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
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2017-08-20 04:25:13 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2017-08-20 17:51:53 +0300
commitb5f8063fb9932c36133d2c3ac185b455964f2e98 (patch)
treec84b99f04185e430bfaf45b82d636bf89128e8d3 /intern/cycles/render/nodes.cpp
parent0b07c2c8a254295dfdd3d051c6e84d36a0a3cc30 (diff)
Cycles: support baking normals plugged into BSDFs, averaged with closure weight.
Diffstat (limited to 'intern/cycles/render/nodes.cpp')
-rw-r--r--intern/cycles/render/nodes.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index 90a68a06cb5..689326f9795 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -1845,6 +1845,14 @@ void BsdfNode::compile(OSLCompiler& /*compiler*/)
assert(0);
}
+bool BsdfNode::has_bump()
+{
+ /* detect if anything is plugged into the normal input besides the default */
+ ShaderInput *normal_in = input("Normal");
+ return (normal_in && normal_in->link &&
+ normal_in->link->parent->special_type != SHADER_SPECIAL_TYPE_GEOMETRY);
+}
+
/* Anisotropic BSDF Closure */
NODE_DEFINE(AnisotropicBsdfNode)
@@ -2439,9 +2447,7 @@ void PrincipledBsdfNode::compile(OSLCompiler& compiler)
bool PrincipledBsdfNode::has_bssrdf_bump()
{
- /* detect if anything is plugged into the normal input besides the default */
- ShaderInput *normal_in = input("Normal");
- return (normal_in->link && normal_in->link->parent->special_type != SHADER_SPECIAL_TYPE_GEOMETRY);
+ return has_surface_bssrdf() && has_bump();
}
/* Translucent BSDF Closure */