Thanks.
Would I be correct in saying (textures already loaded and display correctly):
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, basetex);
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, dot3tex);
glActiveTexture(GL_TEXTURE2);
glBindTexture(GL_TEXTURE_2D, glosstex);
and then passing them to this normal mapping shader like this:
Vertex:
!!ARBvp1.0
OPTION ARB_position_invariant;
PARAM modelViewTranspose[4] = { state.matrix.modelview.transpose};
PARAM cameraPosition = program.env[0];
PARAM scale = {1.0};
TEMP lightPosObjSpace, cameraPosObjSpace;
TEMP viewVector , lightVector, temp;
TEMP tangent, binormal;
MUL tangent , vertex.texcoord[1], scale.x;
MUL binormal, vertex.texcoord[2], scale.x;
DP3 lightPosObjSpace.x, modelViewTranspose[0], state.light[0].position;
DP3 lightPosObjSpace.y, modelViewTranspose[1], state.light[0].position;
DP3 lightPosObjSpace.z, modelViewTranspose[2], state.light[0].position;
SUB temp, lightPosObjSpace, vertex.position;
DP3 lightVector.x, temp, tangent;
DP3 lightVector.y, temp, binormal;
DP3 lightVector.z, temp, vertex.normal;
DP3 cameraPosObjSpace.x, modelViewTranspose[0], cameraPosition;
DP3 cameraPosObjSpace.y, modelViewTranspose[1], cameraPosition;
DP3 cameraPosObjSpace.z, modelViewTranspose[2], cameraPosition;
SUB temp, cameraPosObjSpace, vertex.position;
DP3 viewVector.x, temp, tangent;
DP3 viewVector.y, temp, binormal;
DP3 viewVector.z, temp, vertex.normal;
MOV result.texcoord[0], vertex.texcoord[0];
MOV result.texcoord[1], lightVector;
MOV result.texcoord[2], viewVector;
END
Fragment:
!!ARBfp1.0
# Light parameters
PARAM specularColor = state.light[0].specular;
PARAM ambientColor = state.material.ambient;
PARAM diffuseColor = state.material.diffuse;
PARAM shininess = state.material.shininess;
TEMP textureBase, normalVector, lightVector;
TEMP reflectionVector, viewVector;
TEMP NdotL, RdotL, Falloff, temp, textureGloss;
TEX textureBase , fragment.texcoord[0], texture[0], 2D;
MUL RdotL, textureBase.a, RdotL;
TEX normalVector, fragment.texcoord[0], texture[1], 2D;
TEX textureGloss, fragment.texcoord[0], texture[2], 2D;
MAD normalVector , normalVector , 2.0, -1.0;
DP3 normalVector.w, normalVector , normalVector;
RSQ normalVector.w, normalVector.w;
MUL normalVector , normalVector , normalVector.w;
MOV lightVector, fragment.texcoord[1];
MUL Falloff, lightVector, state.light[0].attenuation.z;
DP3 Falloff, Falloff, Falloff;
SUB_SAT Falloff, 1.0, Falloff;
DP3 lightVector.w, lightVector, lightVector;
RSQ lightVector.w, lightVector.w;
MUL lightVector, lightVector, lightVector.w;
MOV viewVector, fragment.texcoord[2];
DP3 viewVector.w, viewVector, viewVector;
RSQ viewVector.w, viewVector.w;
MUL viewVector, viewVector, viewVector.w;
DP3 reflectionVector, normalVector, viewVector;
ADD reflectionVector, reflectionVector, reflectionVector;
MAD reflectionVector, reflectionVector, normalVector, -viewVector;
DP3 reflectionVector.w, reflectionVector, reflectionVector;
RSQ reflectionVector.w, reflectionVector.w;
MUL reflectionVector, reflectionVector, reflectionVector.w;
DP3_SAT RdotL, reflectionVector, lightVector;
POW RdotL, RdotL.x, shininess.x;
MUL RdotL, textureBase.a, RdotL;
MUL RdotL, specularColor, RdotL;
MUL RdotL, RdotL, textureGloss;
DP3_SAT NdotL, normalVector, lightVector;
MUL NdotL, Falloff, NdotL;
MUL RdotL, NdotL, RdotL;
MUL NdotL, diffuseColor , NdotL;
ADD textureBase, ambientColor, textureBase;
MAD result.color.rgb, textureBase, NdotL, RdotL;
END
Apparently not, because I am getting a black screen… And I know my shader setup is correct because it works with other shaders written in ARB.