aboutsummaryrefslogtreecommitdiff
path: root/src/client/shadows/dynamicshadowsrender.h
diff options
context:
space:
mode:
authorx2048 <codeforsmile@gmail.com>2022-03-31 22:40:06 +0200
committerGitHub <noreply@github.com>2022-03-31 22:40:06 +0200
commit31578303a4eab6b6b083e57b6bf8d12ff3b3d991 (patch)
tree3ff56df6e29207c1ca3f2f93c5327f1cc786a7ec /src/client/shadows/dynamicshadowsrender.h
parent06d197cdd042392e1551e5e7244c61300a6bb4e3 (diff)
downloadminetest-31578303a4eab6b6b083e57b6bf8d12ff3b3d991.tar.gz
minetest-31578303a4eab6b6b083e57b6bf8d12ff3b3d991.tar.bz2
minetest-31578303a4eab6b6b083e57b6bf8d12ff3b3d991.zip
Tune shadow perspective distortion (#12146)
* Pass perspective distortion parameters as uniforms * Set all perspective bias parameters via ShadowRenderer * Recalibrate perspective distortion and shadow range to render less shadow geometry with the same quality and observed shadow distance
Diffstat (limited to 'src/client/shadows/dynamicshadowsrender.h')
-rw-r--r--src/client/shadows/dynamicshadowsrender.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/client/shadows/dynamicshadowsrender.h b/src/client/shadows/dynamicshadowsrender.h
index dc8f79c56..bbeb254b0 100644
--- a/src/client/shadows/dynamicshadowsrender.h
+++ b/src/client/shadows/dynamicshadowsrender.h
@@ -90,6 +90,9 @@ public:
float getShadowStrength() const { return m_shadows_enabled ? m_shadow_strength : 0.0f; }
float getTimeOfDay() const { return m_time_day; }
+ f32 getPerspectiveBiasXY() { return m_perspective_bias_xy; }
+ f32 getPerspectiveBiasZ() { return m_perspective_bias_z; }
+
private:
video::ITexture *getSMTexture(const std::string &shadow_map_name,
video::ECOLOR_FORMAT texture_format,
@@ -131,6 +134,8 @@ private:
bool m_shadow_map_colored;
u8 m_map_shadow_update_frames; /* Use this number of frames to update map shaodw */
u8 m_current_frame{0}; /* Current frame */
+ f32 m_perspective_bias_xy;
+ f32 m_perspective_bias_z;
video::ECOLOR_FORMAT m_texture_format{video::ECOLOR_FORMAT::ECF_R16F};
video::ECOLOR_FORMAT m_texture_format_color{video::ECOLOR_FORMAT::ECF_R16G16};
@@ -146,6 +151,7 @@ private:
s32 mixcsm_shader{-1};
ShadowDepthShaderCB *m_shadow_depth_cb{nullptr};
+ ShadowDepthShaderCB *m_shadow_depth_entity_cb{nullptr};
ShadowDepthShaderCB *m_shadow_depth_trans_cb{nullptr};
shadowScreenQuad *m_screen_quad{nullptr};