Commit Graph

1641 Commits

Author SHA1 Message Date
kenzo terelst
b22e8c57d5 Back out Water Precache PSO changes because of compile issues on certain platforms
#jira UE-164485
#rb none

[CL 22100281 by kenzo terelst in ue5-main branch]
2022-09-20 15:39:59 -04:00
kenzo terelst
c4d378b09a - Precache PSOs for WaterMeshComponents
- Fix for template specialization declares of vertex factory static types and templates

#jira UE-139584
#rb Kevin.Ortegren
#preflight 63298d8ea236a029debe41f6

[CL 22091371 by kenzo terelst in ue5-main branch]
2022-09-20 09:10:18 -04:00
Matt Peters
5f9bf2c4d7 Fix build error: ! and & together are ambiguous precedence so wrap in parentheses to clarify.
#rb None, trivial
#rnx
#preflight None, unavailable

[CL 22086075 by Matt Peters in ue5-main branch]
2022-09-19 21:04:51 -04:00
dmitriy dyomin
c833228e68 Mobile: Use 3 shadow cascades on Epic shadow quality (Android, iOS)
Remove r.Shadow.CSM.MaxMobileCascades, use r.Shadow.CSM.MaxCascades to limit number of cascades
#jira UE-142377
#rb jack.porter
#preflight 632843baf258fccf9879925a

[CL 22084614 by dmitriy dyomin in ue5-main branch]
2022-09-19 19:48:09 -04:00
Matt Peters
a8028aafba MPCook: Replicate shaderlibrary from CookWorker to Director.
#rb Jason.Nadro, Robert.Srinivasiah, Arciel.Rekman
#rnx
#preflight 6328bcd20a4ad044de3cbcfc

[CL 22078910 by Matt Peters in ue5-main branch]
2022-09-19 15:44:57 -04:00
Charles deRousiers
f7a18f5fbf Add support for blending DBuffer as a post-pass.
The post base-pass dbuffer blending only works for simple and single materials. Complex material are still apply during the base pass. This pass is disabled by default, and will be enabled only per-platform. Following needs to happen making unpacking/packing modulare and reusable.

On lower-platform this allows to reduce significatly the cost of base pass (BasePass:-1.2ms DBufferPass+0.4ms = -0.8ms net), as the compiler can better prune code, and allows to increase occupancy.

#rb none
#jira none
#preflight 6324633b74361465145e0f75
#fyi sebastien.hillaire

[CL 22048223 by Charles deRousiers in ue5-main branch]
2022-09-16 08:21:00 -04:00
Yuriy ODonnell
6db429d732 ShaderMinifier - Add experimental CFLAG_RemoveDeadCode to run shader rewriting step that removes unused functions and types from shader source before compilation to improve compile times
#rb Jason.Nadro
#preflight 632363a75a44869a7d025585

[CL 22036834 by Yuriy ODonnell in ue5-main branch]
2022-09-15 15:45:20 -04:00
Thomas Engel
f389bb820a Adding HDR playback capabilities to MediaFrameWork & Electra (PC, GDK, PS4, PS5)
#jira UE-163865
#fyi jens.petersam
#preflight 632357cdc225e8be3809214e

[CL 22034307 by Thomas Engel in ue5-main branch]
2022-09-15 14:30:21 -04:00
Andriy Tylychko
f78784aef7 switched back to lock-free allocator for tasks and removed CreateCompletionHandle()
#rb fransic.hurteau
#preflight 6322fb82e872d7da038cb2bb

[CL 22026345 by Andriy Tylychko in ue5-main branch]
2022-09-15 06:46:54 -04:00
Charles deRousiers
64aa33f6c2 Change Strata byte per pixel budget to be driven per platform, rather than a global project settings.
#rb none
#jira none
#preflight 6322ef526a1299de1d3daaa6
#fyi sebastien.hillaire

[CL 22025779 by Charles deRousiers in ue5-main branch]
2022-09-15 05:43:33 -04:00
josie yang
0c0faf15f5 Fix a couple issues introduced by CL21962580 "Reduce GPUSkinPassThrough vertex factory shader permuations by merging it into local vertex factory."
Issue 1: unbound parameters errors when `r.ShaderDevelopmentMode=1` launching EngineTest
Issue 2: Debug editor build Ensure condition failed in MeshPassProcesser.cpp shader with vertex factory FLocalVertexFactory never set texture at BaseIndex6

#jira UE-157662
#rb jason.nadro
#preflight 6321e1dd9677b738f4ecbb6f

[CL 22009358 by josie yang in ue5-main branch]
2022-09-14 12:31:18 -04:00
florin pascu
2ff00a89a2 Fix RT for other platforms besides PC
#rb Aleksander.Netzel
#jira none
#preflight 6321be4c29254beccbc5c4bd

[CL 22008205 by florin pascu in ue5-main branch]
2022-09-14 11:35:13 -04:00
zach bethel
a5da52cc62 Use format string in RDG events with shipping builds.
[CL 21999633 by zach bethel in ue5-main branch]
2022-09-14 00:02:33 -04:00
zach bethel
f1e1522f88 Offload GPU scene uploads to an async task.
#preflight 6320e00e8838676d100595ed

[CL 21997767 by zach bethel in ue5-main branch]
2022-09-13 21:47:56 -04:00
jian ru
b5608b7b5b Add options to run Lumen passes on async compute. Also added an option to disable async nanite rasterization for shadow depths only so lumen passes can overlap with shadow depths.
#rb krzysztof.narkowicz
[FYI] krzysztof.narkowicz, daniel.wright

[CL 21997760 by jian ru in ue5-main branch]
2022-09-13 21:47:35 -04:00
kenzo terelst
e5d299b320 PSO Precache Vertex factory changes:
- Make ManualVertexFetch & SupportNullPixelShader flags on type instead of members on the VertexFactory instance
- Add PSOPrecaching flag and static PSO precaching element fetch function which can be called on the type during PSO precaching itself
- Implement GetPSOPrecacheVertexFetchElements on most commonly used VertexFactories

#jira UE-139584
#rb Jason.Nadro, Josie.Yang

[CL 21989510 by kenzo terelst in ue5-main branch]
2022-09-13 15:00:41 -04:00
florin pascu
0bc3e61f01 - Add IsRayTracingEnabled(ShaderPlatform) overload that returns true when Project has RT on and ShaderPlatform supports RT and has it on for the project
- Don't create FRayTracingMeshProcessor when IsRayTracingEnabled is false
- Only Add RayTracingGeometries when IsRayTracingEnabled returns true
They are added to the FRayTracingMeshProcessor and will try to compile SF_RayHitGroup shaders
#rb Dmitriy.Dyomin, Carl.Lloyd
#jira UE-160278
#preflight 63208193e93a80888c3ea4d9

[CL 21988506 by florin pascu in ue5-main branch]
2022-09-13 14:22:19 -04:00
Yuriy ODonnell
e741d25317 Add CVar r.RayTracing.RequireSM6 (default=0) to explicitly control when ray tracing shaders/features should be available, instead of relying on project target platform shader model settings. This is required because target platform settings are not available when running a packaged game.
The engine uses GRayTracingPlaformMask to compute ShouldCompilePermutation() for shaders. This is filled based on platform settings and capabilities when running the editor. When running a standalone game, the mask is filled purely based on whether ray tracing is enabled for the project (r.RayTracing) and the current runtime environment supports it (GRHISupportsRayTracing).

The new CVar is meant to be consistent between the cook time and run time. This is achieved by setting GRHISupportsRayTracing=false when running on SM5 if r.RayTracing.RequireSM6 is 1.

#rb christopher.waters
#preflight 631f8c8680642a7fa783ca18
#jira UE-163012

[CL 21971785 by Yuriy ODonnell in ue5-main branch]
2022-09-12 16:27:08 -04:00
zach bethel
b1b031829f Fix for ensure when using RDG clobber resources.
#jira UE-156315
#preflight trivial

[CL 21924352 by zach bethel in ue5-main branch]
2022-09-09 13:51:29 -04:00
zach bethel
eafe4a5868 Fixed GetMipIndex typo in FRenderTargetBindings.
#9134
#jira UE-150538
#preflight trivial

[CL 21924179 by zach bethel in ue5-main branch]
2022-09-09 13:38:15 -04:00
yuriy odonnell
4638f20a35 Add r.RayTracing.EnableInEditor and r.RayTracing.EnableInGame CVars to control whether ray tracing effects should be enabled by default in the editor and in game (if corresponding game user setting does not exist). Both default to enabled, preserving previous behavior.
#rb Juan.Canada

#preflight skip

[CL 21908522 by yuriy odonnell in ue5-main branch]
2022-09-08 20:21:04 -04:00
kenzo terelst
5cffab66a5 PSO Precache Base Changes (disabled by default)
Add PSOPrecache file which wraps engine level PSO structs and functions
- FPSOPrecacheParams used to wrap certain parameters which drive the PSO collection (mostly set from components)
- IPSOCollector interface used as engine entry to the mesh pass processors in renderer project
- FPSOCollectorCreateManager to wrap all statically registered IPSOCollector CreateFuncions
- PSOCollectorStats structs and helper functions

