Commit Graph

354 Commits

Author SHA1 Message Date
marc audy
d8ce23cd39 Restore lost closing brace
#rnx

#ROBOMERGE-AUTHOR: marc.audy
#ROBOMERGE-SOURCE: CL 20680835 in //UE5/Release-Engine-Staging/...
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v955-20579017)

[CL 20681019 by marc audy in ue5-main branch]
2022-06-16 01:03:34 -04:00
jonathan bard
08586534f9 Made ULandscapeInfo members properly set outside of editor and for PIE worlds
#tests UEENGQA-71560
#jira UE-149384
#preflight 62a3a1c1945c4467b54e93a0
#rb aurel.cordonnier
#lockdown

#ROBOMERGE-OWNER: jonathan.bard
#ROBOMERGE-AUTHOR: jonathan.bard
#ROBOMERGE-SOURCE: CL 20675719 in //UE5/Release-5.0/... via CL 20680564
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v955-20579017)

[CL 20681013 by jonathan bard in ue5-main branch]
2022-06-16 01:02:57 -04:00
Patrick Enfedaque
f5545aa360 New "AffectsLandscape" ActorDesc property: Implemented for Water, PatchComponent and LandscapeSplineActor
- Deprecated LandscapeSplineActorDesc as it is no longer needed with this property

#jira none
#rb jeanfrancois.dube, richard.malo
#preflight 62a8c041a43e20b293533548

[CL 20654038 by Patrick Enfedaque in ue5-main branch]
2022-06-14 14:28:12 -04:00
graham wihlidal
8cac6ce905 Added landscape.RenderNanite cvar that can be used to toggle Nanite rendering off/on, and also disabled call to UpdateNaniteRepresentation during PostLoad() until some issues with StaticAllocateObject are sorted out (replacing object before it's been fully loaded).
#rb rune.stubbe
[FYI] jonathan.bard, ola.olsson, ben.woodhouse, jian.ru
#preflight skip

#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 20631727 via CL 20631757 via CL 20631770
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v955-20579017)

[CL 20636409 by graham wihlidal in ue5-main branch]
2022-06-13 18:40:16 -04:00
graham wihlidal
730418b0dc Landscape Nanite serialization fixes (moved representation update out of Serialize and into PreSave), added slow task dialog during builds, and added a "Build Nanite" (and part of Build All Landscape) editor top level menu item under Build (so artists don't have to always navigate to the Build Data button on the landscape actor to rebuild the Nanite representation).
[FYI] jonathan.bard, brian.karis, ola.olsson
#preflight skip

#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 20585983 via CL 20585993 via CL 20586004
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v955-20579017)

[CL 20588028 by graham wihlidal in ue5-main branch]
2022-06-09 20:26:50 -04:00
graham wihlidal
10f753fd63 Refactored Landscape Nanite rebuilds to (by default) only occur during saving, cooking, or explicitly clicking the "Rebuild Data" button on the top level Landscape actor. This makes the sculpting/editing tools usable without massive rebuild hitches. By default now, any edits will invalidate Nanite and fall back to regular landscape rendering until the representation is updated again. This is a hopefully short term approach until we have proper asynchronous builds happening without user involvement. Live rebuilds (with hitching) can be re-enabled now with the landscape.LiveRebuildNaniteOnModification cvar.
[FYI] jonathan.bard, ola.olsson, brian.karis
#preflight 629eae3958032863432ffeba

#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 20581139 via CL 20581834 via CL 20582434
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v955-20579017)

[CL 20585495 by graham wihlidal in ue5-main branch]
2022-06-09 17:58:16 -04:00
graham wihlidal
c8e45f52de Fixed Landscape Nanite not working properly in cooked builds (SetNaniteActive would never fire), and also added code to keep lighting and shadowing properties on the Nanite representation in sync with the Landscape proxy (like casting shadows).
#rb jonathan.bard
[FYI] ola.olsson
#preflight 62a10aea3f1e313c6ad86d70

#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 20563818 via CL 20563863 via CL 20563894
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v954-20466795)

[CL 20567286 by graham wihlidal in ue5-main branch]
2022-06-08 19:06:03 -04:00
jonathan bard
7fab0a0a4d Landscape fixes :
* Fixed ASan issue with dirty data (weightmap/heightmap texture resolving debugging code) by removing usage of lambda in favor of direct call to the dirty function
* Fixed redundant ifdefs and invalid comments
* Removed overallocation of material instances array (was previously done to account for hardware tessellation which doesn't exist anymore)
* Renamed FLandscapeEditLayerReadbackResult to FLandscapeEditLayerComponentReadbackResult to better match what it actually is and changed the output type of readback results from ResolveLayersTexture from a map to an array, because a map was overkill and it allows to batch-handle readbacks in UpdateForChangedWeightmaps / UpdateForChangedHeightmaps

#rb luc.eygasier
#jira UE-155857
#preflight 629f721485333f26644f8c2b

[CL 20553846 by jonathan bard in ue5-main branch]
2022-06-08 05:53:34 -04:00
graham wihlidal
4344c75b1f More improvements to Nanite Landscape - each ALandscapeProxy contains multiple ULandscapeComponent, each rendering a grid cell of the heightmap terrain. My implementation for Nanite triangulates and merges all the components under a proxy (you can also have multiple proxies) into a single Nanite mesh with 4 material slots on it, and stores it on a new ULandscapeNaniteComponent also on each proxy.
The rendering of the 4 landscape components is needed for passes (like RVT) where Nanite is not supported or implemented, and we only want the Nanite landscape component to render in the base pass and virtual shadow maps. (mutually exclusive).

I've now implemented a new mutually exclusive render state that each proxy propagates down to the landscape components to override the calculated view relevance without destructively changing properties like bRenderInMainPass (since we don't want to break non-Nanite rendering when Nanite is not supported by the runtime or platform).

