Trying to create a non static texture

I’m currently developing a clone of the boardGame “full metal planet”.

I’ve progressed a little bit, and have now a stackable theme structure, allowing to get different looks for the game. I now would like one of my hex (water) to get a “moving” texture,ie a non-static one.

I was thinking initially to modify the UV of the mesh, but since all hex of the map share the same mesh, this is not going to work. I’m thinking of changing this to one mesh / terrain type, with separated buffer.

Another possibility would be to change the texture of the material during update. i’ll have to think about this one, since several materials could be defined with such moving texture.

Is there any other possibility ? and if not, would the first or the second solution be a better one ?


From worst to best performance:
-rebuilding the texture (the very worst performance)
-rebuilding the texture coordinates
-modifying the material to support a texture coordinate offset parameter

The middle one seems like the easiest/best if you’ve never modified a shader before. Both the second and third version will require a different material for your animated texture.

…the third version could even do it with the built in g_Time parameter without requiring another uniform if your animation is simple.

thanks for the infos. I think i’ll go for the second, since i never even looked at a shader :slight_smile:

A question, however. You said the second solution (rebuilding texture coordinate) required different material for the animated texture. This is not a problem, since this is already the case. But why is this so, if I change the uv coordinate in the mesh buffer ? the material is only affected at the geometry level, no ?

Yeah, having a separate mesh just means you won’t have to skip all of the texture coordinates that wouldn’t change. My brain optimized that part but forgot to mention why.