3#include "Systems/ComponentSystem.h"
5#include "Components/Core/LightComponent.h"
7#include "Systems/Core/CameraSystem.h"
9#include "Resources/Resources.h"
11#include "Renderer/Constants.h"
13#include "Rendering/DataFormat.h"
26 std::vector<glm::vec3> points;
27 std::vector<unsigned> offsets;
28 glm::vec2 viewportMin;
29 glm::vec2 viewportMax;
35 glm::vec4 lightPosition;
36 glm::vec4 lightDirection;
38 float lightRange = 0.f;
40 uint16_t maxViewports = 4;
41 uint16_t numViewports = maxViewports;
43 uint16_t frameMod[6] = { 0 };
44 uint16_t frameOffset[6] = { 0 };
46 float nearDepths[kMaxCascades] = { 0.f };
47 float farDepths[kMaxCascades] = { 0.f };
52 glm::vec4 cascadeLine;
54 float shadowIntensityOffset = 0;
56 uint32_t arrayOffset = 0;
57 uint32_t textureSize = 1024;
59 uint32_t cubeOffset = 0;
62 bool castShadows =
false;
63 bool tightShadowBounds =
false;
64 bool dynamicCascadeCount =
false;
66 ShadowUpdate shadowUpdate = ShadowUpdate::Default;
68 bool frustaPointsCapture =
false;
70 glm::mat4 lightRawProjection[kMaxCascades];
91 uint32_t currentLayerCount = 0;
92 uint32_t currentTextureSize = 0;
93 Cogs::TextureFormat currentShadowFormat = TextureFormat::Unknown;
96 uint32_t currentCubeCount = 0;
97 uint32_t currentPointShadowResolution = 0;
98 Cogs::TextureFormat currentPointShadowFormat = TextureFormat::Unknown;
100 SoftShadows softShadows = SoftShadows::High;
101 bool lightsChanged =
true;
Context * context
Pointer to the Context instance the system lives in.
void update()
Updates the system state to that of the current frame.
Component system with parallel data per component stored in a pool similar to how the components them...
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Holds all LightComponent instances in the system.
void initialize(Context *context) override
Initialize the system.
void preRender(Context *context)
Cull light system.
Base allocator implementation.
Contains all Cogs related functionality.
ComponentIndex SizeType
Type used to track the size of pools.
Contains data describing a Camera instance and its derived data structured such as matrix data and vi...
Defines calculated light data.