diff --git a/src/render/scene/csm.cpp b/src/render/scene/csm.cpp index c9011935e..9bae3601d 100644 --- a/src/render/scene/csm.cpp +++ b/src/render/scene/csm.cpp @@ -58,8 +58,8 @@ void CSM::Split::init(int32_t resolution, size_t idx, material::MaterialManager& .textureNoBlend(gl::api::FramebufferAttachment::DepthAttachment, depthTextureHandle->getTexture()) .build("csm-split-fb/" + std::to_string(idx)); - squaredTextureHandle = std::make_shared>>( - gsl::make_shared>(glm::ivec2{resolution, resolution}, + squaredTextureHandle = std::make_shared>>( + gsl::make_shared>(glm::ivec2{resolution, resolution}, "csm-texture/" + std::to_string(idx) + "/squared"), gsl::make_unique("csm-texture/" + std::to_string(idx) + "/squared" + gl::SamplerSuffix) | set(gl::api::TextureMinFilter::Linear) | set(gl::api::TextureMagFilter::Linear) @@ -81,7 +81,7 @@ void CSM::Split::init(int32_t resolution, size_t idx, material::MaterialManager& squareMesh->getRenderState().merge(squareFramebuffer->getRenderState()); squareMesh->getMaterialGroup().set(material::RenderMode::FullOpaque, squareMaterial); - squareBlur = std::make_shared>( + squareBlur = std::make_shared>( "squareBlur-" + std::to_string(idx), materialManager, uint8_t{2}, true); squareBlur->setInput(gsl::not_null{squaredTextureHandle}); } @@ -122,13 +122,13 @@ namespace struct SplitGetter { template - static std::array>>, CSMBuffer::NSplits> + static std::array>>, CSMBuffer::NSplits> getBlurred(const std::array& splits, std::index_sequence) { return {{gsl::not_null{splits[Is].squaredTextureHandle}...}}; } - static std::array>>, CSMBuffer::NSplits> + static std::array>>, CSMBuffer::NSplits> getBlurred(const std::array& splits) { return getBlurred(splits, std::make_index_sequence()); @@ -136,7 +136,7 @@ struct SplitGetter }; } // namespace -std::array>>, CSMBuffer::NSplits> CSM::getTextures() const +std::array>>, CSMBuffer::NSplits> CSM::getTextures() const { return SplitGetter::getBlurred(m_splits); } diff --git a/src/render/scene/csm.h b/src/render/scene/csm.h index 40b235b54..0adc0c0e5 100644 --- a/src/render/scene/csm.h +++ b/src/render/scene/csm.h @@ -49,12 +49,12 @@ class CSM final std::shared_ptr>> depthTextureHandle; std::shared_ptr depthFramebuffer{}; - std::shared_ptr>> squaredTextureHandle; + std::shared_ptr>> squaredTextureHandle; std::shared_ptr squareFramebuffer{}; std::shared_ptr squareMaterial{}; std::shared_ptr squareMesh{}; - std::shared_ptr> squareBlur; + std::shared_ptr> squareBlur; void init(int32_t resolution, size_t idx, material::MaterialManager& materialManager); void renderSquare(); @@ -63,7 +63,7 @@ class CSM final explicit CSM(int32_t resolution, material::MaterialManager& materialManager); - [[nodiscard]] std::array>>, CSMBuffer::NSplits> + [[nodiscard]] std::array>>, CSMBuffer::NSplits> getTextures() const; [[nodiscard]] std::array getMatrices(const glm::mat4& modelMatrix) const;