Commit: 32d348577d69be251aa04110c5f6156cd2645f48
Author: Jens Verwiebe
Date:   Thu Jul 21 00:15:48 2016 +0200
Branches: cycles_disney_brdf
https://developer.blender.org/rB32d348577d69be251aa04110c5f6156cd2645f48

Attempt to fix Disney SSS

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

M       intern/cycles/kernel/svm/svm_closure.h

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

diff --git a/intern/cycles/kernel/svm/svm_closure.h 
b/intern/cycles/kernel/svm/svm_closure.h
index 64a290d..2c04e9c 100644
--- a/intern/cycles/kernel/svm/svm_closure.h
+++ b/intern/cycles/kernel/svm/svm_closure.h
@@ -187,6 +187,13 @@ ccl_device void svm_node_closure_bsdf(KernelGlobals *kg, 
ShaderData *sd, float *
                        float3 weight = sc->weight;
                        float sample_weight = sc->sample_weight;
 
+#ifdef __BSDF_DISNEY_DIFFUSE__
+#  ifndef __SPLIT_KERNEL__
+#    define sc_next(sc) sc++
+#  else
+#    define sc_next(sc) sc = ccl_fetch_array(sd, closure, ccl_fetch(sd, 
num_closure))
+#  endif
+
                        /* subsurface */
                        float3 albedo = baseColor;
                        float3 subsurf_weight = baseColor * sc->weight * 
mix_weight * subsurface * diffuse_weight;
@@ -215,6 +222,7 @@ ccl_device void svm_node_closure_bsdf(KernelGlobals *kg, 
ShaderData *sd, float *
                                        ccl_fetch(sd, flag) |= bssrdf_setup(sc, 
(ClosureType)CLOSURE_BSSRDF_BURLEY_ID);
 
                                        ccl_fetch(sd, num_closure)++;
+                                       sc_next(sc);
                                }
 
                                if (fabsf(subsurf_weight.y) > 0.0f) {
@@ -233,6 +241,7 @@ ccl_device void svm_node_closure_bsdf(KernelGlobals *kg, 
ShaderData *sd, float *
                                        ccl_fetch(sd, flag) |= bssrdf_setup(sc, 
(ClosureType)CLOSURE_BSSRDF_BURLEY_ID);
 
                                        ccl_fetch(sd, num_closure)++;
+                                       sc_next(sc);
                                }
 
                                if (fabsf(subsurf_weight.z) > 0.0f) {
@@ -251,9 +260,12 @@ ccl_device void svm_node_closure_bsdf(KernelGlobals *kg, 
ShaderData *sd, float *
                                        ccl_fetch(sd, flag) |= bssrdf_setup(sc, 
(ClosureType)CLOSURE_BSSRDF_BURLEY_ID);
 
                                        ccl_fetch(sd, num_closure)++;
+                                       sc_next(sc);
                                }
                        }
 
+#endif // __BSDF_DISNEY_DIFFUSE__
+
                        /* diffuse */
                        if (metallic < 1.0f) {
                                if (ccl_fetch(sd, num_closure) < MAX_CLOSURE) {

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to