Commit Graph

171 Commits

Author SHA1 Message Date
Arciel Rekman
5623c7e0ae Fix disabling instanced stereo crashing the project.
#rb Jules.Blok
#jira UE-152879
#preflight none
#fyi Robert.Srinivasiah

[CL 20301834 by Arciel Rekman in ue5-main branch]
2022-05-20 15:54:01 -04:00
christopher waters
1e01768e33 Bindless shader parameters
- Adding support for bindless resources/samplers. The loose resources have to be wrapped in a macro that generates an index and proxy resource when bindless is enabled. Reflection has to parse these differently from other resources since they're parsed as uint parameters. The runtime also has to bind these differently since they end up needing to find their real resource in the binding data and then update a constant buffer.
- To assist in conversions, the shader compiler will detect if a shader is compiled with both bindless and non-bindless resources/samplers and will emit errors if that is the case.
- Adding support for bindless Uniform Buffer resources/samplers. Because Uniform Buffers aren't per-shader, they'll always update their constants with the bindless indices of their resources.
- Adding more flags to FShaderCodePackedResourceCounts required changing all the array initializations to individual parameters since not all the new flags are used everywhere.
- No shaders have been configured to support bindless resources/samplers. Yet.

#jira UE-139616
#rb zach.bethel, arciel.rekman
#preflight 6282b8ec44349a6581a21a39

[CL 20250348 by christopher waters in ue5-main branch]
2022-05-17 16:30:48 -04:00
Dmitriy Dyomin
038d909044 Support shading models for mobile deferred path when static lighting is disabled
#rb wei.liu
#jira none
#preflight 627b5f586842238976719cc3

[CL 20134438 by Dmitriy Dyomin in ue5-main branch]
2022-05-11 03:17:42 -04:00
Dmitriy Dyomin
f819c89c21 Support shading models in a mobile deferred shading path. Disabled by default
Requrements:
iOS: A8+
Android VK: more than 4 color attachements, more than 4 input attachments
Android GL: Unsuported - PLS seem to be limited to 128bits on most devices
#rb wei.liu
#preflight 625f866b9c09ef439db7612b

[CL 19861367 by Dmitriy Dyomin in ue5-main branch]
2022-04-22 01:15:27 -04:00
Wei Liu
04d7580d62 Clustered local lights and reflections are supported on mobile forward and deferred.
Local light shadows are supported on mobile forward and deferred, need to enable full depth prepass to generate the ShadowMaskTexture.

Remove the 4 maximum local lights limitation on mobile forward.

Remove the "High Quality Reflection" on mobile forward.

Disable simple lights on mobile forward.

#jira UE-149064

#rb Dmitriy.Dyomin

#preflight 625d17da772cf82d3a6059a6

[CL 19784597 by Wei Liu in ue5-main branch]
2022-04-18 09:09:40 -04:00
Sebastien Hillaire
674c1641ab Strata - advanced vis debug
- partial checkin to continue on another stream.
- Write to the end of the strata texture array is working.

#rb none
#preflight none
#fyi charles.derousiers

[CL 19752138 by Sebastien Hillaire in ue5-main branch]
2022-04-14 03:13:39 -04:00
carl lloyd
9bc1cec538 Enabling half precision floating point for Metal on iOS/tvOS
#rb Dmitriy.Dyomin, Laura.Hermanns
#jira UE-120588
#preflight 624c3b06f4217035fac65500

[CL 19626453 by carl lloyd in ue5-main branch]
2022-04-05 11:51:04 -04:00
Sebastien Hillaire
ab609c73b5 Add support for distance field shadow on water.
Storing water in gbuffer and runnign extra lighting pass would be too expenssiv. So instead, when in deferred, single layer water always output the main dir light luminance into a separate 111110 texture.
DF shadow is applied on that texture. DFShadow culling step is cached the first time for a given view in order to be able to reapply DFShadow later with a depth buffer containing water. This save 0.4ms on a base console.
DFShadow is naturaly skipped if the directional light does not have that feature enabled.
When DFShadow is executed, it is basically 0.24ms extra on a base console @ 1080p.
The separated light buffer is an extra 8MB allocated when in deferred.
This only works with deferred for now (forward does not run the reflection/composite pass).

Render target slot assignement is a bit fuzzy but this is a mostly static setup so should be fine. And could change with Strata down the line.

r.Water.SingleLayer.ShaderSupportDistanceFieldShadow is to enabled dfshadow on water for the shaders. Defaults to 1 and will only be enalbed when using deferred and when distance fields are enabled.
r.Water.SingleLayer.DistanceFieldShadow is a runtime toggle of the feature (if enabled the shaders still output to the separate light render target, but that is simply discarded).

