Jump to content
  • Advertisement

Archived

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

Ivyn

Why do people use lightmaps?

This topic is 5954 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Okay why do people use lightmaps and do I have to use them? Why can''t I just use a whole bunch of the lights that come with (DirectX, OGL)?

Share this post


Link to post
Share on other sites
Advertisement
1. The OpenGL and D3D lighting is only calculated on vertex edges and is blended over the polygone, so when you place a light directly in front of a poly it will have only one color istead of a bright spot in the middle
2. Hardware only supports 8 lights in one scene
3. You calculate the lighting in the preprocessing step when you use lightmaps which allows neater effects such as shadow casting and radiosity.

Share this post


Link to post
Share on other sites
Calculateing the lighting from alot of little lights is very expensive, lightmaps arent, plus as someone mentioned, lighting is per vertex, while lightmaps can make it look perpixel, o bye the way, are you talking about projected light maps, or regular light maps like in Quake 3, that are just applied as a 2nd regular texture over the object, Im pretty sure thats how they do it anyway.

Share this post


Link to post
Share on other sites
quote:
Original post by noVum
2. Hardware only supports 8 lights in one scene



Its 8 lights PER-POLYGON, and 8 is only the minimum required, implementations can support more.

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

Share this post


Link to post
Share on other sites
quote:
Its 8 lights PER-POLYGON, and 8 is only the minimum required, implementations can support more


This is a quote DIRECTLY from OpenGL Game Programming,
quote:
OpenGL lets you have as many as eight lights in your scene at any one time

page 168

Share this post


Link to post
Share on other sites
quote:
at any one time


You can have eight simultaneously active lights. You can have more than eight, you just can''t have all of them active at the same time.

Share this post


Link to post
Share on other sites
quote:
Original post by Rickwi22
This is a quote DIRECTLY from OpenGL Game Programming,



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.

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

Share this post


Link to post
Share on other sites
OpenGL is a state machine, so it''s 8 lights minimum whenever you draw something, and those lights are whatever you have set at the time.

No point arguing over phrasings of the same concept.

And a lot of games use hardware lighting. Quake 3 uses them for characters, but lightmaps for the environment.


Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!