[vulkan] Correct the size of cone splats

I really don't know what I was thinking when I wrote that code. Maybe I
was trying for a half angle. Now the rendered "cone" matches up with a
hard-clipped cone light (soft edges stick out a bit).
This commit is contained in:
Bill Currie 2023-08-08 15:07:11 +09:00
parent c99a49a958
commit 44c1ef5968
2 changed files with 2 additions and 2 deletions

View file

@ -35,7 +35,7 @@ main (void)
LightData l = lights[light_index];
float sz = l.attenuation.w > 0 ? 1 / l.attenuation.w : sqrt(abs(l.color.w));
float c = l.direction.w;
float sxy = sz * (c < 0 ? sqrt (c*c * (1 - c*c)) / (0.5 - c) : 1);
float sxy = sz * (c < 0 ? (sqrt (1 - c*c) / -c) : 1);
vec3 scale = vec3 (sxy, sxy, sz);
vec4 q = from_to_rotation (vec3 (0, 0, -1), l.direction.xyz);

View file

@ -35,7 +35,7 @@ main (void)
LightData l = lights[light_index];
float sz = l.attenuation.w > 0 ? 1 / l.attenuation.w : sqrt(abs(l.color.w));
float c = l.direction.w;
float sxy = sz * (c < 0 ? sqrt (c*c * (1 - c*c)) / (0.5 - c) : 1);
float sxy = sz * (c < 0 ? (sqrt (1 - c*c) / -c) : 1);
vec3 scale = vec3 (sxy, sxy, sz);
vec4 q = from_to_rotation (vec3 (0, 0, -1), l.direction.xyz);