- Shadow PreViewTranslation and ClipmapOrigin become full LWC tile/offset values on the GPU
- In most cases, the camera's and shadow's PreViewTranslations can be subtracted on the GPU to produce a regular-range value to transform from PrimaryView.TranslatedWorld to ShadowView.TranslatedWorld
- Miner cleanup and improvements to SMRT trace loop
- Remove special case for ortho matrices disabling PreViewTranslation in FViewMatrices
- Remove broken static function local and associated cvar r.PreViewTranslation
#preflight 6205dd571404d0fef964d721
#jira UE-139824
#rb graham.wihlidal
#lockdown juan.canada
#ROBOMERGE-AUTHOR: andrew.lauritzen
#ROBOMERGE-SOURCE: CL 18956693 in //UE5/Release-5.0/... via CL 18956877 via CL 18957087
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589)
[CL 18958948 by andrew lauritzen in ue5-main branch]
- Add bHasDeformableMesh to FPrimitiSceneProxy to declare if the meshes are deformed, e.g., skeletal mesh, to be able to catch this case.
- also fix incorrect tracking of revealed primitives (causes invalidation errors with missing shadows when meshes are culled on the CPU).
- Add cvar switch to turn off the new behavior (for emergency use) r.Shadow.Virtual.Cache.DeformableMeshesInvalidate (defaults to 1)
#jira UE-133211
#rb andrew.lauritzen
#preflight 620389584c05b86e6d60185a
#lockdown juan.canada
#ROBOMERGE-AUTHOR: ola.olsson
#ROBOMERGE-SOURCE: CL 18915487 in //UE5/Release-5.0/... via CL 18920329 via CL 18922688
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v916-18915374)
[CL 18923422 by ola olsson in ue5-main branch]
#jira UE-122078
#rb Andrew.Davidson, Colin.McGinley
#preflight standard build
#ROBOMERGE-AUTHOR: fred.kimberley
#ROBOMERGE-SOURCE: CL 18817999 in //UE5/Release-5.0/... via CL 18818012 via CL 18822871
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)
[CL 18824721 by fred kimberley in ue5-main branch]
- Disable view-dependent CPU culling of primitives for local-light VSMs (to fix incorrect caching).
- Track per-light cache data for clipmaps to enable storing bit flags for rendered primitives.
- Make invalidations skip primitives that were never rendered into a clipmap, and mark invalidated primitives as not rendered.
#rb andrew.lauritzen
#preflight 61e6c37b3778a195deabfb8a
#ROBOMERGE-AUTHOR: ola.olsson
#ROBOMERGE-SOURCE: CL 18639158 in //UE5/Release-5.0/... via CL 18639165 via CL 18639180
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v899-18417669)
[CL 18639190 by ola olsson in ue5-main branch]
Add a cvar for the clipmap level depth scale, primarily for debug purposes.
#rb ola.olsson
[FYI] daniel.wright
#preflight 61d646acdb0309127d0ed214
#ROBOMERGE-AUTHOR: andrew.lauritzen
#ROBOMERGE-SOURCE: CL 18533629 in //UE5/Release-5.0/... via CL 18534025
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)
[CL 18534205 by andrew lauritzen in ue5-release-engine-test branch]
Expand Z range of clipmap levels to fix some rare artifacts related to SMRT walking off the Z range with certain settings.
#rb ola.olsson
#preflight 61aea891fc6bcc8e1975cdff
#ROBOMERGE-AUTHOR: andrew.lauritzen
#ROBOMERGE-SOURCE: CL 18400198 in //UE5/Release-5.0/... via CL 18400211
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v896-18170469)
[CL 18400217 by andrew lauritzen in ue5-release-engine-test branch]
Page allocation part is a fairly minor benefit in most scenes but can occasionally make a big difference.
Projection early-out is a pretty uniform benefit all the time, especially with SMRT.
#preflight 612d1b836a14cc000118f03a
#rb ola.olsson
#ROBOMERGE-SOURCE: CL 17388425 via CL 17389280
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v865-17346139)
[CL 17389330 by andrew lauritzen in ue5-release-engine-test branch]
- Instead, create a reference depth range with a guard band that we reuse frame to frame until we get too close to the edge, at which point we invalidate that clipmap level's cached pages (if any)
- Does not significantly affect invalidations, even when moving quickly near surfaces, since those cases would already get invalidated when those pixels moved to a different clipmap level
- Sets up for not re-copying cached VSM pages every frame
#rb ola.olsson
[FYI] brian.karis
#ROBOMERGE-SOURCE: CL 16492432 in //UE5/Private-Frosty/...
#ROBOMERGE-BOT: STARSHIP (Private-Frosty -> Main) (v823-16466674)
[CL 16492445 by andrew lauritzen in ue5-main branch]
Should only really affect planet-scale atmospheric sky rendering with shadows onto cloud type cases, which is not the default config.
#rb graham.wihlidal, ola.olsson
#lockdown nick.whiting
#ROBOMERGE-SOURCE: CL 16052384 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v789-15992632)
[CL 16060017 by andrew lauritzen in ue5-main branch]
Add virtual clipmap levels near the camera to cover extreme close-ups
Add Nanite view compation debug output
Make VSM resolution lod bias consistent for directional and local lights
Remove some unnecessary code from ProjectionCommon.ush which gets included in material shaders
#jira UETOP-1088
#rb graham.wihlidal, ola.olsson
[FYI] brian.karis
#lockdown graham.wihlidal
#ROBOMERGE-SOURCE: CL 15994600 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v789-15992632)
[CL 15994621 by andrew lauritzen in ue5-main branch]
- 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 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]
- 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]
- 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]
- 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]
- Disabled by defaul to start. Enable with r.Shadow.v.SMRT.RayCountDirectional 1
- Denoiser will now use temporal reprojection when SMRT is enabled (disable with r.Shadow.v.Denoiser.Temporal 0)
- Variety of fixes and refactors to existing VSM and projection code
- Still a few edge cases that will be improved in future around screen space trace and similar, but working fairly robustly for reasonable light source size settings
#rb ola.olsson
#fyi brian.karis
[CL 14942586 by andrew lauritzen in ue5-main branch]
- Don't bias the "first" clipmap level based on the resolution bias so that the effective "max" resolution at the near clipmap remains the same. There's no right/wrong on this one but this way is likely more intuitive.
#rb none
#fyi ola.olsson
[CL 14602087 by andrew lauritzen in ue5-main branch]