mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-06 17:41:04 +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
|
@ -76,8 +76,11 @@ void RenderingCore::draw(video::SColor _skycolor, bool _show_hud, bool _show_min
|
|||
draw_wield_tool = _draw_wield_tool;
|
||||
draw_crosshair = _draw_crosshair;
|
||||
|
||||
if (shadow_renderer)
|
||||
if (shadow_renderer) {
|
||||
// This is necessary to render shadows for animations correctly
|
||||
smgr->getRootSceneNode()->OnAnimate(device->getTimer()->getTime());
|
||||
shadow_renderer->update();
|
||||
}
|
||||
|
||||
beforeDraw();
|
||||
drawAll();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue