* Rewrite shadow filtering for the new distortion
* Calculate penumbra radius using a single sample
* Avoid peter-panning effect due to filtering of short shadows
* Add adaptive filter quality for soft shadows
* Avoid sharp shadows on surfaces without normals (e.g. plants)
* Increase default and maximum soft shadow radius
* Make line numbers in shader errors match the code
* 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
* 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
Fragment color for nodes is now calculated from:
* Texture color, highlighted by artificial light if present (light color conveyed via vertex color).
* Texture color highlighted by natural light (conveyed via vertex color) filtered by shadow.
* Reflected day/moonlight filtered by shadow (color and intensity), assuming some portion of the light is directly reflected from the materials.
Reduces stutter and freezes when playing.
* Maintains double SM and SM Color textures
* Light frustum update triggers incremental generation of shadow map into secondary 'future' textures.
* Every incremental update renders a portion of the shadow draw list (split equally).
* After defined number of frames (currently, 4), 'future' and 'current' textures are swapped, and DirectionalLight 'commits' the new frustum to use when rendering shadows on screen.
Co-authored-by: sfan5 <sfan5@live.de>
* Adjust minimum filter radius for perspective
* Expand shadow frustum when camera FOV changes, reuse FOV distance adjustment from numeric.cpp
* Read shadow_soft_radius setting as float
* Use adaptive filter radius to accomodate for PSM distortion
* Adjust filter radius for texture resolution
This only works when shaders are enabled.
The centroid varying avoids that the textures (which repeat themselves out of bounds) are sampled out of bounds in MSAA.
If MSAA (called FSAA in minetest) is disabled, the centroid keyword does nothing.
Erase all traces of normal "generation" from fragment shaders
Remove the "feature" from the engine and default config
Remove any leftover documentation of it