Sure.
Before rendering the view, I enter orthogonal mode and render all lightsources as textures quads onto the lower left corner of the framebuffer(*).
This procudes a top-down lightmap. I copy that into a texture, and repeat three more times, rendering larger and larger areas onto the same screenspace, thus generating coarser but bigger lightmaps.
The player’s position is always (kinda) in the center of the lightmaps.
Whenever I render an object, I figure out what lightmap level that fully covers that object, and switch to that texture in texture unit 2.
I set the automatic texture coord generations to just apply u=x and v=z, and switch to texture matrix mode to offset and scale the lightmap.
Then I render the object, with texture 2 as modulate with a modifier of *2 (for overbrighting).
Keep in mind that if you translate, rotate, or scale the modelview matrix, you have to do the same for the texture matrix.(**)
Using several lightmaps lets me have fully lightmapped terrain up to 512 meters away, but still have a 0.25 meter resolution for the lightmaps near the player.
(ie lightmap LOD)
Does this make any sense?
(* pBuffers seem to crash at ranom for various people, and using the framebuffer has big problems when the pixel ownership test fails… Does anyone know how to disable the ownership test? is that even possible?)
(** I was hoping there would be someway of not having to do this, but I haven’t found a solution yet)