Where speccolor is gotten from this:
// final color gl_FragColor = gl_FrontMaterial.emission; gl_FragColor += gl_LightModel.ambient * gl_FrontMaterial.ambient; gl_FragColor += attenuation * spotlight * (gl_FrontLightProduct.ambient + (diffuse * gl_FrontLightProduct.diffuse) + (specular * gl_FrontMaterial.shi niness * speccolor)); gl_FragColor *= texcolor;
I'm putting the half vector into tangent space:
// get the specular color vec4 speccolor = texture2D(specmap, vec2(gl_TexCoord)) * gl_LightSource.specular;
But, I think I've got a problem in that I don't know if the half-vector starts in object or eye space (I think eye space, which would mean I'm not actually putting it into tangent space). I'm also not sure if I'm applying the specular map correctly (I can't find any GLSL tutorials or non-grayscale tutorials at the moment). I'm also not sure of what to set the shininess factor to since it's not encoded in the specular map. I guess I'm basically asking for any advice or links I can get. I don't see this being as hard to figure out as normal maps, I just don't know if I'm on exactly the right track yet.
H = normalize(tbn * gl_LightSource.halfVector.xyz);