cmtanko
Member
|
Animating UVs ?
Hi Everyone,
Can I animate/pan the UV map(texture) with parameter like Horizontally / vertically / speed ??
How can I do that ?
Thanks
|
|
04-28-2013 04:21 AM |
|
Scarlet Thread
Member
|
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 |
|
Pixel Perfect
Member
|
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 |
|
Tottel
Member
|
RE: Animating UVs ?
What Scarlet said. A custom shader is THE choice to get this effect.
|
|
04-28-2013 11:55 AM |
|
Esenthel
Administrator
|
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 |
|