Extending sh.passthrudim.vp

artoo's icon

I am working on some shaders that sample multiple textures, but i'm not sure of the correct syntax to extend sh.passthrudim.vp

I can see where in need to add lines etc. and i've updated number identifiers asbest i can but it stilldoesnt seem to work. Have i done it correctly?

varying vec2 texcoord0;
varying vec2 texcoord1;
varying vec2 texcoord2;
varying vec2 texcoord3;
varying vec2 texcoord4;
varying vec2 texcoord5;
varying vec2 texdim0;
varying vec2 texdim1;
varying vec2 texdim3;
varying vec2 texdim3;
varying vec2 texdim4;
varying vec2 texdim5;
varying vec2 texorient0;
varying vec2 texorient1;
varying vec2 texorient2;
varying vec2 texorient3;
varying vec2 texorient4;
varying vec2 texorient5;

void main()
{
// perform standard transform on vertex
gl_Position = ftransform();

// transform texcoords
texcoord0 = vec2(gl_TextureMatrix[0] * gl_MultiTexCoord0);
texcoord1 = vec2(gl_TextureMatrix[1] * gl_MultiTexCoord1);
texcoord2 = vec2(gl_TextureMatrix[2] * gl_MultiTexCoord2);
texcoord3 = vec2(gl_TextureMatrix[3] * gl_MultiTexCoord3);
texcoord4 = vec2(gl_TextureMatrix[4] * gl_MultiTexCoord4);
texcoord5 = vec2(gl_TextureMatrix[5] * gl_MultiTexCoord5);
// extract the x and y scalars from the texture matrix to determine dimensions
texdim0 = vec2 (abs(gl_TextureMatrix[0][0][0]),abs(gl_TextureMatrix[0][1][1]));
texdim1 = vec2 (abs(gl_TextureMatrix[1][0][0]),abs(gl_TextureMatrix[1][1][1]));
texdim2 = vec2 (abs(gl_TextureMatrix[2][0][0]),abs(gl_TextureMatrix[2][1][1]));
texdim3 = vec2 (abs(gl_TextureMatrix[3][0][0]),abs(gl_TextureMatrix[3][1][1]));
texdim4 = vec2 (abs(gl_TextureMatrix[4][0][0]),abs(gl_TextureMatrix[4][1][1]));
texdim5 = vec2 (abs(gl_TextureMatrix[5][0][0]),abs(gl_TextureMatrix[5][1][1]));
// extract the sign for orientation
texorient0 = vec2 (gl_TextureMatrix[0][0][0]/texdim0.x,gl_TextureMatrix[0][1][1]/texdim0.y);
texorient1 = vec2 (gl_TextureMatrix[1][0][0]/texdim1.x,gl_TextureMatrix[1][1][1]/texdim1.y);
texorient2 = vec2 (gl_TextureMatrix[2][0][0]/texdim2.x,gl_TextureMatrix[2][1][1]/texdim2.y);
texorient3 = vec2 (gl_TextureMatrix[3][0][0]/texdim3.x,gl_TextureMatrix[3][1][1]/texdim3.y);
texorient4 = vec2 (gl_TextureMatrix[4][0][0]/texdim4.x,gl_TextureMatrix[4][1][1]/texdim4.y);
texorient5 = vec2 (gl_TextureMatrix[5][0][0]/texdim5.x,gl_TextureMatrix[5][1][1]/texdim5.y);
}

artoo's icon

Bump! Can anyone confirm whether I have got this right?

Rob Ramirez's icon

looks right to me. what are you trying to do and what's not working? post a patch if you need help.