Fix T37790: OSL not rendering subsurface scattering color correct since upgrade to...
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 18 Dec 2013 11:29:11 +0000 (12:29 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 18 Dec 2013 11:29:11 +0000 (12:29 +0100)
intern/cycles/kernel/osl/osl_shader.cpp

index f2be61eb5351c79e858a4d0c568a7306f4ee7909..b0461013239f4a8f3a38837c6c0ca815027d42a0 100644 (file)
@@ -150,11 +150,11 @@ static void flatten_surface_closure_tree(ShaderData *sd, int path_flag,
 
                if (prim) {
                        ShaderClosure sc;
+
 #ifdef OSL_SUPPORTS_WEIGHTED_CLOSURE_COMPONENTS
-                       sc.weight = weight*TO_FLOAT3(comp->w);
-#else
-                       sc.weight = weight;
+                       weight = weight*TO_FLOAT3(comp->w);
 #endif
+                       sc.weight = weight;
 
                        prim->setup();
 
@@ -391,11 +391,11 @@ static void flatten_volume_closure_tree(ShaderData *sd,
 
                if (prim) {
                        ShaderClosure sc;
+
 #ifdef OSL_SUPPORTS_WEIGHTED_CLOSURE_COMPONENTS
-                       sc.weight = weight*TO_FLOAT3(comp->w);
-#else
-                       sc.weight = weight;
+                       weight = weight*TO_FLOAT3(comp->w);
 #endif
+                       sc.weight = weight;
 
                        prim->setup();