mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
[vulkan] Ensure dynamic lights are positional
I'm not sure what's up with the weird lighting that results from dynamic lights being directional (sunlight works nicely in marcher, but it has a unit vector for position).
This commit is contained in:
parent
df5b471342
commit
d60602421b
1 changed files with 4 additions and 2 deletions
|
@ -102,10 +102,12 @@ update_lights (vulkan_ctx_t *ctx)
|
|||
// dynamic lights seem a tad faint, so 16x map lights
|
||||
light_data->lights[i].color[3] = lights[i]->radius / 16;
|
||||
VectorCopy (lights[i]->origin, light_data->lights[i].position);
|
||||
// dlights are local point sources
|
||||
light_data->lights[i].position[3] = 1;
|
||||
light_data->lights[i].attenuation =
|
||||
(vec4f_t) { 0, 0, 1, 1/lights[i]->radius };
|
||||
light_data->lights[i].direction =
|
||||
(vec4f_t) { 0, 0, 1, 1 };
|
||||
// full sphere, normal light (not ambient)
|
||||
light_data->lights[i].direction = (vec4f_t) { 0, 0, 1, 1 };
|
||||
}
|
||||
for (size_t i = 0; (i < ldata->lightvis.size
|
||||
&& light_data->lightCount < MaxLights); i++) {
|
||||
|
|
Loading…
Reference in a new issue