Commit Graph

56 Commits

Author SHA1 Message Date
andrew lauritzen
bf84b62791 Improve texel dither to be more continuous and avoid artifacts at the edges of pages (which are now dynamically picked)
Add a world dither. Not necessarily useful but can be somewhat analygous to PCF radius.
Add permutation to SMRT samples = 0 (and possibly more in the future).

#preflight 628eab6fc826bd5a7f1135ec
#rb ola.olsson

#ROBOMERGE-AUTHOR: andrew.lauritzen
#ROBOMERGE-SOURCE: CL 20372897 via CL 20372913 via CL 20372922
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v949-20362246)

[CL 20373677 by andrew lauritzen in ue5-main branch]
2022-05-25 19:50:23 -04:00
guillaume abadie
bbbbbcd918 Fixes PCD3D_SM6 on a GTX 1080
#rb trivial
#preflight 627172c39d6c2f8f5b264654

#ROBOMERGE-AUTHOR: guillaume.abadie
#ROBOMERGE-SOURCE: CL 20031100 via CL 20031605 via CL 20031651
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 20035092 by guillaume abadie in ue5-main branch]
2022-05-03 19:48:39 -04:00
Arciel Rekman
700c39e0e7 Fix VSM debug view being the same for the right eye.
#rb Andrew.Lauritzen
#review @Andrew.Lauritzen, @Robert.Srinivasiah, @Jules.Blok
#jira none
#preflight 625642c45f20a0a34d8fbaf7

[CL 19734289 by Arciel Rekman in ue5-main branch]
2022-04-12 23:44:41 -04:00
Charles deRousiers
61cf50b66f Change Strata binding buffer function args to take view instead of the explicit scene data.
#rb none
#jira none
#preflight 6246ee2a292f228e0914eed2
#fyi sebastien.hillaire

[CL 19586823 by Charles deRousiers in ue5-main branch]
2022-04-01 08:35:55 -04:00
andrew lauritzen
f5206aa74c Minor tweak to screen ray default length to address a few edge cases
#rb trivial

#ROBOMERGE-AUTHOR: andrew.lauritzen
#ROBOMERGE-SOURCE: CL 19413744 via CL 19413761
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v928-19376421)

[CL 19414814 by andrew lauritzen in ue5-main branch]
2022-03-16 19:07:35 -04:00
andrew lauritzen
bd803d7e43 SMRT improvements:
- Add slope-based depth extrapolation which improves the quality of penumbras on angled receivers. Costs ~10% performance in some cases so maintaining a permutation/cvar (default on) for scalability.
- Change screen ray trace to be a simple "space skipping" ray that terminates as soon as it goes behind geometry and continue VSM trace from that distance. This avoids various contact-shadow-like artifacts and undesirable/inconsistent contact shadows from things that aren't in the VSM. In certain cases if regular contact shadows are desired on top of VSM the engine contact shadows can be enabled, as it is with CSMs.
- Remove a bunch of use of "halfs" in the shaders as they cause some extra ALU on some platforms and don't appear to really be helping with occupancy anymore
- Small bump to minimum normal bias clamp (only affects things very close to the camera)

#rb brian.karis
[FYI] ola.olsson

#ROBOMERGE-AUTHOR: andrew.lauritzen
#ROBOMERGE-SOURCE: CL 19411300 via CL 19411627
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v928-19376421)

[CL 19413239 by andrew lauritzen in ue5-main branch]
2022-03-16 17:30:21 -04:00
Charles deRousiers
a02d41c4ee Renamed PROJECT_STRATA into STRATA_ENABLED.
This avoids to define STRATA_ENABLED as 'env. define' for all global shaders needing a Strata specific path.

#rb none
#jira none
#fyi sebastien.hillaire
#preflight 62151b25797dbbeb472ae2eb

[CL 19074999 by Charles deRousiers in ue5-main branch]
2022-02-22 12:35:58 -05:00
Charles deRousiers
70470655e0 Add strata support for virtual shadow map
#rb none
#jira none
#fyi sebastien.hillaire
#preflight 62051f391f57995eddb7e40e

[CL 18935509 by Charles deRousiers in ue5-main branch]
2022-02-10 09:53:46 -05:00
andrew lauritzen
a936f96e04 Add clipmap address space visualization and hook up to (advanced) visualization stuff.
Move visualize enum/defines to shared header file.
Rename a few cvars for consistency.

#rb graham.wihlidal
[FYI] ola.olsson
#preflight 61f9d8921d7ca8ed2d628ccd

#ROBOMERGE-AUTHOR: andrew.lauritzen
#ROBOMERGE-SOURCE: CL 18819821 in //UE5/Release-5.0/... via CL 18819825 via CL 18822904
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18825054 by andrew lauritzen in ue5-main branch]
2022-02-02 08:19:08 -05:00
andrew lauritzen
5717424035 Fix over-allocation of shadow mask/visualization textures causing alignment issues when viewport was resized down in editor.
#preflight 61f360fc8255dba0d6c49db1
#rb graham.wihlidal

#ROBOMERGE-AUTHOR: andrew.lauritzen
#ROBOMERGE-SOURCE: CL 18768164 in //UE5/Release-5.0/... via CL 18768175 via CL 18768219
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18768233 by andrew lauritzen in ue5-main branch]
2022-01-27 23:31:28 -05:00
andrew lauritzen
ef2fd132f7 Add VSM projection visualizations to the editor menu
#rb graham.wihlidal
[FYI] ola.olsson
#preflight 61f1a689fc74f46b5645b225

#ROBOMERGE-AUTHOR: andrew.lauritzen
#ROBOMERGE-SOURCE: CL 18757572 in //UE5/Release-5.0/... via CL 18759665 via CL 18760682
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18760914 by andrew lauritzen in ue5-main branch]
2022-01-27 15:49:31 -05:00
ben ingram
d1124c2e41 Move a bunch of lighting calculations to translated world space, fixes various problems at LWC scale
#preflight 61f1760afd5285142b43178a
#rb Daniel.Wright, tiago.costa, Andrew.Lauritzen, charles.derousiers
#jira UE-139831

#ROBOMERGE-AUTHOR: ben.ingram
#ROBOMERGE-SOURCE: CL 18738670 in //UE5/Release-5.0/... via CL 18738820 via CL 18739464
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18740039 by ben ingram in ue5-main branch]
2022-01-26 13:56:31 -05:00
zach bethel
a618c04cbf Converted light grid injection resources to RDG.
#preflight 61ddebe6ce7fe7aeff6fb109

#ROBOMERGE-AUTHOR: zach.bethel
#ROBOMERGE-SOURCE: CL 18576538 in //UE5/Release-5.0/... via CL 18576549
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18576556 by zach bethel in ue5-release-engine-test branch]
2022-01-11 15:57:18 -05:00
andrew lauritzen
eccc470d1c Initial VSM scalability settings
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]
2021-12-07 16:24:58 -05:00
andrew lauritzen
1dfa763b1f - Generalize one pass projection shadow mask to support up to 32 lights/pixel with 4bpp quantization
- Add some dither noise to both the SMRT result and the shadow mask lookup to minimize banding
- Fall back to a single sample VSM lookup (with a generous static bias) when overflowing the number of lights in one pass projection path
- Fix clamping issue with page dilation that was setting extraneous pages with point lights
- Fix SMRT issue with local lights jammed right next to geometry viewed at a distance
- Separate settings for page dilation for local and directional lights
- Add simple debug output for # lights in one pass projection
- Remove some dead code/parameters

#ROBOMERGE-AUTHOR: andrew.lauritzen
#ROBOMERGE-SOURCE: CL 18279117 via CL 18373418 via CL 18373449
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18373485 by andrew lauritzen in ue5-release-engine-test branch]
2021-12-03 16:23:04 -05:00
andrew lauritzen
655ed7e56a Add texel-scale ray start dither for VSM directional lights
Helps to hide aliasing due to insufficient shadow resolution, albeit at the cost of requiring an optimal bias (which can occasionally increase peter-panning).
Default on as it is generally a net quality improvement in most case, but can be disabled via cvar.

#preflight 6137f26525e54000014fa848
#rb brian.karis

#ROBOMERGE-AUTHOR: andrew.lauritzen
#ROBOMERGE-SOURCE: CL 17452212 via CL 17910699 via CL 18360668 via CL 18360819
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18360872 by andrew lauritzen in ue5-release-engine-test branch]
2021-12-02 18:05:10 -05:00
andrew lauritzen
ead3650569 Virtual shadow maps: early out on pixels backfacing the light in both projection and page allocation
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]
2021-09-01 13:13:01 -04:00
andrew lauritzen
9e9c6bfa2c Remove unused/no longer working VSM paths
#ROBOMERGE-SOURCE: CL 16917622 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v836-16769935)

