White background color for AO and shadow passes


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.

Lukas Toenne (lukastoenne) added a comment.Via Old WorldNov 25 2011, 9:29 AM

Added two images to demonstrate the effect

Tom Musgrove (letterrip) added a comment.Via Old WorldMar 6 2012, 1:47 AM

Hopefully brecht can look

Brecht Van Lommel (brecht) placed this task up for grabs.Via WebNov 9 2014, 3:19 PM
Sergey Sharybin (sergey) claimed this task.Via WebFeb 26 2015, 10:50 AM

Add Comment