Commit Graph

2216 Commits

Author SHA1 Message Date
don boogert 68e886a015 Landscape: Fix mobile texture arrays
* Batching the copy of textures to arrays didn't take into account the target slice
* shader variations cached for landscape mobile texture enabled / disabled.

#rb jonathan.bard
#jira UE-210377

[CL 32544804 by don boogert in ue5-main branch]
2024-03-27 11:24:04 -04:00
kevin macaulayvacher 5dbf219be8 Adjust DDC stats to be more representative of DDC actions. By default COOK_STAT timers will record a miss unless AddHit is called. Here we explicitly only track cycles if we know we won't be using DDC (and thus can't miss)
#jira UE-206398
#rb jonathan.bard
[FYI] Francis.Hurteau

[CL 32539465 by kevin macaulayvacher in ue5-main branch]
2024-03-27 06:56:09 -04:00
jonathan bard 11cb27445b Introducing Landscape Edit Layer class : essentially, a type of object describing landscape edit layers that can be extended by derivation in order to specialize the behavior of the edit layer class. Most edit layer settings should eventually move here and this will be the building block for allowing plugins to extend the edit layer system in a more solid way than the BP brush system.
* 2 implementations for now : ULandscapeEditLayer (standard edit layer, that can be sculpted/painted) and ULandscapeEditLayerSplines (replaces the current "Reserved for Splines" edit layer system)
* The edit layers have a bunch of virtual functions to customize their behavior (affects heightmaps/weightmaps/visibility? contains persistent textures? can be edited via standard tools? supports collapsing? etc.)
* A composition pattern was used : FLandscapeLayer owns an Instanced ULandscapeEditLayerBase property (null not allowed) although the public "LandscapeLayers" list was deprecated in favor of a private "LandscapeEditLayers" in order to stop users being able to mutate the list of layers and their properties freely
* ALandscape::GetLayer was deprecated in favor of ALandscape::GetLayerConst in order to enforce a single, controlled, access to the layer data (via public methods), instead of the current free-for-all way

Landscape UX changes/improvements :
* Landscape edit layers are now added via a more standard '+' button (like standard array properties) and will then request the user to pick a class of edit layer (standard or splines for now, but any non-abstract edit layer class is discoverable) via a modal dialog. The type of the edit layer cannot be changed after the fact (the "Reserve For Splines" / "Remove Reserve for Splines" actions are therefore gone)
* Deletion of edit layer is done via a button or via context menu
* Edit layers context menu will now display all available options (instead of hiding some) but will disable the ones that are not available and will display the reason why that's the case in the tooltip (e.g. cannot rename a locked edit layer)
* The Collapse Layer action has been made available all the time (instead of only when the Manage panel is active) and now also supports collapsing the splines layer onto a standard layer underneath (but not the other way around), because it's supported, since the Splines layer does have standard heightmaps/weightmaps
* The edit layers have the ability to define custom actions generically, which will dynamically extend the context menu on that edit layer (the "Update Splines" actions on the Splines edit layer uses this system)
* Added a drag indicator on edit layers to streamline this reorderable list

Left to do:
* Move most settings from FLandscapeLayer to ULandscapeEditLayer and implement a generic system for responding to property changes in both the landscape and landscape UI, instead of exposing several ad-hoc functions (SetLayerName, SetLayerLocked, etc.) on the landscape and the landscape UI code (plus, it will allow to get those to react to changes to settings defined in an plugin's edit layer)
* Prevent useless heightmaps/weightmaps from being created on procedural edit layers that don't need persistent textures (water, landscape patch, etc.) This is a memory optimization : at least, we already prevent those to be edited, which is a common mistake with the current BP brush system, as users can sculpt/paint on a water edit layer, since it's a standard edit layer and they're allowed to
* Move the systems that act as proper edit layers (LandscapePatchManager, WaterBrushManager) from BP brush to the landscape edit layer class system
* Integrate proper icons for edit layer classes to help the user tell at a glance the type of layer (e.g. splines layer)
#jira UE-209960
#tests Editor
#rb don.boogert

[CL 32477586 by jonathan bard in ue5-main branch]
2024-03-25 14:14:31 -04:00
luc eygasier 7e99d6a926 Updates landscape actionable messages.
#jira UE-204527
#rb Jonathan.Bard

[CL 32336110 by luc eygasier in ue5-main branch]
2024-03-19 15:34:32 -04:00
PetterVMC 2845f4b433 PR #11613: Use triangle-precise placement of landscape grass instances to fix issue with Landscape Grass floating over/under landscape surface.
#rb jonathan.bard
#jira UE-209489
#tests I validated landscape grass instance placements are much more accurate in editor
#11613

[CL 32328086 by PetterVMC in ue5-main branch]
2024-03-19 12:08:14 -04:00
jon cain 28a3fd45fd Change VSM resolution by removing the old LODViewOrigin method, and replacing it with a mixture of ViewTarget location as the VSM world origin location, or defaulting it to the CameraViewOrigin.
Compensates by scaling the FirstLevel VSM depending on the OrthoWidth being used, which has the added benefit of reducing performance for VSM LODs that are not required for Ortho passes. Added a LineTrace system for estimating the location when a ViewTarget is not selected.
Also removes the PostProcess disable setting that previously blocked EyeAdaptation from being applied to Lumen, so SkyLight etc shadows now resolve appropriately, resolving bugs that appear in editor debug views + minimaps.
Also switches Editor debug views to use ortho auto plane calculations/fixes a crash when zooming out. CVars also added for disabling these settings, or forcing different LODBiases in VSMs.
Refactored NearPlane updates to an easier to follow logic path and added compensation for ViewOrigin to ViewTargets.

#jira UE-206860, FORT-604328
#rb Laura.Hermanns, Andrew.Lauritzen

[CL 32322246 by jon cain in ue5-main branch]
2024-03-19 08:10:23 -04:00
don boogert 272719d49d Landscape : Nanite skirts generated on a more general set of edges ( no neighbouring component in set of exported components)
#jira UE-209420
#rb jonathan.bard

[CL 32305546 by don boogert in ue5-main branch]
2024-03-18 13:55:51 -04:00
sebastien lussier b7e6fe7452 World Partition - HLOD: When dealing with landscape HLODs that are nanite enabled,we add a skirt around the edge the the generated mesh. Make sure to use a custom depth for this skirt, that is the length of a quad at the exported resolution. This should cover all possible gap scenario while also avoiding the skirt clipping through neighborhood LS tiles.
#rb JeanFrancois.Dube

[CL 32299025 by sebastien lussier in ue5-main branch]
2024-03-18 09:33:16 -04:00
chris tchou 59be4550e8 Fixing lightmap resolution calculation on landscape nanite meshes
Switched to FMemoryWriter64 for large landscape nanite caching
Adding a CVar to control when landscape nanite export is cached
Adding static lighting test map to LandscapeExtras terrain project

#rb jonathan.bard


#virtualized

[CL 32279194 by chris tchou in ue5-main branch]
2024-03-15 13:54:16 -04:00
luc eygasier d48454bf5b Adds SActionableMessageViewportWidget in Viewport's toolbar.
This widget will host warnings or messages with the ability to automate actions for the user.

Current actionable messages:
* Invalid Landscape grassmaps, with associated rebuild action
* Invalid Landscape physical materials, with associated rebuild action
* Invalid Landscape nanite meshes with associated rebuild action
* Invalid grassmaps, physical materials, nanite meshes will be agregated to only one message if multiple rebuild are necessary
* Landscape proxy packages needs to be updated, with associated mark dirty action

#jira UE-204527

#rb Jonathan.Bard

[CL 32224398 by luc eygasier in ue5-main branch]
2024-03-13 15:34:54 -04:00
luc eygasier 29c904b3e3 Undo //Fortnite/Release-29.20/Engine/... changelist 32186488
#jira UE-204527

[CL 32191590 by luc eygasier in ue5-main branch]
2024-03-12 16:45:06 -04:00
luc eygasier c409a75cc9 Adds SActionableMessageViewportWidget in Viewport's toolbar.
This widget will host warnings or messages with the ability to automate actions for the user.

Current actionable messages:
* Invalid Landscape grassmaps, with associated rebuild action
* Invalid Landscape physical materials, with associated rebuild action
* Invalid Landscape nanite meshes with associated rebuild action
* Invalid grassmaps, physical materials, nanite meshes will be agregated to only one message if multiple rebuild are necessary
* Landscape proxy packages needs to be updated, with associated mark dirty action

#jira UE-204527

#rb chris.tchou, jonathan.bard

[CL 32190792 by luc eygasier in ue5-main branch]
2024-03-12 16:29:49 -04:00
luc eygasier 521f457265 Modifies Landscape to not add packages to ModifiedPackages if the package is already dirty.
Removes package from ModifiedPackages when a package is dirty.
#rb chris.tchou, jonathan.bard
#jira UE-204527

[CL 32188912 by luc eygasier in ue5-main branch]
2024-03-12 15:35:46 -04:00
jeanfrancois dube 415e9960f4 World Partition: added new virtual functions on AActor::OnLoadedActorAddedToLevel/OnLoadedActorRemovedFromLevel called when actors are dynamically added or removed from the persistent level during world partition loading operations + deprecated FWorldPartitionActorDesc::OnUnloadingInstance and moved existing code to new actor callbacks instead.
#rb Sebastien.Lussier

[CL 32154809 by jeanfrancois dube in ue5-main branch]
2024-03-11 10:53:16 -04:00
dmitriy dyomin 120daf53d0 Fixed case where landscape creates mesh batches with a null vertex factory
#jira UE-197040

[CL 32152831 by dmitriy dyomin in ue5-main branch]
2024-03-11 09:05:32 -04:00
chris tchou 84706cb981 Fix issues with landscape nanite build path (texcture coordinates and DDC caching)
* Fixes XZ texcoord material node (data was getting stomped by lightmap UVs in nanite meshes)
* Speeds up nanite build step by manually calculating lightmap UV coordinates (30% faster on a 1k x 1k landscape)
* Fixes DDC cache key issue (was getting collisions on landscapes that got split into multiple nanite meshes), and re-enables DDC caching of the mesh description

#rb don.boogert
#jira UE-208189


#virtualized

[CL 32124074 by chris tchou in ue5-main branch]
2024-03-08 12:49:19 -05:00
chris tchou 36d9174d8a Fix for landscape grass disappearing when switching to a preview mode in editor
Grass maps are not recalculated per-platform, so there's no reason to evict them when the feature level changes.

#jira UE-208555
#rb luc.eygasier

[CL 32103550 by chris tchou in ue5-main branch]
2024-03-07 17:32:23 -05:00
chris tchou edf677c364 Remove unnecessary warning in Landscape, and fix the behavior of the DrawScale cached value in LandscapeInfo.
Previously, landscape info would grab DrawScale from the first registered Proxy that had a valid transform, and then issue warnings on any discrepancy with later registered Proxies.  This is not really necessary as the transforms all get fixed up to match the main landscape Actor when both are registered, so the warning is removed.

However, the DrawScale is grabbed somewhat incorrectly.  If we first register a streaming proxy that has incorrect scale because it was never updated, then it will lock onto the incorrect value of DrawScale.  The code was changed to prefer  the Actor DrawScale over any streaming proxy DrawScale.

Also fixed an issue with the PropertyChanged code pertaining to the scale, that would spuriously issue warnings if you pasted a scale with mismatched signs on X and Y.

I think ideally we would get rid of the DrawScale cached value, as I don't see the value in caching it over computing it.  But it is used in many places, so is a large change to deprecate.

#rb jonathan.bard

[CL 32020449 by chris tchou in ue5-main branch]
2024-03-05 10:30:36 -05:00
chris tchou 4ca84c7fa3 Disable newly added DDC cache (to workaround discovered issues)
#rb jonathan.bard
#jira UE-208189

[CL 31819862 by chris tchou in ue5-main branch]
2024-02-26 17:49:08 -05:00
dominic couture 0434847b6f -Make Landscape use LightMapType setting
-Added a new type of mappping, FLandscapeStaticLightingGlobalVolumeMapping (akin to FStaticLightingGlobalVolumeMapping) that makes Lightmass use the exported Landscape mesh as a surface for caching but then discards the lightmaps

#rb jonathan.bard
#jira UE-194661

[CL 31818485 by dominic couture in ue5-main branch]
2024-02-26 17:04:01 -05:00
jonathan bard 886bf42d89 Missing include
[CL 31801449 by jonathan bard in ue5-main branch]
2024-02-26 08:39:56 -05:00
chris tchou 476b360910 Build fix for crashes in landscape FMemoryWriter going over the max memory limit for when building nanite and attempting to DDC cache a large landscape.
Horde issue 434366

#rb don.boogert

[CL 31786729 by chris tchou in ue5-main branch]
2024-02-23 20:18:34 -05:00
chris tchou bb643c6387 Add landscape static mesh build to the DDC cache, to save farm build time when landscapes are invalidated en masse.
1021x1021 landscape nanite build:
original, no cache: 40.6 s
original, nanite cache only:  16.5 s
with added static mesh cache:  6.6 s

#rb jonathan.bard
#jira UE-205347

[CL 31774789 by chris tchou in ue5-main branch]
2024-02-23 15:30:54 -05:00
tiago costa e004161a0c Cleanup some logic in LandscapeRender.cpp
[CL 31759116 by tiago costa in ue5-main branch]
2024-02-23 06:10:30 -05:00
chris tchou 9c5b82db24 Fix for landscape taking a long time when creating a project from a template while using DirectX 11.
The GPU Readback will never return IsReady() within a loop in a single frame, so we must force it to complete anyways.

I chose to just have it force a completion after 5 ticks, which is just a simple metric that should keep it from being hit in the amortized case (readbacks come back in 3 ticks at most), but will quickly get hit in the BuildNow() case.

#rb jonathan.bard
#jira UE-207360

[CL 31744046 by chris tchou in ue5-main branch]
2024-02-22 19:12:44 -05:00