svn merge -r 23528:23646 https://svn.blender.org/svnroot/bf-blender/trunk/blender soc-2009-jaguarandi
authorAndre Susano Pinto <andresusanopinto@gmail.com>
Tue, 6 Oct 2009 01:58:22 +0000 (01:58 +0000)
committerAndre Susano Pinto <andresusanopinto@gmail.com>
Tue, 6 Oct 2009 01:58:22 +0000 (01:58 +0000)
12 files changed:
1  2 
release/scripts/ui/buttons_scene.py
source/blender/makesdna/DNA_scene_types.h
source/blender/makesrna/intern/rna_scene.c
source/blender/render/SConscript
source/blender/render/extern/include/RE_shader_ext.h
source/blender/render/intern/include/render_types.h
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/rayshade.c
source/blender/render/intern/source/renderdatabase.c
source/blender/render/intern/source/volume_precache.c
source/blender/render/intern/source/volumetric.c
source/blender/windowmanager/intern/wm_init_exit.c

Simple merge
@@@ -23,7 -18,14 +20,15 @@@ if env['WITH_BF_OPENEXR']
      defs.append('WITH_OPENEXR')
  
  if env['OURPLATFORM']=='linux2':
 -    cflags='-pthread'
 +    cflags += ['-pthread']
  
+ if env['OURPLATFORM'] == 'linux2':
+     cflags='-pthread'
+     incs += ' ../../../extern/binreloc/include'
+ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
+     incs += ' ' + env['BF_PTHREADS_INC']
  env.BlenderLib ( libname = 'bf_render', sources = sources, includes = Split(incs), defines=defs, libtype='core', priority=145, compileflags=cflags )
 +env.BlenderLib ( libname = 'bf_render_raytrace', sources = raysources, includes = Split(incs), defines=defs, libtype='core', priority=145, compileflags=cflags, cxx_compileflags=cxxflags )
@@@ -429,9 -458,9 +466,9 @@@ static void *vol_precache_part(void *da
  {
        VolPrecachePart *pa =  (VolPrecachePart *)data;
        ObjectInstanceRen *obi = pa->obi;
 -      RayTree *tree = pa->tree;
 +      RayObject *tree = pa->tree;
        ShadeInput *shi = pa->shi;
-       float density, scatter_col[3] = {0.f, 0.f, 0.f};
+       float scatter_col[3] = {0.f, 0.f, 0.f};
        float co[3];
        int x, y, z;
        const int res[3]= {pa->res[0], pa->res[1], pa->res[2]};
@@@ -72,6 -73,61 +73,51 @@@ inline float luminance(float* col
  }
  
  /* tracing */
 -
 -static int vlr_check_intersect_solid(Isect *is, int ob, RayFace *face)
 -{
 -      VlakRen *vlr = (VlakRen*)face;
 -      
 -      /* solid material types only */
 -      if (vlr->mat->material_type == MA_TYPE_SURFACE)
 -              return 1;
 -      else
 -              return 0;
 -}
 -
+ static float vol_get_shadow(ShadeInput *shi, LampRen *lar, float *co)
+ {
+       float visibility = 1.f;
+       
+       if(lar->shb) {
+               float dot=1.f;
+               float dxco[3]={0.f, 0.f, 0.f}, dyco[3]={0.f, 0.f, 0.f};
+               
+               visibility = testshadowbuf(&R, lar->shb, co, dxco, dyco, 1.0, 0.0);             
+       } else if (lar->mode & LA_SHAD_RAY) {
+               /* trace shadow manually, no good lamp api atm */
+               Isect is;
 -              const float maxsize = RE_ray_tree_max_size(R.raytree);
 -              
+               
+               VecCopyf(is.start, co);
+               if(lar->type==LA_SUN || lar->type==LA_HEMI) {
 -                      is.end[0] = co[0] - lar->vec[0] * maxsize;
 -                      is.end[1] = co[1] - lar->vec[1] * maxsize;
 -                      is.end[2] = co[2] - lar->vec[2] * maxsize;
++                      is.vec[0] = -lar->vec[0];
++                      is.vec[1] = -lar->vec[1];
++                      is.vec[2] = -lar->vec[2];
++                      is.labda = R.maxdist;
+               } else {
 -                      VecCopyf(is.end, lar->co);
++                      VECSUB( is.vec, lar->co, is.start );
++                      is.labda = VecLength( is.vec );
+               }
 -              is.mode= RE_RAY_MIRROR;
++              is.mode = RE_RAY_MIRROR;
++              is.skip = RE_SKIP_VLR_NEIGHBOUR | RE_SKIP_VLR_RENDER_CHECK | RE_SKIP_VLR_NON_SOLID_MATERIAL;
++              
+               if(lar->mode & (LA_LAYER|LA_LAYER_SHADOW))
+                       is.lay= lar->lay;       
+               else
+                       is.lay= -1;
 -              is.face_last= (RayFace*)lar->vlr_last[shi->thread];
 -              is.ob_last= RAY_OBJECT_SET(&R, lar->obi_last[shi->thread]);
 -              is.faceorig= NULL;
 -              is.oborig= RAY_OBJECT_SET(&R, shi->obi);
++                      
++              is.last_hit = NULL;
++              is.orig.ob = (void*)shi->obi;
++              is.orig.face = NULL;
++              is.last_hit = lar->last_hit[shi->thread];
+               
 -              if(RE_ray_tree_intersect_check(R.raytree, &is, vlr_check_intersect_solid)) {
++              if(RE_rayobject_raycast(R.raytree,&is)) {
+                       visibility = 0.f;
+               }
+               
 -              lar->vlr_last[shi->thread]= (VlakRen*)is.face_last;
 -              lar->obi_last[shi->thread]= RAY_OBJECT_GET(&R, is.ob_last);
++              lar->last_hit[shi->thread]= is.last_hit;
+       }
+       return visibility;
+ }
  
  static int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, Isect *isect, int intersect_type)
  {
@@@ -147,15 -202,19 +193,16 @@@ static void shade_intersection(ShadeInp
  static void vol_trace_behind(ShadeInput *shi, VlakRen *vlr, float *co, float *col)
  {
        Isect isect;
 -      float maxsize = RE_ray_tree_max_size(R.raytree);
        
        VECCOPY(isect.start, co);
 -      isect.end[0] = isect.start[0] + shi->view[0] * maxsize;
 -      isect.end[1] = isect.start[1] + shi->view[1] * maxsize;
 -      isect.end[2] = isect.start[2] + shi->view[2] * maxsize;
 -      
 -      isect.faceorig= (RayFace *)vlr;
 +      VECCOPY(isect.vec, shi->view);
 +      isect.labda = FLT_MAX;
        
        isect.mode= RE_RAY_MIRROR;
 -      isect.oborig= RAY_OBJECT_SET(&R, shi->obi);
 -      isect.face_last= NULL;
 -      isect.ob_last= 0;
++      isect.skip = RE_SKIP_VLR_NEIGHBOUR | RE_SKIP_VLR_RENDER_CHECK;
 +      isect.orig.ob = (void*) shi->obi;
 +      isect.orig.face = (void*)vlr;
 +      isect.last_hit = NULL;
        isect.lay= -1;
        
        /* check to see if there's anything behind the volume, otherwise shade the sky */