From 5fbd6223c56dc8696af20f1c0eda22401a955359 Mon Sep 17 00:00:00 2001 From: Morten Mikkelsen Date: Tue, 3 Jan 2012 22:09:22 +0000 Subject: derivative maps were not working correctly with UV scale (the texture setting size) --- source/blender/gpu/intern/gpu_material.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/gpu/intern/gpu_material.c') 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); -- cgit v1.2.3