GameDevTecnico / cubos

A still very barebones game engine focused on voxels and data-oriented programming
https://cubosengine.org
MIT License
83 stars 36 forks source link

Perform frustum culling for voxel meshes #1183

Open RiscadoA opened 4 months ago

RiscadoA commented 4 months ago

Problem

Currently we issue draw calls for all objects, even if they're not visible with a given camera. This makes it impossible to make games with big maps, as even objects which are not on screen end up greatly affecting the performance.

Solution

We should use the utilities defined in #1184 to check if the voxel meshes' bounding boxes intersect with each camera's frustum, on the gBufferRasterizerPlugin. If they don't, we simply don't submit a draw call for them.