Jump to content
  • Advertisement
Sign in to follow this  
TempHolder

OpenGL Are these Lights?

This topic is 4679 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

Hey I was just wondering I know how openGL can only support 8 different light sources and in DX its just 1. But I was wondering if it can only support 8 different lights what happens when say you have 9 lamps on the screen?, I know Ive seen this before and In a couple of games and I was wondering if what they use are actually lights or some kind of cheap trick?, heres a screenshot of some of the effects Iam talking about, I only got screenshots from a 2D game so bare with me. I think of these as glowing affects, anyhow how could I achieve stuff like this? Itll probally be different for a 3D game so keep in mind my game is 3D. Iam guessing it has to do something with Alpha blending but I might be wrong. Image Hosted by ImageShack.us

Share this post


Link to post
Share on other sites
Advertisement
Generally not, unless it is strictly required or the hardware allows. The lighting you saw is some kind of alpha blended texture mapping. These two screenshots probably have none[grin], these lights are mapped textures blended with the scene, that is the reason why the lights are shining over the trees (2nd) and the light is not cut when it reaches the wall's edge (1st).

In 3D games they will normally use billboarding to render light sources (street lamps...) and will use very little real lights.

Share this post


Link to post
Share on other sites
opengl supports in fixed pipeline at least 8 lights. more lights can be calcluated in a shader or simulated with lightmaps..

Share this post


Link to post
Share on other sites
Well, in a lot of games that use multiple lights, I think they use light-mapping. I know Quake uses lightmaps. And I think there are a few more techniques that allow lighting. But it's not actual lighting. I don't know about those screenshots. You can't really tell (or at least I can't) just by looking at a screenshot. Of course, I have never really used lighting, as I just (as for now) create graphics apps. (GL or D3D) to learn new techniques. That way, when I feel comfortable with a lot of it, I can incorporate all of it into a game. =)

Share this post


Link to post
Share on other sites
Through the fixed pipeline, the API or hardware computes the lighting for your program. DirectX supports as many lights as the hardware supports, not just one. The lighting is calculated in accordance with a fixed built-in lighting scheme (which can be adjusted through some parameters).

However, most modern games implement there own lighting. There are many approaches, such as fixed- or dynamic lightmaps or per-pixel lighting. In the later variant, using the programmable pipeline, you can use as much lights as the GPU can pull in terms of frame rate. You can also implement your own lighting schemes.

Illco

Share this post


Link to post
Share on other sites
This extensive discussion of various lighting and shadowing methods is also very interesting if you want to know a number of alternatives.

Illco

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!