Only lighting pass

This question is probably worded poorly because I lack the compositing terminology knowledge to ask it properly, but I’m trying to render out a pass with “only lighting” without anything else in the shot exactly like the result from using the “shadow only” shadow option with Blender Internal materials but with isolated lighting instead of shadows.

This will be for compositing on top of images/video to have rendered lighting in real environments.

I didn’t find any simple option in the passes list that would give me what I was looking for in either Cycles or Blender Internal (although I might have missed it) so I tried a clumsy solution using keying nodes (with a Blender Internal render) that gives me a result close to what I’m looking for, but it is incredibly inelegant and is likely to cause problems in a lot of situations, so I’m hoping there is a better way.

Here’s what I came up with (the result in the backdrop is what I want).

There has to be a better way! Any suggestions? Thank you!

That looks like a job for the specular lighting pass to me.

Thanks for replying RamboBaby! You may be right! Do you have any tips for getting started with a specular pass for something like what I’m looking for? I didn’t find anything in the manual except for descriptions of the base concepts of lighting passes; nothing about how to actually get a result.

In Cycles I was wondering whether the options for Diffuse/Glossy/Transmission and their respective Direct/Indirect/Color passes might be useful, but just looking at their outputs they seemed to leave the geometry in the image and just subtract other sources of lighting, which isn’t what I’m looking for because I want to isolate the lighting alone for compositing on photos/video.

That being said, I’m also really interested in any Blender Internal solutions; I use both Cycles and Blender Internal a lot for different purposes.

Right after posting that about the Diffuse/Glossy/Transmission and their respective Direct/Indirect/Color passes it occurred to me to try a “difference” composite to see if I could isolate the lighting that way, and it kind of worked!

Is THIS a good way of doing this? I’m looking for advice about “proper workflows” or “best practices” more than “what works,” if that makes any sense. Thanks again.

Before answering the question let’s define “Lighting”:

Correct me if I’m wrong:
What you really want is to have the influence of your lights from the scene on footage, right?
So I assume you created some geometry that mimic objects from your footage.
Then you added lamp and you want it to have influence on geometry that you created and then you want to composite this influence over your footage.
Is that all right?

If so:

Hard to say without seeing the footage, but let’s say that you have a floor that is a bit reflective, receive shadows etc.
You have some objects that behaves similarly (I am assuming. I don’t know what you shot).

In cycles - I would set up the scene and activate all diffuse passes and all glossy passes.

Then I’d do this:

(Footage * Diffuse Direct) + Footage + Glossy Direct.
This will make your footage brighter. It will add influence of the lamp that you have in the scene.
Diffuse direct is the influence of your lamps (shadows included) without bounced light that is stored in Diffuse Indirect.
Glossy Direct is in fact Specular. Glossy Direct are reflections of the light sources. Mind however that in this pass you’ll have only reflections of lamps, not mash lights. Emitting meshes are treated as objects and reflections of them will be stored in Glossy Indirect as reflections of any other objects.

If you want shadows - try this:
Footage * Diffuse Direct.
Diffuse Direct pass may be altered before multiplying it with your footage. In such case it’s best to use white lamps.

But that’s just some initial thoughts. I’d be able to say more if I knew your footage and what you want to add to this.

Thank you for the great reply Bartek! All I’ve had time for was a quick test, but the results were very promising. As soon as I have time in a day or two I’m going to try it with a real result in mind and I’ll post the results (success or failure). Thanks so much Bartek!