Is it possible to separate different lamps to different passes?

Hi everyone :slight_smile:

when rendering with cycles, I use most passes available so I have more freedom compositing later.
I was wondering if it was possible to have the effect of different lamps separated onto different passes.

say I have a cube with a basic diffuse material. and I have a blue spotlight and a red spotlight and I want to be able to control the effect (strength) of each light separately in comp and not adjust them together as part of the diffuse and diffuse indirect passes.

I thought maybe I should use different layers for each light. but I would prefer avoiding multiple renders. I hope there’s a way to do it on the same render layer, as this shouldn’t require any new or different information on the scene.


In the BI renderer, which I normally use, you can capture multiple RenderLayers into a single MultiLayer OpenEXR file. So, you could use this facility to try to isolate the various sources of light.

However, I think it would be difficult in practice, because when you do have multiple lights “turned on” and contributing visual data to the scene, the effect of all of them on each illuminated object is naturally “cumulative.” When you’re compositing, you really want each separate track to be “pure, pristine, and distinct,” so that you can apply one set of operations to the entire input and get the desired outcome everywhere in the frame. Things like light and shadow can easily “add up” when you actually go to put the whole thing together.

I’d shoot multiple renders, each with a particular set of lights “turned on,” to be certain that each one captured only the lighting (and, separately, the shadow) effects from each source. Even though it seems to “take more time,” it really doesn’t. (Python scripts can be very helpful.)

This also has the advantage that, if you need to tweak one particular aspect of the light, you only need to re-render that aspect. If your only choice was to re-render everything, you’re really not saving time anymore. If you feel that you have to do it, because different sources influence one another, you don’t have a clean “comp plan.”

The reality is that, when you finally do get to “comp,” you will have to change some things. So, plan for that. Set up your scene, do the various rough lighting-shots, then sit down right away and do at least a rough comp. Look for problems: you will find them. Especially doubled lights and doubled shadows.

Thanks for the elaborate response sundialsvc4.
However, I was asking HOW I can split the render, and not whether I should :slight_smile: I’m well aware of the benefits of separate layers for different layers from maya :slight_smile: (that said, I’m still appreciate you taking the time to answer)

Cycles is capable too of creating a multiLayer OpenExr file, which is currently how I’m rendering my shots.

when cycles goes through the rendering process, I’m assuming it calculates each light separately but returns the accumulated result - split to diffuse(Direct, inDirect and color), glossy (split as well), etc. but not to the different light sources.

what I want is to be able to retrieve this information without having to render multiple times since the initial information should alrady be there. (render layers are in fact - multiple renders, even if they’re part of the same batch, and thus still increase the render times).

It doesn’t really matter for me whether it’s in an EXR format or a PNG pass, as long as I can see the effect of each light on my scene separately.
when I have that, I can use whatever math operation (probably add for light and multiply for shadows) however I want.

Here’s an example of what I’m (theoretically) trying to achieve.

images 1,2 and 3 were rendered in 3 different sessions.
(this is a beauty pass that includes diffuse only).
I would like to render the lights separately in one render session.
combining this 2 diffuse renders of the separate lights in photoshop produced the same results as the 3rd image as can be seen in the example.

you’ll need to render each light individually, but is possible.
place each light in a different layer, and create a RenderLayer for each.
in the end you can just ADD all the images with the mixnode in the compositor, and the end result will be allmost equal as if you had everything in the same layer. (allmost equal means your combined image will have less noise than the original one, but the same luminance and colors)

One thing to bare in mind, is that you also need to render your enviroment separetally, turning if off for the other RenderLayers.

Objects are in layer 1, Blue light in Layer 2, and Red light in Layer 3.

I guess there’s no choice then, separate renders it is :slight_smile:


Unfortunately, that’s the only way I know in Blender. Which increase the render time a lot. I’m also doing it because of the benefit to have separate lights in comp but if you know things to get the same render time, I’d like to know them!

to speed things up a bit, it’s possible to render each layer with less samples than the final image, because only one light is sampled in each render, instead of splitting samples for all the lights.

Theoretically, if you have an original render with 1000smp, and 4 RenderLayers, it should be enough to render each Layer with just 250smp…
i made a small experiment with the samples divided by each Layer, and the combined result still gave me less noise than the original one. But I suspect that this is not a linear relationship, and some scenes can work better than others… :confused:

This is a very good idea!
I made a quick test: there are more samples when lights are separate into render layers and then recombined together. So that’s logical and separate lights needs less samples. But how much less? I divided the number of samples by the number of layers and this gives a more noisy result than the original beauty. It’s not an issue but it could be nice to have the exact same amount of samples when lights are separated. I don’t know if this is possible.

the TotalSamples/RenderLayers formula works best with bounces=0. Because at each bounce the ray get’s a bit randomized, and this changes the sample value very quickly, I think the more bounces, the more close to TotalSamples each layer samples must be.