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
diff options
context:
space:
mode:
authorStefan Werner <swerner@smithmicro.com>2015-07-16 09:31:02 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-07-16 09:33:13 +0300
commit51385f6fe8e85aaed8a77d0314c15f8bdd0ef545 (patch)
treef92b7c0f7734cbcc82438a982d2620490b5a14d1 /intern/cycles/kernel/kernel_light.h
parentb00c49838a4d60f1f1469eedd7580fdb919c1caa (diff)
Fix T45447: Area light importance sampling improvement
Turning on importance sampling on area lights increases noise on diffuse surfaces. This was caused by PDF calculated for an intersected point on light instead of original light position. Patch by Stefan with some own modifications.
Diffstat (limited to 'intern/cycles/kernel/kernel_light.h')
-rw-r--r--intern/cycles/kernel/kernel_light.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/intern/cycles/kernel/kernel_light.h b/intern/cycles/kernel/kernel_light.h
index 1badbc3b9f7..24d4b01302c 100644
--- a/intern/cycles/kernel/kernel_light.h
+++ b/intern/cycles/kernel/kernel_light.h
@@ -728,15 +728,15 @@ ccl_device bool lamp_light_eval(KernelGlobals *kg, int lamp, float3 P, float3 D,
if(dot(D, Ng) >= 0.0f)
return false;
- ls->P = make_float3(data0.y, data0.z, data0.w);
+ float3 light_P = make_float3(data0.y, data0.z, data0.w);
if(!ray_quad_intersect(P, D, t,
- ls->P, axisu, axisv, &ls->P, &ls->t))
+ light_P, axisu, axisv, &ls->P, &ls->t))
return false;
ls->D = D;
ls->Ng = Ng;
- ls->pdf = area_light_sample(P, &ls->P, axisu, axisv, 0, 0, false);
+ ls->pdf = area_light_sample(P, &light_P, axisu, axisv, 0, 0, false);
ls->eval_fac = 0.25f*invarea;
}
else