Fixed bug with un-normalised ellipse area lights not having proper area calculation and erroneously reverting to quad lights. #4

Closed
Alex Fuller wants to merge 1 commits from boberfly/cycles:fixes/ellipse_unnormalize_bug into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Showing only changes of commit bc6e0484ab - Show all commits

View File

@ -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