Refactor: flatten light tree in recursive function #107560
|
@ -1077,8 +1077,8 @@ void LightManager::device_update_lights(Device *device, DeviceScene *dscene, Sce
|
|||
float invarea = (light->normalize && area != 0.0f) ? 1.0f / area : 1.0f;
|
||||
float3 dir = light->dir;
|
||||
|
||||
/* Clamp angles in (0, 0.1) to 0.1 to prevent zero intensity due to floating-point
|
||||
* precision issues, but still handles spread = 0 */
|
||||
/* Clamp angles in (0, 0.1) to 0.1 to prevent zero intensity due to floating-point precision
|
||||
* issues, but still handles spread = 0 */
|
||||
const float min_spread = 0.1f * M_PI_F / 180.0f;
|
||||
const float half_spread = light->spread == 0 ? 0.0f : 0.5f * max(light->spread, min_spread);
|
||||
const float tan_half_spread = light->spread == M_PI_F ? FLT_MAX : tanf(half_spread);
|
||||
|
|
Loading…
Reference in New Issue