My 2 tries on compositing soft shadows:
0. original scene render time with soft shadows: 2:17
1. composite 1 sum of render times: 0:31
2. composite 2 sum of render times: 0:42
1. The approach was to separate objects:
- shadows on the white background
- background alone
- objects alone on dark background
- custom objects mask taking into account objects transparency (required for transparency and unpremultiply alpha from channel).
Shadow layer have to be grown with minimum or erosion (2 different names) filter, blurred and put under the object. You can notice I additionally turned off self shadowing of objects to speed up things a bit.
2. The approach was to separate lighting pass from the colour pass and blur the lighting pass only where shadows are present.
- full lighting pass with all colours and textures removed
- all colours (rendered as 100% ambient)
- shadows mask
- objects mask (to cut the shadow mask to not appear on the objects, actually it might be also useful in example 1 depending on needs)
The presence of environment fog wasn’t very helpful, but again I got the thing solved by using ‘white fog’ to fade one of the multiplied channels (depth channel might be equally useful).
You can see from both examples that the (fake) caustic in the shadows was compromised, or the shadow’s colour on the second one. In fact - it doesn’t have to. There are some solutions for that, but it’s only the matter what qualities are the most important and which ones you can sacrifice. In some other renderers that allow exporting raw passes the rendering is not necessarily faster, but it’s rather a tool to allow more fiddling with the final result. The proposed way of compositing is different in the matter that we’re sacrificing some elements to make the rendering faster.
I’ve shown only two possible roads on splitting things to speed up the rendering. The drawback is that you have to plan this earlier, already when working with the scene, make some experiments with simplified objects of similar qualities, prepare to split your file into several only on the final step (reassigning materials takes time and it’s error prone), and be sure you want to do compositing at the end.
Link to composites:
http://dl.dropbox.com/u/104131615/passes_test.zip
Click thumbnail to see full-size image