Dnurrr

Untitled

Jan 26th, 2025
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Lights
  2. {
  3.     struct Light
  4.     {
  5.         vec3 position;
  6.         vec3 color;
  7.         float intensity;
  8.     };
  9.  
  10.     // Example
  11.     vec3 ProcessLights(vec3 color, vec3 normal, vec3 position, Light l)
  12.     {
  13.         vec3 lightDir = normalize(l.position - position);
  14.         float diff = max(dot(normal, lightDir), 0.0);
  15.         vec3 diffuse = diff * l.color * l.intensity;
  16.  
  17.         return color * diffuse;
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment