Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorOlivier Maury <omaury>2022-07-14 16:59:26 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-07-14 17:36:38 +0300
commit1b5db02a0207621a0325c0d2ee6f748b2520d2fe (patch)
tree443bdb1fa8730e7967581ee5b1fcd9c1253525f9 /intern
parent28c3739a9bc055b3a3e5ba2f5cfc219f70d64dfa (diff)
Fix Cycles MNEE wrong results with area light spread
When the solve is successful, the light sample needs to be updated since the effective shading point is now on the last refractive interface. Spread was not taken into account, creating false caustics. Differential Revision: https://developer.blender.org/D15449
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/kernel/integrator/mnee.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/intern/cycles/kernel/integrator/mnee.h b/intern/cycles/kernel/integrator/mnee.h
index 67505b9b612..70b009d3b48 100644
--- a/intern/cycles/kernel/integrator/mnee.h
+++ b/intern/cycles/kernel/integrator/mnee.h
@@ -137,8 +137,14 @@ ccl_device_forceinline void mnee_update_light_sample(KernelGlobals kg,
}
}
else if (ls->type == LIGHT_AREA) {
+ float invarea = fabsf(klight->area.invarea);
ls->D = normalize_len(ls->P - P, &ls->t);
- ls->pdf = fabsf(klight->area.invarea);
+ ls->pdf = invarea;
+ if (klight->area.tan_spread > 0.f) {
+ ls->eval_fac = 0.25f * invarea;
+ ls->eval_fac *= light_spread_attenuation(
+ ls->D, ls->Ng, klight->area.tan_spread, klight->area.normalize_spread);
+ }
}
ls->pdf *= kernel_data.integrator.pdf_lights;