   I am confused about the color in dx9...
  I am confused about which factors affect the color on the screen.when specify a vertex a color value like D3DCOLOR_RGBX(255,0,0) and the vertex is the first vertex of a triangle,the triangle will be drawn red.(flat mode is assumed).and when i use material. if i set the Diffuse.r = 1.0 and other fields = 0, and use a red light to light the triangle,the triangle will be drawn red too.so which one -the color specified in the vertex structure or the material- decides the final color shown on the screen?and when i map a texture to the triangle,the problem is more complex. there are colors on the textrue,in the vertex stucture and on the material,and how do these colors affect the color on screen? please help me, or tell me which page to study in the sdk.   
  For fixed-function shading, the runtime chooses which color to use for diffuse calculations based on what you have set as your D3DRS_DIFFUSEMATERIALSOURCE renderstate.  This diffuse color is then multipled with the dot product of N and L, as per the standard diffuse lighting equation. Specular, emissive, and ambient, all follow the same rule.  Textures affect the final pixel color based on how you set your texture stage state.  For example you could have your texture color modulated with the diffuse lighting component by specifying D3DTOP_MODULATE as your colorop and D3DTA_DIFFUSE, D3DTA_TEXTURE as your arguments.Honestly I wouldn't spend too much time worrying about the fixed-function stuff, these days it's been fully replaced by programmable shaders.  And with programmable shaders you never have to wonder about what vertex calue does what, since you're the one who decideds what to do with them.   ;Quote:tell me which page to study in the sdk.It would perhaps be better if you let us know what you've looked at in the sdk information that you don't understand. Use the sdk search function and information index to look up information on lighting and materials.Also, there are tutorial projects in the SDK that render colored objects, then textured objects, etc., each one adding more complications. Give those a try. Make simple changes here and there in the code and see what effect each change has.Google for examples of what you want to learn about (NeHe, for example).I would suggest you get a good understanding of how fixed functions work before you get into vertex shaders (if you have any interest in them) as it is much easier to trouble-shoot fixed function coding than it is shaders.;  thanks for helpsafter some test,i find out that when i set the D3DRS_LIGHTING ture,the vertex color will make no sense. so i think that vertex color will only be draw when the state D3DRS_LIGHTING is set false.and i find out that both texture and material will affect the appearance of the object.   