Sign in to follow this  
blaze02

basic lighting

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this