From 6e3f46526e65c13b947d761b8758ae60c871a3a9 Mon Sep 17 00:00:00 2001 From: Maurizio Farmi Date: Thu, 23 Apr 2026 17:57:00 +0200 Subject: [PATCH 1/8] Revert "Fixed textures not being rendered correctly" This reverts commit 1b28248673786504732ce6bb328dcc6118fec514. --- Assets/Scripts/Loading/BinaryDownloadProvider.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Assets/Scripts/Loading/BinaryDownloadProvider.cs b/Assets/Scripts/Loading/BinaryDownloadProvider.cs index 24936e4..0a93122 100644 --- a/Assets/Scripts/Loading/BinaryDownloadProvider.cs +++ b/Assets/Scripts/Loading/BinaryDownloadProvider.cs @@ -159,9 +159,7 @@ public void Dispose() public class AwaitableTextureDownload : AwaitableDownload, ITextureDownload { - - /// - public Texture2D Texture => (m_Request?.downloadHandler as DownloadHandlerTexture)?.texture; + public Texture2D Texture { get; } /// /// Parameter-less constructor, required for inheritance. From 8514a82183fdc0238f0e1d7366b5fe0bfb291cd3 Mon Sep 17 00:00:00 2001 From: Maurizio Farmi Date: Thu, 23 Apr 2026 17:57:06 +0200 Subject: [PATCH 2/8] Revert "Changed shared dependencies branch to main" This reverts commit 4a821ff5aac38fe164cb8f77dc791ba6495e6d96. --- Packages/manifest.json | 2 +- Packages/packages-lock.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Packages/manifest.json b/Packages/manifest.json index a276094..14afa25 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -1,7 +1,7 @@ { "dependencies": { "com.atteneder.gltfast": "https://github.com/atteneder/glTFast.git", - "com.decentraland.unity-shared-dependencies": "git@github.com:decentraland/unity-shared-dependencies.git#main", + "com.decentraland.unity-shared-dependencies": "git@github.com:decentraland/unity-shared-dependencies.git#feat/update-to-gltfast-6.16.1", "com.unity.cinemachine": "3.1.4", "com.unity.ide.rider": "3.0.38", "com.unity.ide.visualstudio": "2.0.26", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index 2d70f61..0cadd92 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -14,11 +14,11 @@ "hash": "3360ccae0a91cbc1bafb32d4aa0132fc82add141" }, "com.decentraland.unity-shared-dependencies": { - "version": "git@github.com:decentraland/unity-shared-dependencies.git#main", + "version": "git@github.com:decentraland/unity-shared-dependencies.git#feat/update-to-gltfast-6.16.1", "depth": 0, "source": "git", "dependencies": {}, - "hash": "0132f23fb5d1bfa1634a872ef28e131067df7a69" + "hash": "e7dc3286806e732f4388754ec17df23b81a8d89e" }, "com.unity.burst": { "version": "1.8.27", From 20f1f469e5ea3003f75c1fc137d7999bd6383fa7 Mon Sep 17 00:00:00 2001 From: Maurizio Farmi Date: Thu, 23 Apr 2026 17:57:10 +0200 Subject: [PATCH 3/8] Revert "Aligned gltfast implementations after update" This reverts commit f07b9daac818cc2f934755a8627950c7cffd8f40. --- .../Scripts/Loading/BinaryDownloadProvider.cs | 18 ++++++++++++++---- .../Scripts/Loading/ToonMaterialGenerator.cs | 14 ++++++-------- Packages/manifest.json | 2 +- Packages/packages-lock.json | 17 ++++++++--------- 4 files changed, 29 insertions(+), 22 deletions(-) diff --git a/Assets/Scripts/Loading/BinaryDownloadProvider.cs b/Assets/Scripts/Loading/BinaryDownloadProvider.cs index 0a93122..4055835 100644 --- a/Assets/Scripts/Loading/BinaryDownloadProvider.cs +++ b/Assets/Scripts/Loading/BinaryDownloadProvider.cs @@ -26,7 +26,7 @@ public BinaryDownloadProvider(Dictionary content) /// /// URI to request /// Object representing the request - public async Task Request(Uri url) + public async Task RequestAsync(Uri url) { var req = new AwaitableDownload(url); await req.WaitAsync(); @@ -39,7 +39,7 @@ public async Task Request(Uri url) /// URI to request /// If true, resulting texture is not CPU readable (uses less memory) /// Object representing the request - public async Task RequestTexture(Uri url, bool nonReadable) + public async Task RequestTextureAsync(Uri url, bool nonReadable, bool forceLinear) { var fileName = Path.GetFileName(url.LocalPath); var file = _content[fileName]; @@ -159,8 +159,6 @@ public void Dispose() public class AwaitableTextureDownload : AwaitableDownload, ITextureDownload { - public Texture2D Texture { get; } - /// /// Parameter-less constructor, required for inheritance. /// @@ -194,5 +192,17 @@ void Init(Uri url, bool nonReadable) m_Request = CreateRequest(url, nonReadable); m_AsyncOperation = m_Request.SendWebRequest(); } + + /// + public IDisposableTexture GetTexture(bool linear) + { + return (m_Request?.downloadHandler as DownloadHandlerTexture)?.texture.ToDisposableTexture(); + } + } + + internal static class DisposableTextureExtensions + { + internal static IDisposableTexture ToDisposableTexture(this Texture2D texture2D) => + new NonReusableTexture(texture2D); } } \ No newline at end of file diff --git a/Assets/Scripts/Loading/ToonMaterialGenerator.cs b/Assets/Scripts/Loading/ToonMaterialGenerator.cs index 4d46591..dbd1701 100644 --- a/Assets/Scripts/Loading/ToonMaterialGenerator.cs +++ b/Assets/Scripts/Loading/ToonMaterialGenerator.cs @@ -2,10 +2,8 @@ using GLTFast; using GLTFast.Logging; using GLTFast.Materials; -using GLTFast.Schema; using UnityEngine; using UnityEngine.Rendering; -using Material = UnityEngine.Material; namespace Loading { @@ -37,7 +35,7 @@ public ToonMaterialGenerator(AvatarColors avatarColors) //_avatarColors = avatarColors; } - public Material GenerateMaterial(MaterialBase gltfMaterial, IGltfReadable gltf, + public Material GenerateMaterial(int materialIndex, GLTFast.Schema.Material gltfMaterial, IGltfReadable gltf, bool pointsSupport = false) { var isFacialFeature = IsFacialFeature(gltfMaterial.name); @@ -45,20 +43,20 @@ public Material GenerateMaterial(MaterialBase gltfMaterial, IGltfReadable gltf, { name = gltfMaterial.name }; // Base color and texture - var baseColor = gltfMaterial.PbrMetallicRoughness.BaseColor; + var baseColor = gltfMaterial.pbrMetallicRoughness.BaseColor; mat.SetColor(BASE_COLOR_ID, baseColor); - if (gltfMaterial.PbrMetallicRoughness.BaseColorTexture.index != -1) + if (gltfMaterial.pbrMetallicRoughness.baseColorTexture.index != -1) { - mat.SetTexture(MAIN_TEX_ID, gltf.GetTexture(gltfMaterial.PbrMetallicRoughness.BaseColorTexture.index)); + mat.SetTexture(MAIN_TEX_ID, gltf.GetTexture(gltfMaterial.pbrMetallicRoughness.baseColorTexture.index)); } // Emission mat.SetColor(EMISSIVE_COLOR_ID, gltfMaterial.Emissive * EMISSIVE_MAGIC_NUMBER); - if (gltfMaterial.EmissiveTexture.index != -1) + if (gltfMaterial.emissiveTexture.index != -1) { - mat.SetTexture(EMISSIVE_TEX_ID, gltf.GetTexture(gltfMaterial.EmissiveTexture.index)); + mat.SetTexture(EMISSIVE_TEX_ID, gltf.GetTexture(gltfMaterial.emissiveTexture.index)); } // Alpha diff --git a/Packages/manifest.json b/Packages/manifest.json index 14afa25..ea7798a 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -1,6 +1,6 @@ { "dependencies": { - "com.atteneder.gltfast": "https://github.com/atteneder/glTFast.git", + "com.atteneder.gltfast": "https://github.com/decentraland/unity-gltf.git", "com.decentraland.unity-shared-dependencies": "git@github.com:decentraland/unity-shared-dependencies.git#feat/update-to-gltfast-6.16.1", "com.unity.cinemachine": "3.1.4", "com.unity.ide.rider": "3.0.38", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index 0cadd92..3575023 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -1,24 +1,23 @@ { "dependencies": { "com.atteneder.gltfast": { - "version": "https://github.com/atteneder/glTFast.git", + "version": "https://github.com/decentraland/unity-gltf.git", "depth": 0, "source": "git", "dependencies": { "com.unity.modules.jsonserialize": "1.0.0", "com.unity.modules.unitywebrequest": "1.0.0", "com.unity.mathematics": "1.2.6", - "com.unity.burst": "1.8.24", - "com.unity.collections": "1.2.4" + "com.unity.burst": "1.6.6" }, - "hash": "3360ccae0a91cbc1bafb32d4aa0132fc82add141" + "hash": "e4587451389b6cf93b084ae434d0cc3d32a45076" }, "com.decentraland.unity-shared-dependencies": { - "version": "git@github.com:decentraland/unity-shared-dependencies.git#feat/update-to-gltfast-6.16.1", + "version": "git@github.com:decentraland/unity-shared-dependencies.git#main", "depth": 0, "source": "git", "dependencies": {}, - "hash": "e7dc3286806e732f4388754ec17df23b81a8d89e" + "hash": "da34743b0e4c01191c72f58af715bf2c0dfc2d67" }, "com.unity.burst": { "version": "1.8.27", @@ -42,7 +41,7 @@ }, "com.unity.collections": { "version": "2.6.2", - "depth": 1, + "depth": 2, "source": "registry", "dependencies": { "com.unity.burst": "1.8.23", @@ -95,7 +94,7 @@ }, "com.unity.nuget.mono-cecil": { "version": "1.11.6", - "depth": 2, + "depth": 3, "source": "registry", "dependencies": {}, "url": "https://packages.unity.com" @@ -178,7 +177,7 @@ }, "com.unity.test-framework.performance": { "version": "3.2.0", - "depth": 2, + "depth": 3, "source": "registry", "dependencies": { "com.unity.test-framework": "1.1.33", From 04432f83d4bc1008e14e840abc20992332bde957 Mon Sep 17 00:00:00 2001 From: Maurizio Farmi Date: Thu, 23 Apr 2026 17:57:16 +0200 Subject: [PATCH 4/8] Revert "updated shared dependencies dependency" This reverts commit 9faf77f61a9215d216292d80fda8be6d24f6ea56. --- Packages/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages/manifest.json b/Packages/manifest.json index ea7798a..49940d5 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -1,7 +1,7 @@ { "dependencies": { "com.atteneder.gltfast": "https://github.com/decentraland/unity-gltf.git", - "com.decentraland.unity-shared-dependencies": "git@github.com:decentraland/unity-shared-dependencies.git#feat/update-to-gltfast-6.16.1", + "com.decentraland.unity-shared-dependencies": "git@github.com:decentraland/unity-shared-dependencies.git#main", "com.unity.cinemachine": "3.1.4", "com.unity.ide.rider": "3.0.38", "com.unity.ide.visualstudio": "2.0.26", From dfbd5226935c3c72e6526444da6b84bd7cc1caa1 Mon Sep 17 00:00:00 2001 From: Maurizio Farmi Date: Mon, 27 Apr 2026 09:44:26 +0200 Subject: [PATCH 5/8] Updated dependencies --- Packages/manifest.json | 2 +- Packages/packages-lock.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Packages/manifest.json b/Packages/manifest.json index 49940d5..d93cfca 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -1,7 +1,7 @@ { "dependencies": { "com.atteneder.gltfast": "https://github.com/decentraland/unity-gltf.git", - "com.decentraland.unity-shared-dependencies": "git@github.com:decentraland/unity-shared-dependencies.git#main", + "com.decentraland.unity-shared-dependencies": "git@github.com:decentraland/unity-shared-dependencies.git#chore/revert-gltfast-update", "com.unity.cinemachine": "3.1.4", "com.unity.ide.rider": "3.0.38", "com.unity.ide.visualstudio": "2.0.26", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index 3575023..f8dccf6 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -13,11 +13,11 @@ "hash": "e4587451389b6cf93b084ae434d0cc3d32a45076" }, "com.decentraland.unity-shared-dependencies": { - "version": "git@github.com:decentraland/unity-shared-dependencies.git#main", + "version": "git@github.com:decentraland/unity-shared-dependencies.git#chore/revert-gltfast-update", "depth": 0, "source": "git", "dependencies": {}, - "hash": "da34743b0e4c01191c72f58af715bf2c0dfc2d67" + "hash": "a2fea2f463972ca32760b3519da979358f0d0359" }, "com.unity.burst": { "version": "1.8.27", From 6268fd8a1b350fe74dafcc2f8aba7b4c6829415a Mon Sep 17 00:00:00 2001 From: Maurizio Farmi Date: Mon, 4 May 2026 17:36:22 +0200 Subject: [PATCH 6/8] Updated shared-dependencies to 1.1.8 (rollbacked gltfast signatures to 5.0.0) --- Packages/manifest.json | 2 +- Packages/packages-lock.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Packages/manifest.json b/Packages/manifest.json index d93cfca..49940d5 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -1,7 +1,7 @@ { "dependencies": { "com.atteneder.gltfast": "https://github.com/decentraland/unity-gltf.git", - "com.decentraland.unity-shared-dependencies": "git@github.com:decentraland/unity-shared-dependencies.git#chore/revert-gltfast-update", + "com.decentraland.unity-shared-dependencies": "git@github.com:decentraland/unity-shared-dependencies.git#main", "com.unity.cinemachine": "3.1.4", "com.unity.ide.rider": "3.0.38", "com.unity.ide.visualstudio": "2.0.26", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index f8dccf6..bdae1ce 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -13,11 +13,11 @@ "hash": "e4587451389b6cf93b084ae434d0cc3d32a45076" }, "com.decentraland.unity-shared-dependencies": { - "version": "git@github.com:decentraland/unity-shared-dependencies.git#chore/revert-gltfast-update", + "version": "git@github.com:decentraland/unity-shared-dependencies.git#main", "depth": 0, "source": "git", "dependencies": {}, - "hash": "a2fea2f463972ca32760b3519da979358f0d0359" + "hash": "f040030e82c51bdddce67ae18149e22b5b4c4c0d" }, "com.unity.burst": { "version": "1.8.27", From ff1c49b82d58c4c0771b6f446895ffcdba89b877 Mon Sep 17 00:00:00 2001 From: Maurizio Farmi Date: Mon, 11 May 2026 09:18:57 +0200 Subject: [PATCH 7/8] Updated packages-lock.json --- Packages/packages-lock.json | 40 +++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index 0d84884..d013168 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -20,7 +20,7 @@ "hash": "f040030e82c51bdddce67ae18149e22b5b4c4c0d" }, "com.unity.burst": { - "version": "1.8.28", + "version": "1.8.27", "depth": 1, "source": "registry", "dependencies": { @@ -40,16 +40,17 @@ "url": "https://packages.unity.com" }, "com.unity.collections": { - "version": "6.4.0", - "depth": 1, - "source": "builtin", + "version": "2.6.2", + "depth": 2, + "source": "registry", "dependencies": { "com.unity.burst": "1.8.23", "com.unity.mathematics": "1.3.2", - "com.unity.nuget.mono-cecil": "1.11.5", "com.unity.test-framework": "1.4.6", + "com.unity.nuget.mono-cecil": "1.11.5", "com.unity.test-framework.performance": "3.0.3" - } + }, + "url": "https://packages.unity.com" }, "com.unity.ext.nunit": { "version": "2.0.5", @@ -106,7 +107,7 @@ "url": "https://packages.unity.com" }, "com.unity.render-pipelines.core": { - "version": "17.4.0", + "version": "17.3.0", "depth": 1, "source": "builtin", "dependencies": { @@ -114,26 +115,27 @@ "com.unity.mathematics": "1.3.2", "com.unity.ugui": "2.0.0", "com.unity.collections": "2.4.3", + "com.unity.modules.physics": "1.0.0", "com.unity.modules.terrain": "1.0.0", "com.unity.modules.jsonserialize": "1.0.0" } }, "com.unity.render-pipelines.universal": { - "version": "17.4.0", + "version": "17.3.0", "depth": 0, "source": "builtin", "dependencies": { - "com.unity.render-pipelines.core": "17.4.0", - "com.unity.shadergraph": "17.4.0", - "com.unity.render-pipelines.universal-config": "17.4.0" + "com.unity.render-pipelines.core": "17.3.0", + "com.unity.shadergraph": "17.3.0", + "com.unity.render-pipelines.universal-config": "17.0.3" } }, "com.unity.render-pipelines.universal-config": { - "version": "17.4.0", + "version": "17.0.3", "depth": 1, "source": "builtin", "dependencies": { - "com.unity.render-pipelines.core": "17.4.0" + "com.unity.render-pipelines.core": "17.0.3" } }, "com.unity.searcher": { @@ -151,16 +153,16 @@ "url": "https://packages.unity.com" }, "com.unity.shadergraph": { - "version": "17.4.0", + "version": "17.3.0", "depth": 1, "source": "builtin", "dependencies": { - "com.unity.render-pipelines.core": "17.4.0", + "com.unity.render-pipelines.core": "17.3.0", "com.unity.searcher": "4.9.3" } }, "com.unity.splines": { - "version": "2.8.3", + "version": "2.8.2", "depth": 1, "source": "registry", "dependencies": { @@ -200,12 +202,12 @@ } }, "com.unity.visualeffectgraph": { - "version": "17.4.0", + "version": "17.3.0", "depth": 0, "source": "builtin", "dependencies": { - "com.unity.shadergraph": "17.4.0", - "com.unity.render-pipelines.core": "17.4.0" + "com.unity.shadergraph": "17.3.0", + "com.unity.render-pipelines.core": "17.3.0" } }, "decentraland.renderfeatures": { From dc004b7812a22756468b0d1be1b432a7916b99bc Mon Sep 17 00:00:00 2001 From: Maurizio Farmi Date: Mon, 11 May 2026 09:34:53 +0200 Subject: [PATCH 8/8] Removed DclGameObjectInstantiator since it has been removed from unity-gltf --- Assets/Scripts/Loading/GLTFLoader.cs | 2 +- Packages/packages-lock.json | 38 +++++++++++++--------------- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/Assets/Scripts/Loading/GLTFLoader.cs b/Assets/Scripts/Loading/GLTFLoader.cs index 4cb543f..ce43f48 100644 --- a/Assets/Scripts/Loading/GLTFLoader.cs +++ b/Assets/Scripts/Loading/GLTFLoader.cs @@ -42,7 +42,7 @@ public static async Task LoadModel(BodyShape bodyShape, EntityDefin root.SetActive(false); root.transform.SetParent(parent, false); - var instantiator = new DclGameObjectInstantiator(importer, root.transform); + var instantiator = new GameObjectInstantiator(importer, root.transform); await importer.InstantiateSceneAsync(instantiator); Sanitize(root.transform); diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index d013168..91437b8 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -20,7 +20,7 @@ "hash": "f040030e82c51bdddce67ae18149e22b5b4c4c0d" }, "com.unity.burst": { - "version": "1.8.27", + "version": "1.8.28", "depth": 1, "source": "registry", "dependencies": { @@ -40,17 +40,16 @@ "url": "https://packages.unity.com" }, "com.unity.collections": { - "version": "2.6.2", + "version": "6.4.0", "depth": 2, - "source": "registry", + "source": "builtin", "dependencies": { "com.unity.burst": "1.8.23", "com.unity.mathematics": "1.3.2", - "com.unity.test-framework": "1.4.6", "com.unity.nuget.mono-cecil": "1.11.5", + "com.unity.test-framework": "1.4.6", "com.unity.test-framework.performance": "3.0.3" - }, - "url": "https://packages.unity.com" + } }, "com.unity.ext.nunit": { "version": "2.0.5", @@ -107,7 +106,7 @@ "url": "https://packages.unity.com" }, "com.unity.render-pipelines.core": { - "version": "17.3.0", + "version": "17.4.0", "depth": 1, "source": "builtin", "dependencies": { @@ -115,27 +114,26 @@ "com.unity.mathematics": "1.3.2", "com.unity.ugui": "2.0.0", "com.unity.collections": "2.4.3", - "com.unity.modules.physics": "1.0.0", "com.unity.modules.terrain": "1.0.0", "com.unity.modules.jsonserialize": "1.0.0" } }, "com.unity.render-pipelines.universal": { - "version": "17.3.0", + "version": "17.4.0", "depth": 0, "source": "builtin", "dependencies": { - "com.unity.render-pipelines.core": "17.3.0", - "com.unity.shadergraph": "17.3.0", - "com.unity.render-pipelines.universal-config": "17.0.3" + "com.unity.render-pipelines.core": "17.4.0", + "com.unity.shadergraph": "17.4.0", + "com.unity.render-pipelines.universal-config": "17.4.0" } }, "com.unity.render-pipelines.universal-config": { - "version": "17.0.3", + "version": "17.4.0", "depth": 1, "source": "builtin", "dependencies": { - "com.unity.render-pipelines.core": "17.0.3" + "com.unity.render-pipelines.core": "17.4.0" } }, "com.unity.searcher": { @@ -153,16 +151,16 @@ "url": "https://packages.unity.com" }, "com.unity.shadergraph": { - "version": "17.3.0", + "version": "17.4.0", "depth": 1, "source": "builtin", "dependencies": { - "com.unity.render-pipelines.core": "17.3.0", + "com.unity.render-pipelines.core": "17.4.0", "com.unity.searcher": "4.9.3" } }, "com.unity.splines": { - "version": "2.8.2", + "version": "2.8.3", "depth": 1, "source": "registry", "dependencies": { @@ -202,12 +200,12 @@ } }, "com.unity.visualeffectgraph": { - "version": "17.3.0", + "version": "17.4.0", "depth": 0, "source": "builtin", "dependencies": { - "com.unity.shadergraph": "17.3.0", - "com.unity.render-pipelines.core": "17.3.0" + "com.unity.shadergraph": "17.4.0", + "com.unity.render-pipelines.core": "17.4.0" } }, "decentraland.renderfeatures": {