rswinkle / oglsuperbible5

Automatically exported from code.google.com/p/oglsuperbible5
0 stars 0 forks source link

Chapter 6: Specular color declared and set in shader but not used #31

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Specular color declared and set in shader but not used: see the vertex shader 
from Chapter 6, example ADSGouraud.

Namely:
uniform vec4 specularColor;

Original issue reported on code.google.com by r45...@gmail.com on 2 Jul 2011 at 12:11

GoogleCodeExporter commented 8 years ago
Same is true for ADSPhong.fp (that is, this time in the fragment shader) from 
same Chapter, example ADSPhong.

Original comment by r45...@gmail.com on 2 Jul 2011 at 12:14

GoogleCodeExporter commented 8 years ago
Probably another issue in these shaders:

// Specular Light
vec3 vReflection = normalize(reflect(-vLightDir, vEyeNormal));
float spec = max(0.0, dot(vEyeNormal, vReflection));
if(diff != 0) { //THIS LINE PROBABLY MUST BE "if(spec != 0) {"
float fSpec = pow(spec, 128.0);
vVaryingColor.rgb += vec3(fSpec, fSpec, fSpec);
}

Original comment by r45...@gmail.com on 2 Jul 2011 at 12:34