Skip to main content
gamedev.net
🔒 Locked

Rendering multiple lights

Started by darkhaven Mar 22, 2003 at 3:00 PM 0 replies 200+ views
Original Post
darkhaven
darkhaven
I''m trying to render multiple lights in my scene by simple rendering the object per as many lights in my scene, with additive blending. For example, my loop is m_pD3DDevice->SetRenderState( D3DRS_SRCBLEND, D3DD3DBLEND_ONE ); m_pD3DDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_ZERO ); RenderScene(); // Render the scene with the first light for( int i = 1; i < (for as many lights in the scene); i++) { m_pD3DDevice->SetRenderState( D3DRS_SRCBLEND, D3DD3DBLEND_ONE ); m_pD3DDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_ONE ); RenderScene(); } However, it seems like I have z fighting. How should I setup my z buffer? I have a GeForce3 so I doubt I don''t have enough bits in my z buffer. Thanks, eric

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.