Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/outline-feature-support' into fi…
Browse files Browse the repository at this point in the history
…x/outlinetransparents

# Conflicts:
#	Explorer/Assets/DCL/AvatarRendering/AvatarShape/Systems/AvatarShapeVisibilitySystem.cs
  • Loading branch information
GBirch33 committed Jan 22, 2025
2 parents 34711e2 + 6711c3e commit 8b23612
Show file tree
Hide file tree
Showing 18 changed files with 57 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
"GUID:e25ef972de004615a22937e739de2def",
"GUID:543b8f091a5947a3880b7f2bca2358bd",
"GUID:d832748739a186646b8656bdbd447ad0",
"GUID:8e25e34dc0eb4a7b93392a4dc25366bd"
"GUID:8e25e34dc0eb4a7b93392a4dc25366bd",
"GUID:09c5cab4669b047398fa5d42a2f64f5b",
"GUID:15fc0a57446b3144c949da3e2b9737a9"
],
"includePlatforms": [],
"excludePlatforms": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using DCL.Character.Components;
using DCL.CharacterCamera;
using DCL.ECSComponents;
using DCL.Quality;
using DCL.Rendering.Avatar;
using ECS.Abstract;
using System.Runtime.CompilerServices;
Expand All @@ -16,9 +17,13 @@ namespace DCL.AvatarRendering.AvatarShape.Systems
[UpdateInGroup(typeof(CameraGroup))]
public partial class AvatarShapeVisibilitySystem : BaseUnityLoopSystem
{
private readonly OutlineRendererFeature? outlineFeature;
private SingleInstanceEntity camera;

public AvatarShapeVisibilitySystem(World world) : base(world) { }
public AvatarShapeVisibilitySystem(World world, IRendererFeaturesCache outlineFeature) : base(world)
{
this.outlineFeature = outlineFeature.GetRendererFeature<OutlineRendererFeature>();
}

public override void Initialize()
{
Expand Down Expand Up @@ -52,7 +57,8 @@ public bool IsWithinCameraDistance(Camera camera, Transform objectTransform, flo
[Query]
private void GetAvatarsVisibleWithOutline(in AvatarBase avatarBase, ref AvatarShapeComponent avatarShape)
{
if (IsWithinCameraDistance(camera.GetCameraComponent(World).Camera, avatarBase.HeadAnchorPoint, 64.0f) && IsVisibleInCamera(camera.GetCameraComponent(World).Camera, avatarBase.AvatarSkinnedMeshRenderer.bounds))
bool isEnabled = outlineFeature?.isActive ?? false;
if (isEnabled && IsWithinCameraDistance(camera.GetCameraComponent(World).Camera, avatarBase.HeadAnchorPoint, 64.0f) && IsVisibleInCamera(camera.GetCameraComponent(World).Camera, avatarBase.AvatarSkinnedMeshRenderer.bounds))
{
OutlineRendererFeature.m_OutlineRenderers.AddRange(avatarShape.OutlineCompatibleRenderers);
}
Expand Down Expand Up @@ -107,6 +113,7 @@ private void UpdateVisibilityState(ref AvatarShapeComponent avatarShape, ref Ava
Hide(ref avatarShape);
else
Show(ref avatarShape);

avatarCachedVisibility.IsVisible = shouldBeHidden;
}

Expand Down
3 changes: 2 additions & 1 deletion Explorer/Assets/DCL/Editor/DCL.Editor.asmdef
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"GUID:286980af24684da6acc1caa413039811",
"GUID:1d2c76eb8b48e0b40940e8b31a679ce1",
"GUID:fc37ca6521833154cab08ec51af097d9",
"GUID:fdc035e0abb695e408d8ccf2c3bd63a5"
"GUID:fdc035e0abb695e408d8ccf2c3bd63a5",
"Quality.RenderFeatures"
],
"includePlatforms": [
"Editor"
Expand Down
3 changes: 2 additions & 1 deletion Explorer/Assets/DCL/PluginSystem/DCL.Plugins.asmdef
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@
"GUID:fdc035e0abb695e408d8ccf2c3bd63a5",
"GUID:ead265f036164eb7899edc341131f4d5",
"GUID:e9db755bba99425db4ca5d30e48b7429",
"GUID:5462d37de7d4344df8aade58a45b403e"
"GUID:5462d37de7d4344df8aade58a45b403e",
"GUID:09c5cab4669b047398fa5d42a2f64f5b"
],
"includePlatforms": [],
"excludePlatforms": [],
Expand Down
7 changes: 5 additions & 2 deletions Explorer/Assets/DCL/PluginSystem/Global/AvatarPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
using DCL.AvatarRendering.AvatarShape.Helpers;
using DCL.Multiplayer.Profiles.Entities;
using DCL.AvatarRendering.Loading.Assets;
using DCL.Multiplayer.Profiles.Tables;
using DCL.Quality;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Pool;
Expand All @@ -51,6 +51,7 @@ public class AvatarPlugin : IDCLGlobalPlugin<AvatarPlugin.AvatarShapeSettings>
private readonly IPerformanceBudget frameTimeCapBudget;
private readonly ObjectProxy<AvatarBase> mainPlayerAvatarBaseProxy;
private readonly IPerformanceBudget memoryBudget;
private readonly IRendererFeaturesCache rendererFeaturesCache;
private readonly IRealmData realmData;

private readonly AttachmentsAssetsCache attachmentsAssetsCache;
Expand Down Expand Up @@ -84,6 +85,7 @@ public AvatarPlugin(
IAssetsProvisioner assetsProvisioner,
IPerformanceBudget frameTimeCapBudget,
IPerformanceBudget memoryBudget,
IRendererFeaturesCache rendererFeaturesCache,
IRealmData realmData,
ObjectProxy<AvatarBase> mainPlayerAvatarBaseProxy,
IDebugContainerBuilder debugContainerBuilder,
Expand All @@ -106,6 +108,7 @@ ExposedTransform playerTransform
this.chatEntryConfiguration = chatEntryConfiguration;
this.defaultFaceFeaturesHandler = defaultFaceFeaturesHandler;
this.memoryBudget = memoryBudget;
this.rendererFeaturesCache = rendererFeaturesCache;
this.nametagsData = nametagsData;
this.textureArrayContainerFactory = textureArrayContainerFactory;
this.remoteEntities = remoteEntities;
Expand Down Expand Up @@ -166,7 +169,7 @@ public void InjectToWorld(ref ArchSystemsWorldBuilder<Arch.Core.World> builder,
FinishAvatarMatricesCalculationSystem.InjectToWorld(ref builder, skinningStrategy,
avatarTransformMatrixJobWrapper);

AvatarShapeVisibilitySystem.InjectToWorld(ref builder);
AvatarShapeVisibilitySystem.InjectToWorld(ref builder, rendererFeaturesCache);
AvatarCleanUpSystem.InjectToWorld(ref builder, frameTimeCapBudget, vertOutBuffer, avatarMaterialPoolHandler,
avatarPoolRegistry, computeShaderPool, attachmentsAssetsCache, mainPlayerAvatarBaseProxy,
avatarTransformMatrixJobWrapper);
Expand Down
1 change: 1 addition & 0 deletions Explorer/Assets/DCL/Quality/Container/csc.rsp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-nullable:enable
3 changes: 3 additions & 0 deletions Explorer/Assets/DCL/Quality/Container/csc.rsp.meta

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

3 changes: 2 additions & 1 deletion Explorer/Assets/DCL/Quality/DCL.Quality.asmdef
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"GUID:4794e238ed0f65142a4aea5848b513e5",
"GUID:a29f69b42fb1815409464ac7b05381d0",
"GUID:21c2e77c042a2d34d8cfbf58f8217053",
"GUID:fc37ca6521833154cab08ec51af097d9"
"GUID:fc37ca6521833154cab08ec51af097d9",
"GUID:09c5cab4669b047398fa5d42a2f64f5b"
],
"includePlatforms": [],
"excludePlatforms": [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using DCL.Quality.Runtime;
using System;
using System.Linq;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.Compilation;

namespace DCL.Quality
Expand Down
3 changes: 3 additions & 0 deletions Explorer/Assets/DCL/Quality/RenderFeatures.meta

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
@@ -0,0 +1,16 @@
{
"name": "Quality.RenderFeatures",
"rootNamespace": "",
"references": [
"GUID:15fc0a57446b3144c949da3e2b9737a9"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

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 @@ -621,6 +621,7 @@ static IMultiPool MultiPoolFactory() =>
assetsProvisioner,
staticContainer.SingletonSharedDependencies.FrameTimeBudget,
staticContainer.SingletonSharedDependencies.MemoryBudget,
staticContainer.QualityContainer.RendererFeaturesCache,
staticContainer.RealmData,
staticContainer.MainPlayerAvatarBaseProxy,
debugBuilder,
Expand Down
6 changes: 3 additions & 3 deletions Explorer/ProjectSettings/QualitySettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ QualitySettings:
useLegacyDetailDistribution: 1
vSyncCount: 0
realtimeGICPUUsage: 25
lodBias: 1.25
lodBias: 1
maximumLODLevel: 0
enableLODCrossFade: 1
streamingMipmapsActive: 1
Expand All @@ -145,9 +145,9 @@ QualitySettings:
customRenderPipeline: {fileID: 11400000, guid: c65640f7136a25549af0035669ea476c, type: 2}
terrainQualityOverrides: 0
terrainPixelError: 1
terrainDetailDensityScale: 1
terrainDetailDensityScale: 0.7
terrainBasemapDistance: 1000
terrainDetailDistance: 300
terrainDetailDistance: 150
terrainTreeDistance: 5000
terrainBillboardStart: 50
terrainFadeLength: 5
Expand Down

0 comments on commit 8b23612

Please sign in to comment.