Search Unity

Question Prefabs/Game objects numbers limit

Discussion in 'Prefabs' started by unitedone3D, Nov 30, 2020.

  1. unitedone3D

    unitedone3D

    Joined:
    Jul 29, 2017
    Posts:
    160
    Hello there!

    I am wondering what is a limit of prefabs that can be used in unity if not using DOTS/ECS (I am guessing the computer/older engine are the limiting elements)...

    Let's say you have 35,000 prefabs in your (large) scene and sure enough you should start to see frame rate dropping at some point depending on the polygon content/tris/vertex count of the models in each prefab...

    I did some tests and it seems that Unity engine (and I'm guessing most 3d engines in general....and not so much the engine itself - the GPU capability only) is capable of around a few million polygons until it breaks down (around 3-10 million tris limit); so your scene could have 10 million polygons but it will start to struggle a lot (due to engine/GPU reaching maximum 3D processes capability)...

    Now I read that when you make a game you are faced with the objects/prefabs number limit problem:
    1- Do I have many game objects and prefabs....which apparently increases dramatically the draw calls the more 'objects' you have in the scene?
    2- Or Do I minimize the number of objects and prefabs to reduce draw calls/batch calls...by 'merging' objects together, 'combining meshes' together in 1 huge mesh containing all the meshes of your scene (as, 1 mesh).

    3- If you have 35,000 meshes in - 1 - prefab...is that faster than 35,000 prefabs containing 1 mesh each (totalling 35,000 meshes); both of these would equal to 10 million polygons...but it seems that it would not give the same result?

    4- If you have 35,000 meshes in 35,000 'game objects' is that faster than - 1 - game object containing 35,000 meshes?

    5- If you 'combine' 35,000 meshes in 1 mesh...is it faster if it is in 1 game object or 1 prefab (seems obvious, but with Unity/engines not always obvious of simply 'reduce numbers and things better')?

    6- What is faster, 1 game object in 1 prefab, or 1 prefab in 1 game object (is there any (speed) difference)?

    7- I read that 'mesh combining' is extremely fast because you combine all the total number of meshes in 1 object...but I also read that the final mesh is Very Heavy (in memory)...like say you combine 35,000 meshes (totalling 10 million polygons) into 1 huge mesh...it will be very heavy in memory (RAM) when loaded on GPU...and may crash your game/'lack of memory'...because loading a 10 million mesh on GPU is very heavy taxing in memory...thus, what do you do then (besides have to 'reduce polygon/tris count' of the meshes before combining it)?

    8- If your scene has 35,000 prefabs, which are -into- 35,000 Game Objects, and the total polygon count is
    10 million tris...how do you go about this? Do you combine it - and see that the final combined mesh is just too heavy (memory wise in RAM/can crash Unity by memory lack to load it on GPU/VRAM/RAM)...or you do something else...you use frustum culling/occluding/camera culling..or some other technique to allow you to use 35,000 prefabs/game objects totalling millions of polygons and getting 60fps roughly (1080p) on a new GPU (about a GeForce RTX 2700/Radeon RX 5700 XT)?

    9- Do you know any other ways to deal with such huge scenes on Unity 2020.1 (besides 'switch to DOTS/ECS, solved')?

    Thank you for any help!