mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-15 01:25:20 +02:00
Distribute shadow map update over multiple frames to reduce stutter (#11422)
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>
This commit is contained in:
@@ -125,7 +125,7 @@ public:
|
||||
void renderMap(video::IVideoDriver* driver, s32 pass);
|
||||
|
||||
void renderMapShadows(video::IVideoDriver *driver,
|
||||
const video::SMaterial &material, s32 pass);
|
||||
const video::SMaterial &material, s32 pass, int frame, int total_frames);
|
||||
|
||||
int getBackgroundBrightness(float max_d, u32 daylight_factor,
|
||||
int oldvalue, bool *sunlight_seen_result);
|
||||
|
Reference in New Issue
Block a user