Materials on .x models

Started by
4 comments, last by ACAC 20 years, 7 months ago
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);
	}
Advertisement
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]
_______________________________________Understanding is a three edged sword...Freelance Games - Home of XBLIG Starchonwww.FreelanceGames.com
You have to copy the ambient colour into the diffuse.
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

Niko Suni

I''m not sure why it works but copying the Ambient to the diffuse does work...
I have to admit, i''ve never seen this behavior on .x files.
Anyone care to explain?

-Nik

Niko Suni

This topic is closed to new replies.

Advertisement