1. Nanite meshes are not longer marked as always visible, and will go through the standard rendering culling / pipeline.
2. Add coarse frustum culling using the already existing scene octree.
3. Remove Distance visibility bit array, and converted only usage to using the visibiliity map. (Spoke with Kenzo about this, the original was put in due to differences between distance a vis flags, but this has been fixed)
4. Optimized Frustum culling methods across the board.
[at]Graham.Wihlidal [at]krzysztof.narkowicz [at]andrew.firth
#preflight 6137e0d1d9c85a00015375cb
#ROBOMERGE-OWNER: jon.nabozny
#ROBOMERGE-AUTHOR: brandon.dawson
#ROBOMERGE-SOURCE: CL 17459502 via CL 17911378 via CL 18360795 via CL 18361127
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)
[CL 18361363 by jon nabozny in ue5-release-engine-test branch]
#ROBOMERGE-AUTHOR: charles.lefebvre
#ROBOMERGE-SOURCE: CL 18325391 via CL 18325414 via CL 18326090 via CL 18326102
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)
[CL 18326112 by charles lefebvre in ue5-release-engine-test branch]
#tests Tested in PIE, preflight on all platforms
[REVIEW] Steve.Robb
#ROBOMERGE-OWNER: charles.lefebvre
#ROBOMERGE-AUTHOR: charles.lefebvre
#ROBOMERGE-SOURCE: CL 18324864 via CL 18325124 via CL 18325149 via CL 18325803 via CL 18325815
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)
[CL 18325823 by charles lefebvre in ue5-release-engine-test branch]
- Re-enable the ISPC bounds calculation that seems now roughly about 3 times faster.
- LWC code compatibility update.
Originally from Jeff.Rous shelf 17168225.
#rb Cedric.Caillaud
#jira none
#preflight 61a0fe6b405273b2c3aeeeaf
#ROBOMERGE-AUTHOR: kriss.gossart
#ROBOMERGE-SOURCE: CL 18307569 in //UE5/Release-5.0/... via CL 18307574
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)
[CL 18307581 by kriss gossart in ue5-release-engine-test branch]
This represents UE4/Main @18073326, Release-5.0 @18081140 and Dev-PerfTest @18045971
[CL 18081471 by aurel cordonnier in ue5-release-engine-test branch]
This represents UE4/Main @17911760, Release-5.0 @17915875 and Dev-PerfTest @17914035
[CL 17918595 by aurel cordonnier in ue5-release-engine-test branch]
This represents UE4/Main @17774255, Release-5.0 @17791557 and Dev-PerfTest @17789485
[CL 17794212 by aurel cordonnier in ue5-release-engine-test branch]
Basic approach is to add HLSL types FLWCScalar, FLWCMatrix, FLWCVector, etc. Inside shaders, absolute world space position values should be represented as FLWCVector3. Matrices that transform *into* absolute world space become FLWCMatrix. Matrices that transform *from* world space become FLWCInverseMatrix. Generally LWC values work by extending the regular 'float' value with an additional tile coordinate. Final tile size will be a trade-off between scale/accuracy; I'm using 256k for now, but may need to be adjusted. Value represented by a FLWCVector thus becomes V.Tile * TileSize + V.Offset. Most operations can be performed directly on LWC values. There are HLSL functions like LWCAdd, LWCSub, LWCMultiply, LWCDivide (operator overloading would be really nice here). The goal is to stay with LWC values for as long as needed, then convert to regular float values when possible. One thing that comes up a lot is working in translated (rather than absolute) world space. WorldSpace + View.PrevPreViewTranslation = TranslatedWorldspace. Except 'View.PrevPreViewTranslation' is now a FLWCVector3, and WorldSpace quantities should be as well. So that becomes LWCAdd(WorldSpace, View.PrevPreViewTranslation) = TranslatedWorldspace. Assuming that we're talking about a position that's "reasonably close" to the camera, it should be safe to convert the translated WS value to float. The 'tile' coordinate of the 2 LWC values should cancel out when added together in this case. I've done some work throughout the shader code to do this. Materials are fully supporting LWC-values as well. Projective texturing and vertex animation materials that I've tested work correctly even when positioned "far away" from the origin.
Lots of work remains to fully convert all of our shader code. There's a function LWCHackToFloat(), which is a simple wrapper for LWCToFloat(). The idea of HackToFloat is to mark places that need further attention, where I'm simply converting absolute WS positions to float, to get shaders to compile. Shaders converted in this way should continue to work for all existing content (without LWC-scale values), but they will break if positions get too large.
General overview of changed files:
LargeWorldCoordinates.ush - This defines the FLWC types and operations
GPUScene.cpp, SceneData.ush - Primitives add an extra 'float3' tile coordinate. Instance data is unchanged, so instances need to stay within single-precision range of the primitive origin. Could potentially split instances behind the scenes (I think) if we don't want this limitation
HLSLMaterialDerivativeAutogen.cpp, HLSLMaterialTranslator.cpp, Preshader.cpp - Translated materials to use LWC values
SceneView.cpp, SceneRelativeViewMatrices.cpp, ShaderCompiler.cpp, InstancedStereo.ush - View uniform buffer includes LWC values where appropriate
#jira UE-117101
#rb arne.schober, Michael.Galetzka
#ROBOMERGE-AUTHOR: ben.ingram
#ROBOMERGE-SOURCE: CL 17787435 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v881-17767770)
[CL 17787478 by ben ingram in ue5-release-engine-test branch]
#rnx
#ushell-cherrypick of 17705096 by Johan.Torp
#ushell-cherrypick of 17705452 by johan.torp
#ushell-cherrypick of 17734208 by Johan.Torp
#preflight 615d99819a6de5000130a3e5
#ROBOMERGE-AUTHOR: johan.torp
#ROBOMERGE-SOURCE: CL 17734960 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v879-17706426)
[CL 17735011 by johan torp in ue5-release-engine-test branch]
Next step would bechanging signature of int32 FMath::FloorToInt(double) to return int64 and remove FloorToInt64 but this means hunting down conversion loss errors across projects.
#rb andy.davidson
#preflight 612e6b2675bca20001d5fbf3
#ROBOMERGE-SOURCE: CL 17385257 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v865-17346139)
[CL 17385276 by patrick enfedaque in ue5-release-engine-test branch]
- Added FMatrix4d validation tests to UnrealMathTest.cpp startup tests.
- Avoided MSVC compiler issue with AVX casts, and switched AVX2 swizzles to more exclusive use of permute2f128.
- Shrinked some code blocks in the VectorMatrixMultiply() function which can fix compiler bugs in some cases for register re-use (it did in CL 16042174 for example).
- Re-enabled AVX1 and AVX2 as this is confirmed to fix the regression on console.
#jira UE-123735
#rb David.Harvey
#ROBOMERGE-SOURCE: CL 17325245 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v861-17282326)
[CL 17325266 by zak middleton in ue5-release-engine-test branch]