View Full Version : Rendering out a "Light Pass" Layer for compositing

07 July 2009, 05:08 PM
Hello everybody,

I've been searching a while for a solution on this one (and i hope i did it thoroughly) but I just can't find the answer.
Assuming I want to recreate the following lighting situation:

I've splited up the rendering into several steps for compositing purposes: there is a glow layer, some base beauty layer for the street lamps and a road layer with a dummy plane to catch the lighting information from the arey lights, which are situated inside the lamp fixtures.

This is how far I came, I have a full 32-bit control over the exposure of the glow.

The problem is: what shader can be used to capture the illuminance data on the road dummy for compositing? I guess this is some kind of a black (transparent?) shader which can then be added on top of the background in compositing by the "add" operator.

Any suggestions are much appreciated, thanks in advance :)

07 July 2009, 09:41 PM
If your using 2009, its very easy, just render out a direct irradiance pass.
If your using 2008 try the mip_matte_shadow shader

07 July 2009, 10:52 PM
Hi mercuito,

thanks for the reply. This was also the first thing i did consider, unfortunatelly (don't know why) whenever I have my render layer setup with the additional "direct irradiance" pass, the pass comes out as an 8-bit image. The master beauty pass in contrary is still 32-bit floating point. As I am a keen HDR workflow devotee I really rely on its flexibility during compositing :)

Also it would be nice to somehow render those "light spot"-parts out with an alpha, that's what I did with the glow layer. By doing so one doesn't have to use the blending modes any longer, since the "cutout" effect works just as well. As HDR-Editing doesn't support the "screen" operator because of the math, another problem would be out of the way.

Any idea on how to force the render passes to stay in 32-bit mode? And maybe also on that alpha trick?

Thanks again :)!

07 July 2009, 08:58 AM
open up the pass contribution map in the attribute editor, there you can change individual passes to various bit depths.

07 July 2009, 10:51 AM
MasonDoran thanks for the reply. Did that and I get my 32-bit output for the render pass, thanks :)
The problem still remains though:

This is a tonemapped output of the "direct irradiance" pass. The ground plane is a simple gray lambertian shader. This can not be composited nicely onto the BG plate though :(
Any suggestions on the right shader?

07 July 2009, 06:07 PM
Perhaps more than the shader I think its the lighting itself that needs fixing. I can not see any light attenuation on the dummy street plane. maybe your light arrays are too strong or are spreading into each other too much? If you could focus them onto specific zones on the road a bit more then you wouldn't get such flatly lit plane.


07 July 2009, 10:16 PM

i didn't have much time to post the results here yet, but a solution has been found :)
I will try to post the exact procedure, but as an overall guideline: the mip_matteshadow did it. The "illuminators" function basically allows us to catch the actual "light" information (illuminance of the street in this case). With the proper assignment of the mip_cameramap we get a pretty convincing result.
Big THX goes to MasterZap, he affirmed that this is the right way to deal with this situation :)
One thing I am still working on: the mip_matteshadow shader has a multiple outputs feature, which would have allowed to save out the "illuminators pass" for compositing. Up to now I didn't manage to write this information to a custom buffer in Maya though. Any suggestions are much appreciated, should I come up with a solution I will post it.

CGTalk Moderation
07 July 2009, 10:16 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.