I am adding dynamic lights to my FPS engine. For models, I use hardware lights with visibility testing. For brushes, I am attempting to blend in a circular gradient texture onto the walls.
I render brushes in this order:
-lightmap
-texture, with a modulate2x blend
-normal map, cube map, other layers (if enough texture units are available)
Decal lights are drawn by rendering another texture layer with a texture of a circular greyscale gradient. I use the material color to dim the dynamic light, depending on how far away it is from the light source. I also use that to change the color of the light.
The problem is that the dynamic light texture layer has to be rendered in a separate pass, since it uses a different material color. This makes it difficult to correctly blend the texture, since it modulates and multiples by two with only the underlying static lightmap.
If there is a way to set a maerial color for only one texture unit, or if you know of another technique I should consider, please let me know.
As for blending, the root of the problem is the modulate2x blend. I could also increase the screen gamma, and use a standard modulate blend, but then windowed apps would be…not quite so sexy.