🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

D3DIM question

Started by
1 comment, last by Pseudo 24 years, 5 months ago
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
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.
-- Goodlife-----------------------------Those whom the gods would destroy, they first drive mad.--DirectX design team official motto
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.

This topic is closed to new replies.

Advertisement