* Fix for camera+internal surface object inside ztransp volume
authorMatt Ebb <matt@mke3.net>
Mon, 24 Aug 2009 08:13:09 +0000 (08:13 +0000)
committerMatt Ebb <matt@mke3.net>
Mon, 24 Aug 2009 08:13:09 +0000 (08:13 +0000)
source/blender/render/intern/source/shadeinput.c
source/blender/render/intern/source/volumetric.c

index ede3c2e0503adc86b052fc23537a9d8477b98ea3..ed654eaf526c4450fa77316b3a1e9ae0d9f3d0d0 100644 (file)
@@ -169,7 +169,8 @@ void shade_material_loop(ShadeInput *shi, ShadeResult *shr)
        }       
        
        if(R.r.mode & R_RAYTRACE) {
-               shade_volume_inside(shi, shr);
+               if (R.render_volumes_inside.first)
+                       shade_volume_inside(shi, shr);
        }
 }
 
index cf66d580944db8bd8416275d8913146eaa66ecff..0e2e39138195dd01b4ca323da8c62e578575b335 100644 (file)
@@ -575,15 +575,14 @@ static void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr, int in
                startco = shi->camera_co;
                endco = shi->co;
                
-               if (!ztransp) {
-                       if (trace_behind) {
+               if (trace_behind) {
+                       if (!ztransp)
                                /* trace behind the volume object */
                                vol_trace_behind(shi, shi->vlr, endco, col);
-                       } else {
-                               /* we're tracing through the volume between the camera 
-                                * and a solid surface, so use that pre-shaded radiance */
-                               QUATCOPY(col, shr->combined);
-                       }
+               } else {
+                       /* we're tracing through the volume between the camera 
+                        * and a solid surface, so use that pre-shaded radiance */
+                       QUATCOPY(col, shr->combined);
                }
                
                /* shade volume from 'camera' to 1st hit point */
@@ -676,8 +675,9 @@ void shade_volume_inside(ShadeInput *shi, ShadeResult *shr)
        MatInside *m;
        Material *mat_backup;
        
-       if (BLI_countlist(&R.render_volumes_inside) == 0) return;
+       //if (BLI_countlist(&R.render_volumes_inside) == 0) return;
        
+       /* XXX: extend to multiple volumes perhaps later */
        mat_backup = shi->mat;
        m = R.render_volumes_inside.first;
        shi->mat = m->ma;