I wonder when building a terrain out of different small objects if there is a feature to “remove” the unseen polygons in meshes. For example when putting different small rocks together to get a big formation of rocks there is so much stuff which can’t be seen inside the game but still gets calculated, right?
What is the best practice to build a detailed map with rocks, trees and buildings without using a to high polycount?
Best practice is to ignore this as being a problem, because generally it’s not actually going to be a significant bottleneck.
The only time it’s likely to be a problem is if you’re doing mobile VR. In which case you’re going to have to be really selective about the geometry you put into the game to begin with, and if you want to really optimize it or push the detail you’ll need to remove the unnecessary vertices (which is much more important than removing triangles) in an external application before importing the mesh into the editor.
Good question. But it is a semi tough question to answer.
Because according to how the map you designed looks on paper, means, there might be a specific way, or a few specific ways to build, model and detail that map in 3d, especially if you don’t want to use a high polycount. The other thing is, we have no idea what the map you imagined looks like, so it is difficult to give an upfront answer. Note, this is not your fault, as alot of people go through this problem too. If possible, could you show us a sketch or concept, of the map you want to make?
There are a bazillion of articles on the internet concerning level design that I recommend you to have a look at, since alot of the level design process is the same no matter what engine you are using. In regard to the subject of this post, what you’ld be looking for to hide “rocks behind other rocks” is called Occlusion Culling, although it’s not used to hide small objects behind other small objects, but more in the fashion of occluding large( or large-ish ) sections of a map that are hidden behind an object of relatively large size (like a wall, or mountain, etc.)
By doing some research on level design, one of the subjects you’ll encounter is OC. But to be able to use occlusion culling properly it’s also important to understand the fundamentals aswell, in particular how to plan map layouts, what obstacles that could end up as bottlenecks aswell as how such bottlenecks could be avoided or reduced. It’s often tricky to optimize a map if it has not been properly planned to start with- but it can also be easy to waste unnecessarily much time optimizing a map in places where it doesn’t need to be.
Theres so much in optimization, OC being only one, but an important one. As previously stated, we cant see your map to know scale, objects, etc. so answers like this will be “generalized”.
Take a look at this video (below) and how the map is designed by adding a LOT of single objects to it. Most part of this objects are hidden and never will be seen by a player. The parts where they intersect for example or what is below the terrain ground. This stuff still is there and gets drawn, right? But it never will be visible… so I thought this is not a “good” way to design a map but you can see this approach everywhere and I wonder if this can be optimized somehow and how you avoid this kind of “Brute Force” editing and throwing in polygons / vertices you never will see?
Video:
(about 1:30 minutes into the video, where he is starting to put the rocks on the map!)
I think youtubers like Sykoo are poor examples for studying level design. Since all they are concerned with are pretty videos with zero real game application. Always working with single camera view only is the most obvious sign.
That is a single scene, and only a part of one. If you were to build a complete map by deving that way, the sheer number of objects would be insane, and you would have next to no fps. As DimitriX89 said, its not real game applicable.
If you read the comments for that video, he says when done he was getting 60fps…thats honestly pretty bad for a single area of a scene. You should not follow these videos or believe it can be done in a game, not possible. Ive created the same type of deving in a full scene/map, and the performance was horrible, even when optimized and stream chunking terrain, nothing worked.
You can create a very high poly and detailed rocks or models and the convert them using simplygon to the very low poly models (bake everything on the textures):
All is a strong word. Used in a lot of AAA games is more accurate. Many AAA games still hand author their lower poly models, or use internal tools to do it rather than Simplygon. There are also tools to reduce the polygon count of a model included in almost every modelling program in existence that can get you 90% of the way.
Simplygon is extremely good at it compared to most tools though.
However it’s just a single object polygon reduction tool. It doesn’t know if polygons won’t be visible due overlapping or being embedded in another separate mesh or the terrain, and thus won’t remove those.
@DimitriX89 's comment above still applies. If they’re building to a single camera view, it’s probably not a great reference for the optimal way to do something for a real time game.
That said, it’s totally the way many games have been successfully made. It’s not optimal, but it will get the job done. Many very successful games have been made by just placing objects manually everywhere. They may not be games known for their excellent performance, but that brings me back to my original comment of ignoring the problem until it becomes an issue. It also depends greatly on the kind of game you’re trying to make. If you’re going to make a large world using the above techniques of manual placing objects, the bottleneck is going to be how long it takes to fill out the world probably before the performance becomes an issue. Unless you’re doing mobile VR or something else similarly extremely performance constrained.
Unity’s built in terrain tools for grass and object placement, or tools on the asset store like Vegetation Studio, can greatly speed up how easy it is to place and tweak the density of scattered objects, as well as handle more performant ways of rendering and culling those objects than manual placement would. For larger objects like buildings or larger structural elements that do need to be hand placed it’s all a balancing act of trying to add enough detail in your meshes to look good without causing a performance problem. Though @aliyeredon2 's mention of Simplygon brings up the importance of using LOD meshes and/or an impostor system like Amplify Impostors on especially high vertex count meshes.
But micro optimization like culling hidden faces on every placed mesh just generally isn’t something done anymore today. It’s not worth the time to implement over other more general purpose optimizations.
Those are screenshots from Skyrim if you don’t recognize it. Not exactly a small game. Bethesda is well known for just shoving massive models into walls / the ground if they only want part of it rather than making bespoke versions of the assets with the extra parts removed. In Fallout games it’s not unusual for more of the mesh to be hidden underground or behind a wall than visible.
If optimisation of hidden faces concerns you, then there is an option is to place your decorative meshes using some 3d modeling application that supports Boolean operations. For example, newest Blender’s Boolean modifier can work on Collections (sort of scene layers), which is ideal for joining together large number of objects such as rocks while removing their internal faces (if Boolean Union is used). Then, you could Boolean Subtract your terrain from the rocks’ mesh, further optimizing it.
I did not try to export terrain from Unity to other applications, but heard it is possible, either using 3rd party assets or some standard functionality.
On topic of export, at the very least Unity can export terrain heightmaps. Then, it will be on you to recreate the terrain in the editor of choice using some kind of Displace modifier
Boolean operations can add more vertices to a mesh than it removes, especially on complex intersections.
Unity’s terrain dynamically tessellates on the CPU based on distance. Tools that export Unity’s terrain mesh exporting usually exports the highest tessellation level across the entire terrain, but that means the most added vertices, as the terrain will be the most detailed version and thus have the most complex intersection. It also means objects placed on the terrain might appear to hover or have holes as soon as you move away from them as the lower detail terrain tiles don’t perfectly match the higher detail tiles leaving gaps between the terrain and the “perfectly” booleaned cut.
Booleans are an excellent tool for modeling complex hard surface shapes. They’re rarely any kind of optimization.
This really is a non issue that you shouldn’t waste time worrying about. You’ll create more problems for yourself than you’ll fix if you try to focus on this “issue” as there are many other much lower hanging optimization techniques to focus on first.