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]
* 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]
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]
- 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]
- 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]
- 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]
- 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]
- 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]
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]