238 Commits

Author SHA1 Message Date
serge bernier
cb29e2d03d Fix global usage of all cvars related to shader pipelines:
r.ShaderPipelines
r.Material.ExcludeNonPipelinedShaders

Both cvars are currently disable on WindowsEngine.ini which make them also disable when we cook for consoles. ExcludeNonPipelinedShaderTypes is currently used only at cooking time when we compile shaders which is currently returning false, since the value is disabled on windows. Making those cvars use FShaderPlatformCachedIniValue, will allow to have specific platform value when cooking for a specific target. Moving r.Material.ExcludeNonPipelinedShaders to the defaultengine.ini file to keep it disable for the moment and not affecting shader key string. Will enable it progressively on console later.


r.Shaders.RemoveUnusedInterpolators

Make that cvar platform agnostic, since it will be used in on other consoles eventually. Platforms supporting the stripping of unused interpolators will check the same flag (CFLAG_ForceRemoveUnusedInterpolators) to enable it. Since windows can run opengl, and stripping is not supported on that shader platform, add extra logic to exclude the flag.

-Make the RHISupportsShaderPipelines function access a real DDPI attribute and not just test if we are not on mobile. Will need this to be able to have stripping unused shader interpolators on Switch.

[REVIEW] Laura.Hermanns

[CL 26038736 by serge bernier in 5.3 branch]
2023-06-16 02:51:55 -04:00
charles derousiers
d31253e301 Add Disney Sheen model for Substrate.
This sheen mode is enabled by default for platforms which high quality shading. The models degrades into a Charlie Sheen model for lower platform. This can also be controlled with r.Substrate.SheenQuality.

#rb none
[FYI] sebastien.hillaire, chris.kulla

[CL 25910338 by charles derousiers in ue5-main branch]
2023-06-10 02:09:12 -04:00
Sebastien Hillaire
302b839027 Substrate - added platofrm control for specular profile through r.Substrate.SpecularProfile.
#rb none
#preflight none
#fyi charles.derousiers

[CL 25601366 by Sebastien Hillaire in ue5-main branch]
2023-05-24 09:15:47 -04:00
dan elksnitis
f645f93588 [shaders] remove legacy preprocessor option & mcpp library
#rb Jason.Nadro
#preflight 6467bf0c2c0a5da0dcd7aaf2
#fyi Yuriy.ODonnell

[CL 25549427 by dan elksnitis in ue5-main branch]
2023-05-19 14:50:25 -04:00
Sebastien Hillaire
5cf6e3bb5b Strata - Glints prototype.
Contains aproved LICENCE and TPS for code and LUT.
Enabled via r.substrate.glint 1

#preflight https://horde.devtools.epicgames.com/job/645cd751aa3c584c0b384ea1
#rb charles.derousiers

