svn merge -r 20133:20486 https://svn.blender.org/svnroot/bf-blender/branches/blender2...
authorAndre Susano Pinto <andresusanopinto@gmail.com>
Fri, 29 May 2009 00:54:52 +0000 (00:54 +0000)
committerAndre Susano Pinto <andresusanopinto@gmail.com>
Fri, 29 May 2009 00:54:52 +0000 (00:54 +0000)
2.5 trunk has a nice bug fix for rendering

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

index 9fbb585fd0276cab292d5e7c36ad8c12c0541d44,27dd43a4ef9e56c3b5938ad45424fea4803bd0ee..547156f6c768c684948c7ecf59757f184dd49fa5
@@@ -31,7 -31,6 +31,7 @@@
  #include <math.h>
  #include <float.h>
  #include <string.h>
 +#include <assert.h>
  
  /* External modules: */
  #include "MEM_guardedalloc.h"
@@@ -704,7 -703,7 +704,7 @@@ static void atm_tile(RenderPart *pa, Re
                        for(sample=0; sample<totsample; sample++) {
                                float *zrect= RE_RenderLayerGetPass(rlpp[sample], SCE_PASS_Z) + od;
                                float *rgbrect = rlpp[sample]->rectf + 4*od;
-                               float rgb[3];
+                               float rgb[3] = {0};
                                int done= 0;
                                
                                for(go=R.lights.first; go; go= go->next) {
@@@ -2235,7 -2234,6 +2235,7 @@@ static void bake_displacement(void *han
        }
  }
  
 +#if 0
  static int bake_check_intersect(Isect *is, int ob, RayFace *face)
  {
        BakeShade *bs = (BakeShade*)is->userdata;
  
        return (R.objectinstance[ob].obr->ob != bs->actob);
  }
 +#endif
  
 -static int bake_intersect_tree(RayTree* raytree, Isect* isect, float *start, float *dir, float sign, float *hitco, float *dist)
 +static int bake_intersect_tree(RayObject* raytree, Isect* isect, float *start, float *dir, float sign, float *hitco, float *dist)
  {
 +      //TODO
 +      assert( 0 );
 +#if 0
        float maxdist;
        int hit;
  
        if(R.r.bake_maxdist > 0.0f)
                maxdist= R.r.bake_maxdist;
        else
 -              maxdist= RE_ray_tree_max_size(R.raytree) + R.r.bake_biasdist;
 +              maxdist= FLT_MAX + R.r.bake_biasdist;
        
 +      //TODO normalized direction?
        VECADDFAC(isect->start, start, dir, -R.r.bake_biasdist);
 +      isect->dir[0] = dir[0]*sign;
 +      isect->dir[1] = dir[1]*sign;
 +      isect->dir[2] = dir[2]*sign;
 +      isect->labda = maxdist;
  
 -      isect->end[0] = isect->start[0] + dir[0]*maxdist*sign;
 -      isect->end[1] = isect->start[1] + dir[1]*maxdist*sign;
 -      isect->end[2] = isect->start[2] + dir[2]*maxdist*sign;
 -
 -      hit = RE_ray_tree_intersect_check(R.raytree, isect, bake_check_intersect);
 +      hit = RE_rayobject_raycast(raytree, isect);
 +      //TODO bake_check_intersect
        if(hit) {
                hitco[0] = isect->start[0] + isect->labda*isect->vec[0];
                hitco[1] = isect->start[1] + isect->labda*isect->vec[1];
        }
  
        return hit;
 +#endif
 +      return 0;
  }
  
  static void bake_set_vlr_dxyco(BakeShade *bs, float *uv1, float *uv2, float *uv3)
@@@ -2397,9 -2387,8 +2397,9 @@@ static void do_bake_shade(void *handle
                for(sign=-1; sign<=1; sign+=2) {
                        memset(&isec, 0, sizeof(isec));
                        isec.mode= RE_RAY_MIRROR;
 -                      isec.faceorig= (RayFace*)vlr;
 -                      isec.oborig= RAY_OBJECT_SET(&R, obi);
 +
 +                      isec.orig.ob   = obi;
 +                      isec.orig.face = vlr;
                        isec.userdata= bs;
                        
                        if(bake_intersect_tree(R.raytree, &isec, shi->co, shi->vn, sign, co, &dist)) {
  
                /* if hit, we shade from the new point, otherwise from point one starting face */
                if(hit) {
 -                      vlr= (VlakRen*)minisec.face;
 -                      obi= RAY_OBJECT_GET(&R, minisec.ob);
 +                      obi= (ObjectInstanceRen*)minisec.hit.ob;
 +                      vlr= (VlakRen*)minisec.hit.face;
                        quad= (minisec.isect == 2);
                        VECCOPY(shi->co, minco);