Skip to content

Commit efdfb16

Browse files
committed
feat: Add support for importing 64-bit GLB version 3 files
1 parent 4fe3391 commit efdfb16

14 files changed

Lines changed: 144 additions & 75 deletions

File tree

Packages/com.unity.cloud.gltfast.tests/Assets~/Unity/FormatVariants/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Textured cube in three format variants:
66

77
1. glTF (JSON) with separate buffer and texture files.
8-
2. glTF-Binary (.glb)
8+
2. glTF-Binary (.glb) version 2 and version 3.
99
3. glTF (JSON) with embedded buffer and texture.
1010

1111
## Legal
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:3044834b5e52b7c3c851a09a2b32642c27c75d84f549419370051604bbc7a2f2
3+
size 2636

Packages/com.unity.cloud.gltfast.tests/Tests/Editor/GltfImporterTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public void OneTimeTearDown()
3636
AssetDatabase.Refresh();
3737
}
3838

39-
[GltfTestCase("glTF-test-models", 65)]
39+
[GltfTestCase("glTF-test-models", 66)]
4040
public IEnumerator GltfTestModels(GltfTestCaseSet testCaseSet, GltfTestCase testCase)
4141
{
4242
#if GLTFAST_EDITOR_IMPORT_OFF

Packages/com.unity.cloud.gltfast.tests/Tests/Runtime/Scripts/Import/AssetsTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public void OneTimeTearDown()
2626
m_Runner.Dispose();
2727
}
2828

29-
[GltfTestCase("glTF-test-models", 65)]
29+
[GltfTestCase("glTF-test-models", 66)]
3030
public IEnumerator GltfTestModels(GltfTestCaseSet testCaseSet, GltfTestCase testCase)
3131
{
3232
yield return AsyncWrapper.WaitForTask(m_Runner.Run(testCaseSet, testCase));

Packages/com.unity.cloud.gltfast.tests/Tests/Runtime/Scripts/Import/CancellationTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public IEnumerator CancelImport_SampleAssets(GltfTestCaseSet testCaseSet, GltfTe
4040
yield return CancellationTestInternal(testCaseSet, testCase, k_MaxIterations);
4141
}
4242

43-
[GltfTestCase("glTF-test-models", 65)]
43+
[GltfTestCase("glTF-test-models", 66)]
4444
public IEnumerator CancelImport_TestModels(GltfTestCaseSet testCaseSet, GltfTestCase testCase)
4545
{
4646
yield return CancellationTestInternal(testCaseSet, testCase, k_MaxIterations);

Packages/com.unity.cloud.gltfast.tests/Tests/Runtime/Scripts/Import/MemoryTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public IEnumerator LoadUnload_SampleAssets(GltfTestCaseSet testCaseSet, GltfTest
6969
yield return GetAllObjectsTestInternal(LoadFileInternal(testCaseSet, testCase), true);
7070
}
7171

72-
[GltfTestCase("glTF-test-models", 65)]
72+
[GltfTestCase("glTF-test-models", 66)]
7373
public IEnumerator LoadUnload_TestModels(GltfTestCaseSet testCaseSet, GltfTestCase testCase)
7474
{
7575
yield return GetAllObjectsTestInternal(LoadFileInternal(testCaseSet, testCase), true);

Packages/com.unity.cloud.gltfast.tests/Tests/Runtime/TestCaseSets/glTF-test-models.asset

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ MonoBehaviour:
2323
- relativeUri: EightTexcoords/EightTexcoords.gltf
2424
expectLoadFail: 0
2525
expectInstantiationFail: 0
26-
expectedLogCodes: 34000000
26+
expectedLogCodes: 36000000
2727
requiredExtensions:
2828
- relativeUri: EmbedBufferInvalid/EmbedBufferInvalid.gltf
2929
expectLoadFail: 1
@@ -63,7 +63,7 @@ MonoBehaviour:
6363
- relativeUri: NineTexcoords/NineTexcoords.gltf
6464
expectLoadFail: 0
6565
expectInstantiationFail: 0
66-
expectedLogCodes: 34000000
66+
expectedLogCodes: 36000000
6767
requiredExtensions:
6868
- relativeUri: NoNormals/NoNormals.gltf
6969
expectLoadFail: 0
@@ -128,12 +128,12 @@ MonoBehaviour:
128128
- relativeUri: Bounds/BoundsMissing/BoundsMissing.gltf
129129
expectLoadFail: 0
130130
expectInstantiationFail: 0
131-
expectedLogCodes: 20000000
131+
expectedLogCodes: 22000000
132132
requiredExtensions:
133133
- relativeUri: DracoSpecialCases/glTF/DracoSpecialCases.gltf
134134
expectLoadFail: 0
135135
expectInstantiationFail: 0
136-
expectedLogCodes: 2000000034000000
136+
expectedLogCodes: 2200000036000000
137137
requiredExtensions: 00000000
138138
- relativeUri: FormatVariants/glTF/FormatVariants.gltf
139139
expectLoadFail: 0
@@ -145,6 +145,11 @@ MonoBehaviour:
145145
expectInstantiationFail: 0
146146
expectedLogCodes:
147147
requiredExtensions:
148+
- relativeUri: FormatVariants/glTF-Binary/FormatVariantsGLB3.glb
149+
expectLoadFail: 0
150+
expectInstantiationFail: 0
151+
expectedLogCodes:
152+
requiredExtensions:
148153
- relativeUri: FormatVariants/glTF-Embedded/FormatVariants.gltf
149154
expectLoadFail: 0
150155
expectInstantiationFail: 0

Packages/com.unity.cloud.gltfast/Runtime/Scripts/GlbBinChunk.cs renamed to Packages/com.unity.cloud.gltfast/Runtime/Scripts/GltfBufferRange.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55

66
namespace GLTFast
77
{
8-
readonly struct GlbBinChunk
8+
readonly struct GltfBufferRange
99
{
10-
public int Start { get; }
10+
public long Start { get; }
1111

12-
public uint Length { get; }
12+
public long Length { get; }
1313

14-
public GlbBinChunk(int start, uint length)
14+
public GltfBufferRange(long start, long length)
1515
{
1616
Start = start;
1717
Length = length;

Packages/com.unity.cloud.gltfast/Runtime/Scripts/GlbBinChunk.cs.meta renamed to Packages/com.unity.cloud.gltfast/Runtime/Scripts/GltfBufferRange.cs.meta

File renamed without changes.

0 commit comments

Comments
 (0)