Commit Graph

288 Commits

Author SHA1 Message Date
aleksander netzel
cb2db589bd HWRT: Turn r.RayTracing.CompileMaterialCHS/AHS into per-platform cvars.
#rb Arciel.Rekman

[CL 33201400 by aleksander netzel in ue5-main branch]
2024-04-24 11:51:05 -04:00
graham wihlidal
6483e2aaaa [Nanite-Materials] First large scale removal of legacy PS material shading path from Nanite (in favor of new system). Lumen needs to be moved over to the new system in order to fully remove the legacy path (WIP).
#rb zach.bethel
#jira UE-187480
#fyi brian.karis, rune.stubbe, jamie.hayes, juan.canada

[CL 33127625 by graham wihlidal in ue5-main branch]
2024-04-20 00:25:44 -04:00
graham wihlidal
9fceb67705 Removed r.Nanite.AllowTessellation to always compile in support for Nanite tessellation. Can still use r.Nanite.Tessellation runtime toggle, but shaders are always built now.
#rb Brian.Karis
#jira UE-190057
#fyi rune.stubbe, jamie.hayes

[CL 33016018 by graham wihlidal in ue5-main branch]
2024-04-16 17:39:19 -04:00
john huelin
2affa78392 Fix CIS compilation issue
#rb Wojciech.Krywult

[CL 32856120 by john huelin in ue5-main branch]
2024-04-10 10:20:42 -04:00
john huelin
7121101cd8 SDK (1): Changes in common code needed to support SDK changes on some platforms
#rb Wojciech.Krywult

[CL 32855114 by john huelin in ue5-main branch]
2024-04-10 09:49:42 -04:00
matt peters
24ea789e44 MaterialInterface: Refactor GetMaterialShaderMapKey into RecordOrEmitMaterialShaderMapKey which takes an FMaterialKeyGeneratorContext instead of an FShaderKeyGenerator. FMaterialKeyGeneratorContext can handle any one of three modes: emit hash strings or save/load data needed for hash strings to compact binary. Use the new RecordOrEmitMaterialShaderMapKey to Save/Load and Emit the material dependency hash for incremental cooking.
#jira UE-203846
#rnx
#rb dan.elksnitis

[CL 32725752 by matt peters in ue5-main branch]
2024-04-04 08:29:57 -04:00
graham wihlidal
06166d1975 [Nanite-Skinning] Added missing shader map DDC key values for r.Nanite.AllowSplineMeshes and r.Nanite.AllowSkinnedMeshes
#rb jamie.hayes
#jira none

[CL 32714056 by graham wihlidal in ue5-main branch]
2024-04-03 18:35:58 -04:00
chris kulla
5eeed6f9dc Shaders: Add a define to all shaders of the entry point name (defined as itself)
This allows the following pattern when there are multiple shader entrypoints in a single file:

#ifdef MyEntryPointName

void MyEntryPointName(...)
{
}

#endif

This makes it possible to completely hide code and variables that are specific to one shader type from the others, while keeping the convenience of having multiple shader definitions in a single .usf file. This pattern is completely opt-in and therefore does not disrupt any previous idioms, though it does mean some code could be simplified going forward.

Use this pattern to fix warnings from the new DXC compiler in lumen and distance field shaders stemming from a THREADGROUP_SIZE being re-used on an unused entrypoint and creating invalid dimensions. This warnings only occurs when the shader minifier is enabled, but with this new approach, the redundant code is stripped out before the minifier runs, which leads to more savings overall.


#rb graham.wihlidal, Krzysztof.Narkowicz

[CL 32654032 by chris kulla in ue5-main branch]
2024-04-01 18:15:28 -04:00
matt peters
236de90692 Shader Keys: Add a keygenerator struct FShaderKeyGenerator than can generate either full string keys or hashed keys. Hashed keys are faster to create and will be used for incremental cook package dependencies.
#jira UE-203846
#rnx
#rb dan.elksnitis, christopher.waters

