Are these Lights?

Started by
7 comments, last by Illco 18 years, 3 months ago
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
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.
--> The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones <--
opengl supports in fixed pipeline at least 8 lights. more lights can be calcluated in a shader or simulated with lightmaps..
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. =)
:==-_ Why don't the voices just leave me alone?! _-==:
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
also, a key point is that its 8 lights per vertex, you can turn lights on and off as required.
where can I find some tutorials on these "lightmaps" and what not.
You can try http://www.3ddrome.com/articles/dynamiclightmaps.php
This extensive discussion of various lighting and shadowing methods is also very interesting if you want to know a number of alternatives.

Illco

This topic is closed to new replies.

Advertisement