Sign in to follow this  
psycho_munkey

multiple light sources

Recommended Posts

d3d supports up to 8 lights at once using the fixed pipeline. To set the other 7, simply pass its index into the SetLight function (0 - 7). Don't forget to also call dev->LightEnable for ecah lights you want enabled. See the DX docs for the details :).

Share this post


Link to post
Share on other sites
If you want to render additional lights, you need to do it in a second pass.

So if you have 15 lights, render the first 8 lights, set blending to additive, then render the remaining 7 lights.

Just remember, having that many lights in one scene being calculated in real time could have a pretty bad performance impact :). If possible, precalculate the lights into a light map or even per vertex if you do not need full definition.

Share this post


Link to post
Share on other sites
__Daedalus__    480
I think your maximum amount of lights you can have set at once is determined by your video card (e.g. check in the device CAPS viewer tool) not DirectX. But try not to have more than four lights in any one scene. Many lights will give bad performance - especially if you have high-polygon models.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this