开发者

Direct3D: Vertex color component vs. IDirect3DDevice9::SetMaterial

What are the differences between the two approaches 开发者_开发百科to coloring my Direct3D model?


Well if you do it via a material then the whole Draw(Indexed)Primitive call will provide you with a single colour in the lighting equation (ie the one set in set material).

If you set it as a per-vertex colour then each vertex can have a different colour AND each colour will be interpolated across the polygon.

Of course bear in mind that you have different colours that can come from per-vertex and material (ie Emissive, Ambient, Diffuse and Specular). To truly understand what it is doing under the hood I recommend you read the article on the mathematics of lighting in MSDN.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