mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-16 18:01:40 +00:00
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
This commit is contained in:
parent
9aabd911eb
commit
a5d29fa1d4
9 changed files with 184 additions and 122 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue