• Advertisement

Archived

This topic is now archived and is closed to further replies.

D3DIM question

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

Is is just me, or does setting the ambient light do NOTHING! I am using a single directional light, and it works fine, then I call this every frame: lpD3DDevice->SetRenderState( D3DRENDERSTATE_AMBIENT, RANDOM_COLOR); This should at least change how the image looks considering I am pseudo-randomly changing the ambient color, but it doesn''t change a thing. Is there something I have to do to enable ambient lights? Pseudo

Share this post


Link to post
Share on other sites
Advertisement
Most people recommend that you do the lighting yourself, using D3DLVERTEX. Typically, your own lighting model is faster, since d3d takes many things into account that you wouldn''t typically bother with.

If you do it this way, it''s as easy as setting up an ambient light variable and keeping it.

I had your problem too, but I switched to my own lighting model-- not because of it, but because when I compared the speeds of the two, my own model was faster.

Share this post


Link to post
Share on other sites
D3DLVERTEX doesn''t contain normal data so how do you use it to do your own lighting model? Don''t you still use vertex normals to shade? I hope you don''t fill the D3DLVERTEX structure after the calculations, because this would mean you have to duplicate every vertex. Please inlighten me.

Share this post


Link to post
Share on other sites

  • Advertisement