Fix missing Jacobian in rect area light pdf when in volume segment

This commit is contained in:
Weizhen Huang 2023-05-12 22:40:02 +02:00 • committed by Weizhen Huang
parent 078b2d7174
commit 9870d8fd27

View file

@ -328,7 +328,7 @@ ccl_device_inline bool area_light_sample(const ccl_global KernelLight *klight,
ls->D, ls->Ng, klight->area.tan_half_spread, klight->area.normalize_spread);
}
if (!sample_rectangle && klight->area.tan_half_spread > 0) {
if (in_volume_segment || (!sample_rectangle && klight->area.tan_half_spread > 0)) {
ls->pdf *= lamp_light_pdf(Ng, -ls->D, ls->t);
}