New Material option: "OnlyCast". This makes the object only cast shadows,
[blender.git] / source / blender / render / intern / source / ray.c
index ff27a287339832a9e110c39b5dd97776e19a2485..e493fcee1e2b04399629422e345a00d26f3f12a4 100644 (file)
@@ -972,18 +972,21 @@ static int testnode(Isect *is, Node *no, OcVal ocval)
                while(vlr) {
                        
                        if(is->vlrorig != vlr) {
-                               
-                               ov= no->ov+nr;
-                               if( (ov->ocx & ocval.ocx) && (ov->ocy & ocval.ocy) && (ov->ocz & ocval.ocz) ) { 
-                                       //accepted++;
-
-                                       isect.vlr= vlr;
-                                       if(intersection(&isect)) {
-                                               if(isect.labda<is->labda) *is= isect;
-                                               found= 1;
+                               /* I now... cpu cycle waste, might do smarter once */
+                               if(is->mode==DDA_MIRROR && (vlr->mat->mode & MA_ONLYCAST));
+                               else {
+                                       ov= no->ov+nr;
+                                       if( (ov->ocx & ocval.ocx) && (ov->ocy & ocval.ocy) && (ov->ocz & ocval.ocz) ) { 
+                                               //accepted++;
+
+                                               isect.vlr= vlr;
+                                               if(intersection(&isect)) {
+                                                       if(isect.labda<is->labda) *is= isect;
+                                                       found= 1;
+                                               }
                                        }
+                                       //else rejected++;
                                }
-                               //else rejected++;
                        }
                        
                        nr++;