About Store Forum Documentation Contact
Donations:
327$/mo



Post Reply 
Animating UVs ?
Author Message
cmtanko Offline
Member

Post: #1
Animating UVs ?
Hi Everyone,
Can I animate/pan the UV map(texture) with parameter like Horizontally / vertically / speed ??
How can I do that ?


Thanks smile
04-28-2013 04:21 AM
Find all posts by this user Quote this message in a reply
gdalex Offline
Member

Post: #2
RE: Animating UVs ?
Would be a nice feature, yes smile
04-28-2013 09:20 AM
Find all posts by this user Quote this message in a reply
Scarlet Thread Offline
Member

Post: #3
RE: Animating UVs ?
Generally when it comes to graphics programming this has to be done in the shaders and not in the code. This is because unbinding data such as UV's held in graphics memory, altering it in the CPU and rebinding it to graphics memory is very very slow.

You could write your own shader. However, I'm a GLSL (OpenGL) man so I caouldn't help you in this regard. For DirectX it's HLSL. Have a look at the custom shaders tutorials.
04-28-2013 10:16 AM
Find all posts by this user Quote this message in a reply
Pixel Perfect Offline
Member

Post: #4
RE: Animating UVs ?
I have done this previously without using shaders by simply manipulating the vertex texture coordinates and it worked really well and had little to no impact on my frame rate. Admittedly I was only using simple quads but a lot of my special effects were based on this technique.

That's something I will need to revisit in this engine when I get round to it, so I don't know what's currently available in terms of functionality for doing this.

Certainly, using a shader as Scarlet suggests is a good solution.
04-28-2013 10:52 AM
Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #5
RE: Animating UVs ?
What Scarlet said. A custom shader is THE choice to get this effect.
04-28-2013 11:55 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
RE: Animating UVs ?
Yes doing this in the shaders is the recommended way.
But if you want simpler way you can try calling texMove, texScale, etc on Meshes
or alternatively lock the MeshRender vtx buffer and perform operations by yourself.
04-29-2013 11:11 AM
Find all posts by this user Quote this message in a reply
Post Reply