Follow up: tile upsample, tile traceshadow, make it work with strata.

Tested shooter and console.

#rb Tiago.Costa, Kevin.Ortegren
#preflight https://horde.devtools.epicgames.com/job/62457ad79f404234145cd424

[CL 19613312 by Sebastien Hillaire in ue5-main branch]
2022-04-04 15:03:48 -04:00
christopher waters
8a555ab176 Adding missing DDC key modifications for DDSPI controlled defines.
#jira none
#rb jason.nadro
#preflight 623ce37615497b40c2015bb3

[CL 19504400 by christopher waters in ue5-main branch]
2022-03-24 18:55:49 -04:00
JayLu2000
25f73e4907 PR #8976: Add a setting to disable strip-reflect when Android shaders are compiled (Contributed by JayLu2000)
#jira UE-145556
#rb carl.lloyd, laura.hermanns
#preflight 623179958a603798938a9f22

[CL 19405778 by JayLu2000 in ue5-main branch]
2022-03-16 10:34:16 -04:00
Sebastien Hillaire
d28a031400 Strata - beginning of rough refraction of sub layers (with scene lighting split into untouched, sss and rough reffracted luminance)
- separate SSS, opaque rough refraction and scene color output when strata project setting is enabled.
- simple placeholder per pixel variance from roughness/layers computation
- SSS only reads from subsurface buffer when ORR is enabled
- Added simple combine pass to final scene lighting (no blur for now)
- Started adding tiling but reached UAV count limit. I will refactor code later to workaround that.
- Updated light rendering, reflection environment pixel shader. Next will be lumen and clustered deferred shading.

#preflight https://horde.devtools.epicgames.com/job/622fc09fe348fe2ada4214f8
#rb none
#fyi charles.derousiers, tiantian.xie

[CL 19382940 by Sebastien Hillaire in ue5-main branch]
2022-03-15 03:11:08 -04:00
Lukas Hermanns
c6ed66feff Enable CFLAG_ForceDXC for platforms that require DXC for HLSL2021.
#rb Guillaume.Abadie
#jira UE-138358
#preflight 622918411f1ec97d4e9741aa
#rnx

[CL 19325937 by Lukas Hermanns in ue5-main branch]
2022-03-09 16:26:11 -05:00
Andrew Davidson
4a3e582384 LWC: Remove UE_LARGE_WORLD_COORDINATES_DISABLED toggle
#rb stephen.holmes
[FYI] zak.middleton
#preflight 61f7d18b114ec25fe09648d6

#ROBOMERGE-OWNER: Andrew.Davidson
#ROBOMERGE-AUTHOR: andrew.davidson
#ROBOMERGE-SOURCE: CL 18788533 in //UE5/Release-5.0/... via CL 18788583 via CL 18788850
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v908-18788545)
#ROBOMERGE-CONFLICT from-shelf
#preflight 61f7eb7a114ec25fe0990f8c

[CL 18789644 by Andrew Davidson in ue5-main branch]
2022-01-31 10:10:51 -05:00
Charles deRousiers
90e7ad66a9 Add a IsStrataEnable function per module where it is used.
#rb none
#jira none
#fyi sebastien.hillaire
#preflight 61eebce65e0414e6ec1e40cb

[CL 18708521 by Charles deRousiers in ue5-main branch]
2022-01-24 10:02:04 -05:00
arciel rekman
0c74b967c3 Exclude editor-only shaders from games that don't support a cooked editor.
#rb Josh.Adams, Jason.Nadro
[REVIEW] [at]Josh.Adams, [at]Jason.Nadro
#jira none
#preflight none

#ROBOMERGE-AUTHOR: arciel.rekman
#ROBOMERGE-SOURCE: CL 18647895 in //UE5/Release-5.0/... via CL 18649305 via CL 18649672
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v900-18638592)

[CL 18649956 by arciel rekman in ue5-main branch]
2022-01-18 17:45:43 -05:00
axel riffard
92a7004918 Harmonize Metal version to use in iOS / Mac
#jira UE-135971
#rb jack.porter
[FYI] will.damon, carl.lloyd
#preflight 61e51ef2a2616066f675dd5e

