Archived

This topic is now archived and is closed to further replies.

DrawIndexedPrimitive - confusion about parameters

This topic is 5505 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

Ok, I have some fconfusion about the Parameters if the IDirect3dDevice interface. According to my documentation, the params are: * Type * BaseVertexIndex * MinIndex * NumVerticces * StartIndex * PrimitiveCount My problem is that I seem to have a misunderstanding here. I have a VertexBuffer containins vertices for a number of terrain patches (4225 vertices each, 9 patches, directly one behind the other). I have an IndexBuffer that contains the index information for all of these patches as triangle lists. These are 8192 triangles per "patch texture layer", for a total of 24576 indices. Again, the indices are in the same "order" than the vertices, and they start with 0 for every vertex patch. Now, when drawing the 9 terrain patches, they show up terribly distorted, at least everything afte rthe initial one. So, just some questions: (a) what is the BaseVertexIndex? Am I correct that this number is added to the index numbers of every index processed to point to the "real vertex"? This way Vertex 0 in patch three would stay Vertex 0 for the indices, just with a higher "BaseVertexIndex", repositioning the 0 to the start of the third vertex "slice"? (b) MinIndex, NumVertices - it is said that this is used for opimisation. So this should be: MinIndex: Nr of the first index used, NumVertices - number of vertices. (c) StartIndex - start position in the index buffer. This should basically point to the first index in the "index array" that the IndexBuffer is, (d) PrimitiveCount - the number of primitives drawn, in this particular case 1/3 of the number of indices. Question: (a) I know (with 16 bit indexing) - I can ONLY have 65536 vertices in a VertexBuffer for an indexed call. Fine with me. But - I CAN have more indices, or? I mean, the IndexBuffer can contain, lets say 300.000 indices? Regards Thomas Tomiczek THONA Consulting Ltd. (Microsoft MVP C#/.NET)

Share this post


Link to post
Share on other sites