Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#ActualFantasyVII

Posted 17 October 2012 - 03:26 AM

How your model is built? If each leaf on your tree is separate ModelMesh, for 150k model it will create tons of batches. (you can simply check it by counting iterations of first foreach, the one with ModelMesh).
You can have 25k batches per second at 1ghz cpu, that leaves ~400 batches per frame to maintain 60 fps. It's wise to use less but large batches rather than small but many batches (it's because for each leaf you need to give gpu it's world matrix, texture etc).


well this is what I did in the draw method.

public void Draw(SpriteBatch spriteBatch)
{
foreach (ModelMesh modelMesh in model.Meshes)
{
spriteBatch.Begin();
spriteBatch.DrawString(spriteFont, "" + model.Meshes.Count, new Vector2(200, 200), Color.Red);
spriteBatch.End();
foreach (BasicEffect Effect in modelMesh.Effects)
{
//Code.....................
}
}


and I got 5901.

and this what SketchUp show
Posted Image
Uploaded with ImageShack.us

#1FantasyVII

Posted 17 October 2012 - 03:23 AM

How your model is built? If each leaf on your tree is separate ModelMesh, for 150k model it will create tons of batches. (you can simply check it by counting iterations of first foreach, the one with ModelMesh).
You can have 25k batches per second at 1ghz cpu, that leaves ~400 batches per frame to maintain 60 fps. It's wise to use less but large batches rather than small but many batches (it's because for each leaf you need to give gpu it's world matrix, texture etc).


well this is what I did in the draw method.

public void Draw(SpriteBatch spriteBatch)
	    {
		    foreach (ModelMesh modelMesh in model.Meshes)
		    {
			    spriteBatch.Begin();
			    spriteBatch.DrawString(spriteFont, "" + model.Meshes.Count, new Vector2(200, 200), Color.Red);
			    spriteBatch.End();
			    foreach (BasicEffect Effect in modelMesh.Effects)
			    {
//Code.....................
}
}

and I got 5901.

and this what SketchUp show
Posted Image
Uploaded with ImageShack.us

PARTNERS