- Home /
Minecraft Rendering?
Hello. I am going to try to be a as informative as possible.
Minecraft uses a rendering algorithm to not render faces that are covered up. Is there a way to do this in unity?
Answer by Bunny83 · May 19, 2012 at 03:37 AM
This has to be done manually like minecraft is doing it "manually". You would split up the world into chunks of blocks (in minecraft 16x16x16 blocks). Each chunk is one mesh which contains all faces that might be visible. A certain face of a block is considered visible when the adjacent block type is either air or a transparent block like glass, water, ...
Everytime a block in a chunk is updated (added / removed / changed) you need to rebuild / Update this chunk and the corresponding mesh.
All this isn't that complicated, but quite complex. Here's the MinePackage (Minecraft-starter-package) for Unity3d.
If you try to render the cubes seperated your frame rate will be around 0. Just a "small" piece, for example 100x100x100 has 1 million blocks. You can't have each of them as gameobject with it's own renderer / mesh.
If you think minecraft is a simple game, you guessed wrong. It's by far more complex than crysis when it comes down to technology.
Answer by syclamoth · May 19, 2012 at 02:38 AM
Occlusion culling. Keep in mind that despite the pixelly graphics and low vertex count, Minecraft is an extremely sophisticated game- don't expect to be able to emulate it without a lot of effort.
Occlusion culling works on a per-object basis, not per face. To do blackface culling on meshes, you should trust Unity to already do its thing as efficiently as possible.
Well, I was assu$$anonymous$$g backface culling already- but that still renders objects that obscured- all it culls are faces that are not directly facing the camera.