Varying texture offset for very basic animation

jME 2 seems to have had something called a TextureKeyframeController which I think would allow you to constantly offset a texture to give a basic “flowing” effect, is there similar functionality in jME 3? It doesn’t appear to be in version 3 at all - is that because we’re supposed to do this in a shader?

Yeah you are supposed to do this in a shader, you could also change the texture coordinates of the mesh dynamically.

Yep, that’s how I did it (shader):



vec4 riv = texture2D(m_riverTex, vec2(texCoord.x * m_riverScale, (texCoord.y - mod(g_Time, 512) / 300) * m_riverScale));

2 Likes

@tebriel , can you show how your shader works? I’m interested in it.

video or screenshot?





I collect some shaders here: http://code.google.com/p/jme-glsl-shaders/