[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43108] trunk/blender/source/blender: derivative maps must take into account that texture scales can be negative

Morten Mikkelsen mikkelsen7 at gmail.com
Tue Jan 3 23:27:37 CET 2012


Revision: 43108
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43108
Author:   mmikkelsen
Date:     2012-01-03 22:27:30 +0000 (Tue, 03 Jan 2012)
Log Message:
-----------
derivative maps must take into account that texture scales can be negative

Modified Paths:
--------------
    trunk/blender/source/blender/gpu/intern/gpu_material.c
    trunk/blender/source/blender/render/intern/source/render_texture.c

Modified: trunk/blender/source/blender/gpu/intern/gpu_material.c
===================================================================
--- trunk/blender/source/blender/gpu/intern/gpu_material.c	2012-01-03 22:18:52 UTC (rev 43107)
+++ trunk/blender/source/blender/gpu/intern/gpu_material.c	2012-01-03 22:27:30 UTC (rev 43108)
@@ -1122,7 +1122,7 @@
 						norfac = -hScale * mtex->norfac;
 						if(found_deriv_map)
 						{
-							float fVirtDim = sqrtf(ima_x*mtex->size[0]*ima_y*mtex->size[1]);
+							float fVirtDim = sqrtf(fabsf(ima_x*mtex->size[0]*ima_y*mtex->size[1]));
 							norfac /= MAX2(fVirtDim, FLT_EPSILON);
 						}
 

Modified: trunk/blender/source/blender/render/intern/source/render_texture.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/render_texture.c	2012-01-03 22:18:52 UTC (rev 43107)
+++ trunk/blender/source/blender/render/intern/source/render_texture.c	2012-01-03 22:27:30 UTC (rev 43108)
@@ -1970,7 +1970,7 @@
 			auto_bump = shi->obr->ob->derivedFinal->auto_bump_scale;
 		}
 		{
-			float fVirtDim = sqrtf((float) (dimx*dimy)*mtex->size[0]*mtex->size[1]);
+			float fVirtDim = sqrtf(fabsf((float) (dimx*dimy)*mtex->size[0]*mtex->size[1]));
 			auto_bump /= MAX2(fVirtDim, FLT_EPSILON);
 		}
 		



More information about the Bf-blender-cvs mailing list