Revision: 14245
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14245
Author:   blendix
Date:     2008-03-26 16:25:56 +0100 (Wed, 26 Mar 2008)

Log Message:
-----------

Fix for bug #8750: depremul in the image texture code should check
with an epsilon rather than 0.0f, could give random spots otherwise
with e.g. calcalpha + negalpha.

Modified Paths:
--------------
    trunk/blender/source/blender/render/intern/source/imagetexture.c

Modified: trunk/blender/source/blender/render/intern/source/imagetexture.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/imagetexture.c    
2008-03-26 14:58:34 UTC (rev 14244)
+++ trunk/blender/source/blender/render/intern/source/imagetexture.c    
2008-03-26 15:25:56 UTC (rev 14245)
@@ -32,6 +32,7 @@
 #include <string.h>
 #include <fcntl.h>
 #include <math.h>
+#include <float.h>
 #ifndef WIN32 
 #include <unistd.h>
 #else
@@ -245,7 +246,7 @@
        if(tex->flag & TEX_NEGALPHA) texres->ta= 1.0f-texres->ta;
 
        /* de-premul, this is being premulled in shade_input_do_shade() */
-       if(texres->ta!=1.0f && texres->ta!=0.0f) {
+       if(texres->ta!=1.0f && texres->ta>FLT_EPSILON) {
                fx= 1.0f/texres->ta;
                texres->tr*= fx;
                texres->tg*= fx;
@@ -989,7 +990,7 @@
        }
        
        /* de-premul, this is being premulled in shade_input_do_shade() */
-       if(texres->ta!=1.0f && texres->ta!=0.0f) {
+       if(texres->ta!=1.0f && texres->ta>FLT_EPSILON) {
                fx= 1.0f/texres->ta;
                texres->tr*= fx;
                texres->tg*= fx;


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to