Commit Graph

37 Commits

Author SHA1 Message Date
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
charles derousiers
e13a7edf29 Add cluster shadring permutation for applying hair shadow on top of opaque geometries.
#rb none
#jira none
[FYI] andrew.lauritzen

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

[CL 15846763 by charles derousiers in ue5-main branch]
2021-03-28 14:38:43 -04:00
charles derousiers
29c0d34f85 * Add hair strands view uniform buffer to simplify resources binding.
* Simplify hair resources binding for virtual shadow map.

#rb andrew.lauritzen
#jira none

#ushell-cherrypick of 15622751 by Charles.deRousiers
#ushell-cherrypick of 15622753 by Charles.deRousiers
#preflight 6050c19723863e000112bdc7

#ROBOMERGE-OWNER: charles.derousiers
#ROBOMERGE-AUTHOR: charles.derousiers
#ROBOMERGE-SOURCE: CL 15711628 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v781-15675533)
#ROBOMERGE-CONFLICT from-shelf

[CL 15711785 by charles derousiers in ue5-main branch]
2021-03-16 11:33:44 -04:00
andrew lauritzen
92b07781d7 Always use compute shader for VSM projection
- Adaptive ray counts for SMRT now work even with pass per light
- Removes a few divergences between the logic in the two paths

Remove debug projection stuff for now; will reimplement with a separate UAV write later

Remove temporal filtering for denoiser (it was broken and would need to be implemented slightly differently with the new path anyways)

Split cvar to allow separate denoiser toggle for directional (default on) and local (default off) lights

Enable SMRT for local lights and VSM caching by default

#rb brian.karis

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

[CL 15708180 by andrew lauritzen in ue5-main branch]
2021-03-15 22:06:28 -04:00
brian karis
a7591eea04 Optimize VSM projection and SMRT
#rb andrew.lauritzen

#ROBOMERGE-OWNER: brian.karis
#ROBOMERGE-AUTHOR: brian.karis
#ROBOMERGE-SOURCE: CL 15682437 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v781-15675533)
#ROBOMERGE-CONFLICT from-shelf

[CL 15684606 by brian karis in ue5-main branch]
2021-03-11 22:07:24 -04:00
andrew lauritzen
9b0a6fab9d Remove complete shadow maps and replace with direct VSM sampling
- 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]
2021-03-08 23:14:54 -04:00
Charles deRousiers
600160e3eb Simplify hair resources binding for virtual shadow map.
#rb andrew.lauritzen
#jira none

[CL 15622753 by Charles deRousiers in ue5-main branch]
2021-03-05 05:14:13 -04:00
charles derousiers
5cfef59875 Add support for virtual shadowing for hair strands.
#rb andrew.lauritzen

#ROBOMERGE-SOURCE: CL 15580360 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v776-15580269)

[CL 15580380 by charles derousiers in ue5-main branch]
2021-03-03 06:14:14 -04:00
brian karis
b0ece4658d Remove double physical texture sample if only a single physical texture is written to.
Disable temporal denoiser pass until crash bug is fixed.

#rb andrew.lauritzen

#ROBOMERGE-SOURCE: CL 15496333 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)

[CL 15496340 by brian karis in ue5-main branch]
2021-02-22 20:13:11 -04:00
andrew lauritzen
ceabdff2a2 - Add support to mark coarse pages in mips/clipmap levels
- 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]
2021-02-18 21:09:05 -04:00
graham wihlidal
200151a3bc Renamed r.Shadow.v.* cvars to r.Shadow.Virtual.* to be more obvious, and also renamed VSM.* resource prefixes to Shadow.Virtual.*
#rb brian.karis
[FYI] ola.olsson, andrew.lauritzen

#ROBOMERGE-SOURCE: CL 15450709 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)

[CL 15454805 by graham wihlidal in ue5-main branch]
2021-02-18 13:44:36 -04:00
graham wihlidal
579f03fbaa Prefixed Nanite and VSM resources so that RDG filtering works nicely.
#rb trivial
[FYI] brian.karis, zach.bethel

#ROBOMERGE-OWNER: graham.wihlidal
#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 15449112 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)
#ROBOMERGE-CONFLICT from-shelf

[CL 15454700 by graham wihlidal in ue5-main branch]
2021-02-18 13:40:42 -04:00
andrew lauritzen
ed544ba28f Disable adaptive ray count projection shader when wave ops are not supported on a given RHI.
#rb trivial
[FYI] brian.karis

#ROBOMERGE-SOURCE: CL 15370518 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)

[CL 15370549 by andrew lauritzen in ue5-main branch]
2021-02-09 17:01:35 -04:00
andrew lauritzen
7726f54957 Point light SMRT:
- Implement cube map SMRT using iteration across two faces. While a ray can technically span 3, no significant corner-related artifacts were observed.
- Rafactor SMRT loop out to a macro/include-based quasi "template" and reimplement SMRT for all light types in terms of it
- Few bug fixes and improvements to occluder distance approximation and similar

#rb brian.karis, ola.olsson

#ROBOMERGE-SOURCE: CL 15341168 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)

[CL 15341176 by andrew lauritzen in ue5-main branch]
2021-02-05 15:55:43 -04:00
andrew lauritzen
69450b4f7c Only add wave ops CFLAG to the relevant permutation.
- DX11 now at least works if you disable r.Shadow.v.SMRT.AdaptiveRayCount

#rb trivial

[CL 15258148 by andrew lauritzen in ue5-main branch]
2021-01-28 22:04:53 -04:00
andrew lauritzen
ac53e341d9 Avoid compiling adaptive SMRT ray count (wave ops) in pixel shader projections.
Add cvar to enable/disable adaptive SMRT ray count.

#rb graham.wihlidal
#jira UE-107199

[CL 15229927 by andrew lauritzen in ue5-main branch]
2021-01-27 21:04:55 -04:00
Florin Pascu
c26c53b3bd Fix Shader Compile Mobile
#rb Ola.Olsson
#jira none
#fyi Brian.Karis

[CL 15206812 by Florin Pascu in ue5-main branch]
2021-01-26 08:59:57 -04:00
Brian Karis
c69a8a42cc One pass VSM projection, culled by the light grid.
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]
2021-01-25 18:20:37 -04:00
andrew lauritzen
e0478fe99c - Enable SMRT for spot lights (still a few minor issues but mostly working well)
- 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]
2021-01-21 19:15:53 -04:00
Brian Karis
baed699817 Point light VSM
#rb andrew.lauritzen

[CL 15133841 by Brian Karis in ue5-main branch]
2021-01-18 22:44:41 -04:00