Skip to content

Commit 7f31d43

Browse files
committed
com.atteneder.gltfast Release 6.15.1
1 parent e35dbd7 commit 7f31d43

37 files changed

+987
-685
lines changed

.github/workflows/dotnet-format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
image: europe-docker.pkg.dev/unity-cds-services-prd/ds-docker/unity-ci-format:latest@sha256:73b38fb713c2b95a142ffe870c6e130edda9d3aad61adadfda24fe985973f6b1
6262
steps:
6363
- name: Checkout
64-
uses: actions/checkout@v5
64+
uses: actions/checkout@v6
6565
with:
6666
ref: ${{ inputs.GIT_BRANCH }}
6767
filter: blob:none

CHANGELOG.md

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,42 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [6.15.1] - 2025-12-09
8+
9+
### Added
10+
- Assigned glTF logo to [GltfEntityAsset](xref:GLTFast.GltfEntityAsset) component.
11+
- (Test) Test glTF asset *CylinderWithMaterial* that's procedurally generated at runtime.
12+
- (Test) Tests for documentation examples.
13+
- (Test) `OpenGltfScene` improvements.
14+
- Refactored to use custom load method.
15+
- Load method option to choose between loading from file or URI.
16+
- Scene index option.
17+
- Informative console logs with file path/URI and load time.
18+
- Now works at runtime as well (without file dialog).
19+
- Re-positions camera so that the loaded glTF scene is framed.
20+
- Can load via [EntityInstantiator](xref:GLTFast.EntityInstantiator).
21+
22+
### Changed
23+
- (Entities) Entities of a scene are grouped via `LinkedEntityGroup`.
24+
- (Performance) Import mesh indices as unsigned integers and don't convert to signed integers anymore.
25+
- (Performance) Limited copy buffer size, so that garbage allocations do not scale with glTF-Binary content size anymore (when loading from file or `Stream`).
26+
- (Performance) Large glTF-Binary content is now loaded into memory in smaller chunks, which keeps the frame rate smooth (when loading from file or `Stream`).
27+
- (Performance) Shift loading glTF-Binary from stream to memory to a background thread, if it won't likely fit within the current update loop.
28+
- (Performance) glTF-Binary buffers are not initialized with zeros before population.
29+
- [meshoptimizer mesh compression for Unity] minimum required version was raised to 0.2.0-exp.1.
30+
- (Test) Updated tests dependency Graphics Test Framework (com.unity.testframework.graphics) to 8.13.1-exp.1.
31+
32+
### Fixed
33+
- Returning a proper error for glTF-Binary with a content length shorter than what's depicted in the header.
34+
- NotSupportedException when loading a glTF-Binary file with excess length (fixes [#786](https://github.com/atteneder/glTFast/issues/786)).
35+
- (Documentation) Clarified how to add export shader variants.
36+
- (Test) Fixed generated test glTFs by exporting them in synchronous mode (only available internally).
37+
- (Importer) Synchronization Context is now properly reset after an exception (thanks [Bruno](https://github.com/bruno1308) for [#29](https://github.com/Unity-Technologies/com.unity.cloud.gltfast/pull/29)).
38+
- Removed compiler warning when `GLTFAST_SAFE` scripting define is active.
39+
- (Test) Stabilize tests by executing `LogAssert.Expect` before actual tests.
40+
- (Entities) Sub-meshes are rendered properly.
41+
- (Test) Tests destroy the glTF entities before disposing meshes/materials to avoid batch rendering errors.
42+
743
## [6.15.0] - 2025-11-17
844

945
### Added
@@ -42,6 +78,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4278

4379
### Removed
4480
- Broken consistency check between image data URI mediatype against image's mimeType.
81+
- Support for obsolete Hybrid Renderer (com.unity.rendering.hybrid).
4582

4683
## [6.14.1] - 2025-09-30
4784

@@ -145,7 +182,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
145182
## [6.10.2] - 2025-02-03
146183

147184
### Added
148-
- (Importer) *Textures Readable* checkbox in the imnporter inspector (*Textures* section).
185+
- (Importer) *Textures Readable* checkbox in the importer inspector (*Textures* section).
149186
- (Export) Error message when attempting to export with unsupported meshopt compression.
150187
- (Tests) Runtime import performance tests.
151188
- (Tests) Procedurally generated glTFs for testing purpose.
@@ -370,7 +407,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
370407
- All missing extensions are logged (not just the first one).
371408
- There's now a single message per missing package.
372409
- Depending on whether that extension is required the message's type is warning or error.
373-
- Added explicit message when [*meshoptimizer decompression for Unity*][meshoptUnity] is missing.
410+
- Added explicit message when [meshoptimizer mesh compression for Unity] is missing.
374411

375412
## [6.3.0] - 2024-03-27
376413

@@ -1482,7 +1519,7 @@ This release contains multiple breaking changes. Please read the [upgrade guide]
14821519
[Draco for Unity]: https://docs.unity3d.com/Packages/com.unity.cloud.draco@latest
14831520
[DracoUnity]: https://github.com/atteneder/DracoUnity
14841521
[PolySpatialVisionOS]: https://docs.unity3d.com/Packages/com.unity.polyspatial.visionos@latest/
1485-
[meshoptUnity]: https://docs.unity3d.com/Packages/com.unity.meshopt.decompress@latest/
1522+
[meshoptimizer mesh compression for Unity]: https://docs.unity3d.com/Packages/com.unity.meshopt.decompress@latest/
14861523
[aurorahcx]: https://github.com/aurorahcx
14871524
[Battlehub0x]: https://github.com/Battlehub0x
14881525
[Bersaelor]: https://github.com/Bersaelor

DocExamples/AssemblyInfo.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// SPDX-FileCopyrightText: 2025 Unity Technologies and the glTFast authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
using System.Runtime.CompilerServices;
5+
6+
[assembly: InternalsVisibleTo("glTFast.Tests")]

DocExamples/AssemblyInfo.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DocExamples/CustomGltfImport.cs

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,35 @@
11
// SPDX-FileCopyrightText: 2023 Unity Technologies and the glTFast authors
22
// SPDX-License-Identifier: Apache-2.0
33

4-
using GLTFast.Logging;
5-
64
#if NEWTONSOFT_JSON
75
namespace GLTFast.Documentation.Examples
86
{
97
#region CustomGltfImport
10-
using GLTFast;
11-
using Addons;
128
using System;
9+
using System.Threading.Tasks;
10+
using Addons;
11+
using GLTFast;
12+
using GLTFast.Logging;
1313
using UnityEngine;
1414
using GltfImport = GLTFast.Newtonsoft.GltfImport;
1515

1616
class CustomGltfImport : MonoBehaviour
1717
{
1818
// Path to the gltf asset to be imported
19-
public string Uri;
19+
public string uri;
2020

2121
async void Start()
22+
{
23+
await LoadGltf();
24+
}
25+
26+
public async Task LoadGltf()
2227
{
2328
try
2429
{
2530
ImportAddonRegistry.RegisterImportAddon(new MyAddon());
2631
var gltfImport = new GltfImport(logger:new ConsoleLogger());
27-
await gltfImport.Load(Uri);
32+
await gltfImport.Load(uri);
2833
await gltfImport.InstantiateMainSceneAsync(transform);
2934
}
3035
catch (Exception e)
@@ -33,8 +38,9 @@ async void Start()
3338
}
3439
}
3540

36-
public class MyAddon : ImportAddon<MyAddonInstance> { }
37-
public class MyAddonInstance : ImportAddonInstance
41+
class MyAddon : ImportAddon<MyAddonInstance> { }
42+
43+
class MyAddonInstance : ImportAddonInstance
3844
{
3945
GltfImport m_GltfImport;
4046

@@ -55,7 +61,7 @@ public override void Inject(IInstantiator instantiator)
5561
var goInstantiator = instantiator as GameObjectInstantiator;
5662
if (goInstantiator == null)
5763
return;
58-
var _ = new MyInstantiatorAddon(m_GltfImport, goInstantiator);
64+
_ = new MyInstantiatorAddon(m_GltfImport, goInstantiator);
5965
}
6066

6167
public override bool SupportsGltfExtension(string extensionName)
@@ -67,8 +73,8 @@ public override bool SupportsGltfExtension(string extensionName)
6773

6874
class MyInstantiatorAddon
6975
{
70-
GltfImport m_GltfImport;
71-
GameObjectInstantiator m_Instantiator;
76+
readonly GltfImport m_GltfImport;
77+
readonly GameObjectInstantiator m_Instantiator;
7278

7379
public MyInstantiatorAddon(GltfImport gltfImport, GameObjectInstantiator instantiator)
7480
{

DocExamples/ExportSamples.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
using System.Threading.Tasks;
5-
using UnityEngine.Serialization;
65

76
namespace GLTFast.Documentation.Examples
87
{
@@ -13,12 +12,9 @@ namespace GLTFast.Documentation.Examples
1312

1413
class ExportSamples : MonoBehaviour
1514
{
15+
public string destinationFilePath;
1616

17-
[FormerlySerializedAs("path")]
18-
[SerializeField]
19-
string destinationFilePath;
20-
21-
async Task AdvancedExport()
17+
public async Task AdvancedExport()
2218
{
2319
#region AdvancedExport
2420

@@ -82,7 +78,7 @@ async Task AdvancedExport()
8278
#endregion
8379
}
8480

85-
void ExportSettingsDraco()
81+
public static ExportSettings ExportSettingsDraco()
8682
{
8783
#region ExportSettingsDraco
8884
// ExportSettings provides generic export settings
@@ -97,14 +93,15 @@ void ExportSettingsDraco()
9793
}
9894
};
9995
#endregion
96+
return exportSettings;
10097
}
10198

10299
async void Start()
103100
{
104101
await LocalTransform();
105102
}
106103

107-
async Task LocalTransform()
104+
public async Task LocalTransform()
108105
{
109106
#region LocalTransform
110107
var export = new GameObjectExport();

DocExamples/LoadGltfFromMemory.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,16 @@ async Task LoadGltfFile()
4242
}
4343
#endregion
4444

45-
void LoadViaComponent()
45+
public void LoadViaComponent()
4646
{
4747
#region LoadViaComponent
4848
var gltf = gameObject.AddComponent<GltfAsset>();
4949
gltf.Url = "https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Assets/main/Models/Duck/glTF/Duck.gltf";
5050
#endregion
51+
gltf.LoadOnStartup = false;
5152
}
5253

53-
async Task ImportSettings()
54+
public static async Task ImportSettings(string filePath)
5455
{
5556
#region ImportSettings
5657
var gltf = new GltfImport();
@@ -63,7 +64,7 @@ async Task ImportSettings()
6364
NodeNameMethod = NameImportMethod.OriginalUnique
6465
};
6566
// Load the glTF and pass along the settings
66-
var success = await gltf.Load("file:///path/to/file.gltf", settings);
67+
var success = await gltf.Load(filePath, settings);
6768

6869
if (success)
6970
{
@@ -77,12 +78,12 @@ async Task ImportSettings()
7778
#endregion
7879
}
7980

80-
async Task Instantiation()
81+
public async Task Instantiation()
8182
{
8283
#region Instantiation
8384
// First step: load glTF
8485
var gltf = new GLTFast.GltfImport();
85-
var success = await gltf.Load("file:///path/to/file.gltf");
86+
var success = await gltf.Load(filePath);
8687

8788
if (success)
8889
{
@@ -111,16 +112,15 @@ async Task Instantiation()
111112
}
112113

113114
#if UNITY_ANIMATION
114-
async Task SceneInstanceAccess()
115+
public async Task SceneInstanceAccess()
115116
{
116117
#region SceneInstanceAccess
117118
var gltfImport = new GltfImport();
118-
await gltfImport.Load("test.gltf");
119+
await gltfImport.Load(filePath);
119120
var instantiator = new GameObjectInstantiator(gltfImport, transform);
120121
var success = await gltfImport.InstantiateMainSceneAsync(instantiator);
121122
if (success)
122123
{
123-
124124
// Get the SceneInstance to access the instance's properties
125125
var sceneInstance = instantiator.SceneInstance;
126126

@@ -150,17 +150,17 @@ async Task SceneInstanceAccess()
150150
}
151151
#endif // UNITY_ANIMATION
152152

153-
async Task CustomDeferAgent()
153+
public async Task CustomDeferAgent()
154154
{
155155
var manyUrls = new[]
156156
{
157157
"https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Assets/main/Models/Duck/glTF/Duck.gltf"
158158
};
159159
#region CustomDeferAgent
160160
// Recommended: Use a common defer agent across multiple GltfImport instances!
161-
// For a stable frame rate:
161+
// TimeBudgetPerFrameDeferAgent for a stable frame rate:
162162
IDeferAgent deferAgent = gameObject.AddComponent<TimeBudgetPerFrameDeferAgent>();
163-
// Or for faster loading:
163+
// Or alternatively, UninterruptedDeferAgent for low latency loading:
164164
deferAgent = new UninterruptedDeferAgent();
165165

166166
var tasks = new List<Task>();

0 commit comments

Comments
 (0)