- Add system for spline meshes to cache their slice transforms into look-up textures to optimize spline evaluations in shaders.
- Optimize the Nanite cluster culling shader with spline mesh deformation enabled to limit the cost of this shader added to all Nanite culling.
- More tightly pack the spline mesh parameters into 7 float4s from 8 and rearrange them to optimize shader access.
- Add "Nanite Cluster Bounds Scale" to spline mesh parameters as a means of fixing rare artifacts caused by inaccurate cluster culling bounds.
- A few other various tweaks and fixes to Nanite spline meshes.
- With these improvements, r.Nanite.AllowSplineMeshes is now on by default
NOTE: This is a re-submission of a change that had been previously rolled back. It is now being resubmitted with fixes to the following issues:
- Gaps in spline meshes due to calculating endpoint tangents using finite differencing of the texture.
- Fixed an issue where spline mesh deformation was broken in RVT rendering.
- Fix to an assert that would trip in some commandlets that were using the scene uniform buffer without having first initialized FSystemTextures
- Handle extrapolation of spline sampling from manually specifying mesh extents that are smaller than the actual mesh boundaries.
#rb brian.karis
#jira UE-181795
[CL 27697936 by jamie hayes in ue5-main branch]
TSR's anti-flickering heuristic (r.TSR.ShadingRejection.Flickering=1) analyses how opaque pixels changes overtime and whenever the period of changes get lower than r.TSR.ShadingRejection.Flickering.Period, the heuristic tries to stabilise the pixel by relaxing the rejections.
The problems this creates is that any fast moving texture paning and other pixel animation made in material might looks identically flickering to TSR, because not knowing the motion of the pixels animations. TSR currently not having optical flow yet, the artists needs a way to say that the velocity buffer containing the geometric velocities used for reprojection actually exclude pixel animations.
This changes implements UMaterial::bHasPixelAnimation the artists can define on opaque geometry. It end up encoded forcing the primitive to draws velocity so that bit can be encoded in velocity buffer when VELOCITY_ENCODE_DEPTH==1 because there is no room left in stencil or gbuffer, and this has the advantage to works for both forward and deferred shading renderer.
This gets passdown to shaders through in the primitive uniform parameters so that nanite global shaders FEmitSceneDepthPS and FDepthExportCS can encode it when writing out velocity. It also allows to not need to compile additional material shader permutation of FVelocityPS for non masked opaque geometry. But this causes the limitation currently that any primitive that have at least one shader with this setting enabled will force the entire primitive's material slots to draw this bit in the velocity.
TSR in turn disables it's r.TSR.ShadingRejection.Flickering=1 heuristic on any pixel that have it sets using DecodeHasPixelAnimationFromVelocityTexture().
The flag can be visualized by artists with the VisualizeTemporalUpscaler show flag.
#rb jeremy.moore
#jira UE-187459
[CL 27385162 by guillaume abadie in ue5-main branch]
- Add system for spline meshes to cache their spline positions into a look-up texture to optimize spline evaluations in shaders.
- Optimize the Nanite cluster culling shader with spline mesh deformation enabled to limit the cost of this shader added to all Nanite culling.
- More tightly pack the spline mesh parameters into 7 float4s from 8 and rearrange them to optimize shader access.
- Add "Nanite Cluster Bounds Scale" to spline mesh parameters as a means of fixing rare artifacts caused by inaccurate cluster culling bounds.
- A few other various tweaks and fixes to Nanite spline meshes.
- With these improvements, r.Nanite.AllowSplineMeshes is now on by default
#rb brian.karis
[FYI] rune.stubbe, graham.wihlidal
#jira UE-181795
[CL 27187995 by jamie hayes in ue5-main branch]
Platforms that do support uniform buffer objects can now provide batched primitive data through UBO. There is a limit UBO range that can be accessed in shaders, so we group instances into batches that fit into this limit. Switch uses 64KB views, other platfroms16KB views. For each primitive we allocate 512Bytes and 256Bytes for instance. Mobile platforms that do not support UBO will use a desktop version of GPUScene.
There are a few things that still missing: Dynamic mesh passes, static lighting
#rb ola.olsson, benjamin.rouveyrol
[CL 26354848 by marc audy in ue5-main branch]
ShaderVersion bumped since View data has been changed.
#rb none
#jira none
#fyi charles.derousiers
[CL 26046671 by Sebastien Hillaire in ue5-main branch]
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 26018371 by serge bernier in ue5-main branch]
Modify RenderLocalLightPrepass from fullscreenpass to instance draw of screen tiles
Restrict MobileLocalLightPrepass texture allocation only when LocalLight Prepass is enabled
#rb Dmitriy.Dyomin, Benjamin.Rouveyrol
[CL 25947848 by florin pascu in ue5-main branch]
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]
Moving Editor only DDSPI types into the cpp files to keep Editor includes out of the global scope.
#rb florin.pascu
[CL 25815319 by christopher waters in ue5-main branch]
- glint can be enabled/disabled per platofm still.
- Glints are enabled by default now.
- Simplified the complexspecial path defines to only have one.
#rb none
#preflight none
#fyi charles.derousiers
[CL 25600737 by Sebastien Hillaire in ue5-main branch]
Runtime pixel formats are named PF_ASTC_<blocksize>_NORM_RG. Use texture format name ASTC_NormalRG_Precise for encoding.
[CL 25563983 by ben woodhouse in ue5-main branch]
Disable mask clip in PS if full depth prepass enabled.
Remove r.Mobile.EarlyZPassOnlyMaterialMasking and use r.Mobile.EarlyZPass=2 instead
#jira none
#rb Dmitriy.Dyomin, Florin.Pascu
#preflight 643f8092bf1053846691e5b4
[CL 25101153 by Wei Liu in ue5-main branch]