From e2f9afbaabbdecc87c77261e40650da426baf168 Mon Sep 17 00:00:00 2001 From: IRIE Shinsuke Date: Tue, 11 Feb 2014 17:06:21 +0900 Subject: Blender Internal: Modify material property "Cast Buffer Shadows" to affect ray shadows also, and rename it to "Cast Shadows". This allows us to make materials that don't cast ray shadows. Turning off this property can reduce the rendering time slightly. Note: RNA path is changed to "use_cast_shadows" as well. The older path "use_cast_buffer_shadows" still can be used as its alias, but it will be removed after updating some addons. Reviewed By: brecht Differential Revision: https://developer.blender.org/D272 --- source/blender/render/intern/raytrace/rayobject.cpp | 2 +- source/blender/render/intern/source/convertblender.c | 2 +- source/blender/render/intern/source/shadbuf.c | 4 ++-- source/blender/render/intern/source/strand.c | 2 +- source/blender/render/intern/source/zbuf.c | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) (limited to 'source/blender/render') diff --git a/source/blender/render/intern/raytrace/rayobject.cpp b/source/blender/render/intern/raytrace/rayobject.cpp index 9e639501fdd..fd3d2b5083b 100644 --- a/source/blender/render/intern/raytrace/rayobject.cpp +++ b/source/blender/render/intern/raytrace/rayobject.cpp @@ -118,7 +118,7 @@ MALWAYS_INLINE int vlr_check_intersect(Isect *is, ObjectInstanceRen *obi, VlakRe if (is->mode == RE_RAY_MIRROR) return !(vlr->mat->mode & MA_ONLYCAST); else - return (is->lay & obi->lay); + return (vlr->mat->mode & MA_CASTSHADOW) && (is->lay & obi->lay); } MALWAYS_INLINE int vlr_check_intersect_solid(Isect *UNUSED(is), ObjectInstanceRen *UNUSED(obi), VlakRen *vlr) diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index bcde98aea8f..56080357dce 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -746,7 +746,7 @@ static Material *give_render_material(Render *re, Object *ob, short nr) if (ma->material_type == MA_TYPE_VOLUME) { ma->mode |= MA_TRANSP; - ma->mode &= ~MA_SHADBUF; + ma->mode &= ~MA_CASTSHADOW; } if ((ma->mode & MA_TRANSP) && (ma->mode & MA_ZTRANSP)) re->flag |= R_ZTRA; diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c index 0c3bf85cd24..676e0436bfd 100644 --- a/source/blender/render/intern/source/shadbuf.c +++ b/source/blender/render/intern/source/shadbuf.c @@ -660,7 +660,7 @@ static void shadowbuf_autoclip(Render *re, LampRen *lar) if (vlr->mat!= ma) { ma= vlr->mat; ok= 1; - if ((ma->mode & MA_SHADBUF)==0) ok= 0; + if ((ma->mode & MA_CASTSHADOW)==0) ok= 0; } if (ok && (obi->lay & lay)) { @@ -2013,7 +2013,7 @@ static void isb_bsp_fillfaces(Render *re, LampRen *lar, ISBBranch *root) if (vlr->mat!= ma) { ma= vlr->mat; ok= 1; - if ((ma->mode & MA_SHADBUF)==0) ok= 0; + if ((ma->mode & MA_CASTSHADOW)==0) ok= 0; if (ma->material_type == MA_TYPE_WIRE) ok= 0; zspanstrand.shad_alpha= zspan.shad_alpha= ma->shad_alpha; } diff --git a/source/blender/render/intern/source/strand.c b/source/blender/render/intern/source/strand.c index f2d4a7afd94..6c13bffdd17 100644 --- a/source/blender/render/intern/source/strand.c +++ b/source/blender/render/intern/source/strand.c @@ -860,7 +860,7 @@ int zbuffer_strands_abuf(Render *re, RenderPart *pa, APixstrand *apixbuf, ListBa /* test if we should skip it */ ma = obr->strandbuf->ma; - if (shadow && !(ma->mode & MA_SHADBUF)) + if (shadow && !(ma->mode & MA_CASTSHADOW)) continue; else if (!shadow && (ma->mode & MA_ONLYCAST)) continue; diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c index a8ccd1f362f..6885768261f 100644 --- a/source/blender/render/intern/source/zbuf.c +++ b/source/blender/render/intern/source/zbuf.c @@ -2368,7 +2368,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->mode & MA_CASTSHADOW)==0) ok= 0; } if (ok && (obi->lay & lay) && !(vlr->flag & R_HIDDEN)) { @@ -2421,7 +2421,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->mode & MA_CASTSHADOW)==0) ok= 0; } if (ok && (sseg.buffer->lay & lay)) { @@ -3349,7 +3349,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->mode & MA_CASTSHADOW); else dofill= (((ma->mode & MA_TRANSP) && (ma->mode & MA_ZTRANSP)) && !(ma->mode & MA_ONLYCAST)); } -- cgit v1.2.3