Nebula
Loading...
Searching...
No Matches
clustercontext.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
9//------------------------------------------------------------------------------
11#include "coregraphics/buffer.h"
12#include "coregraphics/window.h"
13#include <array>
14#include "system_shaders/cluster_generate.h"
15
16namespace Clustering
17{
18
20{
22public:
26 virtual ~ClusterContext();
27
29 static void Create(float ZNear, float ZFar, const CoreGraphics::WindowId window);
30
32 static const SizeT GetNumClusters();
34 static const std::array<SizeT, 3> GetClusterDimensions();
35
37 static void UpdateResources(const Graphics::FrameContext& ctx);
38#ifndef PUBLIC_BUILD
40 static void OnRenderDebug(uint32_t flags);
41#endif
42
44 static void WindowResized(const CoreGraphics::WindowId id, SizeT width, SizeT height);
45
48private:
49
51 static void UpdateClusters();
52};
53} // namespace Clustering
Definition clustercontext.h:20
static const std::array< SizeT, 3 > GetClusterDimensions()
get cluster dimensions
Definition clustercontext.cc:149
static void Create(float ZNear, float ZFar, const CoreGraphics::WindowId window)
setup light context using CameraSettings
Definition clustercontext.cc:65
static void UpdateResources(const Graphics::FrameContext &ctx)
update constants
Definition clustercontext.cc:158
virtual ~ClusterContext()
destructor
Definition clustercontext.cc:57
static void OnRenderDebug(uint32_t flags)
implement me
Definition clustercontext.cc:184
ClusterContext()
constructor
Definition clustercontext.cc:50
static void UpdateClusters()
run light classification compute
static void WindowResized(const CoreGraphics::WindowId id, SizeT width, SizeT height)
Update when window resized.
Definition clustercontext.cc:192
static const SizeT GetNumClusters()
get number of clusters
Definition clustercontext.cc:140
static const CoreGraphics::BufferId * GetClusterBuffer()
Get cluster AABB buffer.
Definition clustercontext.cc:237
Definition graphicscontext.h:165
Context handling GPU cluster culling.
Definition clustercontext.cc:17
CoreGraphics::WindowId window
Definition clustercontext.cc:32
Definition buffer.h:23
Definition window.h:25
Definition graphicsserver.h:31
int SizeT
Definition types.h:49