Blender Internal: Add material property "Cast" which can disable both ray and buffer...
[blender.git] / source / blender / render / intern / source / zbuf.c
index d50d53b5f530d39bd08f252f17d7c81c9041c084..8dc4a6c65de0276c6bbc6c46c5f79bc287a9e0fc 100644 (file)
@@ -2367,7 +2367,7 @@ void zbuffer_shadow(Render *re, float winmat[4][4], LampRen *lar, int *rectz, in
                        if (vlr->mat!= ma) {
                                ma= vlr->mat;
                                ok= 1;
-                               if ((ma->mode & MA_SHADBUF)==0) ok= 0;
+                               if ((ma->mode2 & MA_CASTSHADOW)==0 || (ma->mode & MA_SHADBUF)==0) ok= 0;
                        }
 
                        if (ok && (obi->lay & lay) && !(vlr->flag & R_HIDDEN)) {
@@ -2420,7 +2420,7 @@ void zbuffer_shadow(Render *re, float winmat[4][4], LampRen *lar, int *rectz, in
                                        if (sseg.buffer->ma!= ma) {
                                                ma= sseg.buffer->ma;
                                                ok= 1;
-                                               if ((ma->mode & MA_SHADBUF)==0) ok= 0;
+                                               if ((ma->mode2 & MA_CASTSHADOW)==0 || (ma->mode & MA_SHADBUF)==0) ok= 0;
                                        }
 
                                        if (ok && (sseg.buffer->lay & lay)) {
@@ -3348,7 +3348,7 @@ static int zbuffer_abuf(Render *re, RenderPart *pa, APixstr *APixbuf, ListBase *
                        if (vlr->mat!=ma) {
                                ma= vlr->mat;
                                if (shadow)
-                                       dofill= (ma->mode & MA_SHADBUF);
+                                       dofill= (ma->mode2 & MA_CASTSHADOW) && (ma->mode & MA_SHADBUF);
                                else
                                        dofill= (((ma->mode & MA_TRANSP) && (ma->mode & MA_ZTRANSP)) && !(ma->mode & MA_ONLYCAST));
                        }