opengl.shaders.lighting: Work around problem with specular highlighting.
This commit is contained in:
@@ -67,14 +67,15 @@ apply_Light (light Light,
|
||||
float diffuse_Coefficient = max (0.0,
|
||||
dot (Normal,
|
||||
Surface_to_Light));
|
||||
|
||||
vec3 Diffuse = diffuse_Coefficient * lit_surface_Color;
|
||||
float specular_Coefficient = 0.0;
|
||||
|
||||
|
||||
if (diffuse_Coefficient > 0.0)
|
||||
{
|
||||
specular_Coefficient = pow (max (0.0,
|
||||
dot (Surface_to_Camera,
|
||||
specular_Coefficient = pow (max (0.01, // Using '0.0' produces wierd results when
|
||||
dot (Surface_to_Camera, // light shines directly on a flat surface.
|
||||
reflect (-Surface_to_Light,
|
||||
Normal))),
|
||||
frag_Shine);
|
||||
|
||||
Reference in New Issue
Block a user