Add PSOPrecache support to PipelineStateCache:
- functions to precache compute and graphics PSOs
- functions to check current precache state
- FPrecacheGraphicsPipelineCache which wraps all currently precached PSOs

IMaterial entry function to PrecachePSOs with given vertex factories and params (implemented by UMaterial & UMaterialInstance) which forwards call to FMaterial and finally the FMaterialShaderMap
- FMaterialShaderMap will iterate all registered IPSOCollector to collect all possible PSOs used and forward them to the PipelineStateCache for actual (async) precaching

RHI Changes:
- Add RHI specific functions to retrieve & compare the FRHIVertexDeclaration and FGraphicsPipelineStateInitializer hash for each RHI
- Add helper functions to match RHI*State data by retrieving initializer

Minimal vertex factory changes for PSO precaching as prep - actual changes in upcoming CLs

MeshPassProcessor base functions to collect PSOs which can be used by all mesh pass processor implemention (actual changes in upcoming CLs)
- Cache complete precache data hash of stored minimal PSO so it can be used for fast actual PSO initializer hash computation (full PSO initializer is build at runtime)
- Cache if minimal PSO was successfully precache and option to skip draw when PSO is still precaching (disabled by default and doesn't work yet via GPU scene based rendering)
- Add helper functions to setup the per mesh pass render target data used during PSO collection

Refactor SceneTextureConfig so it can be initialized from an init struct and move all function to setup the internal members from SceneTexture to SceneTextureConfig using the data from the init struct (so it's available in Engine project)

Fix GBufferInfo format for velocity target (was always floating point while it should be unorm when not android

Make certain helper functions definitions to h file so they can be used everywhere (SupportsNaniteRendering, FTextureRenderTarget2DResource::GetFormat & CreateFlags)

#preflight 63189a5a967ffc68fb9044a5
#jira UE-139584
#rb Mihnea.Balta

[CL 21907508 by kenzo terelst in ue5-main branch]
2022-09-08 19:34:08 -04:00
Zak Middleton
ac2cb421f4 #ue5 - Fix type truncation warnings in misc Engine files.
#jira UE-160823
#rb Andrew.Davidson
#preflight 630e8c6fe54ec9d58193596f

[CL 21897606 by Zak Middleton in ue5-main branch]
2022-09-08 13:39:02 -04:00
benjamin rouveyrol
2f143d41de Change check ==0 to an ensure < 1e-6 to not block anyone for some FP imprecision
#jira none
#rb eric.renaudhoude
#preflight 6319eddba60c539c988a7b3d

[CL 21893384 by benjamin rouveyrol in ue5-main branch]
2022-09-08 09:47:18 -04:00
benjamin rouveyrol
0645b83a3d HDR composition improvements:
* De-hardcode UI luminance, now driven by r.HDR.UI.Luminance
* Expose hard-coded ACES tonemapper parameters:
  - r.HDR.Display.MinLuminanceLog10 (-4.0) defines the luminance for the darkest point in the scene, and will also compute its ACES value (through lookup_ACESmin). The same is happening with the existing CVar r.HDR.Display.MaxLuminance, through lookup_ACESmax
  - r.HDR.Display.MidLuminance (15.0) defines the luminance for 18% gray. It works by offseting the dakest and brightest points in the scene
  - r.HDR.Aces.SceneColorMultiplier (1.5) . This acts like a gain to ensure consistency between ACES (for HDR) and UE (for SDR) tonemappers.

From my tests,  r.HDR.Aces.SceneColorMultiplier and r.HDR.Display.MidLuminance are a bit redundant, but the former acts as a gain on the input color, whereas the latter changes the anchor points for the tonemapper. Since they don't have a linear relationship, it felt useful to keep them both.

some examples:

Default Values (used in initial implementation of ACES 1.3)
r.HDR.Display.MinLuminanceLog10 = -4
r.HDR.Display.MidLuminance = 15
r.HDR.Aces.SceneColorMultiplier = 1.5

ACES 1.3 reference values (match reference images for r.HDR.Display.MaxLuminance=1000, 2000, 4000)
r.HDR.Display.MinLuminanceLog10 = -4
r.HDR.Display.MidLuminance = 15
r.HDR.Aces.SceneColorMultiplier = 1.0

ACES 1.3 with better fit to UE SDR tonemapper (scaled to 300 nits)
r.HDR.Display.MinLuminanceLog10 = -4
r.HDR.Display.MidLuminance = 54
r.HDR.Aces.SceneColorMultiplier = 1.0

#review eric.renaudhoude
#jira UE-162970
#preflight 6319a664a60c539c987c1e45

[CL 21890495 by benjamin rouveyrol in ue5-main branch]
2022-09-08 06:28:38 -04:00