Is there Blender like BumpNode in TSL?

Is there any node in TSL(Three Shading Language) similar to blender’s bump node which could take the height map and convert it to normal?

Thank you

Have you already tried BumpMapNode?

2 Likes

Thanks for the suggestion. The bumpMap node works fine for the textures. But It does not seems to work with the procedural textures such as noise node.

material.normalNode = bumpMap(mx_noise_float(uv().mul(10), 1, 0.5));

Is there any alternative node for this ? Thank you.

Below code should work but it seems BumpMapNode does not support this approach yet.

const noiseSampler = sample( ( uv ) => {

    return mx_noise_float( uv.mul( 10 ), 1, 0.5 );

}, uv() );

material.normalNode = bumpMap( noiseSampler );

Live demo: three.js dev tsl-bumpMap test with procedural textures - JSFiddle - Code Playground

Might be worth filing an issue at GitHub.

3 Likes

Some 15 releases ago I wanted to use procedurally generated bump maps but failed (Bump maps generated by a TSL function · Issue #2 · boytchev/tsl-textures · GitHub). So I decided to emulate them with normal maps. Here are three examples of normal maps making the surface look bumpy, although it is flat like an eggplant:

https://boytchev.github.io/tsl-textures/online/concrete.html
https://boytchev.github.io/tsl-textures/online/water-drops.html
https://boytchev.github.io/tsl-textures/online/rough-clay.html

5 Likes

Sure , I will file a feature request in GitHub.

1 Like

Thank you very much @PavelBoytchev .

I will look into these methods for bumpMap.

1 Like

Issue at GitHub:

2 Likes