Commit Graph

47 Commits

Author SHA1 Message Date
guillaume abadie
75faab269c Fixes HLSL2021 short-circuit in TAA, MB, Denoiser, SSR
#rb rune.stubbe

#ROBOMERGE-AUTHOR: guillaume.abadie
#ROBOMERGE-SOURCE: CL 19352018 via CL 19352026
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v926-19321884)

[CL 19356603 by guillaume abadie in ue5-main branch]
2022-03-11 12:10:42 -05:00
Charles deRousiers
888af2ee5f *First* pass for adding Lumen support for Strata.
This CL makes ScreenProbe Diffuse/Reflection 'work' with Strata by relying on Strata's TopLayerData in most places. Only the final integration considers the full set of lobes.
This CL does 'not' address LumenCard material evaluation, nor HW raytracing support. Both has be done in a separate CL.

* Add (weak/simple) material in the realm of Lumen.
* Add support for Strata final DiffuseIndirectComposite
* Add simple place holder for Strata sampling based on TopLayerData

There are several follows:
 * Sample generation (importance sampling, multi-lobes selection, ...) (done in a separate CL)
 * Card material evaluations (done in a separate CL)
 * HW Raytracing support

Test - Regression (visual and performance) has been done on CitySample
* Performance has been measured on console and are unchanged.
* Occupancy on console remain unchanged for ScreenProbeGather/Reflection/Composition

#rb daniel.wright, sebastien.hillaire
#jira none
#preflight 62279c57695c94f981ae2c24

[CL 19306632 by Charles deRousiers in ue5-main branch]
2022-03-08 13:29:54 -05:00
Charles deRousiers
f0a55fdc1f Move #if STRATA_ENABLED within the strata shader files to simplify strata includes.
#rb none
#jira none
#preflight shader
#fyi sebastien.hillaire

[CL 19110961 by Charles deRousiers in ue5-main branch]
2022-02-24 03:40:43 -05:00
charles derousiers
5972579027 Add compact fast-path material for Strata.
#rb sebastien.hillaire
#jira none

#ROBOMERGE-AUTHOR: charles.derousiers
#ROBOMERGE-SOURCE: CL 18317401 in //UE5/Release-5.0/... via CL 18318069
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18318530 by charles derousiers in ue5-release-engine-test branch]
2021-11-29 18:42:19 -05:00
sebastien hillaire
f8e0092b8b New start material buffer: 2 uint using rop and the rest is written through UAV.
Huge optimisation for console.

#rb charles.derousiers

#ROBOMERGE-AUTHOR: sebastien.hillaire
#ROBOMERGE-SOURCE: CL 18309039 in //UE5/Release-5.0/... via CL 18309083
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18309131 by sebastien hillaire in ue5-release-engine-test branch]
2021-11-29 09:31:58 -05:00
charles derousiers
e789dfeb2c Remove strata classification texture.
* All state into are now stored into the header
* Toplayer data now contains both top layer normal & top layer roughness

#rb sebastien.hillaire
#jira none

#ROBOMERGE-AUTHOR: charles.derousiers
#ROBOMERGE-SOURCE: CL 18300408 in //UE5/Release-5.0/... via CL 18300423
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18300445 by charles derousiers in ue5-release-engine-test branch]
2021-11-26 10:59:06 -05:00
charles derousiers
14f9c77700 Change Strata header to keep flags compressed to reduce vgpr usage.
#rb sebastien.hillaire
#jira none

#ROBOMERGE-AUTHOR: charles.derousiers
#ROBOMERGE-SOURCE: CL 18270428 in //UE5/Release-5.0/... via CL 18270438
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18270450 by charles derousiers in ue5-release-engine-test branch]
2021-11-23 10:41:56 -05:00
charles derousiers
d64a83f7fc Change strata classification structure to store data into a bitfield to reduce VGPR pressure.
* VGPR 48 -> 44

#rb sebastien.hillaire
#jira none

#ROBOMERGE-AUTHOR: charles.derousiers
#ROBOMERGE-SOURCE: CL 18268021 in //UE5/Release-5.0/... via CL 18268036
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18268045 by charles derousiers in ue5-release-engine-test branch]
2021-11-23 05:09:10 -05:00
Marc Audy
0c3be2b6ad Merge Release-Engine-Staging to Test @ CL# 18240298
[CL 18241953 by Marc Audy in ue5-release-engine-test branch]
2021-11-18 14:37:34 -05:00
ben ingram
0bb0a923a0 Merging Dev-LWCRendering into Main, this includes initial work to support rendering with LWC-scale position
Basic approach is to add HLSL types FLWCScalar, FLWCMatrix, FLWCVector, etc.  Inside shaders, absolute world space position values should be represented as FLWCVector3.  Matrices that transform *into* absolute world space become FLWCMatrix.  Matrices that transform *from* world space become FLWCInverseMatrix.  Generally LWC values work by extending the regular 'float' value with an additional tile coordinate.  Final tile size will be a trade-off between scale/accuracy; I'm using 256k for now, but may need to be adjusted.  Value represented by a FLWCVector thus becomes V.Tile * TileSize + V.Offset.  Most operations can be performed directly on LWC values.  There are HLSL functions like LWCAdd, LWCSub, LWCMultiply, LWCDivide (operator overloading would be really nice here).  The goal is to stay with LWC values for as long as needed, then convert to regular float values when possible.  One thing that comes up a lot is working in translated (rather than absolute) world space.  WorldSpace + View.PrevPreViewTranslation = TranslatedWorldspace.  Except 'View.PrevPreViewTranslation' is now a FLWCVector3, and WorldSpace quantities should be as well.  So that becomes LWCAdd(WorldSpace, View.PrevPreViewTranslation) = TranslatedWorldspace.  Assuming that we're talking about a position that's "reasonably close" to the camera, it should be safe to convert the translated WS value to float.  The 'tile' coordinate of the 2 LWC values should cancel out when added together in this case.  I've done some work throughout the shader code to do this.  Materials are fully supporting LWC-values as well.  Projective texturing and vertex animation materials that I've tested work correctly even when positioned "far away" from the origin.

Lots of work remains to fully convert all of our shader code.  There's a function LWCHackToFloat(), which is a simple wrapper for LWCToFloat().  The idea of HackToFloat is to mark places that need further attention, where I'm simply converting absolute WS positions to float, to get shaders to compile.  Shaders converted in this way should continue to work for all existing content (without LWC-scale values), but they will break if positions get too large.

General overview of changed files:
LargeWorldCoordinates.ush - This defines the FLWC types and operations
GPUScene.cpp, SceneData.ush - Primitives add an extra 'float3' tile coordinate.  Instance data is unchanged, so instances need to stay within single-precision range of the primitive origin.  Could potentially split instances behind the scenes (I think) if we don't want this limitation
HLSLMaterialDerivativeAutogen.cpp, HLSLMaterialTranslator.cpp, Preshader.cpp - Translated materials to use LWC values
SceneView.cpp, SceneRelativeViewMatrices.cpp, ShaderCompiler.cpp, InstancedStereo.ush - View uniform buffer includes LWC values where appropriate
#jira UE-117101
#rb arne.schober, Michael.Galetzka

#ROBOMERGE-AUTHOR: ben.ingram
#ROBOMERGE-SOURCE: CL 17787435 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v881-17767770)

[CL 17787478 by ben ingram in ue5-release-engine-test branch]
2021-10-12 13:31:00 -04:00
eric mcdaniel
cae4133804 Global shader compilation warning cleanup
- newer DXC versions introduced a warning of ambigous type on bit shift operations
  - made a pass through global shaders to clean up those warnings
  - also hit any misc warnings encountered

#rb brian.white, krzysztof.narkowicz
#jira UECON-545

#ROBOMERGE-SOURCE: CL 16831175 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v836-16769935)

[CL 16831187 by eric mcdaniel in ue5-release-engine-test branch]
2021-07-12 16:44:47 -04:00
Guillaume Abadie
43ccc8111b Nukes USE_PREEXPOSURE
#rb uriel.doyon, jack.porter

[CL 16070774 by Guillaume Abadie in ue5-main branch]
2021-04-21 04:53:11 -04:00
Sebastien Hillaire
276a1d2eef Many fixes for anisotropic lighting to play well with clear coat.
- Fixed GBufferPostDecode to correctly decode custom data according to shading model.
- Fixed Reflection Env PS to apply the correct normal and roughness on the top clear coat layer lighting.
- Fixed ClearCoatBxDF to not apply anisotropy onto the top layer, for its roughness to not affect the bottom layer and added safe ranges to avoid NaNs.
- Fixed SSRReflection to trace for the top layer for clear coat. It will slowly lerp towards tracing for the bottom layer according to the clear coat parameter.

