Custom Mesh Format

Best method for creating and drawing a custom mesh

Page 1 of 1

0 Replies - 1729 Views - Last Post: 06 April 2009 - 05:52 AM Rate Topic: -----

#1 SigurdSuhm   User is offline

  • D.I.C Head

Reputation: 18
  • View blog
  • Posts: 111
  • Joined: 05-August 08

Custom Mesh Format

Posted 06 April 2009 - 05:52 AM

Hey everyone.

I'm still working on my game engine project in C# using both DirectX 9 and 10. Now I've decided to write a custom mesh format which should be drawable by both versions of Direct3D. I've been doing some thinking about the approach.

For now I have an array of vertices and an array of indices within the custom class and I'm wondering what would be the best approach for drawing the mesh. One approach could be creating an encapsulated vertex buffer and index buffer within the actual class and use those for drawing. Performance wise I'm thinking that this would probably be the best approach since I don't have to pass a lot of value types around all the time.

The other way would be to throw the vertices into the vertex buffer of the graphics device when I'm drawing. But I'm concerned that this way would be too slow in managed code. I may be missing something here though.

I believe the DirectX mesh classes use their own buffers for drawing but correct me if I'm wrong. Any input on this matter would be greatly appreciated. Thanks in advance.

Regards
Sigurd

Is This A Good Question/Topic? 0
  • +

Page 1 of 1