[Bf-blender-cvs] [e828765] master: Cycles: Fix wrong SSS on scaled instanced objects

Sergey Sharybin noreply at git.blender.org
Tue Dec 1 23:16:24 CET 2015


Commit: e82876589f81961f42ee7f858b15d3b662c1c6b0
Author: Sergey Sharybin
Date:   Wed Dec 2 03:13:19 2015 +0500
Branches: master
https://developer.blender.org/rBe82876589f81961f42ee7f858b15d3b662c1c6b0

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!

===================================================================

M	intern/cycles/kernel/kernel_subsurface.h

===================================================================

diff --git a/intern/cycles/kernel/kernel_subsurface.h b/intern/cycles/kernel/kernel_subsurface.h
index e2d195a..27a341a 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);




More information about the Bf-blender-cvs mailing list