Does anyone here know how to apply lightmaps to textures (or decals)… such as say an impact mark on the wall, or how the corridor illuminates when you fire a rocket down it in quake… Im just looking for an xplaination of how to UV map a decal or lightmap ontop of another polygon to do this technique.
I would recommend using vertex lighting for dynamic lights and lightmaps for static lighting. If you create lightmaps dynamically your processor will get a lot to do, so you will probably have to use a predefined set of lightmaps if you want dynamic lightmapping. And you will have to use a lot of lightmaps to avoid discontinuities in the lighting.
Not a reply, but a question.
About lightmaps, in quake2 i noticed the were useing pregenerated lightmaps for dynamic light flashes (from weapons) as u mentioned. However useing r_speeds 1 in the console it shows 1 lmaps even when i shoot, i’m guessing this is lightmaps although i am unsure.
does anyone know how quake2 uses lightmaps.
Don’t know how quake is handling this, but i would guess that it has lightmaps for combined dynamic and static lighting too. But it may use multiple rendering passes too.
Quake2, like all the Quake-engine games, uses lightmaps for both static and dynamic lighting. When you see a rocket flying down a corridor the engine is actually rendering the “light ball” into a lightmap and combining it with the static lightmap. Although dynamic lighting is slower, it doesn’t use as much processing as you might think. In Quake (and Quake2 as well I think) each lightmap pixel covers a 16x16 texel region on the destination polygon so, for instance, dynamically lighting a 256x256 area on a polygon would only involve building a 16x16 lightmap - not very arduous for the processor at all, especially given that dynamic lighting in these engines only implement primitive “light-balls” without intensity fall-off or shadows.
I believe Quake 3 uses a different approach for dynamic lights; it does an extra pass over the affected geometry, with a circular texture projected along the up axis, and the contribution of the spot varied with vertical distance from the lightsource. Fire a rocket down a narrrow corridor in Q3 and you’ll notice that although the light appears as a spot on the floor, it’s a streak wherever it hits a vertical surface.
something like a cylindrical light map…?