This fixes issues with mobile GPU scene culling, which needs to access a valid primitive ID from forcibly culled instances' data.
#rb ola.olsson
[CL 27947310 by jamie hayes in ue5-main branch]
- 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]
- 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]
* This should be used to guard any features that require explicitly accessing buffer or textures SRVs in vertex shaders
#rb Dmitriy.Dyomin
#rb Kenzo.Terelst
[CL 26207274 by yuriy odonnell 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]
- Clamps the gpu-scene instance buffer size to the max supported instance ID (MAX_INSTANCE_ID, 16M at present)
- Overflowing ID's will just result in OOB buffer accesses on the GPU which is tolerated and rendering will be undefined.
- Added logging + on-screen message to surface the issue.
#jira UE-182255
#rb jamie.hayes
#preflight 646f7adf50786bb5ba8067b1
[CL 25622221 by Ola Olsson in ue5-main branch]
- Move primitive data stride to SceneDefinitions header so we don't have to change it in 3 places in code.
- Move FPrimitiveSceneShaderData to its own header to (eventually) eliminate dependencies that adversely affect compile time.
- Deprecate scatter upload buffer support for texture targets and prepare to clean up hacks that were previously done for the sake of GPU Scene that are no longer needed.
#rb ola.olsson
#preflight 644fe4750e33f2d51d787e71
[CL 25285293 by jamie hayes in ue5-main branch]
- Also moved FPrimitiveUniformShaderParametersBuilder to its own header to cut down rebuilding when changing scene & nanite definitions.
#rb jamie.hayes
#preflight 644919d41c2846595cfdbf28
[CL 25199110 by Ola Olsson 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]
* Primitives are only tracked by Lumen scene if they can be traced by the current ray tracing method. E.g. if we use HWRT then only primitives with valid BLAS will generate surface cache.
* Instead of recomputing VisibleInLumenScene on every add/remove/update this flag is now cached on proxy
* Added GPU side filtering of draws which should be skipped when capturing surface cache
#preflight 63dd8637323e7eaa30b71680
#jira UE-176073
#rb Daniel.Wright
[CL 24031439 by krzysztof narkowicz in ue5-main branch]