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

Researching Direct3D9 Lighting

posted in IfThen Software
Published June 04, 2011
Advertisement
While doing some further research into the relation between a graphics API and the graphics driver, I came across this article: Mode Switching. I recommend reading it if you are interested in the things I discussed in the previous blog post.

I spent most of the day in research, mainly into the way lighting is performed in Direct3D9. Apparently you can set a material to specify ambient, diffuse, specular, and emissive colors, as well as the specular power. I originally thought that you had to pass this information in a vertex buffer. The layout of the MS3D file format makes a lot more sense now, since all of the colors are stored together rather than per vertex.

Another interesting thing I found out is that material colors specify how much of the incoming light affects the resulting color. Having a diffuse material color of (r:0.5 g:0.0 b:0.0) for example means that 50% of the red component of the light's diffuse color is used, and the green and blue components aren't used at all.

Reposted from http://invisiblegdev.blogspot.com/
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement