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