|
VisuTwin Canvas
C++ 3D Engine — Metal Backend
|
#include <scene/lighting/worldClusters.h>
Public Member Functions | |
| const Vector3 & | boundsMin () const |
| Vector3 | boundsRange () const |
| const uint8_t * | cellData () const |
| size_t | cellDataSize () const |
| Vector3 | cellsCountByBoundsSize () const |
| const ClusterConfig & | config () const |
| int | lightCount () const |
| const GpuClusteredLight * | lightData () const |
| size_t | lightDataSize () const |
| void | update (const std::vector< ClusterLightData > &localLights, const BoundingBox &cameraBounds) |
| WorldClusters (const ClusterConfig &config=ClusterConfig{}) | |
CPU-side 3D grid clustering for local lights (point/spot).
Divides the world into a 3D grid. Each cell stores indices of lights whose AABB overlaps that cell. The GPU fragment shader looks up its world position in the grid and only evaluates lights in the matching cell.
WorldClusters adapted for Metal buffer access. CPU-only: produces data arrays that the renderer uploads to GPU buffers.
Definition at line 69 of file worldClusters.h.
|
explicit |
Definition at line 17 of file worldClusters.cpp.
References cellDataSize(), and config().
|
inline |
Definition at line 91 of file worldClusters.h.
|
inline |
Definition at line 92 of file worldClusters.h.
Referenced by cellsCountByBoundsSize().
|
inline |
Definition at line 87 of file worldClusters.h.
|
inline |
Definition at line 88 of file worldClusters.h.
Referenced by WorldClusters().
| Vector3 visutwin::canvas::WorldClusters::cellsCountByBoundsSize | ( | ) | const |
Definition at line 25 of file worldClusters.cpp.
References boundsRange().
|
inline |
Definition at line 95 of file worldClusters.h.
Referenced by WorldClusters().
|
inline |
Definition at line 85 of file worldClusters.h.
|
inline |
Definition at line 83 of file worldClusters.h.
|
inline |
Definition at line 84 of file worldClusters.h.
| void visutwin::canvas::WorldClusters::update | ( | const std::vector< ClusterLightData > & | localLights, |
| const BoundingBox & | cameraBounds ) |
Called per frame: collect lights, build grid, pack GPU data arrays.
| localLights | Local lights (point/spot) collected from LightComponent. |
| cameraBounds | Camera frustum AABB for grid bounds computation. |
Definition at line 34 of file worldClusters.cpp.