Jump to content
  • Advertisement
Sign in to follow this  
killan

lights : number of it and infinite number of it

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

I have a trouble to understand one thing about light in many games we have a lot of lights, but the graphics card caps give only 4 lights (it depend of the card i supose) but if we want to made a game with a infinite of lights and run it on any graphics card : how do that ? thanks for your help

Share this post


Link to post
Share on other sites
Advertisement
It sounds like you are being limited by a fixed function renderer. OpenGL and Direct3D only support 4 lights in fixed function mode. You might try going to a renderer that uses vertex and pixel shading.

Even if you use shaders it is unlikely that your performance will be very good with any more than 4 lights. You could look into differred shading, but I think that the jury is still out on that technique.

Share this post


Link to post
Share on other sites
There are many ways you can fake "lights". This wouldn't require an actual light in the D3D sense of the word, but as far as the user cares it would count as a light. Specific methods depend on exactly what you're doing, but I can think of about 4 to 5 different ways off the top of my head. If you're looking for a specific solution to a specific situation, you'd likely get a more specific answer :).

Hope this helps.

Share this post


Link to post
Share on other sites
ok so we must combine all type of fake lights and shaders to have all results possible ?

i see the thing... thanks all

Share this post


Link to post
Share on other sites
You can have as many lights as you want. The restriction is on how many you can use at the same time. You might draw one part of the scene with one set of lights and draw another part of the scene with another set of lights.

Share this post


Link to post
Share on other sites
Quote:
Original post by jkleinecke
It sounds like you are being limited by a fixed function renderer. OpenGL and Direct3D only support 4 lights in fixed function mode. You might try going to a renderer that uses vertex and pixel shading.
...


That's not true for Direct3D.

Share this post


Link to post
Share on other sites
Or you can move one light to x,y,z coordinate, set light parameters, and do it again on different position, and do this
n times between BeginScene and EndScene.

Share this post


Link to post
Share on other sites
There is no restriction imposed by Direct3D on the maximum number of lights when using the fixed-function pipeline (up to the number of lights that can be expressed by a DWORD).

Your card may have a restriction (if you're using hardware vertex processing), but the API doesn't. You'd know this if you retrieved the D3DCAPS9::MaxActiveLights when using software vertex processing or hardware vertex processing with the reference device.

Share this post


Link to post
Share on other sites
You can have an infinite number of lights if you use static lighting like in Quake 3. It uses a map compiler that generates the light information so that the game renderer doesn't have to do it in real-time. If you want infinite dynamic lights, do what JohnBolton said, render only the lights that are close to the camera. If want to be really sneaky, use static lighting for far away objects and dynamic lighting for close objects, kind of like Level of Detail. Just wanted to throw some ideas from the top of my head :-)

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!