Archived

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

ACAC

Materials on .x models

Recommended Posts

ACAC    122
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
Sean Doherty    144
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   
Guest Anonymous Poster
You have to copy the ambient colour into the diffuse.

Share this post


Link to post
Share on other sites
Nik02    4348
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