- Move VSM parameters into a single uniform buffer; required for base pass rendering.
- SRVs are initialized to dummy data until they are computed during the frame and subsequently updated before any VSM sampling.
- Make names and usage more consistent with other UB bindings in mesh passes
- Direct injection of VSM into translucent volume and fog
- Support VSM sampling in forward lighting shaders
- Enabled and bound currently for translucent forward and single pass water meshes
- Support VSM sampling in sky atmosphere and cloud rendering
- NOTE: Sky atmosphere LUT pass currently executes before BasePass and ShadowDepths so it will not sample proper data and throw a warning. Moving passes around to address this will come in a future commit.
#rb Brian.Karis, Ola.Olsson, Sebastien.Hillaire, Zachary.Bethel
#ROBOMERGE-OWNER: andrew.lauritzen
#ROBOMERGE-AUTHOR: andrew.lauritzen
#ROBOMERGE-SOURCE: CL 15649858 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v779-15635321)
#ROBOMERGE-CONFLICT from-shelf
[CL 15650486 by andrew lauritzen in ue5-main branch]
- Fix ordering issue in virtual shadow map setup (need to commit and upload dynamic primitive data before building rendering commands).
- Workaround for incorrect culling of late (shadow view) dynamic primitives.
- Mark local lights as rendered.
#rb Brian.Karis
#ROBOMERGE-SOURCE: CL 15470869 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)
[CL 15470873 by ola olsson in ue5-main branch]
- Fix optimal plane bias with clipmap LOD fallback
- Clean up and optimize some of the clipmap level offset math
- Rename some fields to make the resuse between clipmaps/mips clear
#rb brian.karis, ola.olsson
#ROBOMERGE-SOURCE: CL 15466663 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)
[CL 15466676 by andrew lauritzen in ue5-main branch]
- added a path to propagate and cache whether material modifies position (WPO) to enable invalidating cached pages (touches whole mesh command pipeline).
- added pixel shader verision of page copying & clearing.
- also added flag for whether cached the mesh draw command supports primitive id (which enables checing this earlier).
#rb andrew.lauritzen,brian.karis,graham.wihlidal,Krzysztof.Narkowicz
#ROBOMERGE-SOURCE: CL 15436539 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)
[CL 15441336 by ola olsson in ue5-main branch]
- Levels are now strictly pow2 sizes and snap to half their size (instead of internal page boundaries).
- Propogate mips propgates along clipmap levels instead of mips for directional lights
- Provide a O(1) lookup for clipmaps as well that will fall back to coarser data. Do not use it by default for current opaque shading where we know by construction where the mapped pages are.
Still some minor cleanup and optimization possible to come in a future commit.
#ROBOMERGE-SOURCE: CL 15399904 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)
[CL 15399908 by andrew lauritzen in ue5-main branch]
#ROBOMERGE-SOURCE: CL 15347635 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)
[CL 15359404 by brian karis in ue5-main branch]
- Fix SMRT with non-nanite geometry (wasn't sampling the second map)
- Fix toggling distance field shadow cascade on when VSMs are enabled (trying to create a distance field complete shadow map)
- This is a bit of a questionable case, but at least does not crash now
- Remove dependence of clipmap max distance on shadow cascade distance and replace with a cvar
- Will likely want to do something similar for far culling distance for non-nanite stuff, but TBD
- May eventually want a parameter back on the light, but for now just having a cvar set high is good as there is little overhead with Nanite meshes
- Add some debug output for SMRT spot lights
#jira UERNDR-682
#rb brian.karis
#fyi ola.olsson
[CL 15215315 by andrew lauritzen in ue5-main branch]
Major SMRT optimization. Adaptive 7 rays per light with rough penumbra detection. Quality appears to surpass 1rpp with denoising.
#rb andrew.lauritzen
[CL 15190972 by Brian Karis in ue5-main branch]
- Move some functions in PageManagement.usf to avoid confusing global resource scopes
#rb brian.karis
#fyi ola.olsson
[CL 15169596 by andrew lauritzen in ue5-main branch]
- Change VSM page table to single packed uint with a field to allow single-lookup to find any mapped MIP
- Page table lookups go through helper function to encode/decode
- Remove some unused shadow emit code
#rb brian.karis
#fyi ola.olsson
[CL 15160590 by andrew lauritzen in ue5-main branch]
- All non-nanite VSM code is wrapped in ENABLE_NON_NANITE_VSM define (on by default if GPUCULL_TODO is on)
- Added FProjectedShadowInfo with setup to gather primitives for clipmap VSM
- Added RenderVirtualShadowMapsHw to FVirtualShadowMapArray to draw into the VSM
- Shadow depth Vertex shader contains logic to route the instances to pages and uses clip distance to clip to page boundary
- Added culling shaders to replicate instances for each overlapped page
#rb rune.stubbe
#fyi graham.wihlidal,brian.karis,andrew.lauritzen
[CL 15144144 by Ola Olsson in ue5-main branch]