Bugfix on IRC report. Luckily Daniel Salazar *does* carefully check our
authorTon Roosendaal <ton@blender.org>
Tue, 14 Oct 2008 11:42:53 +0000 (11:42 +0000)
committerTon Roosendaal <ton@blender.org>
Tue, 14 Oct 2008 11:42:53 +0000 (11:42 +0000)
regression files, it showed small dark outline errors on envmap.

This commit rewinds bugfix #8437, which actually had to be fixed on
another location in code, which was done a few weeks ago. :)

source/blender/render/intern/source/envmap.c

index aa4e40739da9f222dca2220b5e10fe4422030274..d281ac9e5c85145fb68e325fdddcb582aaef9781 100644 (file)
@@ -640,7 +640,7 @@ int envmaptex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexRe
        /* texvec should be the already reflected normal */
        EnvMap *env;
        ImBuf *ibuf;
-       float fac, vec[3], sco[3], dxts[3], dyts[3], w[3];
+       float fac, vec[3], sco[3], dxts[3], dyts[3];
        int face, face1;
        
        env= tex->env;
@@ -722,15 +722,9 @@ int envmaptex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexRe
                        if(fac!=0.0) {
                                fac= 1.0/fac;
 
-                               /* weight contributions based on alpha */
-                               w[0]= texres->ta*fac;
-                               w[1]= texr1.ta*fac;
-                               w[2]= texr2.ta*fac;
-                               
-                               /* interpolate premultiplied result (imagewraposa returns key) */
-                               texres->tr= (w[0]*texres->ta*texres->tr + w[1]*texr1.ta*texr1.tr + w[2]*texr2.ta*texr2.tr);
-                               texres->tg= (w[0]*texres->ta*texres->tg + w[1]*texr1.ta*texr1.tg + w[2]*texr2.ta*texr2.tg);
-                               texres->tb= (w[0]*texres->ta*texres->tb + w[1]*texr1.ta*texr1.tb + w[2]*texr2.ta*texr2.tb);
+                               texres->tr= fac*(texres->ta*texres->tr + texr1.ta*texr1.tr + texr2.ta*texr2.tr );
+                               texres->tg= fac*(texres->ta*texres->tg + texr1.ta*texr1.tg + texr2.ta*texr2.tg );
+                               texres->tb= fac*(texres->ta*texres->tb + texr1.ta*texr1.tb + texr2.ta*texr2.tb );
                        }
                        texres->ta= 1.0;
                }