[CL 32550793 by matt peters in ue5-main branch]
2024-03-27 14:11:21 -04:00
eric renaudhoude
e34f40ba3e ColorManagement: Remaining deprecation of headers & color management module, since they were moved to Core at CL 32299544.
#jira UE-201221
#rb Sebastien.Hillaire
#rnx

[CL 32470542 by eric renaudhoude in ue5-main branch]
2024-03-25 11:04:55 -04:00
eric renaudhoude
a9cf84f298 ColorManagement: Fixed inaccurate luminance factors globally.
* This change updates the legacy NTSC luminance factors to working color space accurate ones. By default, those now match the sRGB/Rec.709 definition.
* Legacy factors still accessible by enabling a new renderer project setting: "r.LegacyLuminanceFactors".

#jira UE-201221
#rb chris.kulla, Krzysztof.Narkowicz, Sebastien.Hillaire

[CL 32327656 by eric renaudhoude in ue5-main branch]
2024-03-19 11:55:20 -04:00
kenzo terelst
df0b50da8a Rename EShaderPermutationPrecacheRequest members and add comments to better describe the different return values
[CL 32320526 by kenzo terelst in ue5-main branch]
2024-03-19 05:29:36 -04:00
kenzo terelst
f1c87d59e6 Add ShouldPrecachePermutation to FShaderType to check if shader permutation needs PSO precaching on startup - by default ShouldCompilePermutation is used
EShaderPermutationPrecacheRequest is returned to define if a permutation is required, not required or development only. Only required PSOs are precached.
DevelopmentOnly should be used for debug permutations and won't trigger an ensure when permutation is used at runtime which isn't requested for precaching.
Validation also runs in editor builds.

#rb christopher.waters

[CL 32297715 by kenzo terelst in ue5-main branch]
2024-03-18 07:49:34 -04:00
dan elksnitis
721a361177 [shaders] optimize AppendKeyStringShaderDependencies by caching FShaderParametersMetadata pointers in each shader/vf type instead of uniform buffer names; this eliminates a bunch of string hashing/comparison/fname construction that was previously needed every time this function is called and improves performance of GetMaterialShaderMapKeyString by approximately 20%
#rb christopher.waters

[CL 32085954 by dan elksnitis in ue5-main branch]
2024-03-07 10:17:38 -05:00
wouter dek
677a7d6665 Parallelize UpdateReferencedUniformBufferNames, which saves a second on startup
#rb dan.elksnitis, jason.hoerner

[CL 31649258 by wouter dek in ue5-main branch]
2024-02-20 12:37:39 -05:00
sebastien hillaire
6740e01230 Lumen - added render settings to remove all translucent surface for lumen scene when it is know trnaslucent refraction will not be used by a project.
#rb jamie.hayes, Krzysztof.Narkowicz

[CL 31519973 by sebastien hillaire in ue5-main branch]
2024-02-15 10:36:53 -05:00
laura hermanns
3e2c99ebce [Shaders] Remove Hlslcc form GL backend; Mobile renderer fully switched to DXC.
#rnx
#rb Carl.Lloyd, Dmitriy.Dyomin, Florin.Pascu
[FYI] Rolando.Caloca, Jason.Nadro

[CL 31258039 by laura hermanns in ue5-main branch]
2024-02-07 10:32:52 -05:00
charles derousiers
15b747649b Add project settings for hair tristrip geometry as not all project are compatible with this.
#rb charles.derousiers


#changelist validated
#virtualized

[CL 31249413 by charles derousiers in ue5-main branch]
2024-02-07 01:35:42 -05:00
bob tellez
bb4b933b0b [Backout] - CL30979008
#fyi bob.tellez
Original CL Desc
-----------------------------------------------------------------
[Backout] - CL30976715
#fyi Luke.Thatcher
Original CL Desc
-----------------------------------------------------------------
Remove "r.RecompileRenderer", STORE_ONLY_ACTIVE_SHADERMAPS, and all associated dead code paths that are no longer used.
 - r.RecompileRenderer has been broken since at least August 2019 when CL 8231930 disabled the implementation of BackupGlobalShaderMap etc
 - STORE_ONLY_ACTIVE_SHADERMAPS was disabled in 14363137 (September 2020) to resolve FORT-312158 (enabling the new loader). Fortnite was the only user of this code path.
 - This is a delete-only change.

