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.
Description
Description