Skip to content

Commit

Permalink
Skip specular term for ambient lights
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Mott committed Jul 25, 2021
1 parent 31d1c02 commit b099c7d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions install/gl/interaction_fp.glsl
Expand Up @@ -33,7 +33,7 @@ uniform float u_light_scale;
// Invert vertex colour
uniform bool uInvertVCol;

// Activate ambbient light mode (brightness unaffected by direction)
// Activate ambient light mode (brightness unaffected by direction)
uniform bool uAmbientLight;

varying vec3 var_vertex;
Expand Down Expand Up @@ -83,7 +83,8 @@ void main()

// compute final color
gl_FragColor = diffuse * (uInvertVCol ? vec4(1.0, 1.0, 1.0, 1.0) - gl_Color : gl_Color);
gl_FragColor.rgb += specular;
if (!uAmbientLight)
gl_FragColor.rgb += specular;
gl_FragColor.rgb *= attenuation_xy;
gl_FragColor.rgb *= attenuation_z;
}
Expand Down

0 comments on commit b099c7d

Please sign in to comment.