Sign in to follow this  

rendering multiple lights

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

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
Sign in to follow this