Original Post
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