Archived

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

Materials on .x models

This topic is 5181 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

For some reason materials arent being shown on my loaded models, does anyone know why? The materials are actually loaded...ive stepped through in the debugger and drawn as follows
	for(DWORD i=0; i < pMesh->m_NumMaterials; i++)
	{
		//set the material and texture

		m_pDevice->SetMaterial(&pMesh->m_pMaterialList[i]);
		m_pDevice->SetTexture(0,pMesh->m_pTextureList[i]);

		//Draw mesh subset

		pMesh->m_pMesh->DrawSubset(i);
	}

Share this post


Link to post
Share on other sites
quote:

For some reason materials arent being shown on my loaded models, does anyone know why?



I recommend that you verify that you have lighting enabled and that your light source is pointing at the object. Also, you can verify that your mesh displayable using DirectX Mesh viewer.




Understanding is a three edged sword...


[edited by - Sean Doherty on October 11, 2003 12:13:38 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You have to copy the ambient colour into the diffuse.

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
You have to copy the ambient colour into the diffuse.


Why do you think that''ll help?
Ambient and diffuse are independent, and .x has capability to store them independently as exported.

-Nik

Share this post


Link to post
Share on other sites