Thanks :roll:Originally Posted by gnoch
OK, opening DirectX 8.0 SDK help: page "Mathematics of Direct3D Lighting" or directly from here: Diffuse Lighting (DirectX 8.1 C++ Archive):
[Vd is Vertex diffuse color]
The value for Vd is one of three values: one of the two possible vertex colors in a vertex declaration, or the material diffuse color. The value is:
vertex color1, if DIFFUSEMATERIALSOURCE = D3DMCS_COLOR1, and the first vertex color is supplied in the vertex declaration.
vertex color2, if DIFFUSEMATERIALSOURCE = D3DMCS_COLOR2, and the second vertex color is supplied in the vertex declaration.
material diffuse color
PS. You have to check is current card suports DIFFUSEMATERIALSOURCE at all (can't recall right now how to check this)
PPS. So, solution is to use COLOR1 and COLOR2 data field in vertex, and using COLOR2 to modulate material based color. Or move diffuce encoded alpha to light alpha and use DIFFUSEMATERIALSOURCE = D3DMCS_COLOR1. Or use COLOR1 and TFACTOR (skipping lighting altogeter)
Bookmarks