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
path: root/intern
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-09-10 01:52:26 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-09-10 01:52:26 +0400
commit04316efc4a41a2d0427305b2655a8698713301a3 (patch)
treea9475d793ac4b14bfbf76359addd2d464090531a /intern
parent1bbc432eadff001f2952a4ed1aa08f7d82904d8a (diff)
Cycles OSL: update to build with latest OSL master branch.
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/kernel/osl/osl_shader.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/intern/cycles/kernel/osl/osl_shader.cpp b/intern/cycles/kernel/osl/osl_shader.cpp
index 3c057f2b968..9ff3797b50f 100644
--- a/intern/cycles/kernel/osl/osl_shader.cpp
+++ b/intern/cycles/kernel/osl/osl_shader.cpp
@@ -150,7 +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;
+#endif
switch (prim->category()) {
case OSL::ClosurePrimitive::BSDF: {
@@ -327,7 +331,11 @@ static float3 flatten_background_closure_tree(const OSL::ClosureColor *closure)
OSL::ClosurePrimitive *prim = (OSL::ClosurePrimitive *)comp->data();
if (prim && prim->category() == OSL::ClosurePrimitive::Background)
+#ifdef OSL_SUPPORTS_WEIGHTED_CLOSURE_COMPONENTS
+ return TO_FLOAT3(comp->w);
+#else
return make_float3(1.0f, 1.0f, 1.0f);
+#endif
}
else if (closure->type == OSL::ClosureColor::MUL) {
OSL::ClosureMul *mul = (OSL::ClosureMul *)closure;
@@ -379,7 +387,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;
+#endif
switch (prim->category()) {
case OSL::ClosurePrimitive::Volume: {