• 11
• 9
• 10
• 9
• 11

# Materials?

This topic is 4474 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Just learning dx and im making small prgram that displays a polygon facing the viewpoint. The polygon is always white... I created a material object and use the IDirect3DDevice9::SetMaterial() function to set it. This has no affect. I also tried using color data in my vertex structure to no avail. I think the problem is i havnt created any lighting. Is this the problem?

Yes^^

##### Share on other sites
so if i add an ambient light will the material show a color. Specifically what color type ( i mean ambient diffuse or specular ). Also do i have to add normals to my polygon for the color to show if i add a light. Thanks

##### Share on other sites
Oh please note you can also do this:

lpDevice->lpDevice->SetRenderState(D3DRS_COLORVERTEX, TRUE);lpDevice->SetRenderState(D3DRS_DIFFUSEMATERIALSOURCE, D3DMCS_MATERIAL);lpDevice->SetRenderState(D3DRS_AMBIENTMATERIALSOURCE, D3DMCS_MATERIAL);

This should also drop some color on the screen, if I recall correctly.

Regards,

Xeile