#rb Zabir.Hoque, Jason.Nadro

[CL 15938063 by Sebastien Hillaire in ue5-main branch]
2021-04-07 01:03:00 -04:00
Marc Audy
9753392e2b Merge UE5/RES CL# 15462083 to UE5/Main
This represents UE4/Main @ 15414221

[CL 15463811 by Marc Audy in ue5-main branch]
2021-02-18 18:13:28 -04:00
Sebastien Hillaire
2910638a7a Strata clean up
- only a single uint used for normal, roughness is moved on the classification state free bits
- renaming Normal to WorldNormal
- Removed duplciated classification code from Basepass.
- AO is now gamma 2.0 compressed.

#rb none
#fyi charles.derousiers

[CL 15396835 by Sebastien Hillaire in ue5-main branch]
2021-02-12 05:06:32 -04:00
Sebastien Hillaire
fc63054762 Strata SingleLayerWater:
- Removed use of gbuffer in SingleLayerWater passes
- SLW compute envbrdf in the compositing pass from strata water material.
- It is no longer needed to use the classification buffer, avoiding an extra classification pass just for water
- To do this, the SSR pass then also read the water BSDF directly
- Made room  in the top layer data for SSS data coming soon

#rb Charles.deRousiers

[CL 15387433 by Sebastien Hillaire in ue5-main branch]
2021-02-11 10:11:04 -04:00
Sebastien Hillaire
040305c113 Strata
- Basepass shader no longer expoert all rendertarget. Only scene color, preshado, velocity if enabled.
- More decoupling from GBuffer. Now normal gbuffer is not used by any of SSAO, DFAO, HBAO and SSR. Achieved  with permutations.
- Strata header now contains PrecShadow bits.

Shooter game compiles on pc and console. Tested with Strata disabled.

#rb Charles.deRousiers

[CL 15375091 by Sebastien Hillaire in ue5-main branch]
2021-02-10 05:47:34 -04:00
christopher waters
eb7f9fe732 Using the correct Min/Max SM6.0 intrinsics WaveActiveMin/WaveActiveMax.
#jira none
#rb brian.karis

[CL 14940386 by christopher waters in ue5-main branch]
2020-12-16 13:30:46 -04:00
Marc Audy
a7f9391231 Merge UE5/Release-Engine-Staging @ 14811410 to UE5/Main
This represents UE4/Main @ 14768117

For ReleaseObjectVersion.h
#lockdown Marcus.Wassmer

[CL 14811440 by Marc Audy in ue5-main branch]
2020-11-24 18:42:39 -04:00
Lukas Hermanns
dcbecb3e0c Fix casing in filename of #include directive.
#rb none
#fyi Guillaume.Abadie
#jira UE-101728
#rnx

[CL 14601583 by Lukas Hermanns in ue5-main branch]
2020-10-28 14:20:28 -04:00
Brian Karis
cf86003f19 Use SM6 wave ops names
#rb graham.wihlidal

[CL 14435919 by Brian Karis in ue5-main branch]
2020-10-06 23:19:47 -04:00
Marcus Wassmer
3b81cf8201 Merging using //UE5/Main_to_//UE5/Release-Engine-Staging @14384769
autoresolved files
#rb none

[CL 14384911 by Marcus Wassmer in ue5-main branch]
2020-09-24 00:43:27 -04:00
Daniel Wright
97cf839625 Merging //Tasks/UE4/Private-Reverb-Development-Lumen/... to //UE5/Main/...
Contains all work on Lumen since shipping Reverb in March:
 * New Opaque Final Gather with higher quality in clean architecture and better performance
 * Improved global tracing which reduces leaking
 * New basic Reflections pipeline which respects material Roughness
 * New HZB traces that are more accurate at tracing against the depth buffer
 * Hardware Ray Tracing paths for Lumen shadowing and Final Gather
#rb none

[CL 14274844 by Daniel Wright in ue5-main branch]
2020-09-08 17:44:06 -04:00
Josh Adams
0620eb45ac - Fixed some shader compile errors
[CL 14009727 by Josh Adams in ue5-main branch]
2020-08-03 09:02:40 -04:00
graham wihlidal
de46f8e4b9 Fix for && within || logical op parenthesis error on DXC when compiling SSRTRayCast
#rb none
#fyi guillaume.abadie

[CL 13999835 by graham wihlidal in ue5-main branch]
2020-08-01 01:40:38 -04:00