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:
authorCampbell Barton <ideasman42@gmail.com>2012-01-04 10:20:10 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-01-04 10:20:10 +0400
commitd0cdefd9fa37bf6788dad27b87d8d569c58ad94a (patch)
tree8807f7717662ad96cf6ad1d8df0a5caa12162361 /source/blender/gpu
parent8d8403c15ec8694d7d71d8a9f4a9e3a1fade666e (diff)
parent434c1e6df82a082fe03034a3ad3825f7b50ea533 (diff)
svn merge ^/trunk/blender -r43092:43092
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/intern/gpu_material.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c
index fb1d10b5491..93ea067cfb7 100644
--- a/source/blender/gpu/intern/gpu_material.c
+++ b/source/blender/gpu/intern/gpu_material.c
@@ -1120,7 +1120,11 @@ static void do_material_tex(GPUShadeInput *shi)
// to inverting the bump map. Should this ever change
// this negate must be removed.
norfac = -hScale * mtex->norfac;
- if(found_deriv_map) norfac /= sqrtf(ima_x*ima_y);
+ if(found_deriv_map)
+ {
+ float fVirtDim = sqrtf(fabsf(ima_x*mtex->size[0]*ima_y*mtex->size[1]));
+ norfac /= MAX2(fVirtDim, FLT_EPSILON);
+ }
tnorfac = GPU_uniform(&norfac);