Scroll screenspace texture with CustomMaterial

So I have this shader that scrolls a screenspace texture in the y direction:

https://www.babylonjs-playground.com/#LXZPJK#292

But when I apply this to customMaterial, the texture won’t scroll.

https://www.babylonjs-playground.com/#UXCB15#74

Does anyone know what I’m doing wrong?

Small mistake:

material.getEffect().setFloat('time', u_time);

should be:

material.getEffect().setFloat('u_time', u_time);

https://www.babylonjs-playground.com/#UXCB15#75

3 Likes

Thanks for finding the mistake Evgeni :smiley: :smiley: