56 lines
1.8 KiB
C++
56 lines
1.8 KiB
C++
#pragma once
|
|
|
|
#include <XCEngine/Rendering/Planning/CameraRenderRequest.h>
|
|
|
|
#include <vector>
|
|
|
|
namespace XCEngine {
|
|
namespace Components {
|
|
class CameraComponent;
|
|
class Scene;
|
|
} // namespace Components
|
|
|
|
namespace Rendering {
|
|
|
|
// Planner-owned knobs for the single main-light shadow, including both camera
|
|
// fitting and the default sampling / caster bias values emitted into the
|
|
// runtime shadow contract.
|
|
struct DirectionalShadowPlanningSettings {
|
|
// Keep the single-map MainLight shadow at a higher baseline so the current
|
|
// non-cascaded implementation has enough texel density to be usable.
|
|
uint32_t mapDimension = 2048u;
|
|
float minFocusDistance = 5.0f;
|
|
float maxFocusDistance = 32.0f;
|
|
float perspectiveFocusFactor = 1.0f;
|
|
float orthographicFocusFactor = 2.0f;
|
|
float minDepthRange = 20.0f;
|
|
float boundsPadding = 1.0f;
|
|
float minDepthPadding = 2.0f;
|
|
DirectionalShadowSamplingSettings sampling = {};
|
|
DirectionalShadowCasterBiasSettings casterBias = {};
|
|
};
|
|
|
|
class SceneRenderRequestPlanner {
|
|
public:
|
|
SceneRenderRequestPlanner() = default;
|
|
|
|
void SetDirectionalShadowPlanningSettings(const DirectionalShadowPlanningSettings& settings);
|
|
const DirectionalShadowPlanningSettings& GetDirectionalShadowPlanningSettings() const;
|
|
|
|
std::vector<Components::CameraComponent*> CollectCameras(
|
|
const Components::Scene& scene,
|
|
Components::CameraComponent* overrideCamera) const;
|
|
|
|
std::vector<CameraRenderRequest> BuildRequests(
|
|
const Components::Scene& scene,
|
|
Components::CameraComponent* overrideCamera,
|
|
const RenderContext& context,
|
|
const RenderSurface& surface) const;
|
|
|
|
private:
|
|
DirectionalShadowPlanningSettings m_directionalShadowPlanningSettings = {};
|
|
};
|
|
|
|
} // namespace Rendering
|
|
} // namespace XCEngine
|