Jump to content
  • Advertisement

Archived

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

Spongemop

Eight GL_LIGHT limit

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

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~

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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)

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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!

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!