How to combine multiple detail lights?

After the spectacular resonance to my last posting (read: zero answers), here comes another try…

I’ve got a rendering engine using normalization cube bump mapping for detail lighting, simulating geometry detail that isn’t there via bump maps lighting and shading a low-poly geometry with details. So for each object, I recompute tangent space light coords whenever necessary. But for which light? Is there any way to combine multiple lights, perhaps by averaging the light vectors somehow (weighted by distance)?

I have this demo set up, where you walk around a dark corridor and have a flashlight, and it works like a charm. But turn on the light, and everything gets darker outside the projected light cone, because now all the tangent coordinates point towards the flashlight, turn it off and everything gets brighter and less bumped, because now all the tangent coordinates point to the (more distant) corridor light.

I would really appreciate your input on this, I couldn’t find a thing on it on the web. Is this kind of technique so common that nobody even thinks about it, or is it so exotic that nobody knows about it?

Cheers

Wolfgang

Okay, update: I managed to get the lighting right … but what a price to pay … Now it requires four texture units :frowning:

My rendering setup now does the following:

For Each Light
Pass (Separate)
Depth Map for shadow mapping

Pass (Replace)
Ambient x Detail Light (from Camera)

For Each Light
Pass (Add)
Detail Light (from Light) x Shadowmap x Projective Light

Pass (Modulate)
Material (Base Color x Color Texture lerp Reflection Map)

The ambient x detail light from camera thing is a neat trick because otherwise if no light is present you won’t get any detail textures, the light from camera corresponds to the kind of tunnel vision you get at night, things close to you always have a little light at least, and that’s exactly how it looks like. Big grin there. However, the Detail Light x Shadowmap x Projective Light thing is the real hog, taking four texture stages (detail light uses DOT3 combine and normalization cube map), no idea how to reduce this. On the other hand, now everything is correct, to the point where two colored lights produce correctly colored detail light on a surface.

Anyhow, problem solved, phew.

Cheers

Wolfgang