Jump to content
  • Advertisement
Sign in to follow this  
guillermoro

Materials?

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

If you intended to correct an error in the post then please contact us.

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?

Share this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!