Original Post
Hi all.. This is my first post here in the forum,and I am very happy to join all the programmers here.. I use DirectX 8.0 with VB6 to design 2D and 3D games...I made a simple demo representing FPS game..but here comes a problem..I use .x files for objects..it works fine but a friend told me to use index buffers for rendering..I searched and could implement that but the problem is if the mesh has more than one texture I will not be able to put all of them I just can put one only.. Mr.Jack Hoxley in his very good lessons in Directx4VB said that yes there is this problem and can be avoided by using multi-stage texturing and some other techniques,he did not explain how that happens,so is there someone here can help me.. in the loading of the mesh I get the vertex and index buffers like this: Set vertexBuffer = Mesh.GetVertexBuffer vertexBuffer.GetDesc vertexBufferDesc Set indexBuffer = Mesh.GetIndexBuffer indexBuffer.GetDesc indexBufferDesc then in the rendering section I use: Sub renderVI() Dim n As Integer n = 32 D3DDevice.SetMaterial MeshMaterials(0) D3DDevice.SetTexture 0, MeshTextures(1) D3DDevice.SetStreamSource 0, vertexBuffer, n D3DDevice.SetIndices indexBuffer, 0 D3DDevice.DrawIndexedPrimitive D3DPT_TRIANGLELIST, 0, Mesh.GetNumVertices, 0, Mesh.GetNumFaces End Sub notice that the MeshMaterials() and MeshTextures() are the materials and textures extracted in a previous step and I chose the index 0 and 1 respectively to have something as texture,now you understand what my problem is ,how can I put more than one texture on a mesh created by index buffer? Thanks..