# CDXUTMesh Renders Only Textures?

## Recommended Posts

I have been playing around with loading meshes into a program for University project, and have come across the CDXUTMesh class that is included in the common files with most of the Directx 9c SDK examples. This seems like a nice class however when i tried to use it it seemed to render my mesh totally black. I thought this was wierd because it rendered fine when i substituted my mesh for the tiger in tutorial 6 mesh loading in the SDK. Looking further into it i noticed when i textured my mesh it displayed fine using the class however none of the material effects were applied? So my question is, what is going on here? Am I doing something wrong? To demonstrate my point substitute my mesh for the dwarf in the compiled effect sample (C:\Program Files\Microsoft DirectX 9.0 SDK (Summer 2004)\Samples\C++\Direct3D\CompiledEffect) and see what i mean.. Thanks, Mike

##### Share on other sites
In the code try setting the material explicitly. I've had a similar problem with X files not containing material data so it either renders black or not at all. At least if you were to manually set the material type in the program you would know whether the problem is with the X file or with the code.

##### Share on other sites
just tried:

m_pMaterials[i].Diffuse.r =1.0;m_pMaterials[i].Diffuse.g =1.0;m_pMaterials[i].Diffuse.b =1.0;m_pMaterials[i].Ambient.r =1.0;m_pMaterials[i].Ambient.g =1.0;m_pMaterials[i].Ambient.b =1.0;

still black :(

When i add a watch to the materials pointer and add a breakpoint it tells me there are 29 materials and when i inspect them they all have different values so im guessing it is reading them in fine but just not displaying the materials for some reason?

Cheers,
Mike

## Create an account

Register a new account

• ## Partner Spotlight

• ### Forum Statistics

• Total Topics
627638
• Total Posts
2978327

• 10
• 12
• 22
• 13
• 34