Revision: 32726
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32726
Author:   broken
Date:     2010-10-27 04:18:24 +0200 (Wed, 27 Oct 2010)

Log Message:
-----------
Fix [#23972] 2.54 beta crashes when rendering scene with many volume objects

Sticky-taped on more hacks to the already crumbling shading system.

Modified Paths:
--------------
    trunk/blender/source/blender/render/intern/source/rayshade.c

Modified: trunk/blender/source/blender/render/intern/source/rayshade.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/rayshade.c        
2010-10-26 23:52:34 UTC (rev 32725)
+++ trunk/blender/source/blender/render/intern/source/rayshade.c        
2010-10-27 02:18:24 UTC (rev 32726)
@@ -718,7 +718,7 @@
 
                shi.mask= origshi->mask;
                shi.osatex= origshi->osatex;
-               shi.depth= 1;                                   /* only used to 
indicate tracing */
+               shi.depth= origshi->depth + 1;                                  
/* only used to indicate tracing */
                shi.thread= origshi->thread;
                //shi.sample= 0; // memset above, so dont need this
                shi.xs= origshi->xs;
@@ -1458,8 +1458,8 @@
        float diff[3];
        int do_tra, do_mir;
        
-       do_tra= ((shi->mat->mode & MA_TRANSP) && (shi->mat->mode & 
MA_RAYTRANSP) && shr->alpha!=1.0f);
-       do_mir= ((shi->mat->mode & MA_RAYMIRROR) && shi->ray_mirror!=0.0f);
+       do_tra= ((shi->mat->mode & MA_TRANSP) && (shi->mat->mode & 
MA_RAYTRANSP) && shr->alpha!=1.0f && (shi->depth <= shi->mat->ray_depth_tra));
+       do_mir= ((shi->mat->mode & MA_RAYMIRROR) && shi->ray_mirror!=0.0f && 
(shi->depth <= shi->mat->ray_depth));
        
        /* raytrace mirror amd refract like to separate the spec color */
        if(shi->combinedflag & SCE_PASS_SPEC)
@@ -1570,7 +1570,7 @@
                memset(&shi, 0, sizeof(ShadeInput)); 
                /* end warning! - Campbell */
                
-               shi.depth= 1;                                   /* only used to 
indicate tracing */
+               shi.depth= origshi->depth + 1;                                  
/* only used to indicate tracing */
                shi.mask= origshi->mask;
                shi.thread= origshi->thread;
                shi.passflag= SCE_PASS_COMBINED;


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to