Bugfix #17913
authorTon Roosendaal <ton@blender.org>
Sat, 1 Nov 2008 16:09:36 +0000 (16:09 +0000)
committerTon Roosendaal <ton@blender.org>
Sat, 1 Nov 2008 16:09:36 +0000 (16:09 +0000)
Bah... fix for envmaps just before 2.48 release gave good looking envmaps
only when there was no sky involved...

The alpha in environment maps should be reset to 255... something that was
never done before, but also didn't show errors until other fixes in image
rendering were done.

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

index d281ac9e5c85145fb68e325fdddcb582aaef9781..13fa9b17b715c8ac2f23699b10fa04fb7a265dff 100644 (file)
@@ -439,12 +439,19 @@ static void render_envmap(Render *re, EnvMap *env)
 
                if(re->test_break()==0) {
                        RenderLayer *rl= envre->result->layers.first;
+                       int y;
+                       char *alpha;
                        
                        ibuf= IMB_allocImBuf(envre->rectx, envre->recty, 24, IB_rect, 0);
                        ibuf->rect_float= rl->rectf;
                        IMB_rect_from_float(ibuf);
                        ibuf->rect_float= NULL;
-                               
+                       
+                       /* envmap renders without alpha */
+                       alpha= ((char *)ibuf->rect)+3;
+                       for(y= ibuf->x*ibuf->y - 1; y>=0; y--, alpha+=4)
+                               *alpha= 255;
+                       
                        env->cube[part]= ibuf;
                }