Advertisement
Guest User

Untitled

a guest
Oct 19th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. vec4 hemisphereLightSubroutine(vec4 N, vec4 worldPosition, vec3 worldNormal)
  2. {
  3. return vec4(0);
  4. vec4 c_ground = genericLight.diffuseColor;
  5. vec4 c_sky = genericLight.specularColor;
  6.  
  7. vec4 c_diff = (1.0 - material.matMetallic) * fragmentColor;
  8. vec4 d = c_diff / PI;
  9.  
  10. vec4 c_light = mix(c_ground, c_sky, clamp(N.y*0.5 + 0.5, 0, 1));
  11. vec4 L = N;
  12.  
  13. return max(0, dot(N,L)) * d * c_light;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement