Direct3D mesh problem...

Started by
1 comment, last by bangz 20 years, 1 month ago
I''m getting a really strange problem. I''m rendering two objects, a mesh and an index buffer (both have different textures). But, for some reason, the index buffer object has just a black texture, although if I just comment out ''m_mesh->DrawSubset(i);'' the texture displays fine on the index buffer objects. I am not apply material propertise to either, and I also have lighting disabled. Changing the order that I render the objects doesn''t help. Does rendering a mesh set any states that I''m not aware of? regards, bangz. http://www.bangz.co.uk
Advertisement
Could you post your render code? It should look something like this:
for(DWORD i = 0; i < dwNumMaterials; i++){  m_pd3dDevice->SetTexture(0,pMeshTextures);<br>  m_mesh->DrawSubset(i);<br>}<br><br>m_pd3dDevice->SetStreamSource(….);<br>m_pd3dDevice->SetIndices(….)<br>m_pd3dDevice->SetFVF(….);<br>m_pd3dDevice->SetTexture(0, pTexture);<br>m_pd3dDevice->DrawIndexedPrimitive(….)<br> </pre> <br>neneboricua   <br><br><SPAN CLASS=editedby>[edited by - neneboricua19 on February 26, 2004 11:52:08 PM]</SPAN>
Ahhh, cheers!

Your code reminded me that I wasn''t setting m_pd3dDevice->SetFVF(....); when I rendered my index buffer. Obviously when rendering the mesh it will change the vertex format. Doh!



Cheers,
bangz.

This topic is closed to new replies.

Advertisement