Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
997432d
Ripped out the old terrain
AnsisMalins Jun 13, 2025
32e898c
Added the new terrain
AnsisMalins Jun 13, 2025
38fa3c6
Integrate new terrain WIP
AnsisMalins Jun 20, 2025
2721b23
Merge branch 'dev' into feat/new-terrain
AnsisMalins Jun 20, 2025
16d531b
Fix compiler errors
AnsisMalins Jun 20, 2025
ef90f39
Fix things
AnsisMalins Jun 23, 2025
1921269
Correct occupancy map offset and scale
AnsisMalins Jun 27, 2025
e0ca737
Added terrain padding
AnsisMalins Jun 27, 2025
3488a38
Integrate terrain collider with Arch
AnsisMalins Jul 1, 2025
18d26df
Fix rocks, use latest TerrainProto
AnsisMalins Jul 2, 2025
5574a4d
Merge branch 'dev' into feat/new-terrain
AnsisMalins Jul 2, 2025
eddc071
CRLF -> LF because Unity insists
AnsisMalins Jul 9, 2025
1c6f81d
Plug the indirect grass renderer in
AnsisMalins Jul 11, 2025
e1d3867
Make indirect renderer work with no occupancy map
AnsisMalins Jul 11, 2025
ddaa04d
Use latest Terrain package
AnsisMalins Jul 11, 2025
b63f08b
Use indirect branch of stylized grass
AnsisMalins Jul 11, 2025
ba0b578
Merge branch 'dev' into feat/new-terrain
AnsisMalins Jul 14, 2025
a533a7f
Remove the GPUI assets package again
AnsisMalins Jul 14, 2025
735e994
Fixed a crash in release mode
AnsisMalins Jul 15, 2025
9b8cd77
Grass indirect terrain colour blending
GBirch33 Jul 17, 2025
52420a9
Terrain material update
GBirch33 Jul 17, 2025
19f1474
Update terrain data
AnsisMalins Jul 22, 2025
0de1509
Use latest terrain package
AnsisMalins Jul 22, 2025
2788d49
terrain and grass blending
GBirch33 Jul 22, 2025
ceeae24
Use latest package again and double tree density
AnsisMalins Jul 22, 2025
e3215e8
Use the new SatteliteFloor shader
AnsisMalins Jul 23, 2025
ffffdc6
Grass material change
GBirch33 Jul 25, 2025
87cc9e0
Applying grass package update
GBirch33 Jul 25, 2025
7f3a217
Use latest terrain package
AnsisMalins Jul 25, 2025
257f86b
Merge branch 'dev' into feat/new-terrain
AnsisMalins Jul 25, 2025
cc58a7f
Load tree instances from disk
AnsisMalins Jul 30, 2025
407aee1
Update terrain package
AnsisMalins Jul 31, 2025
71027cd
Merge branch 'dev' into feat/new-terrain
AnsisMalins Jul 31, 2025
876494f
Terrain Proto and settings update
GBirch33 Jul 31, 2025
d5e7698
Delete an empty code file
AnsisMalins Jul 31, 2025
1daa8f2
Grass merge with main
GBirch33 Jul 31, 2025
426bd1e
terrain bounds for grass fixed
GBirch33 Jul 31, 2025
aabf571
Fix satellite floor
AnsisMalins Jul 31, 2025
3a0dee5
Use the latest terrain package
AnsisMalins Aug 8, 2025
b0b6e81
Updated the Terrain package which removes the GPU readbacks
GBirch33 Aug 9, 2025
fc51c58
Merge branch 'dev' into feat/new-terrain
m3taphysics Aug 11, 2025
be1677a
Update manifest.json
m3taphysics Aug 11, 2025
684ec70
Remove the packages.
m3taphysics Aug 11, 2025
a407abc
brought back detail distance control from settings (works only on gra…
popuz Aug 11, 2025
c560180
updated package to new hash with details distance account in frustrum…
popuz Aug 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
using Vector3 = UnityEngine.Vector3;
using DCL.Audio.Jobs;
using DCL.Landscape;
using DCL.Landscape.Systems;
using Random = UnityEngine.Random;
using TerrainData = UnityEngine.TerrainData;

namespace DCL.Audio.Systems
{
Expand All @@ -25,7 +25,6 @@ namespace DCL.Audio.Systems
/// </summary>
[LogCategory(ReportCategory.AUDIO)]
[UpdateInGroup(typeof(PresentationSystemGroup))]
[UpdateAfter(typeof(LandscapeTerrainCullingSystem))]
public partial class LandscapeAudioCullingSystem : BaseUnityLoopSystem
{
private readonly TerrainGenerator terrainGenerator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
using ECS.SceneLifeCycle.SceneDefinition;
using ECS.StreamableLoading.Common;
using System.Threading;
using Unity.Collections;
using Unity.Mathematics;
using UnityEngine;
using UnityEngine.Pool;
using Utility;
using Utility.Types;

Expand All @@ -22,15 +22,13 @@ public class Landscape : ILandscape
private readonly TerrainGenerator genesisTerrain;
private readonly WorldTerrainGenerator worldsTerrain;
private readonly bool landscapeEnabled;
private readonly bool isLocalSceneDevelopment;

public Landscape(IGlobalRealmController realmController, TerrainGenerator genesisTerrain, WorldTerrainGenerator worldsTerrain, bool landscapeEnabled, bool isLocalSceneDevelopment)
{
this.realmController = realmController;
this.genesisTerrain = genesisTerrain;
this.worldsTerrain = worldsTerrain;
this.landscapeEnabled = landscapeEnabled;
this.isLocalSceneDevelopment = isLocalSceneDevelopment;
}

public async UniTask<EnumResult<LandscapeError>> LoadTerrainAsync(AsyncLoadProcessReport landscapeLoadReport, CancellationToken ct)
Expand All @@ -44,13 +42,12 @@ public async UniTask<EnumResult<LandscapeError>> LoadTerrainAsync(AsyncLoadProce
if (realmController.RealmData.IsGenesis())
{
//TODO (Juani): The globalWorld terrain would be hidden. We need to implement the re-usage when going back
worldsTerrain.SwitchVisibility(false);
worldsTerrain.Hide();

if (!genesisTerrain.IsTerrainGenerated)
await genesisTerrain.GenerateGenesisTerrainAndShowAsync(processReport: landscapeLoadReport,
cancellationToken: ct);
genesisTerrain.GenerateAndShow(landscapeLoadReport);
else
await genesisTerrain.ShowAsync(landscapeLoadReport);
genesisTerrain.Show(landscapeLoadReport);
}
else
{
Expand Down Expand Up @@ -83,16 +80,13 @@ private async UniTask GenerateStaticScenesTerrainAsync(AsyncLoadProcessReport la
var staticScenesEntityDefinitions = await realmController.WaitForStaticScenesEntityDefinitionsAsync(ct);
if (!staticScenesEntityDefinitions.HasValue) return;

int parcelsAmount = staticScenesEntityDefinitions.Value.Value.Count;

using (var parcels = new NativeParallelHashSet<int2>(parcelsAmount, AllocatorManager.Persistent))
using (ListPool<int2>.Get(out var parcels))
{
foreach (var staticScene in staticScenesEntityDefinitions.Value.Value)
{
foreach (Vector2Int parcel in staticScene.metadata.scene.DecodedParcels) { parcels.Add(parcel.ToInt2()); }
}
foreach (Vector2Int parcel in staticScene.metadata.scene.DecodedParcels)
parcels.Add(parcel.ToInt2());

await worldsTerrain.GenerateTerrainAsync(parcels, (uint)realmController.RealmData.GetHashCode(), landscapeLoadReport, cancellationToken: ct);
worldsTerrain.GenerateTerrain(parcels.ToArray(), landscapeLoadReport);
}
}

Expand All @@ -103,20 +97,13 @@ private async UniTask GenerateFixedScenesTerrainAsync(AsyncLoadProcessReport lan

AssetPromise<SceneEntityDefinition, GetSceneDefinition>[]? promises = await realmController.WaitForFixedScenePromisesAsync(ct);

var parcelsAmount = 0;

foreach (AssetPromise<SceneEntityDefinition, GetSceneDefinition> promise in promises)
parcelsAmount += promise.Result!.Value.Asset!.metadata.scene.DecodedParcels.Count;

using (var parcels = new NativeParallelHashSet<int2>(parcelsAmount, AllocatorManager.Persistent))
using (ListPool<int2>.Get(out var parcels))
{
foreach (AssetPromise<SceneEntityDefinition, GetSceneDefinition> promise in promises)
{
foreach (Vector2Int parcel in promise.Result!.Value.Asset!.metadata.scene.DecodedParcels)
parcels.Add(parcel.ToInt2());
}

await worldsTerrain.GenerateTerrainAsync(parcels, (uint)realmController.RealmData.GetHashCode(), landscapeLoadReport, cancellationToken: ct);
worldsTerrain.GenerateTerrain(parcels.ToArray(), landscapeLoadReport);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using DCL.Multiplayer.Connections.DecentralandUrls;
using DCL.PluginSystem.Global;
using DCL.RealmNavigation;
using ECS.SceneLifeCycle;
using ECS.SceneLifeCycle.Realm;
using Global.Dynamic.Landscapes;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ Material:
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses:
- MOTIONVECTORS
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ Material:
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses:
- MOTIONVECTORS
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7a5b23ea474707949ac1958443314f0f, type: 3}
propertyPath: m_LocalPosition.x
value: 717.4116
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7a5b23ea474707949ac1958443314f0f, type: 3}
propertyPath: m_LocalPosition.y
value: 0.58625525
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7a5b23ea474707949ac1958443314f0f, type: 3}
propertyPath: m_LocalPosition.z
value: -1573.6902
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7a5b23ea474707949ac1958443314f0f, type: 3}
propertyPath: m_LocalRotation.w
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ Material:
m_DoubleSidedGI: 1
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses:
- MOTIONVECTORS
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ Material:
m_DoubleSidedGI: 1
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses:
- MOTIONVECTORS
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ Material:
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses:
- MOTIONVECTORS
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ Material:
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses:
- MOTIONVECTORS
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &301782615085243669
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3087263769094213892}
- component: {fileID: 8742584773998374722}
m_Layer: 17
m_Name: CollisionObject0
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3087263769094213892
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 301782615085243669}
serializedVersion: 2
m_LocalRotation: {x: -0, y: 0.000000030888096, z: 0.7071068, w: 0.7071068}
m_LocalPosition: {x: 0.006637088, y: 0.53919345, z: -0.0029117465}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 132018308065938286}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!136 &8742584773998374722
CapsuleCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 301782615085243669}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.054864246
m_Height: 1.1490948
m_Direction: 0
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &9037524513379548263
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 132018308065938286}
m_Layer: 0
m_Name: Bush02 Collider
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &132018308065938286
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9037524513379548263}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 3087263769094213892}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7ee2877b90d2bc048b88aacb57ee6dcc, type: 3}
propertyPath: m_LocalPosition.x
value: 716.7916
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7ee2877b90d2bc048b88aacb57ee6dcc, type: 3}
propertyPath: m_LocalPosition.y
value: 0.08944039
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7ee2877b90d2bc048b88aacb57ee6dcc, type: 3}
propertyPath: m_LocalPosition.z
value: -1574.5286
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7ee2877b90d2bc048b88aacb57ee6dcc, type: 3}
propertyPath: m_LocalRotation.w
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ Material:
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses:
- MOTIONVECTORS
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ Material:
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses:
- MOTIONVECTORS
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
Expand Down
Loading
Loading