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

@@ -11,6 +11,7 @@
#include <Nazara/Graphics/Config.hpp>
#include <Nazara/Graphics/LightShadowData.hpp>
#include <Nazara/Math/BoundingVolume.hpp>
#include <Nazara/Math/Frustum.hpp>
#include <Nazara/Math/Quaternion.hpp>
#include <Nazara/Math/Vector3.hpp>
#include <Nazara/Utility/PixelFormat.hpp>
@@ -19,12 +20,8 @@
namespace Nz
{
class CommandBufferBuilder;
class ElementRendererRegistry;
class FramePipeline;
class RenderBuffer;
class RenderFrame;
class Texture;
class NAZARA_GRAPHICS_API Light
{
@@ -34,11 +31,11 @@ namespace Nz
Light(Light&&) noexcept = default;
virtual ~Light();
virtual float ComputeContributionScore(const BoundingVolumef& boundingVolume) const = 0;
virtual float ComputeContributionScore(const Frustumf& viewerFrustum) const = 0;
inline void EnableShadowCasting(bool castShadows);
virtual void FillLightData(void* data) const = 0;
virtual bool FrustumCull(const Frustumf& viewerFrustum) const = 0;
inline const BoundingVolumef& GetBoundingVolume() const;
inline UInt8 GetLightType() const;