mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
[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:
parent
c99a49a958
commit
44c1ef5968
2 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue