Original Post
So does the .x file only support 1 texture? Ive been using obj up until now. So how would i also use spec maps, normal maps etc etc with the .x file?
//load the mesh, get pointer to the mtrl bufferD3DXLoadMeshFromX(filename.c_str(), D3DXMESH_SYSTEMMEM, device, &adjBuffer, &mtrlBuffer, 0, &numMtrls, &mesh));//load the materialsif( mtrlBuffer != 0 && numMtrls != 0 ){ D3DXMATERIAL* d3dxmtrls = (D3DXMATERIAL*)mtrlBuffer->GetBufferPointer(); for(DWORD i = 0; i < numMtrls; ++i) { D3DMATERIAL9 m; m.Ambient = d3dxmtrls.MatD3D.Diffuse; m.Diffuse = d3dxmtrls.MatD3D.Diffuse; m.Specular = d3dxmtrls.MatD3D.Specular; m.Power = d3dxmtrls.MatD3D.Power; // Check if the ith material has an associative texture if( d3dxmtrls.pTextureFilename != 0 ) { //load the texture } else { // No texture for the ith subset //load a default texture } //store the material //store the texture }}# Max2Mtl Version 4.0 Mar 10th, 2001#newmtl 01_-_DefaultKa 0.6 0.6 0.6Kd 0.6 0.6 0.6Ks 0.9 0.9 0.9d 1.0Ns 0.0illum 2map_Kd Autumn_Leaves.jpgmap_Ks Dock.jpgmap_d Tree.jpgbump Green_Sea_Turtle.jpg## EOFQuote:
Original post by wforl
hmm, i was referring to the .xfile, and how the materials store textures names in that, and then how to read those back.
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more