Jump to content
  • Advertisement
Sign in to follow this  
noatom

Why doesn't the ambient color work?

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

pDevice->SetRenderState(D3DRS_AMBIENT, D3DXCOLOR(0x00202020));

 

I use that state,and set the material's ambient value(argb) to 1.Yet all my vertices are still black(and yes i enabled lighting).

 

What could be the problem?

Share this post


Link to post
Share on other sites
Advertisement

Do your vertices contain normals? You need normals for lighting (even though ambient lighting technically doesn't use them).

 

Another thought - I'm not using the fixed pipeline so I'm not sure this matter at all, but maybe you could try to use 0xFF202020 instead of 0x00202020. In fact for testing I would suggest rather something like 0xFFFF7F7F (you'll know it's working properly when your objects are rendered in red).

Edited by Tom KQT

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!