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:
authorDaniel Salazar <zanqdo@gmail.com>2011-06-20 00:41:41 +0400
committerDaniel Salazar <zanqdo@gmail.com>2011-06-20 00:41:41 +0400
commitdd364944d11bfbe2c2e9441a16602f7004fbdfd4 (patch)
treee189de375faae018646e671e875bfb045b58c342 /source/blender/render
parentb1b8284f9bc85419701467d001e6310fbba09722 (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')
-rw-r--r--source/blender/render/intern/source/render_texture.c6
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);
+ }
}