Files
Seele/src/Engine/Scene/LightEnvironment.h
T

37 lines
1.3 KiB
C++
Raw Normal View History

2023-10-26 18:37:29 +02:00
#pragma once
#include "Component/DirectionalLight.h"
#include "Component/PointLight.h"
2024-06-09 12:20:04 +02:00
#include "Graphics/Buffer.h"
#include "Graphics/Descriptor.h"
2023-10-26 18:37:29 +02:00
2024-06-09 12:20:04 +02:00
namespace Seele {
2025-04-06 09:57:47 +02:00
DECLARE_REF(EnvironmentMapAsset)
2024-06-09 12:20:04 +02:00
class LightEnvironment {
public:
2023-10-26 18:37:29 +02:00
LightEnvironment(Gfx::PGraphics graphics);
~LightEnvironment();
void reset();
void addDirectionalLight(Component::DirectionalLight dirLight);
void addPointLight(Component::PointLight pointLight);
void commit();
2023-11-05 10:36:01 +01:00
const Gfx::PDescriptorLayout getDescriptorLayout() const;
2025-05-06 19:36:43 +02:00
const Component::DirectionalLight& getDirectionalLight(uint32 lightIndex) const { return dirs[lightIndex]; }
2023-11-05 10:36:01 +01:00
Gfx::PDescriptorSet getDescriptorSet();
2025-04-06 09:57:47 +02:00
PEnvironmentMapAsset getEnvironmentMap() { return environment; }
2025-05-06 19:36:43 +02:00
uint64 getNumDirectionalLights() const { return dirs.size(); }
const Array<Gfx::OTexture2D>& getShadowMaps() const { return shadowMapArray; }
2024-06-09 12:20:04 +02:00
private:
2023-11-01 23:12:30 +01:00
Gfx::OShaderBuffer directionalLights;
2025-05-06 19:36:43 +02:00
Array<Gfx::OTexture2D> shadowMapArray;
2023-11-01 23:12:30 +01:00
Gfx::OShaderBuffer pointLights;
2023-10-26 18:37:29 +02:00
Array<Component::DirectionalLight> dirs;
Array<Component::PointLight> points;
2025-04-06 09:57:47 +02:00
PEnvironmentMapAsset environment;
Gfx::OSampler environmentSampler;
2023-11-01 23:12:30 +01:00
Gfx::ODescriptorLayout layout;
2023-11-05 10:36:01 +01:00
Gfx::PDescriptorSet set;
2023-10-26 18:37:29 +02:00
Gfx::PGraphics graphics;
};
DEFINE_REF(LightEnvironment)
2024-06-09 12:20:04 +02:00
} // namespace Seele