Jump to content
  • Advertisement
Sign in to follow this  
lejianwei

How to bind 2 textures for each subset of a .X file?

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

Hi, I am rendering a complex Maya-made .x file(ID3DXMESH) model which has many subsets. I want to bind 2 textures(Color map & Normal map) for each subset of the model. However. I don't know how to render all the subsets in a shot. Now I am using: // load the mesh D3DXLoadMeshFromX("Terrain.X", D3DXMESH_MANAGED, gd3dDevice, NULL, &pD3DXMtrlBuffer, NULL, &g_dwNumMaterials, &mTerrain); for( DWORD i=0; i<g_dwNumMaterials; i++ ) { g_pMeshTextures = NULL; if( d3dxMaterials.pTextureFilename != NULL && lstrlen(d3dxMaterials.pTextureFilename) > 0 ) { // load a texture for each subset of the mesh D3DXCreateTextureFromFile( gd3dDevice, d3dxMaterials.pTextureFilename, &g_pMeshTextures ); } } In this way I can only load a single texture for each subset of the mesh, How to load two textures(color & norm) for each subset? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!