- Home /
Best way to render bunch of cubes/planes?
Id like to make a game based on cubes or planes similar to voxels. Something like a 3d-pixel game. What is the best way to do?
I tried Graphics.Drawmeshes, but after making 100x100 planes the fps drops to 8-10..
Answer by Username801 · Jan 28, 2021 at 11:32 PM
You need to combine all the cubes into one giant mesh and remove the internal faces. There is a great YouTube series on making a Minecraft clone in unity, that should help. Link.
Answer by wolfgraphicsLLC · Jan 29, 2021 at 09:36 AM
i have to agree with @Bunny83 here and this is also the reason for LOD on spawned and in world assets and even scene work. as well as level generation procedurally done.
LOD works for complex meshes with multiple vertices and triangles, but cubes and planes are a bit difficult to make any less detailed.
correct the lods are some what more complex however it depends on how it is made i can make say 2 pair of boots one set could be 150,000 k tris very high poly and look great very high detail, well can take and remake the same pair but around 20,000 reuse the same uv map from the high poly and kick up the resolution to 4 or even 8k and they would look just as good often better than the high poly one and wont be as near hard on cpu gpu on pc.
the point to the last statement is its really not about the detain bit the tris , face, and poly could as to how much surface of any one object just as @Bunny83 said break it down and even if had to populate an auto generated lvl with the job setup for spawning items and it would be clones not a physical item in the scene
Answer by Llama_w_2Ls · Jan 29, 2021 at 07:38 AM
They also use a method called chunks, which means loading and deloading objects that aren't in view distance of the camera anymore. This should prevent you from having to render unnecessary amounts of gameobjects in your scene.
Right, chunks are also needed for frustum culling. When a chunk is loaded but not in view it won't be rendered either. Creating one large mesh would be worse for performance as a mesh is one object and has to be rendered as one. So dividing the ground into chunks is a logical step for voxel games like $$anonymous$$C.
Your answer
Follow this Question
Related Questions
instantiate works on one but not other object 0 Answers
Demolishable object that won't kill my framerate 3 Answers
Cube made out of many voxels 0 Answers
Cube style terrain 1 Answer
"simplified" plane (with not so many faces/vertices) 4 Answers