diff options
author | Morten Mikkelsen <mikkelsen7@gmail.com> | 2012-01-04 02:09:22 +0400 |
---|---|---|
committer | Morten Mikkelsen <mikkelsen7@gmail.com> | 2012-01-04 02:09:22 +0400 |
commit | 5fbd6223c56dc8696af20f1c0eda22401a955359 (patch) | |
tree | d4a278892f4ae9302c874a94d5832006b80909bc /source/blender/gpu/intern/gpu_material.c | |
parent | b197a7ea698eac7fc671a985f672948a9a842791 (diff) |
derivative maps were not working correctly with UV scale (the texture setting size)
Diffstat (limited to 'source/blender/gpu/intern/gpu_material.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_material.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index fb1d10b5491..e23428fb991 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -1120,7 +1120,7 @@ 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) norfac /= MAX2(sqrtf(ima_x*mtex->size[0]*ima_y*mtex->size[1]), FLT_EPSILON); tnorfac = GPU_uniform(&norfac); |