Eight GL_LIGHT limit

Started by
34 comments, last by Spongemop 20 years, 9 months ago
Seems a little low. Aside from, say, doing soft lighting using glColor and distance calculations, is there some way to get more lights in the scene? Mop~
Advertisement
8 lights per polygon.

You can set those lights anywhere at any time.

Apply the 8 closest light effects to each object you are rendering, and the effect should be good enough.
It's not what you're taught, it's what you learn.
While a level may have more than eight lights, it''s fairly rare for it to have eight lights that are significantly affecting a particular object simultaneously. Just pick the eight lights with the greatest localized brightness (absolute brightness / distance2) and use those.

How appropriate. You fight like a cow.
I always thought 8 lights is the minimum for hardware implementation. But thus far, no company increased it. But with programable pipeline, you can increased it yourself, I guess, it will be slow though.
just out of curiousity can you implement more lights with a shader???
If I''m not mistaken the number of max. lights is hardware dependant. There''s something like GL_MAX_LIGHTS (or similar)that''ll tell you how much hardware accelerated lights your card supports for one surface.
If you go beyond the number your (or somebody elses) hw supports you''ll ''just'' drop back to software, which will be significantly slower of course.
As Senftel said, if you got a 3D level with several rooms, you just have to make sure that no more then eight lights are visible at once. Only glEnable those lights that truely have an effect on the player at it''s current location and glDisable the rest.
How do I set my laser printer on stun?
Then Im curious about this:

I was playing Zelda on the cube yesterday, in the forestpart, and there were green orbs (or whatever) flying around everywhere, and they all had their own light, with a small radius though (i guess somewhere around 1.0f, really small) that showed up when they got close to walls n stuff.

What would be the best way of achieving a similar effect? (without loosing too much speed)
My guess would be:
a) The gamecube supports more then eight lights simultaniously. As mentioned before that''s hw dependant.

b) They use a clever trick, so that no more then eight spheres are close to a wall same time, and thus require lighting effects.
(Or at least no more then eight of the visual spheres to that...)

c) The used some kind of multi texturing. A small texture that looks like a ''lighting glow'' gets blended over the floor/wall texture, and is scaled according to the spheres distance.

Now, get started
How do I set my laser printer on stun?
lol, get started. Right now i''m working on a really good Framework, which can use openGL, or whatever you want it to use. At the same time I''m writing a series of tutors about that for www.maxcode.com. Just finished part one (still have to convert it to html though) Part one features:

- Creating a new project

- Creating and initialising the program

- Proper error-handling

- Adding the ability to log to a text file

- Adding the ability to change the display mode


Part 2 will handle creating windows.
Part 3 will handle deriving a gamemode-class from part 2, which will be able to use openGL or other libraries, but i will base it on using openGL
Part 4 will actually do ... something with openGL, but nothing big since im still pretty new to openGL itself
U can do many lights at one go as long as a polygon is not affected by 8 lights at 1 time.

Like the Zelda example, u could do it this way.
Say u have a Green light.

GreenLight.pos={x,y,z};
RenderOrb1();
GreenLight.pos={x2,y2,z2};
RenderOrb2();
etc...
And you only use 1 light this way!

This topic is closed to new replies.

Advertisement