55 lines
1.2 KiB
C++
55 lines
1.2 KiB
C++
//
|
|
// Created by kj16609 on 9/23/25.
|
|
//
|
|
#pragma once
|
|
|
|
#include <vulkan/vulkan.hpp>
|
|
|
|
#include <memory>
|
|
|
|
#include "RenderCamera.hpp"
|
|
#include "Swapchain.hpp"
|
|
#include "primitives/rotation/UniversalRotation.hpp"
|
|
#include "systems/prerender/CullingSystem.hpp"
|
|
|
|
namespace fgl::engine
|
|
{
|
|
namespace gui
|
|
{
|
|
void drawShadowmaps( const FrameInfo& info );
|
|
}
|
|
|
|
struct CameraInfo;
|
|
|
|
class ShadowMap
|
|
{
|
|
std::shared_ptr< Swapchain > m_swapchain;
|
|
UniversalRotation m_direction;
|
|
|
|
std::shared_ptr< CameraViewpoint > m_camera;
|
|
|
|
std::unique_ptr< Pipeline > m_shadow_pipeline;
|
|
|
|
CullingSystem m_culling_system;
|
|
vk::Extent2D m_extent;
|
|
|
|
PerFrameArray< std::unique_ptr< descriptors::DescriptorSet > > createShadowmapDescriptors() const;
|
|
PerFrameArray< std::unique_ptr< descriptors::DescriptorSet > > m_shadowmap_descriptor;
|
|
|
|
public:
|
|
|
|
ShadowMap() = delete;
|
|
|
|
ShadowMap( const UniversalRotation& direction, vk::Extent2D extent );
|
|
|
|
void pass( FrameInfo info );
|
|
|
|
friend void gui::drawShadowmaps( const FrameInfo& info );
|
|
static descriptors::DescriptorSetLayout& getDescriptorLayout();
|
|
};
|
|
|
|
std::shared_ptr< ShadowMap > createShadowmap( UniversalRotation direction );
|
|
|
|
std::vector< std::weak_ptr< ShadowMap > > getShadowmaps();
|
|
|
|
} // namespace fgl::engine
|