Assorted small volume render related fixes.
[blender.git] / source / blender / render / intern / source / volumetric.c
index 21a0ab1d2a8e1a3469cb92b5740c7b380cc59d59..4ddbc079e91255b4e66274fcc9423480c64e61fb 100644 (file)
@@ -193,7 +193,7 @@ static void vol_trace_behind(ShadeInput *shi, VlakRen *vlr, float *co, float *co
        isect.labda = FLT_MAX;
        
        isect.mode= RE_RAY_MIRROR;
-       isect.skip = RE_SKIP_VLR_NEIGHBOUR | RE_SKIP_VLR_RENDER_CHECK;
+       isect.skip = RE_SKIP_VLR_NEIGHBOUR;
        isect.orig.ob = (void*) shi->obi;
        isect.orig.face = (void*)vlr;
        isect.last_hit = NULL;
@@ -446,7 +446,7 @@ static void vol_get_transmittance(ShadeInput *shi, float *tr, float *co, float *
                const float stepd = (t0 - pt0) * d;
                float sigma_t[3];
                
-               vol_get_sigma_t(shi, sigma_t, co);
+               vol_get_sigma_t(shi, sigma_t, p);
                
                tau[0] += stepd * sigma_t[0];
                tau[1] += stepd * sigma_t[1];
@@ -609,7 +609,10 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float
                        /* transmittance component (alpha) */
                        vol_get_transmittance_seg(shi, tr, stepsize, co, density);
                        
-                       if (luminance(tr) < shi->mat->vol.depth_cutoff) break;
+                       if (t0 > t1 * 0.25) {
+                               /* only use depth cutoff after we've traced a little way into the volume */
+                               if (luminance(tr) < shi->mat->vol.depth_cutoff) break;
+                       }
                        
                        vol_get_emission(shi, emit_col, p);