Advertisement

How to tell which face of a ID3DXMesh is mapped to which material slot?

Started by August 01, 2017 06:28 AM
1 comment, last by vinterberg 7 years, 6 months ago

Just didn't know why when I try to retrieve the attribute table from the m_pOrigMesh after it gets loaded, it reports zero attributes, only after I setup the subsets, that is the attribute table manually.   I would like to first assign the original materials to the attribute table or buffer an initial value, and when I want to change certain parts, I alter the table. But since I don't have this information handy, that is which face is mapping to which material slot, when I make up a certain material for a certain subset, I need to make up the rest of the material mapping, which the original intentions were no change.

Any ideas?

Thanks

Jack

 


	if (FAILED(D3DXLoadMeshFromXA(pFilename, D3DXMESH_MANAGED, d3d::GetInstance().GetDevice(),
            NULL, &l_buff, NULL, &numMats, &m_pOrigMesh)))
        {    
            cout << "Failed to load mesh: " << pFilename << endl;
            throw(cError);
	        }
    }
    else
    {        
        cout << "Failed to load mesh: " << pFilename << endl;
        throw(cError);
    }
	 
    D3DXMATERIAL* _mats = (D3DXMATERIAL*)l_buff->GetBufferPointer();    
	    DWORD numFaces = m_pOrigMesh->GetNumFaces();
	  

I thought you had switched to DX11/Assimp, as per a recent thread....

DX9/X file format is not the way to go today IMHO

.:vinterberg:.

This topic is closed to new replies.

Advertisement