From d98603129ca30aabe29f17f28f4ac72dbc0ca4ac Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 11 Feb 2010 15:43:31 +0000 Subject: Added an option "Cast Approximate" to control if a material should cast shadow when using approximate AO, separate from "Traceable". --- source/blender/render/intern/source/occlusion.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'source/blender/render') diff --git a/source/blender/render/intern/source/occlusion.c b/source/blender/render/intern/source/occlusion.c index d06339f75cc..3f825613d12 100644 --- a/source/blender/render/intern/source/occlusion.c +++ b/source/blender/render/intern/source/occlusion.c @@ -629,6 +629,7 @@ static OcclusionTree *occ_tree_build(Render *re) OcclusionTree *tree; ObjectInstanceRen *obi; ObjectRen *obr; + Material *ma; VlakRen *vlr= NULL; int a, b, c, totface; @@ -640,7 +641,9 @@ static OcclusionTree *occ_tree_build(Render *re) if((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak; else vlr++; - if((vlr->mat->mode & MA_TRACEBLE) && (vlr->mat->material_type == MA_TYPE_SURFACE)) + ma= vlr->mat; + + if((ma->shade_flag & MA_APPROX_OCCLUSION) && (ma->material_type == MA_TYPE_SURFACE)) totface++; } } @@ -677,7 +680,9 @@ static OcclusionTree *occ_tree_build(Render *re) if((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak; else vlr++; - if((vlr->mat->mode & MA_TRACEBLE) && (vlr->mat->material_type == MA_TYPE_SURFACE)) { + ma= vlr->mat; + + if((ma->shade_flag & MA_APPROX_OCCLUSION) && (ma->material_type == MA_TYPE_SURFACE)) { tree->face[b].obi= c; tree->face[b].facenr= a; tree->occlusion[b]= 1.0f; -- cgit v1.2.3