1
0
Fork 0

Use specular factor of bumpspec map (alpha channel) to modulate reflection factor

This commit is contained in:
Frederic Bouvier 2010-09-21 09:17:07 +02:00
parent d734e32bd5
commit ee8d70b3bf
2 changed files with 6 additions and 6 deletions

View file

@ -39,9 +39,9 @@ void main (void)
float NdotL, NdotHV;
vec4 color = constantColor;
vec4 specular = vec4(0.0);
vec4 ns = texture2D(NormalTex, gl_TexCoord[0].st);
vec3 n = ns.rgb * 2.0 - 1.0;
n = normalize(n.x * VTangent + n.y * VBinormal + n.z * VNormal);
vec4 ns = texture2D(NormalTex, gl_TexCoord[0].st);
vec3 n = ns.rgb * 2.0 - 1.0;
n = normalize(n.x * VTangent + n.y * VBinormal + n.z * VNormal);
NdotL = max(0.0, dot(n, lightDir));
// calculate the specular light
@ -97,7 +97,7 @@ void main (void)
reflFactor = (gl_FrontMaterial.shininess / 128) + transparency_offset;
}
reflFactor = clamp(reflFactor, 0.0, 1.0);
reflFactor = clamp(reflFactor, 0.0, 1.0) * ns.a;
// set ambient adjustment to remove bluiness with user input
float ambient_offset = clamp(ambient_correction, -1.0, 1.0);

View file

@ -5,8 +5,8 @@
varying vec4 rawpos;
varying vec4 ecPosition;
varying vec3 VNormal;
varying vec3 VTangent;//////////////
varying vec3 VBinormal;/////////////
varying vec3 VTangent;
varying vec3 VBinormal;
varying vec3 Normal;
varying vec4 constantColor;
varying vec3 vViewVec;