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
path: root/source
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2010-02-15 19:45:45 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2010-02-15 19:45:45 +0300
commit9bd50214d343ad09ca42354f2f626a436cb36a06 (patch)
tree07c360edb9710cc9c584e7b4dca03fa32a141930 /source
parentb3d41ac144b7a72bc1bcdd3955085a57f7eb3cb3 (diff)
Fix artifacts in bump map render with Object coordinates. Float precision
is problematic here with coordinates being transform by matrix and back by inverse, so tweaked the epsilons to avoid the problem.
Diffstat (limited to 'source')
-rw-r--r--source/blender/render/intern/source/texture.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c
index 8899812fe50..67b4b4cf9b4 100644
--- a/source/blender/render/intern/source/texture.c
+++ b/source/blender/render/intern/source/texture.c
@@ -1881,7 +1881,7 @@ void do_material_tex(ShadeInput *shi)
// for the uv case, use the same value for both du/dv,
// since individually scaling the normal derivatives makes them useless...
du = MIN2(du, dv);
- idu = (du < 1e-6f) ? bf : (bf/du);
+ idu = (du < 1e-5f) ? bf : (bf/du);
// +u val
tco[0] = co[0] + dudnu*du;
@@ -1902,8 +1902,8 @@ void do_material_tex(ShadeInput *shi)
else {
float tu[3] = {nu[0], nu[1], nu[2]}, tv[3] = {nv[0], nv[1], nv[2]};
- idu = (du < 1e-6f) ? bf : (bf/du);
- idv = (dv < 1e-6f) ? bf : (bf/dv);
+ idu = (du < 1e-5f) ? bf : (bf/du);
+ idv = (dv < 1e-5f) ? bf : (bf/dv);
if ((mtex->texco == TEXCO_ORCO) && shi->obr && shi->obr->ob) {
mul_mat3_m4_v3(shi->obr->ob->imat, tu);