Sign in to follow this  

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

This topic is 3593 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[i] = NULL; if( d3dxMaterials[i].pTextureFilename != NULL && lstrlen(d3dxMaterials[i].pTextureFilename) > 0 ) { // load a texture for each subset of the mesh D3DXCreateTextureFromFile( gd3dDevice, d3dxMaterials[i].pTextureFilename, &g_pMeshTextures[i] ); } } 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

This topic is 3593 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this