diff options
author | Daniel Salazar <zanqdo@gmail.com> | 2011-06-20 00:41:41 +0400 |
---|---|---|
committer | Daniel Salazar <zanqdo@gmail.com> | 2011-06-20 00:41:41 +0400 |
commit | dd364944d11bfbe2c2e9441a16602f7004fbdfd4 (patch) | |
tree | e189de375faae018646e671e875bfb045b58c342 /source/blender/render/intern | |
parent | b1b8284f9bc85419701467d001e6310fbba09722 (diff) |
By Morten S. Mikkelsen; this adds support for tangent bump shading
left: legacy bump, righ: sparkybump
http://pasteall.org/pic/show.php?id=13875
bugs [#26320], [#27506]
there's still an issue with texture OSA as you can see
Diffstat (limited to 'source/blender/render/intern')
-rw-r--r-- | source/blender/render/intern/source/render_texture.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c index c4587b83fcd..f0c39964d5a 100644 --- a/source/blender/render/intern/source/render_texture.c +++ b/source/blender/render/intern/source/render_texture.c @@ -2620,6 +2620,12 @@ void do_material_tex(ShadeInput *shi) } } } + if ((use_compat_bump || use_ntap_bump) && (shi->mat->mode & MA_TANGENT_V)!=0) { + const float fnegdot = -dot_v3v3(shi->vn, shi->tang); + // apply Gram-Schmidt projection + madd_v3_v3fl(shi->tang, shi->vn, fnegdot); + normalize_v3(shi->tang); + } } |