Skip to content

Instantly share code, notes, and snippets.

@wrr
Created September 11, 2017 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wrr/a50c00de697ef9cb72d01cbea54c056a to your computer and use it in GitHub Desktop.
Save wrr/a50c00de697ef9cb72d01cbea54c056a to your computer and use it in GitHub Desktop.
vec3 lightW = normalize(cameraPosition - vPositionW.xyz);
gl_FragColor.rgb = color * max(dot(normalize(vNormalW), lightW), 0.0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment