How does unity deal with models in terms of performance

Sorry that the question doesn’t quite make sense. I’ll explain what I’m unsure about doing. I’m making my first models in blender to import in to unity and I’m not how I should make them for unity in the most optimal way.

Ive seen model houses on unity where the exterior and the interior are both present in the same model.

Before seeing these I’d just naturally assumed that I’d have an exterior building and then just loadlevel on opening the front door and load a new scene with just interiors.

Now I’m unsure what to do. If I was to do the first method and include both interior and exterior. Is this only going to affect the scene load time ?

Does unity only worry about what’s in the game scene in terms of frames per sec or is it everything

Loading a different level for interiors might be a workaround for complex scenes in some cases. You typically set a “polygon budget”, and various techniques can reduce your use of this (LOD levels and occlusion culling being important features for that in Unity), but other elements of the scene may affect it too. Using the lowest level of detail, lower texture resolutions and simpler shaders can make the difference for a scene built for both desktop and mobile.

Can the interiors be loaded really quickly on the platforms you intend to release the product on? Then it doesn’t matter. Make it the way you prefer. If not careful there, though, you can end up with weirdly TARDIS-like buildings where the interiors are way off the exterior scale :wink:

Is it more convenient to design the level as a whole in a 3D package, then break it up into individual models? Can the destination platform(s) handle it? Do so then - this is the best option for desktop platforms these days, and gives you matching inside and outside scale since the buildings aren’t designed twice.

Far too large textures for your VRAM can slow down a scene just as much as simply having too many polygons, since you’ll be swapping in and out textures from RAM to VRAM. A GPU with little VRAM is also typically one with less bandwidth, so you’re hit with two bottlenecks.

Further tricks people use to make complex interiors is to not have many loose objects. This is boring, but sometimes necessary. You can optimise a desk model with all the clutter on it by making the clutter part of the model. Writing implements and books and such are just more polygons in the model, while paper could simply be patterns in the shared texture for all of it. A good mobile interior would have all of the models’ textures inside the same atlas, making the draw call count minimal (one, ideally).

Pre-baked lights are also going to affect the whole thing. Once you have a scene that works smoothly with whatever moving objects you want in it (players, NPCs, weather and particle effects), you apply lighting and see what works. Dynamic lights look better but tend to be costly.

tl;dr: Without using occlusion culling and careful texture atlas layout plus LODs on models, Unity does very little to optimise your scenes. It may batch draw calls, but not even occlusion culling is entirely automatic.

1 Like

Thanks orb for an excellent answer and explanation. This really clears up stuff for me. I feel ive got a much better understanding of how this is all works together.

One problem I’m still struggling with is the poly budget. Is this a budget for how many polygons are going to be on the screen at any one frame or is this the total number on polygons in the scene as a total.

Thanks again

I think it’s normally the visible number of polygons - anything outside your view should already be optimised away (hopefully!) by the engine, while the ones in the distance are mainly what occlusion culling is about. It’s hard to find exact numbers because you usually don’t view a whole scene at once.

If you have a top-down game with a fairly close to the ground camera you can go wild with the complete scene, up to many millions for even mobile, since you might only be looking at under 100k polygons in the camera frame. I think mobile struggles beyond half a million visible polygons at once, maybe? Less for cheaper devices.

We’ve moved on to new tricks which reduce the need for polygons in the final game model, through layers of different types of maps (texture, detail, occlusion, displacement etc.) to give the impression of detail where there really aren’t polys. These different maps are baked from the source model, so game models can be far less complex while still retaining what’s needed for interesting visuals. Texture memory available is also all over the place on mobile, while on desktops even budget cards now have 4GB VRAM. Even integrated GPUs have cool shaders and plenty of memory.

I think the best rule of thumb for buildings is to model it and reduce polygon counts until you get to the step before you can tell the difference visually on a fully textured building, then optimise the textures down until you hit the last point that looks like maximum quality. On a desktop or console platform you’re also going to have to expect really high resolutions these days, which makes the texture resolution requirement for a good representation higher.

Then there are the character models. You can probably first do the same as for buildings. If you don’t have any advanced facial animation that’s one area to reduce the polys a lot.

Another rule of thumb often seen in top-down games is to focus on the torso and weapons, keep the legs low-detail. It’s probably going to be similar for a 3D single-player game, where the legs and torso can be fairly simple relative to the arms and weapons, but everything will be slightly more complex for multiplayer. At 10k-40k a character model will look very good, unless you’re going for something like L.A. Noire.

So it can be boiled down to: Go as low as you can before it hurts. If it’s still too heavy after occlusion culling and LOD tweaking, find trade-offs. Good shaders and textures can regain much of what you lose.

Disclaimer: I’m just a coder. I’m sure pro artists get yelled at enough about polygon waste to know more on the subject :wink:

1 Like

Wow thanks again for a great detailed answer. I completely get it now. This will really help moving forward.

I want to make 3D models for mobile games, so now I know how it works, I can do my best to optimise for it

Mobile limitations have their advantages too - you don’t have to make million-poly super-detailed models :wink: