From bf3acbf388406f736286d990adb5f35a9023c390 Mon Sep 17 00:00:00 2001 From: x2048 Date: Sun, 25 Jul 2021 12:36:23 +0200 Subject: 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 --- builtin/settingtypes.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'builtin') diff --git a/builtin/settingtypes.txt b/builtin/settingtypes.txt index 17843fac8..420e9d49c 100644 --- a/builtin/settingtypes.txt +++ b/builtin/settingtypes.txt @@ -618,11 +618,11 @@ shadow_filters (Shadow filter quality) enum 1 0,1,2 # On true translucent nodes cast colored shadows. This is expensive. shadow_map_color (Colored shadows) bool false - -# Set the shadow update time, in seconds. -# Lower value means shadows and map updates faster, but it consumes more resources. -# Minimum value: 0.001; maximum value: 0.2 -shadow_update_time (Map update time) float 0.2 0.001 0.2 +# Spread a complete update of shadow map over given amount of frames. +# Higher values might make shadows laggy, lower values +# will consume more resources. +# Minimum value: 1; maximum value: 16 +shadow_update_frames (Map shadows update frames) int 8 1 16 # Set the soft shadow radius size. # Lower values mean sharper shadows, bigger values mean softer shadows. -- cgit v1.2.3