[CL 25433839 by Sebastien Hillaire in ue5-main branch]
2023-05-11 15:33:23 -04:00
Laura Hermanns
b8c526c389 DXC and SPIRV-Cross fixes to enable Substrate in D3D11:
- Support structured buffers in HLSL backend of SPIRV-Cross (PR #2143).
- Integrate SPIRV-Cross fix to forward opaque types in GLSL backend (PR #2110).
- Integrate SPIRV-Cross fix to use actual field offset to validate vec4 boundary alignment (#PR 2139).
- Integrate SPIRV-Cross fix to not restrict SV_RenderTargetArrayIndex to GS and MS (#PR 2138).
- Make SV_Position decoration as implicitly invariant optional (Used to address Z-fighting issues in Vulkan and Metal; Drastically impacts vertex shader performance on certain platforms).
- Don't force DXC for all shaders when r.Substrate is enabled.

#jira UE-174555
#rb Sebastien.Hillaire, Carl.Lloyd, Dan.Elksnitis
#fyi Brian.White, Jason.Nadro, JeaNoe.Morissette, Yuriy.Odonnell, Guillaume.Abadie
#preflight 6453d3df0e33f2d51d2b032e

[CL 25353473 by Laura Hermanns in ue5-main branch]
2023-05-05 09:21:36 -04:00
florin pascu
11ed4ccf7a Add CFLAG_CullBeforeFetch and CFLAG_WarpCulling to control warp culling and CBF hardware optimizations
#rb Laura.Hermanns, Brian.White, Serge.Bernier
#preflight 6446fc3e641e2c3cb4db18d3

[CL 25177654 by florin pascu in ue5-main branch]
2023-04-25 06:01:45 -04:00
Charles deRousiers
2dd761fc54 Change Subsutrate sRGB encoding.
* Default now uses accurate sRGB value encoding.
* Lower platforms using lower shading quality (i.e., r.Substrate.ShadingQuality > 1), will continue to use the cheap sqrt/square encoding/decoding

Using proper sRGB encoding increases occupangy by 8 vgpr on ps4 and a fullscreen quad during the base pass by 0.2ms due to lower occupancy. So keep it disabled on lower platforms.

#rb none
#jira none
#preflight 642ad0058f078cc7031c1ae2
#fyi sebastien.hillaire

[CL 24891794 by Charles deRousiers in ue5-main branch]
2023-04-03 09:35:50 -04:00
Wei Liu
01a415b564 Sampling SceneDepth instead of fetching SceneDepthAux when full depth prepass is enabled.
#jira none

#rb Dmitriy.Dyomin
#preflight 64267ed89621ba9cb48c0edf

[CL 24868190 by Wei Liu in ue5-main branch]
2023-03-31 03:12:41 -04:00
dan elksnitis
49d7985a85 [shaders] Add "compile argument" functionality for generic parameters consumed by compile backends, along with helper to set both a compile arg AND define for cases which require both. The purpose of this is to move towards enforcing that preprocessor defines should _only_ be used during the preprocessing phase itself; the subset of defines that are currently used only as arguments to the compile backends (or used as both actual preprocessor defines and backend arguments) should use this mechanism instead. This allows us to explicitly identify and hash such parameters to be included in a stable key based primarily on a hash of preprocessed/deadstripped source; without it we would need to hash all defines which will defeat most of the deduplication benefit of doing this. A subsequent change will deprecate the GetDefinitions function on the shader compilation environment to enforce that defines cannot be read by anything outside of core shader system functionality.
#rb Massimo.Tristano
#rb Laura.Hermanns
#preflight 64258c2e5e52099fe3d03625

[CL 24854110 by dan elksnitis in ue5-main branch]
2023-03-30 10:47:09 -04:00
Sebastien Hillaire
88900c95e5 Compilation error fix for 24853509
#rb none
#preflight none

[CL 24853689 by Sebastien Hillaire in ue5-main branch]
2023-03-30 10:16:51 -04:00
Sebastien Hillaire
7e4d413b5f Substrate - always precompile with DXC when substrate is enabled and if DXC is supported. No need for any ForceDXC cvar anymore.
#rb Laura.hermanns
#preflight https://horde.devtools.epicgames.com/job/64253dafe11ce5214fec8ddd
#fyi charles.derousiers

[CL 24853509 by Sebastien Hillaire in ue5-main branch]
2023-03-30 10:01:27 -04:00
Sebastien Hillaire
de532bf488 Substrate - GPULightmass support
#rb none
#preflight https://horde.devtools.epicgames.com/job/64241210e11ce5214f740ebd
#fyi charles.derousiers

[CL 24833842 by Sebastien Hillaire in ue5-main branch]
2023-03-29 07:24:23 -04:00
Sebastien Hillaire
1491943760 Substrata - ray tracing material shaders uses fully simplified material for smaller payload.
Next would be to have the fully simplified mode disable anisotropy to have an even lower payload size.

#rb charles.derousiers
#preflight https://horde.devtools.epicgames.com/job/6422ad44973e609670e855c8

[CL 24815921 by Sebastien Hillaire in ue5-main branch]
2023-03-28 05:25:01 -04:00
Dmitriy Dyomin
1221e5705d Added support for ASTC Luminace+Alpha encoded normal maps
#jira none
#preflight 6404782e1d304a5471847436

[CL 24518576 by Dmitriy Dyomin in ue5-main branch]
2023-03-05 21:08:09 -05:00
charles derousiers
a6b3723b28 Add VSM high quality shadow filtering for translucent surface for Substrate and legacy path.
This is a global opt-in feature.

#rb ola.olsson, andrew.lauritzen
#jira none
#lockdown juan.canada
#preflight 63fe7e1bf43e53f681c31d03

[CL 24462071 by charles derousiers in ue5-main branch]
2023-03-01 10:01:35 -05:00
carl lloyd
ce3e8fe3fe Move Fortnite to OpenGL DXC
Fixed bug in Shader Key with OpenGL

#rb Allan.Bentham
[FYI] Pete.Sauerbrei

[CL 24312254 by carl lloyd in ue5-main branch]
2023-02-20 07:25:20 -05:00
wouter dek
3ae5c6c895 Convert shader type and parameter struct metadata from global variables to static locals to defer initialization. This allows us to create these types dynamically at startup, while keeping the rest of the infrastructure as is.
#rb jason.nadro
#preflight 63f352130803c73accb744f1

[CL 24311526 by wouter dek in ue5-main branch]
2023-02-20 06:10:39 -05:00
christopher waters
87014d9ccf Allow configuration of Bindless on a per-format basis in configs.
- The config section is the DDSPI ShaderFormat of the shader platform
- BindlessResources and BindlessSamplers can be set independently
- The cvars still exist and will take precedence over the config settings.
- Renamed RHIGetBindlessResourcesConfiguration/RHIGetBindlessSamplersConfiguration to have the word "Runtime" in them to reflect that they should only be used at runtime and not when deciding if it's enabled for a shader.

#jira UE-171919
#rb jason.nadro, yuriy.odonnell, jeannoe.morissette
#preflight 63edaabd0a06073fef07655f

[CL 24282763 by christopher waters in ue5-main branch]
2023-02-17 11:01:24 -05:00
Arciel Rekman
84d3f99470 [Backout] - CL24227640
#fyi wouter.dek

The problem with this change is that late-created shader types will not be in the shadertype list and as such will not be included in the shader map even if their ShouldCompilePermutation() would return true.

Original CL Desc
-----------------------------------------------------------------
Convert shader type and parameter struct metadata from global variables to static locals to defer initialization. This allows us to create these types dynamically at startup, while keeping the rest of the infrastructure as is.

#preflight 63eca58e7d2ec3d2fd286d9a
#rb zach.bethel

[CL 24240825 by Arciel Rekman in ue5-main branch]
2023-02-15 15:57:24 -05:00
wouter dek
7a70fa6a8f Convert shader type and parameter struct metadata from global variables to static locals to defer initialization. This allows us to create these types dynamically at startup, while keeping the rest of the infrastructure as is.
#preflight 63eca58e7d2ec3d2fd286d9a
#rb zach.bethel

[CL 24227640 by wouter dek in ue5-main branch]
2023-02-15 05:55:29 -05:00
charles derousiers
2e825249bd Add optional accurate sRGB encoding for Strata pixel payload.
#rb sebastien.hillaire
#jira none
#preflight 63e40213244dc45a2026160c
#lockdown juan.canada

[CL 24085322 by charles derousiers in ue5-main branch]
2023-02-08 18:00:32 -05:00
eric renaudhoude
4c7052d24b ColorManagement: Working color space support in volumetric cloud rendering.
#jira UE-170709
#rb sebastien.hillaire
#preflight 63e19ebbb923ed4bdd00b15d

[CL 24043003 by eric renaudhoude in ue5-main branch]
2023-02-06 19:59:13 -05:00
dmitriy dyomin
b447633a62 Fixed: Virtual texture shimmering on mobile platforms
Added manual VT filtering for mobile platforms that do not use TAA (contributed by albin.bernhardsson at ARM)
#jira UE-175862
#rb jeremy.moore
#preflight 63db903bba4fadeef046dc56

[CL 23967866 by dmitriy dyomin in ue5-main branch]
2023-02-02 09:58:44 -05:00
charles derousiers
5229394cfe Fix incorrect material appearance on raytracing material with Strata enabled
* Add adaptive RT material payload for Strata.
* Centralize all Strata settings in RenderCore/RenderUtils.h to ensure consistency

#rb chris.kulla
#jira none
#preflight 63d43bcff626715201a0ed1d
[FYI] sebastien.hillaire

[CL 23923301 by charles derousiers in ue5-main branch]
2023-01-31 01:12:18 -05:00