Advertisement
Guest User

Untitled

a guest
May 8th, 2025
5
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. // fragPos is in clip space, lightPos is (2,2,2), and pointDepthMap is a samplerCubemap
  2. float pointShadowCalculation (vec3 fragPos, vec3 lightPos) {
  3. vec3 fragToLight = fragPos - lightPos;
  4. float closestDepth = texture(pointDepthMap, fragToLight).r;
  5. closestDepth *= farPlane;
  6. float currentDepth = length(fragToLight);
  7. float bias = 0.05;
  8. float shadow = currentDepth - bias > closestDepth ? 1.0 : 0.0;
  9. return shadow;
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement