Commit Graph

68 Commits

Author SHA1 Message Date
andrew lauritzen
235e085126 Fix typo/merge conflict
[CL 23071973 by andrew lauritzen in ue5-main branch]
2022-11-10 01:15:21 -05:00
andrew lauritzen
4c3a0b4a5b Add and use blue noise for VSM projection to improve performance.
Add ability to adjust the adaptive ray count heuristic to be less aggressive (larger numbers).

#rb ola.olsson
#preflight 636b0282dc30a4ce96cc093e

[CL 23071887 by andrew lauritzen in ue5-main branch]
2022-11-10 01:11:11 -05:00
tim doerries
1efb722a91 Reworked CL for adding support for filtered virtual shadow maps on SingleLayerWater. Implemented by applying the VSM shadow mask to the SeparateMainDirLight texture that is written out by the main water pass in the presence of distance field shadows (or VSM filtering) and then later composing it back into the scene. Also removed EncodeLightAttenuationFromMask() function from VirtualShadowMapMaskBitsCommon.ush.
Originally reviewed in review 22330833.

#rb andrew.lauritzen, Ola.Olsson, Sebastien.Hillaire
#jira FORT-515227
#rnx
#preflight 6356c6700313c24974e8f7dd

[CL 22749579 by tim doerries in ue5-main branch]
2022-10-25 09:19:25 -04:00
bob tellez
58a94a0239 Merging CL#22581718
[Backout] - CL22476756
[FYI] tim.doerries
Original CL Desc
-----------------------------------------------------------------
Added support for filtered virtual shadow maps on SingleLayerWater. Implemented by applying the VSM shadow mask to the SeparateMainDirLight texture that is written out by the main water pass in the presence of distance field shadows (or VSM filtering) and then later composing it back into the scene. Also removed EncodeLightAttenuationFromMask() function from VirtualShadowMapMaskBitsCommon.ush.

#rb andrew.lauritzen, Ola.Olsson, Sebastien.Hillaire
#rnx
#preflight 6345d0aeb757820b7a90db71

[CL 22587146 by bob tellez in ue5-main branch]
2022-10-17 19:32:43 -04:00
tim doerries
462a1f21d5 Added support for filtered virtual shadow maps on SingleLayerWater. Implemented by applying the VSM shadow mask to the SeparateMainDirLight texture that is written out by the main water pass in the presence of distance field shadows (or VSM filtering) and then later composing it back into the scene. Also removed EncodeLightAttenuationFromMask() function from VirtualShadowMapMaskBitsCommon.ush.
#rb andrew.lauritzen, Ola.Olsson, Sebastien.Hillaire
#rnx
#preflight 6345d0aeb757820b7a90db71

[CL 22565339 by tim doerries in ue5-main branch]
2022-10-17 10:51:56 -04:00
marc audy
6ea1f07195 * Move SSS transmission code into a single place (merge duplicate between PCF & VSM)
* Add shadow/transmission blurring on SSS surfae with VSM to reduce hard-shadow (directional light only for now).
 * Change SubSurfaceModel to have extinction-like color-shifting.

#rb andrew.lauritzen
#preflight 63409395090af7205c2240b2
[CODEREVIEW] sebastien.hillaire, wei.liu, chares.derousiers

[CL 22424955 by marc audy in ue5-main branch]
2022-10-09 23:35:48 -04:00
andrew lauritzen
5fa7ade72b Fix VSM when r.Nanite.ProjectEnabled=0
#jira UE-165479
#rb christopher.waters

[CL 22334556 by andrew lauritzen in ue5-main branch]
2022-10-04 13:52:45 -04:00
andrew lauritzen
f8032f4743 Optimizations to light loop for shadowed lights:
- Move translucent injection outside the loop rather as it shares state and doesn't need barriers between it. This had already been done for unshadowed lights but this implements it for shadowed lights as well.
- Implement VSM one pass projection (still default off) even when clustered shading is not enabled. Has two paths in the regular light loop:
  1) If another effect (ex. light functions) needs to interact with the screen shadow mask, a VSM composite path is inserted that does a quick copy from the one pass projection shadow mask bits
  2) If only VSM is needed for the light, the lookup is rolled directly into the deferred lighting pixel shader, eliding the screen shadow mask entirely
Especially in the second case this significantly cuts down on GPU idle time and g-buffer bandwidth, improving the performance of scenes with small local lights

#rb ola.olsson, charles.derousiers
#preflight 633b36f9ba39998ce84c34dd
#jira UE-122099

[CL 22327084 by andrew lauritzen in ue5-main branch]
2022-10-04 01:25:53 -04:00
tiago costa
5d63c9fad9 Added option to apply inverse exposure to local lights
- This should only be used for gameplay lights.
- Current implementation adjusts light intensity on CPU using exposure data readback from GPU.

#preflight 631b4884d31788ea3a993a2f
#rb Krzysztof.Narkowicz

[CL 21929836 by tiago costa in ue5-main branch]
2022-09-09 18:16:47 -04:00
wouter dek
ddae01c8d9 Make VSM debug visualizations work in splitscreen
#jira UE-160090
#preflight 62fdf1a93c4417dcecf7305b
#rb ola.olsson, andrew.lauritzen

[CL 21454765 by wouter dek in ue5-main branch]
2022-08-19 04:31:18 -04:00
andrew lauritzen
e20d2e6bce Add an alternate subsurface shadow mode for testing, hidden behind a (temporary) cvar
Also minor optimization to local light filtering when source radius = 0.

#rb charles.derousiers
#preflight 62c480352f31b87c6c9e78e7

#ROBOMERGE-AUTHOR: andrew.lauritzen
#ROBOMERGE-SOURCE: CL 20947932 via CL 20948251 via CL 20948696
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v971-20777995)

[CL 20950909 by andrew lauritzen in ue5-main branch]
2022-07-05 17:54:24 -04:00
andrew lauritzen
ae31bd8019 SMRT local lights updates
- Improvements to cube map filtering to eliminate various leaking artifacts at cube edges/corners
- Implement texel dither and optimal bias for local lights
- Remove some half stuff that was causing some sub-optimal compilation
- Fix VSM visualization alignment
- Add a general purpose permutation parameter that can be set for A/B testing projection performance that affects register allocation
- General cleanup

#rb ola.olsson
#preflight 62b350da767c9aaf349e3243

#ROBOMERGE-AUTHOR: andrew.lauritzen
#ROBOMERGE-SOURCE: CL 20779131 via CL 20780276 via CL 20780946
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v970-20704180)

[CL 20782054 by andrew lauritzen in ue5-main branch]
2022-06-22 17:22:27 -04:00
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