[Bf-committers] Please review: White background color for AO and shadow passes

Lukas Tönne lukas.toenne at googlemail.com
Fri Nov 25 09:07:50 CET 2011

lmg and i made a new patch that we'd like to get into trunk in next
bcon1. I'm not very familiar with BI renderer code, so would be nice
if Brecht and/or Ton could review. Codereview won't accept it due to
changes startup.blend.c size.


>From the patch description:

For "subtractive" passes, such as AO and shadows, it makes compositing
much easier when the default background color is white instead of
black (no additional masking required). This was a request by
Sebastian Koenig.

This patch initializes AO and shadow background color as white and
then treats ao and shad values in render result as negative influences
on full lighting:

result -= 1 - color
<=> result += color - 1

i.e. OSA filtering uses the (shr->ao - 1) values.

Currently that light transformation happens at final pass filtering,
but Ton suggested to move this further down "to the shader level".

Compatibility code has been added in the form of a new render layer
flag "black background", which is off by default and enabled by
do_versions for old files, to avoid breaking old compositor setups
with compensation masks. Brecht suggested moving such compatibility
switches into a separate UI section to avoid clutter.

More information about the Bf-committers mailing list