- 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]
This option has the following knock-on effects of other rendering systems to prevent potential bugs or artifacts:
* For non-Nanite meshes, enabling this option will force instances of draw commands with this material applied to always invalidate VSM page cache when instance culling for VSM shadows.
* For Nanite meshes, enabling this option will force all clusters of all instances to pad cluster culling bounds and invalidate cached VSM pages, even if clusters don't have this material applied to it, as it would be prohibitively expensive to determine if no materials on the cluster would force invalidation.
#rb ola.olsson, massimo.tristano
[CL 26456226 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]
- Some refactoring of LocalVertexFactory shader code to accommodate new spline mesh changes as well as to clean it up a little.
- Split primitive flags in the GPU Scene primitive data relating to visibility out into its own to facilitate adding another flag that wouldn't fit into a single DWORD.
#rb ola.olsson
[CL 25853575 by jamie hayes in ue5-main branch]
This is fixed by switching to use GFrameCounter which is incremented once per engine tick, so multi views of the same frame share the same value.
#jira IRON-653
#rb jason.hoerner
#preflight 646d05611b241f0748b2cb14
[CL 25617857 by Josie Yang in ue5-main branch]
- Add instance draw distance and global clip plane culling to GPU instance culling and VSM culling shaders to prevent VS invocations for invisible instances.
- Additional clean-up to GPU Scene data and culling code.
#rb ola.olsson
#preflight 640a5bf67e654e2e6543a98c
[CL 24584209 by jamie hayes in ue5-main branch]
Original CL Desc
-----------------------------------------------------------------
- Implement "WPO Disable Distance" for non-Nanite static meshes, and unify `FMaterialVertexParameters.bEvaluateWorldPositionOffset` for all vertex factories
- Add instance draw distance and global clip plane culling to GPU instance culling and VSM culling shaders to prevent VS invocations for invisible instances.
- Additional clean-up to GPU Scene data and culling code.
#rb ola.olsson
#preflight 6407c662ba12ba6416b8245b
[CL 24581209 by jamie hayes in ue5-main branch]
- Add instance draw distance and global clip plane culling to GPU instance culling and VSM culling shaders to prevent VS invocations for invisible instances.
- Additional clean-up to GPU Scene data and culling code.
#rb ola.olsson
#preflight 6407c662ba12ba6416b8245b
[CL 24579289 by jamie hayes in ue5-main branch]
This allows spline meshes to work in path tracing notably, as well as RT shadows and other raytraced effects. A new cvar "r.RayTracing.Geometry.SplineMeshes" can be used to quickly enable or disable support.
#rb Aleksander.Netzel
#jira UE-116051
#jira UE-151103
#preflight 63cc5d1ad83c1837b1b0523e
[CL 23949217 by chris kulla in ue5-main branch]
This allows us to create the loose uniform buffer when we update the vertex factory instead of during the mesh batch creation.
#preflight 63a2421735203bc7aa89bd31
[CL 23552584 by Jeremy Moore in ue5-main branch]
This allows multiple deformers to write to different parts of the same final vertex buffer.
Simplify the passthrough vertex factory, and the logic around uniform buffer updates.
#preflight 63a09252012902cb8d22c1b7
[CL 23548650 by Jeremy Moore in ue5-main branch]
Fixes ensure failure in MessPassProcessor.cpp in debug_editor build, due to PreviousPositionBuffer being a loose SRV parameter.
#jira UE-165128
#rb Massimo.Tristano
#preflight 634408ea360ee7edeafdd5d7
#lockdown juan.canada
[CL 22431615 by josie yang in ue5-main branch]
The logic for fetching RandomID from instances was only active when instancing was setup for the vertex factory, which is not the case for raytracing (which handles instancing natively). I followed the pattern used for per instance custom data which was already supported. Since the per instance random value is constant per primitive, I simplified the logic and moved it out of the interpolated quantity PerInstanceParams (which is now a float3 instead of a float4).
Tweaked the logic that enables the RandomID field to only populate it when either PerInstanceRandom or dither fade is enabled (which are the only two cases that use it currently).
#jira UE-163215
#rb Yuriy.ODonnell,Graham.Wihlidal
#preflight 63223eb58838676d105e2d92
[CL 22016969 by chris kulla 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]
CitySample PC cook stats (recompile all shaders in both runs):
Baseline: 75229 shaders compiled, Cook time 1h35m46s
WithChange: 69228 shaders compiled, Cook time 1h29m10s
Shader reduction 8%, Cook time reduction 6mins
#jira UE-157662
#rb jason.nadro, jeremy.moore, dmitriy.dyomin
#preflight 631f0e5298092524abfb6044
[CL 21971450 by josie yang in ue5-main branch]