🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Lightning/Lightmap

Started by
4 comments, last by WickedImp 23 years, 12 months ago
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!
Advertisement
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
> 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.
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
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"..~~-=-=-=-=-=-=~
WickedImp,

Checkout this website.

http://www.voodoospotlight.com/devknowledge/articles/lightmapping/lightmaps.html

He gives a nice clear explanation of lightmapping. Should get you started.

Erik Labree.

This topic is closed to new replies.

Advertisement