Why do people use lightmaps?

Started by
17 comments, last by Ivyn 21 years, 10 months ago
Yeah, it''s just a question of which words you use. Technically it''s not 8 per polygon, because a call to glDrawElements might draw 2000 polygons, but only 8 lights can be active for that call. But "scene" is misleading too. So basically, when using hardware lighting, you''d have to know which lights are close enough to affect the geometry you''re drawing, and if there''s more than 8 than you''d have to choose the 8 best ones.

~CGameProgrammer( );

~CGameProgrammer( );Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.
Advertisement
Quake 3 uses a precalculated light grid for the charracters. Look at the tool source if you don''t believe that.
Yes you are right, you could use some selection process to decide which lights may be active in a scene.

quote:That doesnt mean its right. That book wasnt written by SGI was it? I doubt it. It IS 8 lights PER POLYGON. It makes sense if you think about it instead of blindly believing what you are told. If you setup all 8 lights, render a polygon, setup all 8 lights again differently, and render another polygon, then youve just done what cant be done according to that book (as its 16 different lights for the scene so far). Keep going and youve done more lights for that scene.

Lesson here: the book is WRONG. Its PER POLYGON.


I firmly believe the book is right.
I dont know how you ment it, but you could draw a polygon, then change the light settings around and position them differnetly, and then draw another polygon, but that is not the sense I took it in at the time. It looks like a double misunderstanding of each others comments, no need to get offensive.

Rickwi22
I didnt mean to be offensive, so I appologize is thats the way it came out. I was just trying to emphasize certain points.

You could look at it either way, but I look at it the same way as texturing. You cant change textures in the glDrawElements block, but that doesnt mean you can only have X number of textures in the scene (where X is the TMU count on your hardware). You can change the texture once per polygon (thatll get slow), or simply never. Same goes with lighting.

-----------------------
"When I have a problem on an Nvidia, I assume that it is my fault. With anyone else''s drivers, I assume it is their fault" - John Carmack
-----------------------"When I have a problem on an Nvidia, I assume that it is my fault. With anyone else's drivers, I assume it is their fault" - John Carmack
Hardware TnL performance absolutely crashes through the floor like you wouldn''t believe with 8 hardware lights.
quote:
Hardware TnL performance absolutely crashes through the floor like you wouldn''t believe with 8 hardware lights.


It''s not that dramatic. It does cost but not too huge an amount if you really need 8 lights. On my DX8.1 app on a GF3Ti 200 a 20k triangle scene with 1 directional light ran at ~200fps. With 8 point lights ( point lights are more expensive than directional ). It dropped to ~150fps. Not too bad. I think it is a little worse on the original Geforce though.

Jack
quote:Original post by noVum
Quake 3 uses a precalculated light grid for the charracters. Look at the tool source if you don''t believe that.


But that doesn''t mean it didn''t use hardware lights to perform the lighting caculations. The light grid simply designates which hardware lights to setup for the characters.

Hardware lighting is very, very common. In practical use, 8 is plenty. But, more hardware lights never hurts because it allows you to reduce render setup (but in general, 8 is plenty to achieve any desired visual effect).

quote:Original post by noVum
I never saw any game that used hardware lights. Prove me if I''m wrong.


That would actually be quite easy to prove as it''s extremely common in games to use dynamic, per vertex calculated (hardware) lighting for ambient or directional light of characters or game objects. On some platforms it''s practically a standard technique.

quote:That doesnt mean its right. That book wasnt written by SGI was it? I doubt it. It IS 8 lights PER POLYGON. It makes sense if you think about it instead of blindly believing what you are told. If you setup all 8 lights, render a polygon, setup all 8 lights again differently, and render another polygon, then youve just done what cant be done according to that book (as its 16 different lights for the scene so far). Keep going and youve done more lights for that scene.

Lesson here: the book is WRONG. Its PER POLYGON.

That''s entirely up to your definition of a "scene".
IMO, if you turn on 8 lights for a polygon, then turn the off and activate 8 different lights for another polygon, you are simply drawing the polygons as different scenes. You never had more than 8 in one. That''s what the book means. And the visuals will say the same thing, the polygons look like they are in totally different scenes, because they have differen''t light sources.

------------
http://aud.vze.com <-- Newbie alert, look at your own risk. Can induce severe laughing fits and other variations of hysterical outburst.
_______________________________________Pixelante Game Studios - Fowl Language

This topic is closed to new replies.

Advertisement