Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#Actualdavepl1968

Posted 08 March 2013 - 05:28 PM

It seems that every sample I've come across so far simply loads models with Content.Load<Model>(etc).

 

Then, when its time to draw them (in the XNA case) you wind up looping through the model.Meshes and drawing them.  This can't be very fast if its has to push all the vertex data of the model back to the card (or graphics device, whatever) each time.

 

So, I presumed that the right thing to do (especially if you have a model that's reused a lot) would be to load each of the meshes into a vertex buffer, keep track of the index, all of that.  Then, when you draw, you could use your card's vertex buffer DrawIndexedPrimitive() instead of mesh.Draw(), and it would use the vertexes already loaded into the card-controlled memory.

 

My questions are

(a) is this happening behind the scenes with Load<Model> and mesh.Draw() and I just don't realize it?

(b) if not, does anyone have an example they could point me at that does it "right" that I can learn from?

 

Thanks!

Dave


#1davepl1968

Posted 08 March 2013 - 05:27 PM

It seems that every sample I've come across so far simply loads models with Content.Load<Model>(etc).

 

Then, when its time to draw them (in the XNA case) you wind up looping through the model.Meshes and drawing them.  This can't be very fast if its has to push all the vertex data of the model back to the card (or graphics device, whatever) each time.

 

So, I presumed that the right thing to do (especially if you have a model that's reused a lot) would be to load each of the meshes into a vertex buffer, keep track of the index, all of that.  When, when you draw, you could use your card's vertex buffer DrawIndexedPrimitive() instead of mesh.Draw(), and it would use the vertexes already loaded into the card-controlled memory.

 

My questions are

(a) is this happening behind the scenes with Load<Model> and mesh.Draw() and I just don't realize it?

(b) if not, does anyone have an example they could point me at that does it "right" that I can learn from?

 

Thanks!

Dave

 

 

 


PARTNERS