2023-10-26 18:37:29 +02:00
|
|
|
#pragma once
|
|
|
|
|
#include "Graphics/Descriptor.h"
|
|
|
|
|
#include "Graphics/Buffer.h"
|
|
|
|
|
#include "Component/DirectionalLight.h"
|
|
|
|
|
#include "Component/PointLight.h"
|
|
|
|
|
|
|
|
|
|
namespace Seele
|
|
|
|
|
{
|
|
|
|
|
class LightEnvironment
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
LightEnvironment(Gfx::PGraphics graphics);
|
|
|
|
|
~LightEnvironment();
|
|
|
|
|
void reset();
|
|
|
|
|
void addDirectionalLight(Component::DirectionalLight dirLight);
|
|
|
|
|
void addPointLight(Component::PointLight pointLight);
|
|
|
|
|
void commit();
|
|
|
|
|
private:
|
|
|
|
|
#define MAX_DIRECTIONAL_LIGHTS 4
|
|
|
|
|
#define MAX_POINT_LIGHTS 256
|
2023-10-31 16:16:23 +01:00
|
|
|
struct LightEnv
|
|
|
|
|
{
|
|
|
|
|
uint32 numDirectionalLights;
|
|
|
|
|
uint32 numPointLights;
|
|
|
|
|
} lightEnv;
|
2023-11-01 23:12:30 +01:00
|
|
|
Gfx::OShaderBuffer directionalLights;
|
|
|
|
|
Gfx::OUniformBuffer lightEnvBuffer;
|
|
|
|
|
Gfx::OShaderBuffer pointLights;
|
2023-10-26 18:37:29 +02:00
|
|
|
Array<Component::DirectionalLight> dirs;
|
|
|
|
|
Array<Component::PointLight> points;
|
2023-11-01 23:12:30 +01:00
|
|
|
Gfx::ODescriptorLayout layout;
|
|
|
|
|
Gfx::ODescriptorSet set;
|
2023-10-26 18:37:29 +02:00
|
|
|
Gfx::PGraphics graphics;
|
|
|
|
|
};
|
|
|
|
|
DEFINE_REF(LightEnvironment)
|
|
|
|
|
}
|