Graphics: Move shadow-mapping related code to LightShadow classes

This commit is contained in:
SirLynix
2022-11-26 18:33:12 +01:00
committed by Jérôme Leclercq
parent ec3bc45544
commit 1768f20365
27 changed files with 496 additions and 160 deletions

View File

@@ -6,6 +6,7 @@
#include <Nazara/Graphics/Enums.hpp>
#include <Nazara/Graphics/Graphics.hpp>
#include <Nazara/Graphics/PredefinedShaderStructs.hpp>
#include <Nazara/Graphics/SpotLightShadowData.hpp>
#include <Nazara/Math/Vector2.hpp>
#include <Nazara/Math/Vector3.hpp>
#include <Nazara/Math/Vector4.hpp>
@@ -33,6 +34,11 @@ namespace Nz
AccessByOffset<Matrix4f&>(data, lightOffset.lightMemberOffsets.viewProjMatrix) = m_viewProjMatrix;
}
std::unique_ptr<LightShadowData> SpotLight::InstanciateShadowData(FramePipeline& pipeline, ElementRendererRegistry& elementRegistry) const
{
return std::make_unique<SpotLightShadowData>(pipeline, elementRegistry, *this);
}
void SpotLight::UpdateTransform(const Vector3f& position, const Quaternionf& rotation, const Vector3f& /*scale*/)
{
m_position = position; //< don't call UpdatePosition to prevent double update