Orange <-> bf-blender conflict, with 2.40 saved files the version-patch to
authorTon Roosendaal <ton@blender.org>
Sun, 1 Jan 2006 16:37:21 +0000 (16:37 +0000)
committerTon Roosendaal <ton@blender.org>
Sun, 1 Jan 2006 16:37:21 +0000 (16:37 +0000)
initialize the (soon obsolete) material layers was skipped, causing it all
to be rendered black.

1  2 
source/blender/render/intern/source/rendercore.c

index acac0d48e2ccac8724c019472be772adc07f4b44,92b26a5998152ff8a6501099e01ac069749d52bf..3a5eb15d186edb07518ae10637764db4a032a550
@@@ -2479,36 -2309,25 +2479,36 @@@ void *shadepixel(float x, float y, int 
                        }
                }
                
 -              /* ------  main shading loop */
 -              shade_lamp_loop(&shi, &shr);
 +              /* ------  main shading loop -------- */
 +              VECCOPY(shi.vno, shi.vn);
 +              
-               if(shi.mat->ml_flag & ML_RENDER) {
++              if(1) { //shi.mat->ml_flag & ML_RENDER) {
  
 -              if(shi.translucency!=0.0) {
 -                      ShadeResult shr_t;
 +                      shade_lamp_loop(&shi, &shr);    /* clears shr */
 +
 +                      if(shi.translucency!=0.0) {
 +                              ShadeResult shr_t;
 +                              
 +                              VECCOPY(shi.vn, shi.vno);
 +                              VecMulf(shi.vn, -1.0);
 +                              VecMulf(shi.facenor, -1.0);
 +                              shade_lamp_loop(&shi, &shr_t);
 +                              
 +                              shr.diff[0]+= shi.translucency*shr_t.diff[0];
 +                              shr.diff[1]+= shi.translucency*shr_t.diff[1];
 +                              shr.diff[2]+= shi.translucency*shr_t.diff[2];
 +                              VecMulf(shi.vn, -1.0);
 +                              VecMulf(shi.facenor, -1.0);
 +                      }
                        
 -                      VecMulf(shi.vn, -1.0);
 -                      VecMulf(shi.facenor, -1.0);
 -                      shade_lamp_loop(&shi, &shr_t);
 -                      shr.diff[0]+= shi.translucency*shr_t.diff[0];
 -                      shr.diff[1]+= shi.translucency*shr_t.diff[1];
 -                      shr.diff[2]+= shi.translucency*shr_t.diff[2];
 -                      VecMulf(shi.vn, -1.0);
 -                      VecMulf(shi.facenor, -1.0);
 -              }
 -              
 -              if(R.r.mode & R_RAYTRACE) {
 -                      if(shi.ray_mirror!=0.0 || ((shi.mat->mode & MA_RAYTRANSP) && shr.alpha!=1.0)) {
 -                              ray_trace(&shi, &shr);
 +                      if(R.r.mode & R_RAYTRACE) {
 +                              if(shi.ray_mirror!=0.0 || ((shi.mat->mode & MA_RAYTRANSP) && shr.alpha!=1.0)) {
 +                                      ray_trace(&shi, &shr);
 +                              }
 +                      }
 +                      else {
 +                              /* doesnt look 'correct', but is better for preview, plus envmaps dont raytrace this */
 +                              if(shi.mat->mode & MA_RAYTRANSP) shr.alpha= 1.0;
                        }
                }
                else {