diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-12-02 01:13:19 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-12-02 01:13:19 +0300 |
commit | e82876589f81961f42ee7f858b15d3b662c1c6b0 (patch) | |
tree | 3f67f7a5769b9931a4636ad661b61934346bb0ac /intern/cycles | |
parent | 70502578b1d2849a3f8477dd574ffd98328c3a50 (diff) |
Cycles: Fix wrong SSS on scaled instanced objects
Was a mistake on searching refined position form ray and hit distance.
Remember kids: SSS distance is in the object space!
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/kernel/kernel_subsurface.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/intern/cycles/kernel/kernel_subsurface.h b/intern/cycles/kernel/kernel_subsurface.h index e2d195a6ffe..27a341aa37a 100644 --- a/intern/cycles/kernel/kernel_subsurface.h +++ b/intern/cycles/kernel/kernel_subsurface.h @@ -292,7 +292,10 @@ ccl_device int subsurface_scatter_multi_intersect( for(int hit = 0; hit < num_eval_hits; hit++) { /* Quickly retrieve P and Ng without setting up ShaderData. */ - float3 hit_P = ray->P + ss_isect->hits[hit].t * ray->D; + float3 hit_P = triangle_refine_subsurface(kg, + sd, + &ss_isect->hits[hit], + ray); float3 hit_Ng = ss_isect->Ng[hit]; if(ss_isect->hits[hit].object != OBJECT_NONE) { object_normal_transform(kg, sd, &hit_Ng); |