What's the proper way to send a texture matrix to the vertex shader and access it? I have, say, a few nodes sharing a vertex buffer, ( with different indices, for LOD/tesselation), so I need to translate the texture so that it appears to cover multiple nodes.
I want to do something like this, no? I'm having trouble getting it to work, texture isn't modified at all.
Render:
Code: Select all
matrix4 tex;
tex.buildTextureTransform(0.0,vector2df(0,0),vector2df(X_Offset,Y_Offset),vector2df(2,2));
driver->setTransform(video::ETS_TEXTURE_0, tex );
Code: Select all
core::matrix4 T = driver->getTransform(video::ETS_TEXTURE_0);
services->setVertexShaderConstant("T", T.pointer(), 16);
Code: Select all
uniform mat4 T;
void main(void)
{
...
gl_TexCoord[0] = T * gl_MultiTexCoord0;
}