We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9759a12 commit 5d8de78Copy full SHA for 5d8de78
src/flitter/render/window/glsl/standard_lighting.frag
@@ -130,11 +130,12 @@ void main() {
130
passes = 2;
131
attenuation = clamp(1.0 - (light_radius / light_distance), 0.0, 1.0);
132
if (pass == 0) {
133
- light_distance = max(0.0, light_distance - light_radius*0.99);
+ light_distance -= min(light_radius, light_distance*0.99);
134
} else {
135
vec3 R = reflect(V, N);
136
vec3 l = dot(L, R) * R - L;
137
L += l * min(0.99, light_radius/length(l));
138
+ light_distance = length(L);
139
}
140
141
L = normalize(L);
0 commit comments