[CL 16917631 by andrew lauritzen in ue5-release-engine-test branch]
2021-07-21 19:04:20 -04:00
andrew lauritzen
37ebf8ceb4 Implement simple subsurface shading model for virtual shadow maps and related fixes and improvements:
- Add VirtualShadowMapId to forward light data, removing the per-view remapping table. Should fixe a few multi-view/split-screen bugs.
- Minor cleanup of PCF subsurface path; remove dead/broken code.
- Fix up blending of light attenuation into screen shadow mask; disable CSM fading when VSMs are enabled.
- Fix OnePassProjection flag when VSMs are disabled

#rb none
[FYI] ola.olsson, brian.karis

#ROBOMERGE-SOURCE: CL 16852407 via CL 16852415
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v836-16769935)

[CL 16852422 by andrew lauritzen in ue5-release-engine-test branch]
2021-07-14 13:45:31 -04:00
andrew lauritzen
93dd5946b6 Re-implement debug output visualization for VSM projection
Use actor label for light identification/selection in editor; fall back on component name (UUID) temporarily until this data is made available outside the editor as well
Collect debug data in RayState for SMRT and return the last valid sample data
- Alternative is to always generate debug data based on just a single VSM sample even when SMRT is enabled, but it's useful to have a debug output path for the true SMRT data, even if a bit more complex
Move some common visualization utilities to /Visualization.ush
Implement but disable backface culling for shadow evaluation pending change that handles various SHADINGMODEL's properly

#rb graham.wihlidal, ola.olsson

#ROBOMERGE-SOURCE: CL 16407102 in //UE5/Private-Frosty/...
#ROBOMERGE-BOT: STARSHIP (Private-Frosty -> Main) (v804-16311228)

[CL 16412421 by andrew lauritzen in ue5-main branch]
2021-05-20 19:32:20 -04:00
Charles deRousiers
b16cdec99d Change VSM projection hair permutation to be used as a guard when hair strands are disabled.
#rb none
#jira none
#fyi andrew.lauritzen

[CL 16219097 by Charles deRousiers in ue5-main branch]
2021-05-06 05:46:35 -04:00
andrew lauritzen
9b9eda9628 Remove unused virtual shadow map denoiser path
No more need for writing out the "signal" texture info, so reduce that to single F32 for shadow factor
No need to return HitDistance as far up the stack in the shaders
Remove VSM defines and permutations from screen space denoiser

#rb guillaume.abadie
#lock nick.whiting

#ROBOMERGE-OWNER: andrew.lauritzen
#ROBOMERGE-AUTHOR: andrew.lauritzen
#ROBOMERGE-SOURCE: CL 16117127 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v789-15992632)
#ROBOMERGE-CONFLICT from-shelf

[CL 16117874 by andrew lauritzen in ue5-main branch]
2021-04-26 15:47:32 -04:00
andrew lauritzen
aa23d18204 Scale normal bias by distance to camera and projection scale to fix artifacts on flat planes and default sphere with shallow light angles.
Rename parameter to "r.Shadow.Virtual.NormalBias" to better represent its unit-less value and give a reasonable default value.

#lockdown nick.whiting
#rb brian.karis, graham.wihlidal

#ROBOMERGE-SOURCE: CL 16097675 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v789-15992632)

[CL 16097704 by andrew lauritzen in ue5-main branch]
2021-04-22 16:30:49 -04:00
charles derousiers
c4d7d8eea3 Add input source for virtual shadow page managment pass (Gbuffer/HairStrands).
#rb none
#jira none

#ROBOMERGE-SOURCE: CL 15878772 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v786-15839533)

[CL 15878794 by charles derousiers in ue5-main branch]
2021-03-31 14:18:27 -04:00
andrew lauritzen
582a2d014d Enable SMRT (7 rays/pixel) and disable denoising by default for directional lights as well.
#rb brian.karis

#ROBOMERGE-SOURCE: CL 15853242 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v786-15839533)

[CL 15854558 by andrew lauritzen in ue5-main branch]
2021-03-29 15:53:16 -04:00