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:
authorKevin Dietrich <kevin.dietrich@mailoo.org>2014-04-21 15:15:45 +0400
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2014-04-21 16:44:36 +0400
commit83988b6cdd181fb572b2f4dd078c165a583497fd (patch)
tree800087449391cbe916a2abdc7d4b73fdc6196ca7 /intern/cycles/render/nodes.cpp
parentf55ca54be18199a968bbb9623d8e5d323a55f7ba (diff)
Fix new Cycles UV Map node not working correct for bump mapping.
Reviewed By: brecht Differential Revision: https://developer.blender.org/D475
Diffstat (limited to 'intern/cycles/render/nodes.cpp')
-rw-r--r--intern/cycles/render/nodes.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index 908acb3e6aa..576dcecc18a 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -2360,6 +2360,15 @@ void UVMapNode::compile(SVMCompiler& compiler)
NodeType attr_node = NODE_ATTR;
int attr;
+ if(bump == SHADER_BUMP_DX) {
+ texco_node = NODE_TEX_COORD_BUMP_DX;
+ attr_node = NODE_ATTR_BUMP_DX;
+ }
+ else if(bump == SHADER_BUMP_DY) {
+ texco_node = NODE_TEX_COORD_BUMP_DY;
+ attr_node = NODE_ATTR_BUMP_DY;
+ }
+
if(!out->links.empty()) {
if(from_dupli) {
compiler.stack_assign(out);
@@ -2379,6 +2388,13 @@ void UVMapNode::compile(SVMCompiler& compiler)
void UVMapNode::compile(OSLCompiler& compiler)
{
+ if(bump == SHADER_BUMP_DX)
+ compiler.parameter("bump_offset", "dx");
+ else if(bump == SHADER_BUMP_DY)
+ compiler.parameter("bump_offset", "dy");
+ else
+ compiler.parameter("bump_offset", "center");
+
compiler.parameter("from_dupli", from_dupli);
compiler.parameter("name", attribute.c_str());
compiler.add(this, "node_uv_map");