diff options
author | Kevin Dietrich <kevin.dietrich@mailoo.org> | 2014-04-21 15:15:45 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2014-04-21 16:44:36 +0400 |
commit | 83988b6cdd181fb572b2f4dd078c165a583497fd (patch) | |
tree | 800087449391cbe916a2abdc7d4b73fdc6196ca7 /intern/cycles/kernel | |
parent | f55ca54be18199a968bbb9623d8e5d323a55f7ba (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/kernel')
-rw-r--r-- | intern/cycles/kernel/shaders/node_uv_map.osl | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/intern/cycles/kernel/shaders/node_uv_map.osl b/intern/cycles/kernel/shaders/node_uv_map.osl index fd039beaee8..01c984aff4c 100644 --- a/intern/cycles/kernel/shaders/node_uv_map.osl +++ b/intern/cycles/kernel/shaders/node_uv_map.osl @@ -17,18 +17,29 @@ #include "stdosl.h" shader node_uv_map( - string name = "", int from_dupli = 0, + string name = "", + string bump_offset = "center", output point UV = point(0.0, 0.0, 0.0)) - { if (from_dupli) { getattribute("geom:dupli_uv", UV); } else { - if (name == "") - getattribute("geom:uv", UV); - else - getattribute(name, UV); + if (name == "") + getattribute("geom:uv", UV); + else + getattribute(name, UV); + } + + if (bump_offset == "dx") { + if (!from_dupli) { + UV += Dx(UV); + } + } + else if (bump_offset == "dy") { + if (!from_dupli) { + UV += Dy(UV); + } } } |