#jira UE-167133
#rb Arciel.Rekman, Jason.Nadro

[CL 30987478 by bob tellez in ue5-main branch]
2024-01-29 23:48:09 -05:00
bob tellez
9abacf237b [Backout] - CL30976715
#fyi Luke.Thatcher
Original CL Desc
-----------------------------------------------------------------
Remove "r.RecompileRenderer", STORE_ONLY_ACTIVE_SHADERMAPS, and all associated dead code paths that are no longer used.
 - r.RecompileRenderer has been broken since at least August 2019 when CL 8231930 disabled the implementation of BackupGlobalShaderMap etc
 - STORE_ONLY_ACTIVE_SHADERMAPS was disabled in 14363137 (September 2020) to resolve FORT-312158 (enabling the new loader). Fortnite was the only user of this code path.
 - This is a delete-only change.

#jira UE-167133
#rb Arciel.Rekman, Jason.Nadro

[CL 30979008 by bob tellez in ue5-main branch]
2024-01-29 17:22:09 -05:00
Luke Thatcher
4eb84944ad Remove "r.RecompileRenderer", STORE_ONLY_ACTIVE_SHADERMAPS, and all associated dead code paths that are no longer used.
- r.RecompileRenderer has been broken since at least August 2019 when CL 8231930 disabled the implementation of BackupGlobalShaderMap etc
 - STORE_ONLY_ACTIVE_SHADERMAPS was disabled in 14363137 (September 2020) to resolve FORT-312158 (enabling the new loader). Fortnite was the only user of this code path.
 - This is a delete-only change.

#jira UE-167133
#rb Arciel.Rekman, Jason.Nadro

[CL 30976715 by Luke Thatcher in ue5-main branch]
2024-01-29 15:42:08 -05:00
patrick kelly
36380c6163 Heterogeneous Volumes: Initial shadow-casting support and integration with translucency pass.
#rb stu.mckenna krzysztof.narkowicz
#jira UE-190041

[CL 30914925 by patrick kelly in ue5-main branch]
2024-01-26 00:33:50 -05:00
laura hermanns
fffc6b84e1 Enable DXC by default for remaining SPIR-V backends.
#jira UE-182488
#rb Jason.Nadro, serge.bernier

[CL 30784243 by laura hermanns in ue5-main branch]
2024-01-22 15:37:51 -05:00
jason nadro
7f1092758a [Shaders][Material Editor] - Add generic, data driven key, value shader statistics.
- Shader stats are simply key (FName) and value (POD types) that are stored per-shader.
- A Shader Statistic is a variant that can take on the following POD types: bool, float, int32, uint32
- Currently don't support strings since those weren't as trivial to implement (needed conversion and special case code to support serializing these to the memory images required by shader maps)
- Adds another shader statistics row in the Material Editor that will show the platform specific stats.
- The platform statistics are turned into a comma and newline separated string that is displayed to the user.
- Bump the shader output worker version since I'm changing the output file format (to contain the stats).
- The shader compiler output stores the stats as a `TMap<FString, FShaderStatVariant>`.  Serializing across FNames between Shader Compiler Worker and the main process wasn't working (different name tables).
- When storing and serializing the stats to the shader map we convert them to FNames. (see `FShader::FShader()`)

#rb dan.elksnitis

[CL 30394059 by jason nadro in ue5-main branch]
2023-12-19 09:36:35 -05:00
charles derousiers
821a52514b Add IES Atlas support for translucent surface.
#rb charles.derousiers
[FYI] sebastien.hillaire

[CL 30207129 by charles derousiers in ue5-main branch]
2023-12-08 03:03:42 -05:00