Jump to content
  • Advertisement
Sign in to follow this  
blaze02

basic lighting

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

My textured quad renders fine with d3d lighting off. My quad does not render with d3d lighting on, d3drs_ambient full, and the quad's material set to full ambient. Should the quad be drawn with color? Why? Do I need to create and enable a d3dlight9? Why doesn't d3drs_ambient handle the lighting for me? I've tried rendering with normals, but do I need them with ambient lighting?

Share this post


Link to post
Share on other sites
Advertisement
You don't need normals for ambient lighting. You need lighting enabled, ambient set in the material, and the ambient render state set.

You've got a bug somewhere else in your code. Disable the texture stages, fill the background with something other than black, and then draw the quad. Is it unlighted (i.e. black)?



Share this post


Link to post
Share on other sites
Good call... it wasn't rendering the quad at all. The problem I had was a bad render state. I was using alpha testing and had the wrong compare func. I'm not sure why the quad was ever rendering.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!