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

direct3d coloring?

Started by
0 comments, last by GameDev.net 24 years, 6 months ago
how do make triangles a certain color?
Advertisement
There are a couple of different ways. I'm not going to get into using lighting to do this, it's covered in the SDK under Direct3D\Direct3D Immediate Mode\Direct3D Immediate Mode Essentials\Materials and Lighting.

Probably the easiest way to do it, is to disable Direct3D's lighting module, by calling
pd3dDevice->SetRenderState(D3DRENDERSTATE_LIGHTING, FALSE);
Then, create a lit vertex, with the FVF format D3DFVF_LVERTEX. Set the vertex color (don't worry about the specular somponent) to whatever color you want. These colors are RGB triples, so for bright red, the color would be 0xFF0000.

This topic is closed to new replies.

Advertisement