This topic is now archived and is closed to further replies.

The Wizard Of Oz

light maps

Recommended Posts

Lightmaps are most likely to be used as textures.
If you want to apply a lightmap on a non-textured object, you *just* have to set the lightmap as the texture of the object.
If you want to apply a lightmap on an object that is already textured, you have either to use multitexturing (1st texture for your object's color, adn second texture for your lightmap) or draw you object in two-pass (one pass for the first texture(color), one pass for the second texture(lightmap))

Rendering a lightmap depends on the complexity of your object, and the complexity of realism you look for.
The realism can go from a super-sample of polygons (kind of gouraud rendering) to radiosity (best results known today), smooth-shadow, raytracing etc.

The limitation of the lightmap is that it is a static map (unless you compute the texture on-the-fly which is a lot of hard work and barely never implemented). Thus forcing your application to use lightmap for static lights (lights do no move, for instance the sun at a specified hour, or a light fixed on a wall/ceiling) on static objects (a building for instance, but not something moving like a player).

Please tell us what do you know about lightmaps, this will make discussion a lot better for you if we know wether you are a newbie (eg just heard about the word 'lightmap' but don't really know what it is, where it is used) or a *merely* (?) experienced programmer who needs details for optimization and stuff.

Edited by - vincoof on February 8, 2002 3:02:57 AM

Share this post

Link to post
Share on other sites
i''m an merely experienced in almost every field except lighting..
i''ve tried ''bout dozen times to use opengl light functions, but i never got the light to stand always moves with my scene it''s like i''ve got a flashlight in my hands ( cool effect but not the one i needed
so, anyway i''d like to learn how to implement lightmaps to my program and if you people out there know and tutorials page i''d br very greatfull


follow the yellow brick road

Share this post

Link to post
Share on other sites

float light[4];


glLightfv(GL_LIGHTi, GL_POSITION,(float*)&light);

where i is the light number.

when you have the model view matrix transformed to the lights position if light = 0,0,0,1.

and that has nothing to do with lightmapping btw.

Share this post

Link to post
Share on other sites
RipTorn :
I think tWoZ has more problems, like defining normals, color materials and such stuff. Lighting is an important, but also a difficult part.
Anyway, I''d say you can not implement lightmaps if you don''t know how ligthing works, because lightmaps is an advanced case of lighting.

Share this post

Link to post
Share on other sites