Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am using WinForms Sample downloaded from microsoft website. The problem is, that the model loading time is quite long, using:

contentBuilder.Add(ModelPath, ModelName, null, "ModelProcessor");
contentManager.Load<Model>(ModelName);

even a simple model, such as a cube with no textures, takes 4+ seconds to load. Now, I am no expert on this, but is there anyway to decrease loading time?


EDIT:

I've gone thru the code and found out that calling contentBuilder.Build(); ,which comes right after contentBuilder.Add() method takes up most of the time.

share|improve this question
    
The ContentManager can be very slow when running in Debug mode. Do you get the same results when switching to Release mode? –  Aaron Kabashi Dec 15 '12 at 20:03
    
Actually 3-4 seconds was in release mode, debug mode takes up to 6 seconds. –  user1806687 Dec 15 '12 at 20:33
    
It's compiling the .fbx/x model files when you run it. If you use content loading in a Windows forms application, you can always make it a Background progress with Background Worker or similiar. –  Deukalion Dec 16 '12 at 9:11
add comment

1 Answer 1

up vote 0 down vote accepted

I've found out that adding all models to contentBuilder: contentBuilder.Add(ModelPath, ModelName, null, "ModelProcessor");, and when all models are added, calling contentBuilder.Build(); and then looping thru all models and loading them contentManager.Load(ModelName); speeds things up. Before one model took around 3-4 seconds to load, this way 8 models took around 6 seconds to load, so it is a improvement but I still think this is a bit to much, but agan I am no expert on this matter.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.