- 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]
Broken for a long while and different visualizations available now.
#rb ola.olsson
#jira UE-184606
[CL 27578246 by andrew lauritzen in ue5-main branch]
- Legacy shading model node can now be used as a regular node.
- We can have multiple legacy shading model node in a isngle material now.
- There is now a ShadinModel drop down on the node that is used when the ShadingModel input is not plugged in
- Material instance shading model override is now accounted for by the legacy shading model node. Overriden from the HLSLTranslator when detected.
The data flow now for legacy mateiral conversion is as such:
--- Conversion time - UMaterial::ConvertMaterialToStrataMaterial()
Shading model => legacy node setup (shading model from expression: relink input, otherwise: set shading model on the conversion node)
--- GatherStrataMaterialInfo
Send back what is the shadingmodel used (or if it is "from expression")
--- UMaterial::RebuildShadingModelField()
Set material Domain, ShadingModel and ShadingModels according ot the returned value (FromExpression, etc.) from GatherStrataMaterialInfo.
Those values are not authorable but do enable shading models via defines from the HLSLTranslator. Seeing them being correct also helps to understand and debug.
--- Material instance shading model override
Overriden from the HLSLTranslator when detected.
#rb charles.derousiers
[CL 27504675 by sebastien hillaire in ue5-main branch]
Fixed NANITE_SANITY_CHECK_STREAMING_REQUESTS path so it compiles again and reduced size of Magic to make room for wider page indices.
Changed independent coding of PageIndex and ClusterIndex in FVisibleCluster to a smaller combined encoding.
Added more descriptive error messages when running out of pool space.
#rb graham.wihlidal
[FYI] brian.karis, jamie.hayes
[CL 27504613 by rune stubbe 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]
-Delta code vertex attributes and cluster refs
-ZigZag code deltas
-Store them as whole bytes
-Split high/mid/low bytes into separate streams
Transcode
-Transcode is now split into an independent pass and a number of dependent passes
-Launch a group per cluster instead of launching a group per potential cluster in a page and have them early out
Got rid of unused vertex color mode: NANITE_VERTEX_COLOR_MODE_WHITE
#rb brian.karis
[FYI] graham.wihlidal, jamie.hayes
#jira
[CL 27132972 by marc audy in ue5-main branch]
Previously, geometry was only rendered to static maps, resulting in missing shadows when no static map was present.
#jira UE-190827
#rb andrew.lauritzen
#rb ola.olsson
[CL 26824413 by wouter dek in ue5-main branch]
Clusters already have a max range for position. An additional exponent bit has been added to the position encoding to cover that range.
Added sanity check to make sure the largest possible cluster bound can always be encoded with the current position encoding parameters.
#rb jamie.hayes
[FYI] brian.karis, graham.wihlidal
[CL 26630917 by rune stubbe in ue5-main branch]
Disk pages sizes can now have arbitrary sizes, but are assumed to rarely be more than ~1.5x when reserving memory or sizing the upload staging buffer.
#rb ola.olsson
[FYI] brian.karis, graham.wihlidal, jamie.hayes
[CL 26534981 by rune stubbe in ue5-main branch]
* Add FPrimitiveSceneProxy::AllowInstanceCullingOcclusionQueries() method to allow occlusion queries (disallowed by default)
* Add PRIMITIVE_SCENE_DATA_FLAG_INSTANCE_CULLING_OCCLUSION_QUERIES
* Allow OQ for static meshes only
* Incompatible instances are treated as visible during OQ instance culling pass
* Tweak help text forVisualizeInstanceOcclusionQueries visualize menu entry
Only certain objects may benefit from per-pixel occlusion culling and otherwise HZB-based culling is sufficient.
#rb Jeremy.Moore
[CL 26501221 by yuriy odonnell 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]
Remove multiple cache managesr that were implemented to work around issues with the previous naive implementation
Fixes some invalidation issues in cases where multiple managers existed previously
NOTE: This change brings pages from scene captures and ndisplay and similar systems back into the main physical page pool, so it may be necessary in some of these cases to increase the page pool size.
#rb ola.olsson jason.hoerner
[CL 26352061 by andrew lauritzen in ue5-main branch]