Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am writing a game in XNA 4 and I want to have something like a corridor. Do you think that is better to use one big and solid model, or to use multiple small parts (window, stairs, door...)?

share|improve this question
up vote 8 down vote accepted

In terms of graphics rendering, one large mesh is faster to draw than several smaller meshes.

If you're talking about something like a corridor, it's probably not going to be that intensive for the GPU if you send it in as a door and a floor and some walls. The smaller meshes also allow you to fiddle with positioning more easily.

If your drawing becomes a bottleneck, then consider it.

share|improve this answer
It doesn't have to be faster. Take the world of Oblivion, rendering this as one would just be stupid and very slow since you can't choose what sections are visible to the player. You will end up wasting a ton of resources – Peter Ølsted May 22 '11 at 14:27
His example was a corridor. If he had said 'the entire world', I would've mentioned that. :P – The Communist Duck May 22 '11 at 14:31
Well spoken, my bad – Peter Ølsted May 22 '11 at 14:55
yes, my level scene is corridor link – Vodáček May 23 '11 at 10:35
With that scene, definitely several elements. It would be a real pain to change the scene in 3DMax, blender or whatever. And as "The Communist Duck", if it becomes a bottleneck and you are sure its the model and not anything else, than maybe (if the performance is really that important) you can do it. – Peter Ølsted May 23 '11 at 18:46

I'd suggest keeping the door as a separate model, unless you're certain you never want to be able to open it.

Windows if they are transparent also want to be separate models so they can be depth sorted appropriately for rendering.

Everything else should probably be a single model and texture for best performance, and to eliminate any cracks where they join together.

share|improve this answer

If your level has too much detail you should split it in parts and apply some frustum culling to draw only currently visible meshes.

share|improve this answer
I have alredy using this method, but I think that works only for whole model (not for meshes), but is posible that us depends on my drawing code. – Vodáček May 23 '11 at 10:30
Whether it depends on the whole model or the meshes depends on your renderer, or how you have implemented the culling. Vertices are vertices. – dcousens May 24 '11 at 12:19

in most cases using small parts are worth it because it gives your code reusability and flexibility; and in case of a corridor or something similar that does not include MANY (many would mean a number like at least 40) smaller parts, the performance gain of using a big and solid models is negligible(except if you are drawing the object many times per frame).

if you care about the performance i recommend precomputing the lighting or using some kind of vertex arrays(vertex buffers?) which would actually make a difference. ( if those things are possible in XNA - i dont know a lot about XNA )

p.s. : the first paragraph of this post is correct only about drawing ( not about for example using separate physics models for parts of the corridor )

share|improve this answer

Your Answer


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.