Revision: 17141
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17141
Author:   broken
Date:     2008-10-21 08:10:36 +0200 (Tue, 21 Oct 2008)

Log Message:
-----------
fixed a crash in volume shadows

Modified Paths:
--------------
    branches/sim_physics/source/blender/render/intern/source/rayshade.c
    branches/sim_physics/source/blender/render/intern/source/volumetric.c

Modified: branches/sim_physics/source/blender/render/intern/source/rayshade.c
===================================================================
--- branches/sim_physics/source/blender/render/intern/source/rayshade.c 
2008-10-21 02:04:29 UTC (rev 17140)
+++ branches/sim_physics/source/blender/render/intern/source/rayshade.c 
2008-10-21 06:10:36 UTC (rev 17141)
@@ -467,6 +467,7 @@
                //shi.do_preview= 0; // memset above, so dont need this
                shi.light_override= origshi->light_override;
                shi.mat_override= origshi->mat_override;
+               shi.re = origshi->re;
                
                memset(&shr, 0, sizeof(ShadeResult));
                
@@ -1300,6 +1301,7 @@
                
                shi.depth= 1;                                   /* only used to 
indicate tracing */
                shi.mask= 1;
+               shi.re = &R;
                
                /*shi.osatex= 0;
                shi.thread= shi.sample= 0;

Modified: branches/sim_physics/source/blender/render/intern/source/volumetric.c
===================================================================
--- branches/sim_physics/source/blender/render/intern/source/volumetric.c       
2008-10-21 02:04:29 UTC (rev 17140)
+++ branches/sim_physics/source/blender/render/intern/source/volumetric.c       
2008-10-21 06:10:36 UTC (rev 17141)
@@ -297,8 +297,8 @@
        }
 }
 
-#if 0
-/* no interpolation, not used */
+
+/* no interpolation */
 static void vol_get_precached_scattering_nearest(ShadeInput *shi, float 
*scatter_col, float *co)
 {
        const int res = shi->mat->vol_precache_resolution;
@@ -319,8 +319,8 @@
        scatter_col[1] = shi->obi->volume_precache[1*res*res*res + x*res*res + 
y*res + z];
        scatter_col[2] = shi->obi->volume_precache[2*res*res*res + x*res*res + 
y*res + z];
 }
-#endif
 
+
 /* Compute attenuation, otherwise known as 'optical thickness', extinction, or 
tau.
  * Used in the relationship Transmittance = e^(-attenuation)
  */
@@ -529,7 +529,10 @@
                        
                        if ((shi->mat->vol_shadeflag & MA_VOL_PRECACHESHADING) 
&&
                                (shi->mat->vol_shadeflag & MA_VOL_ATTENUATED)) {
-                               vol_get_precached_scattering(shi, scatter_col, 
step_mid);
+                               if (G.rt==0)
+                                       vol_get_precached_scattering(shi, 
scatter_col, step_mid);
+                               else
+                                       
vol_get_precached_scattering_nearest(shi, scatter_col, step_mid);
                        } else
                                vol_get_scattering(shi, scatter_col, step_mid, 
stepsize, density);
                        


_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to