diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-11-26 06:50:14 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-11-26 06:50:14 +0300 |
commit | ca6cc30368841e358021d53281c7299ea6a82f13 (patch) | |
tree | 93889b8f695119b247eb67adb066ca5e7ce8b5c3 | |
parent | 9d9a88348e2f9d1770e4dd7d44df3491489b3ded (diff) |
Fix #24855: disabling shadows didn't disable AO/env with ray transparency
and AO multiply mode.
-rw-r--r-- | source/blender/render/intern/source/shadeoutput.c | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c index 7f5a620ab57..295428b7c0f 100644 --- a/source/blender/render/intern/source/shadeoutput.c +++ b/source/blender/render/intern/source/shadeoutput.c @@ -1646,12 +1646,14 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr) if(R.wrld.mode & (WO_AMB_OCC|WO_ENV_LIGHT|WO_INDIRECT_LIGHT)) { if(((passflag & SCE_PASS_COMBINED) && (shi->combinedflag & (SCE_PASS_AO|SCE_PASS_ENVIRONMENT|SCE_PASS_INDIRECT))) || (passflag & (SCE_PASS_AO|SCE_PASS_ENVIRONMENT|SCE_PASS_INDIRECT))) { - /* AO was calculated for scanline already */ - if(shi->depth || shi->volume_depth) - ambient_occlusion(shi); - VECCOPY(shr->ao, shi->ao); - VECCOPY(shr->env, shi->env); // XXX multiply - VECCOPY(shr->indirect, shi->indirect); // XXX multiply + if(R.r.mode & R_SHADOW) { + /* AO was calculated for scanline already */ + if(shi->depth || shi->volume_depth) + ambient_occlusion(shi); + VECCOPY(shr->ao, shi->ao); + VECCOPY(shr->env, shi->env); // XXX multiply + VECCOPY(shr->indirect, shi->indirect); // XXX multiply + } } } @@ -1767,18 +1769,20 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr) /* from now stuff everything in shr->combined: ambient, AO, radio, ramps, exposure */ if(!(ma->sss_flag & MA_DIFF_SSS) || !sss_pass_done(&R, ma)) { - /* add AO in combined? */ - if(R.wrld.mode & WO_AMB_OCC) - if(shi->combinedflag & SCE_PASS_AO) - ambient_occlusion_apply(shi, shr); - - if(R.wrld.mode & WO_ENV_LIGHT) - if(shi->combinedflag & SCE_PASS_ENVIRONMENT) - environment_lighting_apply(shi, shr); - - if(R.wrld.mode & WO_INDIRECT_LIGHT) - if(shi->combinedflag & SCE_PASS_INDIRECT) - indirect_lighting_apply(shi, shr); + if(R.r.mode & R_SHADOW) { + /* add AO in combined? */ + if(R.wrld.mode & WO_AMB_OCC) + if(shi->combinedflag & SCE_PASS_AO) + ambient_occlusion_apply(shi, shr); + + if(R.wrld.mode & WO_ENV_LIGHT) + if(shi->combinedflag & SCE_PASS_ENVIRONMENT) + environment_lighting_apply(shi, shr); + + if(R.wrld.mode & WO_INDIRECT_LIGHT) + if(shi->combinedflag & SCE_PASS_INDIRECT) + indirect_lighting_apply(shi, shr); + } shr->combined[0]+= shi->ambr; shr->combined[1]+= shi->ambg; |