#ROBOMERGE-OWNER: axel.riffard
#ROBOMERGE-AUTHOR: axel.riffard
#ROBOMERGE-SOURCE: CL 18631139 in //UE5/Release-5.0/...
#ROBOMERGE-BOT: UE5 (Release-5.0 -> Release-Engine-Staging) (v899-18417669)
#ROBOMERGE-CONFLICT from-shelf
#p4v-cherrypick 18631594
#preflight 61e643cb1f30b67a22f3febd

[CL 18636647 by axel riffard in ue5-main branch]
2022-01-17 23:50:00 -05:00
arciel rekman
2a499437fe Change shader compression method to Oodle Selkie6 by default (UE-136845).
- Provides about 8% runtime memory savings (in local tests).
- Also, adds more compression types for shaders.
- Impact on the shader compilation (in SCWs) seems to be negligible in local tests.

#rb Devin.Doucette, Charles.Bloom
[REVIEW] [at]Devin.Doucette, [at]Charles.Bloom, [at]Jason.Nadro
#jira UE-136845

#ROBOMERGE-AUTHOR: arciel.rekman
#ROBOMERGE-SOURCE: CL 18502862 via CL 18503105 via CL 18503112 via CL 18505939 via CL 18505950
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18505961 by arciel rekman in ue5-release-engine-test branch]
2022-01-04 00:58:30 -05:00
tuxerr
a531f1d4b4 PR #8679: regenerate UBO structs when platform changes (Contributed by tuxerr)
#rb Mihnea.Balta,Lukas.Hermanns
[FYI] Arciel.Rekman
#preflight 61a9017f800738dbfbbc4920

#ROBOMERGE-AUTHOR: jeannoe.morissette
#ROBOMERGE-SOURCE: CL 18408495 in //UE5/Release-5.0/... via CL 18408515
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v897-18405271)

[CL 18408530 by tuxerr in ue5-release-engine-test branch]
2021-12-08 13:31:51 -05:00
arciel rekman
f302f8f030 Fix CVars not being picked up from other sections (UE-135567).
- Some projects put rendering CVars in other sections than RendererSettings.

#jira UE-135567
[at]Josh.Adams, [at]Dmitriy.Dyomin
#rb Josh.Adams, Dmitriy.Dyomin

#ROBOMERGE-AUTHOR: arciel.rekman
#ROBOMERGE-SOURCE: CL 18270117 in //UE5/Release-5.0/... via CL 18270123
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18270137 by arciel rekman in ue5-release-engine-test branch]
2021-11-23 10:17:56 -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
aurel cordonnier
fc542f6cfd Merge from Release-Engine-Staging @ 18081189 to Release-Engine-Test
This represents UE4/Main @18073326, Release-5.0 @18081140 and Dev-PerfTest @18045971

[CL 18081471 by aurel cordonnier in ue5-release-engine-test branch]
2021-11-07 23:43:01 -05:00
carl lloyd
232f64154e Added support for full precision in Material expressions to project
Added override for half precision to Materials

#jira UE-130988
#rb Jack.Porter, Dmitriy.Dyomin
#p4v-cherrypick 17965223

#ROBOMERGE-AUTHOR: carl.lloyd
#ROBOMERGE-SOURCE: CL 18035100 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v885-17909292)

[CL 18035152 by carl lloyd in ue5-release-engine-test branch]
2021-11-03 11:57:39 -04:00
christopher waters
a43a3f735f More bring-up work on bindless in D3D12RHI and initial public RHI support:
- Bindless rendering is not enabled anywhere yet.
- Adding bSupportsBindless to DDSPI.
- Moving ED3D12DescriptorHeapType into RHI and renaming to ERHIDescriptorHeapType.
- Adding FRHIDescriptorHandle for public usage of bindless indices.
- Adding GetBindlessHandle() to RHI SamplerState, SRV, UAV.
- Adding GetDefaultShaderResourceView() to RHI Textures.
- Adding bindless Sampler heap support to D3D12.
- Cleaned up some common shader code in prep for future bindless work.

#jira none
#rb mihnea.balta
#preflight 6169f8fafeab330001591bd0

#ROBOMERGE-AUTHOR: christopher.waters
#ROBOMERGE-SOURCE: CL 17846249 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v883-17842818)

[CL 17846289 by christopher waters in ue5-release-engine-test branch]
2021-10-18 12:00:17 -04:00
aurel cordonnier
a12d56ff31 Merge from Release-Engine-Staging @ 17791557 to Release-Engine-Test
This represents UE4/Main @17774255, Release-5.0 @17791557 and Dev-PerfTest @17789485

[CL 17794212 by aurel cordonnier in ue5-release-engine-test branch]
2021-10-12 21:21:22 -04: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