diff --git a/src/scene/light.cpp b/src/scene/light.cpp index df0d894d4..2cbbfbca4 100644 --- a/src/scene/light.cpp +++ b/src/scene/light.cpp @@ -1044,11 +1044,11 @@ void LightManager::device_update_lights(Device *device, DeviceScene *dscene, Sce float len_u, len_v; float3 axis_u = normalize_len(extentu, &len_u); float3 axis_v = normalize_len(extentv, &len_v); - float area = len_u * len_v; + float area = light->normalize ? len_u * len_v : 1.0f; if (light->ellipse) { area *= -M_PI_4_F; } - float invarea = (light->normalize && area != 0.0f) ? 1.0f / area : 1.0f; + float invarea = (light->normalize && area != 0.0f) ? 1.0f / area : area; float3 dir = light->dir; /* Clamp angles in (0, 0.1) to 0.1 to prevent zero intensity due to floating-point precision