GameDevTecnico / cubos

A still very barebones game engine focused on voxels and data-oriented programming
https://gamedevtecnico.github.io/cubos/
MIT License
83 stars 23 forks source link

Cull deferred lighting light volumes #1180

Open RiscadoA opened 3 months ago

RiscadoA commented 3 months ago

Problem

We spend time handling tons of lights even if their effects aren't visible.

Solution

After implementing #211, we could associate a bounding box to each light. Then, in the deferredShadingPlugin, we simply only render the lights for each camera which intersect with its frustum, using the utilities defined in #1184.