mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-14 00:55:20 +02: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:
@@ -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();
|
||||
|
Reference in New Issue
Block a user