basic lighting

Started by
1 comment, last by blaze02 17 years, 10 months ago
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?
-------Harmotion - Free 1v1 top-down shooter!Double Jump StudiosBlog
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)?



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.
-------Harmotion - Free 1v1 top-down shooter!Double Jump StudiosBlog

This topic is closed to new replies.

Advertisement