Graphics: Rework shadowing (add cascaded shadow mapping)

- Add support for per-viewer shadows
- Add cascaded shadow mapping for directional lights (wip)
- Rework the way lights are sent to the shaders (they are now selected once per viewer)
- Fixes PointLight shadow mapping (using a dedicated pass)
- Lights out of frustum for every viewers are no longer processed (wip)
This commit is contained in:
SirLynix
2023-09-06 13:20:52 +02:00
committed by Jérôme Leclercq
parent a08850946a
commit 9aebb4f745
41 changed files with 1320 additions and 576 deletions

View File

@@ -23,9 +23,9 @@ namespace Nz
PointLight(PointLight&&) noexcept = default;
~PointLight() = default;
float ComputeContributionScore(const BoundingVolumef& boundingVolume) const override;
float ComputeContributionScore(const Frustumf& viewerFrustum) const override;
void FillLightData(void* data) const override;
bool FrustumCull(const Frustumf& viewerFrustum) const override;
std::unique_ptr<LightShadowData> InstanciateShadowData(FramePipeline& pipeline, ElementRendererRegistry& elementRegistry) const override;
@@ -33,6 +33,7 @@ namespace Nz
inline float GetDiffuseFactor() const;
inline Color GetColor() const;
inline const Vector3f& GetPosition() const;
inline float GetInvRadius() const;
inline float GetRadius() const;
inline void UpdateAmbientFactor(float factor);