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:
authorMorten Mikkelsen <mikkelsen7@gmail.com>2012-01-04 02:18:52 +0400
committerMorten Mikkelsen <mikkelsen7@gmail.com>2012-01-04 02:18:52 +0400
commitaa1325ef55bce6792acfa8141f0bb53b7529d2a1 (patch)
treeded37df9dfbd1d0593cd797ab5735dbc6fed4f51 /source/blender/gpu
parent5fbd6223c56dc8696af20f1c0eda22401a955359 (diff)
calculate factor before using MAX2 macro
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 e23428fb991..bf575e092dc 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 /= MAX2(sqrtf(ima_x*mtex->size[0]*ima_y*mtex->size[1]), FLT_EPSILON);
+ if(found_deriv_map)
+ {
+ float fVirtDim = sqrtf(ima_x*mtex->size[0]*ima_y*mtex->size[1]);
+ norfac /= MAX2(fVirtDim, FLT_EPSILON);
+ }
tnorfac = GPU_uniform(&norfac);