Prevent stack overflow from material editor setting color from details view that doesn't own current color picker.
#jira UE-120042
#rb none
#ROBOMERGE-AUTHOR: ben.ingram
#ROBOMERGE-SOURCE: CL 18238668 via CL 18239212 via CL 18239370 via CL 18240762 via CL 18240831
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)
[CL 18242931 by ben ingram 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]
[FYI] Ben.Ingram
#jira UE-132661
Original CL Desc
-----------------------------------------------------------------
Generate cached data for MID created at runtime in non-editor builds
Make sure material instance resources are updated from cached data loaded in non-editor builds
#jira UE-131802
#rb none
#ROBOMERGE-OWNER: aurel.cordonnier
#ROBOMERGE-AUTHOR: kevin.ortegren
#ROBOMERGE-COMMAND: _robomerge UE5-Release-Engine-Test
#ROBOMERGE-SOURCE: CL 17921250 in //UE5/Release-5.0/... via CL 17922774
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v885-17909292)
[CL 17930569 by kevin ortegren 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]
- The profile combo is only visible when the user has more than one profile
- This was added to the Material Editor, the Static Mesh Editor and Niagara Editor.
#jira UETOOL-2775 Add preview scene background profile dropdown to asset editor vieport toolbar.
#rb Lauren.Barnes, Brooke.Hubert
#preflight 6130c00617a8610001b8ba61
#ROBOMERGE-SOURCE: CL 17402767 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v865-17346139)
[CL 17402787 by patrick laflamme in ue5-release-engine-test branch]
Primary goal is to reduce amount of code duplicated across different parameter types, and reduce amount of boilerplate required to add new parameters
The main part are new types FMaterialParameterValue, and FMaterialParameterMetadata (both in MaterialTypes.h). FMaterialParameterValue is a tagged union/variant type, that can represent any material parameter value. FMaterialParameterMetadata contains a value, along with various editor-only fields that describe how that value is used.
Using this new type, many places that previously included separate APIs for each parameter type collapse to a single API that operates on a FMaterialParameterValue/FMaterialParameterMetadata. Code that previously had a block copy/pasted for each parameter type can be replaced with a loop that iterates over all parameter types.
Also includes some API cleanup that should improve (editor) performance. Previously we had APIs GetAllScalarParameters, GetAllVectorParameters, etc, which would return a list of FMaterialParameterInfos for each parameter of the given type. Code would often query all parameters, then loop over the results and lookup each parameter value. Now there's a new API, GetAllParametersOfType, which returns a list of all FMaterialParameterMetadata of a given type. It's easy to just collect the values at the time we're building the list of parameters, so this saves the work of looking up each value individually.
#jira none
#rb lauren.barnes
[FYI] zousar.shaker
#ROBOMERGE-SOURCE: CL 17360722 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v865-17346139)
[CL 17360730 by ben ingram in ue5-release-engine-test branch]
This is fine, because materials will refresh the stateID of any dependent MF when loaded, and use updated stateIDs to form the ShaderMapID
#rb arciel.rekman, jason.nadro
#preflight 6125576daf9a8f0001510587
#ROBOMERGE-SOURCE: CL 17294061 via CL 17294075
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v861-17282326)
[CL 17294091 by ben ingram in ue5-release-engine-test branch]
- Let the game thread remove its reference before the deferred deletion so we don't trigger a non-zero ref count check in ~FMaterial.
#rb Ben.Ingram
#preflight 610071545938f90001e90c85
#ROBOMERGE-SOURCE: CL 16975782 via CL 16975842
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v838-16927207)
[CL 16975864 by jason nadro in ue5-release-engine-test branch]