Fix T72871 Overlay: Spotlights cone is much smaller than before

This commit is contained in:
Clément Foucault 2020-01-15 14:45:31 +01:00
parent aa3720ed82
commit 3fa548f986
Notes: blender-bot 2023-10-12 12:49:04 +02:00
Referenced by issue #72871, Overlay: 'Show Cone' for Spotlights is much smaller than before
1 changed files with 3 additions and 0 deletions

View File

@ -637,6 +637,9 @@ void OVERLAY_light_cache_populate(OVERLAY_Data *vedata, Object *ob)
DRW_buffer_add_entry(cb->light_sun, color, &instdata);
}
else if (la->type == LA_SPOT) {
/* Previous implementation was using the clipend distance as cone size.
* We cannot do this anymore so we use a fixed size of 10. (see T72871) */
rescale_m4(instdata.mat, (float[3]){10.0f, 10.0f, 10.0f});
/* For cycles and eevee the spot attenuation is
* y = (1/(1 + x^2) - a)/((1 - a) b)
* We solve the case where spot attenuation y = 1 and y = 0