Browse Source

I don't think it's needed to multiply by normal length in shader here

render_group_fix
cinnaboot 5 years ago
parent
commit
1e01e4d667
  1. 3
      src/default_shaders.cpp

3
src/default_shaders.cpp

@ -62,7 +62,8 @@ void main()
for (uint i = 0u; i < num_lights; i++) {
vec3 surfaceToLight = lights[i].position - fragPosition;
float brightness = dot(normal, surfaceToLight) / (length(surfaceToLight) * length(normal));
//float brightness = dot(normal, surfaceToLight) / (length(surfaceToLight) * length(normal));
float brightness = dot(normal, surfaceToLight) / length(surfaceToLight);
totalBrightness += brightness;
}

Loading…
Cancel
Save