diff options
author | x2048 <codeforsmile@gmail.com> | 2022-04-14 22:49:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-14 22:49:30 +0200 |
commit | a5d29fa1d4bc6849d7a6529edc522accac8219d2 (patch) | |
tree | 16643a9fcfeef12802fb867803a7de35e93d649f /src/client/shadows/dynamicshadows.h | |
parent | 9aabd911eb57a5ddef72dd9b7c96f5cca1bd258e (diff) | |
download | hax-minetest-server-a5d29fa1d4bc6849d7a6529edc522accac8219d2.tar.gz hax-minetest-server-a5d29fa1d4bc6849d7a6529edc522accac8219d2.zip |
Implement shadow offsets for the new SM distortion function (#12191)
* Move shadow position calculation to vertex shaders
* Animate entire scene before rendering shadows to prevent lagging of shadows
* Remove unnecessary use of PolygonOffsetFactor
* Apply normal offset to both nodes and objects
* Rename getPerspectiveFactor -> applyPerspectiveDistortion
* Remove perspective distortion from fragment shaders
Diffstat (limited to '')
-rw-r--r-- | src/client/shadows/dynamicshadows.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/client/shadows/dynamicshadows.h b/src/client/shadows/dynamicshadows.h index 70574aa6c..6e9d96b15 100644 --- a/src/client/shadows/dynamicshadows.h +++ b/src/client/shadows/dynamicshadows.h @@ -69,12 +69,18 @@ public: const core::matrix4 &getFutureProjectionMatrix() const; core::matrix4 getViewProjMatrix(); - /// Gets the light's far value. + /// Gets the light's maximum far value, i.e. the shadow boundary f32 getMaxFarValue() const { return farPlane * BS; } + /// Gets the current far value of the light + f32 getFarValue() const + { + return shadow_frustum.zFar; + } + /// Gets the light's color. const video::SColorf &getLightColor() const |