Added some robustness/validation to the GetCompleteBounds call.
#rb jonathan.bard
#preflight 6294c4294c7bcac173ce31bd
[CL 20430596 by julien lheureux in ue5-main branch]
Landscape: added utility function to render the merged heightmap from anywhere in world space. This is done in 2 steps : render the heightmaps of all landscape components overlapping with the requested region into an atlas texture (uncompressed) subsection by subsection, skipping the duplicated rows/columns. Then resample the atlas at the requested location.
If the render target is 8bits/channel, the resulting heightmap will be compressed on the R and G channels. If the target is 16 bits uint, the output will contain the uncompressed height value.
The function supports heightmaps with different minimum mip level and will use the best available mip level. However, currently the intermediate atlas render target is always allocated using the landscape's full resolution.
This is meant to be compatible with runtime but is not at the moment, because it relies on ULandscapeInfo members which are not editor-only but are not available at runtime (yet). This will be fixed later on.
#rb semion.piskarev
#preflight 629007c98c23e52ef0097189
#ROBOMERGE-AUTHOR: semion.piskarev
#ROBOMERGE-SOURCE: CL 20389454 via CL 20389469 via CL 20389478
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v949-20362246)
[CL 20390053 by semion piskarev in ue5-main branch]
- Allow changing bIsSpatiallyLoaded flag on ALandscapeStreamingProxy and ALandscapeSplineActor
- New flag in ALandscape used to set the bIsSpatiallyloaded flags on newly created AlandscapeStreamingProxy and ALandscapeSplineActor (bAreNewLandscapeActorsSpatiallyLoaded)
#rb richard.malo, jeanfrancois.dube
#preflight 628d1404b378b39d419041cf
#ROBOMERGE-AUTHOR: patrick.enfedaque
#ROBOMERGE-SOURCE: CL 20351658 via CL 20351677 via CL 20351695
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v948-20297126)
[CL 20353647 by patrick enfedaque in ue5-main branch]
Also fixed a couple of places where we were not using the FTextureSource's data (even though those calls should be fine since they happen in a place where texture compilation is done)
#rb paul.chipchase
#jira UE-150653
#preflight 62829ff6216d06861f3b7ca9
[CL 20239776 by jonathan bard in ue5-main branch]
* MaxLODLevel == INDEX_NONE means the max available
* Also fixed off-by-one error (Num LOD levels vs Max LOD level)
#jira UE-151563
#preflight 627ab701c42338be6528bc33
[CL 20127983 by Sebastien Lussier in ue5-main branch]
This meant that the test in ALandscapeProxy::PostRegisterAllComponents() to know whether data migration (from non-edit layers to edit layers) should occur, which relies on the cached value bHasLayersContent (which was always false in that case, since there's no landscape component in the ALandscape) and the result of virtual function HasLayersContent() (overridden in ALandscape::HasLayersContent to return true if there's at least one registered landscape edit layer) was always forcing data migration to occur, which would do nothing (no landscape component, hence, no data to migrate) but was still marking the level as dirty
#rb patrick.enfedaque
#preflight 627a67a610766ef8c1f3d590
#ROBOMERGE-AUTHOR: jonathan.bard
#ROBOMERGE-SOURCE: CL 20123696 via CL 20123706 via CL 20123718
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)
[CL 20125767 by jonathan bard in ue5-main branch]
Added a new registry to let the objects provide how their elements should be selected when doing a selection by a volume such as a box or a frustum.
Added a some editor only functions for the marquee selection into the world interface.
#jira UETOOL-4797
#rb Brooke.Hubert
#preflight 624cb2dca64871f1a113bf2a
[CL 19727315 by Julien StJean in ue5-main branch]
Convert landscape mobile cook version to system guid system
#jira
#rnx
#ROBOMERGE-OWNER: marc.audy
#ROBOMERGE-AUTHOR: marc.audy
#ROBOMERGE-SOURCE: CL 19346370 via CL 19352300 via CL 19352991 via CL 19355735
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v926-19321884)
[CL 19357735 by marc audy in ue5-main branch]
Fortnite Client Crash in FStreamingRenderAsset::UpdateStaticData when attempting to start a match on Android.
#preflight 6226e2b6671c913c0502a891
#rb patrick.enfedaque
#ROBOMERGE-AUTHOR: sebastien.lussier
#ROBOMERGE-SOURCE: CL 19302517 in //UE5/Release-5.0/... via CL 19303828
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v926-19321884)
[CL 19346847 by sebastien lussier in ue5-main branch]
Fixes uninitialized member in FLandscapePerLODMaterialOverride
#rb Jonathan.Bard
#jira UE-144566
#preflight 6220c3397e0217a606ee7545
Original CL Desc
* Removed incomplete per-platform per-LOD level material overrides for landscape. The code isn't meant to support that since material instances are built at edit-time. We would need to somewhat hack it at cook time in order to regenerate (and recompile) the list of material instances per-platform, which is not a recommended thing to to in the engine. Instead, we choose to simply make the per-LOD level material overrides constant across platforms since the recommended way is to customize the material for platforms using material expressions such as Quality Level switc, Shading Path Switc or Feature Level Switc.
* Deprecated/merged FLandscapeComponentMaterialOverride and FLandscapeProxyMaterialOverride into FLandscapePerLODMaterialOverride since they were identical
* Fixed UpdateLayersMaterialInstances which, unlike UpdateMaterialInstances, didn't take into account per-component material overrides
[CL 19242882 by luc eygasier in ue5-main branch]
#rb none
#jira UE-144566
#preflight 62200fba943787f1d21ae8ae
#fyi luc.eygasier, Jonathan.Bard
Original CL Desc
-----------------------------------------------------------------
* Removed incomplete per-platform per-LOD level material overrides for landscape. The code isn't meant to support that since material instances are built at edit-time. We would need to somewhat hack it at cook time in order to regenerate (and recompile) the list of material instances per-platform, which is not a recommended thing to to in the engine. Instead, we choose to simply make the per-LOD level material overrides constant across platforms since the recommended way is to customize the material for platforms using material expressions such as Quality Level switc, Shading Path Switc or Feature Level Switc.
* Deprecated/merged FLandscapeComponentMaterialOverride and FLandscapeProxyMaterialOverride into FLandscapePerLODMaterialOverride since they were identical
* Fixed UpdateLayersMaterialInstances which, unlike UpdateMaterialInstances, didn't take into account per-component material overrides
From shelve 17931928 on behalf on Jonathan.Bard
#rb Jonathan.Bard
#jira UE-132031
#preflight 621cd5cd49723678579d9ec1
#ROBOMERGE-OWNER: luc.eygasier
#ROBOMERGE-AUTHOR: luc.eygasier
#ROBOMERGE-SOURCE: CL 19221589 via CL 19223810 via CL 19223838 via CL 19226205
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)
[CL 19235312 by eric mcdaniel in ue5-main branch]
* Deprecated/merged FLandscapeComponentMaterialOverride and FLandscapeProxyMaterialOverride into FLandscapePerLODMaterialOverride since they were identical
* Fixed UpdateLayersMaterialInstances which, unlike UpdateMaterialInstances, didn't take into account per-component material overrides
From shelve 17931928 on behalf on Jonathan.Bard
#rb Jonathan.Bard
#jira UE-132031
#preflight 621cd5cd49723678579d9ec1
#ROBOMERGE-OWNER: luc.eygasier
#ROBOMERGE-AUTHOR: luc.eygasier
#ROBOMERGE-SOURCE: CL 19221589 via CL 19223810 via CL 19223838 via CL 19226205
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)
[CL 19230219 by luc eygasier in ue5-main branch]
* Fixed assert when updating heightmaps of different sizes
* Fixed crash when deleting components : the deleted components were still referenced in the shared weightmap texture usages
Misc:
* Properly delete edit layers heightmaps and weightmaps when deleting landscape components
#rb luc.eygasier
#jira UE-140551
#preflight 62164eea37178b0175ac9cf9
#ROBOMERGE-AUTHOR: jonathan.bard
#ROBOMERGE-SOURCE: CL 19094154 via CL 19100022 via CL 19100646 via CL 19109891
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)
[CL 19147208 by jonathan bard in ue5-main branch]
Cooking a ULandscapeComponent is updating a LandscapeMaterialInstanceConstant and the landscape MIC has already had BeginCacheForCookedPlatformData() called on it.
Here is what's happening:
UMaterialInstance::BeginCacheForCookedPlatformData is called for a Landscape MIC
This MIC's bHasStaticPermutationResource == false so no resources are cooked for the MIC. The MIC's CachedMaterialResourcesForCooking is empty.
ULandscapeComponent::BeginCacheForCookedPlatformData is called on a Landscape component.
The Landscape component changes the MIC to have a static permutation and calls `CombinationMaterialInstance->UpdateStaticPermutation(StaticParameters, InMaterialUpdateContext);`
We then go to Save the MIC, which now has bHasStaticPermutationResource==true, but it doesn't have resources cached for cooking and triggers the assert.
The new code ensures we call `BeginCacheForCookedPlatformData` on any material instances created during landscape generation while cooking.
#rb jason.nadro
#preflight 620fb676be45100d32bccef9
#jira UE-142195
#ROBOMERGE-AUTHOR: jonathan.bard
#ROBOMERGE-SOURCE: CL 19081744 in //UE5/Release-5.0/... via CL 19096958
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)
[CL 19140598 by jonathan bard in ue5-main branch]
WorldPartition - Added Lanscape HLODs
Created a custom HLOD builder for ULandscapeComponent
* Landscape LOD used to generate the HLOD is autocomputed from the expected draw distance, same for the baked texture size
* Expose ALandscapeProxy::GetLODScreenSizeArray()
* Actually reverting changes done in CL 18794652 (moving proxy mesh creation back to ALandscapeProxy)
* ComputeLayerHash() now takes a bool to choose if we want to compute the hash for edition or runtime data
#preflight 620a60a1583261b0a6539c22
#rb Patrick.Enfedaque
#ROBOMERGE-AUTHOR: sebastien.lussier
#ROBOMERGE-SOURCE: CL 18980225 in //UE5/Release-5.0/... via CL 18980661 via CL 18981014
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589)
[CL 18981050 by sebastien lussier in ue5-main branch]
* The new merge algorithm also speeds up the merging process by performing the merge operation in a single shader pass, which avoids intermediate clear/copies, even more so when dealing with several edit layers (O(n) -> O(1))
* Implemented via FRDGBuilder to benefit from transient memory allocation and optimal resource transitions.
* This is activated by a CVar (landscape.EditLayersLocalMerge.Enable, disabled by default) and disabled for landscapes containing BP brushes, since customers (similar to what the WaterBrushManager did) might have made the assumption that the merge is global and we don't want to break the existing landscapes.
For heightmaps:
* The algorithm is divided into several "component resolve batches" that render a list of neighboring components and merge all their edit layers into a single slice of a scratch texture array (first, copy all the edit layers texture subregions to a texture array then merge them in a single shader pass). Then those rendered components' borders are stitched (in order to mimic the behavior of global merge) so that there are no seams in between components even if they were not properly authored (i.e. one component authored while its neighbor was not loaded). Then normals are generated in another pass.
* In order to limit the amount of temporary copies of heightmaps, batches only render a max number of landscape components (including neighbor components), controlled by CVar landscape.EditLayersLocalMerge.MaxComponentsPerHeightmapResolveBatch. This means that a given component can effectively be rendered (i.e. merged) multiple times if it's needed for the computation of different batches but batches are built in a way to minimize this situation.
* Finally, mips are generated and the resulting heightmaps are copied to staging textures the same way they used to.
For weightmaps:
* The algorithm is divided into several "weightmap resolve batches" that render a list of components that participate to the output of a list of given weightmaps, processing each individual channel into a single slice of a scratch texture array (first, copy all the edit layers texture channels to a texture array then merge them in a single shader pass). Then, the weightmaps to resolve within the batch are finalized (i.e. individual, single-channel, weightmaps are packed into the final multi-channel weightmap), their mips are generated and the resulting weightmaps are copied to staging textures the same way they used to.
* In order to limit the amount of temporary copies of weightmaps, batches only render a max number of individual weightmaps, controlled by CVar landscape.EditLayersLocalMerge.MaxComponentsPerWeightmapResolveBatch. This means that a given weightmap can effectively be rendered (i.e. merged) multiple times if it's needed for the computation of different batches but batches are built in a way to minimize this situation.
Misc:
* Fixed RHI validation for GlobalMerge of weightmaps
* Moved landscape render resources to their own file to de-clutter LandscapeEditLayers.cpp a bit
* landscape.RenderCaptureLayersNextHeightmapDraws and landscape.RenderCaptureLayersNextWeightmapDraws now support capturing several draw calls
* Moved all intermediate containers (LandscapeComponentHeightmapsToRender/ToResolve, MapHelper, etc.) to a context object in order to centralize the local/global merge common structures. Note : the context is mutable and can be partially refreshed since weightmaps can be potentially added by the merge algorithms and therefore those structures were not up to date and we could miss reading back from newly-added weightmap textures
* Removed unused WeightmapLayersBlendSubstractive in global merge algorithm
* CVar commands landscape.Dirty and landscape.FixSplines now process all loaded game worlds
The next step is to re-work our internal brushes and provide a new API for them and user-implemented ones to work in the same fashion. Then the old BP brush API will be progressively phased out.
#rb sebastien.lussier, patrick.enfedaque
#tests full QA pass (UEENGQA-60460)
#preflight 61d8bc681f62d3ad4d728095
#ROBOMERGE-AUTHOR: jonathan.bard
#ROBOMERGE-SOURCE: CL 18751747 via CL 18751748 via CL 18751754 via CL 18751906 via CL 18751983
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)
[CL 18751988 by jonathan bard in ue5-main branch]
#rb CarlMagnus.Nordin, pj.kack
#rnx
#jira UE-133429
#preflight 61e7c020b875abaf33179ccc
### Token Removal
- Now that we support the IoStore in the editor there is no reason to keep the bulkdata streaming token as both the editor and runtime systems can use the same code paths.
- Existing use of USE_BULKDATA_STREAMING_TOKEN will now give deprecation warnings however code should continue to work as long as STREAMINGTOKEN_PARAM was correctly used.
- ::CreateStreamingToken has been removed from the bulkdata api, but any calls to this should've been wrapped with #if USE_BULKDATA_STREAMING_TOKEN
### API Fixes
- We can remove all code that relied on USE_BULKDATA_STREAMING_TOKEN being == 1
- LANDSCAPE_LOD_STREAMING_USE_TOKEN required USE_BULKDATA_STREAMING_TOKEN to be enabled, so we can now assume that it is always 0 and remove the associated code paths.
#ROBOMERGE-AUTHOR: paul.chipchase
#ROBOMERGE-SOURCE: CL 18656055 in //UE5/Release-5.0/... via CL 18656061 via CL 18656063
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v900-18638592)
[CL 18656065 by paul chipchase in ue5-main branch]
World Partition Landscape Support
- Don't maintain a list of landscape proxy and spline handles from actor descriptors registration.
- Iterate through actor descriptors to gather landscape edges and load intersecting splines instead.
#rb patrick.enfedaque
#preflight 61e0619a250b9537f7792d3b
#ROBOMERGE-OWNER: JeanFrancois.Dube
#ROBOMERGE-AUTHOR: jeanfrancois.dube
#ROBOMERGE-SOURCE: CL 18600396 in //UE5/Release-5.0/... via CL 18600408 via CL 18600449
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v899-18417669)
#ROBOMERGE-CONFLICT from-shelf
[CL 18601153 by JeanFrancois Dube in ue5-main branch]