Fixed bug with un-normalised ellipse area lights not having proper area calculation and erroneously reverting to quad lights. #4
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user