79 void update(
const std::vector<ClusterLightData>& localLights,
85 int lightCount()
const {
return static_cast<int>(_gpuLights.size()); }
87 const uint8_t*
cellData()
const {
return _cellData.data(); }
98 void collectLights(
const std::vector<ClusterLightData>& localLights);
99 void computeGridBounds(
const BoundingBox& cameraBounds);
100 void assignLightsToCells();
101 void packGpuLights();
109 float outerConeCos = 1.0f;
110 float innerConeCos = 1.0f;
114 std::vector<LightEntry> _lights;
115 std::vector<GpuClusteredLight> _gpuLights;
118 std::vector<uint8_t> _cellData;
120 Vector3 _boundsMin = Vector3(0.0f);
121 Vector3 _boundsMax = Vector3(0.0f);
123 bool _warnedOverflow =
false;
Axis-Aligned Bounding Box defined by center and half-extents.
size_t lightDataSize() const
void update(const std::vector< ClusterLightData > &localLights, const BoundingBox &cameraBounds)
const uint8_t * cellData() const
Vector3 boundsRange() const
const GpuClusteredLight * lightData() const
const Vector3 & boundsMin() const
const ClusterConfig & config() const
Vector3 cellsCountByBoundsSize() const
WorldClusters(const ClusterConfig &config=ClusterConfig{})
size_t cellDataSize() const
RGBA color with floating-point components in [0, 1].
3D vector for positions, directions, and normals with multi-backend SIMD acceleration.