Skip to main content
GameDev.net gamedev.net
Using GameDev.net for your class this semester?
Learn more →
🔒 Locked

MDX Replacing DrawSubset

Started by janoside Jan 18, 2007 at 1:27 PM 0 replies 750+ views
Original Post
janoside
janoside
In order to perform instancing of Direct3D Meshes the way I want to, I'd like to replace the DrawSubset method with my custom implementation. I have looked through the forums and saw a couple of implementations which are very similar to what I have. Unfortunately, when I render my scene with this replacement implementation, none of the meshes are visible. I ran NVPerfHUD on the application and all of the draw calls are still being made (evidenced also by an identical framerate for either implementation). Does anyone have any idea why my custom implementation would result in nothing being rendered? My implementation:

AttributeRange attribRange = mesh.GetAttributeTable()[id];

device.VertexFormat = mesh.VertexFormat;
device.SetStreamSource(0, mesh.VertexBuffer, 0);
device.Indices = mesh.IndexBuffer;
device.DrawIndexedPrimitives(
	PrimitiveType.TriangleList,
	0,
	attribRange.VertexStart,
	attribRange.VertexCount,
	3 * attribRange.FaceStart,
	attribRange.FaceCount);

Any ideas are appreciated.
-janoside [Firestorm Engine]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.