PDA

View Full Version : Lightmaps and special effects



Commandr
10-29-2000, 12:45 AM
Please tell me what is correct way of rendering lightmaps and special FX layer? AFAIK, in general, I must use multiple rendering passes with same geometry and some unusual blending parameters. The question is: how to generate lightmaps and map them to surfaces correctly? If I will generate lightmap for EVERY face that will be EXTREMLY slow, because I've got up to 30000 faces in a single frame. Same thing with special effects (bullet holes, blood splats etc.) that are laid over normal textures. If I will use initially clean effects textures (with 0 alpha value) and then draw effect on it, this will be just big waste of texture memory...
I guess there must be correct way for doing this stuff (just like in UT, that is extremly fast even on my old PC (Cyrix MII 300/Voodoo Rush 6MB)).

[This message has been edited by Commandr (edited 10-29-2000).]

10-29-2000, 09:27 AM
You can cheat :-)

First, the resolution of light maps can be
really quite small, as linear interpolation
will give you a nice smooth change across
the surface.

Second, you only need to re-calculate the
lighting for things that are close enough
to a light source that changed, AND which
are currently visible.

Third, most static geometry can share one
or a few light map textures (some standard
washes, fades, or rectangular areas, say),
out of which they just pull the correct
sub-image (depending on geometry this may
or may not work for you).

If you share the textures, you will have to
assign another light map texture when
something is a) in view and b) affected by
a dynamic light.

Also, you can cheat again :-) If you don't
need super accurate radial lights, you may
be able to play tricks with the way the
light map is applied to make it darken less
for vertexes which are close to a light
source. If you can make this work well
enough, you need not recalculate light maps
at all.

Well, some ideas to start with. I'm still
struggling with understanding all of this,
so I'm sure even better ideas will pop up!