Hi all,
I realize this might be an impossible task, but then again, it might be a possible one!
First, I am locked to OpenGLES 1.0 for technical reasons at my company. I realize doing it with a shader would be simple, but unless I want to announce that I'm going to be rewriting the whole core graphical section of the company framework (for which I will get fired), I have to do it some other way.
So here's the issue:
We have a model, all UV'd.
We have some skins of the model baked onto a texture atlas.
At load time, the model gets its UVs adjusted to fit the texture on the atlas so it draws well. Like, we literally have a function that takes UV's in the range of 0-1 and adjusts them to the texture's position on the atlas.
Here's my problem:
I want a way to, on the fly, move those UV's over to another place on the atlas. Because the skins that are backed on the atlas are all the same size, it would be sufficient to simply transform the UV's-- they don't need to be resized or recomputer.
But, because UV's are baked to the XYZ position (a featured designed by a madman), I would literally be stuck either making a whole new model with the UV coordinates, or changing the UV's on the fly.
Because this routine needs to be used to populate a screen that could have a lot of versions of the same object with different skins, both of those objects are prohibitive-- I'd need about a hundred models at worst, or I'd need to manually change the UV's a hundred times.
Since the target is mobile, no good!
So: does there exist some sort of call you can make to translate the texture coordinates before drawing a primitive? Sort of the way you'd set the world matrix to move your model, except for texture coordinates? Answer accepted for either DirectX or OpenGL.
Thanks!
John