[FYI] jonathan.bard, ola.olsson, brian.karis, jeremy.moore
#preflight skip

#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 20532817 via CL 20532818 via CL 20532819
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v954-20466795)

[CL 20533257 by graham wihlidal in ue5-main branch]
2022-06-07 01:45:15 -04:00
graham wihlidal
277293f087 Some build fixes
#preflight skip

#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 20491553 via CL 20491560 via CL 20491579
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v954-20466795)

[CL 20495536 by graham wihlidal in ue5-main branch]
2022-06-03 19:14:22 -04:00
graham wihlidal
ca70de9156 Work in progress Nanite support for landscape
#preflight 6297a7f3a660a44a23c0c879
#rb jonathan.bard
[FYI] brian.karis, ola.olsson, michal.valient, rune.stubbe

#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 20490481 via CL 20490493 via CL 20490509
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v954-20466795)

[CL 20495473 by graham wihlidal in ue5-main branch]
2022-06-03 19:13:16 -04:00
julien lheureux
3af7a02872 Added delegate for changes on landscape proxy.
Added some robustness/validation to the GetCompleteBounds call.

#rb jonathan.bard
#preflight 6294c4294c7bcac173ce31bd

[CL 20430596 by julien lheureux in ue5-main branch]
2022-05-30 09:34:41 -04:00
semion piskarev
d78f6490ed Submitting on behalf of Jonathan.Bard, see review 19835889
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]
2022-05-26 23:03:03 -04:00
patrick enfedaque
6e14bf225a Landscape:
- 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]
2022-05-24 15:21:03 -04:00
JeanFrancois Dube
a2f7024803 Landscape: fix relative location mismatch detection.
#jira UE-153865
#rb patrick.enfedaque
#preflight none
#rnx

[CL 20351118 by JeanFrancois Dube in ue5-main branch]
2022-05-24 13:17:18 -04:00
jonathan bard
62f566009a Fixed random crash ocurring in HLOD builder commandlet, where we're hashing landscape texture source data while potentially asynchronously building textures. UTexture2D::GetSizeX() / UTexture2D::GetSizeY() should be prevented in those cases, since unlike in the landscape editor, nothing ensures that FinishCachePlatformData() is called on those textures and the returned sizes end up being wrong / thread-unsafe.
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]
2022-05-17 05:21:54 -04:00
luc eygasier
8f5e6ffb66 Adds Landscape resolution restriction when in Restricted Mode (example: UEFN), preventing to create landscape if the wanted resolution exceed currently supported safe limits.
Applied to:
* New Landscapes, new imported landscape
* Import Landscape tool
* Add component tool

#jira UE-149015
#preflight 627e98d97c26e247735ca7d1
#rb Michael.Balzer, Jonathan.Bard

#ROBOMERGE-AUTHOR: luc.eygasier
#ROBOMERGE-SOURCE: CL 20187875 via CL 20189504 via CL 20189506 via CL 20189507
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 20191648 by luc eygasier in ue5-main branch]
2022-05-13 18:58:05 -04:00
Sebastien Lussier
c3f8b1ebf5 Corrected ALandscapeProxy::GetLODScreenSizeArray() which didn't handle MaxLODLevel == INDEX_NONE properly
* 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]
2022-05-10 15:19:25 -04:00
jonathan bard
e479ed3735 Fixed bHasLayersContent not being set properly for the main ALandscape actor in distributed landscape setups (One ALandscape, multiple ALandscapeStreamingProxy actors).
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]
2022-05-10 13:53:26 -04:00
Julien StJean
175d5f6ab4 Adding elements support for the marquee selection.
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]
2022-04-12 15:52:44 -04:00
jonathan bard
0660f91839 Added BP setters for ForcedLOD and LODBias on landscape components. SetLOD can now be called both at runtime and edit-time.
#rb luc.eygasier
[FYI] cody.haskell

#ROBOMERGE-AUTHOR: jonathan.bard
#ROBOMERGE-SOURCE: CL 19720596 via CL 19720629 via CL 19720639 via CL 19720646
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v938-19570697)

[CL 19721952 by jonathan bard in ue5-main branch]
2022-04-12 11:31:39 -04:00
dmitriy dyomin
d5741f624b Added option to disable usage of a baked landscape mesh on mobile platforms (r.Mobile.LandscapeMesh)
#rb jack.porter

#ROBOMERGE-OWNER: dmitriy.dyomin
#ROBOMERGE-AUTHOR: dmitriy.dyomin
#ROBOMERGE-SOURCE: CL 19528072 via CL 19528235 via CL 19528695 via CL 19528703
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v937-19513599)

[CL 19532768 by dmitriy dyomin in ue5-main branch]
2022-03-28 16:28:57 -04:00
marc audy
a3275e4513 Move SystemGUIDs in to a cpp to avoid massive recompiles when changing
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]
2022-03-11 13:08:58 -05:00
sebastien lussier
2ee1117eec #jira UE-144062
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]
2022-03-10 20:48:38 -05:00
luc eygasier
643ed6eea9 Undo //UE5/Main/Engine/Source/... changelist 19235312
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]
2022-03-03 08:55:00 -05:00