Files
UnrealEngineUWP/Engine/Source/Editor/LandscapeEditor
jonathan bard c9757666de Added system to invalidate VSM pages when using (non-Nanite) landscape, to hide shadow artifacts induced by the vertex morphing system of standard landscape :
* Relies on pre-computing max height delas from mip-to-mip for every landscape component
* Invalidation occurs when the evaluated max delta between the heights at the LOD value that was active when VSM was last cached is different enough from the heights at the current LOD value (for a given persistent view), based on a height threshold that is tweakable per landscape and overridable per landscape proxy
* Invalidation doesn't occur when Nanite landscape is used
* The invalidation rate is decreased as the LOD value goes up, controlled by a screen size parameter in the landscape actor (overridable per proxy), under which no invalidation will occur. This avoids over-invalidating VSM on higher LOD values, since they tend to occupy less real estate and therefore don't need to have perfect shadows
* Added per landscape (overridable per-proxy) shadow map bias to help with this problem too
* Added 3 non-shipping CVars to help tweak those 3 parameters in-game (landscape.OverrideNonNaniteVirtualShadowMapConstantDepthBiasOverride, landscape.OverrideNonNaniteVirtualShadowMapInvalidationHeightErrorThreshold, landscape.OverrideNonNaniteVirtualShadowMapInvalidationScreenSizeLimit)
* The whole invalidation system can be enabled/disabled via CVar landscape.AllowNonNaniteVirtualShadowMapInvalidation
* Added another CVar (landscape.NonNaniteVirtualShadowMapInvalidationLODAttenuationExponent) to tweak the screen-size-dependent invalidation rate curve shape

Misc:
* Fixed landscape.DumpLODs command : now works without parameter and can be used several times
* Changed CachedSectionLODValues system for landscape to be usable both for ViewState-less views (one-shot renders like water info custom render passes) and "persistent" views (those that have  FViewStateInterface associated). This allows to keep track of the previous frame's CachedSectionLODValues for a given persistent view and removes the previous hacky method
* Also, prevented landscape render systems to have their LOD section values cleared when a render is made on another scene (e.g. any time a thumbnail renders in editor or when custom render passes execute) : now only the render systems that pertain to the scene being rendered get udpated
* Fixed game thread data being accessed in render thread landscape scene proxy (component)
* Landscape UX fixes
* Fixed some landscape CVars which were not render-thread safe
* Removed member RHI buffer refs LandscapeLODDataBuffer and LandscapeIndirectionBuffer which didn't serve any purpose
#rb chris.tchou
#tests Editor, cooked game,, cooked game
#jira UE-203928, UE-141201, UE-203934, FORT-687382, UE-203945, UE-163715

[CL 31441773 by jonathan bard in ue5-main branch]
2024-02-13 14:57:38 -05:00
..