Skip to main content
GameDev.net gamedev.net
🔒 Locked

Lightning/Lightmap

Started by WickedImp Jul 4, 2000 at 8:50 AM 4 replies 1k views
Original Post
WickedImp
WickedImp
Ok here we go... Lightning is a wonderfull thing! That''s fact! But OpenGL supports only few lights in one scene (OpenGL 1.0 -> 8 lights). The best to do is to use lightmaps, like Quake1 - Quake3. I know that lightmaps are textures, which are blended to the original texture. But I don''t know how they are calculated! (Quake is creating them while compiling the level (build time), but I hope they''re not creating a lightmap for every polygon in the level?!). Is there someone, who could help me??? Is there only one lightmap for the hole level (if there is only one style of lightning), or something else??? Help me, please!
baskuenen
baskuenen
quote:

Original post by WickedImp
...I know that lightmaps are textures...



This is not always true. In Quake they just give each vertex in the world a light intensity. At runtime you can add extra light from explosions to the existing light intensity. This only for the nearest vertices, the closest ones get the most light...

Hope this helps,
- Bas



Edited by - baskuenen on July 4, 2000 9:33:26 PM
Ysaneya
Ysaneya
> This is not always true. In Quake they just give each vertex in the world a light intensity.

The definition of a lightmap is a texture in which you''re puttin the intensity of the light. If you use vertex-lighting, it''s no longer a lightmap.
Quake doesn''t use vertex-lighting, but true lightmaps.

> I know that lightmaps are textures, which are blended to the original texture.

True.

> I hope they''re not creating a lightmap for every polygon in the level?!

Sorry to deceive you, but it''s what they''re doing. Well, not exactly; they''re using the concept of lightmap banks; it''s a 256x256 texture which contains many little lightmaps. There is one lightmap per polygon in the level. However, keep in mind that lightmaps are of a very little size compared to the true polygon (Quake II uses 16x16 pixels lightmaps i think).

Y.
WickedImp
WickedImp
quote:
Original post by Ysaneya

Ysaneya>
Hmmm... ok... now I know more about it... (that's the explanaition for the quadratic shadows on the wall )But how are they managing a huge polygon (like a long floor), lightned up with only one little spotlight? The rest of the floor is dark!

Are they blending a 'black' lightmap to the rest of it?

... damn... I forgot the /quote

Edited by - WickedImp on July 5, 2000 4:18:20 AM
BlackScar
BlackScar
Actually, that is a problem if you''re doing it that way. I beleive what Quake III and I *THINK* II is generate lightmaps within the bsp file. Then, for each face, have a special VERY SMALL lightmap texture stored within it. Then at render time it renders the face with the texture file and it''s special lightmap. Because in Q3 and Q2Radiant, it calculates all of the lights. The way I *THINK* they do it is shooting light rays from a point. Then it calculates the lightmap texture onto it and stores it. That''s why if you render a bsp file with FULL lights, it takes so freakin'' long. hehe

Hope that helps!

Justin Eslinger
Blackscar
~-=-=-=-=-=-=~~Justin Eslinger~~.."BlackScar"..~~-=-=-=-=-=-=~

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.