I want to multiply the light diffuse contribution with texture
not sure how i`m go over the coordinates of that texture.
How would I define the uv ?
diffuseSum *= texture(speckle,uv);
Update:
Keith Lostracco
You need to pass your UV attributes from the vertex shader to the pixel shader. If you convert a Phong shader with a color map it will have the appropriate code.
[code]for (int i = 0; i < TD_NUM_LIGHTS; i++)
{
vec3 diffuseContrib = vec3(0);
vec3 specularContrib = vec3(0);
TDLighting(diffuseContrib,
specularContrib,
i,
iVert.worldSpacePos.xyz,
normal,
uShadowStrength, uShadowColor,
viewVec,
uShininess);
diffuseSum += diffuseContrib;
if (i == 0) {
diffuseSum *= texture(speckle,sUV.st);
}
specularSum += specularContrib;
}[/code]