Skip to main content
GameDev.net gamedev.net
🔒 Locked

Materials?

Started by guillermoro Jan 21, 2006 at 7:45 PM 2 replies 1k views
Original Post
guillermoro
guillermoro
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?
guillermoro
guillermoro
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
Xeile
Xeile
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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.