- Home /
Is there a way not to render all the triangles in a mesh?,Is there a way to not render all the triangles in a mesh
I want to create a procedural terrain in my game. I was wondering if there is a way to only render the triangles that the camera will see.,I want create a procedural terrain for my game. I want to know if there is a way to only render the triangles that the camera will see.
Answer by Bunny83 · yesterday
This happens automatically. Triangles that face away from the camera are not rasterized because almost all shaders have backface culling with the exception of some special shaders like particle shaders. Note this is only about "facing" the camera. That doesn't mean triangles that face the camera but are hidden behind other triangles. Those are rendered as well. So when you think about a game like minecraft, when you create a mesh from a voxel grid you generally only create faces / triangles of those voxels which are next to a transparent block. The majority of blocks in a minecraft world do not have any faces. In the case of MC when you create the mesh for a terrain chunk you check the 6 surrounding voxels and only create the faces that are next to a transparent block.
Your answer
Follow this Question
Related Questions
Terrain grow up when get close to it. 1 Answer
Unity terrain lights up at night 1 Answer
Possible to simulate screen raycast? 0 Answers
Camera is dislocated after build. 0 Answers
Set RenderQueue for Terrain 2 Answers