Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

SirPaladin

Diffuse and Material/Lights?

This topic is 5486 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 a quick question to make sure I understand how all the basics work. I''m going through all of Jim''s RPG cGraphics objects to make sure I understand it/them, and I''ve gotten past Materials and Lights (well, I think I have). My question is, I have the following Vertex Buffer described:
typedef struct sVertex 
{
	float x, y, z;
	float nx, ny, nz;
	D3DCOLOR Diffuse;
} sVertex;
 
When the light is on, my material takes over and displays red. When the light is off, my diffuse color takes over. My question is: Is there a way for the Material color and Diffuse color to "mix" per se when the light is on? When I have the light on, DirectX ignores my Diffuse color altogether. Just curious if there is a way to display both the material and diffuse colors together?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
they should anyways.

Share this post


Link to post
Share on other sites
You can instruct the lighting to use your vertex diffuse or vertex specular or material color for each component via D3DRS_DIFFUSEMATERIALSOURCE, D3DRS_SPECULARMATERIALSOURCE, D3DRS_AMBIENTMATERIALSOURCE, and D3DRS_EMISSIVEMATERIALSOURCE. Mixing vertex diffuse and material colors is not possible. You could always look into using a shader, and using software shader emulation for non-shader cards. This way you can do whatever you want.

Share this post


Link to post
Share on other sites
Thanks. I just wanted to make sure I understand the difference between diffuse and material in this case, and wanted to verify that it was not possible.

Thanks for answering my question .


Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!