light maps

Started by
3 comments, last by The Wizard Of Oz 22 years, 2 months ago
hi! can someone please tell me how to create efficient light mapping in my OpenGL prog... where and how do I create light maps? please, help! thanx follow the yellow brick road
follow the yellow brick road
Advertisement
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
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 still...it 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

thanx

follow the yellow brick road
follow the yellow brick road
call:

float light[4];

setup...

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.
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.

This topic is closed to new replies.

Advertisement