Offset texture in custom shader

Hi everyone, referring to this example: Custom Shaders | Learn PlayCanvas
How to offset via script the heightmap ?

Thanks for any kind of hint !

vertex shader here adjust (waves) the position of the vertices.
https://playcanvas.github.io/#/graphics/shader-wobble

So something similar, but the offset needs to come from the texture. I’m not sure we have an example of that handy.

1 Like

hi @mvaligursky , thanks for reply, my idea was to offset the noise in order to have “animated cutout”, so even if cutout value is still, the border will be animated, not sure that waving vertex will do the job, do you have any hint or suggestion i can follow to implement offset and tiling for the heightmap ?

thanks

Do you have a reference video/gif of what you are trying to do?

I’m just using that example i linked and i would like to be able to offset heightmap, like I usually do with other textures in materials, cant think of other details to supply…

Sorry, I don’t understand what effect you trying to achieve here.

In this example Custom Shaders | Learn PlayCanvas , it’s applied an heightmap in order to cutout the material, what if i want to offset that texture on its X like usually is done with tiled texture ?

The effect should be that the portion of heightmap applied is different based on this offset, in example with a uTime = 0.5 ( material 50% cutout ), moving the heightmap, we would have a continuosly moving cutout edge.

My question is how to have the heightmap with attributes like tiling and offset ?