Sign in to follow this  
Hassanbasil

rendering multiple lights

Recommended Posts

hello guys, how can i render multiple lights? e.g. i have this:
device->SetLight(0, &light);

device->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, RGB ( 200, 20, 60 ), 1.0f, 0);
device->BeginScene();
//..render objects
device->EndScene();
this renders one light, what if i have 2 lights for example? thanks in advance, -Hassan

Share this post


Link to post
Share on other sites
The first parameter to SetLight is the index of the light you are setting so here's how you would set up a second light.

device->SetLight(1, &light2);

don't forget to enable it though!

device->LightEnable( 1, TRUE );

this page might help some if you have other questions about lighting in d3d
http://www.toymaker.info/Games/html/lighting.html

Share this post


Link to post
Share on other sites
Quote:
Original post by Atrix256
The first parameter to SetLight is the index of the light you are setting so here's how you would set up a second light.

device->SetLight(1, &light2);

don't forget to enable it though!

device->LightEnable( 1, TRUE );

this page might help some if you have other questions about lighting in d3d
http://www.toymaker.info/Games/html/lighting.html


thanks man, never excepted it that simple.
Cheers

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