As some of you may have discovered by now, the ‘useBackground’ shader doesn’t collect Final Gathering shadows, which is annoying.
This afternoon I managed to find a fairly nice (in my opinion anyway) work-around for that. It effectively makes the ‘useBackground’ shader collect FG like shadows, like this:
Not exactly the best example, but when you render it without the image plane you get:
So it works fairly well. You only need to mess around with the floor shader, not the other objects. Here’s what I did (it’s slightly odd):
Apply a ‘useBackground’ shader to the floor.
Turn off the specularity and reflection of that shader (well,
unless you want it).
Open the Hypershade.
Connect the following nodes together:
Now to explain.
The Shadow Mask attribute of the ‘useBackground’ shader controls the transparency of the rendered shadow. The very handy Dirtmap shader basically creates FG shadowing wherever two surfaces are close to each other. If you don’t know how to get the Dirtmap shader, you’ll have to read around on this forum or wait 'til my next tutorial is out (in a few days).
By multiplying the result of the Dirtmap shader with the amount of shadow that the Shadow Mask is already receiving, you get FG and normal shadows for the ‘useBackground’ shader!
You need to add the Reverse node into the flow because otherwise the Dirtmap adds un-shadow (whiteness) instead of darkness.
As for attributes set on all these nodes:
Dirtmap shader has default values.
I’ve got 0.5 as the Input1.x value of the multiplyDivide node because 0.5 sets the normal shadows (cast by the light, not the Dirtmap) to half transparent. You only set to the Input1.x value and not the Y and Z because the shadowMask attribute only takes one value.
No attributes to set on the reverse node.
The only other thing you need to play with is the Matte Opacity attribute of the ‘useBackground’ shader. With it set to the default value of 1, the alpha channel has the Dirtmap shadows as invisible. So I set the Matte Opacity to like 100 which just makes the shadow alpha solid.
Here’s my scene file for you also:
I know that’s kinda a lot to do just to get the fake FG shadows, but at least I had semi-fun figuring it out, hehe.