Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vec4 calcSpotLight(SpotLight spotLight, vec3 normal){
- vec3 lightDirection = normalize(worldPos0 - spotLight.point.pos);
- float spotFactor = dot(lightDirection, spotLight.direction);
- vec4 color = vec4(0,0,0,0);
- if (spotFactor > spotLight.cutoff){
- color = calcPointLight(spotLight.point, normal) *
- (1.0 - ((1.0 - spotFactor)/(1.0 - spotLight.cutoff)));
- }
- return color;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement