* Refactored ExportToRawMesh function to allow exporting one mesh section per component
* Implemented support for UV mappings usually provided by the landscape vertex factory in the non-Nanite case (as per the LandscapeLayerCoords material expression + others)
* For Nanite landscape materials, the relevant UV channels are :
** Texcoords0-2 : TerrainCoordMapping_XY, TerrainCoordMapping_XZ, TerrainCoordMapping_YZ (note : TerrainCoordMapping_XZ doesn't work ATM because texcoords1 seems to be a special case...)
** Texcoords3 : WeightmapUV
** Texcoords4 : LightmapUV (not implemented by ExportToRawMesh yet and not supported by Nanite meshes ATM : max 4 UV channels)
** Texcoords5 : HeightmapUV (implemented by ExportToRawMesh but not supported by Nanite meshes ATM : max 4 UV channels)
* Nanite landscape meshes now have 1 polygroup per component, with the proper landscape material instance being assigned to it
* Since Nanite meshes are capped at 64 meshes per section, Nanite landscape mesh will now fail to build on proxies sporting more than this amount of components. This is a first implementation and can be fixed later by adding as many Nanite landscape components as needed
* Implemented some missing virtual overrides on FLandscapeMaterialResource leading to landscape material instances potentially being used for non-landscape usages (hair, etc.)
* Fixed LandscapeNaniteComponent not being attached to the root component (and the mesh being exported in world space coordinates), leading to it not following when moving the actor
* Added NaniteLODIndex property in ALandscape to be able to tweak the LOD level used when generating the Nanite meshes. It's mostly a debug feature to test the LODLevel > 0 landscape mesh export and to accelerate the Nanite landscape mesh generation since you usually want Nanite to be the most defined mesh possible
* All Nanite landscape meshes will be auto-invalidated by this change
#rb roey.borsteinas, graham.wihlidal
#preflight 6365e2a2882365b8590525ac
#lockdown marc.audy
[CL 23069843 by jonathan bard in ue5-main branch]
struct Foo : public TSharedFromThis<Foo>
{
// ...
};
struct Bar : public Foo
{
// ...
void Execute()
{
FControlFlow& ControlFlow = ...;
ControlFlow.QueueStep(this, &Bar::DoStep);
}
void DoStep()
{
}
};
The QueueStep deduction would fail as it expects the type to be directly derived as TSharedFromThis<Bar> rather than indirectly via TSharedFromThis<Foo>
#preflight 636a7040dc30a4ce96a157a7
[FYI] Geoffrey.Wong
#rb Steve.Robb
#rnx
[CL 23039132 by jamie dale in ue5-main branch]
- LargePageAllocator does all its preallocation handling in its Refresh method (invoked via delegate) thanks to cvars. If preallocated pools are larger than the new requested size, the pool is shrinked (and physical memory freed), if it is smaller then the pool is grown (and more memory will be preallocated)
- First preallocation is done at PreInit once all the INI files have been read on platforms that use very large page allocator
- If a OOM happens, the preallocation code is then be disabled until the title is restarted
- With this system, pools can be tweaked per device profile
- Preallocated pools are tagged as FMalloc in LLM
[REVIEW] [at]john.huelin, [at]robert.millar
[CL 23039063 by mickael gilabert in ue5-main branch]
Takeaways. Try to use "friend" on functions/operators that are frequently overloaded EXCEPT if they are in a templated type that is frequently instantiated. So do not put friends in TMap, TSet, TObjectPtr etc, this will slow down compile times. There is a break-even somewhere and hard to tell where it is but taking a class that is templatized on character type probably don't matter either way and then it is nicer to use a friend since that simplies error messages when compiler can't resolve functions/operators.
If it is possible to use member functions instead of friend that is the best option in terms of compile time performance. With c++20 you only have to write operator==(Foo, Bar) and the compiler will automatically provide operator==(Bar, Foo), operator!=(Foo, Bar) and operator!=(Bar, Foo).
Changes in this changelist involes
* Making operator<< friends in non-template types and not friends in template types
* Making operator==/!= members where possible and if not possible moved out if type is a frequently instantiated templated type.
#preflight 636970f5376a9cd6a80da54a
#rb steve.robb
[CL 23038965 by henrik karlsson in ue5-main branch]
bGreyScaleFormat is only used by debug/editor shaders, game runtime uses SamplerType from MaterialExpressions
bGreyScaleFormat bool is needed because FTexture does not have access to CompressionSettings
behavior is observably different with Grayscale G16 and cases like TC_Alpha non-multiple-of-4
#preflight 636968d6d0174259ccea87f5
#rb dan.thompson
[CL 23023252 by charles bloom in ue5-main branch]