17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-26 15:54:53 +01:00
Files
maszyna/betterRenderer/renderer/source/csm.h
maj00r 2695c8e525 include what you use in betterRenderer
Its sources reached the standard library through the project headers they
included; those are imports now. 178 headers across 56 files, plus 18 C
library headers elsewhere for memcpy/printf and friends. MSVC's STL does
not supply these transitively the way libstdc++ does.
2026-09-10 00:26:55 +02:00

32 lines
1.1 KiB
C++

#pragma once
#include <nvrhi/nvrhi.h>
#include "nvrenderer/resource_registry.h"
#include <array>
#include <vector>
struct MaShadowMap : public MaResourceRegistry {
MaShadowMap(class NvRenderer* renderer);
void Init();
std::vector<double> m_shadow_planes;
std::vector<glm::dmat4> m_cascade_matrices;
std::vector<glm::dmat4> m_cascade_matrices_clamped;
double m_far_plane_first;
double m_far_plane_last;
double m_shadow_far_plane;
nvrhi::BufferHandle m_projection_buffer;
nvrhi::BufferHandle m_inverse_projection_buffer;
class NvRendererBackend* m_backend;
void CalcCascades(const glm::dmat4& projection, const glm::dmat4& view,
const glm::dvec3& light);
void UpdateConstants(nvrhi::ICommandList* command_list);
static void GetViewPlaneCornersWorldSpace(
const glm::dmat4& projection, const glm::dmat4& inverse_projection,
const glm::dmat4& inverse_view, const double& d, bool normalize,
glm::dvec3& ll, glm::dvec3& lr, glm::dvec3& ul, glm::dvec3& ur);
struct ShadowProjectionConstants {
std::array<glm::mat4, 8> m_shadow_projection;
std::array<float, 8> m_shadow_planes;
};
};