From 68feb1d73589a91e23f5e9f181c822afe7d1b622 Mon Sep 17 00:00:00 2001 From: Andreas Atteneder Date: Thu, 8 Aug 2024 23:00:29 +0200 Subject: [PATCH 01/16] Post Release 6.7.1 (#172) --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c4b6a66..1b9b90d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] - + ## [6.7.1] - 2024-08-07 ### Fixed From 71e5b0ba999528b4d91459eb01a206ed50b00e97 Mon Sep 17 00:00:00 2001 From: Andreas Atteneder Date: Mon, 19 Aug 2024 14:54:46 +0200 Subject: [PATCH 02/16] fix(export): Writing to files on the web via IndexedDB now works. (#173) --- CHANGELOG.md | 3 +++ Runtime/Scripts/Export/GltfWriter.cs | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b9b90d7..4a307f9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] - +### Fixed +- (Export) Writing to files on the web via IndexedDB now works (fixes [#625](https://github.com/atteneder/glTFast/issues/625)) + ## [6.7.1] - 2024-08-07 ### Fixed diff --git a/Runtime/Scripts/Export/GltfWriter.cs b/Runtime/Scripts/Export/GltfWriter.cs index fa023aa0..ba07b3d6 100755 --- a/Runtime/Scripts/Export/GltfWriter.cs +++ b/Runtime/Scripts/Export/GltfWriter.cs @@ -587,7 +587,12 @@ async Task SaveAndDispose(Stream outStream, string bufferPath = null, stri outStream.Write(BitConverter.GetBytes((uint)ChunkFormat.Binary)); var ms = (MemoryStream)m_BufferStream; ms.WriteTo(outStream); +#if UNITY_WEBGL && !UNITY_EDITOR + // FlushAsync never finishes on the Web, so doing it in sync + ms.Flush(); +#else await ms.FlushAsync(); +#endif for (var i = 0; i < binPad; i++) { outStream.WriteByte(0); @@ -613,7 +618,12 @@ async Task WriteJsonToStream(Stream outStream) { var writer = new StreamWriter(outStream); m_Gltf.GltfSerialize(writer); +#if UNITY_WEBGL && !UNITY_EDITOR + // FlushAsync never finishes on the Web, so doing it in sync + writer.Flush(); +#else await writer.FlushAsync(); +#endif } void CertifyNotDisposed() From 4526df7d6234c0533b53666eb6dc15922719cdd7 Mon Sep 17 00:00:00 2001 From: Andreas Atteneder Date: Mon, 19 Aug 2024 14:55:07 +0200 Subject: [PATCH 03/16] feat: Added test for correct handling of Android JAR URIs (#174) --- CHANGELOG.md | 3 +++ Tests/Runtime/Scripts/UriHelperTest.cs | 2 ++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a307f9f..3eb91ada 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [6.7.1] - 2024-08-07 +### Added +- Test for correct handling of Android JAR URIs. + ### Fixed - (Export) Cases of corrupt glTFs when not all vertex attributes of a mesh were exported. - Alpha blending via baseColorTexture's alpha value is now in correct color space, less opaque and as a result consistent with other glTF viewers (affected URP and built-in render pipeline projects in linear color space; fixes [#700](https://github.com/atteneder/glTFast/issues/700)). diff --git a/Tests/Runtime/Scripts/UriHelperTest.cs b/Tests/Runtime/Scripts/UriHelperTest.cs index 6ca0abe2..d8e8acfe 100644 --- a/Tests/Runtime/Scripts/UriHelperTest.cs +++ b/Tests/Runtime/Scripts/UriHelperTest.cs @@ -64,6 +64,8 @@ public void GetBaseUriTest() Assert.AreEqual(new Uri("https://www.server.com/dir/sub/"), UriHelper.GetBaseUri(new Uri("https://www.server.com/dir/sub/file+test.gltf"))); Assert.AreEqual(new Uri("file:///dir/sub/"), UriHelper.GetBaseUri(new Uri("file:///dir/sub/file+test.gltf"))); + // Android paths + Assert.AreEqual(new Uri("jar:file:///dir/sub/"), UriHelper.GetBaseUri(new Uri("jar:file:///dir/sub/file.gltf"))); // relative paths var uri = new Uri("Assets/Some/Path/asset.glb", UriKind.Relative); From a483b5252407767812b41c8fff79ce514c4b4353 Mon Sep 17 00:00:00 2001 From: Andreas Atteneder Date: Tue, 20 Aug 2024 16:19:56 +0200 Subject: [PATCH 04/16] fix(test): Export test results are validated again. (#175) --- CHANGELOG.md | 1 + Tests/Runtime/Scripts/glTFast.Tests.asmdef | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3eb91ada..5f002c4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - (Export) Writing to files on the web via IndexedDB now works (fixes [#625](https://github.com/atteneder/glTFast/issues/625)) +- Export test results are validated again. ## [6.7.1] - 2024-08-07 diff --git a/Tests/Runtime/Scripts/glTFast.Tests.asmdef b/Tests/Runtime/Scripts/glTFast.Tests.asmdef index 52fc8710..d432d90a 100644 --- a/Tests/Runtime/Scripts/glTFast.Tests.asmdef +++ b/Tests/Runtime/Scripts/glTFast.Tests.asmdef @@ -7,6 +7,7 @@ "Unity.Collections", "Unity.Mathematics", "Unity.PerformanceTesting", + "com.unity.formats.gltf.validator.Editor", "glTFast", "glTFast.Export", "glTFast.Newtonsoft", @@ -26,6 +27,11 @@ "UNITY_INCLUDE_TESTS" ], "versionDefines": [ + { + "name": "com.unity.formats.gltf.validator", + "expression": "", + "define": "GLTF_VALIDATOR" + }, { "name": "com.unity.meshopt.decompress", "expression": "", @@ -83,4 +89,4 @@ } ], "noEngineReferences": false -} +} \ No newline at end of file From 372df6dc3aa227522e62368d8c80ce0cfbe54195 Mon Sep 17 00:00:00 2001 From: Andreas Atteneder Date: Wed, 21 Aug 2024 15:02:29 +0200 Subject: [PATCH 05/16] feat(import): Setting to create textures readable. (#177) This allows users to access resulting textures from their scripts. --- CHANGELOG.md | 3 +++ Runtime/Scripts/GltfImport.cs | 17 ++++++++++------- Runtime/Scripts/ImportSettings.cs | 13 +++++++++++++ 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f002c4d..af05ff39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] - +### Added +- (Import) Setting to create textures readable. This allows users to access resulting textures from their scripts. + ### Fixed - (Export) Writing to files on the web via IndexedDB now works (fixes [#625](https://github.com/atteneder/glTFast/issues/625)) - Export test results are validated again. diff --git a/Runtime/Scripts/GltfImport.cs b/Runtime/Scripts/GltfImport.cs index 16483637..7ed878da 100755 --- a/Runtime/Scripts/GltfImport.cs +++ b/Runtime/Scripts/GltfImport.cs @@ -1395,10 +1395,13 @@ void SetImageGamma(TextureInfoBase txtInfo) } #if !UNITY_VISIONOS - m_ImageReadable = new bool[m_Images.Length]; - for (int i = 0; i < m_Images.Length; i++) + if (!m_Settings.TexturesReadable) { - m_ImageReadable[i] = imageVariants[i] != null && imageVariants[i].Count > 1; + m_ImageReadable = new bool[m_Images.Length]; + for (var i = 0; i < m_Images.Length; i++) + { + m_ImageReadable[i] = imageVariants[i] != null && imageVariants[i].Count > 1; + } } #endif @@ -1450,7 +1453,7 @@ void SetImageGamma(TextureInfoBase txtInfo) #if UNITY_VISIONOS false, #else - !m_ImageReadable[imageIndex], + !m_Settings.TexturesReadable && !m_ImageReadable[imageIndex], #endif imgFormat == ImageFormat.Ktx ); @@ -1506,7 +1509,7 @@ async Task LoadImageFromBuffer(Task> decodeBufferTask, int #if UNITY_VISIONOS false #else - !m_ImageReadable[imageIndex] + !m_Settings.TexturesReadable && !m_ImageReadable[imageIndex] #endif ); m_Images[imageIndex] = txt; @@ -1587,7 +1590,7 @@ async Task WaitForTextureDownloads() #if UNITY_VISIONOS false #else - !m_ImageReadable[imageIndex] + !m_Settings.TexturesReadable && !m_ImageReadable[imageIndex] #endif ); #else @@ -2074,7 +2077,7 @@ async Task Prepare() #if UNITY_VISIONOS false #else - !m_ImageReadable[jh.imageIndex] + !m_Settings.TexturesReadable && !m_ImageReadable[jh.imageIndex] #endif ); #endif diff --git a/Runtime/Scripts/ImportSettings.cs b/Runtime/Scripts/ImportSettings.cs index de89acea..99ddac33 100644 --- a/Runtime/Scripts/ImportSettings.cs +++ b/Runtime/Scripts/ImportSettings.cs @@ -40,6 +40,15 @@ public bool GenerateMipMaps set => generateMipMaps = value; } + /// + /// Create textures readable. Increases memory consumption. + /// + public bool TexturesReadable + { + get => texturesReadable; + set => texturesReadable = value; + } + /// /// Defines the default minification filter mode for textures that have no such specification in data /// @@ -79,6 +88,10 @@ public int AnisotropicFilterLevel [Tooltip("Controls if mipmaps are created for imported textures.")] bool generateMipMaps; + [SerializeField] + [Tooltip("Create textures readable. Increases memory consumption.")] + bool texturesReadable; + [SerializeField] [Tooltip("Minification filter mode fallback if no mode was provided.")] Sampler.MinFilterMode defaultMinFilterMode = Sampler.MinFilterMode.Linear; From 990add17ec3a77e411ac6f19152275fda8138664 Mon Sep 17 00:00:00 2001 From: Andreas Atteneder Date: Fri, 23 Aug 2024 13:02:07 +0200 Subject: [PATCH 06/16] feat(export): Support exporting non-readable meshes. (#176) * known issue: Draco compression does not work with non-readable meshes. * known issue: Draco compression does not use optimized MeshDataArray overload anymore --- CHANGELOG.md | 2 + Documentation~/KnownIssues.md | 12 + Runtime/Scripts/Export/ExportJobs.cs | 77 +++++ Runtime/Scripts/Export/GltfWriter.cs | 320 +++++++++++++----- Runtime/Scripts/Export/IMeshData.cs | 40 +++ Runtime/Scripts/Export/IMeshData.cs.meta | 3 + Runtime/Scripts/Export/MeshDataProxy.cs | 62 ++++ Runtime/Scripts/Export/MeshDataProxy.cs.meta | 3 + Runtime/Scripts/Export/NonReadableMeshData.cs | 92 +++++ .../Export/NonReadableMeshData.cs.meta | 3 + Tests/Resources/Export/Models.meta | 8 + .../Export/Models/NonReadableTriangle.fbx | Bin 0 -> 12076 bytes .../Models/NonReadableTriangle.fbx.meta | 107 ++++++ .../Scripts/Export/ExportNonReadableTests.cs | 137 ++++++++ .../Export/ExportNonReadableTests.cs.meta | 3 + Tests/Runtime/Scripts/Export/ExportTests.cs | 4 +- 16 files changed, 795 insertions(+), 78 deletions(-) create mode 100644 Runtime/Scripts/Export/IMeshData.cs create mode 100644 Runtime/Scripts/Export/IMeshData.cs.meta create mode 100644 Runtime/Scripts/Export/MeshDataProxy.cs create mode 100644 Runtime/Scripts/Export/MeshDataProxy.cs.meta create mode 100644 Runtime/Scripts/Export/NonReadableMeshData.cs create mode 100644 Runtime/Scripts/Export/NonReadableMeshData.cs.meta create mode 100644 Tests/Resources/Export/Models.meta create mode 100644 Tests/Resources/Export/Models/NonReadableTriangle.fbx create mode 100644 Tests/Resources/Export/Models/NonReadableTriangle.fbx.meta create mode 100644 Tests/Runtime/Scripts/Export/ExportNonReadableTests.cs create mode 100644 Tests/Runtime/Scripts/Export/ExportNonReadableTests.cs.meta diff --git a/CHANGELOG.md b/CHANGELOG.md index af05ff39..5f8218db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - (Import) Setting to create textures readable. This allows users to access resulting textures from their scripts. +- (Export) Non-readable meshes can be exported as well now. +- (Export) Added support for exporting meshes with vertex compression enabled (effectively converting 16-bit float positions/normals/tangents/texture coordinates to 32-bit floats). ### Fixed - (Export) Writing to files on the web via IndexedDB now works (fixes [#625](https://github.com/atteneder/glTFast/issues/625)) diff --git a/Documentation~/KnownIssues.md b/Documentation~/KnownIssues.md index d81e7471..1c80fb62 100644 --- a/Documentation~/KnownIssues.md +++ b/Documentation~/KnownIssues.md @@ -1,5 +1,7 @@ # Known Issues +## Import + - ¹Vertex accessors (positions, normals, etc.) that are used across meshes are duplicated and result in higher memory usage and slower loading (see [this comment](https://github.com/atteneder/glTFast/issues/52#issuecomment-583837852)) - ¹When using more than one sampler on one image, that image is duplicated and results in higher memory usage - Texture sampler minification/magnification filter limitations (see [issue][SamplerFilter]): @@ -8,6 +10,16 @@ ¹: A Unity API limitation. +## Export + +### Non-readable Meshes + +Exporting non-readable meshes is not supported! + +Turn on *Read/Write Enabled* on all model importer settings that you intend to export to glTF later at runtime to ensure it works reliably (see [FBX importer settings](https://docs.unity3d.com/6000.0/Documentation/Manual/FBXImporter-Model.html) as example). + +While exporting non-readable meshes in general is feasible (via reading back index and vertex buffers from GPU memory) it has proven to be unreliable across platforms and graphics APIs, especially builds made with Unity version 2022 and older. The fact that it seems to work stable in Editor playmode is deceptive. The problem seems to be better in Unity 6 Preview, but there's not enough data to support that so use at own risk. + ## Trademarks *Unity®* is a registered trademark of [Unity Technologies][Unity]. diff --git a/Runtime/Scripts/Export/ExportJobs.cs b/Runtime/Scripts/Export/ExportJobs.cs index 28d99263..b38689fb 100644 --- a/Runtime/Scripts/Export/ExportJobs.cs +++ b/Runtime/Scripts/Export/ExportJobs.cs @@ -83,6 +83,32 @@ public void Execute(int i) } } + [BurstCompile] + public unsafe struct ConvertPositionHalfJob : IJobParallelFor + { + + public uint inputByteStride; + public uint outputByteStride; + + [ReadOnly] + [NativeDisableUnsafePtrRestriction] + public byte* input; + + [WriteOnly] + [NativeDisableUnsafePtrRestriction] + public byte* output; + + public void Execute(int i) + { + var inPtr = (half3*)(input + i * inputByteStride); + var outPtr = (float3*)(output + i * outputByteStride); + + var tmp = (float3)(*inPtr); + tmp.x *= -1; + *outPtr = tmp; + } + } + [BurstCompile] public unsafe struct ConvertTangentFloatJob : IJobParallelFor { @@ -109,6 +135,32 @@ public void Execute(int i) } } + [BurstCompile] + public unsafe struct ConvertTangentHalfJob : IJobParallelFor + { + + public uint inputByteStride; + public uint outputByteStride; + + [ReadOnly] + [NativeDisableUnsafePtrRestriction] + public byte* input; + + [WriteOnly] + [NativeDisableUnsafePtrRestriction] + public byte* output; + + public void Execute(int i) + { + var inPtr = (half4*)(input + i * inputByteStride); + var outPtr = (float4*)(output + i * outputByteStride); + + var tmp = (float4)(*inPtr); + tmp.z *= -1; + *outPtr = tmp; + } + } + [BurstCompile] public unsafe struct ConvertTexCoordFloatJob : IJobParallelFor { @@ -134,6 +186,31 @@ public void Execute(int i) } } + [BurstCompile] + public unsafe struct ConvertTexCoordHalfJob : IJobParallelFor + { + public uint inputByteStride; + public uint outputByteStride; + + [ReadOnly] + [NativeDisableUnsafePtrRestriction] + public byte* input; + + [WriteOnly] + [NativeDisableUnsafePtrRestriction] + public byte* output; + + public void Execute(int i) + { + var inPtr = (half2*)(input + i * inputByteStride); + var outPtr = (float2*)(output + i * outputByteStride); + + var tmp = (float2)(*inPtr); + tmp.y = 1 - tmp.y; + *outPtr = tmp; + } + } + [BurstCompile] public unsafe struct ConvertGenericJob : IJobParallelFor { diff --git a/Runtime/Scripts/Export/GltfWriter.cs b/Runtime/Scripts/Export/GltfWriter.cs index ba07b3d6..d2db3fc0 100755 --- a/Runtime/Scripts/Export/GltfWriter.cs +++ b/Runtime/Scripts/Export/GltfWriter.cs @@ -1,6 +1,10 @@ // SPDX-FileCopyrightText: 2023 Unity Technologies and the glTFast authors // SPDX-License-Identifier: Apache-2.0 +#if UNITY_2023_3_OR_NEWER +#define ASYNC_MESH_DATA +#endif + using System; using System.Collections.Generic; using System.Diagnostics; @@ -53,13 +57,24 @@ enum State Disposed } - struct AttributeData + readonly struct AttributeData { - public int stream; - public int inputOffset; - public int outputOffset; - public int accessorId; - public int size; + public readonly VertexAttributeDescriptor descriptor; + public readonly int inputOffset; + public readonly int outputOffset; + + public AttributeData( + VertexAttributeDescriptor descriptor, + int inputOffset, + int outputOffset + ) + { + this.descriptor = descriptor; + this.inputOffset = inputOffset; + this.outputOffset = outputOffset; + } + + public int Size => GetAttributeSize(descriptor.format) * descriptor.dimension; } const int k_MAXStreamCount = 4; @@ -772,6 +787,7 @@ void AssignMaterialsToMeshes() var materialIds = nodeMaterial.Value; var node = m_Nodes[nodeId]; var originalMeshId = node.mesh; + if (originalMeshId < 0) continue; var mesh = m_Meshes[originalMeshId]; var meshMaterialCombo = new MeshMaterialCombination(originalMeshId, materialIds); @@ -846,7 +862,8 @@ async Task BakeMeshes() } var tasks = m_Settings.Deterministic ? null : new List(m_Meshes.Count); - var meshDataArray = UnityEngine.Mesh.AcquireReadOnlyMeshData(m_UnityMeshes); + var meshData = CollectMeshData(out var meshDataArray); + Profiler.EndSample(); for (var meshId = 0; meshId < m_Meshes.Count; meshId++) { @@ -854,12 +871,12 @@ async Task BakeMeshes() #if DRACO_UNITY if ((m_Settings.Compression & Compression.Draco) != 0) { - task = BakeMeshDraco(meshId, meshDataArray[meshId]); + task = BakeMeshDraco(meshId); } else #endif { - task = BakeMesh(meshId, meshDataArray[meshId]); + task = BakeMesh(meshId, meshData[meshId]); } if (m_Settings.Deterministic) @@ -877,11 +894,92 @@ async Task BakeMeshes() { await Task.WhenAll(tasks); } - meshDataArray.Dispose(); + meshDataArray?.Dispose(); return true; } - async Task BakeMesh(int meshId, UnityEngine.Mesh.MeshData meshData) + IMeshData[] CollectMeshData(out UnityEngine.Mesh.MeshDataArray? meshDataArray) + { + var meshData = new IMeshData[m_UnityMeshes.Count]; + var nonReadableMesh = false; + var readableMeshCount = 0; + List readableMeshes = null; + List indexMap = null; + + for (var i = 0; i < m_UnityMeshes.Count; i++) + { + var mesh = m_UnityMeshes[i]; + if (mesh.isReadable) + { + if (nonReadableMesh) + { + // There's been a non-readable mesh before, so put this mesh in the queue. + if (readableMeshes == null) + { + readableMeshes = new List(); + indexMap = new List(); + } + readableMeshes.Add(mesh); + indexMap.Add(i); + } + + readableMeshCount++; + } + else + { +#if UNITY_2021_3_OR_NEWER + meshData[i] = mesh.indexFormat == IndexFormat.UInt16 + ? new NonReadableMeshData(mesh) + : new NonReadableMeshData(mesh); + if (readableMeshes == null && readableMeshCount > 0) + { + // This is the first non-readable mesh, so all potential predecessors are readable and we put + // them in the queue. + readableMeshes = new List(i); + indexMap = new List(i); + for (var a = 0; a < i; a++) + { + readableMeshes.Add(m_UnityMeshes[a]); + indexMap.Add(a); + } + } +#endif + nonReadableMesh = true; + } + } + + meshDataArray = null; + if (readableMeshCount > 0) + { + if (readableMeshes == null) + { + // All meshes are readable, bulk acquire data for all of them. + meshDataArray = UnityEngine.Mesh.AcquireReadOnlyMeshData(m_UnityMeshes); + for (var i = 0; i < m_UnityMeshes.Count; i++) + { + meshData[i] = m_UnityMeshes[i].indexFormat == IndexFormat.UInt16 + ? (IMeshData)new MeshDataProxy(meshDataArray.Value[i]) + : new MeshDataProxy(meshDataArray.Value[i]); + } + } + else + { + // Only a subset of the meshes are readable. + meshDataArray = UnityEngine.Mesh.AcquireReadOnlyMeshData(readableMeshes); + for (var i = 0; i < readableMeshes.Count; i++) + { + var actualIndex = indexMap[i]; + meshData[actualIndex] = m_UnityMeshes[actualIndex].indexFormat == IndexFormat.UInt16 + ? (IMeshData)new MeshDataProxy(meshDataArray.Value[i]) + : new MeshDataProxy(meshDataArray.Value[i]); + } + } + } + + return meshData; + } + + async Task BakeMesh(int meshId, IMeshData meshData) { Profiler.BeginSample("BakeMesh 1"); @@ -894,6 +992,7 @@ async Task BakeMesh(int meshId, UnityEngine.Mesh.MeshData meshData) var inputStrides = new int[k_MAXStreamCount]; var outputStrides = new int[k_MAXStreamCount]; var alignments = new int[k_MAXStreamCount]; + var streamAccessorIds = new List[k_MAXStreamCount]; var attributes = new Attributes(); var vertexCount = uMesh.vertexCount; @@ -910,25 +1009,24 @@ async Task BakeMesh(int meshId, UnityEngine.Mesh.MeshData meshData) var excludeAttribute = (attribute.attribute.ToVertexAttributeUsage() & vertexAttributeUsage) == VertexAttributeUsage.None; - var attributeSize = GetAttributeSize(attribute.format); + var attributeElementSize = GetAttributeSize(attribute.format); + var attributeSize = attribute.dimension * attributeElementSize; - var attrData = new AttributeData - { - inputOffset = inputStrides[attribute.stream], - outputOffset = outputStrides[attribute.stream], - stream = attribute.stream, - size = attribute.dimension * attributeSize - }; + var attrData = new AttributeData( + attribute, + inputStrides[attribute.stream], + outputStrides[attribute.stream] + ); - inputStrides[attribute.stream] += attrData.size; - alignments[attribute.stream] = math.max(alignments[attribute.stream], attributeSize); + inputStrides[attribute.stream] += attributeSize; + alignments[attribute.stream] = math.max(alignments[attribute.stream], attributeElementSize); if (excludeAttribute) { continue; } - outputStrides[attribute.stream] += attrData.size; + outputStrides[attribute.stream] += attributeSize; // Adhere data alignment rules Assert.IsTrue(attrData.outputOffset % 4 == 0); @@ -942,14 +1040,14 @@ async Task BakeMesh(int meshId, UnityEngine.Mesh.MeshData meshData) var accessorId = AddAccessor(accessor); - attrData.accessorId = accessorId; + streamAccessorIds[attribute.stream] ??= new List(); + streamAccessorIds[attribute.stream].Add(accessorId); + attrDataDict[attribute.attribute] = attrData; switch (attribute.attribute) { case VertexAttribute.Position: - Assert.AreEqual(VertexAttributeFormat.Float32, attribute.format); - Assert.AreEqual(3, attribute.dimension); var bounds = uMesh.bounds; var max = bounds.max; var min = bounds.min; @@ -958,13 +1056,10 @@ async Task BakeMesh(int meshId, UnityEngine.Mesh.MeshData meshData) attributes.POSITION = accessorId; break; case VertexAttribute.Normal: - Assert.AreEqual(VertexAttributeFormat.Float32, attribute.format); - Assert.AreEqual(3, attribute.dimension); attributes.NORMAL = accessorId; break; case VertexAttribute.Tangent: - Assert.AreEqual(VertexAttributeFormat.Float32, attribute.format); - Assert.AreEqual(4, attribute.dimension); + Assert.AreEqual(4, attribute.dimension, "Invalid tangent vector dimension"); attributes.TANGENT = accessorId; break; case VertexAttribute.Color: @@ -1020,19 +1115,19 @@ async Task BakeMesh(int meshId, UnityEngine.Mesh.MeshData meshData) MeshTopology? topology = null; for (var subMeshIndex = 0; subMeshIndex < meshData.subMeshCount; subMeshIndex++) { - var subMesh = meshData.GetSubMesh(subMeshIndex); + var subMeshTopology = meshData.GetTopology(subMeshIndex); if (!topology.HasValue) { - topology = subMesh.topology; + topology = subMeshTopology; } else { - Assert.AreEqual(topology.Value, subMesh.topology, "Mixed topologies are not supported!"); + Assert.AreEqual(topology.Value, subMeshTopology, "Mixed topologies are not supported!"); } - var mode = GetDrawMode(subMesh.topology); + var mode = GetDrawMode(subMeshTopology); if (!mode.HasValue) { - m_Logger?.Error(LogCode.TopologyUnsupported, subMesh.topology.ToString()); + m_Logger?.Error(LogCode.TopologyUnsupported, subMeshTopology.ToString()); mode = DrawMode.Points; } @@ -1040,14 +1135,14 @@ async Task BakeMesh(int meshId, UnityEngine.Mesh.MeshData meshData) { byteOffset = indexOffset, componentType = indexComponentType, - count = subMesh.indexCount, + count = meshData.GetIndexCount(subMeshIndex), // min = new []{}, // TODO // max = new []{}, // TODO }; indexAccessor.SetAttributeType(GltfAccessorAttributeType.SCALAR); - if (subMesh.topology == MeshTopology.Quads) + if (subMeshTopology == MeshTopology.Quads) { indexAccessor.count = indexAccessor.count / 2 * 3; } @@ -1070,7 +1165,11 @@ async Task BakeMesh(int meshId, UnityEngine.Mesh.MeshData meshData) int indexBufferViewId; if (uMesh.indexFormat == IndexFormat.UInt16) { - var indexData16 = meshData.GetIndexData(); + var indexData16 = +#if ASYNC_MESH_DATA + await +#endif + ((IMeshData)meshData).GetIndexData(); if (topology.Value == MeshTopology.Quads) { Profiler.BeginSample("IndexJobUInt16QuadsSchedule"); @@ -1099,7 +1198,7 @@ async Task BakeMesh(int meshId, UnityEngine.Mesh.MeshData meshData) { Profiler.BeginSample("IndexJobUInt16TrisSchedule"); var triangleCount = indexData16.Length / 3; - var destIndices = new NativeArray(indexData16.Length, Allocator.TempJob); + var destIndices = new NativeArray(triangleCount * 3, Allocator.TempJob); var job = new ExportJobs.ConvertIndicesFlippedJob { input = indexData16, @@ -1119,10 +1218,15 @@ async Task BakeMesh(int meshId, UnityEngine.Mesh.MeshData meshData) destIndices.Dispose(); Profiler.EndSample(); } + indexData16.Dispose(); } else { - var indexData32 = meshData.GetIndexData(); + var indexData32 = +#if ASYNC_MESH_DATA + await +#endif + ((IMeshData)meshData).GetIndexData(); if (topology.Value == MeshTopology.Quads) { Profiler.BeginSample("IndexJobUInt32QuadsSchedule"); @@ -1171,6 +1275,8 @@ async Task BakeMesh(int meshId, UnityEngine.Mesh.MeshData meshData) destIndices.Dispose(); Profiler.EndSample(); } + + indexData32.Dispose(); } foreach (var accessor in indexAccessors) @@ -1183,7 +1289,11 @@ async Task BakeMesh(int meshId, UnityEngine.Mesh.MeshData meshData) for (var stream = 0; stream < streamCount; stream++) { - inputStreams[stream] = meshData.GetVertexData(stream); + inputStreams[stream] = +#if ASYNC_MESH_DATA + await +#endif + meshData.GetVertexData(stream); outputStreams[stream] = new NativeArray(outputStrides[stream] * vertexCount, Allocator.TempJob); } @@ -1197,21 +1307,21 @@ async Task BakeMesh(int meshId, UnityEngine.Mesh.MeshData meshData) case VertexAttribute.Normal: await ConvertPositionAttribute( attrData, - (uint)inputStrides[attrData.stream], - (uint)outputStrides[attrData.stream], + (uint)inputStrides[attrData.descriptor.stream], + (uint)outputStrides[attrData.descriptor.stream], vertexCount, - inputStreams[attrData.stream], - outputStreams[attrData.stream] + inputStreams[attrData.descriptor.stream], + outputStreams[attrData.descriptor.stream] ); break; case VertexAttribute.Tangent: await ConvertTangentAttribute( attrData, - (uint)inputStrides[attrData.stream], - (uint)outputStrides[attrData.stream], + (uint)inputStrides[attrData.descriptor.stream], + (uint)outputStrides[attrData.descriptor.stream], vertexCount, - inputStreams[attrData.stream], - outputStreams[attrData.stream] + inputStreams[attrData.descriptor.stream], + outputStreams[attrData.descriptor.stream] ); break; case VertexAttribute.TexCoord0: @@ -1224,11 +1334,11 @@ await ConvertTangentAttribute( case VertexAttribute.TexCoord7: await ConvertTexCoordAttribute( attrData, - (uint)inputStrides[attrData.stream], - (uint)outputStrides[attrData.stream], + (uint)inputStrides[attrData.descriptor.stream], + (uint)outputStrides[attrData.descriptor.stream], vertexCount, - inputStreams[attrData.stream], - outputStreams[attrData.stream] + inputStreams[attrData.descriptor.stream], + outputStreams[attrData.descriptor.stream] ); break; case VertexAttribute.Color: @@ -1237,11 +1347,11 @@ await ConvertTexCoordAttribute( default: await ConvertGenericAttribute( attrData, - (uint)inputStrides[attrData.stream], - (uint)outputStrides[attrData.stream], + (uint)inputStrides[attrData.descriptor.stream], + (uint)outputStrides[attrData.descriptor.stream], vertexCount, - inputStreams[attrData.stream], - outputStreams[attrData.stream] + inputStreams[attrData.descriptor.stream], + outputStreams[attrData.descriptor.stream] ); break; } @@ -1250,31 +1360,46 @@ await ConvertGenericAttribute( var bufferViewIds = new int[streamCount]; for (var stream = 0; stream < streamCount; stream++) { - bufferViewIds[stream] = WriteBufferViewToBuffer( + var bufferViewId = WriteBufferViewToBuffer( outputStreams[stream], outputStrides[stream], alignments[stream] ); + bufferViewIds[stream] = bufferViewId; + inputStreams[stream].Dispose(); outputStreams[stream].Dispose(); - } - foreach (var pair in attrDataDict) - { - var attrData = pair.Value; - m_Accessors[attrData.accessorId].bufferView = bufferViewIds[attrData.stream]; + var accessorIds = streamAccessorIds[stream]; + if (accessorIds != null) + { + foreach (var accessorId in accessorIds) + { + m_Accessors[accessorId].bufferView = bufferViewId; + } + } } } #if DRACO_UNITY - async Task BakeMeshDraco(int meshId, UnityEngine.Mesh.MeshData meshData) + async Task BakeMeshDraco(int meshId) { var mesh = m_Meshes[meshId]; var unityMesh = m_UnityMeshes[meshId]; +#if UNITY_EDITOR + // Non-readable meshes are unsupported during playmode or in builds, but work in Editor exports. + if (Application.isPlaying) +#endif + { + if (!unityMesh.isReadable) + { + return; + } + } + var results = await DracoEncoder.EncodeMesh( unityMesh, - meshData, (QuantizationSettings) m_Settings.DracoSettings, (SpeedSettings) m_Settings.DracoSettings ); @@ -1561,14 +1686,24 @@ static unsafe JobHandle CreateConvertPositionAttributeJob( NativeArray outputStream ) { - var job = new ExportJobs.ConvertPositionFloatJob + if (attrData.descriptor.format == VertexAttributeFormat.Float16) + { + return new ExportJobs.ConvertPositionHalfJob + { + input = (byte*)inputStream.GetUnsafeReadOnlyPtr() + attrData.inputOffset, + inputByteStride = inputByteStride, + outputByteStride = outputByteStride, + output = (byte*)outputStream.GetUnsafePtr() + attrData.outputOffset + }.Schedule(vertexCount, k_DefaultInnerLoopBatchCount); + } + Assert.AreEqual(VertexAttributeFormat.Float32, attrData.descriptor.format, "Unsupported positions/normals format"); + return new ExportJobs.ConvertPositionFloatJob { input = (byte*)inputStream.GetUnsafeReadOnlyPtr() + attrData.inputOffset, inputByteStride = inputByteStride, outputByteStride = outputByteStride, output = (byte*)outputStream.GetUnsafePtr() + attrData.outputOffset }.Schedule(vertexCount, k_DefaultInnerLoopBatchCount); - return job; } static async Task ConvertTangentAttribute( @@ -1604,14 +1739,24 @@ static unsafe JobHandle CreateConvertTangentAttributeJob( NativeArray outputStream ) { - var job = new ExportJobs.ConvertTangentFloatJob + if (attrData.descriptor.format == VertexAttributeFormat.Float16) + { + return new ExportJobs.ConvertTangentHalfJob + { + input = (byte*)inputStream.GetUnsafeReadOnlyPtr() + attrData.inputOffset, + inputByteStride = inputByteStride, + outputByteStride = outputByteStride, + output = (byte*)outputStream.GetUnsafePtr() + attrData.outputOffset + }.Schedule(vertexCount, k_DefaultInnerLoopBatchCount); + } + Assert.AreEqual(VertexAttributeFormat.Float32, attrData.descriptor.format, "Unsupported tangents format"); + return new ExportJobs.ConvertTangentFloatJob { input = (byte*)inputStream.GetUnsafeReadOnlyPtr() + attrData.inputOffset, inputByteStride = inputByteStride, outputByteStride = outputByteStride, output = (byte*)outputStream.GetUnsafePtr() + attrData.outputOffset }.Schedule(vertexCount, k_DefaultInnerLoopBatchCount); - return job; } static async Task ConvertTexCoordAttribute( @@ -1669,14 +1814,23 @@ static unsafe JobHandle CreateConvertTexCoordAttributeJob( NativeArray outputStream ) { - var job = new ExportJobs.ConvertTexCoordFloatJob + if (attrData.descriptor.format == VertexAttributeFormat.Float16) + { + return new ExportJobs.ConvertTexCoordHalfJob + { + input = (byte*)inputStream.GetUnsafeReadOnlyPtr() + attrData.inputOffset, + inputByteStride = inputByteStride, + outputByteStride = outputByteStride, + output = (byte*)outputStream.GetUnsafePtr() + attrData.outputOffset + }.Schedule(vertexCount, k_DefaultInnerLoopBatchCount); + } + return new ExportJobs.ConvertTexCoordFloatJob { input = (byte*)inputStream.GetUnsafeReadOnlyPtr() + attrData.inputOffset, inputByteStride = inputByteStride, outputByteStride = outputByteStride, output = (byte*)outputStream.GetUnsafePtr() + attrData.outputOffset }.Schedule(vertexCount, k_DefaultInnerLoopBatchCount); - return job; } static unsafe JobHandle CreateConvertGenericAttributeJob( @@ -1692,7 +1846,7 @@ NativeArray outputStream { inputByteStride = inputByteStride, outputByteStride = outputByteStride, - byteLength = (uint)attrData.size, + byteLength = (uint)attrData.Size, input = (byte*)inputStream.GetUnsafeReadOnlyPtr() + attrData.inputOffset, output = (byte*)outputStream.GetUnsafePtr() + attrData.outputOffset }.Schedule(vertexCount, k_DefaultInnerLoopBatchCount); @@ -1774,14 +1928,28 @@ static Node CreateNode( int AddMesh(UnityEngine.Mesh uMesh, VertexAttributeUsage attributeUsage) { int meshId; - -#if !UNITY_EDITOR if (!uMesh.isReadable) { - m_Logger?.Error(LogCode.MeshNotReadable, uMesh.name); - return -1; - } +#if DEBUG && !UNITY_6000_0_OR_NEWER + Debug.LogWarning($"Exporting non-readable meshes is not reliable in builds across platforms and " + + $"graphics APIs! Consider making mesh \"{uMesh.name}\" readable.", uMesh); #endif + // Unity 2020 and older does not support accessing non-readable meshes via GraphicsBuffer. +#if UNITY_2021_3_OR_NEWER + // As of now Draco for Unity does not support encoding non-readable meshes. + if ((m_Settings.Compression & Compression.Draco) != 0) +#endif + { +#if UNITY_2021_3_OR_NEWER && UNITY_EDITOR + // Non-readable meshes are unsupported during playmode or in builds, but work in Editor exports. + if (Application.isPlaying) +#endif + { + m_Logger?.Error(LogCode.MeshNotReadable, uMesh.name); + return -1; + } + } + } if (m_UnityMeshes != null) { diff --git a/Runtime/Scripts/Export/IMeshData.cs b/Runtime/Scripts/Export/IMeshData.cs new file mode 100644 index 00000000..1a2cd754 --- /dev/null +++ b/Runtime/Scripts/Export/IMeshData.cs @@ -0,0 +1,40 @@ +// SPDX-FileCopyrightText: 2024 Unity Technologies and the glTFast authors +// SPDX-License-Identifier: Apache-2.0 + + +#if UNITY_2023_3_OR_NEWER +#define ASYNC_MESH_DATA +#endif + +using System; +#if ASYNC_MESH_DATA +using System.Threading.Tasks; +#endif +using Unity.Collections; +using UnityEngine; + +namespace GLTFast.Export +{ + interface IMeshData + { + int subMeshCount { get; } + + MeshTopology GetTopology(int subMesh); + int GetIndexCount(int subMesh); + +#if ASYNC_MESH_DATA + Task> GetVertexData(int stream); +#else + NativeArray GetVertexData(int stream); +#endif + } + + interface IMeshData : IMeshData where TIndex : struct + { +#if ASYNC_MESH_DATA + Task> GetIndexData(); +#else + NativeArray GetIndexData(); +#endif + } +} diff --git a/Runtime/Scripts/Export/IMeshData.cs.meta b/Runtime/Scripts/Export/IMeshData.cs.meta new file mode 100644 index 00000000..d3b60bba --- /dev/null +++ b/Runtime/Scripts/Export/IMeshData.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 3c249de161d74abf9bc681282190f184 +timeCreated: 1724072314 \ No newline at end of file diff --git a/Runtime/Scripts/Export/MeshDataProxy.cs b/Runtime/Scripts/Export/MeshDataProxy.cs new file mode 100644 index 00000000..e9a77144 --- /dev/null +++ b/Runtime/Scripts/Export/MeshDataProxy.cs @@ -0,0 +1,62 @@ +// SPDX-FileCopyrightText: 2024 Unity Technologies and the glTFast authors +// SPDX-License-Identifier: Apache-2.0 + +#if UNITY_2023_3_OR_NEWER +#define ASYNC_MESH_DATA +#endif + +using System; +#if ASYNC_MESH_DATA +using System.Threading.Tasks; +#endif +using Unity.Collections; +using UnityEngine; + +namespace GLTFast.Export +{ + class MeshDataProxy : IMeshData where TIndex : struct + { + Mesh.MeshData m_MeshData; + + public MeshDataProxy(Mesh.MeshData meshData) + { + m_MeshData = meshData; + } + + public int subMeshCount => m_MeshData.subMeshCount; + + public MeshTopology GetTopology(int subMesh) + { + return m_MeshData.GetSubMesh(subMesh).topology; + } + + public int GetIndexCount(int subMesh) + { + return m_MeshData.GetSubMesh(subMesh).indexCount; + } + +#if ASYNC_MESH_DATA + public Task> GetIndexData() + { + return Task.FromResult(m_MeshData.GetIndexData()); + } + + public Task> GetVertexData(int stream) + { + return Task.FromResult(m_MeshData.GetVertexData(stream)); + } +#else + public NativeArray GetIndexData() + { + return m_MeshData.GetIndexData(); + } + + public NativeArray GetVertexData(int stream) + { + return m_MeshData.GetVertexData(stream); + } +#endif + + + } +} diff --git a/Runtime/Scripts/Export/MeshDataProxy.cs.meta b/Runtime/Scripts/Export/MeshDataProxy.cs.meta new file mode 100644 index 00000000..0fd465ee --- /dev/null +++ b/Runtime/Scripts/Export/MeshDataProxy.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 1ce5100c376c4edbb850b580eccdb504 +timeCreated: 1724164806 \ No newline at end of file diff --git a/Runtime/Scripts/Export/NonReadableMeshData.cs b/Runtime/Scripts/Export/NonReadableMeshData.cs new file mode 100644 index 00000000..3f8b344b --- /dev/null +++ b/Runtime/Scripts/Export/NonReadableMeshData.cs @@ -0,0 +1,92 @@ +// SPDX-FileCopyrightText: 2024 Unity Technologies and the glTFast authors +// SPDX-License-Identifier: Apache-2.0 + +#if UNITY_2021_3_OR_NEWER +#if UNITY_2023_3_OR_NEWER +#define ASYNC_MESH_DATA +#endif + +using System; +#if ASYNC_MESH_DATA +using System.Threading.Tasks; +#endif +using Unity.Collections; +using UnityEngine; +using UnityEngine.Assertions; +using UnityEngine.Rendering; + +namespace GLTFast.Export +{ + class NonReadableMeshData : IMeshData where TIndex : struct + { + Mesh m_Mesh; + + NativeArray m_IndexData; + NativeArray[] m_VertexData; + + public NonReadableMeshData(Mesh mesh) + { + m_Mesh = mesh; + } + + public int subMeshCount => m_Mesh.subMeshCount; + + public MeshTopology GetTopology(int subMesh) + { + return m_Mesh.GetTopology(subMesh); + } + + public int GetIndexCount(int subMesh) + { + return (int)m_Mesh.GetIndexCount(subMesh); + } + + +#if ASYNC_MESH_DATA + public async Task> GetIndexData() +#else + public NativeArray GetIndexData() +#endif + { + if (!m_IndexData.IsCreated) + { + using var indexBuffer = m_Mesh.GetIndexBuffer(); + m_IndexData = new NativeArray(indexBuffer.count, Allocator.Persistent); +#if ASYNC_MESH_DATA + var request = await AsyncGPUReadback.RequestIntoNativeArrayAsync(ref m_IndexData, indexBuffer); +#else + var request = AsyncGPUReadback.RequestIntoNativeArray(ref m_IndexData, indexBuffer); + request.WaitForCompletion(); +#endif + Assert.IsTrue(request.done); + Assert.IsFalse(request.hasError); + } + return m_IndexData; + } + +#if ASYNC_MESH_DATA + public async Task> GetVertexData(int stream) +#else + public NativeArray GetVertexData(int stream) +#endif + { + Assert.IsTrue(stream >= 0 && stream < 4, "stream must in range 0 to 3"); + m_VertexData ??= new NativeArray[4]; + if (!m_VertexData[stream].IsCreated) + { + using var vertexBuffer = m_Mesh.GetVertexBuffer(stream); + m_VertexData[stream] = new NativeArray(vertexBuffer.count * vertexBuffer.stride, Allocator.Persistent); +#if ASYNC_MESH_DATA + var request = await AsyncGPUReadback.RequestIntoNativeArrayAsync(ref m_VertexData[stream], vertexBuffer); +#else + var request = AsyncGPUReadback.RequestIntoNativeArray(ref m_VertexData[stream], vertexBuffer); + request.WaitForCompletion(); +#endif + Assert.IsTrue(request.done); + Assert.IsFalse(request.hasError); + } + return m_VertexData[stream]; + } + } +} +#endif // UNITY_2021_2_OR_NEWER diff --git a/Runtime/Scripts/Export/NonReadableMeshData.cs.meta b/Runtime/Scripts/Export/NonReadableMeshData.cs.meta new file mode 100644 index 00000000..4d750edc --- /dev/null +++ b/Runtime/Scripts/Export/NonReadableMeshData.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: d069bccc929e4e9db8f89f1775102de8 +timeCreated: 1724164866 \ No newline at end of file diff --git a/Tests/Resources/Export/Models.meta b/Tests/Resources/Export/Models.meta new file mode 100644 index 00000000..6c08611c --- /dev/null +++ b/Tests/Resources/Export/Models.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3b55a6db9d49d4a9dabe4716c9229241 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Resources/Export/Models/NonReadableTriangle.fbx b/Tests/Resources/Export/Models/NonReadableTriangle.fbx new file mode 100644 index 0000000000000000000000000000000000000000..9f67d00f901895246bb70f0758ff476505eb81ba GIT binary patch literal 12076 zcmcgyeQX@X6<N3HT2yKkg$6-IC~8XzRr-4~Z|~;p z+r6_bb>#K#&YSm}c^~uM%-rrZr_!ct#yZ=skF{C0=}yIB#%kllg@*BLy-_GDLGKb~ zTDZF>ePMf+W8VZ~4X#>T%M0XT;Sw?N;hBapskLZCi-1PpKhkK+cH1d;D(8c5a4IJf zAQ|@%G?x|at}rFl%8I0KW^=y-CFr}p0E;e0ZMDABh*wkfu?X-iWa_p6#VZ)w{4 zB>E%JwYU~1Q^FPrd(=sui`P9FXT;3Vt5H*=kmy66a63%jya=2afI%`YBIPG_>Ncj5 zi3@5@=kV3tu6 zH#HxmzXE9y*w-i|vR0pKjbY|yr0F1H&dJ+pH4IRVooG%XbmKzbt8oiB?rP2DGFD2? ztzmc@^sGySmWIMviKoCHI|*L0JjBR-paS`P+{z*MnwYiaalfqL&hYcUG59V8enAL0 zPyP^ml3UJ}HayWwk3yr#Q5Y(GR}3Pu+`Ok}Q0g$KDC#gt1C4KP#^2^0+vBl#{A=>B zDISj>WN5bS3LU!B%7_T@$(=MWc@apE+PDlC^tl+fZqxIV=7dOx7eyoP%q}hgdmHD4E7Q*HdEmBnoYBLEaQ(h`@-{^2VKjw$1ZJD7Vj5TGhbPl1P5()4MR`>QZRro~_vt3#q@|$zVWmOG7>l>}g9Vn`0FCB&Og8SXOBAu^4La#@d)7D>t_ z!p>)lc`Sj}##Tr|!@Uw0SZD;qlFXSl7T2yXW!WpM2thvJE*B7VH+%-zf@c7bVu}Dx zE|mYNw@(~}osH+2Uo&=l-t(PorwbJfARSjW_SL%p6jJKQfw?RW7Fk{m1f{q@qSv-# z5#!4+aSGM6bh`*wL(sVU?ALaZHyctGxpXc*y+In|QWB^RfIu3%92e^)i48+`IvP!cJ;KQf-<|rrJkBZPOJXJeUCxXCsX>v=Wyk|*=68-v z_6TqMBTB4XN(_Dwaf;ft;)21+j+H~h!w*sUprvEh!@CUEq2LI)t<9Olc2mylVa#~P zy|P124)r2kh?>hX`yq~z6U}&A1>k#rl5N%F?;PFm_!dR>tzDWaJrf z9Nr9}jUngSOvB33W$#FC7-0p?({e}59Dn7~%10p35{wi^zWi{oAHOdtz zI_X|Sl2Rzme4X8lDzxD72=hg{5Y55+(J&|_E_4*Y1j@0LmUGwT;eW18rzlv{xH(7q z<04RI1aksh1q+ac_u_&*Xc7%LzDYB)Z*o~{Rj4lKwrFSkf`_EpM&n(; zv|fhQzzn17!1JHoT>vI&wTY$!TlV!~vff*Xb6*(e3zax;2;=-$G^aTkI@&nqS%jSC zWawybsl*vN+Q*nv3x2_b>T_|>C#5Vi!{2AVZLkYwIPJp&J}lW%qSJA^t*qtu*_pC| z7wwH^Y=}wTYjAPYE@1f9=%_6`@A}G%E*$Ar0kp3gpqHuux}h4N(+m_>qS3UV?NYa} zD|4^eHH19^vG5w7mdE|BDCmY(5%Wm9hZ$9iMg5NFFBJATV9APC;F=NZqXW@3IGURw zWiXZnM4>|wsPhj&$AC&gu2(`*9M{GgI-^fVvV~6PZJ18sy@k%@Yy?|G*!gKBTj(I) ziDU~Mo

sHf4nNwcoku)lIZ!0FjWav6PqoRGSHla z>Z%A+l~DIrgsDoXw-{!-QCQ+&Jx1qI=~nuUq$)eD`l`}Q7)VtDeY*lkRpLAV5X!Th zf@yc&?Kro#`oVFNT%*oB6MUVyI0cit4&~G`G?MRg9x`qel&Rz7xO02C?NbeCt@uHT zqQupzIdYECE5@*|oe(%+#)kwxj%DygKt7jqa4Jl2WzKZ&D@DO(B{I?jSprsboX`Ow5;4XiD5UODeQAfp);iJ zR3@e;t8#V3nv~k&C|~YO|Hq8Yy9ipd5_Ta|&8nyh^Y2(lk9Q}6R6n~#i_6>Pb8T`^})C6?tEp*1)bQ!f$rR0DvsFe3Uv?6Dq zX>(S95qy7i7b>6Q219sm0KvC#jGkVMH!9>GrR8Lc_C9^bkq=)~@6&vjZ&c6iiuIpx zPuLq6EBl?y)R<#ahhkDrH;Yt3g?x_+4g0^CX&2(x33?{J+TH0f;gxNA2FOEei_)&_ zHmC6MS4PmMFTIYN#dk$$V(eo$(n#U-U*N^j2#e%z7}We{TuTea^Lor&4(ERKeG>5G z2VV3A5>3OlsS=U?%xpM2G|n&lJ~5M#)>~5eL8rrVaaw*J3jkFa^=i;wI#3KYjOEJo z>C+##bTK0-X(=<7S8F*4<88$Iz)e=@ij%(%NWC4>bX%gg!%U#LsPsmvm5lE(X^zTU z&7+y4@*ZZkEV{3g{d?)anf9ZuOxZv2*~jdtC62xS2y}|}v3qtL`?}(j^yy!!`T*+a z8^1bKp#O&ZCmS>>#Zew9@mBIuDx~a^axrpeV1Z@21%`&D`j@XS(o58T1rtiuKQs(q z9bwWO)&CH)%~AcwneAH0b;i(ex{l?eb1swv=Uo0YtNKm4AGr3Nzw7U)n&$VDEh||Y zq{@0|pn5$%h@cwiu~zCa0Su#0Q*S|iX%LGl8j?Qr7HXOu){qw=9=0Hj4ro+YVn zWTRRlb)gZG`>a*VtO~RX7DvCYUAxveFno0OD(MKLb}G~*xXo!9vu_t;Y7buklfoh| zUFWgr1hcUPiXapOnqYxd;ec#boVgJY!Tf0K!ABfcagt1Ew8fG(Xx^&6Za&B)ieL5g z<0sN!d(F?emJ(ondmbMR|{O5%y7r%Mzte#!p;qJgkQ literal 0 HcmV?d00001 diff --git a/Tests/Resources/Export/Models/NonReadableTriangle.fbx.meta b/Tests/Resources/Export/Models/NonReadableTriangle.fbx.meta new file mode 100644 index 00000000..50d75d80 --- /dev/null +++ b/Tests/Resources/Export/Models/NonReadableTriangle.fbx.meta @@ -0,0 +1,107 @@ +fileFormatVersion: 2 +guid: 152b42780cca74a6f9e9ce9121cc164e +ModelImporter: + serializedVersion: 21300 + internalIDToNameTable: [] + externalObjects: {} + materials: + materialImportMode: 2 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + removeConstantScaleCurves: 1 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 0 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + nodeNameCollisionStrategy: 1 + fileIdsGeneration: 2 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + bakeAxisConversion: 0 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + optimizeBones: 1 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVMarginMethod: 1 + secondaryUVMinLightmapResolution: 40 + secondaryUVMinObjectScale: 1 + secondaryUVPackMargin: 4 + useFileScale: 1 + strictVertexDataChecks: 0 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 1 + humanDescription: + serializedVersion: 3 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + globalScale: 1 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + autoGenerateAvatarMappingIfUnspecified: 1 + animationType: 2 + humanoidOversampling: 1 + avatarSetup: 0 + addHumanoidExtraRootOnlyWhenUsingAvatar: 1 + remapMaterialsIfMaterialImportModeIsNone: 0 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Runtime/Scripts/Export/ExportNonReadableTests.cs b/Tests/Runtime/Scripts/Export/ExportNonReadableTests.cs new file mode 100644 index 00000000..babacecc --- /dev/null +++ b/Tests/Runtime/Scripts/Export/ExportNonReadableTests.cs @@ -0,0 +1,137 @@ +// SPDX-FileCopyrightText: 2024 Unity Technologies and the glTFast authors +// SPDX-License-Identifier: Apache-2.0 + +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using GLTFast.Export; +using GLTFast.Logging; +using NUnit.Framework; +#if GLTF_VALIDATOR && UNITY_EDITOR +using Unity.glTF.Validator; +#endif // GLTF_VALIDATOR +using UnityEngine; +using UnityEngine.TestTools; + +namespace GLTFast.Tests.Export +{ + [Category("Export")] + class ExportNonReadableTests + { + static GameObject s_NonReadableTriangle; + + [UnityTest] + public IEnumerator NonReadableMesh() + { + Certify(); + var model = Object.Instantiate(s_NonReadableTriangle); + var task = ExportObjects( + "NonReadableMesh", + new[] { model } +#if !UNITY_2021_3_OR_NEWER + , expectedLogCodes: new[] { LogCode.MeshNotReadable } +#endif + ); + yield return AsyncWrapper.WaitForTask(task); + } + + [UnityTest] + public IEnumerator MixedReadableMesh() + { + Certify(); + var model = Object.Instantiate(s_NonReadableTriangle); + var readable = GameObject.CreatePrimitive(PrimitiveType.Cube); + + var mesh = readable.GetComponent().sharedMesh; + Assert.IsTrue(mesh.isReadable); + + var task = ExportObjects( + "MixedReadableMesh-01", + new[] { model, readable } +#if !UNITY_2021_3_OR_NEWER + , expectedLogCodes: new[] { LogCode.MeshNotReadable } +#endif + ); + yield return AsyncWrapper.WaitForTask(task); + + task = ExportObjects( + "MixedReadableMesh-10", + new[] { readable, model } +#if !UNITY_2021_3_OR_NEWER + , expectedLogCodes: new[] { LogCode.MeshNotReadable } +#endif + ); + yield return AsyncWrapper.WaitForTask(task); + } + + [UnityTest] + public IEnumerator DracoMixedReadableMesh() + { +#if !DRACO_UNITY + Assert.Ignore("Test requires Draco for Unity (com.unity.cloud.draco) to be installed"); +#endif + Certify(); + var model = Object.Instantiate(s_NonReadableTriangle); + var readable = GameObject.CreatePrimitive(PrimitiveType.Cube); + + var mesh = readable.GetComponent().sharedMesh; + Assert.IsTrue(mesh.isReadable); + + var dracoSettings = new ExportSettings + { + Compression = Compression.Draco + }; + + var task = ExportObjects( + "DracoMixedReadableMesh-01", + new[] { model, readable }, + dracoSettings, + new[] { LogCode.MeshNotReadable } + ); + yield return AsyncWrapper.WaitForTask(task); + + task = ExportObjects( + "DracoMixedReadableMesh-10", + new[] { readable, model }, + dracoSettings, + new[] { LogCode.MeshNotReadable } + ); + yield return AsyncWrapper.WaitForTask(task); + } + + static async Task ExportObjects( + string name, + GameObject[] nodes, + ExportSettings settings = null, + IEnumerable expectedLogCodes = null + ) + { + var logger = new CollectingLogger(); + var export = new GameObjectExport(exportSettings: settings, logger: logger); + export.AddScene(nodes); + var path = Path.Combine(Application.persistentDataPath, $"{name}.gltf"); + var success = await export.SaveToFileAndDispose(path); + Assert.IsTrue(success); + LoggerTest.AssertLogger(logger, expectedLogCodes); +#if GLTF_VALIDATOR && UNITY_EDITOR + ExportTests.ValidateGltf(path, MessageCode.UNUSED_OBJECT); +#endif + } + + [OneTimeSetUp] + public void OneTimeSetup() + { + s_NonReadableTriangle = Resources.Load($"Export/Models/NonReadableTriangle"); + var mesh = s_NonReadableTriangle.GetComponent().sharedMesh; + Assert.IsFalse(mesh.isReadable); + } + + void Certify() + { +#if !(UNITY_6000_0_OR_NEWER || (UNITY_EDITOR && UNITY_2022_3_OR_NEWER)) + Assert.Ignore("Exporting non-readable meshes is unreliable on Unity versions before 6."); +#endif + } + } +} diff --git a/Tests/Runtime/Scripts/Export/ExportNonReadableTests.cs.meta b/Tests/Runtime/Scripts/Export/ExportNonReadableTests.cs.meta new file mode 100644 index 00000000..47c7bc59 --- /dev/null +++ b/Tests/Runtime/Scripts/Export/ExportNonReadableTests.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 22a0133e5248434b9f24ab1ae20ea8f2 +timeCreated: 1724154259 \ No newline at end of file diff --git a/Tests/Runtime/Scripts/Export/ExportTests.cs b/Tests/Runtime/Scripts/Export/ExportTests.cs index a2ba829f..ba681155 100644 --- a/Tests/Runtime/Scripts/Export/ExportTests.cs +++ b/Tests/Runtime/Scripts/Export/ExportTests.cs @@ -879,7 +879,7 @@ static async Task ExportSceneAll(bool binary, bool toStream = false) #endif } - static void AssertLogger(CollectingLogger logger) + internal static void AssertLogger(CollectingLogger logger) { logger.LogAll(); if (logger.Count > 0) @@ -930,7 +930,7 @@ static void AssertThrowsAsync(AsyncTestDelegate code, string message = #if GLTF_VALIDATOR && UNITY_EDITOR - static void ValidateGltf(string path, params MessageCode[] expectedMessages) { + internal static void ValidateGltf(string path, params MessageCode[] expectedMessages) { var report = Validator.Validate(path); Assert.NotNull(report, $"Report null for {path}"); // report.Log(); From 14cd3725b535e6b694f9bb976a92259306813430 Mon Sep 17 00:00:00 2001 From: Andreas Atteneder Date: Thu, 29 Aug 2024 23:48:01 +0200 Subject: [PATCH 07/16] feat: Primitive modes TRIANGLE_STRIP and TRIANGLE_FAN (#178) * Fixed line loop last index (cherry picked from commit ee4038ab859598fbef436b0f81f96d0158985b10) * Fixed max index of new triangles (cherry picked from commit 4ca4c39dc7620cbc533e99d7fd8adf82930d958c) * Removed unnecessary comments (cherry picked from commit 8280506e9ad5a0a8a5269c4b39cc8ec9e51456d3) * fix: Smaller code convention cleanups * Removed unused parameter from `CalculateIndicesJob` * doc: Changelog entries * doc: Updated features page * fix: Removed expected log code from test case asset. --------- Co-authored-by: ErdemPC --- CHANGELOG.md | 3 + Documentation~/features.md | 4 +- Runtime/Scripts/GltfImport.cs | 145 +++++++++++++----- Runtime/Scripts/Jobs.cs | 104 +++++++++++++ .../TestCaseSets/glTF-Sample-Assets.asset | 2 +- 5 files changed, 218 insertions(+), 40 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f8218db..b8dd08a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,10 +10,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - (Import) Setting to create textures readable. This allows users to access resulting textures from their scripts. - (Export) Non-readable meshes can be exported as well now. - (Export) Added support for exporting meshes with vertex compression enabled (effectively converting 16-bit float positions/normals/tangents/texture coordinates to 32-bit floats). +- (Import) Support for mesh primitive modes `TRIANGLE_STRIP` and `TRIANGLE_FAN` (thanks [Hexer611][Hexer611] for [#22](https://github.com/Unity-Technologies/com.unity.cloud.gltfast/pull/22)) ### Fixed - (Export) Writing to files on the web via IndexedDB now works (fixes [#625](https://github.com/atteneder/glTFast/issues/625)) - Export test results are validated again. +- Primitve mode LINE_LOOP works as expected (thanks [Hexer611][Hexer611] for [#22](https://github.com/Unity-Technologies/com.unity.cloud.gltfast/pull/22)). ## [6.7.1] - 2024-08-07 @@ -1218,6 +1220,7 @@ This release contains multiple breaking changes. Please read the [upgrade guide] [Battlehub0x]: https://github.com/Battlehub0x [Bersaelor]: https://github.com/Bersaelor [EricBeetsOfficial-Opuscope]: https://github.com/EricBeetsOfficial-Opuscope +[Hexer611]: https://github.com/Hexer611 [Holo-Krzysztof]: https://github.com/Holo-Krzysztof [hybridherbst]: https://github.com/hybridherbst [krisrok]: https://github.com/krisrok diff --git a/Documentation~/features.md b/Documentation~/features.md index 6be4ac54..756889e0 100644 --- a/Documentation~/features.md +++ b/Documentation~/features.md @@ -56,8 +56,8 @@ The glTF 2.0 specification is fully supported, with only a few minor remarks. | LINES | ✅ | ✅ | LINE_STRIP | ✅ | ✅ | ¹LINE_LOOP | ✅ | ✅ -| TRIANGLE_STRIP | | -| TRIANGLE_FAN | | +| TRIANGLE_STRIP | ✅ | `n/a` +| TRIANGLE_FAN | ✅ | `n/a` | Quads | `n/a` | ✅ via triangulation | | | | **Meshes** diff --git a/Runtime/Scripts/GltfImport.cs b/Runtime/Scripts/GltfImport.cs index 7ed878da..c3a6c2c7 100755 --- a/Runtime/Scripts/GltfImport.cs +++ b/Runtime/Scripts/GltfImport.cs @@ -3055,13 +3055,9 @@ async Task LoadAccessorData(RootBase gltf) var att = primitive.attributes; if (primitive.indices >= 0) { - var usage = ( - primitive.mode == DrawMode.Triangles - || primitive.mode == DrawMode.TriangleStrip - || primitive.mode == DrawMode.TriangleFan - ) - ? AccessorUsage.IndexFlipped - : AccessorUsage.Index; + var usage = primitive.mode == DrawMode.Triangles + ? AccessorUsage.IndexFlipped + : AccessorUsage.Index; SetAccessorUsage(primitive.indices, isDraco ? AccessorUsage.Ignore : usage); } @@ -3600,6 +3596,8 @@ void PreparePrimitiveIndices(RootBase gltf, MeshPrimitiveBase primitive, ref Pri switch (primitive.mode) { case DrawMode.Triangles: + case DrawMode.TriangleStrip: + case DrawMode.TriangleFan: c.topology = MeshTopology.Triangles; break; case DrawMode.Points: @@ -3609,30 +3607,30 @@ void PreparePrimitiveIndices(RootBase gltf, MeshPrimitiveBase primitive, ref Pri c.topology = MeshTopology.Lines; break; case DrawMode.LineLoop: - m_Logger?.Error(LogCode.PrimitiveModeUnsupported, primitive.mode.ToString()); c.topology = MeshTopology.LineStrip; break; case DrawMode.LineStrip: c.topology = MeshTopology.LineStrip; break; - case DrawMode.TriangleStrip: - case DrawMode.TriangleFan: default: m_Logger?.Error(LogCode.PrimitiveModeUnsupported, primitive.mode.ToString()); c.topology = MeshTopology.Triangles; break; } + int[] indices; if (primitive.indices >= 0) { - c.SetIndices(subMesh, ((AccessorData)m_AccessorData[primitive.indices]).data); + indices = ((AccessorData)m_AccessorData[primitive.indices]).data; + RecalculateIndicesJob(primitive, indices, out indices, out c.jobHandle, out c.calculatedIndicesHandle); } else { - int vertexCount = gltf.Accessors[primitive.attributes.POSITION].count; - CalculateIndicesJob(primitive, vertexCount, c.topology, out var indices, out c.jobHandle, out c.calculatedIndicesHandle); - c.SetIndices(subMesh, indices); + var vertexCount = gltf.Accessors[primitive.attributes.POSITION].count; + CalculateIndicesJob(primitive, vertexCount, out indices, out c.jobHandle, out c.calculatedIndicesHandle); } + + c.SetIndices(subMesh, indices); Profiler.EndSample(); } @@ -3647,10 +3645,64 @@ void PreparePrimitiveDraco( RootBase gltf, MeshPrimitiveBase primitive, ref Prim } #endif + static unsafe void RecalculateIndicesJob( + MeshPrimitiveBase primitive, + int[] oldIndices, + out int[] indices, + out JobHandle jobHandle, + out GCHandle resultHandle + ) + { + switch (primitive.mode) + { + case DrawMode.LineLoop: + indices = new int[oldIndices.Length + 1]; + Array.Copy(oldIndices, indices, oldIndices.Length); + indices[oldIndices.Length] = oldIndices[0]; + jobHandle = default; + resultHandle = default; + break; + case DrawMode.TriangleStrip: + var triangleStripTriangleCount = oldIndices.Length - 2; + indices = new int[triangleStripTriangleCount * 3]; + resultHandle = GCHandle.Alloc(indices, GCHandleType.Pinned); + var triangleStripJob = new RecalculateIndicesForTriangleStripJob(); + fixed (void* dst = &(indices[0])) + { + triangleStripJob.result = (int*)dst; + } + fixed (void* inp = &(oldIndices[0])) + { + triangleStripJob.input = (int*)inp; + } + jobHandle = triangleStripJob.Schedule(triangleStripTriangleCount, DefaultBatchCount); + break; + case DrawMode.TriangleFan: + var triangleFanTriangleCount = oldIndices.Length - 2; + indices = new int[triangleFanTriangleCount * 3]; + resultHandle = GCHandle.Alloc(indices, GCHandleType.Pinned); + var triangleFanJob = new RecalculateIndicesForTriangleFanJob(); + fixed (void* dst = &(indices[0])) + { + triangleFanJob.result = (int*)dst; + } + fixed (void* inp = &(oldIndices[0])) + { + triangleFanJob.input = (int*)inp; + } + jobHandle = triangleFanJob.Schedule(triangleFanTriangleCount, DefaultBatchCount); + break; + default: + indices = oldIndices; + jobHandle = default; + resultHandle = default; + break; + } + } + static unsafe void CalculateIndicesJob( MeshPrimitiveBase primitive, int vertexCount, - MeshTopology topology, out int[] indices, out JobHandle jobHandle, out GCHandle resultHandle @@ -3658,32 +3710,51 @@ out GCHandle resultHandle { Profiler.BeginSample("CalculateIndicesJob"); // No indices: calculate them - bool lineLoop = primitive.mode == DrawMode.LineLoop; + var lineLoop = primitive.mode == DrawMode.LineLoop; // extra index (first vertex again) for closing line loop indices = new int[vertexCount + (lineLoop ? 1 : 0)]; resultHandle = GCHandle.Alloc(indices, GCHandleType.Pinned); - if (topology == MeshTopology.Triangles) - { - var job8 = new CreateIndicesInt32FlippedJob(); - fixed (void* dst = &(indices[0])) - { - job8.result = (int*)dst; - } - jobHandle = job8.Schedule(indices.Length, DefaultBatchCount); - } - else + switch (primitive.mode) { - var job8 = new CreateIndicesInt32Job(); - if (lineLoop) - { - // Set the last index to the first vertex - indices[vertexCount] = 0; - } - fixed (void* dst = &(indices[0])) - { - job8.result = (int*)dst; - } - jobHandle = job8.Schedule(vertexCount, DefaultBatchCount); + case DrawMode.Triangles: + var flippedJob8 = new CreateIndicesInt32FlippedJob(); + fixed (void* dst = &(indices[0])) + { + flippedJob8.result = (int*)dst; + } + jobHandle = flippedJob8.Schedule(indices.Length, DefaultBatchCount); + break; + case DrawMode.TriangleStrip: + indices = new int[(indices.Length - 2) * 3]; + var triangleStripJob = new CreateIndicesForTriangleStripJob(); + fixed (void* dst = &(indices[0])) + { + triangleStripJob.result = (int*)dst; + } + jobHandle = triangleStripJob.Schedule(indices.Length, DefaultBatchCount); + break; + case DrawMode.TriangleFan: + indices = new int[(indices.Length - 2) * 3]; + var triangleFanJob = new CreateIndicesForTriangleFanJob(); + fixed (void* dst = &(indices[0])) + { + triangleFanJob.result = (int*)dst; + } + jobHandle = triangleFanJob.Schedule(indices.Length, DefaultBatchCount); + break; + default: + var job8 = new CreateIndicesInt32Job(); + if (lineLoop) + { + // Set the last index to the first vertex + indices[vertexCount] = 0; + } + fixed (void* dst = &(indices[0])) + { + job8.result = (int*)dst; + } + jobHandle = job8.Schedule(vertexCount, DefaultBatchCount); + break; } Profiler.EndSample(); } diff --git a/Runtime/Scripts/Jobs.cs b/Runtime/Scripts/Jobs.cs index 6eb0854b..97f467d4 100644 --- a/Runtime/Scripts/Jobs.cs +++ b/Runtime/Scripts/Jobs.cs @@ -326,6 +326,110 @@ public void Execute(int i) } } + [BurstCompile] + unsafe struct CreateIndicesForTriangleStripJob : IJobParallelFor + { + + [ReadOnly] + [NativeDisableUnsafePtrRestriction] + public int* result; + + public void Execute(int i) + { + // Source https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html + // Triangle Strips + // One triangle primitive is defined by each vertex and the two vertices that follow it, according to the equation: + // pi = { vi, vi + (1 + i % 2), vi + (2 - i % 2)} + // We change first and second indices for Unity + + var triangleIndex = i / 3; + result[i] = (i % 3) switch + { + 0 => triangleIndex + (1 + triangleIndex % 2), + 1 => triangleIndex, + 2 => triangleIndex + (2 - triangleIndex % 2), + _ => result[i] + }; + } + } + + [BurstCompile] + unsafe struct CreateIndicesForTriangleFanJob : IJobParallelFor + { + + [ReadOnly] + [NativeDisableUnsafePtrRestriction] + public int* result; + + public void Execute(int i) + { + // Source https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html + // Triangle Fans + // Triangle primitives are defined around a shared common vertex, according to the equation: + // pi = {vi+1, vi+2, v0} + // We change first and second indices for Unity + + var triangleIndex = i / 3; + result[i] = (i % 3) switch + { + 0 => triangleIndex + 2, + 1 => triangleIndex + 1, + _ => 0 + }; + } + } + + [BurstCompile] + unsafe struct RecalculateIndicesForTriangleStripJob : IJobParallelFor + { + [ReadOnly] + [NativeDisableUnsafePtrRestriction] + public int* input; + + [ReadOnly] + [NativeDisableUnsafePtrRestriction] + public int* result; + + public void Execute(int i) + { + // Source https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html + // Triangle Strips + // One triangle primitive is defined by each vertex and the two vertices that follow it, according to the equation: + // pi = { vi, vi + (1 + i % 2), vi + (2 - i % 2)} + // We change first and second indices for Unity + + var triangleIndex = i * 3; + result[triangleIndex + 1] = input[i]; + result[triangleIndex] = input[i + (1 + i % 2)]; + result[triangleIndex + 2] = input[i + (2 - i % 2)]; + } + } + + [BurstCompile] + unsafe struct RecalculateIndicesForTriangleFanJob : IJobParallelFor + { + [ReadOnly] + [NativeDisableUnsafePtrRestriction] + public int* input; + + [ReadOnly] + [NativeDisableUnsafePtrRestriction] + public int* result; + + public void Execute(int i) + { + // Source https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html + // Triangle Fans + // Triangle primitives are defined around a shared common vertex, according to the equation: + // pi = {vi+1, vi+2, v0} + // We change first and second indices for Unity + + var triangleIndex = i * 3; + result[triangleIndex + 1] = input[i + 1]; + result[triangleIndex] = input[i + 2]; + result[triangleIndex + 2] = 0; + } + } [BurstCompile] unsafe struct ConvertIndicesUInt8ToInt32Job : IJobParallelFor { diff --git a/Tests/Runtime/TestCaseSets/glTF-Sample-Assets.asset b/Tests/Runtime/TestCaseSets/glTF-Sample-Assets.asset index 1dc205f2..35dba47e 100644 --- a/Tests/Runtime/TestCaseSets/glTF-Sample-Assets.asset +++ b/Tests/Runtime/TestCaseSets/glTF-Sample-Assets.asset @@ -286,7 +286,7 @@ MonoBehaviour: - relativeUri: Models/MeshPrimitiveModes/glTF/MeshPrimitiveModes.gltf expectLoadFail: 0 expectInstantiationFail: 0 - expectedLogCodes: 26000000 + expectedLogCodes: - relativeUri: Models/MetalRoughSpheres/glTF/MetalRoughSpheres.gltf expectLoadFail: 0 expectInstantiationFail: 0 From 0a8ab2836b1b657afbb12d4ee18c159eb78c2753 Mon Sep 17 00:00:00 2001 From: Andreas Atteneder Date: Tue, 3 Sep 2024 23:42:24 +0200 Subject: [PATCH 08/16] fix(export): Removed expendable JSON content when exporting unlit materials without color or texture applied. (#181) --- CHANGELOG.md | 3 ++- Runtime/Scripts/Export/GltfUnlitMaterialExporter.cs | 6 ++++-- Tests/Resources/ExportTargets/PointCloud.gltf.txt | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b8dd08a1..54a77ba5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - (Export) Writing to files on the web via IndexedDB now works (fixes [#625](https://github.com/atteneder/glTFast/issues/625)) -- Export test results are validated again. +- (Export) test results are validated again. +- (Export) Removed expendable JSON content when exporting unlit materials without color or texture applied. - Primitve mode LINE_LOOP works as expected (thanks [Hexer611][Hexer611] for [#22](https://github.com/Unity-Technologies/com.unity.cloud.gltfast/pull/22)). ## [6.7.1] - 2024-08-07 diff --git a/Runtime/Scripts/Export/GltfUnlitMaterialExporter.cs b/Runtime/Scripts/Export/GltfUnlitMaterialExporter.cs index 6d1d23d3..67851c94 100644 --- a/Runtime/Scripts/Export/GltfUnlitMaterialExporter.cs +++ b/Runtime/Scripts/Export/GltfUnlitMaterialExporter.cs @@ -29,7 +29,6 @@ public bool ConvertMaterial( material = new GLTFast.Schema.Material { name = unityMaterial.name, - pbrMetallicRoughness = new PbrMetallicRoughness(), extensions = new MaterialExtensions { KHR_materials_unlit = new MaterialUnlit() @@ -61,6 +60,7 @@ static GLTFast.Schema.Material HandlePbrMetallicRoughness( texCoord = GltfMaterialExporter.GetValue(unityMaterial, MaterialProperty.BaseColorTextureTexCoord) }; + material.pbrMetallicRoughness ??= new PbrMetallicRoughness(); material.pbrMetallicRoughness.baseColorTexture = textureInfo; if (GltfMaterialExporter.TryCreateTextureTransform( @@ -79,8 +79,10 @@ out var textureTransform } } - if (GltfMaterialExporter.TryGetValue(unityMaterial, MaterialProperty.BaseColor, out Color baseColor)) + if (GltfMaterialExporter.TryGetValue(unityMaterial, MaterialProperty.BaseColor, out Color baseColor) + && baseColor != Color.white) { + material.pbrMetallicRoughness ??= new PbrMetallicRoughness(); material.pbrMetallicRoughness.BaseColor = baseColor.linear; } diff --git a/Tests/Resources/ExportTargets/PointCloud.gltf.txt b/Tests/Resources/ExportTargets/PointCloud.gltf.txt index aa78a41b..9b2ea728 100644 --- a/Tests/Resources/ExportTargets/PointCloud.gltf.txt +++ b/Tests/Resources/ExportTargets/PointCloud.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.41f1 glTFast 5.0.0-exp.1"},"nodes":[{"name":"PointCloud","mesh":0,"translation":[-37,0,0]}],"extensionsRequired":["KHR_materials_unlit"],"extensionsUsed":["KHR_materials_unlit"],"buffers":[{"uri":"PointCloud.bin","byteLength":1824}],"bufferViews":[{"buffer":0,"byteLength":456},{"buffer":0,"byteLength":1368,"byteOffset":456,"byteStride":12}],"accessors":[{"bufferView":1,"componentType":5126,"count":114,"type":"VEC3","max":[1,1,1.00000024],"min":[-1,-1,-0.9999998]},{"bufferView":0,"componentType":5125,"count":114,"type":"SCALAR"}],"materials":[{"name":"PointCloud","pbrMetallicRoughness":{"metallicFactor":0},"extensions":{"KHR_materials_unlit":{}}}],"meshes":[{"name":"PointCloud","primitives":[{"attributes":{"POSITION":0},"indices":1,"material":0,"mode":0}]}],"scene":0,"scenes":[{"name":"PointCloud","nodes":[0]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"PointCloud","mesh":0,"translation":[-37,0,0]}],"extensionsRequired":["KHR_materials_unlit"],"extensionsUsed":["KHR_materials_unlit"],"buffers":[{"uri":"PointCloud.bin","byteLength":1824}],"bufferViews":[{"buffer":0,"byteLength":456},{"buffer":0,"byteLength":1368,"byteOffset":456,"byteStride":12}],"accessors":[{"bufferView":1,"componentType":5126,"count":114,"type":"VEC3","max":[1,1,1.00000024],"min":[-1,-1,-0.9999998]},{"bufferView":0,"componentType":5125,"count":114,"type":"SCALAR"}],"materials":[{"name":"PointCloud","extensions":{"KHR_materials_unlit":{}}}],"meshes":[{"name":"PointCloud","primitives":[{"attributes":{"POSITION":0},"indices":1,"material":0,"mode":0}]}],"scene":0,"scenes":[{"name":"PointCloud","nodes":[0]}]} \ No newline at end of file From c4240942edbdd2e85a22b5156744d9828584ce5a Mon Sep 17 00:00:00 2001 From: Andreas Atteneder Date: Wed, 4 Sep 2024 00:12:15 +0200 Subject: [PATCH 09/16] =?UTF-8?q?fix(test):=20Fail=20export=20test=20if=20?= =?UTF-8?q?glTF=20JSON=20contains=20unexpected=20or=20misse=E2=80=A6=20(#1?= =?UTF-8?q?80)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(test): Fail export test if glTF JSON contains unexpected or misses expected properties. --------- Co-authored-by: Nick Constantinidis --- CHANGELOG.md | 1 + Tests/Runtime/Scripts/Export/ExportTests.cs | 27 +++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54a77ba5..b078f28d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - (Export) test results are validated again. - (Export) Removed expendable JSON content when exporting unlit materials without color or texture applied. - Primitve mode LINE_LOOP works as expected (thanks [Hexer611][Hexer611] for [#22](https://github.com/Unity-Technologies/com.unity.cloud.gltfast/pull/22)). +- (Test) Fail export test if glTF JSON contains unexpected or misses expected properties. ## [6.7.1] - 2024-08-07 diff --git a/Tests/Runtime/Scripts/Export/ExportTests.cs b/Tests/Runtime/Scripts/Export/ExportTests.cs index ba681155..38d33739 100644 --- a/Tests/Runtime/Scripts/Export/ExportTests.cs +++ b/Tests/Runtime/Scripts/Export/ExportTests.cs @@ -830,6 +830,33 @@ static void CompareGltfJsonTokenRecursively(JToken tokenA, JToken tokenB) CompareGltfJsonTokenRecursively(a, b); } + + if (tokenA is JObject objA && tokenB is JObject objB) + { + if (objA.Count > objB.Count) + { + AssertMissingProperties(objA, objB, true); + } + else if (objA.Count < objB.Count) + { + AssertMissingProperties(objB, objA, false); + } + } + + void AssertMissingProperties(JObject largerObject, JObject smallerObject, bool expected) + { + var i = 0; + foreach (var pair in largerObject) + { + if (i < smallerObject.Count) + { + i++; + continue; + } + + throw new AssertionException($"{expected ? "Missing" : "Unexpected"} property \"{pair.Key}\" at {largerObject.Path}."); + } + } } static async Task ExportSceneAll(bool binary, bool toStream = false) From d983ce6a99c4d73fca485916d11af27e7b05419c Mon Sep 17 00:00:00 2001 From: Andreas Atteneder Date: Wed, 4 Sep 2024 07:56:02 +0200 Subject: [PATCH 10/16] fix: Syntax error (#186) --- Tests/Runtime/Scripts/Export/ExportTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Runtime/Scripts/Export/ExportTests.cs b/Tests/Runtime/Scripts/Export/ExportTests.cs index 38d33739..f66d8b0a 100644 --- a/Tests/Runtime/Scripts/Export/ExportTests.cs +++ b/Tests/Runtime/Scripts/Export/ExportTests.cs @@ -854,7 +854,7 @@ void AssertMissingProperties(JObject largerObject, JObject smallerObject, bool e continue; } - throw new AssertionException($"{expected ? "Missing" : "Unexpected"} property \"{pair.Key}\" at {largerObject.Path}."); + throw new AssertionException($"{(expected ? "Missing" : "Unexpected")} property \"{pair.Key}\" at {largerObject.Path}."); } } } From a9923bdb4ec0fdd8b48544b379341b2bff8f92ce Mon Sep 17 00:00:00 2001 From: Andreas Atteneder Date: Wed, 4 Sep 2024 17:30:07 +0200 Subject: [PATCH 11/16] feat(export): Skinning export support (#179) * The hierarchy is now first converted to nodes before actually adding components to nodes. This ensures joint nodes have already been added. * fix: Updated export references. * Camera/light orientation nodes are added at last now. * Buffer view targets are added now. * fix: Fixed layer mask test and updated referenences. * fix: Skip skin when not all bone transforms are exported as well. * fix: Draco compressed skin export. * doc: Updated features page. --------- Co-authored-by: Hugo Pereira --- CHANGELOG.md | 1 + Documentation~/features.md | 6 +- Runtime/Scripts/Export/ExportJobs.cs | 87 +++ Runtime/Scripts/Export/GameObjectExport.cs | 66 +- Runtime/Scripts/Export/GltfWriter.cs | 244 ++++++- Runtime/Scripts/Export/IGltfWritable.cs | 11 + Runtime/Scripts/Export/ManagedNativeArray.cs | 74 +++ .../Scripts/Export/ManagedNativeArray.cs.meta | 11 + Runtime/Scripts/Schema/BufferView.cs | 12 +- Runtime/Scripts/Schema/MeshPrimitive.cs | 4 + ...orSmoothnessMetalOcclusionTexture.gltf.txt | 2 +- .../BaseColorSmoothnessMetalTexture.gltf.txt | 2 +- .../BaseColorSmoothnessTexture.gltf.txt | 2 +- .../ExportTargets/BaseColorTexture.gltf.txt | 2 +- .../BaseColorTextureCutout.gltf.txt | 2 +- .../BaseColorTextureFade.gltf.txt | 2 +- .../BaseColorTextureTransform.gltf.txt | 2 +- .../BaseColorTextureTransparent.gltf.txt | 2 +- Tests/Resources/ExportTargets/Bounds.gltf.txt | 2 +- .../ExportTargets/BoxVertexColors.gltf.txt | 2 +- .../Resources/ExportTargets/Cameras.gltf.txt | 2 +- .../ExportTargets/ClearcoatFactor.gltf.txt | 2 +- .../ExportTargets/ClearcoatTexture.gltf.txt | 2 +- .../ComponentMaskCamera.gltf.txt | 2 +- .../ExportTargets/ComponentMaskLight.gltf.txt | 2 +- .../ExportTargets/ComponentMaskMesh.gltf.txt | 2 +- .../ExportTargets/ComponentMaskNone.gltf.txt | 2 +- .../ExportTargets/Dielectric.gltf.txt | 2 +- .../ExportTargets/DoubleSided.gltf.txt | 2 +- .../ExportTargets/EmissiveFactor.gltf.txt | 2 +- .../ExportTargets/EmissiveTexture.gltf.txt | 2 +- .../EmissiveTextureFactor.gltf.txt | 2 +- ...orSmoothnessMetalOcclusionTexture.gltf.txt | 2 +- .../BaseColorSmoothnessMetalTexture.gltf.txt | 2 +- .../HDRP/BaseColorSmoothnessTexture.gltf.txt | 2 +- .../HDRP/BoxVertexColors.gltf.txt | 2 +- .../HDRP/ClearcoatFactor.gltf.txt | 2 +- .../HDRP/ClearcoatTexture.gltf.txt | 2 +- .../ExportTargets/HDRP/Dielectric.gltf.txt | 2 +- .../ExportTargets/HDRP/DoubleSided.gltf.txt | 2 +- .../ExportTargets/HDRP/LightAreaDisc.gltf.txt | 2 +- .../HDRP/LightAreaRectangle.gltf.txt | 2 +- .../HDRP/LightDirectional.gltf.txt | 2 +- .../ExportTargets/HDRP/LightsPoint.gltf.txt | 2 +- .../ExportTargets/HDRP/LightsSpot.gltf.txt | 2 +- ...etallicSmoothnessOcclusionTexture.gltf.txt | 2 +- .../HDRP/MetallicSmoothnessTexture.gltf.txt | 2 +- .../HDRP/MetallicTexture.gltf.txt | 2 +- .../ExportTargets/HDRP/NoMaterial2.gltf.txt | 2 +- .../HDRP/OcclusionTexture.gltf.txt | 2 +- .../HDRP/OcclusionTextureStrength.gltf.txt | 2 +- .../HDRP/SmoothnessTexture.gltf.txt | 2 +- .../ExportTargets/HDRP/Submesh.gltf.txt | 2 +- .../ExportTargets/HDRP/Unlit.gltf.txt | 2 +- .../HierarchyComponentsDisabled.gltf.txt | 2 +- .../HierarchyEditorOnlyTag.gltf.txt | 2 +- .../HierarchyObjectsInactive.gltf.txt | 2 +- .../IdenticalTextureName.gltf.txt | 2 +- .../ExportTargets/LayerMaskAll.gltf.txt | 2 +- .../ExportTargets/LayerMaskNone.gltf.txt | 2 +- .../ExportTargets/LayerMaskOne.gltf.txt | 2 +- .../ExportTargets/LayerMaskTwo.gltf.txt | 2 +- .../ExportTargets/LightAreaDisc.gltf.txt | 2 +- .../ExportTargets/LightAreaRectangle.gltf.txt | 2 +- .../ExportTargets/LightDirectional.gltf.txt | 2 +- .../ExportTargets/LightsPoint.gltf.txt | 2 +- .../ExportTargets/LightsSpot.gltf.txt | 2 +- .../ExportTargets/MeshMaterialReuse.gltf.txt | 2 +- .../ExportTargets/MeshReuse.gltf.txt | 2 +- .../Resources/ExportTargets/Metallic.gltf.txt | 2 +- ...etallicSmoothnessOcclusionTexture.gltf.txt | 2 +- .../MetallicSmoothnessTexture.gltf.txt | 2 +- .../ExportTargets/MetallicTexture.gltf.txt | 2 +- .../ExportTargets/NoMaterial.gltf.txt | 2 +- .../ExportTargets/NoMaterial2.gltf.txt | 2 +- .../ExportTargets/NormalTexture.gltf.txt | 2 +- .../ExportTargets/OcclusionTexture.gltf.txt | 2 +- .../OcclusionTextureStrength.gltf.txt | 2 +- .../ExportTargets/PointCloud.gltf.txt | 2 +- Tests/Resources/ExportTargets/Quads.gltf.txt | 2 +- Tests/Resources/ExportTargets/Simple.gltf.txt | 2 +- .../ExportTargets/SmoothnessTexture.gltf.txt | 2 +- .../Resources/ExportTargets/Submesh.gltf.txt | 2 +- .../URP/ClearcoatFactor.gltf.txt | 2 +- .../URP/ClearcoatTexture.gltf.txt | 2 +- .../ExportTargets/URP/Dielectric.gltf.txt | 2 +- .../ExportTargets/URP/DoubleSided.gltf.txt | 2 +- .../ExportTargets/URP/LightAreaDisc.gltf.txt | 2 +- .../URP/LightAreaRectangle.gltf.txt | 2 +- .../URP/LightDirectional.gltf.txt | 2 +- .../ExportTargets/URP/LightsPoint.gltf.txt | 2 +- .../ExportTargets/URP/LightsSpot.gltf.txt | 2 +- ...etallicSmoothnessOcclusionTexture.gltf.txt | 2 +- .../URP/MetallicSmoothnessTexture.gltf.txt | 2 +- .../URP/MetallicTexture.gltf.txt | 2 +- .../ExportTargets/URP/NoMaterial2.gltf.txt | 2 +- .../URP/OcclusionTexture.gltf.txt | 2 +- .../URP/OcclusionTextureStrength.gltf.txt | 2 +- .../URP/SmoothnessTexture.gltf.txt | 2 +- .../ExportTargets/URP/Submesh.gltf.txt | 2 +- .../ExportTargets/URP/Unlit.gltf.txt | 2 +- Tests/Resources/ExportTargets/Unlit.gltf.txt | 2 +- .../ExportTargets/UnlitTextured.gltf.txt | 2 +- .../UnlitTexturedTransform.gltf.txt | 2 +- .../ExportTargets/WrapModeU.gltf.txt | 2 +- .../ExportTargets/WrapModeV.gltf.txt | 2 +- Tests/Runtime/Export/Models/SimpleSkin.meta | 8 + .../Export/Models/SimpleSkin/Clip_0.anim | 168 +++++ .../Export/Models/SimpleSkin/Clip_0.anim.meta | 8 + .../Export/Models/SimpleSkin/SkinnedMesh.mesh | 202 ++++++ .../Models/SimpleSkin/SkinnedMesh.mesh.meta | 7 + Tests/Runtime/Export/Scenes/ExportSkin.unity | 596 ++++++++++++++++++ .../Export/Scenes/ExportSkin.unity.meta | 7 + .../Runtime/Scripts/Export/ExportSkinTests.cs | 109 ++++ .../Scripts/Export/ExportSkinTests.cs.meta | 11 + Tests/Runtime/Scripts/Export/ExportTests.cs | 13 +- .../Scripts/Export/GltfWritableMock.cs | 5 + .../Runtime/Scripts/Export/GltfWriterTests.cs | 2 +- 118 files changed, 1703 insertions(+), 141 deletions(-) create mode 100644 Runtime/Scripts/Export/ManagedNativeArray.cs create mode 100644 Runtime/Scripts/Export/ManagedNativeArray.cs.meta create mode 100644 Tests/Runtime/Export/Models/SimpleSkin.meta create mode 100644 Tests/Runtime/Export/Models/SimpleSkin/Clip_0.anim create mode 100644 Tests/Runtime/Export/Models/SimpleSkin/Clip_0.anim.meta create mode 100644 Tests/Runtime/Export/Models/SimpleSkin/SkinnedMesh.mesh create mode 100644 Tests/Runtime/Export/Models/SimpleSkin/SkinnedMesh.mesh.meta create mode 100644 Tests/Runtime/Export/Scenes/ExportSkin.unity create mode 100644 Tests/Runtime/Export/Scenes/ExportSkin.unity.meta create mode 100644 Tests/Runtime/Scripts/Export/ExportSkinTests.cs create mode 100644 Tests/Runtime/Scripts/Export/ExportSkinTests.cs.meta diff --git a/CHANGELOG.md b/CHANGELOG.md index b078f28d..66530a40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - (Import) Setting to create textures readable. This allows users to access resulting textures from their scripts. - (Export) Non-readable meshes can be exported as well now. - (Export) Added support for exporting meshes with vertex compression enabled (effectively converting 16-bit float positions/normals/tangents/texture coordinates to 32-bit floats). +- (Export) [Buffer view targets](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#_bufferview_target) are set properly now. - (Import) Support for mesh primitive modes `TRIANGLE_STRIP` and `TRIANGLE_FAN` (thanks [Hexer611][Hexer611] for [#22](https://github.com/Unity-Technologies/com.unity.cloud.gltfast/pull/22)) ### Fixed diff --git a/Documentation~/features.md b/Documentation~/features.md index 756889e0..82b611a3 100644 --- a/Documentation~/features.md +++ b/Documentation~/features.md @@ -70,12 +70,12 @@ The glTF 2.0 specification is fully supported, with only a few minor remarks. | Draco™ mesh compression (via [DracoForUnity]) | ✅ | ✅ | Implicit (no) indices | ✅ | | Per primitive material | ✅ | ✅ -| Joints (up to 4 per vertex) | ✅ | -| Weights (up to 4 per vertex) | ✅ | +| Joints (up to 4 per vertex) | ✅ | ✅ +| Weights (up to 4 per vertex) | ✅ | ✅ | | | | **Morph Targets / Blend Shapes** | Sparse accessors | ³ ✅ | -| [Skins][Skins] | ✅ | +| [Skins][Skins] | ✅ | ✅ | | | | **Animation** | via legacy Animation System | ✅ | diff --git a/Runtime/Scripts/Export/ExportJobs.cs b/Runtime/Scripts/Export/ExportJobs.cs index b38689fb..a43730b8 100644 --- a/Runtime/Scripts/Export/ExportJobs.cs +++ b/Runtime/Scripts/Export/ExportJobs.cs @@ -211,6 +211,93 @@ public void Execute(int i) } } + + [BurstCompile] + public unsafe struct ConvertSkinWeightsJob : IJobParallelFor + { + + public uint inputByteStride; + public uint outputByteStride; + + [ReadOnly] + [NativeDisableUnsafePtrRestriction] + public byte* input; + + [WriteOnly] + [NativeDisableUnsafePtrRestriction] + public byte* output; + + public void Execute(int i) + { + var inPtr = (float4*)(input + i * inputByteStride); + var outPtr = (float4*)(output + i * outputByteStride); + + *outPtr = *inPtr; + } + } + + [BurstCompile] + public struct ConvertMatrixJob : IJobParallelFor + { + public NativeArray matrices; + + public void Execute(int i) + { + + var tmp = matrices[i]; + tmp.c0.y *= -1; + tmp.c0.z *= -1; + tmp.c1.x *= -1; + tmp.c2.x *= -1; + tmp.c3.x *= -1; + matrices[i] = tmp; + } + } + + [BurstCompile] + public unsafe struct ConvertSkinIndicesJob : IJobParallelFor + { + + struct ushort4 + { + public ushort4(uint x, uint y, uint z, uint w) + { + m_X = (ushort)x; + m_Y = (ushort)y; + m_Z = (ushort)z; + m_W = (ushort)w; + } + + ushort m_X; + ushort m_Y; + ushort m_Z; + ushort m_W; + } + + public uint inputByteStride; + public int indicesOffset; + public uint outputByteStride; + + [ReadOnly] + [NativeDisableUnsafePtrRestriction] + public byte* input; + + [WriteOnly] + [NativeDisableUnsafePtrRestriction] + public byte* output; + + public void Execute(int i) + { + var inputIndexPtr = (uint4*)(indicesOffset + input + i * inputByteStride); + var outIndexPtr = (ushort4*)(indicesOffset + output + i * outputByteStride); + + // Set the correct values for the indices + var tmpIndex = *inputIndexPtr; + var tmpOut = new ushort4(tmpIndex[0], tmpIndex[1], tmpIndex[2], tmpIndex[3]); + *outIndexPtr = tmpOut; + } + } + [BurstCompile] public unsafe struct ConvertGenericJob : IJobParallelFor { diff --git a/Runtime/Scripts/Export/GameObjectExport.cs b/Runtime/Scripts/Export/GameObjectExport.cs index 72ee2e40..9835790c 100644 --- a/Runtime/Scripts/Export/GameObjectExport.cs +++ b/Runtime/Scripts/Export/GameObjectExport.cs @@ -72,12 +72,17 @@ public bool AddScene(ICollection gameObjects, float4x4 origin, strin var rootNodes = new List(gameObjects.Count); var tempMaterials = new List(); var success = true; + + var nodesQueue = new Queue(); + var transformNodeId = new Dictionary(); + foreach (var gameObject in gameObjects) { success &= AddGameObject( gameObject, origin, - tempMaterials, + nodesQueue, + transformNodeId, out var nodeId ); if (nodeId >= 0) @@ -85,6 +90,16 @@ out var nodeId rootNodes.Add((uint)nodeId); } } + + while (nodesQueue.Count > 0) + { + var transform = nodesQueue.Dequeue(); + AddNodeComponents( + transform, + transformNodeId, + tempMaterials + ); + } if (rootNodes.Count > 0) { m_Writer.AddScene(rootNodes.ToArray(), name); @@ -141,7 +156,8 @@ void CertifyNotDisposed() bool AddGameObject( GameObject gameObject, float4x4? sceneOrigin, - List tempMaterials, + Queue nodesQueue, + Dictionary transformNodeId, out int nodeId) { if (m_Settings.OnlyActiveInHierarchy && !gameObject.activeInHierarchy @@ -163,7 +179,8 @@ bool AddGameObject( success &= AddGameObject( child.gameObject, null, - tempMaterials, + nodesQueue, + transformNodeId, out var childNodeId ); if (childNodeId >= 0) @@ -200,7 +217,8 @@ out var childNodeId rotation = transform.localRotation; scale = transform.localScale; } - nodeId = (int)m_Writer.AddNode( + + var newNodeId = m_Writer.AddNode( translation, rotation, scale, @@ -210,8 +228,11 @@ out var childNodeId if (onIncludedLayer) { - AddNodeComponents(gameObject, tempMaterials, nodeId); + nodesQueue.Enqueue(transform); } + transformNodeId[transform] = newNodeId; + + nodeId = (int)newNodeId; } else { @@ -221,11 +242,17 @@ out var childNodeId return success; } - void AddNodeComponents(GameObject gameObject, List tempMaterials, int nodeId) + void AddNodeComponents( + Transform transform, + Dictionary transformNodeId, + List tempMaterials + ) { + var gameObject = transform.gameObject; + var nodeId = transformNodeId[transform]; tempMaterials.Clear(); Mesh mesh = null; - var skinning = false; + Transform[] bones = null; if (gameObject.TryGetComponent(out MeshFilter meshFilter)) { if (gameObject.TryGetComponent(out Renderer renderer)) @@ -243,9 +270,9 @@ void AddNodeComponents(GameObject gameObject, List tempMaterials, int if (smr.enabled || m_Settings.DisabledComponents) { mesh = smr.sharedMesh; + bones = smr.bones; smr.GetSharedMaterials(tempMaterials); } - skinning = true; } var materialIds = new int[tempMaterials.Count]; @@ -264,7 +291,24 @@ void AddNodeComponents(GameObject gameObject, List tempMaterials, int if (mesh != null) { - m_Writer.AddMeshToNode(nodeId, mesh, materialIds, skinning); + uint[] joints = null; + if (bones != null) + { + joints = new uint[bones.Length]; + for (var i = 0; i < bones.Length; i++) + { + var bone = bones[i]; + if (!transformNodeId.TryGetValue(bone, out joints[i])) + { +#if DEBUG + Debug.LogError($"Skip skin on {transform.name}: No node ID for bone transform {bone.name} found!"); + joints = null; + break; +#endif + } + } + } + m_Writer.AddMeshToNode((int)nodeId, mesh, materialIds, joints); } if (gameObject.TryGetComponent(out Camera camera)) @@ -273,7 +317,7 @@ void AddNodeComponents(GameObject gameObject, List tempMaterials, int { if (m_Writer.AddCamera(camera, out var cameraId)) { - m_Writer.AddCameraToNode(nodeId, cameraId); + m_Writer.AddCameraToNode((int)nodeId, cameraId); } } } @@ -284,7 +328,7 @@ void AddNodeComponents(GameObject gameObject, List tempMaterials, int { if (m_Writer.AddLight(light, out var lightId)) { - m_Writer.AddLightToNode(nodeId, lightId); + m_Writer.AddLightToNode((int)nodeId, lightId); } } } diff --git a/Runtime/Scripts/Export/GltfWriter.cs b/Runtime/Scripts/Export/GltfWriter.cs index d2db3fc0..d84d7726 100755 --- a/Runtime/Scripts/Export/GltfWriter.cs +++ b/Runtime/Scripts/Export/GltfWriter.cs @@ -93,7 +93,11 @@ int outputOffset List m_Scenes; List m_Nodes; + Dictionary m_transformToNodeId; List m_Meshes; + List m_Skins; + Dictionary m_MeshBindPoses; + List m_SkinMesh; List m_Materials; List m_Textures; List m_Images; @@ -120,6 +124,7 @@ int outputOffset /// Defer agent (); decides when/if to preempt /// export to preserve a stable frame rate. /// Interface for logging (error) messages. + /// Function used to get the bone Ids of a given mesh public GltfWriter( ExportSettings exportSettings = null, IDeferAgent deferAgent = null, @@ -159,7 +164,19 @@ public void AddMeshToNode(int nodeId, UnityEngine.Mesh uMesh, int[] materialIds) } /// + [Obsolete("Use overload with skinning parameter.")] public void AddMeshToNode(int nodeId, UnityEngine.Mesh uMesh, int[] materialIds, bool skinning) + { + AddMeshToNode(nodeId, uMesh, materialIds, null); + } + + /// + public void AddMeshToNode( + int nodeId, + UnityEngine.Mesh uMesh, + int[] materialIds, + uint[] joints + ) { if ((m_Settings.ComponentMask & ComponentType.Mesh) == 0) return; CertifyNotDisposed(); @@ -167,6 +184,11 @@ public void AddMeshToNode(int nodeId, UnityEngine.Mesh uMesh, int[] materialIds, // Always export positions. var attributeUsage = VertexAttributeUsage.Position; + var skinning = joints != null && joints.Length > 0; + if (skinning) + { + attributeUsage |= VertexAttributeUsage.Skinning; + } var noMaterialAssigned = false; if (materialIds != null && materialIds.Length > 0) @@ -182,12 +204,7 @@ public void AddMeshToNode(int nodeId, UnityEngine.Mesh uMesh, int[] materialIds, } else { - var usage = GetVertexAttributeUsage(m_UnityMaterials[materialId].shader); - if (!skinning) - { - usage &= ~VertexAttributeUsage.Skinning; - } - attributeUsage |= usage; + attributeUsage |= GetVertexAttributeUsage(m_UnityMaterials[materialId].shader); } } } @@ -203,7 +220,16 @@ public void AddMeshToNode(int nodeId, UnityEngine.Mesh uMesh, int[] materialIds, attributeUsage |= VertexAttributeUsage.Normal | VertexAttributeUsage.Color; } + if (!skinning) + { + attributeUsage &= ~VertexAttributeUsage.Skinning; + } + node.mesh = AddMesh(uMesh, attributeUsage); + if (skinning) + { + node.skin = AddSkin(node.mesh, joints); + } } /// @@ -693,6 +719,7 @@ async Task Bake(string bufferPath, string directory) if (!success) return false; } + AssignBindPosesToSkins(); AssignMaterialsToMeshes(); success = await BakeImages(directory); @@ -712,6 +739,7 @@ async Task Bake(string bufferPath, string directory) m_Gltf.scenes = m_Scenes?.ToArray(); m_Gltf.nodes = m_Nodes?.ToArray(); m_Gltf.meshes = m_Meshes?.ToArray(); + m_Gltf.skins = m_Skins?.ToArray(); m_Gltf.accessors = m_Accessors?.ToArray(); m_Gltf.bufferViews = m_BufferViews?.ToArray(); m_Gltf.materials = m_Materials?.ToArray(); @@ -775,6 +803,20 @@ void BakeExtensions() } } + void AssignBindPosesToSkins() + { + if (m_SkinMesh == null || m_MeshBindPoses == null) return; + for (var skinId = 0; skinId < m_SkinMesh.Count; skinId++) + { + var meshId = m_SkinMesh[skinId]; + var inverseBindMatricesAccessor = m_MeshBindPoses[meshId]; + m_Skins[skinId].inverseBindMatrices = inverseBindMatricesAccessor; + } + + m_SkinMesh = null; + m_MeshBindPoses = null; + } + void AssignMaterialsToMeshes() { if (m_NodeMaterials != null && m_Meshes != null) @@ -1000,13 +1042,6 @@ async Task BakeMesh(int meshId, IMeshData meshData) foreach (var attribute in vertexAttributes) { - if (attribute.attribute == VertexAttribute.BlendWeight - || attribute.attribute == VertexAttribute.BlendIndices) - { - Debug.LogWarning($"Vertex attribute {attribute.attribute} is not supported yet...skipping"); - continue; - } - var excludeAttribute = (attribute.attribute.ToVertexAttributeUsage() & vertexAttributeUsage) == VertexAttributeUsage.None; var attributeElementSize = GetAttributeSize(attribute.format); @@ -1094,12 +1129,33 @@ async Task BakeMesh(int meshId, IMeshData meshData) break; case VertexAttribute.BlendIndices: attributes.JOINTS_0 = accessorId; + accessor.componentType = GltfComponentType.UnsignedShort; break; default: throw new ArgumentOutOfRangeException(); } } + // Add skin + var bindposes = uMesh.bindposes; + if (bindposes != null && bindposes.Length > 0) + { + var accessor = new Accessor + { + byteOffset = 0, + componentType = GltfComponentType.Float, + count = bindposes.Length + }; + accessor.SetAttributeType(GltfAccessorAttributeType.MAT4); + + var accessorId = AddAccessor(accessor); + m_MeshBindPoses ??= new Dictionary(); + m_MeshBindPoses[meshId] = accessorId; + + var bufferViewId = await WriteBindPosesToBuffer(bindposes); + accessor.bufferView = bufferViewId; + } + var streamCount = 1; for (var stream = 0; stream < outputStrides.Length; stream++) { @@ -1189,6 +1245,7 @@ async Task BakeMesh(int meshId, IMeshData meshData) job.Complete(); indexBufferViewId = WriteBufferViewToBuffer( destIndices.Reinterpret(sizeof(ushort)), + BufferViewTarget.ElementArrayBuffer, byteAlignment: sizeof(ushort) ); destIndices.Dispose(); @@ -1213,6 +1270,7 @@ async Task BakeMesh(int meshId, IMeshData meshData) job.Complete(); indexBufferViewId = WriteBufferViewToBuffer( destIndices.Reinterpret(sizeof(ushort)), + BufferViewTarget.ElementArrayBuffer, byteAlignment: sizeof(ushort) ); destIndices.Dispose(); @@ -1246,6 +1304,7 @@ async Task BakeMesh(int meshId, IMeshData meshData) job.Complete(); indexBufferViewId = WriteBufferViewToBuffer( destIndices.Reinterpret(sizeof(uint)), + BufferViewTarget.ElementArrayBuffer, byteAlignment: sizeof(uint) ); destIndices.Dispose(); @@ -1270,6 +1329,7 @@ async Task BakeMesh(int meshId, IMeshData meshData) job.Complete(); indexBufferViewId = WriteBufferViewToBuffer( destIndices.Reinterpret(sizeof(uint)), + BufferViewTarget.ElementArrayBuffer, byteAlignment: sizeof(uint) ); destIndices.Dispose(); @@ -1294,6 +1354,7 @@ async Task BakeMesh(int meshId, IMeshData meshData) await #endif meshData.GetVertexData(stream); + outputStreams[stream] = new NativeArray(outputStrides[stream] * vertexCount, Allocator.TempJob); } @@ -1343,7 +1404,28 @@ await ConvertTexCoordAttribute( break; case VertexAttribute.Color: case VertexAttribute.BlendWeight: + await ConvertSkinWeightsAttribute( + attrData, + (uint)inputStrides[attrData.descriptor.stream], + (uint)outputStrides[attrData.descriptor.stream], + vertexCount, + inputStreams[attrData.descriptor.stream], + outputStreams[attrData.descriptor.stream] + ); + break; case VertexAttribute.BlendIndices: + Profiler.BeginSample("ConvertSkinningAttributesJob"); + // indices are uint*4 in Unity, and ushort*4 in glTF + await ConvertSkinIndicesAttributes( + attrData, + (uint)inputStrides[attrData.descriptor.stream], + (uint)outputStrides[attrData.descriptor.stream], + vertexCount, + inputStreams[attrData.descriptor.stream], + outputStreams[attrData.descriptor.stream] + ); + Profiler.EndSample(); + break; default: await ConvertGenericAttribute( attrData, @@ -1362,6 +1444,7 @@ await ConvertGenericAttribute( { var bufferViewId = WriteBufferViewToBuffer( outputStreams[stream], + BufferViewTarget.ArrayBuffer, outputStrides[stream], alignments[stream] ); @@ -1381,6 +1464,29 @@ await ConvertGenericAttribute( } } + async Task WriteBindPosesToBuffer(Matrix4x4[] bindposes) + { + var bufferViewId = -1; + var nativeBindPoses = new ManagedNativeArray(bindposes); + var matrices = nativeBindPoses.nativeArray; + var job = new ExportJobs.ConvertMatrixJob + { + matrices = matrices + }.Schedule(bindposes.Length, k_DefaultInnerLoopBatchCount); + + while (!job.IsCompleted) + { + await Task.Yield(); + } + job.Complete(); + bufferViewId = WriteBufferViewToBuffer( + matrices.Reinterpret(sizeof(float) * 4 * 4), BufferViewTarget.None + ); + + nativeBindPoses.Dispose(); + return bufferViewId; + } + #if DRACO_UNITY async Task BakeMeshDraco(int meshId) { @@ -1409,7 +1515,7 @@ async Task BakeMeshDraco(int meshId) mesh.primitives = new MeshPrimitive[results.Length]; for (var submesh = 0; submesh < results.Length; submesh++) { var encodeResult = results[submesh]; - var bufferViewId = WriteBufferViewToBuffer(encodeResult.data); + var bufferViewId = WriteBufferViewToBuffer(encodeResult.data, BufferViewTarget.None); var attributes = new Attributes(); var dracoAttributes = new Attributes(); @@ -1419,7 +1525,9 @@ async Task BakeMeshDraco(int meshId) var vertexAttribute = vertexAttributeTuple.Key; var attribute = vertexAttributeTuple.Value; var accessor = new Accessor { - componentType = GltfComponentType.Float, + componentType = vertexAttribute == VertexAttribute.BlendIndices + ? GltfComponentType.UnsignedShort + : GltfComponentType.Float, count = (int)encodeResult.vertexCount }; var attributeType = Accessor.GetAccessorAttributeType(attribute.dimensions); @@ -1535,6 +1643,14 @@ int dracoId attributes.TEXCOORD_7 = accessorId; dracoAttributes.TEXCOORD_7 = dracoId; break; + case VertexAttribute.BlendWeight: + attributes.WEIGHTS_0 = accessorId; + dracoAttributes.WEIGHTS_0 = dracoId; + break; + case VertexAttribute.BlendIndices: + attributes.JOINTS_0 = accessorId; + dracoAttributes.JOINTS_0 = dracoId; + break; } } #endif // DRACO_UNITY @@ -1627,7 +1743,7 @@ bool GetUniqueFileName(ref string filename) var imageBytes = imageExport.GetData(); if (imageBytes != null) { - m_Images[imageId].bufferView = WriteBufferViewToBuffer(imageBytes); + m_Images[imageId].bufferView = WriteBufferViewToBuffer(imageBytes, BufferViewTarget.None); } } else if (imageDest == ImageDestination.SeparateFile) @@ -1653,6 +1769,23 @@ bool GetUniqueFileName(ref string filename) return true; } + static async Task ConvertSkinWeightsAttribute( + AttributeData attrData, + uint inputByteStride, + uint outputByteStride, + int vertexCount, + NativeArray inputStream, + NativeArray outputStream + ) + { + var job = ConvertSkinWeightsAttributeJob(attrData, inputByteStride, outputByteStride, vertexCount, inputStream, outputStream); + while (!job.IsCompleted) + { + await Task.Yield(); + } + job.Complete(); // TODO: Wait until thread is finished + } + static async Task ConvertPositionAttribute( AttributeData attrData, uint inputByteStride, @@ -1833,6 +1966,62 @@ NativeArray outputStream }.Schedule(vertexCount, k_DefaultInnerLoopBatchCount); } + static unsafe JobHandle ConvertSkinWeightsAttributeJob( + AttributeData attrData, + uint inputByteStride, + uint outputByteStride, + int vertexCount, + NativeArray inputStream, + NativeArray outputStream + ) + { + var job = new ExportJobs.ConvertSkinWeightsJob + { + input = (byte*)inputStream.GetUnsafeReadOnlyPtr() + attrData.inputOffset, + inputByteStride = inputByteStride, + outputByteStride = outputByteStride, + output = (byte*)outputStream.GetUnsafePtr() + attrData.outputOffset, + }.Schedule(vertexCount, k_DefaultInnerLoopBatchCount); + return job; + } + + static async Task ConvertSkinIndicesAttributes( + AttributeData indicesAttrData, + uint inputByteStride, + uint outputByteStride, + int vertexCount, + NativeArray input, + NativeArray output + ) + { + var job = CreateConvertSkinIndicesAttributesJob(indicesAttrData, inputByteStride, outputByteStride, vertexCount, input, output); + while (!job.IsCompleted) + { + await Task.Yield(); + } + job.Complete(); + } + + static unsafe JobHandle CreateConvertSkinIndicesAttributesJob( + AttributeData indicesAttrData, + uint inputByteStride, + uint outputByteStride, + int vertexCount, + NativeArray input, + NativeArray output + ) + { + var job = new ExportJobs.ConvertSkinIndicesJob + { + input = (byte*)input.GetUnsafeReadOnlyPtr(), + inputByteStride = inputByteStride, + outputByteStride = outputByteStride, + indicesOffset = indicesAttrData.inputOffset, + output = (byte*)output.GetUnsafePtr() + }.Schedule(vertexCount, k_DefaultInnerLoopBatchCount); + return job; + } + static unsafe JobHandle CreateConvertGenericAttributeJob( AttributeData attrData, uint inputByteStride, @@ -1972,10 +2161,25 @@ int AddMesh(UnityEngine.Mesh uMesh, VertexAttributeUsage attributeUsage) m_UnityMeshes.Add(uMesh); m_MeshVertexAttributeUsage.Add(attributeUsage); meshId = m_Meshes.Count - 1; + return meshId; } - unsafe int WriteBufferViewToBuffer(byte[] bufferViewData, int? byteStride = null) + int AddSkin(int meshId, uint[] joints) + { + m_Skins ??= new List(); + m_SkinMesh ??= new List(); + var skinId = m_Skins.Count; + var newSkin = new Skin + { + joints = joints + }; + m_Skins.Add(newSkin); + m_SkinMesh.Add(meshId); + return skinId; + } + + unsafe int WriteBufferViewToBuffer(byte[] bufferViewData, BufferViewTarget target, int? byteStride = null) { var bufferHandle = GCHandle.Alloc(bufferViewData, GCHandleType.Pinned); fixed (void* bufferAddress = &bufferViewData[0]) @@ -1985,7 +2189,7 @@ unsafe int WriteBufferViewToBuffer(byte[] bufferViewData, int? byteStride = null var safetyHandle = AtomicSafetyHandle.Create(); NativeArrayUnsafeUtility.SetAtomicSafetyHandle(array: ref nativeData, safetyHandle); #endif - var bufferViewId = WriteBufferViewToBuffer(nativeData, byteStride); + var bufferViewId = WriteBufferViewToBuffer(nativeData, target, byteStride); #if ENABLE_UNITY_COLLECTIONS_CHECKS AtomicSafetyHandle.Release(safetyHandle); #endif @@ -2016,6 +2220,7 @@ Stream CertifyBuffer() /// Writes the given data to the main buffer, creates a bufferView and returns its index /// /// Content to write to buffer + /// Target of the bufferView /// The byte size of an element. Provide it, /// if it cannot be inferred from the accessor /// If not zero, the offsets of the bufferView @@ -2023,7 +2228,7 @@ Stream CertifyBuffer() /// if required; see https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#data-alignment ) /// /// Buffer view index - int WriteBufferViewToBuffer(NativeArray bufferViewData, int? byteStride = null, int byteAlignment = 0) + int WriteBufferViewToBuffer(NativeArray bufferViewData, BufferViewTarget bufferViewTarget, int? byteStride = null, int byteAlignment = 0) { Profiler.BeginSample("WriteBufferViewToBuffer"); var buffer = CertifyBuffer(); @@ -2048,6 +2253,7 @@ int WriteBufferViewToBuffer(NativeArray bufferViewData, int? byteStride = buffer = 0, byteOffset = (int)byteOffset, byteLength = bufferViewData.Length, + target = (int)bufferViewTarget, }; if (byteStride.HasValue) { diff --git a/Runtime/Scripts/Export/IGltfWritable.cs b/Runtime/Scripts/Export/IGltfWritable.cs index 7353ea8a..42d4c88e 100644 --- a/Runtime/Scripts/Export/IGltfWritable.cs +++ b/Runtime/Scripts/Export/IGltfWritable.cs @@ -52,8 +52,19 @@ uint AddNode( /// glTF materials IDs to be assigned /// (multiple in case of sub-meshes) /// Skinning has been applied (e.g. ). + [Obsolete("Use overload with joints parameter.")] void AddMeshToNode(int nodeId, Mesh uMesh, int[] materialIds, bool skinning); + ///

+ /// Assigns a mesh to a previously added node + /// + /// Index of the node to add the mesh to + /// Unity mesh to be assigned and exported + /// glTF materials IDs to be assigned + /// (multiple in case of sub-meshes) + /// Node indices representing the joints of a skin. + void AddMeshToNode(int nodeId, Mesh uMesh, int[] materialIds, uint[] joints); + /// /// Assigns a camera to a previously added node /// diff --git a/Runtime/Scripts/Export/ManagedNativeArray.cs b/Runtime/Scripts/Export/ManagedNativeArray.cs new file mode 100644 index 00000000..dddb3ee6 --- /dev/null +++ b/Runtime/Scripts/Export/ManagedNativeArray.cs @@ -0,0 +1,74 @@ +// SPDX-FileCopyrightText: 2024 Unity Technologies and the glTFast authors +// SPDX-License-Identifier: Apache-2.0 + +using System; +using System.Runtime.InteropServices; +using Unity.Collections; +using Unity.Collections.LowLevel.Unsafe; +using UnityEngine; + +namespace GLTFast.Export +{ + + /// + /// Wraps a managed T[] in a NativeArray<T>without copying memory. + /// + public class ManagedNativeArray : IDisposable + where TIn : unmanaged + where TOut : unmanaged + { + + NativeArray m_NativeArray; + GCHandle m_BufferHandle; +#if ENABLE_UNITY_COLLECTIONS_CHECKS + AtomicSafetyHandle m_SafetyHandle; +#endif + bool m_Pinned; + + /// + /// Wraps a managed T[] in a NativeArray<T>without copying memory. + /// + /// The original T[] to convert into a NativeArray<T> + public unsafe ManagedNativeArray(TIn[] original) + { + if (original != null) + { + m_BufferHandle = GCHandle.Alloc(original, GCHandleType.Pinned); + fixed (void* bufferAddress = &original[0]) + { + m_NativeArray = NativeArrayUnsafeUtility.ConvertExistingDataToNativeArray(bufferAddress, original.Length, Allocator.None); +#if ENABLE_UNITY_COLLECTIONS_CHECKS + m_SafetyHandle = AtomicSafetyHandle.Create(); + NativeArrayUnsafeUtility.SetAtomicSafetyHandle(array: ref m_NativeArray, m_SafetyHandle); +#endif + } + + m_Pinned = true; + } + else + { + m_NativeArray = new NativeArray(); + } + } + + /// + /// Points to the managed NativeArray<T>. + /// + public NativeArray nativeArray => m_NativeArray; + + + /// + /// Disposes the managed NativeArray<TT>. + /// + public void Dispose() + { + if (m_Pinned) + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + AtomicSafetyHandle.Release(m_SafetyHandle); +#endif + m_BufferHandle.Free(); + } + } + } +} diff --git a/Runtime/Scripts/Export/ManagedNativeArray.cs.meta b/Runtime/Scripts/Export/ManagedNativeArray.cs.meta new file mode 100644 index 00000000..ac2d1884 --- /dev/null +++ b/Runtime/Scripts/Export/ManagedNativeArray.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d4718bb4c3cba4f909ad5fea7877b4a1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Scripts/Schema/BufferView.cs b/Runtime/Scripts/Schema/BufferView.cs index 3e28accd..3b344c36 100644 --- a/Runtime/Scripts/Schema/BufferView.cs +++ b/Runtime/Scripts/Schema/BufferView.cs @@ -6,12 +6,12 @@ namespace GLTFast.Schema { - // public enum BufferViewTarget - // { - // None = 0, - // ArrayBuffer = 34962, - // ElementArrayBuffer = 34963, - // } + public enum BufferViewTarget + { + None = 0, + ArrayBuffer = 34962, + ElementArrayBuffer = 34963, + } /// [Serializable] diff --git a/Runtime/Scripts/Schema/MeshPrimitive.cs b/Runtime/Scripts/Schema/MeshPrimitive.cs index 648a5b9a..858ce337 100644 --- a/Runtime/Scripts/Schema/MeshPrimitive.cs +++ b/Runtime/Scripts/Schema/MeshPrimitive.cs @@ -285,6 +285,8 @@ public override bool Equals(object obj) && TEXCOORD_6 == b.TEXCOORD_6 && TEXCOORD_7 == b.TEXCOORD_7 && COLOR_0 == b.COLOR_0 + && JOINTS_0 == b.JOINTS_0 + && WEIGHTS_0 == b.WEIGHTS_0 ; } @@ -301,6 +303,8 @@ public override int GetHashCode() hash = hash * 7 + TEXCOORD_0.GetHashCode(); hash = hash * 7 + TEXCOORD_1.GetHashCode(); hash = hash * 7 + COLOR_0.GetHashCode(); + hash = hash * 7 + JOINTS_0.GetHashCode(); + hash = hash * 7 + WEIGHTS_0.GetHashCode(); return hash; } diff --git a/Tests/Resources/ExportTargets/BaseColorSmoothnessMetalOcclusionTexture.gltf.txt b/Tests/Resources/ExportTargets/BaseColorSmoothnessMetalOcclusionTexture.gltf.txt index 3378684e..86fc89f7 100644 --- a/Tests/Resources/ExportTargets/BaseColorSmoothnessMetalOcclusionTexture.gltf.txt +++ b/Tests/Resources/ExportTargets/BaseColorSmoothnessMetalOcclusionTexture.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2022.2.12f1 glTFast 5.0.4"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"BaseColorSmoothnessMetalOcclusionTexture","children":[0,2],"translation":[-31,0,0]}],"buffers":[{"uri":"BaseColorSmoothnessMetalOcclusionTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"ColorGridAlpha.jpg","uri":"ColorGridAlpha.jpg","mimeType":"image/jpeg"},{"name":"metallic.jpg","uri":"metallic.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"BaseColorSmoothnessMetalOcclusionTexture","pbrMetallicRoughness":{"baseColorTexture":{"index":0},"metallicRoughnessTexture":{"index":1}},"occlusionTexture":{"index":1}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"samplers":[{"magFilter":9728,"minFilter":9728}],"scene":0,"scenes":[{"name":"BaseColorSmoothnessMetalOcclusionTexture","nodes":[3]}],"textures":[{"source":0},{"source":1,"sampler":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"BaseColorSmoothnessMetalOcclusionTexture","children":[0,2],"translation":[-31,0,0]}],"buffers":[{"uri":"BaseColorSmoothnessMetalOcclusionTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"ColorGridAlpha.jpg","uri":"ColorGridAlpha.jpg","mimeType":"image/jpeg"},{"name":"metallic.jpg","uri":"metallic.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"BaseColorSmoothnessMetalOcclusionTexture","pbrMetallicRoughness":{"baseColorTexture":{"index":0},"metallicRoughnessTexture":{"index":1}},"occlusionTexture":{"index":1}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"samplers":[{"magFilter":9728,"minFilter":9728}],"scene":0,"scenes":[{"name":"BaseColorSmoothnessMetalOcclusionTexture","nodes":[3]}],"textures":[{"source":0},{"source":1,"sampler":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/BaseColorSmoothnessMetalTexture.gltf.txt b/Tests/Resources/ExportTargets/BaseColorSmoothnessMetalTexture.gltf.txt index 967b9e1e..c1273386 100644 --- a/Tests/Resources/ExportTargets/BaseColorSmoothnessMetalTexture.gltf.txt +++ b/Tests/Resources/ExportTargets/BaseColorSmoothnessMetalTexture.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2022.2.12f1 glTFast 5.0.4"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"BaseColorSmoothnessMetalTexture","children":[0,2],"translation":[-30,0,0]}],"buffers":[{"uri":"BaseColorSmoothnessMetalTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"ColorGridAlpha.jpg","uri":"ColorGridAlpha.jpg","mimeType":"image/jpeg"},{"name":"metallic.jpg","uri":"metallic.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"BaseColorSmoothnessMetalTexture","pbrMetallicRoughness":{"baseColorTexture":{"index":0},"metallicRoughnessTexture":{"index":1}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"samplers":[{"magFilter":9728,"minFilter":9728}],"scene":0,"scenes":[{"name":"BaseColorSmoothnessMetalTexture","nodes":[3]}],"textures":[{"source":0},{"source":1,"sampler":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"BaseColorSmoothnessMetalTexture","children":[0,2],"translation":[-30,0,0]}],"buffers":[{"uri":"BaseColorSmoothnessMetalTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"ColorGridAlpha.jpg","uri":"ColorGridAlpha.jpg","mimeType":"image/jpeg"},{"name":"metallic.jpg","uri":"metallic.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"BaseColorSmoothnessMetalTexture","pbrMetallicRoughness":{"baseColorTexture":{"index":0},"metallicRoughnessTexture":{"index":1}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"samplers":[{"magFilter":9728,"minFilter":9728}],"scene":0,"scenes":[{"name":"BaseColorSmoothnessMetalTexture","nodes":[3]}],"textures":[{"source":0},{"source":1,"sampler":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/BaseColorSmoothnessTexture.gltf.txt b/Tests/Resources/ExportTargets/BaseColorSmoothnessTexture.gltf.txt index 0aabc8a0..69b01973 100644 --- a/Tests/Resources/ExportTargets/BaseColorSmoothnessTexture.gltf.txt +++ b/Tests/Resources/ExportTargets/BaseColorSmoothnessTexture.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2022.2.12f1 glTFast 5.0.4"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"BaseColorSmoothnessTexture","children":[0,2],"translation":[-29,0,0]}],"buffers":[{"uri":"BaseColorSmoothnessTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"ColorGridAlpha.jpg","uri":"ColorGridAlpha.jpg","mimeType":"image/jpeg"},{"name":"ColorGridAlphaORM.jpg","uri":"ColorGridAlphaORM.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"BaseColorSmoothnessTexture","pbrMetallicRoughness":{"metallicFactor":0,"baseColorTexture":{"index":0},"metallicRoughnessTexture":{"index":1}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"BaseColorSmoothnessTexture","nodes":[3]}],"textures":[{"source":0},{"source":1}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"BaseColorSmoothnessTexture","children":[0,2],"translation":[-29,0,0]}],"buffers":[{"uri":"BaseColorSmoothnessTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"ColorGridAlpha.jpg","uri":"ColorGridAlpha.jpg","mimeType":"image/jpeg"},{"name":"ColorGridAlphaORM.jpg","uri":"ColorGridAlphaORM.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"BaseColorSmoothnessTexture","pbrMetallicRoughness":{"metallicFactor":0,"baseColorTexture":{"index":0},"metallicRoughnessTexture":{"index":1}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"BaseColorSmoothnessTexture","nodes":[3]}],"textures":[{"source":0},{"source":1}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/BaseColorTexture.gltf.txt b/Tests/Resources/ExportTargets/BaseColorTexture.gltf.txt index 5b6e899b..5ef38801 100644 --- a/Tests/Resources/ExportTargets/BaseColorTexture.gltf.txt +++ b/Tests/Resources/ExportTargets/BaseColorTexture.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2021.3.21f1 glTFast 5.0.4"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"BaseColorTexture","children":[0,2],"translation":[-9,0,0]}],"buffers":[{"uri":"BaseColorTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"ColorGrid.jpg","uri":"ColorGrid.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"BaseColorTexture","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0,"baseColorTexture":{"index":0}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"BaseColorTexture","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"BaseColorTexture","children":[0,2],"translation":[-9,0,0]}],"buffers":[{"uri":"BaseColorTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"ColorGrid.jpg","uri":"ColorGrid.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"BaseColorTexture","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0,"baseColorTexture":{"index":0}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"BaseColorTexture","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/BaseColorTextureCutout.gltf.txt b/Tests/Resources/ExportTargets/BaseColorTextureCutout.gltf.txt index 842642e7..fd178256 100644 --- a/Tests/Resources/ExportTargets/BaseColorTextureCutout.gltf.txt +++ b/Tests/Resources/ExportTargets/BaseColorTextureCutout.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2021.3.21f1 glTFast 5.0.4"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"BaseColorTextureCutout","children":[0,2],"translation":[-10,0,0]}],"buffers":[{"uri":"BaseColorTextureCutout.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"ColorGridAlpha.png","uri":"ColorGridAlpha.png","mimeType":"image/png"}],"materials":[{"name":"BaseColorTextureCutout","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0,"baseColorTexture":{"index":0}},"alphaMode":"MASK","alphaCutoff":0.6}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"BaseColorTextureCutout","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"BaseColorTextureCutout","children":[0,2],"translation":[-10,0,0]}],"buffers":[{"uri":"BaseColorTextureCutout.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"ColorGridAlpha.png","uri":"ColorGridAlpha.png","mimeType":"image/png"}],"materials":[{"name":"BaseColorTextureCutout","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0,"baseColorTexture":{"index":0}},"alphaMode":"MASK","alphaCutoff":0.6}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"BaseColorTextureCutout","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/BaseColorTextureFade.gltf.txt b/Tests/Resources/ExportTargets/BaseColorTextureFade.gltf.txt index 8599fc1f..b59254a3 100644 --- a/Tests/Resources/ExportTargets/BaseColorTextureFade.gltf.txt +++ b/Tests/Resources/ExportTargets/BaseColorTextureFade.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2021.3.21f1 glTFast 5.0.4"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"BaseColorTextureFade","children":[0,2],"translation":[-11,0,0]}],"buffers":[{"uri":"BaseColorTextureFade.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"ColorGridAlpha.png","uri":"ColorGridAlpha.png","mimeType":"image/png"}],"materials":[{"name":"BaseColorTextureFade","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0,"baseColorTexture":{"index":0}},"alphaMode":"BLEND"}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"BaseColorTextureFade","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"BaseColorTextureFade","children":[0,2],"translation":[-11,0,0]}],"buffers":[{"uri":"BaseColorTextureFade.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"ColorGridAlpha.png","uri":"ColorGridAlpha.png","mimeType":"image/png"}],"materials":[{"name":"BaseColorTextureFade","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0,"baseColorTexture":{"index":0}},"alphaMode":"BLEND"}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"BaseColorTextureFade","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/BaseColorTextureTransform.gltf.txt b/Tests/Resources/ExportTargets/BaseColorTextureTransform.gltf.txt index ebf121a5..66684029 100644 --- a/Tests/Resources/ExportTargets/BaseColorTextureTransform.gltf.txt +++ b/Tests/Resources/ExportTargets/BaseColorTextureTransform.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2021.3.21f1 glTFast 5.0.4"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"BaseColorTextureTransform","children":[0,2],"translation":[-13,0,0]}],"extensionsRequired":["KHR_texture_transform"],"extensionsUsed":["KHR_texture_transform"],"buffers":[{"uri":"BaseColorTextureTransform.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"ColorGrid.jpg","uri":"ColorGrid.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"BaseColorTextureTransform","pbrMetallicRoughness":{"metallicFactor":0,"baseColorTexture":{"index":0,"extensions":{"KHR_texture_transform":{"offset":[0.5,-0.5],"scale":[1.5,2]}}}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"BaseColorTextureTransform","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"BaseColorTextureTransform","children":[0,2],"translation":[-13,0,0]}],"extensionsRequired":["KHR_texture_transform"],"extensionsUsed":["KHR_texture_transform"],"buffers":[{"uri":"BaseColorTextureTransform.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"ColorGrid.jpg","uri":"ColorGrid.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"BaseColorTextureTransform","pbrMetallicRoughness":{"metallicFactor":0,"baseColorTexture":{"index":0,"extensions":{"KHR_texture_transform":{"offset":[0.5,-0.5],"scale":[1.5,2]}}}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"BaseColorTextureTransform","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/BaseColorTextureTransparent.gltf.txt b/Tests/Resources/ExportTargets/BaseColorTextureTransparent.gltf.txt index 0bf000e4..d0b98296 100644 --- a/Tests/Resources/ExportTargets/BaseColorTextureTransparent.gltf.txt +++ b/Tests/Resources/ExportTargets/BaseColorTextureTransparent.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2021.3.21f1 glTFast 5.0.4"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"BaseColorTextureTransparent","children":[0,2],"translation":[-12,0,0]}],"buffers":[{"uri":"BaseColorTextureTransparent.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"ColorGridAlpha.png","uri":"ColorGridAlpha.png","mimeType":"image/png"}],"materials":[{"name":"BaseColorTextureTransparent","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0,"baseColorTexture":{"index":0}},"alphaMode":"BLEND"}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"BaseColorTextureTransparent","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"BaseColorTextureTransparent","children":[0,2],"translation":[-12,0,0]}],"buffers":[{"uri":"BaseColorTextureTransparent.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"ColorGridAlpha.png","uri":"ColorGridAlpha.png","mimeType":"image/png"}],"materials":[{"name":"BaseColorTextureTransparent","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0,"baseColorTexture":{"index":0}},"alphaMode":"BLEND"}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"BaseColorTextureTransparent","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/Bounds.gltf.txt b/Tests/Resources/ExportTargets/Bounds.gltf.txt index a0ed3640..6d1c80c8 100644 --- a/Tests/Resources/ExportTargets/Bounds.gltf.txt +++ b/Tests/Resources/ExportTargets/Bounds.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.4.0"},"nodes":[{"name":"AsymBoundsCube","mesh":0},{"name":"Bounds","children":[0],"translation":[-6,0,0]}],"buffers":[{"uri":"Bounds.bin","byteLength":720}],"bufferViews":[{"buffer":0,"byteLength":144},{"buffer":0,"byteLength":576,"byteOffset":144,"byteStride":24}],"accessors":[{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","max":[0.099999994,0.6,0.400000036],"min":[-0.3,-0.5,-0.199999988]},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","byteOffset":12},{"bufferView":0,"componentType":5125,"count":36,"type":"SCALAR"}],"meshes":[{"name":"AsymBoundsCube","primitives":[{"attributes":{"POSITION":0,"NORMAL":1},"indices":2}]}],"scene":0,"scenes":[{"name":"Bounds","nodes":[1]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"AsymBoundsCube","mesh":0},{"name":"Bounds","children":[0],"translation":[-6,0,0]}],"buffers":[{"uri":"Bounds.bin","byteLength":720}],"bufferViews":[{"buffer":0,"byteLength":144,"target":34963},{"buffer":0,"byteLength":576,"byteOffset":144,"byteStride":24,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","max":[0.099999994,0.6,0.400000036],"min":[-0.3,-0.5,-0.199999988]},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","byteOffset":12},{"bufferView":0,"componentType":5125,"count":36,"type":"SCALAR"}],"meshes":[{"name":"AsymBoundsCube","primitives":[{"attributes":{"POSITION":0,"NORMAL":1},"indices":2}]}],"scene":0,"scenes":[{"name":"Bounds","nodes":[1]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/BoxVertexColors.gltf.txt b/Tests/Resources/ExportTargets/BoxVertexColors.gltf.txt index 431170ef..4f06c541 100644 --- a/Tests/Resources/ExportTargets/BoxVertexColors.gltf.txt +++ b/Tests/Resources/ExportTargets/BoxVertexColors.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2022.3.27f1 glTFast 6.4.0"},"nodes":[{"name":"Cube","mesh":0},{"name":"Mesh"},{"name":"Texture Group"},{"name":"RootNode","children":[0,1,2]},{"name":"BoxVertexColors","children":[3],"translation":[-35,0,0]}],"extensionsRequired":["KHR_materials_unlit"],"extensionsUsed":["KHR_materials_unlit"],"buffers":[{"uri":"BoxVertexColors.bin","byteLength":1008}],"bufferViews":[{"buffer":0,"byteLength":144},{"buffer":0,"byteLength":288,"byteOffset":144,"byteStride":12},{"buffer":0,"byteLength":384,"byteOffset":432,"byteStride":16},{"buffer":0,"byteLength":192,"byteOffset":816,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":2,"componentType":5126,"count":24,"type":"VEC4"},{"bufferView":3,"componentType":5126,"count":24,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":36,"type":"SCALAR"}],"materials":[{"name":"VertexColorsUnlit","pbrMetallicRoughness":{"metallicFactor":0},"extensions":{"KHR_materials_unlit":{}}}],"meshes":[{"name":"Cube","primitives":[{"attributes":{"POSITION":0,"TEXCOORD_0":2,"COLOR_0":1},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"BoxVertexColors","nodes":[4]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Cube","mesh":0},{"name":"Mesh"},{"name":"Texture Group"},{"name":"RootNode","children":[0,1,2]},{"name":"BoxVertexColors","children":[3],"translation":[-35,0,0]}],"extensionsRequired":["KHR_materials_unlit"],"extensionsUsed":["KHR_materials_unlit"],"buffers":[{"uri":"BoxVertexColors.bin","byteLength":1008}],"bufferViews":[{"buffer":0,"byteLength":144,"target":34963},{"buffer":0,"byteLength":288,"byteOffset":144,"byteStride":12,"target":34962},{"buffer":0,"byteLength":384,"byteOffset":432,"byteStride":16,"target":34962},{"buffer":0,"byteLength":192,"byteOffset":816,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":2,"componentType":5126,"count":24,"type":"VEC4"},{"bufferView":3,"componentType":5126,"count":24,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":36,"type":"SCALAR"}],"materials":[{"name":"VertexColorsUnlit","pbrMetallicRoughness":{"metallicFactor":0},"extensions":{"KHR_materials_unlit":{}}}],"meshes":[{"name":"Cube","primitives":[{"attributes":{"POSITION":0,"TEXCOORD_0":2,"COLOR_0":1},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"BoxVertexColors","nodes":[4]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/Cameras.gltf.txt b/Tests/Resources/ExportTargets/Cameras.gltf.txt index 8ad5b8fd..da064a33 100644 --- a/Tests/Resources/ExportTargets/Cameras.gltf.txt +++ b/Tests/Resources/ExportTargets/Cameras.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.41f1 glTFast 5.0.0-exp.1"},"nodes":[{"name":"PerspectiveCamera","children":[1],"translation":[0,0.8,4],"rotation":[0.0168262012,0.765781939,-0.0200526863,0.642567337]},{"name":"PerspectiveCamera_Orientation","rotation":[0,-1,0,-4.371139E-08],"camera":0},{"name":"OrthogonalCamera","children":[3],"translation":[0,0.8,4],"rotation":[0.0168262012,0.765781939,-0.0200526863,0.642567337]},{"name":"OrthogonalCamera_Orientation","rotation":[0,-1,0,-4.371139E-08],"camera":1},{"name":"Cameras","children":[0,2],"translation":[-59,0,0]}],"cameras":[{"type":"perspective","perspective":{"yfov":0.17453292,"zfar":1000,"znear":0.3}},{"type":"orthographic","orthographic":{"xmag":3.2,"ymag":1.8,"zfar":1000,"znear":0.3}}],"scene":0,"scenes":[{"name":"Cameras","nodes":[4]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"PerspectiveCamera","children":[3],"translation":[0,0.8,4],"rotation":[0.0168262012,0.765781939,-0.0200526863,0.642567337]},{"name":"OrthogonalCamera","children":[4],"translation":[0,0.8,4],"rotation":[0.0168262012,0.765781939,-0.0200526863,0.642567337]},{"name":"Cameras","children":[0,1],"translation":[-59,0,0]},{"name":"PerspectiveCamera_Orientation","rotation":[0,-1,0,-4.371139E-08],"camera":0},{"name":"OrthogonalCamera_Orientation","rotation":[0,-1,0,-4.371139E-08],"camera":1}],"cameras":[{"type":"perspective","perspective":{"yfov":0.17453292,"zfar":1000,"znear":0.3}},{"type":"orthographic","orthographic":{"xmag":3.2,"ymag":1.8,"zfar":1000,"znear":0.3}}],"scene":0,"scenes":[{"name":"Cameras","nodes":[2]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/ClearcoatFactor.gltf.txt b/Tests/Resources/ExportTargets/ClearcoatFactor.gltf.txt index d058927e..0f098f8b 100644 --- a/Tests/Resources/ExportTargets/ClearcoatFactor.gltf.txt +++ b/Tests/Resources/ExportTargets/ClearcoatFactor.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.4.0"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"ClearcoatFactor","children":[0,2],"translation":[-39,0,0]}],"buffers":[{"uri":"ClearcoatFactor.bin","byteLength":20856}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":9216,"byteOffset":120},{"buffer":0,"byteLength":11520,"byteOffset":9336,"byteStride":24}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":3,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":3,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5125,"count":2304,"type":"SCALAR"}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1},"indices":2}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":3,"NORMAL":4},"indices":5}]}],"scene":0,"scenes":[{"name":"ClearcoatFactor","nodes":[3]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"ClearcoatFactor","children":[0,2],"translation":[-39,0,0]}],"buffers":[{"uri":"ClearcoatFactor.bin","byteLength":20856}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":120,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9336,"byteStride":24,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":3,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":3,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5125,"count":2304,"type":"SCALAR"}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1},"indices":2}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":3,"NORMAL":4},"indices":5}]}],"scene":0,"scenes":[{"name":"ClearcoatFactor","nodes":[3]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/ClearcoatTexture.gltf.txt b/Tests/Resources/ExportTargets/ClearcoatTexture.gltf.txt index aef7f1b4..c1d00fb8 100644 --- a/Tests/Resources/ExportTargets/ClearcoatTexture.gltf.txt +++ b/Tests/Resources/ExportTargets/ClearcoatTexture.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.4.0"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"ClearcoatTexture","children":[0,2],"translation":[-40,0,0]}],"buffers":[{"uri":"ClearcoatTexture.bin","byteLength":20856}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":9216,"byteOffset":120},{"buffer":0,"byteLength":11520,"byteOffset":9336,"byteStride":24}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":3,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":3,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5125,"count":2304,"type":"SCALAR"}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1},"indices":2}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":3,"NORMAL":4},"indices":5}]}],"scene":0,"scenes":[{"name":"ClearcoatTexture","nodes":[3]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"ClearcoatTexture","children":[0,2],"translation":[-40,0,0]}],"buffers":[{"uri":"ClearcoatTexture.bin","byteLength":20856}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":120,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9336,"byteStride":24,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":3,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":3,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5125,"count":2304,"type":"SCALAR"}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1},"indices":2}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":3,"NORMAL":4},"indices":5}]}],"scene":0,"scenes":[{"name":"ClearcoatTexture","nodes":[3]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/ComponentMaskCamera.gltf.txt b/Tests/Resources/ExportTargets/ComponentMaskCamera.gltf.txt index a6d7b750..7656b1b5 100644 --- a/Tests/Resources/ExportTargets/ComponentMaskCamera.gltf.txt +++ b/Tests/Resources/ExportTargets/ComponentMaskCamera.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2021.3.13f1 glTFast 5.0.0-exp.1"},"nodes":[{"name":"Mesh"},{"name":"Light","translation":[-1,0,0]},{"name":"Camera","children":[3],"translation":[-0.5,0,-3]},{"name":"Camera_Orientation","rotation":[0,-1,0,-4.371139E-08],"camera":0},{"name":"Root","children":[0,1,2]}],"cameras":[{"type":"perspective","perspective":{"yfov":1.04719758,"zfar":1000,"znear":0.3}}],"materials":[{"name":"Default-Material","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0.5}}],"scene":0,"scenes":[{"nodes":[4]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Mesh"},{"name":"Light","translation":[-1,0,0]},{"name":"Camera","children":[3],"translation":[-0.5,0,-3]},{"name":"Camera_Orientation","rotation":[0,-1,0,-4.371139E-08],"camera":0},{"name":"Root","children":[0,1,2]}],"cameras":[{"type":"perspective","perspective":{"yfov":1.04719758,"zfar":1000,"znear":0.3}}],"materials":[{"name":"Default-Material","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0.5}}],"scene":0,"scenes":[{"nodes":[4]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/ComponentMaskLight.gltf.txt b/Tests/Resources/ExportTargets/ComponentMaskLight.gltf.txt index e686a4d4..428a35c3 100644 --- a/Tests/Resources/ExportTargets/ComponentMaskLight.gltf.txt +++ b/Tests/Resources/ExportTargets/ComponentMaskLight.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2021.3.13f1 glTFast 5.0.0-exp.1"},"nodes":[{"name":"Mesh"},{"name":"Light","translation":[-1,0,0],"extensions":{"KHR_lights_punctual":{"light":0}}},{"name":"Camera","translation":[-0.5,0,-3]},{"name":"Root","children":[0,1,2]}],"extensionsRequired":["KHR_lights_punctual"],"extensionsUsed":["KHR_lights_punctual"],"materials":[{"name":"Default-Material","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0.5}}],"scene":0,"scenes":[{"nodes":[3]}],"extensions":{"KHR_lights_punctual":{"lights":[{"type":"point","name":"Light","intensity":3.14159274,"range":10}]}}} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Mesh"},{"name":"Light","translation":[-1,0,0],"extensions":{"KHR_lights_punctual":{"light":0}}},{"name":"Camera","translation":[-0.5,0,-3]},{"name":"Root","children":[0,1,2]}],"extensionsRequired":["KHR_lights_punctual"],"extensionsUsed":["KHR_lights_punctual"],"materials":[{"name":"Default-Material","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0.5}}],"scene":0,"scenes":[{"nodes":[3]}],"extensions":{"KHR_lights_punctual":{"lights":[{"type":"point","name":"Light","intensity":3.14159274,"range":10}]}}} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/ComponentMaskMesh.gltf.txt b/Tests/Resources/ExportTargets/ComponentMaskMesh.gltf.txt index ea224afa..cc3c7299 100644 --- a/Tests/Resources/ExportTargets/ComponentMaskMesh.gltf.txt +++ b/Tests/Resources/ExportTargets/ComponentMaskMesh.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2021.3.13f1 glTFast 5.0.0-exp.1"},"nodes":[{"name":"Mesh","mesh":0},{"name":"Light","translation":[-1,0,0]},{"name":"Camera","translation":[-0.5,0,-3]},{"name":"Root","children":[0,1,2]}],"buffers":[{"uri":"ComponentMaskMesh.bin","byteLength":1416}],"bufferViews":[{"buffer":0,"byteLength":72},{"buffer":0,"byteLength":1344,"byteOffset":72,"byteStride":56}],"accessors":[{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","byteOffset":12},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC4","byteOffset":24},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC2","byteOffset":40},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC2","byteOffset":48},{"bufferView":0,"componentType":5123,"count":36,"type":"SCALAR"}],"materials":[{"name":"Default-Material","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0.5}}],"meshes":[{"name":"Cube","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3,"TEXCOORD_1":4},"indices":5,"material":0}]}],"scene":0,"scenes":[{"nodes":[3]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Mesh","mesh":0},{"name":"Light","translation":[-1,0,0]},{"name":"Camera","translation":[-0.5,0,-3]},{"name":"Root","children":[0,1,2]}],"buffers":[{"uri":"ComponentMaskMesh.bin","byteLength":1416}],"bufferViews":[{"buffer":0,"byteLength":72},{"buffer":0,"byteLength":1344,"byteOffset":72,"byteStride":56}],"accessors":[{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","byteOffset":12},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC4","byteOffset":24},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC2","byteOffset":40},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC2","byteOffset":48},{"bufferView":0,"componentType":5123,"count":36,"type":"SCALAR"}],"materials":[{"name":"Default-Material","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0.5}}],"meshes":[{"name":"Cube","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3,"TEXCOORD_1":4},"indices":5,"material":0}]}],"scene":0,"scenes":[{"nodes":[3]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/ComponentMaskNone.gltf.txt b/Tests/Resources/ExportTargets/ComponentMaskNone.gltf.txt index 24ff1639..6a11317a 100644 --- a/Tests/Resources/ExportTargets/ComponentMaskNone.gltf.txt +++ b/Tests/Resources/ExportTargets/ComponentMaskNone.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2021.3.13f1 glTFast 5.0.0-exp.1"},"nodes":[{"name":"Mesh"},{"name":"Light","translation":[-1,0,0]},{"name":"Camera","translation":[-0.5,0,-3]},{"name":"Root","children":[0,1,2]}],"materials":[{"name":"Default-Material","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0.5}}],"scene":0,"scenes":[{"nodes":[3]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Mesh"},{"name":"Light","translation":[-1,0,0]},{"name":"Camera","translation":[-0.5,0,-3]},{"name":"Root","children":[0,1,2]}],"materials":[{"name":"Default-Material","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0.5}}],"scene":0,"scenes":[{"nodes":[3]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/Dielectric.gltf.txt b/Tests/Resources/ExportTargets/Dielectric.gltf.txt index 6c15d41a..82a8e8b7 100644 --- a/Tests/Resources/ExportTargets/Dielectric.gltf.txt +++ b/Tests/Resources/ExportTargets/Dielectric.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.6.0"},"nodes":[{"name":"Sphere","mesh":0},{"name":"sphere 1","children":[0]},{"name":"Sphere","mesh":1},{"name":"sphere 2","children":[2],"translation":[0,0,1]},{"name":"Sphere","mesh":2},{"name":"sphere 3","children":[4],"translation":[0,0,2]},{"name":"Sphere","mesh":3},{"name":"sphere 4","children":[6],"translation":[0,0,3]},{"name":"Sphere","mesh":4},{"name":"sphere 5","children":[8],"translation":[0,0,4]},{"name":"Dielectric","children":[1,3,5,7,9],"translation":[-8,0,0]}],"buffers":[{"uri":"Dielectric.bin","byteLength":24576}],"bufferViews":[{"buffer":0,"byteLength":9216},{"buffer":0,"byteLength":11520,"byteOffset":9216,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20736,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":1,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":2304,"type":"SCALAR"}],"materials":[{"name":"Dielectric 1","pbrMetallicRoughness":{"baseColorFactor":[0.45914036,0.14717856,1,1],"metallicFactor":0,"roughnessFactor":0}},{"name":"Dielectric 2","pbrMetallicRoughness":{"baseColorFactor":[0.45914036,0.14717856,1,1],"metallicFactor":0,"roughnessFactor":0.25}},{"name":"Dielectric 3","pbrMetallicRoughness":{"baseColorFactor":[0.45914036,0.14717856,1,1],"metallicFactor":0,"roughnessFactor":0.5}},{"name":"Dielectric 4","pbrMetallicRoughness":{"baseColorFactor":[0.45914036,0.14717856,1,1],"metallicFactor":0,"roughnessFactor":0.75}},{"name":"Dielectric 5","pbrMetallicRoughness":{"baseColorFactor":[0.45914036,0.14717856,1,1],"metallicFactor":0}}],"meshes":[{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":1}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":2}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":3}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":4}]}],"scene":0,"scenes":[{"name":"Dielectric","nodes":[10]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Sphere","mesh":0},{"name":"sphere 1","children":[0]},{"name":"Sphere","mesh":1},{"name":"sphere 2","children":[2],"translation":[0,0,1]},{"name":"Sphere","mesh":2},{"name":"sphere 3","children":[4],"translation":[0,0,2]},{"name":"Sphere","mesh":3},{"name":"sphere 4","children":[6],"translation":[0,0,3]},{"name":"Sphere","mesh":4},{"name":"sphere 5","children":[8],"translation":[0,0,4]},{"name":"Dielectric","children":[1,3,5,7,9],"translation":[-8,0,0]}],"buffers":[{"uri":"Dielectric.bin","byteLength":24576}],"bufferViews":[{"buffer":0,"byteLength":9216,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9216,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20736,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":1,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":2304,"type":"SCALAR"}],"materials":[{"name":"Dielectric 1","pbrMetallicRoughness":{"baseColorFactor":[0.45914036,0.14717859,1,1],"metallicFactor":0,"roughnessFactor":0}},{"name":"Dielectric 2","pbrMetallicRoughness":{"baseColorFactor":[0.45914036,0.14717859,1,1],"metallicFactor":0,"roughnessFactor":0.25}},{"name":"Dielectric 3","pbrMetallicRoughness":{"baseColorFactor":[0.45914036,0.14717859,1,1],"metallicFactor":0,"roughnessFactor":0.5}},{"name":"Dielectric 4","pbrMetallicRoughness":{"baseColorFactor":[0.45914036,0.14717859,1,1],"metallicFactor":0,"roughnessFactor":0.75}},{"name":"Dielectric 5","pbrMetallicRoughness":{"baseColorFactor":[0.45914036,0.14717859,1,1],"metallicFactor":0}}],"meshes":[{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":1}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":2}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":3}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":4}]}],"scene":0,"scenes":[{"name":"Dielectric","nodes":[10]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/DoubleSided.gltf.txt b/Tests/Resources/ExportTargets/DoubleSided.gltf.txt index 0919cc18..8d31e773 100644 --- a/Tests/Resources/ExportTargets/DoubleSided.gltf.txt +++ b/Tests/Resources/ExportTargets/DoubleSided.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.6.0"},"nodes":[{"name":"DoubleSided","mesh":0,"translation":[-18,0,0],"rotation":[-0.5,-0.5,-0.5,0.5]}],"buffers":[{"uri":"DoubleSided.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"DoubleSided","pbrMetallicRoughness":{"baseColorFactor":[0,0.008149115,1,1],"metallicFactor":0,"roughnessFactor":0.7},"doubleSided":true}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"DoubleSided","nodes":[0]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"DoubleSided","mesh":0,"translation":[-18,0,0],"rotation":[-0.5,-0.5,-0.5,0.5]}],"buffers":[{"uri":"DoubleSided.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"DoubleSided","pbrMetallicRoughness":{"baseColorFactor":[0,0.00814912,1,1],"metallicFactor":0,"roughnessFactor":0.7},"doubleSided":true}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"DoubleSided","nodes":[0]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/EmissiveFactor.gltf.txt b/Tests/Resources/ExportTargets/EmissiveFactor.gltf.txt index 8772efdc..d6a4f661 100644 --- a/Tests/Resources/ExportTargets/EmissiveFactor.gltf.txt +++ b/Tests/Resources/ExportTargets/EmissiveFactor.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2021.3.12f1 glTFast 4.8.5"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"EmissiveFactor","children":[0,2],"translation":[-22,0,0]}],"buffers":[{"uri":"EmissiveFactor.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"materials":[{"name":"EmissiveFactor","pbrMetallicRoughness":{"baseColorFactor":[0,0,0,1],"metallicFactor":0},"emissiveFactor":[1,1,0]}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"EmissiveFactor","nodes":[3]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"EmissiveFactor","children":[0,2],"translation":[-22,0,0]}],"buffers":[{"uri":"EmissiveFactor.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"materials":[{"name":"EmissiveFactor","pbrMetallicRoughness":{"baseColorFactor":[0,0,0,1],"metallicFactor":0},"emissiveFactor":[1,1,0]}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"EmissiveFactor","nodes":[3]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/EmissiveTexture.gltf.txt b/Tests/Resources/ExportTargets/EmissiveTexture.gltf.txt index 52d013b6..261389af 100644 --- a/Tests/Resources/ExportTargets/EmissiveTexture.gltf.txt +++ b/Tests/Resources/ExportTargets/EmissiveTexture.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2021.3.21f1 glTFast 5.0.4"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"EmissiveTexture","children":[0,2],"translation":[-23,0,0]}],"buffers":[{"uri":"EmissiveTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"emissive.jpg","uri":"emissive.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"EmissiveTexture","pbrMetallicRoughness":{"baseColorFactor":[0,0,0,1],"metallicFactor":0},"emissiveTexture":{"index":0},"emissiveFactor":[1,1,1]}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"EmissiveTexture","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"EmissiveTexture","children":[0,2],"translation":[-23,0,0]}],"buffers":[{"uri":"EmissiveTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"emissive.jpg","uri":"emissive.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"EmissiveTexture","pbrMetallicRoughness":{"baseColorFactor":[0,0,0,1],"metallicFactor":0},"emissiveTexture":{"index":0},"emissiveFactor":[1,1,1]}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"EmissiveTexture","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/EmissiveTextureFactor.gltf.txt b/Tests/Resources/ExportTargets/EmissiveTextureFactor.gltf.txt index f591e88c..fc8c9574 100644 --- a/Tests/Resources/ExportTargets/EmissiveTextureFactor.gltf.txt +++ b/Tests/Resources/ExportTargets/EmissiveTextureFactor.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2021.3.21f1 glTFast 5.0.4"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"EmissiveTextureFactor","children":[0,2],"translation":[-24,0,0]}],"extensionsRequired":["KHR_texture_transform"],"extensionsUsed":["KHR_texture_transform"],"buffers":[{"uri":"EmissiveTextureFactor.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"emissive.jpg","uri":"emissive.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"EmissiveTextureFactor","pbrMetallicRoughness":{"baseColorFactor":[0,0,0,1],"metallicFactor":0},"emissiveTexture":{"index":0,"extensions":{"KHR_texture_transform":{"offset":[0,-2],"scale":[2,3]}}},"emissiveFactor":[1,0.5,0]}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"EmissiveTextureFactor","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"EmissiveTextureFactor","children":[0,2],"translation":[-24,0,0]}],"extensionsRequired":["KHR_texture_transform"],"extensionsUsed":["KHR_texture_transform"],"buffers":[{"uri":"EmissiveTextureFactor.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"emissive.jpg","uri":"emissive.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"EmissiveTextureFactor","pbrMetallicRoughness":{"baseColorFactor":[0,0,0,1],"metallicFactor":0},"emissiveTexture":{"index":0,"extensions":{"KHR_texture_transform":{"offset":[0,-2],"scale":[2,3]}}},"emissiveFactor":[1,0.5,0]}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"EmissiveTextureFactor","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/HDRP/BaseColorSmoothnessMetalOcclusionTexture.gltf.txt b/Tests/Resources/ExportTargets/HDRP/BaseColorSmoothnessMetalOcclusionTexture.gltf.txt index 236cf6b3..dfa007fd 100644 --- a/Tests/Resources/ExportTargets/HDRP/BaseColorSmoothnessMetalOcclusionTexture.gltf.txt +++ b/Tests/Resources/ExportTargets/HDRP/BaseColorSmoothnessMetalOcclusionTexture.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2021.3.21f1 glTFast 5.0.4"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"BaseColorSmoothnessMetalOcclusionTexture","children":[0,2],"translation":[-31,0,0]}],"buffers":[{"uri":"BaseColorSmoothnessMetalOcclusionTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"ColorGridAlpha.jpg","uri":"ColorGridAlpha.jpg","mimeType":"image/jpeg"},{"name":"BaseColorSmoothnessMetalOcclusionTexture_MaskMap.jpg","uri":"BaseColorSmoothnessMetalOcclusionTexture_MaskMap.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"BaseColorSmoothnessMetalOcclusionTexture","pbrMetallicRoughness":{"baseColorTexture":{"index":0},"metallicRoughnessTexture":{"index":1}},"occlusionTexture":{"index":1}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"samplers":[{"magFilter":9728,"minFilter":9728}],"scene":0,"scenes":[{"name":"BaseColorSmoothnessMetalOcclusionTexture","nodes":[3]}],"textures":[{"source":0},{"source":1,"sampler":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"BaseColorSmoothnessMetalOcclusionTexture","children":[0,2],"translation":[-31,0,0]}],"buffers":[{"uri":"BaseColorSmoothnessMetalOcclusionTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"ColorGridAlpha.jpg","uri":"ColorGridAlpha.jpg","mimeType":"image/jpeg"},{"name":"BaseColorSmoothnessMetalOcclusionTexture_MaskMap.jpg","uri":"BaseColorSmoothnessMetalOcclusionTexture_MaskMap.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"BaseColorSmoothnessMetalOcclusionTexture","pbrMetallicRoughness":{"baseColorTexture":{"index":0},"metallicRoughnessTexture":{"index":1}},"occlusionTexture":{"index":1}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"samplers":[{"magFilter":9728,"minFilter":9728}],"scene":0,"scenes":[{"name":"BaseColorSmoothnessMetalOcclusionTexture","nodes":[3]}],"textures":[{"source":0},{"source":1,"sampler":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/HDRP/BaseColorSmoothnessMetalTexture.gltf.txt b/Tests/Resources/ExportTargets/HDRP/BaseColorSmoothnessMetalTexture.gltf.txt index bcf5e779..1931a8dc 100644 --- a/Tests/Resources/ExportTargets/HDRP/BaseColorSmoothnessMetalTexture.gltf.txt +++ b/Tests/Resources/ExportTargets/HDRP/BaseColorSmoothnessMetalTexture.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2021.3.21f1 glTFast 5.0.4"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"BaseColorSmoothnessMetalTexture","children":[0,2],"translation":[-30,0,0]}],"buffers":[{"uri":"BaseColorSmoothnessMetalTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"ColorGridAlpha.jpg","uri":"ColorGridAlpha.jpg","mimeType":"image/jpeg"},{"name":"BaseColorSmoothnessMetalTexture_MaskMap.jpg","uri":"BaseColorSmoothnessMetalTexture_MaskMap.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"BaseColorSmoothnessMetalTexture","pbrMetallicRoughness":{"baseColorTexture":{"index":0},"metallicRoughnessTexture":{"index":1}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"samplers":[{"magFilter":9728,"minFilter":9728}],"scene":0,"scenes":[{"name":"BaseColorSmoothnessMetalTexture","nodes":[3]}],"textures":[{"source":0},{"source":1,"sampler":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"BaseColorSmoothnessMetalTexture","children":[0,2],"translation":[-30,0,0]}],"buffers":[{"uri":"BaseColorSmoothnessMetalTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"ColorGridAlpha.jpg","uri":"ColorGridAlpha.jpg","mimeType":"image/jpeg"},{"name":"BaseColorSmoothnessMetalTexture_MaskMap.jpg","uri":"BaseColorSmoothnessMetalTexture_MaskMap.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"BaseColorSmoothnessMetalTexture","pbrMetallicRoughness":{"baseColorTexture":{"index":0},"metallicRoughnessTexture":{"index":1}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"samplers":[{"magFilter":9728,"minFilter":9728}],"scene":0,"scenes":[{"name":"BaseColorSmoothnessMetalTexture","nodes":[3]}],"textures":[{"source":0},{"source":1,"sampler":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/HDRP/BaseColorSmoothnessTexture.gltf.txt b/Tests/Resources/ExportTargets/HDRP/BaseColorSmoothnessTexture.gltf.txt index 0dbb9c63..f07f9ff1 100644 --- a/Tests/Resources/ExportTargets/HDRP/BaseColorSmoothnessTexture.gltf.txt +++ b/Tests/Resources/ExportTargets/HDRP/BaseColorSmoothnessTexture.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2021.3.21f1 glTFast 5.0.4"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"BaseColorSmoothnessTexture","children":[0,2],"translation":[-29,0,0]}],"buffers":[{"uri":"BaseColorSmoothnessTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"ColorGridAlpha.jpg","uri":"ColorGridAlpha.jpg","mimeType":"image/jpeg"},{"name":"BaseColorSmoothnessTexture_MaskMap.jpg","uri":"BaseColorSmoothnessTexture_MaskMap.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"BaseColorSmoothnessTexture","pbrMetallicRoughness":{"metallicFactor":0,"baseColorTexture":{"index":0},"metallicRoughnessTexture":{"index":1}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"BaseColorSmoothnessTexture","nodes":[3]}],"textures":[{"source":0},{"source":1}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"BaseColorSmoothnessTexture","children":[0,2],"translation":[-29,0,0]}],"buffers":[{"uri":"BaseColorSmoothnessTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"ColorGridAlpha.jpg","uri":"ColorGridAlpha.jpg","mimeType":"image/jpeg"},{"name":"BaseColorSmoothnessTexture_MaskMap.jpg","uri":"BaseColorSmoothnessTexture_MaskMap.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"BaseColorSmoothnessTexture","pbrMetallicRoughness":{"metallicFactor":0,"baseColorTexture":{"index":0},"metallicRoughnessTexture":{"index":1}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"BaseColorSmoothnessTexture","nodes":[3]}],"textures":[{"source":0},{"source":1}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/HDRP/BoxVertexColors.gltf.txt b/Tests/Resources/ExportTargets/HDRP/BoxVertexColors.gltf.txt index f9be45ae..dc513a62 100644 --- a/Tests/Resources/ExportTargets/HDRP/BoxVertexColors.gltf.txt +++ b/Tests/Resources/ExportTargets/HDRP/BoxVertexColors.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2022.3.27f1 glTFast 6.4.0"},"nodes":[{"name":"Cube","mesh":0},{"name":"Mesh"},{"name":"Texture Group"},{"name":"RootNode","children":[0,1,2]},{"name":"BoxVertexColors","children":[3],"translation":[-35,0,0]}],"buffers":[{"uri":"BoxVertexColors.bin","byteLength":1104}],"bufferViews":[{"buffer":0,"byteLength":144},{"buffer":0,"byteLength":576,"byteOffset":144,"byteStride":24},{"buffer":0,"byteLength":384,"byteOffset":720,"byteStride":16}],"accessors":[{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":24,"type":"VEC4"},{"bufferView":0,"componentType":5125,"count":36,"type":"SCALAR"}],"meshes":[{"name":"Cube","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"COLOR_0":2},"indices":3}]}],"scene":0,"scenes":[{"name":"BoxVertexColors","nodes":[4]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Cube","mesh":0},{"name":"Mesh"},{"name":"Texture Group"},{"name":"RootNode","children":[0,1,2]},{"name":"BoxVertexColors","children":[3],"translation":[-35,0,0]}],"buffers":[{"uri":"BoxVertexColors.bin","byteLength":1104}],"bufferViews":[{"buffer":0,"byteLength":144,"target":34963},{"buffer":0,"byteLength":576,"byteOffset":144,"byteStride":24,"target":34962},{"buffer":0,"byteLength":384,"byteOffset":720,"byteStride":16,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":24,"type":"VEC4"},{"bufferView":0,"componentType":5125,"count":36,"type":"SCALAR"}],"meshes":[{"name":"Cube","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"COLOR_0":2},"indices":3}]}],"scene":0,"scenes":[{"name":"BoxVertexColors","nodes":[4]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/HDRP/ClearcoatFactor.gltf.txt b/Tests/Resources/ExportTargets/HDRP/ClearcoatFactor.gltf.txt index a77bb5bc..7ec8c16b 100644 --- a/Tests/Resources/ExportTargets/HDRP/ClearcoatFactor.gltf.txt +++ b/Tests/Resources/ExportTargets/HDRP/ClearcoatFactor.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2021.3.28f1 glTFast 5.1.0"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"ClearcoatFactor","children":[0,2],"translation":[-39,0,0]}],"extensionsRequired":["KHR_materials_clearcoat"],"extensionsUsed":["KHR_materials_clearcoat"],"buffers":[{"uri":"ClearcoatFactor.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"materials":[{"name":"ClearcoatFactor","pbrMetallicRoughness":{"baseColorFactor":[1,0,0,1],"metallicFactor":0,"roughnessFactor":0.5},"extensions":{"KHR_materials_clearcoat":{"clearcoatFactor":1}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"ClearcoatFactor","nodes":[3]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"ClearcoatFactor","children":[0,2],"translation":[-39,0,0]}],"extensionsRequired":["KHR_materials_clearcoat"],"extensionsUsed":["KHR_materials_clearcoat"],"buffers":[{"uri":"ClearcoatFactor.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"materials":[{"name":"ClearcoatFactor","pbrMetallicRoughness":{"baseColorFactor":[1,0,0,1],"metallicFactor":0,"roughnessFactor":0.5},"extensions":{"KHR_materials_clearcoat":{"clearcoatFactor":1}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"ClearcoatFactor","nodes":[3]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/HDRP/ClearcoatTexture.gltf.txt b/Tests/Resources/ExportTargets/HDRP/ClearcoatTexture.gltf.txt index 3dc3faca..084b74e8 100644 --- a/Tests/Resources/ExportTargets/HDRP/ClearcoatTexture.gltf.txt +++ b/Tests/Resources/ExportTargets/HDRP/ClearcoatTexture.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2021.3.28f1 glTFast 5.1.0"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"ClearcoatTexture","children":[0,2],"translation":[-40,0,0]}],"extensionsRequired":["KHR_materials_clearcoat"],"extensionsUsed":["KHR_materials_clearcoat"],"buffers":[{"uri":"ClearcoatTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"clearcoat.jpg","uri":"clearcoat.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"ClearcoatTexture","pbrMetallicRoughness":{"baseColorFactor":[1,0,0,1],"metallicFactor":0,"roughnessFactor":0.5},"extensions":{"KHR_materials_clearcoat":{"clearcoatFactor":1,"clearcoatTexture":{"index":0}}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"ClearcoatTexture","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"ClearcoatTexture","children":[0,2],"translation":[-40,0,0]}],"extensionsRequired":["KHR_materials_clearcoat"],"extensionsUsed":["KHR_materials_clearcoat"],"buffers":[{"uri":"ClearcoatTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"clearcoat.jpg","uri":"clearcoat.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"ClearcoatTexture","pbrMetallicRoughness":{"baseColorFactor":[1,0,0,1],"metallicFactor":0,"roughnessFactor":0.5},"extensions":{"KHR_materials_clearcoat":{"clearcoatFactor":1,"clearcoatTexture":{"index":0}}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"ClearcoatTexture","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/HDRP/Dielectric.gltf.txt b/Tests/Resources/ExportTargets/HDRP/Dielectric.gltf.txt index 5ba7e5ec..849f403f 100644 --- a/Tests/Resources/ExportTargets/HDRP/Dielectric.gltf.txt +++ b/Tests/Resources/ExportTargets/HDRP/Dielectric.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.6.0"},"nodes":[{"name":"Sphere","mesh":0},{"name":"sphere 1","children":[0]},{"name":"Sphere","mesh":1},{"name":"sphere 2","children":[2],"translation":[0,0,1]},{"name":"Sphere","mesh":2},{"name":"sphere 3","children":[4],"translation":[0,0,2]},{"name":"Sphere","mesh":3},{"name":"sphere 4","children":[6],"translation":[0,0,3]},{"name":"Sphere","mesh":4},{"name":"sphere 5","children":[8],"translation":[0,0,4]},{"name":"Dielectric","children":[1,3,5,7,9],"translation":[-8,0,0]}],"buffers":[{"uri":"Dielectric.bin","byteLength":24576}],"bufferViews":[{"buffer":0,"byteLength":9216},{"buffer":0,"byteLength":11520,"byteOffset":9216,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20736,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":1,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":2304,"type":"SCALAR"}],"materials":[{"name":"Dielectric 1","pbrMetallicRoughness":{"baseColorFactor":[0.45914036,0.147178546,1,1],"metallicFactor":0,"roughnessFactor":0}},{"name":"Dielectric 2","pbrMetallicRoughness":{"baseColorFactor":[0.45914036,0.147178546,1,1],"metallicFactor":0,"roughnessFactor":0.25}},{"name":"Dielectric 3","pbrMetallicRoughness":{"baseColorFactor":[0.45914036,0.147178546,1,1],"metallicFactor":0,"roughnessFactor":0.5}},{"name":"Dielectric 4","pbrMetallicRoughness":{"baseColorFactor":[0.45914036,0.147178546,1,1],"metallicFactor":0,"roughnessFactor":0.75}},{"name":"Dielectric 5","pbrMetallicRoughness":{"baseColorFactor":[0.45914036,0.147178546,1,1],"metallicFactor":0}}],"meshes":[{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":1}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":2}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":3}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":4}]}],"scene":0,"scenes":[{"name":"Dielectric","nodes":[10]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Sphere","mesh":0},{"name":"sphere 1","children":[0]},{"name":"Sphere","mesh":1},{"name":"sphere 2","children":[2],"translation":[0,0,1]},{"name":"Sphere","mesh":2},{"name":"sphere 3","children":[4],"translation":[0,0,2]},{"name":"Sphere","mesh":3},{"name":"sphere 4","children":[6],"translation":[0,0,3]},{"name":"Sphere","mesh":4},{"name":"sphere 5","children":[8],"translation":[0,0,4]},{"name":"Dielectric","children":[1,3,5,7,9],"translation":[-8,0,0]}],"buffers":[{"uri":"Dielectric.bin","byteLength":24576}],"bufferViews":[{"buffer":0,"byteLength":9216,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9216,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20736,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":1,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":2304,"type":"SCALAR"}],"materials":[{"name":"Dielectric 1","pbrMetallicRoughness":{"baseColorFactor":[0.45914036,0.147178546,1,1],"metallicFactor":0,"roughnessFactor":0}},{"name":"Dielectric 2","pbrMetallicRoughness":{"baseColorFactor":[0.45914036,0.147178546,1,1],"metallicFactor":0,"roughnessFactor":0.25}},{"name":"Dielectric 3","pbrMetallicRoughness":{"baseColorFactor":[0.45914036,0.147178546,1,1],"metallicFactor":0,"roughnessFactor":0.5}},{"name":"Dielectric 4","pbrMetallicRoughness":{"baseColorFactor":[0.45914036,0.147178546,1,1],"metallicFactor":0,"roughnessFactor":0.75}},{"name":"Dielectric 5","pbrMetallicRoughness":{"baseColorFactor":[0.45914036,0.147178546,1,1],"metallicFactor":0}}],"meshes":[{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":1}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":2}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":3}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":4}]}],"scene":0,"scenes":[{"name":"Dielectric","nodes":[10]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/HDRP/DoubleSided.gltf.txt b/Tests/Resources/ExportTargets/HDRP/DoubleSided.gltf.txt index 0919cc18..e148d600 100644 --- a/Tests/Resources/ExportTargets/HDRP/DoubleSided.gltf.txt +++ b/Tests/Resources/ExportTargets/HDRP/DoubleSided.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.6.0"},"nodes":[{"name":"DoubleSided","mesh":0,"translation":[-18,0,0],"rotation":[-0.5,-0.5,-0.5,0.5]}],"buffers":[{"uri":"DoubleSided.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"DoubleSided","pbrMetallicRoughness":{"baseColorFactor":[0,0.008149115,1,1],"metallicFactor":0,"roughnessFactor":0.7},"doubleSided":true}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"DoubleSided","nodes":[0]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"DoubleSided","mesh":0,"translation":[-18,0,0],"rotation":[-0.5,-0.5,-0.5,0.5]}],"buffers":[{"uri":"DoubleSided.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"DoubleSided","pbrMetallicRoughness":{"baseColorFactor":[0,0.008149115,1,1],"metallicFactor":0,"roughnessFactor":0.7},"doubleSided":true}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"DoubleSided","nodes":[0]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/HDRP/LightAreaDisc.gltf.txt b/Tests/Resources/ExportTargets/HDRP/LightAreaDisc.gltf.txt index 2567c2d3..c0ceb10b 100644 --- a/Tests/Resources/ExportTargets/HDRP/LightAreaDisc.gltf.txt +++ b/Tests/Resources/ExportTargets/HDRP/LightAreaDisc.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 6000.0.0b11 glTFast 6.2.0"},"nodes":[{"name":"Light","children":[1],"translation":[0,1,0],"rotation":[0.482962936,-0.224143922,0.129409552,0.8365163]},{"name":"Light_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":0}}},{"name":"Plane","mesh":0,"scale":[10,10,10]},{"name":"LightAreaDisc","children":[0,2],"translation":[-45,0,10]}],"extensionsRequired":["KHR_lights_punctual"],"extensionsUsed":["KHR_lights_punctual"],"buffers":[{"uri":"LightAreaDisc.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"Neutral","pbrMetallicRoughness":{"metallicFactor":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"LightAreaDisc","nodes":[3]}],"extensions":{"KHR_lights_punctual":{"lights":[{"type":"spot","name":"Light","color":[0.6038274,0.0331047624,0.0331047624],"intensity":81.0569458,"range":100,"spot":{"innerConeAngle":0.305432618,"outerConeAngle":0.3926991}}]}}} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Light","children":[3],"translation":[0,1,0],"rotation":[0.482962936,-0.224143922,0.129409552,0.8365163]},{"name":"Plane","mesh":0,"scale":[10,10,10]},{"name":"LightAreaDisc","children":[0,1],"translation":[-45,0,10]},{"name":"Light_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":0}}}],"extensionsRequired":["KHR_lights_punctual"],"extensionsUsed":["KHR_lights_punctual"],"buffers":[{"uri":"LightAreaDisc.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"Neutral","pbrMetallicRoughness":{"metallicFactor":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"LightAreaDisc","nodes":[2]}],"extensions":{"KHR_lights_punctual":{"lights":[{"type":"spot","name":"Light","color":[0.6038274,0.0331047624,0.0331047624],"intensity":81.0569458,"range":100,"spot":{"innerConeAngle":0.305432618,"outerConeAngle":0.3926991}}]}}} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/HDRP/LightAreaRectangle.gltf.txt b/Tests/Resources/ExportTargets/HDRP/LightAreaRectangle.gltf.txt index 0b68fe4e..0c020215 100644 --- a/Tests/Resources/ExportTargets/HDRP/LightAreaRectangle.gltf.txt +++ b/Tests/Resources/ExportTargets/HDRP/LightAreaRectangle.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 6000.0.0b11 glTFast 6.2.0"},"nodes":[{"name":"Light","children":[1],"translation":[0,1,0],"rotation":[0.482962936,-0.224143922,0.129409552,0.8365163]},{"name":"Light_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":0}}},{"name":"Plane","mesh":0,"scale":[10,10,10]},{"name":"LightAreaRectangle","children":[0,2],"translation":[-35,0,10]}],"extensionsRequired":["KHR_lights_punctual"],"extensionsUsed":["KHR_lights_punctual"],"buffers":[{"uri":"LightAreaRectangle.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"Neutral","pbrMetallicRoughness":{"metallicFactor":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"LightAreaRectangle","nodes":[3]}],"extensions":{"KHR_lights_punctual":{"lights":[{"type":"spot","name":"Light","color":[0.6038274,0.0331047624,0.0331047624],"intensity":254.6479,"range":100,"spot":{"innerConeAngle":0.305432618,"outerConeAngle":0.3926991}}]}}} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Light","children":[3],"translation":[0,1,0],"rotation":[0.482962936,-0.224143922,0.129409552,0.8365163]},{"name":"Plane","mesh":0,"scale":[10,10,10]},{"name":"LightAreaRectangle","children":[0,1],"translation":[-35,0,10]},{"name":"Light_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":0}}}],"extensionsRequired":["KHR_lights_punctual"],"extensionsUsed":["KHR_lights_punctual"],"buffers":[{"uri":"LightAreaRectangle.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"Neutral","pbrMetallicRoughness":{"metallicFactor":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"LightAreaRectangle","nodes":[2]}],"extensions":{"KHR_lights_punctual":{"lights":[{"type":"spot","name":"Light","color":[0.6038274,0.0331047624,0.0331047624],"intensity":254.6479,"range":100,"spot":{"innerConeAngle":0.305432618,"outerConeAngle":0.3926991}}]}}} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/HDRP/LightDirectional.gltf.txt b/Tests/Resources/ExportTargets/HDRP/LightDirectional.gltf.txt index c1583a55..37fdd687 100644 --- a/Tests/Resources/ExportTargets/HDRP/LightDirectional.gltf.txt +++ b/Tests/Resources/ExportTargets/HDRP/LightDirectional.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.41f1 glTFast 5.0.0-exp.1"},"nodes":[{"name":"Light","children":[1],"translation":[0,1,0],"rotation":[0.482962936,-0.224143922,0.129409552,0.8365163]},{"name":"Light_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":0}}},{"name":"Plane","mesh":0,"scale":[10,10,10]},{"name":"LightDirectional","children":[0,2],"translation":[-25,0,10]}],"extensionsRequired":["KHR_lights_punctual"],"extensionsUsed":["KHR_lights_punctual"],"buffers":[{"uri":"LightDirectional.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"Neutral","pbrMetallicRoughness":{"metallicFactor":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"LightDirectional","nodes":[3]}],"extensions":{"KHR_lights_punctual":{"lights":[{"type":"directional","name":"Light","color":[0.6038274,0.0331047624,0.0331047624],"intensity":0.1}]}}} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Light","children":[3],"translation":[0,1,0],"rotation":[0.482962936,-0.224143922,0.129409552,0.8365163]},{"name":"Plane","mesh":0,"scale":[10,10,10]},{"name":"LightDirectional","children":[0,1],"translation":[-25,0,10]},{"name":"Light_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":0}}}],"extensionsRequired":["KHR_lights_punctual"],"extensionsUsed":["KHR_lights_punctual"],"buffers":[{"uri":"LightDirectional.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"Neutral","pbrMetallicRoughness":{"metallicFactor":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"LightDirectional","nodes":[2]}],"extensions":{"KHR_lights_punctual":{"lights":[{"type":"directional","name":"Light","color":[0.6038274,0.0331047624,0.0331047624],"intensity":0.1}]}}} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/HDRP/LightsPoint.gltf.txt b/Tests/Resources/ExportTargets/HDRP/LightsPoint.gltf.txt index 31d66c7b..6f92cc8e 100644 --- a/Tests/Resources/ExportTargets/HDRP/LightsPoint.gltf.txt +++ b/Tests/Resources/ExportTargets/HDRP/LightsPoint.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.41f1 glTFast 5.0.0-exp.1"},"nodes":[{"name":"Red","translation":[1,1,-1.73205],"extensions":{"KHR_lights_punctual":{"light":0}}},{"name":"Green","translation":[1,1,1.73205],"extensions":{"KHR_lights_punctual":{"light":1}}},{"name":"Blue","translation":[-2,1,0],"extensions":{"KHR_lights_punctual":{"light":2}}},{"name":"Plane","mesh":0,"scale":[10,10,10]},{"name":"LightsPoint","children":[0,1,2,3],"translation":[-5,0,10]}],"extensionsRequired":["KHR_lights_punctual"],"extensionsUsed":["KHR_lights_punctual"],"buffers":[{"uri":"LightsPoint.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"Neutral","pbrMetallicRoughness":{"metallicFactor":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"LightsPoint","nodes":[4]}],"extensions":{"KHR_lights_punctual":{"lights":[{"type":"point","name":"Red","color":[1,0,0],"intensity":50,"range":10},{"type":"point","name":"Green","color":[0,1,0],"intensity":50,"range":10},{"type":"point","name":"Blue","color":[0,0,1],"intensity":50,"range":10}]}}} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Red","translation":[1,1,-1.73205],"extensions":{"KHR_lights_punctual":{"light":0}}},{"name":"Green","translation":[1,1,1.73205],"extensions":{"KHR_lights_punctual":{"light":1}}},{"name":"Blue","translation":[-2,1,0],"extensions":{"KHR_lights_punctual":{"light":2}}},{"name":"Plane","mesh":0,"scale":[10,10,10]},{"name":"LightsPoint","children":[0,1,2,3],"translation":[-5,0,10]}],"extensionsRequired":["KHR_lights_punctual"],"extensionsUsed":["KHR_lights_punctual"],"buffers":[{"uri":"LightsPoint.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"Neutral","pbrMetallicRoughness":{"metallicFactor":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"LightsPoint","nodes":[4]}],"extensions":{"KHR_lights_punctual":{"lights":[{"type":"point","name":"Red","color":[1,0,0],"intensity":50,"range":10},{"type":"point","name":"Green","color":[0,1,0],"intensity":50,"range":10},{"type":"point","name":"Blue","color":[0,0,1],"intensity":50,"range":10}]}}} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/HDRP/LightsSpot.gltf.txt b/Tests/Resources/ExportTargets/HDRP/LightsSpot.gltf.txt index 7844fb43..f5218309 100644 --- a/Tests/Resources/ExportTargets/HDRP/LightsSpot.gltf.txt +++ b/Tests/Resources/ExportTargets/HDRP/LightsSpot.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.41f1 glTFast 5.0.0-exp.1"},"nodes":[{"name":"Red","children":[1],"translation":[1,12,-1.73205],"rotation":[0.7071068,0,0,0.7071068]},{"name":"Red_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":0}}},{"name":"Green","children":[3],"translation":[1,12,1.73205],"rotation":[0.7071068,0,0,0.7071068]},{"name":"Green_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":1}}},{"name":"Blue","children":[5],"translation":[-2,12,0],"rotation":[0.7071068,0,0,0.7071068]},{"name":"Blue_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":2}}},{"name":"Plane","mesh":0,"scale":[10,10,10]},{"name":"LightsSpot","children":[0,2,4,6],"translation":[-15,0,10]}],"extensionsRequired":["KHR_lights_punctual"],"extensionsUsed":["KHR_lights_punctual"],"buffers":[{"uri":"LightsSpot.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"Neutral","pbrMetallicRoughness":{"metallicFactor":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"LightsSpot","nodes":[7]}],"extensions":{"KHR_lights_punctual":{"lights":[{"type":"spot","name":"Red","color":[1,0,0],"intensity":400,"range":100,"spot":{"innerConeAngle":0.190259039,"outerConeAngle":0.2617994}},{"type":"spot","name":"Green","color":[0,1,0],"intensity":400,"range":100,"spot":{"innerConeAngle":0.190259039,"outerConeAngle":0.2617994}},{"type":"spot","name":"Blue","color":[0,0,1],"intensity":400,"range":100,"spot":{"innerConeAngle":0.190259039,"outerConeAngle":0.2617994}}]}}} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Red","children":[5],"translation":[1,12,-1.73205],"rotation":[0.7071068,0,0,0.7071068]},{"name":"Green","children":[6],"translation":[1,12,1.73205],"rotation":[0.7071068,0,0,0.7071068]},{"name":"Blue","children":[7],"translation":[-2,12,0],"rotation":[0.7071068,0,0,0.7071068]},{"name":"Plane","mesh":0,"scale":[10,10,10]},{"name":"LightsSpot","children":[0,1,2,3],"translation":[-15,0,10]},{"name":"Red_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":0}}},{"name":"Green_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":1}}},{"name":"Blue_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":2}}}],"extensionsRequired":["KHR_lights_punctual"],"extensionsUsed":["KHR_lights_punctual"],"buffers":[{"uri":"LightsSpot.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"Neutral","pbrMetallicRoughness":{"metallicFactor":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"LightsSpot","nodes":[4]}],"extensions":{"KHR_lights_punctual":{"lights":[{"type":"spot","name":"Red","color":[1,0,0],"intensity":400,"range":100,"spot":{"innerConeAngle":0.190259039,"outerConeAngle":0.2617994}},{"type":"spot","name":"Green","color":[0,1,0],"intensity":400,"range":100,"spot":{"innerConeAngle":0.190259039,"outerConeAngle":0.2617994}},{"type":"spot","name":"Blue","color":[0,0,1],"intensity":400,"range":100,"spot":{"innerConeAngle":0.190259039,"outerConeAngle":0.2617994}}]}}} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/HDRP/MetallicSmoothnessOcclusionTexture.gltf.txt b/Tests/Resources/ExportTargets/HDRP/MetallicSmoothnessOcclusionTexture.gltf.txt index 50f21166..a7f60461 100644 --- a/Tests/Resources/ExportTargets/HDRP/MetallicSmoothnessOcclusionTexture.gltf.txt +++ b/Tests/Resources/ExportTargets/HDRP/MetallicSmoothnessOcclusionTexture.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.6.0"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"MetallicSmoothnessOcclusionTexture","children":[0,2],"translation":[-28,0,0]}],"buffers":[{"uri":"MetallicSmoothnessOcclusionTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"MetallicSmoothnessOcclusionTexture_MaskMap.jpg","uri":"MetallicSmoothnessOcclusionTexture_MaskMap.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"MetallicSmoothnessOcclusionTexture","pbrMetallicRoughness":{"baseColorFactor":[0.0761853456,0.87672466,1,1],"metallicRoughnessTexture":{"index":0}},"occlusionTexture":{"index":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"samplers":[{"magFilter":9728,"minFilter":9728}],"scene":0,"scenes":[{"name":"MetallicSmoothnessOcclusionTexture","nodes":[3]}],"textures":[{"source":0,"sampler":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"MetallicSmoothnessOcclusionTexture","children":[0,2],"translation":[-28,0,0]}],"buffers":[{"uri":"MetallicSmoothnessOcclusionTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"MetallicSmoothnessOcclusionTexture_MaskMap.jpg","uri":"MetallicSmoothnessOcclusionTexture_MaskMap.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"MetallicSmoothnessOcclusionTexture","pbrMetallicRoughness":{"baseColorFactor":[0.0761853456,0.87672466,1,1],"metallicRoughnessTexture":{"index":0}},"occlusionTexture":{"index":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"samplers":[{"magFilter":9728,"minFilter":9728}],"scene":0,"scenes":[{"name":"MetallicSmoothnessOcclusionTexture","nodes":[3]}],"textures":[{"source":0,"sampler":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/HDRP/MetallicSmoothnessTexture.gltf.txt b/Tests/Resources/ExportTargets/HDRP/MetallicSmoothnessTexture.gltf.txt index e45e95b1..20865548 100644 --- a/Tests/Resources/ExportTargets/HDRP/MetallicSmoothnessTexture.gltf.txt +++ b/Tests/Resources/ExportTargets/HDRP/MetallicSmoothnessTexture.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.6.0"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"MetallicSmoothnessTexture","children":[0,2],"translation":[-27,0,0]}],"buffers":[{"uri":"MetallicSmoothnessTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"MetallicSmoothnessTexture_MaskMap.jpg","uri":"MetallicSmoothnessTexture_MaskMap.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"MetallicSmoothnessTexture","pbrMetallicRoughness":{"baseColorFactor":[0.0761853456,1,0.125470772,1],"metallicRoughnessTexture":{"index":0}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"samplers":[{"magFilter":9728,"minFilter":9728}],"scene":0,"scenes":[{"name":"MetallicSmoothnessTexture","nodes":[3]}],"textures":[{"source":0,"sampler":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"MetallicSmoothnessTexture","children":[0,2],"translation":[-27,0,0]}],"buffers":[{"uri":"MetallicSmoothnessTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"MetallicSmoothnessTexture_MaskMap.jpg","uri":"MetallicSmoothnessTexture_MaskMap.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"MetallicSmoothnessTexture","pbrMetallicRoughness":{"baseColorFactor":[0.0761853456,1,0.125470772,1],"metallicRoughnessTexture":{"index":0}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"samplers":[{"magFilter":9728,"minFilter":9728}],"scene":0,"scenes":[{"name":"MetallicSmoothnessTexture","nodes":[3]}],"textures":[{"source":0,"sampler":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/HDRP/MetallicTexture.gltf.txt b/Tests/Resources/ExportTargets/HDRP/MetallicTexture.gltf.txt index a869aa02..1d5b14a5 100644 --- a/Tests/Resources/ExportTargets/HDRP/MetallicTexture.gltf.txt +++ b/Tests/Resources/ExportTargets/HDRP/MetallicTexture.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.6.0"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"MetallicTexture","children":[0,2],"translation":[-26,0,0]}],"buffers":[{"uri":"MetallicTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"MetallicTexture_MaskMap.jpg","uri":"MetallicTexture_MaskMap.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"MetallicTexture","pbrMetallicRoughness":{"baseColorFactor":[0.0761853456,1,0.125470772,1],"metallicRoughnessTexture":{"index":0}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"samplers":[{"magFilter":9728,"minFilter":9728}],"scene":0,"scenes":[{"name":"MetallicTexture","nodes":[3]}],"textures":[{"source":0,"sampler":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"MetallicTexture","children":[0,2],"translation":[-26,0,0]}],"buffers":[{"uri":"MetallicTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"MetallicTexture_MaskMap.jpg","uri":"MetallicTexture_MaskMap.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"MetallicTexture","pbrMetallicRoughness":{"baseColorFactor":[0.0761853456,1,0.125470772,1],"metallicRoughnessTexture":{"index":0}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"samplers":[{"magFilter":9728,"minFilter":9728}],"scene":0,"scenes":[{"name":"MetallicTexture","nodes":[3]}],"textures":[{"source":0,"sampler":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/HDRP/NoMaterial2.gltf.txt b/Tests/Resources/ExportTargets/HDRP/NoMaterial2.gltf.txt index 4f614917..56534bc6 100644 --- a/Tests/Resources/ExportTargets/HDRP/NoMaterial2.gltf.txt +++ b/Tests/Resources/ExportTargets/HDRP/NoMaterial2.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.41f1 glTFast 4.8.5"},"nodes":[{"name":"Submesh","mesh":0},{"name":"NoMaterial2","children":[0],"translation":[-3,0,0]}],"buffers":[{"uri":"NoMaterial2.bin","byteLength":204}],"bufferViews":[{"buffer":0,"byteLength":12},{"buffer":0,"byteLength":192,"byteOffset":12,"byteStride":48}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC4","byteOffset":24},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC2","byteOffset":40},{"bufferView":0,"componentType":5123,"count":3,"type":"SCALAR"},{"bufferView":0,"componentType":5123,"count":3,"type":"SCALAR","byteOffset":6}],"materials":[{"name":"Red","pbrMetallicRoughness":{"baseColorFactor":[1,0,0,1],"metallicFactor":0,"roughnessFactor":0.5}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3},"indices":4},{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3},"indices":5,"material":0}]}],"scene":0,"scenes":[{"name":"NoMaterial2","nodes":[1]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Submesh","mesh":0},{"name":"NoMaterial2","children":[0],"translation":[-3,0,0]}],"buffers":[{"uri":"NoMaterial2.bin","byteLength":204}],"bufferViews":[{"buffer":0,"byteLength":12,"target":34963},{"buffer":0,"byteLength":192,"byteOffset":12,"byteStride":48,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC4","byteOffset":24},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC2","byteOffset":40},{"bufferView":0,"componentType":5123,"count":3,"type":"SCALAR"},{"bufferView":0,"componentType":5123,"count":3,"type":"SCALAR","byteOffset":6}],"materials":[{"name":"Red","pbrMetallicRoughness":{"baseColorFactor":[1,0,0,1],"metallicFactor":0,"roughnessFactor":0.5}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3},"indices":4},{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3},"indices":5,"material":0}]}],"scene":0,"scenes":[{"name":"NoMaterial2","nodes":[1]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/HDRP/OcclusionTexture.gltf.txt b/Tests/Resources/ExportTargets/HDRP/OcclusionTexture.gltf.txt index 3b995aea..78a77718 100644 --- a/Tests/Resources/ExportTargets/HDRP/OcclusionTexture.gltf.txt +++ b/Tests/Resources/ExportTargets/HDRP/OcclusionTexture.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.6.0"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"OcclusionTexture","children":[0,2],"translation":[-20,0,0]}],"buffers":[{"uri":"OcclusionTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"OcclusionTexture_MaskMap.jpg","uri":"OcclusionTexture_MaskMap.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"OcclusionTexture","pbrMetallicRoughness":{"baseColorFactor":[1,0.4543959,0.0765513852,1],"metallicFactor":0,"roughnessFactor":0.7},"occlusionTexture":{"index":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"OcclusionTexture","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"OcclusionTexture","children":[0,2],"translation":[-20,0,0]}],"buffers":[{"uri":"OcclusionTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"OcclusionTexture_MaskMap.jpg","uri":"OcclusionTexture_MaskMap.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"OcclusionTexture","pbrMetallicRoughness":{"baseColorFactor":[1,0.4543959,0.0765513852,1],"metallicFactor":0,"roughnessFactor":0.7},"occlusionTexture":{"index":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"OcclusionTexture","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/HDRP/OcclusionTextureStrength.gltf.txt b/Tests/Resources/ExportTargets/HDRP/OcclusionTextureStrength.gltf.txt index 143cf065..a60285d8 100644 --- a/Tests/Resources/ExportTargets/HDRP/OcclusionTextureStrength.gltf.txt +++ b/Tests/Resources/ExportTargets/HDRP/OcclusionTextureStrength.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.6.0"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"OcclusionTextureStrength","children":[0,2],"translation":[-21,0,0]}],"extensionsRequired":["KHR_texture_transform"],"extensionsUsed":["KHR_texture_transform"],"buffers":[{"uri":"OcclusionTextureStrength.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"OcclusionTextureStrength_MaskMap.jpg","uri":"OcclusionTextureStrength_MaskMap.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"OcclusionTextureStrength","pbrMetallicRoughness":{"baseColorFactor":[1,0.4543959,0.0765513852,1],"metallicFactor":0},"occlusionTexture":{"index":0,"extensions":{"KHR_texture_transform":{"offset":[0,-0.5],"scale":[2,1.5]}},"strength":0.230000019}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"OcclusionTextureStrength","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"OcclusionTextureStrength","children":[0,2],"translation":[-21,0,0]}],"extensionsRequired":["KHR_texture_transform"],"extensionsUsed":["KHR_texture_transform"],"buffers":[{"uri":"OcclusionTextureStrength.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"OcclusionTextureStrength_MaskMap.jpg","uri":"OcclusionTextureStrength_MaskMap.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"OcclusionTextureStrength","pbrMetallicRoughness":{"baseColorFactor":[1,0.4543959,0.0765513852,1],"metallicFactor":0},"occlusionTexture":{"index":0,"extensions":{"KHR_texture_transform":{"offset":[0,-0.5],"scale":[2,1.5]}},"strength":0.230000019}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"OcclusionTextureStrength","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/HDRP/SmoothnessTexture.gltf.txt b/Tests/Resources/ExportTargets/HDRP/SmoothnessTexture.gltf.txt index ab04452a..a0b1452c 100644 --- a/Tests/Resources/ExportTargets/HDRP/SmoothnessTexture.gltf.txt +++ b/Tests/Resources/ExportTargets/HDRP/SmoothnessTexture.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.6.0"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"SmoothnessTexture","children":[0,2],"translation":[-25,0,0]}],"buffers":[{"uri":"SmoothnessTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"SmoothnessTexture_MaskMap.jpg","uri":"SmoothnessTexture_MaskMap.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"SmoothnessTexture","pbrMetallicRoughness":{"baseColorFactor":[0.0761853456,1,0.125470772,1],"metallicRoughnessTexture":{"index":0}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"samplers":[{"magFilter":9728,"minFilter":9728}],"scene":0,"scenes":[{"name":"SmoothnessTexture","nodes":[3]}],"textures":[{"source":0,"sampler":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"SmoothnessTexture","children":[0,2],"translation":[-25,0,0]}],"buffers":[{"uri":"SmoothnessTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"SmoothnessTexture_MaskMap.jpg","uri":"SmoothnessTexture_MaskMap.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"SmoothnessTexture","pbrMetallicRoughness":{"baseColorFactor":[0.0761853456,1,0.125470772,1],"metallicRoughnessTexture":{"index":0}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"samplers":[{"magFilter":9728,"minFilter":9728}],"scene":0,"scenes":[{"name":"SmoothnessTexture","nodes":[3]}],"textures":[{"source":0,"sampler":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/HDRP/Submesh.gltf.txt b/Tests/Resources/ExportTargets/HDRP/Submesh.gltf.txt index 598e6bc0..5f5b2976 100644 --- a/Tests/Resources/ExportTargets/HDRP/Submesh.gltf.txt +++ b/Tests/Resources/ExportTargets/HDRP/Submesh.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.6.0"},"nodes":[{"name":"Submesh","mesh":0,"translation":[-1,0,0]}],"buffers":[{"uri":"Submesh.bin","byteLength":204}],"bufferViews":[{"buffer":0,"byteLength":12},{"buffer":0,"byteLength":192,"byteOffset":12,"byteStride":48}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC4","byteOffset":24},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC2","byteOffset":40},{"bufferView":0,"componentType":5123,"count":3,"type":"SCALAR"},{"bufferView":0,"componentType":5123,"count":3,"type":"SCALAR","byteOffset":6}],"materials":[{"name":"Blue","pbrMetallicRoughness":{"baseColorFactor":[0.009788704,0.022219114,0.8,1],"metallicFactor":0,"roughnessFactor":0.5}},{"name":"Red","pbrMetallicRoughness":{"baseColorFactor":[1,0,0,1],"metallicFactor":0,"roughnessFactor":0.5}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3},"indices":4,"material":0},{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3},"indices":5,"material":1}]}],"scene":0,"scenes":[{"name":"Submesh","nodes":[0]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Submesh","mesh":0,"translation":[-1,0,0]}],"buffers":[{"uri":"Submesh.bin","byteLength":204}],"bufferViews":[{"buffer":0,"byteLength":12,"target":34963},{"buffer":0,"byteLength":192,"byteOffset":12,"byteStride":48,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC4","byteOffset":24},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC2","byteOffset":40},{"bufferView":0,"componentType":5123,"count":3,"type":"SCALAR"},{"bufferView":0,"componentType":5123,"count":3,"type":"SCALAR","byteOffset":6}],"materials":[{"name":"Blue","pbrMetallicRoughness":{"baseColorFactor":[0.009788704,0.022219114,0.8,1],"metallicFactor":0,"roughnessFactor":0.5}},{"name":"Red","pbrMetallicRoughness":{"baseColorFactor":[1,0,0,1],"metallicFactor":0,"roughnessFactor":0.5}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3},"indices":4,"material":0},{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3},"indices":5,"material":1}]}],"scene":0,"scenes":[{"name":"Submesh","nodes":[0]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/HDRP/Unlit.gltf.txt b/Tests/Resources/ExportTargets/HDRP/Unlit.gltf.txt index da437eaa..357f1a86 100644 --- a/Tests/Resources/ExportTargets/HDRP/Unlit.gltf.txt +++ b/Tests/Resources/ExportTargets/HDRP/Unlit.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.6.0"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"Unlit","children":[0,2],"translation":[-15,0,0]}],"extensionsRequired":["KHR_materials_unlit"],"extensionsUsed":["KHR_materials_unlit"],"buffers":[{"uri":"Unlit.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"materials":[{"name":"Unlit","pbrMetallicRoughness":{"baseColorFactor":[1,0.2726522,0,1],"metallicFactor":0},"extensions":{"KHR_materials_unlit":{}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"Unlit","nodes":[3]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"Unlit","children":[0,2],"translation":[-15,0,0]}],"extensionsRequired":["KHR_materials_unlit"],"extensionsUsed":["KHR_materials_unlit"],"buffers":[{"uri":"Unlit.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"materials":[{"name":"Unlit","pbrMetallicRoughness":{"baseColorFactor":[1,0.2726522,0,1],"metallicFactor":0},"extensions":{"KHR_materials_unlit":{}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"Unlit","nodes":[3]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/HierarchyComponentsDisabled.gltf.txt b/Tests/Resources/ExportTargets/HierarchyComponentsDisabled.gltf.txt index fd581044..342cf495 100644 --- a/Tests/Resources/ExportTargets/HierarchyComponentsDisabled.gltf.txt +++ b/Tests/Resources/ExportTargets/HierarchyComponentsDisabled.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.4.0"},"nodes":[{"name":"A1","mesh":0,"translation":[0.249999985,0.75,-0.25],"scale":[0.5,0.5,0.5]},{"name":"A2","mesh":0,"translation":[-0.25,0.75,-0.25],"scale":[0.5,0.5,0.5]},{"name":"A3","mesh":0,"translation":[0.249999985,0.75,0.23],"scale":[0.5,0.5,0.5]},{"name":"A4","mesh":0,"translation":[-0.25,0.75,0.23],"scale":[0.5,0.5,0.5]},{"name":"A","children":[0,1,2,3],"mesh":0,"translation":[0.3,0.7,-0.3000002],"scale":[0.4,0.4,0.4]},{"name":"B1","mesh":0,"translation":[0.249999985,0.75,-0.25],"scale":[0.5,0.5,0.5]},{"name":"B2","mesh":0,"translation":[-0.25,0.75,-0.25],"scale":[0.5,0.5,0.5]},{"name":"B3","mesh":0,"translation":[0.249999985,0.75,0.23],"scale":[0.5,0.5,0.5]},{"name":"B4","mesh":0,"translation":[-0.25,0.75,0.23],"scale":[0.5,0.5,0.5]},{"name":"B","children":[5,6,7,8],"translation":[-0.3,0.7,-0.3],"scale":[0.4,0.4,0.4]},{"name":"C1","mesh":0,"translation":[0.249999985,0.75,-0.25],"scale":[0.5,0.5,0.5]},{"name":"C2","translation":[-0.25,0.75,-0.25],"scale":[0.5,0.5,0.5]},{"name":"C3","translation":[0.249999985,0.75,0.23],"scale":[0.5,0.5,0.5]},{"name":"C4","mesh":0,"translation":[-0.25,0.75,0.23],"scale":[0.5,0.5,0.5]},{"name":"C","children":[10,11,12,13],"mesh":0,"translation":[0.3,0.7,0.3],"scale":[0.4,0.4,0.4]},{"name":"D1","translation":[0.249999985,0.75,-0.25],"scale":[0.5,0.5,0.5]},{"name":"D2","mesh":0,"translation":[-0.25,0.75,-0.25],"scale":[0.5,0.5,0.5]},{"name":"D3","mesh":0,"translation":[0.249999985,0.75,0.23],"scale":[0.5,0.5,0.5]},{"name":"D4","translation":[-0.25,0.75,0.23],"scale":[0.5,0.5,0.5]},{"name":"D","children":[15,16,17,18],"translation":[-0.3,0.7,0.3],"scale":[0.4,0.4,0.4]},{"name":"Root","children":[4,9,14,19],"mesh":0,"translation":[0,0,16]},{"name":"HierarchyComponentsDisabled","children":[20],"translation":[-1,0,0]}],"buffers":[{"uri":"HierarchyComponentsDisabled.bin","byteLength":648}],"bufferViews":[{"buffer":0,"byteLength":72},{"buffer":0,"byteLength":576,"byteOffset":72,"byteStride":24}],"accessors":[{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","byteOffset":12},{"bufferView":0,"componentType":5123,"count":36,"type":"SCALAR"}],"meshes":[{"name":"Cube","primitives":[{"attributes":{"POSITION":0,"NORMAL":1},"indices":2}]}],"scene":0,"scenes":[{"name":"HierarchyComponentsDisabled","nodes":[21]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"A1","mesh":0,"translation":[0.249999985,0.75,-0.25],"scale":[0.5,0.5,0.5]},{"name":"A2","mesh":0,"translation":[-0.25,0.75,-0.25],"scale":[0.5,0.5,0.5]},{"name":"A3","mesh":0,"translation":[0.249999985,0.75,0.23],"scale":[0.5,0.5,0.5]},{"name":"A4","mesh":0,"translation":[-0.25,0.75,0.23],"scale":[0.5,0.5,0.5]},{"name":"A","children":[0,1,2,3],"mesh":0,"translation":[0.3,0.7,-0.3000002],"scale":[0.4,0.4,0.4]},{"name":"B1","mesh":0,"translation":[0.249999985,0.75,-0.25],"scale":[0.5,0.5,0.5]},{"name":"B2","mesh":0,"translation":[-0.25,0.75,-0.25],"scale":[0.5,0.5,0.5]},{"name":"B3","mesh":0,"translation":[0.249999985,0.75,0.23],"scale":[0.5,0.5,0.5]},{"name":"B4","mesh":0,"translation":[-0.25,0.75,0.23],"scale":[0.5,0.5,0.5]},{"name":"B","children":[5,6,7,8],"translation":[-0.3,0.7,-0.3],"scale":[0.4,0.4,0.4]},{"name":"C1","mesh":0,"translation":[0.249999985,0.75,-0.25],"scale":[0.5,0.5,0.5]},{"name":"C2","translation":[-0.25,0.75,-0.25],"scale":[0.5,0.5,0.5]},{"name":"C3","translation":[0.249999985,0.75,0.23],"scale":[0.5,0.5,0.5]},{"name":"C4","mesh":0,"translation":[-0.25,0.75,0.23],"scale":[0.5,0.5,0.5]},{"name":"C","children":[10,11,12,13],"mesh":0,"translation":[0.3,0.7,0.3],"scale":[0.4,0.4,0.4]},{"name":"D1","translation":[0.249999985,0.75,-0.25],"scale":[0.5,0.5,0.5]},{"name":"D2","mesh":0,"translation":[-0.25,0.75,-0.25],"scale":[0.5,0.5,0.5]},{"name":"D3","mesh":0,"translation":[0.249999985,0.75,0.23],"scale":[0.5,0.5,0.5]},{"name":"D4","translation":[-0.25,0.75,0.23],"scale":[0.5,0.5,0.5]},{"name":"D","children":[15,16,17,18],"translation":[-0.3,0.7,0.3],"scale":[0.4,0.4,0.4]},{"name":"Root","children":[4,9,14,19],"mesh":0,"translation":[0,0,16]},{"name":"HierarchyComponentsDisabled","children":[20],"translation":[-1,0,0]}],"buffers":[{"uri":"HierarchyComponentsDisabled.bin","byteLength":648}],"bufferViews":[{"buffer":0,"byteLength":72,"target":34963},{"buffer":0,"byteLength":576,"byteOffset":72,"byteStride":24,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","byteOffset":12},{"bufferView":0,"componentType":5123,"count":36,"type":"SCALAR"}],"meshes":[{"name":"Cube","primitives":[{"attributes":{"POSITION":0,"NORMAL":1},"indices":2}]}],"scene":0,"scenes":[{"name":"HierarchyComponentsDisabled","nodes":[21]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/HierarchyEditorOnlyTag.gltf.txt b/Tests/Resources/ExportTargets/HierarchyEditorOnlyTag.gltf.txt index e17ecc91..2748e140 100644 --- a/Tests/Resources/ExportTargets/HierarchyEditorOnlyTag.gltf.txt +++ b/Tests/Resources/ExportTargets/HierarchyEditorOnlyTag.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.4.0"},"nodes":[{"name":"A1","mesh":0,"translation":[0.249999985,0.75,-0.25],"scale":[0.5,0.5,0.5]},{"name":"A2","mesh":0,"translation":[-0.25,0.75,-0.25],"scale":[0.5,0.5,0.5]},{"name":"A3","mesh":0,"translation":[0.249999985,0.75,0.23],"scale":[0.5,0.5,0.5]},{"name":"A4","mesh":0,"translation":[-0.25,0.75,0.23],"scale":[0.5,0.5,0.5]},{"name":"A","children":[0,1,2,3],"mesh":0,"translation":[0.3,0.7,-0.3000002],"scale":[0.4,0.4,0.4]},{"name":"C1","mesh":0,"translation":[0.249999985,0.75,-0.25],"scale":[0.5,0.5,0.5]},{"name":"C4","mesh":0,"translation":[-0.25,0.75,0.23],"scale":[0.5,0.5,0.5]},{"name":"C","children":[5,6],"mesh":0,"translation":[0.3,0.7,0.3],"scale":[0.4,0.4,0.4]},{"name":"D2","mesh":0,"translation":[-0.25,0.75,-0.25],"scale":[0.5,0.5,0.5]},{"name":"D3","mesh":0,"translation":[0.249999985,0.75,0.23],"scale":[0.5,0.5,0.5]},{"name":"D","children":[8,9],"mesh":0,"translation":[-0.3,0.7,0.3],"scale":[0.4,0.4,0.4]},{"name":"Root","children":[4,7,10],"mesh":0,"translation":[0,0,16]},{"name":"HierarchyEditorOnlyTag","children":[11],"translation":[-2,0,0]}],"buffers":[{"uri":"HierarchyEditorOnlyTag.bin","byteLength":648}],"bufferViews":[{"buffer":0,"byteLength":72},{"buffer":0,"byteLength":576,"byteOffset":72,"byteStride":24}],"accessors":[{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","byteOffset":12},{"bufferView":0,"componentType":5123,"count":36,"type":"SCALAR"}],"meshes":[{"name":"Cube","primitives":[{"attributes":{"POSITION":0,"NORMAL":1},"indices":2}]}],"scene":0,"scenes":[{"name":"HierarchyEditorOnlyTag","nodes":[12]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"A1","mesh":0,"translation":[0.249999985,0.75,-0.25],"scale":[0.5,0.5,0.5]},{"name":"A2","mesh":0,"translation":[-0.25,0.75,-0.25],"scale":[0.5,0.5,0.5]},{"name":"A3","mesh":0,"translation":[0.249999985,0.75,0.23],"scale":[0.5,0.5,0.5]},{"name":"A4","mesh":0,"translation":[-0.25,0.75,0.23],"scale":[0.5,0.5,0.5]},{"name":"A","children":[0,1,2,3],"mesh":0,"translation":[0.3,0.7,-0.3000002],"scale":[0.4,0.4,0.4]},{"name":"C1","mesh":0,"translation":[0.249999985,0.75,-0.25],"scale":[0.5,0.5,0.5]},{"name":"C4","mesh":0,"translation":[-0.25,0.75,0.23],"scale":[0.5,0.5,0.5]},{"name":"C","children":[5,6],"mesh":0,"translation":[0.3,0.7,0.3],"scale":[0.4,0.4,0.4]},{"name":"D2","mesh":0,"translation":[-0.25,0.75,-0.25],"scale":[0.5,0.5,0.5]},{"name":"D3","mesh":0,"translation":[0.249999985,0.75,0.23],"scale":[0.5,0.5,0.5]},{"name":"D","children":[8,9],"mesh":0,"translation":[-0.3,0.7,0.3],"scale":[0.4,0.4,0.4]},{"name":"Root","children":[4,7,10],"mesh":0,"translation":[0,0,16]},{"name":"HierarchyEditorOnlyTag","children":[11],"translation":[-2,0,0]}],"buffers":[{"uri":"HierarchyEditorOnlyTag.bin","byteLength":648}],"bufferViews":[{"buffer":0,"byteLength":72,"target":34963},{"buffer":0,"byteLength":576,"byteOffset":72,"byteStride":24,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","byteOffset":12},{"bufferView":0,"componentType":5123,"count":36,"type":"SCALAR"}],"meshes":[{"name":"Cube","primitives":[{"attributes":{"POSITION":0,"NORMAL":1},"indices":2}]}],"scene":0,"scenes":[{"name":"HierarchyEditorOnlyTag","nodes":[12]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/HierarchyObjectsInactive.gltf.txt b/Tests/Resources/ExportTargets/HierarchyObjectsInactive.gltf.txt index c803ecac..ca9f26fd 100644 --- a/Tests/Resources/ExportTargets/HierarchyObjectsInactive.gltf.txt +++ b/Tests/Resources/ExportTargets/HierarchyObjectsInactive.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.4.0"},"nodes":[{"name":"A1","mesh":0,"translation":[0.249999985,0.75,-0.25],"scale":[0.5,0.5,0.5]},{"name":"A2","mesh":0,"translation":[-0.25,0.75,-0.25],"scale":[0.5,0.5,0.5]},{"name":"A3","mesh":0,"translation":[0.249999985,0.75,0.23],"scale":[0.5,0.5,0.5]},{"name":"A4","mesh":0,"translation":[-0.25,0.75,0.23],"scale":[0.5,0.5,0.5]},{"name":"A","children":[0,1,2,3],"mesh":0,"translation":[0.3,0.7,-0.3000002],"scale":[0.4,0.4,0.4]},{"name":"C1","mesh":0,"translation":[0.249999985,0.75,-0.25],"scale":[0.5,0.5,0.5]},{"name":"C4","mesh":0,"translation":[-0.25,0.75,0.23],"scale":[0.5,0.5,0.5]},{"name":"C","children":[5,6],"mesh":0,"translation":[0.3,0.7,0.3],"scale":[0.4,0.4,0.4]},{"name":"D2","mesh":0,"translation":[-0.25,0.75,-0.25],"scale":[0.5,0.5,0.5]},{"name":"D3","mesh":0,"translation":[0.249999985,0.75,0.23],"scale":[0.5,0.5,0.5]},{"name":"D","children":[8,9],"mesh":0,"translation":[-0.3,0.7,0.3],"scale":[0.4,0.4,0.4]},{"name":"Root","children":[4,7,10],"mesh":0,"translation":[0,0,16]},{"name":"HierarchyObjectsInactive","children":[11]}],"buffers":[{"uri":"HierarchyObjectsInactive.bin","byteLength":648}],"bufferViews":[{"buffer":0,"byteLength":72},{"buffer":0,"byteLength":576,"byteOffset":72,"byteStride":24}],"accessors":[{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","byteOffset":12},{"bufferView":0,"componentType":5123,"count":36,"type":"SCALAR"}],"meshes":[{"name":"Cube","primitives":[{"attributes":{"POSITION":0,"NORMAL":1},"indices":2}]}],"scene":0,"scenes":[{"name":"HierarchyObjectsInactive","nodes":[12]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"A1","mesh":0,"translation":[0.249999985,0.75,-0.25],"scale":[0.5,0.5,0.5]},{"name":"A2","mesh":0,"translation":[-0.25,0.75,-0.25],"scale":[0.5,0.5,0.5]},{"name":"A3","mesh":0,"translation":[0.249999985,0.75,0.23],"scale":[0.5,0.5,0.5]},{"name":"A4","mesh":0,"translation":[-0.25,0.75,0.23],"scale":[0.5,0.5,0.5]},{"name":"A","children":[0,1,2,3],"mesh":0,"translation":[0.3,0.7,-0.3000002],"scale":[0.4,0.4,0.4]},{"name":"C1","mesh":0,"translation":[0.249999985,0.75,-0.25],"scale":[0.5,0.5,0.5]},{"name":"C4","mesh":0,"translation":[-0.25,0.75,0.23],"scale":[0.5,0.5,0.5]},{"name":"C","children":[5,6],"mesh":0,"translation":[0.3,0.7,0.3],"scale":[0.4,0.4,0.4]},{"name":"D2","mesh":0,"translation":[-0.25,0.75,-0.25],"scale":[0.5,0.5,0.5]},{"name":"D3","mesh":0,"translation":[0.249999985,0.75,0.23],"scale":[0.5,0.5,0.5]},{"name":"D","children":[8,9],"mesh":0,"translation":[-0.3,0.7,0.3],"scale":[0.4,0.4,0.4]},{"name":"Root","children":[4,7,10],"mesh":0,"translation":[0,0,16]},{"name":"HierarchyObjectsInactive","children":[11]}],"buffers":[{"uri":"HierarchyObjectsInactive.bin","byteLength":648}],"bufferViews":[{"buffer":0,"byteLength":72,"target":34963},{"buffer":0,"byteLength":576,"byteOffset":72,"byteStride":24,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","byteOffset":12},{"bufferView":0,"componentType":5123,"count":36,"type":"SCALAR"}],"meshes":[{"name":"Cube","primitives":[{"attributes":{"POSITION":0,"NORMAL":1},"indices":2}]}],"scene":0,"scenes":[{"name":"HierarchyObjectsInactive","nodes":[12]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/IdenticalTextureName.gltf.txt b/Tests/Resources/ExportTargets/IdenticalTextureName.gltf.txt index 88d3b883..cbf4e093 100644 --- a/Tests/Resources/ExportTargets/IdenticalTextureName.gltf.txt +++ b/Tests/Resources/ExportTargets/IdenticalTextureName.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2021.3.21f1 glTFast 5.0.4"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"IdenticalTextureName","mesh":1},{"name":"IdenticalTextureName","children":[0,1],"translation":[-32,0,0]}],"buffers":[{"uri":"IdenticalTextureName.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"images":[{"name":"ColorGrid.jpg","uri":"ColorGrid.jpg","mimeType":"image/jpeg"},{"name":"ColorGrid.jpg","uri":"ColorGrid.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"BaseColorTexture","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0,"baseColorTexture":{"index":0}}},{"name":"IdenticalTextureName","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0,"baseColorTexture":{"index":1}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":1}]}],"scene":0,"scenes":[{"name":"IdenticalTextureName","nodes":[2]}],"textures":[{"source":0},{"source":1}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"IdenticalTextureName","mesh":1},{"name":"IdenticalTextureName","children":[0,1],"translation":[-32,0,0]}],"buffers":[{"uri":"IdenticalTextureName.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"images":[{"name":"ColorGrid.jpg","uri":"ColorGrid.jpg","mimeType":"image/jpeg"},{"name":"ColorGrid.jpg","uri":"ColorGrid.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"BaseColorTexture","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0,"baseColorTexture":{"index":0}}},{"name":"IdenticalTextureName","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0,"baseColorTexture":{"index":1}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":1}]}],"scene":0,"scenes":[{"name":"IdenticalTextureName","nodes":[2]}],"textures":[{"source":0},{"source":1}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/LayerMaskAll.gltf.txt b/Tests/Resources/ExportTargets/LayerMaskAll.gltf.txt index ac3cc51b..c0f8672c 100644 --- a/Tests/Resources/ExportTargets/LayerMaskAll.gltf.txt +++ b/Tests/Resources/ExportTargets/LayerMaskAll.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2021.3.13f1 glTFast 5.0.0-exp.1"},"nodes":[{"name":"c","mesh":0,"translation":[-1,0,0]},{"name":"b","children":[0],"mesh":0,"translation":[-1,0,0]},{"name":"a","children":[1],"mesh":0},{"name":"Root","children":[2]}],"buffers":[{"uri":"LayerMaskAll.bin","byteLength":1416}],"bufferViews":[{"buffer":0,"byteLength":72},{"buffer":0,"byteLength":1344,"byteOffset":72,"byteStride":56}],"accessors":[{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","byteOffset":12},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC4","byteOffset":24},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC2","byteOffset":40},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC2","byteOffset":48},{"bufferView":0,"componentType":5123,"count":36,"type":"SCALAR"}],"materials":[{"name":"Default-Material","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0.5}}],"meshes":[{"name":"Cube","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3,"TEXCOORD_1":4},"indices":5,"material":0}]}],"scene":0,"scenes":[{"nodes":[3]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"c","mesh":0,"translation":[-1,0,0]},{"name":"b","children":[0],"mesh":0,"translation":[-1,0,0]},{"name":"a","children":[1],"mesh":0},{"name":"Root","children":[2]}],"buffers":[{"uri":"LayerMaskAll.bin","byteLength":1416}],"bufferViews":[{"buffer":0,"byteLength":72,"target":34963},{"buffer":0,"byteLength":1344,"byteOffset":72,"byteStride":56,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","byteOffset":12},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC4","byteOffset":24},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC2","byteOffset":40},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC2","byteOffset":48},{"bufferView":0,"componentType":5123,"count":36,"type":"SCALAR"}],"materials":[{"name":"Default-Material","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0.5}}],"meshes":[{"name":"Cube","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3,"TEXCOORD_1":4},"indices":5,"material":0}]}],"scene":0,"scenes":[{"nodes":[3]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/LayerMaskNone.gltf.txt b/Tests/Resources/ExportTargets/LayerMaskNone.gltf.txt index 90cb6cce..d5a5e281 100644 --- a/Tests/Resources/ExportTargets/LayerMaskNone.gltf.txt +++ b/Tests/Resources/ExportTargets/LayerMaskNone.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2021.3.13f1 glTFast 5.0.0-exp.1"}} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"}} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/LayerMaskOne.gltf.txt b/Tests/Resources/ExportTargets/LayerMaskOne.gltf.txt index a656de15..8acec842 100644 --- a/Tests/Resources/ExportTargets/LayerMaskOne.gltf.txt +++ b/Tests/Resources/ExportTargets/LayerMaskOne.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2021.3.13f1 glTFast 5.0.0-exp.1"},"nodes":[{"name":"b","mesh":0,"translation":[-1,0,0]},{"name":"a","children":[0],"mesh":0},{"name":"Root","children":[1]}],"buffers":[{"uri":"LayerMaskOne.bin","byteLength":1416}],"bufferViews":[{"buffer":0,"byteLength":72},{"buffer":0,"byteLength":1344,"byteOffset":72,"byteStride":56}],"accessors":[{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","byteOffset":12},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC4","byteOffset":24},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC2","byteOffset":40},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC2","byteOffset":48},{"bufferView":0,"componentType":5123,"count":36,"type":"SCALAR"}],"materials":[{"name":"Default-Material","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0.5}}],"meshes":[{"name":"Cube","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3,"TEXCOORD_1":4},"indices":5,"material":0}]}],"scene":0,"scenes":[{"nodes":[2]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"b","mesh":0,"translation":[-1,0,0]},{"name":"a","children":[0],"mesh":0},{"name":"Root","children":[1]}],"buffers":[{"uri":"LayerMaskOne.bin","byteLength":1416}],"bufferViews":[{"buffer":0,"byteLength":72,"target":34963},{"buffer":0,"byteLength":1344,"byteOffset":72,"byteStride":56,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","byteOffset":12},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC4","byteOffset":24},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC2","byteOffset":40},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC2","byteOffset":48},{"bufferView":0,"componentType":5123,"count":36,"type":"SCALAR"}],"materials":[{"name":"Default-Material","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0.5}}],"meshes":[{"name":"Cube","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3,"TEXCOORD_1":4},"indices":5,"material":0}]}],"scene":0,"scenes":[{"nodes":[2]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/LayerMaskTwo.gltf.txt b/Tests/Resources/ExportTargets/LayerMaskTwo.gltf.txt index 1da133a8..39c303a7 100644 --- a/Tests/Resources/ExportTargets/LayerMaskTwo.gltf.txt +++ b/Tests/Resources/ExportTargets/LayerMaskTwo.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2021.3.13f1 glTFast 5.0.0-exp.1"},"nodes":[{"name":"c","mesh":0,"translation":[-1,0,0]},{"name":"b","children":[0],"translation":[-1,0,0]},{"name":"a","children":[1]},{"name":"Root","children":[2]}],"buffers":[{"uri":"LayerMaskTwo.bin","byteLength":1416}],"bufferViews":[{"buffer":0,"byteLength":72},{"buffer":0,"byteLength":1344,"byteOffset":72,"byteStride":56}],"accessors":[{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","byteOffset":12},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC4","byteOffset":24},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC2","byteOffset":40},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC2","byteOffset":48},{"bufferView":0,"componentType":5123,"count":36,"type":"SCALAR"}],"materials":[{"name":"Default-Material","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0.5}}],"meshes":[{"name":"Cube","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3,"TEXCOORD_1":4},"indices":5,"material":0}]}],"scene":0,"scenes":[{"nodes":[3]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"c","mesh":0,"translation":[-1,0,0]},{"name":"b","children":[0],"translation":[-1,0,0]},{"name":"a","children":[1]},{"name":"Root","children":[2]}],"buffers":[{"uri":"LayerMaskTwo.bin","byteLength":1416}],"bufferViews":[{"buffer":0,"byteLength":72,"target":34963},{"buffer":0,"byteLength":1344,"byteOffset":72,"byteStride":56,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","byteOffset":12},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC4","byteOffset":24},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC2","byteOffset":40},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC2","byteOffset":48},{"bufferView":0,"componentType":5123,"count":36,"type":"SCALAR"}],"materials":[{"name":"Default-Material","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0.5}}],"meshes":[{"name":"Cube","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3,"TEXCOORD_1":4},"indices":5,"material":0}]}],"scene":0,"scenes":[{"nodes":[3]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/LightAreaDisc.gltf.txt b/Tests/Resources/ExportTargets/LightAreaDisc.gltf.txt index c3305b6e..1de9a25b 100644 --- a/Tests/Resources/ExportTargets/LightAreaDisc.gltf.txt +++ b/Tests/Resources/ExportTargets/LightAreaDisc.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.2.0"},"nodes":[{"name":"Light","children":[1],"translation":[0,1,0],"rotation":[0.482962936,-0.224143922,0.129409552,0.8365163]},{"name":"Light_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":0}}},{"name":"Plane","mesh":0,"scale":[10,10,10]},{"name":"LightAreaDisc","children":[0,2],"translation":[-45,0,10]}],"extensionsRequired":["KHR_lights_punctual"],"extensionsUsed":["KHR_lights_punctual"],"buffers":[{"uri":"LightAreaDisc.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"Neutral","pbrMetallicRoughness":{"metallicFactor":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"LightAreaDisc","nodes":[3]}],"extensions":{"KHR_lights_punctual":{"lights":[{"type":"spot","name":"Light","color":[0.6038274,0.0331047624,0.0331047624],"intensity":3.14159274,"range":100,"spot":{"innerConeAngle":0.305432618,"outerConeAngle":0.3926991}}]}}} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Light","children":[3],"translation":[0,1,0],"rotation":[0.482962936,-0.224143922,0.129409552,0.8365163]},{"name":"Plane","mesh":0,"scale":[10,10,10]},{"name":"LightAreaDisc","children":[0,1],"translation":[-45,0,10]},{"name":"Light_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":0}}}],"extensionsRequired":["KHR_lights_punctual"],"extensionsUsed":["KHR_lights_punctual"],"buffers":[{"uri":"LightAreaDisc.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"Neutral","pbrMetallicRoughness":{"metallicFactor":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"LightAreaDisc","nodes":[2]}],"extensions":{"KHR_lights_punctual":{"lights":[{"type":"spot","name":"Light","color":[0.6038274,0.0331047624,0.0331047624],"intensity":3.14159274,"range":100,"spot":{"innerConeAngle":0.305432618,"outerConeAngle":0.3926991}}]}}} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/LightAreaRectangle.gltf.txt b/Tests/Resources/ExportTargets/LightAreaRectangle.gltf.txt index e0256a9a..e6bd62b8 100644 --- a/Tests/Resources/ExportTargets/LightAreaRectangle.gltf.txt +++ b/Tests/Resources/ExportTargets/LightAreaRectangle.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.2.0"},"nodes":[{"name":"Light","children":[1],"translation":[0,1,0],"rotation":[0.482962936,-0.224143922,0.129409552,0.8365163]},{"name":"Light_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":0}}},{"name":"Plane","mesh":0,"scale":[10,10,10]},{"name":"LightAreaRectangle","children":[0,2],"translation":[-35,0,10]}],"extensionsRequired":["KHR_lights_punctual"],"extensionsUsed":["KHR_lights_punctual"],"buffers":[{"uri":"LightAreaRectangle.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"Neutral","pbrMetallicRoughness":{"metallicFactor":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"LightAreaRectangle","nodes":[3]}],"extensions":{"KHR_lights_punctual":{"lights":[{"type":"spot","name":"Light","color":[0.6038274,0.0331047624,0.0331047624],"intensity":3.14159274,"range":100,"spot":{"innerConeAngle":0.305432618,"outerConeAngle":0.3926991}}]}}} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Light","children":[3],"translation":[0,1,0],"rotation":[0.482962936,-0.224143922,0.129409552,0.8365163]},{"name":"Plane","mesh":0,"scale":[10,10,10]},{"name":"LightAreaRectangle","children":[0,1],"translation":[-35,0,10]},{"name":"Light_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":0}}}],"extensionsRequired":["KHR_lights_punctual"],"extensionsUsed":["KHR_lights_punctual"],"buffers":[{"uri":"LightAreaRectangle.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"Neutral","pbrMetallicRoughness":{"metallicFactor":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"LightAreaRectangle","nodes":[2]}],"extensions":{"KHR_lights_punctual":{"lights":[{"type":"spot","name":"Light","color":[0.6038274,0.0331047624,0.0331047624],"intensity":3.14159274,"range":100,"spot":{"innerConeAngle":0.305432618,"outerConeAngle":0.3926991}}]}}} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/LightDirectional.gltf.txt b/Tests/Resources/ExportTargets/LightDirectional.gltf.txt index b51e67ca..67af8f48 100644 --- a/Tests/Resources/ExportTargets/LightDirectional.gltf.txt +++ b/Tests/Resources/ExportTargets/LightDirectional.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.41f1 glTFast 5.0.0-exp.1"},"nodes":[{"name":"Light","children":[1],"translation":[0,1,0],"rotation":[0.482962936,-0.224143922,0.129409552,0.8365163]},{"name":"Light_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":0}}},{"name":"Plane","mesh":0,"scale":[10,10,10]},{"name":"LightDirectional","children":[0,2],"translation":[-25,0,10]}],"extensionsRequired":["KHR_lights_punctual"],"extensionsUsed":["KHR_lights_punctual"],"buffers":[{"uri":"LightDirectional.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"Neutral","pbrMetallicRoughness":{"metallicFactor":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"LightDirectional","nodes":[3]}],"extensions":{"KHR_lights_punctual":{"lights":[{"type":"directional","name":"Light","color":[0.6038274,0.0331047624,0.0331047624],"intensity":0.314159274}]}}} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Light","children":[3],"translation":[0,1,0],"rotation":[0.482962936,-0.224143922,0.129409552,0.8365163]},{"name":"Plane","mesh":0,"scale":[10,10,10]},{"name":"LightDirectional","children":[0,1],"translation":[-25,0,10]},{"name":"Light_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":0}}}],"extensionsRequired":["KHR_lights_punctual"],"extensionsUsed":["KHR_lights_punctual"],"buffers":[{"uri":"LightDirectional.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"Neutral","pbrMetallicRoughness":{"metallicFactor":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"LightDirectional","nodes":[2]}],"extensions":{"KHR_lights_punctual":{"lights":[{"type":"directional","name":"Light","color":[0.6038274,0.0331047624,0.0331047624],"intensity":0.314159274}]}}} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/LightsPoint.gltf.txt b/Tests/Resources/ExportTargets/LightsPoint.gltf.txt index 537519f8..39f30a9b 100644 --- a/Tests/Resources/ExportTargets/LightsPoint.gltf.txt +++ b/Tests/Resources/ExportTargets/LightsPoint.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.41f1 glTFast 5.0.0-exp.1"},"nodes":[{"name":"Red","translation":[1,1,-1.73205],"extensions":{"KHR_lights_punctual":{"light":0}}},{"name":"Green","translation":[1,1,1.73205],"extensions":{"KHR_lights_punctual":{"light":1}}},{"name":"Blue","translation":[-2,1,0],"extensions":{"KHR_lights_punctual":{"light":2}}},{"name":"Plane","mesh":0,"scale":[10,10,10]},{"name":"LightsPoint","children":[0,1,2,3],"translation":[-5,0,10]}],"extensionsRequired":["KHR_lights_punctual"],"extensionsUsed":["KHR_lights_punctual"],"buffers":[{"uri":"LightsPoint.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"Neutral","pbrMetallicRoughness":{"metallicFactor":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"LightsPoint","nodes":[4]}],"extensions":{"KHR_lights_punctual":{"lights":[{"type":"point","name":"Red","color":[1,0,0],"intensity":3.14159274,"range":10},{"type":"point","name":"Green","color":[0,1,0],"intensity":3.14159274,"range":10},{"type":"point","name":"Blue","color":[0,0,1],"intensity":3.14159274,"range":10}]}}} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Red","translation":[1,1,-1.73205],"extensions":{"KHR_lights_punctual":{"light":0}}},{"name":"Green","translation":[1,1,1.73205],"extensions":{"KHR_lights_punctual":{"light":1}}},{"name":"Blue","translation":[-2,1,0],"extensions":{"KHR_lights_punctual":{"light":2}}},{"name":"Plane","mesh":0,"scale":[10,10,10]},{"name":"LightsPoint","children":[0,1,2,3],"translation":[-5,0,10]}],"extensionsRequired":["KHR_lights_punctual"],"extensionsUsed":["KHR_lights_punctual"],"buffers":[{"uri":"LightsPoint.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"Neutral","pbrMetallicRoughness":{"metallicFactor":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"LightsPoint","nodes":[4]}],"extensions":{"KHR_lights_punctual":{"lights":[{"type":"point","name":"Red","color":[1,0,0],"intensity":3.14159274,"range":10},{"type":"point","name":"Green","color":[0,1,0],"intensity":3.14159274,"range":10},{"type":"point","name":"Blue","color":[0,0,1],"intensity":3.14159274,"range":10}]}}} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/LightsSpot.gltf.txt b/Tests/Resources/ExportTargets/LightsSpot.gltf.txt index fa129ba9..c99938bb 100644 --- a/Tests/Resources/ExportTargets/LightsSpot.gltf.txt +++ b/Tests/Resources/ExportTargets/LightsSpot.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.41f1 glTFast 5.0.0-exp.1"},"nodes":[{"name":"Red","children":[1],"translation":[1,12,-1.73205],"rotation":[0.7071068,0,0,0.7071068]},{"name":"Red_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":0}}},{"name":"Green","children":[3],"translation":[1,12,1.73205],"rotation":[0.7071068,0,0,0.7071068]},{"name":"Green_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":1}}},{"name":"Blue","children":[5],"translation":[-2,12,0],"rotation":[0.7071068,0,0,0.7071068]},{"name":"Blue_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":2}}},{"name":"Plane","mesh":0,"scale":[10,10,10]},{"name":"LightsSpot","children":[0,2,4,6],"translation":[-15,0,10]}],"extensionsRequired":["KHR_lights_punctual"],"extensionsUsed":["KHR_lights_punctual"],"buffers":[{"uri":"LightsSpot.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"Neutral","pbrMetallicRoughness":{"metallicFactor":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"LightsSpot","nodes":[7]}],"extensions":{"KHR_lights_punctual":{"lights":[{"type":"spot","name":"Red","color":[1,0,0],"intensity":3.14159274,"range":100,"spot":{"innerConeAngle":0.190259039,"outerConeAngle":0.2617994}},{"type":"spot","name":"Green","color":[0,1,0],"intensity":3.14159274,"range":100,"spot":{"innerConeAngle":0.190259039,"outerConeAngle":0.2617994}},{"type":"spot","name":"Blue","color":[0,0,1],"intensity":3.14159274,"range":100,"spot":{"innerConeAngle":0.190259039,"outerConeAngle":0.2617994}}]}}} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Red","children":[5],"translation":[1,12,-1.73205],"rotation":[0.7071068,0,0,0.7071068]},{"name":"Green","children":[6],"translation":[1,12,1.73205],"rotation":[0.7071068,0,0,0.7071068]},{"name":"Blue","children":[7],"translation":[-2,12,0],"rotation":[0.7071068,0,0,0.7071068]},{"name":"Plane","mesh":0,"scale":[10,10,10]},{"name":"LightsSpot","children":[0,1,2,3],"translation":[-15,0,10]},{"name":"Red_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":0}}},{"name":"Green_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":1}}},{"name":"Blue_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":2}}}],"extensionsRequired":["KHR_lights_punctual"],"extensionsUsed":["KHR_lights_punctual"],"buffers":[{"uri":"LightsSpot.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"Neutral","pbrMetallicRoughness":{"metallicFactor":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"LightsSpot","nodes":[4]}],"extensions":{"KHR_lights_punctual":{"lights":[{"type":"spot","name":"Red","color":[1,0,0],"intensity":3.14159274,"range":100,"spot":{"innerConeAngle":0.190259039,"outerConeAngle":0.2617994}},{"type":"spot","name":"Green","color":[0,1,0],"intensity":3.14159274,"range":100,"spot":{"innerConeAngle":0.190259039,"outerConeAngle":0.2617994}},{"type":"spot","name":"Blue","color":[0,0,1],"intensity":3.14159274,"range":100,"spot":{"innerConeAngle":0.190259039,"outerConeAngle":0.2617994}}]}}} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/MeshMaterialReuse.gltf.txt b/Tests/Resources/ExportTargets/MeshMaterialReuse.gltf.txt index 279ed834..b034975e 100644 --- a/Tests/Resources/ExportTargets/MeshMaterialReuse.gltf.txt +++ b/Tests/Resources/ExportTargets/MeshMaterialReuse.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2021.3.13f1 glTFast 4.8.5"},"nodes":[{"name":"Cube 1","mesh":0},{"name":"Cube 2","mesh":0,"translation":[0,0,2]},{"name":"MeshMaterialReuse","children":[0,1],"translation":[-4,0,0]}],"buffers":[{"uri":"MeshMaterialReuse.bin","byteLength":1416}],"bufferViews":[{"buffer":0,"byteLength":72},{"buffer":0,"byteLength":1344,"byteOffset":72,"byteStride":56}],"accessors":[{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","byteOffset":12},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC4","byteOffset":24},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC2","byteOffset":40},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC2","byteOffset":48},{"bufferView":0,"componentType":5123,"count":36,"type":"SCALAR"}],"materials":[{"name":"Red","pbrMetallicRoughness":{"baseColorFactor":[1,0,0,1],"metallicFactor":0,"roughnessFactor":0.5}}],"meshes":[{"name":"Cube","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3,"TEXCOORD_1":4},"indices":5,"material":0}]}],"scene":0,"scenes":[{"name":"MeshMaterialReuse","nodes":[2]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Cube 1","mesh":0},{"name":"Cube 2","mesh":0,"translation":[0,0,2]},{"name":"MeshMaterialReuse","children":[0,1],"translation":[-4,0,0]}],"buffers":[{"uri":"MeshMaterialReuse.bin","byteLength":1416}],"bufferViews":[{"buffer":0,"byteLength":72,"target":34963},{"buffer":0,"byteLength":1344,"byteOffset":72,"byteStride":56,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","byteOffset":12},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC4","byteOffset":24},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC2","byteOffset":40},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC2","byteOffset":48},{"bufferView":0,"componentType":5123,"count":36,"type":"SCALAR"}],"materials":[{"name":"Red","pbrMetallicRoughness":{"baseColorFactor":[1,0,0,1],"metallicFactor":0,"roughnessFactor":0.5}}],"meshes":[{"name":"Cube","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3,"TEXCOORD_1":4},"indices":5,"material":0}]}],"scene":0,"scenes":[{"name":"MeshMaterialReuse","nodes":[2]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/MeshReuse.gltf.txt b/Tests/Resources/ExportTargets/MeshReuse.gltf.txt index ad0e1f03..20550bc0 100644 --- a/Tests/Resources/ExportTargets/MeshReuse.gltf.txt +++ b/Tests/Resources/ExportTargets/MeshReuse.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2021.3.12f1 glTFast 4.8.5"},"nodes":[{"name":"Cube 1","mesh":0},{"name":"Cube 2","mesh":1,"translation":[0,0,2]},{"name":"MeshReuse","children":[0,1],"translation":[-5,0,0]}],"buffers":[{"uri":"MeshReuse.bin","byteLength":1416}],"bufferViews":[{"buffer":0,"byteLength":72},{"buffer":0,"byteLength":1344,"byteOffset":72,"byteStride":56}],"accessors":[{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","byteOffset":12},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC4","byteOffset":24},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC2","byteOffset":40},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC2","byteOffset":48},{"bufferView":0,"componentType":5123,"count":36,"type":"SCALAR"}],"materials":[{"name":"Red","pbrMetallicRoughness":{"baseColorFactor":[1,0,0,1],"metallicFactor":0,"roughnessFactor":0.5}},{"name":"Green","pbrMetallicRoughness":{"baseColorFactor":[0,1,0,1],"metallicFactor":0,"roughnessFactor":0.5}}],"meshes":[{"name":"Cube","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3,"TEXCOORD_1":4},"indices":5,"material":0}]},{"name":"Cube","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3,"TEXCOORD_1":4},"indices":5,"material":1}]}],"scene":0,"scenes":[{"name":"MeshReuse","nodes":[2]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Cube 1","mesh":0},{"name":"Cube 2","mesh":1,"translation":[0,0,2]},{"name":"MeshReuse","children":[0,1],"translation":[-5,0,0]}],"buffers":[{"uri":"MeshReuse.bin","byteLength":1416}],"bufferViews":[{"buffer":0,"byteLength":72,"target":34963},{"buffer":0,"byteLength":1344,"byteOffset":72,"byteStride":56,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","byteOffset":12},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC4","byteOffset":24},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC2","byteOffset":40},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC2","byteOffset":48},{"bufferView":0,"componentType":5123,"count":36,"type":"SCALAR"}],"materials":[{"name":"Red","pbrMetallicRoughness":{"baseColorFactor":[1,0,0,1],"metallicFactor":0,"roughnessFactor":0.5}},{"name":"Green","pbrMetallicRoughness":{"baseColorFactor":[0,1,0,1],"metallicFactor":0,"roughnessFactor":0.5}}],"meshes":[{"name":"Cube","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3,"TEXCOORD_1":4},"indices":5,"material":0}]},{"name":"Cube","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3,"TEXCOORD_1":4},"indices":5,"material":1}]}],"scene":0,"scenes":[{"name":"MeshReuse","nodes":[2]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/Metallic.gltf.txt b/Tests/Resources/ExportTargets/Metallic.gltf.txt index 2d653089..4ec524d7 100644 --- a/Tests/Resources/ExportTargets/Metallic.gltf.txt +++ b/Tests/Resources/ExportTargets/Metallic.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2021.3.12f1 glTFast 4.8.5"},"nodes":[{"name":"Sphere","mesh":0},{"name":"sphere 1","children":[0]},{"name":"Sphere","mesh":1},{"name":"sphere 2","children":[2],"translation":[0,0,1]},{"name":"Sphere","mesh":2},{"name":"sphere 3","children":[4],"translation":[0,0,2]},{"name":"Sphere","mesh":3},{"name":"sphere 4","children":[6],"translation":[0,0,3]},{"name":"Sphere","mesh":4},{"name":"sphere 5","children":[8],"translation":[0,0,4]},{"name":"Metallic","children":[1,3,5,7,9],"translation":[-7,0,0]}],"buffers":[{"uri":"Metallic.bin","byteLength":24576}],"bufferViews":[{"buffer":0,"byteLength":9216},{"buffer":0,"byteLength":11520,"byteOffset":9216,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20736,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":1,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":2304,"type":"SCALAR"}],"materials":[{"name":"Metallic 1","pbrMetallicRoughness":{"roughnessFactor":0}},{"name":"Metallic 2","pbrMetallicRoughness":{"roughnessFactor":0.25}},{"name":"Metallic 3","pbrMetallicRoughness":{"roughnessFactor":0.5}},{"name":"Metallic 4","pbrMetallicRoughness":{"roughnessFactor":0.75}},{"name":"Metallic 5","pbrMetallicRoughness":{}}],"meshes":[{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":1}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":2}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":3}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":4}]}],"scene":0,"scenes":[{"name":"Metallic","nodes":[10]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Sphere","mesh":0},{"name":"sphere 1","children":[0]},{"name":"Sphere","mesh":1},{"name":"sphere 2","children":[2],"translation":[0,0,1]},{"name":"Sphere","mesh":2},{"name":"sphere 3","children":[4],"translation":[0,0,2]},{"name":"Sphere","mesh":3},{"name":"sphere 4","children":[6],"translation":[0,0,3]},{"name":"Sphere","mesh":4},{"name":"sphere 5","children":[8],"translation":[0,0,4]},{"name":"Metallic","children":[1,3,5,7,9],"translation":[-7,0,0]}],"buffers":[{"uri":"Metallic.bin","byteLength":24576}],"bufferViews":[{"buffer":0,"byteLength":9216,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9216,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20736,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":1,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":2304,"type":"SCALAR"}],"materials":[{"name":"Metallic 1","pbrMetallicRoughness":{"roughnessFactor":0}},{"name":"Metallic 2","pbrMetallicRoughness":{"roughnessFactor":0.25}},{"name":"Metallic 3","pbrMetallicRoughness":{"roughnessFactor":0.5}},{"name":"Metallic 4","pbrMetallicRoughness":{"roughnessFactor":0.75}},{"name":"Metallic 5","pbrMetallicRoughness":{}}],"meshes":[{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":1}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":2}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":3}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":4}]}],"scene":0,"scenes":[{"name":"Metallic","nodes":[10]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/MetallicSmoothnessOcclusionTexture.gltf.txt b/Tests/Resources/ExportTargets/MetallicSmoothnessOcclusionTexture.gltf.txt index 128cb3dd..97e131aa 100644 --- a/Tests/Resources/ExportTargets/MetallicSmoothnessOcclusionTexture.gltf.txt +++ b/Tests/Resources/ExportTargets/MetallicSmoothnessOcclusionTexture.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.6.0"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"MetallicSmoothnessOcclusionTexture","children":[0,2],"translation":[-28,0,0]}],"buffers":[{"uri":"MetallicSmoothnessOcclusionTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"metallic-smoothness.jpg","uri":"metallic-smoothness.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"MetallicSmoothnessOcclusionTexture","pbrMetallicRoughness":{"baseColorFactor":[0.07618536,0.87672466,1,1],"metallicRoughnessTexture":{"index":0}},"occlusionTexture":{"index":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"samplers":[{"magFilter":9728,"minFilter":9728}],"scene":0,"scenes":[{"name":"MetallicSmoothnessOcclusionTexture","nodes":[3]}],"textures":[{"source":0,"sampler":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"MetallicSmoothnessOcclusionTexture","children":[0,2],"translation":[-28,0,0]}],"buffers":[{"uri":"MetallicSmoothnessOcclusionTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"metallic-smoothness.jpg","uri":"metallic-smoothness.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"MetallicSmoothnessOcclusionTexture","pbrMetallicRoughness":{"baseColorFactor":[0.0761853755,0.87672466,1,1],"metallicRoughnessTexture":{"index":0}},"occlusionTexture":{"index":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"samplers":[{"magFilter":9728,"minFilter":9728}],"scene":0,"scenes":[{"name":"MetallicSmoothnessOcclusionTexture","nodes":[3]}],"textures":[{"source":0,"sampler":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/MetallicSmoothnessTexture.gltf.txt b/Tests/Resources/ExportTargets/MetallicSmoothnessTexture.gltf.txt index 472e2511..2cb83d01 100644 --- a/Tests/Resources/ExportTargets/MetallicSmoothnessTexture.gltf.txt +++ b/Tests/Resources/ExportTargets/MetallicSmoothnessTexture.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.6.0"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"MetallicSmoothnessTexture","children":[0,2],"translation":[-27,0,0]}],"buffers":[{"uri":"MetallicSmoothnessTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"metallic-smoothness.jpg","uri":"metallic-smoothness.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"MetallicSmoothnessTexture","pbrMetallicRoughness":{"baseColorFactor":[0.07618536,1,0.1254708,1],"metallicRoughnessTexture":{"index":0}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"samplers":[{"magFilter":9728,"minFilter":9728}],"scene":0,"scenes":[{"name":"MetallicSmoothnessTexture","nodes":[3]}],"textures":[{"source":0,"sampler":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"MetallicSmoothnessTexture","children":[0,2],"translation":[-27,0,0]}],"buffers":[{"uri":"MetallicSmoothnessTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"metallic-smoothness.jpg","uri":"metallic-smoothness.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"MetallicSmoothnessTexture","pbrMetallicRoughness":{"baseColorFactor":[0.0761853755,1,0.125470817,1],"metallicRoughnessTexture":{"index":0}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"samplers":[{"magFilter":9728,"minFilter":9728}],"scene":0,"scenes":[{"name":"MetallicSmoothnessTexture","nodes":[3]}],"textures":[{"source":0,"sampler":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/MetallicTexture.gltf.txt b/Tests/Resources/ExportTargets/MetallicTexture.gltf.txt index 1b0e45e7..357bd4f4 100644 --- a/Tests/Resources/ExportTargets/MetallicTexture.gltf.txt +++ b/Tests/Resources/ExportTargets/MetallicTexture.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.6.0"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"MetallicTexture","children":[0,2],"translation":[-26,0,0]}],"buffers":[{"uri":"MetallicTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"metallic.jpg","uri":"metallic.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"MetallicTexture","pbrMetallicRoughness":{"baseColorFactor":[0.07618536,1,0.1254708,1],"metallicRoughnessTexture":{"index":0}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"samplers":[{"magFilter":9728,"minFilter":9728}],"scene":0,"scenes":[{"name":"MetallicTexture","nodes":[3]}],"textures":[{"source":0,"sampler":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"MetallicTexture","children":[0,2],"translation":[-26,0,0]}],"buffers":[{"uri":"MetallicTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"metallic.jpg","uri":"metallic.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"MetallicTexture","pbrMetallicRoughness":{"baseColorFactor":[0.0761853755,1,0.125470817,1],"metallicRoughnessTexture":{"index":0}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"samplers":[{"magFilter":9728,"minFilter":9728}],"scene":0,"scenes":[{"name":"MetallicTexture","nodes":[3]}],"textures":[{"source":0,"sampler":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/NoMaterial.gltf.txt b/Tests/Resources/ExportTargets/NoMaterial.gltf.txt index 252128ef..b5a271cb 100644 --- a/Tests/Resources/ExportTargets/NoMaterial.gltf.txt +++ b/Tests/Resources/ExportTargets/NoMaterial.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.4.0"},"nodes":[{"name":"Cube","mesh":0},{"name":"NoMaterial","children":[0],"translation":[-2,0,0]}],"buffers":[{"uri":"NoMaterial.bin","byteLength":648}],"bufferViews":[{"buffer":0,"byteLength":72},{"buffer":0,"byteLength":576,"byteOffset":72,"byteStride":24}],"accessors":[{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","byteOffset":12},{"bufferView":0,"componentType":5123,"count":36,"type":"SCALAR"}],"meshes":[{"name":"Cube","primitives":[{"attributes":{"POSITION":0,"NORMAL":1},"indices":2}]}],"scene":0,"scenes":[{"name":"NoMaterial","nodes":[1]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Cube","mesh":0},{"name":"NoMaterial","children":[0],"translation":[-2,0,0]}],"buffers":[{"uri":"NoMaterial.bin","byteLength":648}],"bufferViews":[{"buffer":0,"byteLength":72,"target":34963},{"buffer":0,"byteLength":576,"byteOffset":72,"byteStride":24,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","byteOffset":12},{"bufferView":0,"componentType":5123,"count":36,"type":"SCALAR"}],"meshes":[{"name":"Cube","primitives":[{"attributes":{"POSITION":0,"NORMAL":1},"indices":2}]}],"scene":0,"scenes":[{"name":"NoMaterial","nodes":[1]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/NoMaterial2.gltf.txt b/Tests/Resources/ExportTargets/NoMaterial2.gltf.txt index 4f614917..56534bc6 100644 --- a/Tests/Resources/ExportTargets/NoMaterial2.gltf.txt +++ b/Tests/Resources/ExportTargets/NoMaterial2.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.41f1 glTFast 4.8.5"},"nodes":[{"name":"Submesh","mesh":0},{"name":"NoMaterial2","children":[0],"translation":[-3,0,0]}],"buffers":[{"uri":"NoMaterial2.bin","byteLength":204}],"bufferViews":[{"buffer":0,"byteLength":12},{"buffer":0,"byteLength":192,"byteOffset":12,"byteStride":48}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC4","byteOffset":24},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC2","byteOffset":40},{"bufferView":0,"componentType":5123,"count":3,"type":"SCALAR"},{"bufferView":0,"componentType":5123,"count":3,"type":"SCALAR","byteOffset":6}],"materials":[{"name":"Red","pbrMetallicRoughness":{"baseColorFactor":[1,0,0,1],"metallicFactor":0,"roughnessFactor":0.5}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3},"indices":4},{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3},"indices":5,"material":0}]}],"scene":0,"scenes":[{"name":"NoMaterial2","nodes":[1]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Submesh","mesh":0},{"name":"NoMaterial2","children":[0],"translation":[-3,0,0]}],"buffers":[{"uri":"NoMaterial2.bin","byteLength":204}],"bufferViews":[{"buffer":0,"byteLength":12,"target":34963},{"buffer":0,"byteLength":192,"byteOffset":12,"byteStride":48,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC4","byteOffset":24},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC2","byteOffset":40},{"bufferView":0,"componentType":5123,"count":3,"type":"SCALAR"},{"bufferView":0,"componentType":5123,"count":3,"type":"SCALAR","byteOffset":6}],"materials":[{"name":"Red","pbrMetallicRoughness":{"baseColorFactor":[1,0,0,1],"metallicFactor":0,"roughnessFactor":0.5}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3},"indices":4},{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3},"indices":5,"material":0}]}],"scene":0,"scenes":[{"name":"NoMaterial2","nodes":[1]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/NormalTexture.gltf.txt b/Tests/Resources/ExportTargets/NormalTexture.gltf.txt index fbd70278..f7e12597 100644 --- a/Tests/Resources/ExportTargets/NormalTexture.gltf.txt +++ b/Tests/Resources/ExportTargets/NormalTexture.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2021.3.21f1 glTFast 5.0.4"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"NormalTexture","children":[0,2],"translation":[-14,0,0]}],"buffers":[{"uri":"NormalTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"normal.png","uri":"normal.png","mimeType":"image/png"}],"materials":[{"name":"NormalTexture","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0.5},"normalTexture":{"index":0,"scale":1.1}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"NormalTexture","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"NormalTexture","children":[0,2],"translation":[-14,0,0]}],"buffers":[{"uri":"NormalTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"normal.png","uri":"normal.png","mimeType":"image/png"}],"materials":[{"name":"NormalTexture","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0.5},"normalTexture":{"index":0,"scale":1.1}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"NormalTexture","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/OcclusionTexture.gltf.txt b/Tests/Resources/ExportTargets/OcclusionTexture.gltf.txt index 091339e3..bc2b75f6 100644 --- a/Tests/Resources/ExportTargets/OcclusionTexture.gltf.txt +++ b/Tests/Resources/ExportTargets/OcclusionTexture.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.6.0"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"OcclusionTexture","children":[0,2],"translation":[-20,0,0]}],"buffers":[{"uri":"OcclusionTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"occlusion.jpg","uri":"occlusion.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"OcclusionTexture","pbrMetallicRoughness":{"baseColorFactor":[1,0.4543959,0.0765514,1],"metallicFactor":0,"roughnessFactor":0.7},"occlusionTexture":{"index":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"OcclusionTexture","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"OcclusionTexture","children":[0,2],"translation":[-20,0,0]}],"buffers":[{"uri":"OcclusionTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"occlusion.jpg","uri":"occlusion.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"OcclusionTexture","pbrMetallicRoughness":{"baseColorFactor":[1,0.4543959,0.07655142,1],"metallicFactor":0,"roughnessFactor":0.7},"occlusionTexture":{"index":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"OcclusionTexture","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/OcclusionTextureStrength.gltf.txt b/Tests/Resources/ExportTargets/OcclusionTextureStrength.gltf.txt index e9954062..71ed3c7f 100644 --- a/Tests/Resources/ExportTargets/OcclusionTextureStrength.gltf.txt +++ b/Tests/Resources/ExportTargets/OcclusionTextureStrength.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.6.0"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"OcclusionTextureStrength","children":[0,2],"translation":[-21,0,0]}],"extensionsRequired":["KHR_texture_transform"],"extensionsUsed":["KHR_texture_transform"],"buffers":[{"uri":"OcclusionTextureStrength.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"occlusion.jpg","uri":"occlusion.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"OcclusionTextureStrength","pbrMetallicRoughness":{"baseColorFactor":[1,0.4543959,0.0765514,1],"metallicFactor":0},"occlusionTexture":{"index":0,"extensions":{"KHR_texture_transform":{"offset":[0,-0.5],"scale":[2,1.5]}},"strength":0.23}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"OcclusionTextureStrength","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"OcclusionTextureStrength","children":[0,2],"translation":[-21,0,0]}],"extensionsRequired":["KHR_texture_transform"],"extensionsUsed":["KHR_texture_transform"],"buffers":[{"uri":"OcclusionTextureStrength.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"occlusion.jpg","uri":"occlusion.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"OcclusionTextureStrength","pbrMetallicRoughness":{"baseColorFactor":[1,0.4543959,0.07655142,1],"metallicFactor":0},"occlusionTexture":{"index":0,"extensions":{"KHR_texture_transform":{"offset":[0,-0.5],"scale":[2,1.5]}},"strength":0.23}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"OcclusionTextureStrength","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/PointCloud.gltf.txt b/Tests/Resources/ExportTargets/PointCloud.gltf.txt index 9b2ea728..b4c63e1d 100644 --- a/Tests/Resources/ExportTargets/PointCloud.gltf.txt +++ b/Tests/Resources/ExportTargets/PointCloud.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"PointCloud","mesh":0,"translation":[-37,0,0]}],"extensionsRequired":["KHR_materials_unlit"],"extensionsUsed":["KHR_materials_unlit"],"buffers":[{"uri":"PointCloud.bin","byteLength":1824}],"bufferViews":[{"buffer":0,"byteLength":456},{"buffer":0,"byteLength":1368,"byteOffset":456,"byteStride":12}],"accessors":[{"bufferView":1,"componentType":5126,"count":114,"type":"VEC3","max":[1,1,1.00000024],"min":[-1,-1,-0.9999998]},{"bufferView":0,"componentType":5125,"count":114,"type":"SCALAR"}],"materials":[{"name":"PointCloud","extensions":{"KHR_materials_unlit":{}}}],"meshes":[{"name":"PointCloud","primitives":[{"attributes":{"POSITION":0},"indices":1,"material":0,"mode":0}]}],"scene":0,"scenes":[{"name":"PointCloud","nodes":[0]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"PointCloud","mesh":0,"translation":[-37,0,0]}],"extensionsRequired":["KHR_materials_unlit"],"extensionsUsed":["KHR_materials_unlit"],"buffers":[{"uri":"PointCloud.bin","byteLength":1824}],"bufferViews":[{"buffer":0,"byteLength":456,"target":34963},{"buffer":0,"byteLength":1368,"byteOffset":456,"byteStride":12,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":114,"type":"VEC3","max":[1,1,1.00000024],"min":[-1,-1,-0.9999998]},{"bufferView":0,"componentType":5125,"count":114,"type":"SCALAR"}],"materials":[{"name":"PointCloud","extensions":{"KHR_materials_unlit":{}}}],"meshes":[{"name":"PointCloud","primitives":[{"attributes":{"POSITION":0},"indices":1,"material":0,"mode":0}]}],"scene":0,"scenes":[{"name":"PointCloud","nodes":[0]}]} diff --git a/Tests/Resources/ExportTargets/Quads.gltf.txt b/Tests/Resources/ExportTargets/Quads.gltf.txt index 647d36b1..e2209b8d 100644 --- a/Tests/Resources/ExportTargets/Quads.gltf.txt +++ b/Tests/Resources/ExportTargets/Quads.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2021.3.21f1 glTFast 5.0.4"},"nodes":[{"name":"QuadCube","mesh":0,"rotation":[-0.7071068,0,0,0.7071067],"scale":[100,100,100]},{"name":"Quads","children":[0],"translation":[-19,0,0]}],"buffers":[{"uri":"Quads.bin","byteLength":1224}],"bufferViews":[{"buffer":0,"byteLength":72},{"buffer":0,"byteLength":1152,"byteOffset":72,"byteStride":48}],"accessors":[{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","max":[0.005,0.005,0.005],"min":[-0.005,-0.005,-0.005]},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","byteOffset":12},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC4","byteOffset":24},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC2","byteOffset":40},{"bufferView":0,"componentType":5123,"count":36,"type":"SCALAR"}],"images":[{"name":"ColorGrid.jpg","uri":"ColorGrid.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"BaseColorTexture","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0,"baseColorTexture":{"index":0}}}],"meshes":[{"name":"QuadCube","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3},"indices":4,"material":0}]}],"scene":0,"scenes":[{"name":"Quads","nodes":[1]}],"textures":[{"source":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"QuadCube","mesh":0,"rotation":[-0.7071068,0,0,0.7071067],"scale":[100,100,100]},{"name":"Quads","children":[0],"translation":[-19,0,0]}],"buffers":[{"uri":"Quads.bin","byteLength":1224}],"bufferViews":[{"buffer":0,"byteLength":72,"target":34963},{"buffer":0,"byteLength":1152,"byteOffset":72,"byteStride":48,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","max":[0.005,0.005,0.005],"min":[-0.005,-0.005,-0.005]},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","byteOffset":12},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC4","byteOffset":24},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC2","byteOffset":40},{"bufferView":0,"componentType":5123,"count":36,"type":"SCALAR"}],"images":[{"name":"ColorGrid.jpg","uri":"ColorGrid.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"BaseColorTexture","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0,"baseColorTexture":{"index":0}}}],"meshes":[{"name":"QuadCube","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3},"indices":4,"material":0}]}],"scene":0,"scenes":[{"name":"Quads","nodes":[1]}],"textures":[{"source":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/Simple.gltf.txt b/Tests/Resources/ExportTargets/Simple.gltf.txt index da416c0f..c8f1b633 100644 --- a/Tests/Resources/ExportTargets/Simple.gltf.txt +++ b/Tests/Resources/ExportTargets/Simple.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2021.3.12f1 glTFast 4.8.5"},"nodes":[{"name":"Cube","mesh":0},{"name":"Sphere","mesh":1,"translation":[0,0,1]},{"name":"Simple","children":[0,1]}],"buffers":[{"uri":"Simple.bin","byteLength":34864}],"bufferViews":[{"buffer":0,"byteLength":72},{"buffer":0,"byteLength":1344,"byteOffset":72,"byteStride":56},{"buffer":0,"byteLength":4608,"byteOffset":1416},{"buffer":0,"byteLength":28840,"byteOffset":6024,"byteStride":56}],"accessors":[{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","byteOffset":12},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC4","byteOffset":24},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC2","byteOffset":40},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC2","byteOffset":48},{"bufferView":0,"componentType":5123,"count":36,"type":"SCALAR"},{"bufferView":3,"componentType":5126,"count":515,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":3,"componentType":5126,"count":515,"type":"VEC3","byteOffset":12},{"bufferView":3,"componentType":5126,"count":515,"type":"VEC4","byteOffset":24},{"bufferView":3,"componentType":5126,"count":515,"type":"VEC2","byteOffset":40},{"bufferView":3,"componentType":5126,"count":515,"type":"VEC2","byteOffset":48},{"bufferView":2,"componentType":5123,"count":2304,"type":"SCALAR"}],"materials":[{"name":"Red","pbrMetallicRoughness":{"baseColorFactor":[1,0,0,1],"metallicFactor":0,"roughnessFactor":0.5}},{"name":"Green","pbrMetallicRoughness":{"baseColorFactor":[0,1,0,1],"metallicFactor":0,"roughnessFactor":0.5}}],"meshes":[{"name":"Cube","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3,"TEXCOORD_1":4},"indices":5,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":6,"NORMAL":7,"TANGENT":8,"TEXCOORD_0":9,"TEXCOORD_1":10},"indices":11,"material":1}]}],"scene":0,"scenes":[{"name":"Simple","nodes":[2]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Cube","mesh":0},{"name":"Sphere","mesh":1,"translation":[0,0,1]},{"name":"Simple","children":[0,1]}],"buffers":[{"uri":"Simple.bin","byteLength":34864}],"bufferViews":[{"buffer":0,"byteLength":72,"target":34963},{"buffer":0,"byteLength":1344,"byteOffset":72,"byteStride":56,"target":34962},{"buffer":0,"byteLength":4608,"byteOffset":1416,"target":34963},{"buffer":0,"byteLength":28840,"byteOffset":6024,"byteStride":56,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC3","byteOffset":12},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC4","byteOffset":24},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC2","byteOffset":40},{"bufferView":1,"componentType":5126,"count":24,"type":"VEC2","byteOffset":48},{"bufferView":0,"componentType":5123,"count":36,"type":"SCALAR"},{"bufferView":3,"componentType":5126,"count":515,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":3,"componentType":5126,"count":515,"type":"VEC3","byteOffset":12},{"bufferView":3,"componentType":5126,"count":515,"type":"VEC4","byteOffset":24},{"bufferView":3,"componentType":5126,"count":515,"type":"VEC2","byteOffset":40},{"bufferView":3,"componentType":5126,"count":515,"type":"VEC2","byteOffset":48},{"bufferView":2,"componentType":5123,"count":2304,"type":"SCALAR"}],"materials":[{"name":"Red","pbrMetallicRoughness":{"baseColorFactor":[1,0,0,1],"metallicFactor":0,"roughnessFactor":0.5}},{"name":"Green","pbrMetallicRoughness":{"baseColorFactor":[0,1,0,1],"metallicFactor":0,"roughnessFactor":0.5}}],"meshes":[{"name":"Cube","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3,"TEXCOORD_1":4},"indices":5,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":6,"NORMAL":7,"TANGENT":8,"TEXCOORD_0":9,"TEXCOORD_1":10},"indices":11,"material":1}]}],"scene":0,"scenes":[{"name":"Simple","nodes":[2]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/SmoothnessTexture.gltf.txt b/Tests/Resources/ExportTargets/SmoothnessTexture.gltf.txt index a9c502a0..db82fe25 100644 --- a/Tests/Resources/ExportTargets/SmoothnessTexture.gltf.txt +++ b/Tests/Resources/ExportTargets/SmoothnessTexture.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.6.0"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"SmoothnessTexture","children":[0,2],"translation":[-25,0,0]}],"buffers":[{"uri":"SmoothnessTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"smoothness.jpg","uri":"smoothness.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"SmoothnessTexture","pbrMetallicRoughness":{"baseColorFactor":[0.07618536,1,0.1254708,1],"metallicRoughnessTexture":{"index":0}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"samplers":[{"magFilter":9728,"minFilter":9728}],"scene":0,"scenes":[{"name":"SmoothnessTexture","nodes":[3]}],"textures":[{"source":0,"sampler":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"SmoothnessTexture","children":[0,2],"translation":[-25,0,0]}],"buffers":[{"uri":"SmoothnessTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"smoothness.jpg","uri":"smoothness.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"SmoothnessTexture","pbrMetallicRoughness":{"baseColorFactor":[0.0761853755,1,0.125470817,1],"metallicRoughnessTexture":{"index":0}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"samplers":[{"magFilter":9728,"minFilter":9728}],"scene":0,"scenes":[{"name":"SmoothnessTexture","nodes":[3]}],"textures":[{"source":0,"sampler":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/Submesh.gltf.txt b/Tests/Resources/ExportTargets/Submesh.gltf.txt index 04db958e..8374c031 100644 --- a/Tests/Resources/ExportTargets/Submesh.gltf.txt +++ b/Tests/Resources/ExportTargets/Submesh.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.6.0"},"nodes":[{"name":"Submesh","mesh":0,"translation":[-1,0,0]}],"buffers":[{"uri":"Submesh.bin","byteLength":204}],"bufferViews":[{"buffer":0,"byteLength":12},{"buffer":0,"byteLength":192,"byteOffset":12,"byteStride":48}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC4","byteOffset":24},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC2","byteOffset":40},{"bufferView":0,"componentType":5123,"count":3,"type":"SCALAR"},{"bufferView":0,"componentType":5123,"count":3,"type":"SCALAR","byteOffset":6}],"materials":[{"name":"Blue","pbrMetallicRoughness":{"baseColorFactor":[0.009788709,0.0222191215,0.8,1],"metallicFactor":0,"roughnessFactor":0.5}},{"name":"Red","pbrMetallicRoughness":{"baseColorFactor":[1,0,0,1],"metallicFactor":0,"roughnessFactor":0.5}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3},"indices":4,"material":0},{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3},"indices":5,"material":1}]}],"scene":0,"scenes":[{"name":"Submesh","nodes":[0]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Submesh","mesh":0,"translation":[-1,0,0]}],"buffers":[{"uri":"Submesh.bin","byteLength":204}],"bufferViews":[{"buffer":0,"byteLength":12,"target":34963},{"buffer":0,"byteLength":192,"byteOffset":12,"byteStride":48,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC4","byteOffset":24},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC2","byteOffset":40},{"bufferView":0,"componentType":5123,"count":3,"type":"SCALAR"},{"bufferView":0,"componentType":5123,"count":3,"type":"SCALAR","byteOffset":6}],"materials":[{"name":"Blue","pbrMetallicRoughness":{"baseColorFactor":[0.009788713,0.0222191289,0.8,1],"metallicFactor":0,"roughnessFactor":0.5}},{"name":"Red","pbrMetallicRoughness":{"baseColorFactor":[1,0,0,1],"metallicFactor":0,"roughnessFactor":0.5}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3},"indices":4,"material":0},{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3},"indices":5,"material":1}]}],"scene":0,"scenes":[{"name":"Submesh","nodes":[0]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/URP/ClearcoatFactor.gltf.txt b/Tests/Resources/ExportTargets/URP/ClearcoatFactor.gltf.txt index 1b1fb0fa..b7517997 100644 --- a/Tests/Resources/ExportTargets/URP/ClearcoatFactor.gltf.txt +++ b/Tests/Resources/ExportTargets/URP/ClearcoatFactor.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2022.3.27f1 glTFast 6.4.0"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"ClearcoatFactor","children":[0,2],"translation":[-39,0,0]}],"buffers":[{"uri":"ClearcoatFactor.bin","byteLength":20856}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":9216,"byteOffset":120},{"buffer":0,"byteLength":11520,"byteOffset":9336,"byteStride":24}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":3,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":3,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5125,"count":2304,"type":"SCALAR"}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1},"indices":2}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":3,"NORMAL":4},"indices":5}]}],"scene":0,"scenes":[{"name":"ClearcoatFactor","nodes":[3]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2022.3.44f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"ClearcoatFactor","children":[0,2],"translation":[-39,0,0]}],"buffers":[{"uri":"ClearcoatFactor.bin","byteLength":20856}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":120,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9336,"byteStride":24,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":3,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":3,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5125,"count":2304,"type":"SCALAR"}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1},"indices":2}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":3,"NORMAL":4},"indices":5}]}],"scene":0,"scenes":[{"name":"ClearcoatFactor","nodes":[3]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/URP/ClearcoatTexture.gltf.txt b/Tests/Resources/ExportTargets/URP/ClearcoatTexture.gltf.txt index 6bdccf8f..f574053e 100644 --- a/Tests/Resources/ExportTargets/URP/ClearcoatTexture.gltf.txt +++ b/Tests/Resources/ExportTargets/URP/ClearcoatTexture.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2022.3.27f1 glTFast 6.4.0"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"ClearcoatTexture","children":[0,2],"translation":[-40,0,0]}],"buffers":[{"uri":"ClearcoatTexture.bin","byteLength":20856}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":9216,"byteOffset":120},{"buffer":0,"byteLength":11520,"byteOffset":9336,"byteStride":24}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":3,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":3,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5125,"count":2304,"type":"SCALAR"}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1},"indices":2}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":3,"NORMAL":4},"indices":5}]}],"scene":0,"scenes":[{"name":"ClearcoatTexture","nodes":[3]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2022.3.44f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"ClearcoatTexture","children":[0,2],"translation":[-40,0,0]}],"buffers":[{"uri":"ClearcoatTexture.bin","byteLength":20856}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":120,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9336,"byteStride":24,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":3,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":3,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5125,"count":2304,"type":"SCALAR"}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1},"indices":2}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":3,"NORMAL":4},"indices":5}]}],"scene":0,"scenes":[{"name":"ClearcoatTexture","nodes":[3]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/URP/Dielectric.gltf.txt b/Tests/Resources/ExportTargets/URP/Dielectric.gltf.txt index 6c15d41a..a321c903 100644 --- a/Tests/Resources/ExportTargets/URP/Dielectric.gltf.txt +++ b/Tests/Resources/ExportTargets/URP/Dielectric.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.6.0"},"nodes":[{"name":"Sphere","mesh":0},{"name":"sphere 1","children":[0]},{"name":"Sphere","mesh":1},{"name":"sphere 2","children":[2],"translation":[0,0,1]},{"name":"Sphere","mesh":2},{"name":"sphere 3","children":[4],"translation":[0,0,2]},{"name":"Sphere","mesh":3},{"name":"sphere 4","children":[6],"translation":[0,0,3]},{"name":"Sphere","mesh":4},{"name":"sphere 5","children":[8],"translation":[0,0,4]},{"name":"Dielectric","children":[1,3,5,7,9],"translation":[-8,0,0]}],"buffers":[{"uri":"Dielectric.bin","byteLength":24576}],"bufferViews":[{"buffer":0,"byteLength":9216},{"buffer":0,"byteLength":11520,"byteOffset":9216,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20736,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":1,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":2304,"type":"SCALAR"}],"materials":[{"name":"Dielectric 1","pbrMetallicRoughness":{"baseColorFactor":[0.45914036,0.14717856,1,1],"metallicFactor":0,"roughnessFactor":0}},{"name":"Dielectric 2","pbrMetallicRoughness":{"baseColorFactor":[0.45914036,0.14717856,1,1],"metallicFactor":0,"roughnessFactor":0.25}},{"name":"Dielectric 3","pbrMetallicRoughness":{"baseColorFactor":[0.45914036,0.14717856,1,1],"metallicFactor":0,"roughnessFactor":0.5}},{"name":"Dielectric 4","pbrMetallicRoughness":{"baseColorFactor":[0.45914036,0.14717856,1,1],"metallicFactor":0,"roughnessFactor":0.75}},{"name":"Dielectric 5","pbrMetallicRoughness":{"baseColorFactor":[0.45914036,0.14717856,1,1],"metallicFactor":0}}],"meshes":[{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":1}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":2}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":3}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":4}]}],"scene":0,"scenes":[{"name":"Dielectric","nodes":[10]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2022.3.44f1 glTFast 6.7.1"},"nodes":[{"name":"Sphere","mesh":0},{"name":"sphere 1","children":[0]},{"name":"Sphere","mesh":1},{"name":"sphere 2","children":[2],"translation":[0,0,1]},{"name":"Sphere","mesh":2},{"name":"sphere 3","children":[4],"translation":[0,0,2]},{"name":"Sphere","mesh":3},{"name":"sphere 4","children":[6],"translation":[0,0,3]},{"name":"Sphere","mesh":4},{"name":"sphere 5","children":[8],"translation":[0,0,4]},{"name":"Dielectric","children":[1,3,5,7,9],"translation":[-8,0,0]}],"buffers":[{"uri":"Dielectric.bin","byteLength":24576}],"bufferViews":[{"buffer":0,"byteLength":9216,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9216,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20736,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":1,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":2304,"type":"SCALAR"}],"materials":[{"name":"Dielectric 1","pbrMetallicRoughness":{"baseColorFactor":[0.45914036,0.147178546,1,1],"metallicFactor":0,"roughnessFactor":0}},{"name":"Dielectric 2","pbrMetallicRoughness":{"baseColorFactor":[0.45914036,0.147178546,1,1],"metallicFactor":0,"roughnessFactor":0.25}},{"name":"Dielectric 3","pbrMetallicRoughness":{"baseColorFactor":[0.45914036,0.147178546,1,1],"metallicFactor":0,"roughnessFactor":0.5}},{"name":"Dielectric 4","pbrMetallicRoughness":{"baseColorFactor":[0.45914036,0.147178546,1,1],"metallicFactor":0,"roughnessFactor":0.75}},{"name":"Dielectric 5","pbrMetallicRoughness":{"baseColorFactor":[0.45914036,0.147178546,1,1],"metallicFactor":0}}],"meshes":[{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":1}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":2}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":3}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":4}]}],"scene":0,"scenes":[{"name":"Dielectric","nodes":[10]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/URP/DoubleSided.gltf.txt b/Tests/Resources/ExportTargets/URP/DoubleSided.gltf.txt index 0919cc18..7ff2d7a9 100644 --- a/Tests/Resources/ExportTargets/URP/DoubleSided.gltf.txt +++ b/Tests/Resources/ExportTargets/URP/DoubleSided.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.6.0"},"nodes":[{"name":"DoubleSided","mesh":0,"translation":[-18,0,0],"rotation":[-0.5,-0.5,-0.5,0.5]}],"buffers":[{"uri":"DoubleSided.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"DoubleSided","pbrMetallicRoughness":{"baseColorFactor":[0,0.008149115,1,1],"metallicFactor":0,"roughnessFactor":0.7},"doubleSided":true}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"DoubleSided","nodes":[0]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2022.3.44f1 glTFast 6.7.1"},"nodes":[{"name":"DoubleSided","mesh":0,"translation":[-18,0,0],"rotation":[-0.5,-0.5,-0.5,0.5]}],"buffers":[{"uri":"DoubleSided.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"DoubleSided","pbrMetallicRoughness":{"baseColorFactor":[0,0.008149112,1,1],"metallicFactor":0,"roughnessFactor":0.7},"doubleSided":true}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"DoubleSided","nodes":[0]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/URP/LightAreaDisc.gltf.txt b/Tests/Resources/ExportTargets/URP/LightAreaDisc.gltf.txt index 6d0c20fc..a9a3abb2 100644 --- a/Tests/Resources/ExportTargets/URP/LightAreaDisc.gltf.txt +++ b/Tests/Resources/ExportTargets/URP/LightAreaDisc.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.2.0"},"nodes":[{"name":"Light","children":[1],"translation":[0,1,0],"rotation":[0.482962936,-0.224143922,0.129409552,0.8365163]},{"name":"Light_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":0}}},{"name":"Plane","mesh":0,"scale":[10,10,10]},{"name":"LightAreaDisc","children":[0,2],"translation":[-45,0,10]}],"extensionsRequired":["KHR_lights_punctual"],"extensionsUsed":["KHR_lights_punctual"],"buffers":[{"uri":"LightAreaDisc.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"Neutral","pbrMetallicRoughness":{"metallicFactor":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"LightAreaDisc","nodes":[3]}],"extensions":{"KHR_lights_punctual":{"lights":[{"type":"spot","name":"Light","color":[0.6038274,0.0331047624,0.0331047624],"range":100,"spot":{"innerConeAngle":0.305432618,"outerConeAngle":0.3926991}}]}}} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2022.3.44f1 glTFast 6.7.1"},"nodes":[{"name":"Light","children":[3],"translation":[0,1,0],"rotation":[0.482962936,-0.224143922,0.129409552,0.8365163]},{"name":"Plane","mesh":0,"scale":[10,10,10]},{"name":"LightAreaDisc","children":[0,1],"translation":[-45,0,10]},{"name":"Light_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":0}}}],"extensionsRequired":["KHR_lights_punctual"],"extensionsUsed":["KHR_lights_punctual"],"buffers":[{"uri":"LightAreaDisc.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"Neutral","pbrMetallicRoughness":{"metallicFactor":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"LightAreaDisc","nodes":[2]}],"extensions":{"KHR_lights_punctual":{"lights":[{"type":"spot","name":"Light","color":[0.6038274,0.0331047624,0.0331047624],"range":100,"spot":{"innerConeAngle":0.305432618,"outerConeAngle":0.3926991}}]}}} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/URP/LightAreaRectangle.gltf.txt b/Tests/Resources/ExportTargets/URP/LightAreaRectangle.gltf.txt index ac13d620..e8e7eca3 100644 --- a/Tests/Resources/ExportTargets/URP/LightAreaRectangle.gltf.txt +++ b/Tests/Resources/ExportTargets/URP/LightAreaRectangle.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.2.0"},"nodes":[{"name":"Light","children":[1],"translation":[0,1,0],"rotation":[0.482962936,-0.224143922,0.129409552,0.8365163]},{"name":"Light_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":0}}},{"name":"Plane","mesh":0,"scale":[10,10,10]},{"name":"LightAreaRectangle","children":[0,2],"translation":[-35,0,10]}],"extensionsRequired":["KHR_lights_punctual"],"extensionsUsed":["KHR_lights_punctual"],"buffers":[{"uri":"LightAreaRectangle.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"Neutral","pbrMetallicRoughness":{"metallicFactor":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"LightAreaRectangle","nodes":[3]}],"extensions":{"KHR_lights_punctual":{"lights":[{"type":"spot","name":"Light","color":[0.6038274,0.0331047624,0.0331047624],"range":100,"spot":{"innerConeAngle":0.305432618,"outerConeAngle":0.3926991}}]}}} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2022.3.44f1 glTFast 6.7.1"},"nodes":[{"name":"Light","children":[3],"translation":[0,1,0],"rotation":[0.482962936,-0.224143922,0.129409552,0.8365163]},{"name":"Plane","mesh":0,"scale":[10,10,10]},{"name":"LightAreaRectangle","children":[0,1],"translation":[-35,0,10]},{"name":"Light_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":0}}}],"extensionsRequired":["KHR_lights_punctual"],"extensionsUsed":["KHR_lights_punctual"],"buffers":[{"uri":"LightAreaRectangle.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"Neutral","pbrMetallicRoughness":{"metallicFactor":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"LightAreaRectangle","nodes":[2]}],"extensions":{"KHR_lights_punctual":{"lights":[{"type":"spot","name":"Light","color":[0.6038274,0.0331047624,0.0331047624],"range":100,"spot":{"innerConeAngle":0.305432618,"outerConeAngle":0.3926991}}]}}} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/URP/LightDirectional.gltf.txt b/Tests/Resources/ExportTargets/URP/LightDirectional.gltf.txt index c1583a55..65e486e4 100644 --- a/Tests/Resources/ExportTargets/URP/LightDirectional.gltf.txt +++ b/Tests/Resources/ExportTargets/URP/LightDirectional.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.41f1 glTFast 5.0.0-exp.1"},"nodes":[{"name":"Light","children":[1],"translation":[0,1,0],"rotation":[0.482962936,-0.224143922,0.129409552,0.8365163]},{"name":"Light_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":0}}},{"name":"Plane","mesh":0,"scale":[10,10,10]},{"name":"LightDirectional","children":[0,2],"translation":[-25,0,10]}],"extensionsRequired":["KHR_lights_punctual"],"extensionsUsed":["KHR_lights_punctual"],"buffers":[{"uri":"LightDirectional.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"Neutral","pbrMetallicRoughness":{"metallicFactor":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"LightDirectional","nodes":[3]}],"extensions":{"KHR_lights_punctual":{"lights":[{"type":"directional","name":"Light","color":[0.6038274,0.0331047624,0.0331047624],"intensity":0.1}]}}} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2022.3.44f1 glTFast 6.7.1"},"nodes":[{"name":"Light","children":[3],"translation":[0,1,0],"rotation":[0.482962936,-0.224143922,0.129409552,0.8365163]},{"name":"Plane","mesh":0,"scale":[10,10,10]},{"name":"LightDirectional","children":[0,1],"translation":[-25,0,10]},{"name":"Light_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":0}}}],"extensionsRequired":["KHR_lights_punctual"],"extensionsUsed":["KHR_lights_punctual"],"buffers":[{"uri":"LightDirectional.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"Neutral","pbrMetallicRoughness":{"metallicFactor":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"LightDirectional","nodes":[2]}],"extensions":{"KHR_lights_punctual":{"lights":[{"type":"directional","name":"Light","color":[0.6038274,0.0331047624,0.0331047624],"intensity":0.1}]}}} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/URP/LightsPoint.gltf.txt b/Tests/Resources/ExportTargets/URP/LightsPoint.gltf.txt index 6d0d58b5..6e36a770 100644 --- a/Tests/Resources/ExportTargets/URP/LightsPoint.gltf.txt +++ b/Tests/Resources/ExportTargets/URP/LightsPoint.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.41f1 glTFast 5.0.0-exp.1"},"nodes":[{"name":"Red","translation":[1,1,-1.73205],"extensions":{"KHR_lights_punctual":{"light":0}}},{"name":"Green","translation":[1,1,1.73205],"extensions":{"KHR_lights_punctual":{"light":1}}},{"name":"Blue","translation":[-2,1,0],"extensions":{"KHR_lights_punctual":{"light":2}}},{"name":"Plane","mesh":0,"scale":[10,10,10]},{"name":"LightsPoint","children":[0,1,2,3],"translation":[-5,0,10]}],"extensionsRequired":["KHR_lights_punctual"],"extensionsUsed":["KHR_lights_punctual"],"buffers":[{"uri":"LightsPoint.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"Neutral","pbrMetallicRoughness":{"metallicFactor":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"LightsPoint","nodes":[4]}],"extensions":{"KHR_lights_punctual":{"lights":[{"type":"point","name":"Red","color":[1,0,0],"range":10},{"type":"point","name":"Green","color":[0,1,0],"range":10},{"type":"point","name":"Blue","color":[0,0,1],"range":10}]}}} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2022.3.44f1 glTFast 6.7.1"},"nodes":[{"name":"Red","translation":[1,1,-1.73205],"extensions":{"KHR_lights_punctual":{"light":0}}},{"name":"Green","translation":[1,1,1.73205],"extensions":{"KHR_lights_punctual":{"light":1}}},{"name":"Blue","translation":[-2,1,0],"extensions":{"KHR_lights_punctual":{"light":2}}},{"name":"Plane","mesh":0,"scale":[10,10,10]},{"name":"LightsPoint","children":[0,1,2,3],"translation":[-5,0,10]}],"extensionsRequired":["KHR_lights_punctual"],"extensionsUsed":["KHR_lights_punctual"],"buffers":[{"uri":"LightsPoint.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"Neutral","pbrMetallicRoughness":{"metallicFactor":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"LightsPoint","nodes":[4]}],"extensions":{"KHR_lights_punctual":{"lights":[{"type":"point","name":"Red","color":[1,0,0],"range":10},{"type":"point","name":"Green","color":[0,1,0],"range":10},{"type":"point","name":"Blue","color":[0,0,1],"range":10}]}}} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/URP/LightsSpot.gltf.txt b/Tests/Resources/ExportTargets/URP/LightsSpot.gltf.txt index b6c5d515..6c670b18 100644 --- a/Tests/Resources/ExportTargets/URP/LightsSpot.gltf.txt +++ b/Tests/Resources/ExportTargets/URP/LightsSpot.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.41f1 glTFast 5.0.0-exp.1"},"nodes":[{"name":"Red","children":[1],"translation":[1,12,-1.73205],"rotation":[0.7071068,0,0,0.7071068]},{"name":"Red_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":0}}},{"name":"Green","children":[3],"translation":[1,12,1.73205],"rotation":[0.7071068,0,0,0.7071068]},{"name":"Green_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":1}}},{"name":"Blue","children":[5],"translation":[-2,12,0],"rotation":[0.7071068,0,0,0.7071068]},{"name":"Blue_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":2}}},{"name":"Plane","mesh":0,"scale":[10,10,10]},{"name":"LightsSpot","children":[0,2,4,6],"translation":[-15,0,10]}],"extensionsRequired":["KHR_lights_punctual"],"extensionsUsed":["KHR_lights_punctual"],"buffers":[{"uri":"LightsSpot.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"Neutral","pbrMetallicRoughness":{"metallicFactor":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"LightsSpot","nodes":[7]}],"extensions":{"KHR_lights_punctual":{"lights":[{"type":"spot","name":"Red","color":[1,0,0],"intensity":100,"range":100,"spot":{"innerConeAngle":0.190259039,"outerConeAngle":0.2617994}},{"type":"spot","name":"Green","color":[0,1,0],"intensity":100,"range":100,"spot":{"innerConeAngle":0.190259039,"outerConeAngle":0.2617994}},{"type":"spot","name":"Blue","color":[0,0,1],"intensity":100,"range":100,"spot":{"innerConeAngle":0.190259039,"outerConeAngle":0.2617994}}]}}} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2022.3.44f1 glTFast 6.7.1"},"nodes":[{"name":"Red","children":[5],"translation":[1,12,-1.73205],"rotation":[0.7071068,0,0,0.7071068]},{"name":"Green","children":[6],"translation":[1,12,1.73205],"rotation":[0.7071068,0,0,0.7071068]},{"name":"Blue","children":[7],"translation":[-2,12,0],"rotation":[0.7071068,0,0,0.7071068]},{"name":"Plane","mesh":0,"scale":[10,10,10]},{"name":"LightsSpot","children":[0,1,2,3],"translation":[-15,0,10]},{"name":"Red_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":0}}},{"name":"Green_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":1}}},{"name":"Blue_Orientation","rotation":[0,-1,0,-4.371139E-08],"extensions":{"KHR_lights_punctual":{"light":2}}}],"extensionsRequired":["KHR_lights_punctual"],"extensionsUsed":["KHR_lights_punctual"],"buffers":[{"uri":"LightsSpot.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"materials":[{"name":"Neutral","pbrMetallicRoughness":{"metallicFactor":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}],"scene":0,"scenes":[{"name":"LightsSpot","nodes":[4]}],"extensions":{"KHR_lights_punctual":{"lights":[{"type":"spot","name":"Red","color":[1,0,0],"intensity":100,"range":100,"spot":{"innerConeAngle":0.190259039,"outerConeAngle":0.2617994}},{"type":"spot","name":"Green","color":[0,1,0],"intensity":100,"range":100,"spot":{"innerConeAngle":0.190259039,"outerConeAngle":0.2617994}},{"type":"spot","name":"Blue","color":[0,0,1],"intensity":100,"range":100,"spot":{"innerConeAngle":0.190259039,"outerConeAngle":0.2617994}}]}}} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/URP/MetallicSmoothnessOcclusionTexture.gltf.txt b/Tests/Resources/ExportTargets/URP/MetallicSmoothnessOcclusionTexture.gltf.txt index 128cb3dd..d658d1e5 100644 --- a/Tests/Resources/ExportTargets/URP/MetallicSmoothnessOcclusionTexture.gltf.txt +++ b/Tests/Resources/ExportTargets/URP/MetallicSmoothnessOcclusionTexture.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.6.0"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"MetallicSmoothnessOcclusionTexture","children":[0,2],"translation":[-28,0,0]}],"buffers":[{"uri":"MetallicSmoothnessOcclusionTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"metallic-smoothness.jpg","uri":"metallic-smoothness.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"MetallicSmoothnessOcclusionTexture","pbrMetallicRoughness":{"baseColorFactor":[0.07618536,0.87672466,1,1],"metallicRoughnessTexture":{"index":0}},"occlusionTexture":{"index":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"samplers":[{"magFilter":9728,"minFilter":9728}],"scene":0,"scenes":[{"name":"MetallicSmoothnessOcclusionTexture","nodes":[3]}],"textures":[{"source":0,"sampler":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2022.3.44f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"MetallicSmoothnessOcclusionTexture","children":[0,2],"translation":[-28,0,0]}],"buffers":[{"uri":"MetallicSmoothnessOcclusionTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"metallic-smoothness.jpg","uri":"metallic-smoothness.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"MetallicSmoothnessOcclusionTexture","pbrMetallicRoughness":{"baseColorFactor":[0.0761853456,0.87672466,1,1],"metallicRoughnessTexture":{"index":0}},"occlusionTexture":{"index":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"samplers":[{"magFilter":9728,"minFilter":9728}],"scene":0,"scenes":[{"name":"MetallicSmoothnessOcclusionTexture","nodes":[3]}],"textures":[{"source":0,"sampler":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/URP/MetallicSmoothnessTexture.gltf.txt b/Tests/Resources/ExportTargets/URP/MetallicSmoothnessTexture.gltf.txt index 472e2511..005f8b97 100644 --- a/Tests/Resources/ExportTargets/URP/MetallicSmoothnessTexture.gltf.txt +++ b/Tests/Resources/ExportTargets/URP/MetallicSmoothnessTexture.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.6.0"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"MetallicSmoothnessTexture","children":[0,2],"translation":[-27,0,0]}],"buffers":[{"uri":"MetallicSmoothnessTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"metallic-smoothness.jpg","uri":"metallic-smoothness.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"MetallicSmoothnessTexture","pbrMetallicRoughness":{"baseColorFactor":[0.07618536,1,0.1254708,1],"metallicRoughnessTexture":{"index":0}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"samplers":[{"magFilter":9728,"minFilter":9728}],"scene":0,"scenes":[{"name":"MetallicSmoothnessTexture","nodes":[3]}],"textures":[{"source":0,"sampler":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2022.3.44f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"MetallicSmoothnessTexture","children":[0,2],"translation":[-27,0,0]}],"buffers":[{"uri":"MetallicSmoothnessTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"metallic-smoothness.jpg","uri":"metallic-smoothness.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"MetallicSmoothnessTexture","pbrMetallicRoughness":{"baseColorFactor":[0.0761853456,1,0.125470772,1],"metallicRoughnessTexture":{"index":0}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"samplers":[{"magFilter":9728,"minFilter":9728}],"scene":0,"scenes":[{"name":"MetallicSmoothnessTexture","nodes":[3]}],"textures":[{"source":0,"sampler":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/URP/MetallicTexture.gltf.txt b/Tests/Resources/ExportTargets/URP/MetallicTexture.gltf.txt index 1b0e45e7..b30ac71b 100644 --- a/Tests/Resources/ExportTargets/URP/MetallicTexture.gltf.txt +++ b/Tests/Resources/ExportTargets/URP/MetallicTexture.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.6.0"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"MetallicTexture","children":[0,2],"translation":[-26,0,0]}],"buffers":[{"uri":"MetallicTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"metallic.jpg","uri":"metallic.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"MetallicTexture","pbrMetallicRoughness":{"baseColorFactor":[0.07618536,1,0.1254708,1],"metallicRoughnessTexture":{"index":0}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"samplers":[{"magFilter":9728,"minFilter":9728}],"scene":0,"scenes":[{"name":"MetallicTexture","nodes":[3]}],"textures":[{"source":0,"sampler":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2022.3.44f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"MetallicTexture","children":[0,2],"translation":[-26,0,0]}],"buffers":[{"uri":"MetallicTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"metallic.jpg","uri":"metallic.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"MetallicTexture","pbrMetallicRoughness":{"baseColorFactor":[0.0761853456,1,0.125470772,1],"metallicRoughnessTexture":{"index":0}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"samplers":[{"magFilter":9728,"minFilter":9728}],"scene":0,"scenes":[{"name":"MetallicTexture","nodes":[3]}],"textures":[{"source":0,"sampler":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/URP/NoMaterial2.gltf.txt b/Tests/Resources/ExportTargets/URP/NoMaterial2.gltf.txt index a1007920..d23c8eff 100644 --- a/Tests/Resources/ExportTargets/URP/NoMaterial2.gltf.txt +++ b/Tests/Resources/ExportTargets/URP/NoMaterial2.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.41f1 glTFast 5.0.0-exp.1"},"nodes":[{"name":"Submesh","mesh":0},{"name":"NoMaterial2","children":[0],"translation":[-3,0,0]}],"buffers":[{"uri":"NoMaterial2.bin","byteLength":204}],"bufferViews":[{"buffer":0,"byteLength":12},{"buffer":0,"byteLength":192,"byteOffset":12,"byteStride":48}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC4","byteOffset":24},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC2","byteOffset":40},{"bufferView":0,"componentType":5123,"count":3,"type":"SCALAR"},{"bufferView":0,"componentType":5123,"count":3,"type":"SCALAR","byteOffset":6}],"materials":[{"name":"Red","pbrMetallicRoughness":{"baseColorFactor":[1,0,0,1],"metallicFactor":0,"roughnessFactor":0.5}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3},"indices":4},{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3},"indices":5,"material":0}]}],"scene":0,"scenes":[{"name":"NoMaterial2","nodes":[1]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2022.3.44f1 glTFast 6.7.1"},"nodes":[{"name":"Submesh","mesh":0},{"name":"NoMaterial2","children":[0],"translation":[-3,0,0]}],"buffers":[{"uri":"NoMaterial2.bin","byteLength":204}],"bufferViews":[{"buffer":0,"byteLength":12,"target":34963},{"buffer":0,"byteLength":192,"byteOffset":12,"byteStride":48,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC4","byteOffset":24},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC2","byteOffset":40},{"bufferView":0,"componentType":5123,"count":3,"type":"SCALAR"},{"bufferView":0,"componentType":5123,"count":3,"type":"SCALAR","byteOffset":6}],"materials":[{"name":"Red","pbrMetallicRoughness":{"baseColorFactor":[1,0,0,1],"metallicFactor":0,"roughnessFactor":0.5}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3},"indices":4},{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3},"indices":5,"material":0}]}],"scene":0,"scenes":[{"name":"NoMaterial2","nodes":[1]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/URP/OcclusionTexture.gltf.txt b/Tests/Resources/ExportTargets/URP/OcclusionTexture.gltf.txt index 091339e3..e97d5505 100644 --- a/Tests/Resources/ExportTargets/URP/OcclusionTexture.gltf.txt +++ b/Tests/Resources/ExportTargets/URP/OcclusionTexture.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.6.0"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"OcclusionTexture","children":[0,2],"translation":[-20,0,0]}],"buffers":[{"uri":"OcclusionTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"occlusion.jpg","uri":"occlusion.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"OcclusionTexture","pbrMetallicRoughness":{"baseColorFactor":[1,0.4543959,0.0765514,1],"metallicFactor":0,"roughnessFactor":0.7},"occlusionTexture":{"index":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"OcclusionTexture","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2022.3.44f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"OcclusionTexture","children":[0,2],"translation":[-20,0,0]}],"buffers":[{"uri":"OcclusionTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"occlusion.jpg","uri":"occlusion.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"OcclusionTexture","pbrMetallicRoughness":{"baseColorFactor":[1,0.4543959,0.0765513852,1],"metallicFactor":0,"roughnessFactor":0.7},"occlusionTexture":{"index":0}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"OcclusionTexture","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/URP/OcclusionTextureStrength.gltf.txt b/Tests/Resources/ExportTargets/URP/OcclusionTextureStrength.gltf.txt index e9954062..239415e7 100644 --- a/Tests/Resources/ExportTargets/URP/OcclusionTextureStrength.gltf.txt +++ b/Tests/Resources/ExportTargets/URP/OcclusionTextureStrength.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.6.0"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"OcclusionTextureStrength","children":[0,2],"translation":[-21,0,0]}],"extensionsRequired":["KHR_texture_transform"],"extensionsUsed":["KHR_texture_transform"],"buffers":[{"uri":"OcclusionTextureStrength.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"occlusion.jpg","uri":"occlusion.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"OcclusionTextureStrength","pbrMetallicRoughness":{"baseColorFactor":[1,0.4543959,0.0765514,1],"metallicFactor":0},"occlusionTexture":{"index":0,"extensions":{"KHR_texture_transform":{"offset":[0,-0.5],"scale":[2,1.5]}},"strength":0.23}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"OcclusionTextureStrength","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2022.3.44f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"OcclusionTextureStrength","children":[0,2],"translation":[-21,0,0]}],"extensionsRequired":["KHR_texture_transform"],"extensionsUsed":["KHR_texture_transform"],"buffers":[{"uri":"OcclusionTextureStrength.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"occlusion.jpg","uri":"occlusion.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"OcclusionTextureStrength","pbrMetallicRoughness":{"baseColorFactor":[1,0.4543959,0.0765513852,1],"metallicFactor":0},"occlusionTexture":{"index":0,"extensions":{"KHR_texture_transform":{"offset":[0,-0.5],"scale":[2,1.5]}},"strength":0.23}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"OcclusionTextureStrength","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/URP/SmoothnessTexture.gltf.txt b/Tests/Resources/ExportTargets/URP/SmoothnessTexture.gltf.txt index a9c502a0..228cfc33 100644 --- a/Tests/Resources/ExportTargets/URP/SmoothnessTexture.gltf.txt +++ b/Tests/Resources/ExportTargets/URP/SmoothnessTexture.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.6.0"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"SmoothnessTexture","children":[0,2],"translation":[-25,0,0]}],"buffers":[{"uri":"SmoothnessTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"smoothness.jpg","uri":"smoothness.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"SmoothnessTexture","pbrMetallicRoughness":{"baseColorFactor":[0.07618536,1,0.1254708,1],"metallicRoughnessTexture":{"index":0}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"samplers":[{"magFilter":9728,"minFilter":9728}],"scene":0,"scenes":[{"name":"SmoothnessTexture","nodes":[3]}],"textures":[{"source":0,"sampler":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2022.3.44f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"SmoothnessTexture","children":[0,2],"translation":[-25,0,0]}],"buffers":[{"uri":"SmoothnessTexture.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"smoothness.jpg","uri":"smoothness.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"SmoothnessTexture","pbrMetallicRoughness":{"baseColorFactor":[0.0761853456,1,0.125470772,1],"metallicRoughnessTexture":{"index":0}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"samplers":[{"magFilter":9728,"minFilter":9728}],"scene":0,"scenes":[{"name":"SmoothnessTexture","nodes":[3]}],"textures":[{"source":0,"sampler":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/URP/Submesh.gltf.txt b/Tests/Resources/ExportTargets/URP/Submesh.gltf.txt index 04db958e..383e98e0 100644 --- a/Tests/Resources/ExportTargets/URP/Submesh.gltf.txt +++ b/Tests/Resources/ExportTargets/URP/Submesh.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.6.0"},"nodes":[{"name":"Submesh","mesh":0,"translation":[-1,0,0]}],"buffers":[{"uri":"Submesh.bin","byteLength":204}],"bufferViews":[{"buffer":0,"byteLength":12},{"buffer":0,"byteLength":192,"byteOffset":12,"byteStride":48}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC4","byteOffset":24},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC2","byteOffset":40},{"bufferView":0,"componentType":5123,"count":3,"type":"SCALAR"},{"bufferView":0,"componentType":5123,"count":3,"type":"SCALAR","byteOffset":6}],"materials":[{"name":"Blue","pbrMetallicRoughness":{"baseColorFactor":[0.009788709,0.0222191215,0.8,1],"metallicFactor":0,"roughnessFactor":0.5}},{"name":"Red","pbrMetallicRoughness":{"baseColorFactor":[1,0,0,1],"metallicFactor":0,"roughnessFactor":0.5}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3},"indices":4,"material":0},{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3},"indices":5,"material":1}]}],"scene":0,"scenes":[{"name":"Submesh","nodes":[0]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2022.3.44f1 glTFast 6.7.1"},"nodes":[{"name":"Submesh","mesh":0,"translation":[-1,0,0]}],"buffers":[{"uri":"Submesh.bin","byteLength":204}],"bufferViews":[{"buffer":0,"byteLength":12,"target":34963},{"buffer":0,"byteLength":192,"byteOffset":12,"byteStride":48,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC4","byteOffset":24},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC2","byteOffset":40},{"bufferView":0,"componentType":5123,"count":3,"type":"SCALAR"},{"bufferView":0,"componentType":5123,"count":3,"type":"SCALAR","byteOffset":6}],"materials":[{"name":"Blue","pbrMetallicRoughness":{"baseColorFactor":[0.009788704,0.022219114,0.8,1],"metallicFactor":0,"roughnessFactor":0.5}},{"name":"Red","pbrMetallicRoughness":{"baseColorFactor":[1,0,0,1],"metallicFactor":0,"roughnessFactor":0.5}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3},"indices":4,"material":0},{"attributes":{"POSITION":0,"NORMAL":1,"TANGENT":2,"TEXCOORD_0":3},"indices":5,"material":1}]}],"scene":0,"scenes":[{"name":"Submesh","nodes":[0]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/URP/Unlit.gltf.txt b/Tests/Resources/ExportTargets/URP/Unlit.gltf.txt index 7b1f5d59..e22ea746 100644 --- a/Tests/Resources/ExportTargets/URP/Unlit.gltf.txt +++ b/Tests/Resources/ExportTargets/URP/Unlit.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.6.0"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"Unlit","children":[0,2],"translation":[-15,0,0]}],"extensionsRequired":["KHR_materials_unlit"],"extensionsUsed":["KHR_materials_unlit"],"buffers":[{"uri":"Unlit.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"materials":[{"name":"Unlit","pbrMetallicRoughness":{"baseColorFactor":[1,0.272652268,0,1],"metallicFactor":0},"extensions":{"KHR_materials_unlit":{}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"Unlit","nodes":[3]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2022.3.44f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"Unlit","children":[0,2],"translation":[-15,0,0]}],"extensionsRequired":["KHR_materials_unlit"],"extensionsUsed":["KHR_materials_unlit"],"buffers":[{"uri":"Unlit.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"materials":[{"name":"Unlit","pbrMetallicRoughness":{"baseColorFactor":[1,0.2726522,0,1],"metallicFactor":0},"extensions":{"KHR_materials_unlit":{}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"Unlit","nodes":[3]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/Unlit.gltf.txt b/Tests/Resources/ExportTargets/Unlit.gltf.txt index da437eaa..6fc41f63 100644 --- a/Tests/Resources/ExportTargets/Unlit.gltf.txt +++ b/Tests/Resources/ExportTargets/Unlit.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.6.0"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"Unlit","children":[0,2],"translation":[-15,0,0]}],"extensionsRequired":["KHR_materials_unlit"],"extensionsUsed":["KHR_materials_unlit"],"buffers":[{"uri":"Unlit.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"materials":[{"name":"Unlit","pbrMetallicRoughness":{"baseColorFactor":[1,0.2726522,0,1],"metallicFactor":0},"extensions":{"KHR_materials_unlit":{}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"Unlit","nodes":[3]}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"Unlit","children":[0,2],"translation":[-15,0,0]}],"extensionsRequired":["KHR_materials_unlit"],"extensionsUsed":["KHR_materials_unlit"],"buffers":[{"uri":"Unlit.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"materials":[{"name":"Unlit","pbrMetallicRoughness":{"baseColorFactor":[1,0.272652268,0,1],"metallicFactor":0},"extensions":{"KHR_materials_unlit":{}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"Unlit","nodes":[3]}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/UnlitTextured.gltf.txt b/Tests/Resources/ExportTargets/UnlitTextured.gltf.txt index 82d395ea..a5bdc717 100644 --- a/Tests/Resources/ExportTargets/UnlitTextured.gltf.txt +++ b/Tests/Resources/ExportTargets/UnlitTextured.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2021.3.21f1 glTFast 5.0.4"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"UnlitTextured","children":[0,2],"translation":[-16,0,0]}],"extensionsRequired":["KHR_materials_unlit"],"extensionsUsed":["KHR_materials_unlit"],"buffers":[{"uri":"UnlitTextured.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"ColorGrid.jpg","uri":"ColorGrid.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"UnlitTextured","pbrMetallicRoughness":{"metallicFactor":0,"baseColorTexture":{"index":0}},"extensions":{"KHR_materials_unlit":{}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"UnlitTextured","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"UnlitTextured","children":[0,2],"translation":[-16,0,0]}],"extensionsRequired":["KHR_materials_unlit"],"extensionsUsed":["KHR_materials_unlit"],"buffers":[{"uri":"UnlitTextured.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"ColorGrid.jpg","uri":"ColorGrid.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"UnlitTextured","pbrMetallicRoughness":{"metallicFactor":0,"baseColorTexture":{"index":0}},"extensions":{"KHR_materials_unlit":{}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"UnlitTextured","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/UnlitTexturedTransform.gltf.txt b/Tests/Resources/ExportTargets/UnlitTexturedTransform.gltf.txt index 2e50eca6..dd583dd1 100644 --- a/Tests/Resources/ExportTargets/UnlitTexturedTransform.gltf.txt +++ b/Tests/Resources/ExportTargets/UnlitTexturedTransform.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2021.3.21f1 glTFast 5.0.4"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"UnlitTexturedTransform","children":[0,2],"translation":[-17,0,0]}],"extensionsRequired":["KHR_materials_unlit","KHR_texture_transform"],"extensionsUsed":["KHR_materials_unlit","KHR_texture_transform"],"buffers":[{"uri":"UnlitTexturedTransform.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8},{"buffer":0,"byteLength":9216,"byteOffset":152},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"ColorGrid.jpg","uri":"ColorGrid.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"UnlitTexturedTransform","pbrMetallicRoughness":{"metallicFactor":0,"baseColorTexture":{"index":0,"extensions":{"KHR_texture_transform":{"offset":[-0.5,-1],"scale":[2,1.5]}}}},"extensions":{"KHR_materials_unlit":{}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"UnlitTexturedTransform","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"Plane","mesh":0,"translation":[0,0,1]},{"name":"Sphere","mesh":1},{"name":"sphere","children":[1],"rotation":[0,0.7071068,0,0.7071068]},{"name":"UnlitTexturedTransform","children":[0,2],"translation":[-17,0,0]}],"extensionsRequired":["KHR_materials_unlit","KHR_texture_transform"],"extensionsUsed":["KHR_materials_unlit","KHR_texture_transform"],"buffers":[{"uri":"UnlitTexturedTransform.bin","byteLength":24728}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9216,"byteOffset":152,"target":34963},{"buffer":0,"byteLength":11520,"byteOffset":9368,"byteStride":24,"target":34962},{"buffer":0,"byteLength":3840,"byteOffset":20888,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","max":[0.5,0.5,0.5],"min":[-0.5,-0.5,-0.5]},{"bufferView":4,"componentType":5126,"count":480,"type":"VEC3","byteOffset":12},{"bufferView":5,"componentType":5126,"count":480,"type":"VEC2"},{"bufferView":3,"componentType":5125,"count":2304,"type":"SCALAR"}],"images":[{"name":"ColorGrid.jpg","uri":"ColorGrid.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"UnlitTexturedTransform","pbrMetallicRoughness":{"metallicFactor":0,"baseColorTexture":{"index":0,"extensions":{"KHR_texture_transform":{"offset":[-0.5,-1],"scale":[2,1.5]}}}},"extensions":{"KHR_materials_unlit":{}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Sphere","primitives":[{"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}],"scene":0,"scenes":[{"name":"UnlitTexturedTransform","nodes":[3]}],"textures":[{"source":0}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/WrapModeU.gltf.txt b/Tests/Resources/ExportTargets/WrapModeU.gltf.txt index f59956b2..c469b70f 100644 --- a/Tests/Resources/ExportTargets/WrapModeU.gltf.txt +++ b/Tests/Resources/ExportTargets/WrapModeU.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2021.3.21f1 glTFast 5.0.4"},"nodes":[{"name":"R","mesh":0},{"name":"C","mesh":1,"translation":[0,0,1]},{"name":"M","mesh":2,"translation":[0,0,2]},{"name":"M1","mesh":3,"translation":[0,0,3]},{"name":"WrapModeU","children":[0,1,2,3],"translation":[-33,0,0]}],"extensionsRequired":["KHR_texture_transform"],"extensionsUsed":["KHR_texture_transform"],"buffers":[{"uri":"WrapModeU.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"images":[{"name":"WrapModeCR.jpg","uri":"WrapModeCR.jpg","mimeType":"image/jpeg"},{"name":"WrapModeCC.jpg","uri":"WrapModeCC.jpg","mimeType":"image/jpeg"},{"name":"WrapModeCM.jpg","uri":"WrapModeCM.jpg","mimeType":"image/jpeg"},{"name":"WrapModeCM1.jpg","uri":"WrapModeCM1.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"WrapModeCR","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0,"baseColorTexture":{"index":0,"extensions":{"KHR_texture_transform":{"offset":[-0.5,-3],"scale":[2,3]}}}}},{"name":"WrapModeCC","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0,"baseColorTexture":{"index":1,"extensions":{"KHR_texture_transform":{"offset":[-0.5,-1],"scale":[2,3]}}}}},{"name":"WrapModeCM","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0,"baseColorTexture":{"index":2,"extensions":{"KHR_texture_transform":{"offset":[-1.5,-2],"scale":[4,5]}}}}},{"name":"WrapModeCM1","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0,"baseColorTexture":{"index":3,"extensions":{"KHR_texture_transform":{"offset":[-1.5,-2],"scale":[4,5]}}}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":1}]},{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":2}]},{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":3}]}],"samplers":[{"magFilter":9728,"minFilter":9728,"wrapS":33071},{"magFilter":9728,"minFilter":9728,"wrapS":33071,"wrapT":33071},{"magFilter":9728,"minFilter":9728,"wrapS":33071,"wrapT":33648},{"magFilter":9728,"minFilter":9728,"wrapS":33071,"wrapT":33648}],"scene":0,"scenes":[{"name":"WrapModeU","nodes":[4]}],"textures":[{"source":0,"sampler":0},{"source":1,"sampler":1},{"source":2,"sampler":2},{"source":3,"sampler":3}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"R","mesh":0},{"name":"C","mesh":1,"translation":[0,0,1]},{"name":"M","mesh":2,"translation":[0,0,2]},{"name":"M1","mesh":3,"translation":[0,0,3]},{"name":"WrapModeU","children":[0,1,2,3],"translation":[-33,0,0]}],"extensionsRequired":["KHR_texture_transform"],"extensionsUsed":["KHR_texture_transform"],"buffers":[{"uri":"WrapModeU.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"images":[{"name":"WrapModeCR.jpg","uri":"WrapModeCR.jpg","mimeType":"image/jpeg"},{"name":"WrapModeCC.jpg","uri":"WrapModeCC.jpg","mimeType":"image/jpeg"},{"name":"WrapModeCM.jpg","uri":"WrapModeCM.jpg","mimeType":"image/jpeg"},{"name":"WrapModeCM1.jpg","uri":"WrapModeCM1.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"WrapModeCR","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0,"baseColorTexture":{"index":0,"extensions":{"KHR_texture_transform":{"offset":[-0.5,-3],"scale":[2,3]}}}}},{"name":"WrapModeCC","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0,"baseColorTexture":{"index":1,"extensions":{"KHR_texture_transform":{"offset":[-0.5,-1],"scale":[2,3]}}}}},{"name":"WrapModeCM","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0,"baseColorTexture":{"index":2,"extensions":{"KHR_texture_transform":{"offset":[-1.5,-2],"scale":[4,5]}}}}},{"name":"WrapModeCM1","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0,"baseColorTexture":{"index":3,"extensions":{"KHR_texture_transform":{"offset":[-1.5,-2],"scale":[4,5]}}}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":1}]},{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":2}]},{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":3}]}],"samplers":[{"magFilter":9728,"minFilter":9728,"wrapS":33071},{"magFilter":9728,"minFilter":9728,"wrapS":33071,"wrapT":33071},{"magFilter":9728,"minFilter":9728,"wrapS":33071,"wrapT":33648},{"magFilter":9728,"minFilter":9728,"wrapS":33071,"wrapT":33648}],"scene":0,"scenes":[{"name":"WrapModeU","nodes":[4]}],"textures":[{"source":0,"sampler":0},{"source":1,"sampler":1},{"source":2,"sampler":2},{"source":3,"sampler":3}]} \ No newline at end of file diff --git a/Tests/Resources/ExportTargets/WrapModeV.gltf.txt b/Tests/Resources/ExportTargets/WrapModeV.gltf.txt index a9eeb446..0574c9c7 100644 --- a/Tests/Resources/ExportTargets/WrapModeV.gltf.txt +++ b/Tests/Resources/ExportTargets/WrapModeV.gltf.txt @@ -1 +1 @@ -{"asset":{"version":"2.0","generator":"Unity 2021.3.21f1 glTFast 5.0.4"},"nodes":[{"name":"R","mesh":0},{"name":"C","mesh":1,"translation":[0,0,1]},{"name":"M","mesh":2,"translation":[0,0,2]},{"name":"M1","mesh":3,"translation":[0,0,3]},{"name":"WrapModeV","children":[0,1,2,3],"translation":[-34,0,0]}],"extensionsRequired":["KHR_texture_transform"],"extensionsUsed":["KHR_texture_transform"],"buffers":[{"uri":"WrapModeV.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"images":[{"name":"WrapModeRC.jpg","uri":"WrapModeRC.jpg","mimeType":"image/jpeg"},{"name":"WrapModeCC.jpg","uri":"WrapModeCC.jpg","mimeType":"image/jpeg"},{"name":"WrapModeMC.jpg","uri":"WrapModeMC.jpg","mimeType":"image/jpeg"},{"name":"WrapModeM1C.jpg","uri":"WrapModeM1C.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"WrapModeRC","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0,"baseColorTexture":{"index":0,"extensions":{"KHR_texture_transform":{"offset":[-1,-0.5],"scale":[3,2]}}}}},{"name":"WrapModeCC","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0,"baseColorTexture":{"index":1,"extensions":{"KHR_texture_transform":{"offset":[-0.5,-1],"scale":[2,3]}}}}},{"name":"WrapModeMC","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0,"baseColorTexture":{"index":2,"extensions":{"KHR_texture_transform":{"offset":[-2,-1.5],"scale":[5,4]}}}}},{"name":"WrapModeM1C","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0,"baseColorTexture":{"index":3,"extensions":{"KHR_texture_transform":{"offset":[-2,-1.5],"scale":[5,4]}}}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":1}]},{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":2}]},{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":3}]}],"samplers":[{"magFilter":9728,"minFilter":9728,"wrapT":33071},{"magFilter":9728,"minFilter":9728,"wrapS":33071,"wrapT":33071},{"magFilter":9728,"minFilter":9728,"wrapS":33648,"wrapT":33071},{"magFilter":9728,"minFilter":9728,"wrapS":33648,"wrapT":33071}],"scene":0,"scenes":[{"name":"WrapModeV","nodes":[4]}],"textures":[{"source":0,"sampler":0},{"source":1,"sampler":1},{"source":2,"sampler":2},{"source":3,"sampler":3}]} \ No newline at end of file +{"asset":{"version":"2.0","generator":"Unity 2020.3.48f1 glTFast 6.7.1"},"nodes":[{"name":"R","mesh":0},{"name":"C","mesh":1,"translation":[0,0,1]},{"name":"M","mesh":2,"translation":[0,0,2]},{"name":"M1","mesh":3,"translation":[0,0,3]},{"name":"WrapModeV","children":[0,1,2,3],"translation":[-34,0,0]}],"extensionsRequired":["KHR_texture_transform"],"extensionsUsed":["KHR_texture_transform"],"buffers":[{"uri":"WrapModeV.bin","byteLength":152}],"bufferViews":[{"buffer":0,"byteLength":24,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":24,"byteStride":24,"target":34962},{"buffer":0,"byteLength":32,"byteOffset":120,"byteStride":8,"target":34962}],"accessors":[{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","max":[0.5,0,0.5],"min":[-0.5,0,-0.5]},{"bufferView":1,"componentType":5126,"count":4,"type":"VEC3","byteOffset":12},{"bufferView":2,"componentType":5126,"count":4,"type":"VEC2"},{"bufferView":0,"componentType":5125,"count":6,"type":"SCALAR"}],"images":[{"name":"WrapModeRC.jpg","uri":"WrapModeRC.jpg","mimeType":"image/jpeg"},{"name":"WrapModeCC.jpg","uri":"WrapModeCC.jpg","mimeType":"image/jpeg"},{"name":"WrapModeMC.jpg","uri":"WrapModeMC.jpg","mimeType":"image/jpeg"},{"name":"WrapModeM1C.jpg","uri":"WrapModeM1C.jpg","mimeType":"image/jpeg"}],"materials":[{"name":"WrapModeRC","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0,"baseColorTexture":{"index":0,"extensions":{"KHR_texture_transform":{"offset":[-1,-0.5],"scale":[3,2]}}}}},{"name":"WrapModeCC","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0,"baseColorTexture":{"index":1,"extensions":{"KHR_texture_transform":{"offset":[-0.5,-1],"scale":[2,3]}}}}},{"name":"WrapModeMC","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0,"baseColorTexture":{"index":2,"extensions":{"KHR_texture_transform":{"offset":[-2,-1.5],"scale":[5,4]}}}}},{"name":"WrapModeM1C","pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":0,"baseColorTexture":{"index":3,"extensions":{"KHR_texture_transform":{"offset":[-2,-1.5],"scale":[5,4]}}}}}],"meshes":[{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":1}]},{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":2}]},{"name":"Plane","primitives":[{"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":3}]}],"samplers":[{"magFilter":9728,"minFilter":9728,"wrapT":33071},{"magFilter":9728,"minFilter":9728,"wrapS":33071,"wrapT":33071},{"magFilter":9728,"minFilter":9728,"wrapS":33648,"wrapT":33071},{"magFilter":9728,"minFilter":9728,"wrapS":33648,"wrapT":33071}],"scene":0,"scenes":[{"name":"WrapModeV","nodes":[4]}],"textures":[{"source":0,"sampler":0},{"source":1,"sampler":1},{"source":2,"sampler":2},{"source":3,"sampler":3}]} \ No newline at end of file diff --git a/Tests/Runtime/Export/Models/SimpleSkin.meta b/Tests/Runtime/Export/Models/SimpleSkin.meta new file mode 100644 index 00000000..32928cbf --- /dev/null +++ b/Tests/Runtime/Export/Models/SimpleSkin.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 00d6f40089e144eb0a6712944ecdbe85 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Runtime/Export/Models/SimpleSkin/Clip_0.anim b/Tests/Runtime/Export/Models/SimpleSkin/Clip_0.anim new file mode 100644 index 00000000..c2c90698 --- /dev/null +++ b/Tests/Runtime/Export/Models/SimpleSkin/Clip_0.anim @@ -0,0 +1,168 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Clip_0 + serializedVersion: 6 + m_Legacy: 1 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: {x: 0, y: -0, z: -0, w: 1} + inSlope: {x: 0, y: 0, z: 0, w: 0} + outSlope: {x: 0, y: 0, z: -0.766, w: -0.15199995} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0, y: 0, z: 0, w: 0} + outWeight: {x: 0, y: 0, z: 0, w: 0} + - serializedVersion: 3 + time: 0.5 + value: {x: 0, y: -0, z: -0.383, w: 0.924} + inSlope: {x: 0, y: 0, z: -0.766, w: -0.15199995} + outSlope: {x: 0, y: 0, z: -0.64800006, w: -0.43400002} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0, y: 0, z: 0, w: 0} + outWeight: {x: 0, y: 0, z: 0, w: 0} + - serializedVersion: 3 + time: 1 + value: {x: 0, y: -0, z: -0.707, w: 0.707} + inSlope: {x: 0, y: 0, z: -0.64800006, w: -0.43400002} + outSlope: {x: 0, y: 0, z: 0, w: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0, y: 0, z: 0, w: 0} + outWeight: {x: 0, y: 0, z: 0, w: 0} + - serializedVersion: 3 + time: 1.5 + value: {x: 0, y: -0, z: -0.707, w: 0.707} + inSlope: {x: 0, y: 0, z: 0, w: 0} + outSlope: {x: 0, y: 0, z: 0.64800006, w: 0.43400002} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0, y: 0, z: 0, w: 0} + outWeight: {x: 0, y: 0, z: 0, w: 0} + - serializedVersion: 3 + time: 2 + value: {x: 0, y: -0, z: -0.383, w: 0.924} + inSlope: {x: 0, y: 0, z: 0.64800006, w: 0.43400002} + outSlope: {x: 0, y: 0, z: 0.766, w: 0.15199995} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0, y: 0, z: 0, w: 0} + outWeight: {x: 0, y: 0, z: 0, w: 0} + - serializedVersion: 3 + time: 2.5 + value: {x: 0, y: -0, z: -0, w: 1} + inSlope: {x: 0, y: 0, z: 0.766, w: 0.15199995} + outSlope: {x: 0, y: 0, z: 0, w: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0, y: 0, z: 0, w: 0} + outWeight: {x: 0, y: 0, z: 0, w: 0} + - serializedVersion: 3 + time: 3 + value: {x: 0, y: -0, z: -0, w: 1} + inSlope: {x: 0, y: 0, z: 0, w: 0} + outSlope: {x: 0, y: 0, z: 0.766, w: -0.15199995} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0, y: 0, z: 0, w: 0} + outWeight: {x: 0, y: 0, z: 0, w: 0} + - serializedVersion: 3 + time: 3.5 + value: {x: 0, y: -0, z: 0.383, w: 0.924} + inSlope: {x: 0, y: 0, z: 0.766, w: -0.15199995} + outSlope: {x: 0, y: 0, z: 0.64800006, w: -0.43400002} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0, y: 0, z: 0, w: 0} + outWeight: {x: 0, y: 0, z: 0, w: 0} + - serializedVersion: 3 + time: 4 + value: {x: 0, y: -0, z: 0.707, w: 0.707} + inSlope: {x: 0, y: 0, z: 0.64800006, w: -0.43400002} + outSlope: {x: 0, y: 0, z: 0, w: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0, y: 0, z: 0, w: 0} + outWeight: {x: 0, y: 0, z: 0, w: 0} + - serializedVersion: 3 + time: 4.5 + value: {x: 0, y: -0, z: 0.707, w: 0.707} + inSlope: {x: 0, y: 0, z: 0, w: 0} + outSlope: {x: 0, y: 0, z: -0.64800006, w: 0.43400002} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0, y: 0, z: 0, w: 0} + outWeight: {x: 0, y: 0, z: 0, w: 0} + - serializedVersion: 3 + time: 5 + value: {x: 0, y: -0, z: 0.383, w: 0.924} + inSlope: {x: 0, y: 0, z: -0.64800006, w: 0.43400002} + outSlope: {x: 0, y: 0, z: -0.766, w: 0.15199995} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0, y: 0, z: 0, w: 0} + outWeight: {x: 0, y: 0, z: 0, w: 0} + - serializedVersion: 3 + time: 5.5 + value: {x: 0, y: -0, z: -0, w: 1} + inSlope: {x: 0, y: 0, z: -0.766, w: 0.15199995} + outSlope: {x: 0, y: 0, z: 0, w: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0, y: 0, z: 0, w: 0} + outWeight: {x: 0, y: 0, z: 0, w: 0} + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + path: Node-1/Node-2 + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 2 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 5.5 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Tests/Runtime/Export/Models/SimpleSkin/Clip_0.anim.meta b/Tests/Runtime/Export/Models/SimpleSkin/Clip_0.anim.meta new file mode 100644 index 00000000..f8031457 --- /dev/null +++ b/Tests/Runtime/Export/Models/SimpleSkin/Clip_0.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 30e8156cd3a2045bcba82b14e7ca0961 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Runtime/Export/Models/SimpleSkin/SkinnedMesh.mesh b/Tests/Runtime/Export/Models/SimpleSkin/SkinnedMesh.mesh new file mode 100644 index 00000000..c9012f93 --- /dev/null +++ b/Tests/Runtime/Export/Models/SimpleSkin/SkinnedMesh.mesh @@ -0,0 +1,202 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!43 &4300000 +Mesh: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: SkinnedMesh + serializedVersion: 10 + m_SubMeshes: + - serializedVersion: 2 + firstByte: 0 + indexCount: 24 + topology: 0 + baseVertex: 0 + firstVertex: 0 + vertexCount: 10 + localAABB: + m_Center: {x: 0, y: 1, z: 0} + m_Extent: {x: 0.5, y: 1, z: 0} + m_Shapes: + vertices: [] + shapes: [] + channels: [] + fullWeights: [] + m_BindPose: + - e00: 1 + e01: -0 + e02: -0 + e03: -0 + e10: -0 + e11: 1 + e12: 0 + e13: 0 + e20: -0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + - e00: 1 + e01: -0 + e02: -0 + e03: -0 + e10: -0 + e11: 1 + e12: 0 + e13: -1 + e20: -0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_BoneNameHashes: + m_RootBoneNameHash: 0 + m_BonesAABB: + - m_Min: {x: -0.5, y: 0, z: 0} + m_Max: {x: 0.5, y: 1.5, z: 0} + - m_Min: {x: -0.5, y: -0.5, z: 0} + m_Max: {x: 0.5, y: 1, z: 0} + m_VariableBoneCountWeights: + m_Data: + m_MeshCompression: 0 + m_IsReadable: 1 + m_KeepVertices: 0 + m_KeepIndices: 0 + m_IndexFormat: 1 + m_IndexBuffer: 000000000300000001000000000000000200000003000000020000000500000003000000020000000400000005000000040000000700000005000000040000000600000007000000060000000900000007000000060000000800000009000000 + m_VertexData: + serializedVersion: 3 + m_VertexCount: 10 + m_Channels: + - stream: 0 + offset: 0 + format: 0 + dimension: 3 + - stream: 0 + offset: 12 + format: 0 + dimension: 3 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 0 + offset: 0 + format: 0 + dimension: 0 + - stream: 1 + offset: 0 + format: 0 + dimension: 4 + - stream: 1 + offset: 16 + format: 10 + dimension: 4 + m_DataSize: 560 + _typelessdata: 0000003f000000000000000000000000000000000000803f000000bf000000000000000000000000000000000000803f0000003f0000003f0000000000000000000000000000803f000000bf0000003f0000000000000000000000000000803f0000003f0000803f0000000000000000000000000000803f000000bf0000803f0000000000000000000000000000803f0000003f0000c03f0000000000000000000000000000803f000000bf0000c03f0000000000000000000000000000803f0000003f000000400000000000000000000000000000803f000000bf000000400000000000000000000000000000803f0000803f000000000000000000000000000000000000000000000000000000000000803f000000000000000000000000000000000000000000000000000000000000403f0000803e0000000000000000000000000100000000000000000000000000403f0000803e0000000000000000000000000100000000000000000000000000003f0000003f0000000000000000000000000100000000000000000000000000003f0000003f0000000000000000000000000100000000000000000000000000403f0000803e0000000000000000010000000000000000000000000000000000403f0000803e0000000000000000010000000000000000000000000000000000803f000000000000000000000000010000000000000000000000000000000000803f00000000000000000000000001000000000000000000000000000000 + m_CompressedMesh: + m_Vertices: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_UV: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_Normals: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_Tangents: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_Weights: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_NormalSigns: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_TangentSigns: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_FloatColors: + m_NumItems: 0 + m_Range: 0 + m_Start: 0 + m_Data: + m_BitSize: 0 + m_BoneIndices: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_Triangles: + m_NumItems: 0 + m_Data: + m_BitSize: 0 + m_UVInfo: 0 + m_LocalAABB: + m_Center: {x: 0, y: 1, z: 0} + m_Extent: {x: 0.5, y: 1, z: 0} + m_MeshUsageFlags: 0 + m_BakedConvexCollisionMesh: + m_BakedTriangleCollisionMesh: + m_MeshMetrics[0]: 1 + m_MeshMetrics[1]: 1 + m_MeshOptimizationFlags: 1 + m_StreamData: + serializedVersion: 2 + offset: 0 + size: 0 + path: diff --git a/Tests/Runtime/Export/Models/SimpleSkin/SkinnedMesh.mesh.meta b/Tests/Runtime/Export/Models/SimpleSkin/SkinnedMesh.mesh.meta new file mode 100644 index 00000000..f5e4e11c --- /dev/null +++ b/Tests/Runtime/Export/Models/SimpleSkin/SkinnedMesh.mesh.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d01c6a251a6a34acabcc9b87446abf46 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Runtime/Export/Scenes/ExportSkin.unity b/Tests/Runtime/Export/Scenes/ExportSkin.unity new file mode 100644 index 00000000..814fadc1 --- /dev/null +++ b/Tests/Runtime/Export/Scenes/ExportSkin.unity @@ -0,0 +1,596 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.3731193, g: 0.38073996, b: 0.35872698, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &449987770 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 449987771} + m_Layer: 0 + m_Name: Node-1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &449987771 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 449987770} + 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_Children: + - {fileID: 1397829614} + m_Father: {fileID: 1231589054} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1231589052 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1231589054} + - component: {fileID: 1231589053} + m_Layer: 0 + m_Name: SimpleSkin2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!111 &1231589053 +Animation: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1231589052} + m_Enabled: 1 + serializedVersion: 3 + m_Animation: {fileID: 7400000, guid: 30e8156cd3a2045bcba82b14e7ca0961, type: 2} + m_Animations: + - {fileID: 7400000, guid: 30e8156cd3a2045bcba82b14e7ca0961, type: 2} + m_WrapMode: 0 + m_PlayAutomatically: 0 + m_AnimatePhysics: 0 + m_CullingType: 0 +--- !u!4 &1231589054 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1231589052} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.5, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1252619967} + - {fileID: 449987771} + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1252619966 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1252619967} + - component: {fileID: 1252619968} + m_Layer: 0 + m_Name: Node-0 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1252619967 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1252619966} + 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_Children: [] + m_Father: {fileID: 1231589054} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!137 &1252619968 +SkinnedMeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1252619966} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 3 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + serializedVersion: 2 + m_Quality: 0 + m_UpdateWhenOffscreen: 1 + m_SkinnedMotionVectors: 1 + m_Mesh: {fileID: 4300000, guid: d01c6a251a6a34acabcc9b87446abf46, type: 2} + m_Bones: + - {fileID: 449987771} + - {fileID: 1397829614} + m_BlendShapeWeights: [] + m_RootBone: {fileID: 449987771} + m_AABB: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_DirtyAABB: 1 +--- !u!1 &1397829613 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1397829614} + m_Layer: 0 + m_Name: Node-2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1397829614 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1397829613} + m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0, y: 1, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 449987771} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &2072643656 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2072643659} + - component: {fileID: 2072643658} + - component: {fileID: 2072643657} + m_Layer: 0 + m_Name: Static + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!23 &2072643657 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2072643656} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &2072643658 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2072643656} + m_Mesh: {fileID: 4300000, guid: d01c6a251a6a34acabcc9b87446abf46, type: 2} +--- !u!4 &2072643659 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2072643656} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -1.5, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &501790146402810073 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2406278215318778076} + m_Layer: 0 + m_Name: Node-2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &2107409825784389198 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5253128422118991608} + - component: {fileID: 7960101358867479720} + m_Layer: 0 + m_Name: SimpleSkin + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2406278215318778076 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 501790146402810073} + m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0, y: 1, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 7325758507313247805} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &3482177121235486728 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7325758507313247805} + m_Layer: 0 + m_Name: Node-1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!137 &4878862080855546027 +SkinnedMeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5983801299650413423} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 3 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + serializedVersion: 2 + m_Quality: 0 + m_UpdateWhenOffscreen: 1 + m_SkinnedMotionVectors: 1 + m_Mesh: {fileID: 4300000, guid: d01c6a251a6a34acabcc9b87446abf46, type: 2} + m_Bones: + - {fileID: 7325758507313247805} + - {fileID: 2406278215318778076} + m_BlendShapeWeights: [] + m_RootBone: {fileID: 7325758507313247805} + m_AABB: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_DirtyAABB: 1 +--- !u!4 &5253128422118991608 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2107409825784389198} + 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_Children: + - {fileID: 8781329141790507718} + - {fileID: 7325758507313247805} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &5983801299650413423 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8781329141790507718} + - component: {fileID: 4878862080855546027} + m_Layer: 0 + m_Name: Node-0 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7325758507313247805 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3482177121235486728} + 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_Children: + - {fileID: 2406278215318778076} + m_Father: {fileID: 5253128422118991608} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!111 &7960101358867479720 +Animation: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2107409825784389198} + m_Enabled: 1 + serializedVersion: 3 + m_Animation: {fileID: 7400000, guid: 30e8156cd3a2045bcba82b14e7ca0961, type: 2} + m_Animations: + - {fileID: 7400000, guid: 30e8156cd3a2045bcba82b14e7ca0961, type: 2} + m_WrapMode: 0 + m_PlayAutomatically: 0 + m_AnimatePhysics: 0 + m_CullingType: 0 +--- !u!4 &8781329141790507718 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5983801299650413423} + 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_Children: [] + m_Father: {fileID: 5253128422118991608} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Tests/Runtime/Export/Scenes/ExportSkin.unity.meta b/Tests/Runtime/Export/Scenes/ExportSkin.unity.meta new file mode 100644 index 00000000..03656181 --- /dev/null +++ b/Tests/Runtime/Export/Scenes/ExportSkin.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 31eac5d5a01524e08af72319b729d77c +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Runtime/Scripts/Export/ExportSkinTests.cs b/Tests/Runtime/Scripts/Export/ExportSkinTests.cs new file mode 100644 index 00000000..32687084 --- /dev/null +++ b/Tests/Runtime/Scripts/Export/ExportSkinTests.cs @@ -0,0 +1,109 @@ +// SPDX-FileCopyrightText: 2024 Unity Technologies and the glTFast authors +// SPDX-License-Identifier: Apache-2.0 + +using System.Collections; +using System.IO; +using System.Threading.Tasks; +using GLTFast.Export; +using GLTFast.Logging; +using NUnit.Framework; +#if GLTF_VALIDATOR && UNITY_EDITOR +using Unity.glTF.Validator; +#endif // GLTF_VALIDATOR +using UnityEngine; +using UnityEngine.SceneManagement; +using UnityEngine.TestTools; + +namespace GLTFast.Tests.Export +{ + [TestFixture, Category("Export")] + class ExportSkinTests : IPrebuildSetup + { + const string k_SceneName = "ExportSkin"; + +#if UNITY_EDITOR + static void SetupTests() + { + ExportTests.AddExportTestScene(k_SceneName); + } +#endif + + public void Setup() + { +#if UNITY_EDITOR + SetupTests(); +#endif + } + + [OneTimeSetUp] + public void OneTimeSetUp() + { + SceneManager.LoadScene(k_SceneName, LoadSceneMode.Single); + } + + [OneTimeTearDown] + public void OneTimeTearDown() + { + SceneManager.UnloadSceneAsync(k_SceneName); + } + + [UnityTest] + public IEnumerator SimpleSkin() + { + var skin = GameObject.Find("SimpleSkin"); + var task = Export("SimpleSkin", new[] { skin }); + yield return AsyncWrapper.WaitForTask(task); + } + + [UnityTest] + public IEnumerator SimpleSkinTwice() + { + var skin = GameObject.Find("SimpleSkin"); + var skin2 = GameObject.Find("SimpleSkin2"); + var task = Export("SimpleSkinTwice", new[] { skin, skin2 }); + yield return AsyncWrapper.WaitForTask(task); + } + + [UnityTest] + public IEnumerator SimpleSkinDraco() + { +#if !DRACO_UNITY + Assert.Ignore("Test requires Draco for Unity (com.unity.cloud.draco) to be installed"); +#endif + var skin = GameObject.Find("SimpleSkin"); + var task = Export( + "SimpleSkinDraco", + new[] { skin }, + new ExportSettings + { + Compression = Compression.Draco + }); + yield return AsyncWrapper.WaitForTask(task); + } + + [UnityTest] + public IEnumerator MissingBones() + { + LogAssert.Expect(LogType.Error, "Skip skin on Node-0: No node ID for bone transform Node-1 found!"); + + var skin = GameObject.Find("SimpleSkin").transform; + var meshOnly = skin.GetChild(0).gameObject; + var task = Export("MissingBones", new[] { meshOnly }); + yield return AsyncWrapper.WaitForTask(task); + } + + static async Task Export(string name, GameObject[] objects, ExportSettings settings = null) + { + var logger = new CollectingLogger(); + var export = new GameObjectExport(logger: logger, exportSettings: settings); + export.AddScene(objects); + var path = Path.Combine(Application.persistentDataPath, $"{name}.gltf"); + var success = await export.SaveToFileAndDispose(path); ; + ExportTests.AssertLogger(logger); + Assert.IsTrue(success); +#if GLTF_VALIDATOR && UNITY_EDITOR + ExportTests.ValidateGltf(path,MessageCode.NODE_SKINNED_MESH_NON_ROOT); +#endif + } + } +} diff --git a/Tests/Runtime/Scripts/Export/ExportSkinTests.cs.meta b/Tests/Runtime/Scripts/Export/ExportSkinTests.cs.meta new file mode 100644 index 00000000..f521a9e5 --- /dev/null +++ b/Tests/Runtime/Scripts/Export/ExportSkinTests.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8f4ea52dd89c0465bb2f13845def3183 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Runtime/Scripts/Export/ExportTests.cs b/Tests/Runtime/Scripts/Export/ExportTests.cs index f66d8b0a..e52d27f0 100644 --- a/Tests/Runtime/Scripts/Export/ExportTests.cs +++ b/Tests/Runtime/Scripts/Export/ExportTests.cs @@ -117,9 +117,13 @@ internal static GUID TryFixPackageAssetPath(ref string packageAssetPath) return guid; } - internal static void AddExportTestScene() + static void AddExportTestScene() + { + AddExportTestScene(GetExportSceneName()); + } + + internal static void AddExportTestScene(string sceneName) { - var sceneName = GetExportSceneName(); var scenePath = $"Packages/{GltfGlobals.GltfPackageName}{k_ScenesPath}{sceneName}.unity"; var sceneGuid = TryFixPackageAssetPath(ref scenePath); @@ -135,7 +139,6 @@ internal static void AddExportTestScene() Array.Resize(ref scenes, scenes.Length+1); scenes[scenes.Length - 1] = new EditorBuildSettingsScene(sceneGuid, true); EditorBuildSettings.scenes = scenes; - } static void CreateExportSceneObjectList(string sceneName) @@ -548,7 +551,7 @@ public IEnumerator LayerMask() "LayerMaskOne", gameObjectExportSettings: new GameObjectExportSettings { - LayerMask = 1 + LayerMask = 2 // layer one: 1<<1 }); yield return AsyncWrapper.WaitForTask(task); @@ -558,7 +561,7 @@ public IEnumerator LayerMask() "LayerMaskTwo", gameObjectExportSettings: new GameObjectExportSettings { - LayerMask = 2 + LayerMask = 4 // layer two: 1<<2 }); yield return AsyncWrapper.WaitForTask(task); diff --git a/Tests/Runtime/Scripts/Export/GltfWritableMock.cs b/Tests/Runtime/Scripts/Export/GltfWritableMock.cs index 8eebf605..5d9c3dfd 100644 --- a/Tests/Runtime/Scripts/Export/GltfWritableMock.cs +++ b/Tests/Runtime/Scripts/Export/GltfWritableMock.cs @@ -48,6 +48,11 @@ public void AddMeshToNode(int nodeId, Mesh uMesh, int[] materialIds, bool skinni throw new NotImplementedException(); } + public void AddMeshToNode(int nodeId, Mesh uMesh, int[] materialIds, uint[] joints) + { + throw new NotImplementedException(); + } + public void AddCameraToNode(int nodeId, int cameraId) { throw new NotImplementedException(); diff --git a/Tests/Runtime/Scripts/Export/GltfWriterTests.cs b/Tests/Runtime/Scripts/Export/GltfWriterTests.cs index d712b0b1..5e395363 100644 --- a/Tests/Runtime/Scripts/Export/GltfWriterTests.cs +++ b/Tests/Runtime/Scripts/Export/GltfWriterTests.cs @@ -113,7 +113,7 @@ static async Task DracoUncompressedFallback(ICodeLogger logger) var node = writer.AddNode(); var tmpGameObject = GameObject.CreatePrimitive(PrimitiveType.Plane); - writer.AddMeshToNode((int)node, tmpGameObject.GetComponent().sharedMesh, null, false); + writer.AddMeshToNode((int)node, tmpGameObject.GetComponent().sharedMesh, null, null); await writer.SaveToStreamAndDispose(new MemoryStream()); From 54b7ad4ccd55d92221e2a1927168751102e23085 Mon Sep 17 00:00:00 2001 From: Andreas Atteneder Date: Wed, 4 Sep 2024 20:18:04 +0200 Subject: [PATCH 12/16] fix: Increased resilience against invalid animation data. (#182) --- CHANGELOG.md | 1 + Runtime/Scripts/GltfImport.cs | 20 ++++++++++++++++---- Runtime/Scripts/Logging/LogMessages.cs | 2 +- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66530a40..c5e86a96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - (Export) Removed expendable JSON content when exporting unlit materials without color or texture applied. - Primitve mode LINE_LOOP works as expected (thanks [Hexer611][Hexer611] for [#22](https://github.com/Unity-Technologies/com.unity.cloud.gltfast/pull/22)). - (Test) Fail export test if glTF JSON contains unexpected or misses expected properties. +- Increased resilience against invalid animation data. ## [6.7.1] - 2024-08-07 diff --git a/Runtime/Scripts/GltfImport.cs b/Runtime/Scripts/GltfImport.cs index c3a6c2c7..29e2e232 100755 --- a/Runtime/Scripts/GltfImport.cs +++ b/Runtime/Scripts/GltfImport.cs @@ -2268,6 +2268,11 @@ async Task Prepare() continue; } var sampler = animation.Samplers[channel.sampler]; + if (sampler == null || sampler.output < 0 || sampler.output >= Root.Accessors.Count) + { + m_Logger?.Error(LogCode.AnimationChannelSamplerInvalid, j.ToString()); + continue; + } if (channel.Target.node < 0 || channel.Target.node >= Root.Nodes.Count) { m_Logger?.Error(LogCode.AnimationChannelNodeInvalid, j.ToString()); continue; @@ -2277,24 +2282,31 @@ async Task Prepare() var times = ((AccessorNativeData) m_AccessorData[sampler.input]).data; + var outputData = m_AccessorData[sampler.output]; + Assert.IsNotNull(outputData); + switch (channel.Target.GetPath()) { case AnimationChannel.Path.Translation: { - var values= ((AccessorNativeData) m_AccessorData[sampler.output]).data; + Assert.IsTrue(outputData is AccessorNativeData); + var values = ((AccessorNativeData) outputData).data; AnimationUtils.AddTranslationCurves(m_AnimationClips[i], path, times, values, sampler.GetInterpolationType()); break; } case AnimationChannel.Path.Rotation: { - var values= ((AccessorNativeData) m_AccessorData[sampler.output]).data; + Assert.IsTrue(outputData is AccessorNativeData); + var values = ((AccessorNativeData) outputData).data; AnimationUtils.AddRotationCurves(m_AnimationClips[i], path, times, values, sampler.GetInterpolationType()); break; } case AnimationChannel.Path.Scale: { - var values= ((AccessorNativeData) m_AccessorData[sampler.output]).data; + Assert.IsTrue(outputData is AccessorNativeData); + var values = ((AccessorNativeData) outputData).data; AnimationUtils.AddScaleCurves(m_AnimationClips[i], path, times, values, sampler.GetInterpolationType()); break; } case AnimationChannel.Path.Weights: { - var values= ((AccessorNativeData) m_AccessorData[sampler.output]).data; + Assert.IsTrue(outputData is AccessorNativeData); + var values = ((AccessorNativeData) outputData).data; var node = Root.Nodes[channel.Target.node]; if (node.mesh < 0 || node.mesh >= Root.Meshes.Count) { break; diff --git a/Runtime/Scripts/Logging/LogMessages.cs b/Runtime/Scripts/Logging/LogMessages.cs index 9108aa3e..00fed93b 100644 --- a/Runtime/Scripts/Logging/LogMessages.cs +++ b/Runtime/Scripts/Logging/LogMessages.cs @@ -263,7 +263,7 @@ public static class LogMessages This may result in low performance and high memory usage. Try optimizing the glTF file. See details in corresponding issue at https://github.com/atteneder/glTFast/issues/52" }, { LogCode.AnimationChannelNodeInvalid, "Animation channel {0} has invalid node id" }, - { LogCode.AnimationChannelSamplerInvalid, "Animation channel {0} has invalid sampler id" }, + { LogCode.AnimationChannelSamplerInvalid, "Animation channel {0} has invalid sampler id or output" }, { LogCode.AnimationFormatInvalid, "Invalid animation format {0}" }, { LogCode.AnimationTargetPathUnsupported, "Unsupported animation target path {0}" }, { LogCode.BufferLoadFailed, "Download buffer {1} failed: {0}" }, From aeb2276a977357cd1ed5d0a04a79cb2a82191810 Mon Sep 17 00:00:00 2001 From: Andreas Atteneder Date: Wed, 4 Sep 2024 20:19:18 +0200 Subject: [PATCH 13/16] Fixed link to the code of conduct (#183) --------- Co-authored-by: ErdemPC --- CHANGELOG.md | 1 + CONTRIBUTING.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5e86a96..854b93be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Primitve mode LINE_LOOP works as expected (thanks [Hexer611][Hexer611] for [#22](https://github.com/Unity-Technologies/com.unity.cloud.gltfast/pull/22)). - (Test) Fail export test if glTF JSON contains unexpected or misses expected properties. - Increased resilience against invalid animation data. +- Broken link in `CONTRIBUTING.md` (thanks [Hexer611][Hexer611] for [#22](https://github.com/Unity-Technologies/com.unity.cloud.gltfast/pull/23)). ## [6.7.1] - 2024-08-07 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e204da6b..20497c16 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -53,7 +53,7 @@ original creation and that you have complete right and authority to make your contributions. We allow both individual contributions and contributions made on behalf of companies. -[COC]: (CODE_OF_CONDUCT.md) +[COC]: CODE_OF_CONDUCT.md [Git]: https://git-scm.com/ [repo]: https://github.com/Unity-Technologies/com.unity.cloud.gltfast [issues]: https://github.com/Unity-Technologies/com.unity.cloud.gltfast/issues From 9139e98422b6a6eb3a36ccb12e3e93dd20651a1c Mon Sep 17 00:00:00 2001 From: Andreas Atteneder Date: Wed, 4 Sep 2024 20:20:03 +0200 Subject: [PATCH 14/16] fix: Unknown texture extension parsing (#184) * fix: Loading glTFs with unknown texture extensions (e.g. WebP, `EXT_texture_webp`) now works. fixes https://github.com/atteneder/glTFast/issues/705 * feat: Adding test for parsing unknown texture extensions. --- CHANGELOG.md | 1 + Runtime/Scripts/GltfImport.cs | 2 + Runtime/Scripts/Schema/Root.cs | 8 ++ Runtime/Scripts/Schema/Texture.cs | 28 +++++++ .../Scripts/JsonParsing/JsonParsingTests.cs | 75 +++++++++++++++++++ 5 files changed, 114 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 854b93be..55ab7790 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - (Test) Fail export test if glTF JSON contains unexpected or misses expected properties. - Increased resilience against invalid animation data. - Broken link in `CONTRIBUTING.md` (thanks [Hexer611][Hexer611] for [#22](https://github.com/Unity-Technologies/com.unity.cloud.gltfast/pull/23)). +- Loading glTFs with unknown texture extensions (e.g. WebP, `EXT_texture_webp`) now works (fixes [#705](https://github.com/atteneder/glTFast/issues/705)). ## [6.7.1] - 2024-08-07 diff --git a/Runtime/Scripts/GltfImport.cs b/Runtime/Scripts/GltfImport.cs index 29e2e232..828edcad 100755 --- a/Runtime/Scripts/GltfImport.cs +++ b/Runtime/Scripts/GltfImport.cs @@ -1387,6 +1387,7 @@ void SetImageGamma(TextureInfoBase txtInfo) foreach (var txt in Root.Textures) { var imageIndex = txt.GetImageIndex(); + if (imageIndex < 0 || imageIndex >= Root.Images.Count) continue; if (imageVariants[imageIndex] == null) { imageVariants[imageIndex] = new HashSet(); @@ -2117,6 +2118,7 @@ async Task Prepare() } var imageIndex = txt.GetImageIndex(); + if (imageIndex < 0 || imageIndex >= Root.Images.Count) continue; var img = m_Images[imageIndex]; if (imageVariants[imageIndex] == null) { diff --git a/Runtime/Scripts/Schema/Root.cs b/Runtime/Scripts/Schema/Root.cs index a9e30a72..866092e8 100644 --- a/Runtime/Scripts/Schema/Root.cs +++ b/Runtime/Scripts/Schema/Root.cs @@ -637,6 +637,14 @@ public virtual void JsonUtilityCleanup() { UnsetExtensions(); } + + if (Textures != null) + { + foreach (var texture in Textures) + { + texture.JsonUtilityCleanup(); + } + } } /// diff --git a/Runtime/Scripts/Schema/Texture.cs b/Runtime/Scripts/Schema/Texture.cs index 7fed148d..10d012a8 100644 --- a/Runtime/Scripts/Schema/Texture.cs +++ b/Runtime/Scripts/Schema/Texture.cs @@ -20,6 +20,12 @@ public abstract class TextureBase : TextureBase /// public override TextureExtensions Extensions => extensions; + + /// + internal override void UnsetExtensions() + { + extensions = null; + } } /// @@ -124,5 +130,27 @@ public override int GetHashCode() return hash; #endif } + + /// + /// Sets to null. + /// + internal abstract void UnsetExtensions(); + + /// + /// Cleans up invalid parsing artifacts created by . + /// + internal void JsonUtilityCleanup() + { + var e = Extensions; + if (e != null) + { + // Check if Basis Universal extension is valid + if ((e.KHR_texture_basisu?.source ?? -1) < 0) + { + e.KHR_texture_basisu = null; + UnsetExtensions(); + } + } + } } } diff --git a/Tests/Runtime/Scripts/JsonParsing/JsonParsingTests.cs b/Tests/Runtime/Scripts/JsonParsing/JsonParsingTests.cs index a506de45..a55022a7 100644 --- a/Tests/Runtime/Scripts/JsonParsing/JsonParsingTests.cs +++ b/Tests/Runtime/Scripts/JsonParsing/JsonParsingTests.cs @@ -507,6 +507,81 @@ public void UnknownNodeExtension() Assert.AreEqual(42, node5.Extensions.KHR_lights_punctual.light); } + [Test] + public void UnknownTextureExtension() + { + var jsonParser = new GltfJsonUtilityParser(); + var gltf = jsonParser.ParseJson(@" +{ + ""textures"": [ + { + ""name"": ""Texture0"" + }, + { + ""extensions"": {}, + ""name"": ""Texture1"" + }, + { + ""extensions"": { + ""EXT_texture_webp"": { + ""source"": 42 + } + }, + ""name"": ""Texture2"" + }, + { + ""extensions"": { + ""KHR_texture_basisu"": { + ""source"": 42 + } + }, + ""name"": ""Texture3"" + }, + { + ""extensions"": { + ""KHR_texture_basisu"": { + ""source"": 42 + }, + ""EXT_texture_webp"": { + ""source"": 43 + } + }, + ""name"": ""Texture4"" + } + ] +} +" + ); + + Assert.NotNull(gltf); + Assert.NotNull(gltf.Textures, "No textures"); + Assert.AreEqual(5, gltf.Textures.Count, "Invalid texture quantity"); + + var texture0 = gltf.Textures[0]; + Assert.NotNull(texture0); + Assert.IsNull(texture0.Extensions); + + var texture1 = gltf.Textures[1]; + Assert.NotNull(texture1); + Assert.IsNull(texture1.Extensions); + + var texture2 = gltf.Textures[2]; + Assert.NotNull(texture2); + Assert.IsNull(texture2.Extensions); + + var texture3 = gltf.Textures[3]; + Assert.NotNull(texture3); + Assert.NotNull(texture3.Extensions); + Assert.NotNull(texture3.Extensions.KHR_texture_basisu); + Assert.AreEqual(42, texture3.Extensions.KHR_texture_basisu.source); + + var texture4 = gltf.Textures[4]; + Assert.NotNull(texture4); + Assert.NotNull(texture4.Extensions); + Assert.NotNull(texture4.Extensions.KHR_texture_basisu); + Assert.AreEqual(42, texture4.Extensions.KHR_texture_basisu.source); + } + [Test] public void ParseGarbage() { From 1b881122e655dceb1aae2525804840f4e62f2405 Mon Sep 17 00:00:00 2001 From: Andreas Atteneder Date: Wed, 4 Sep 2024 20:21:54 +0200 Subject: [PATCH 15/16] doc: Updated features page. (#185) --- Documentation~/features.md | 57 ++++++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 18 deletions(-) diff --git a/Documentation~/features.md b/Documentation~/features.md index 82b611a3..86b40ffc 100644 --- a/Documentation~/features.md +++ b/Documentation~/features.md @@ -55,7 +55,7 @@ The glTF 2.0 specification is fully supported, with only a few minor remarks. | POINTS | ✅ | ✅ | LINES | ✅ | ✅ | LINE_STRIP | ✅ | ✅ -| ¹LINE_LOOP | ✅ | ✅ +| LINE_LOOP | ✅ | ✅ | TRIANGLE_STRIP | ✅ | `n/a` | TRIANGLE_FAN | ✅ | `n/a` | Quads | `n/a` | ✅ via triangulation @@ -64,9 +64,9 @@ The glTF 2.0 specification is fully supported, with only a few minor remarks. | Positions | ✅ | ✅ | Normals | ✅ | ✅ | Tangents | ✅ | ✅ -| Texture coordinates / UV sets | ✅ | `?` -| Three or more texture coordinates / UV sets | ²☑️ | `?` -| Vertex colors | ✅ | `?` +| Texture coordinates / UV sets | ✅ | ✅ +| Three or more texture coordinates / UV sets | ¹☑️ | ✅ +| Vertex colors | ✅ | ✅ | Draco™ mesh compression (via [DracoForUnity]) | ✅ | ✅ | Implicit (no) indices | ✅ | | Per primitive material | ✅ | ✅ @@ -74,19 +74,19 @@ The glTF 2.0 specification is fully supported, with only a few minor remarks. | Weights (up to 4 per vertex) | ✅ | ✅ | | | | **Morph Targets / Blend Shapes** -| Sparse accessors | ³ ✅ | +| Sparse accessors | ² ✅ | | [Skins][Skins] | ✅ | ✅ | | | | **Animation** | via legacy Animation System | ✅ | | via Playable API ([issue][AnimationPlayables]) | | -| via Mecanim ([issue][AnimationMecanim]) | | +| via Mecanim ([issue][AnimationMecanim]) | ³☑️ | -¹: Untested due to lack of demo files. +¹: Up to eight UV sets can imported, but *Unity glTFast* shaders only support two (see [issue][UVsets]). -²: Up to eight UV sets can imported, but *Unity glTFast* shaders only support two (see [issue][UVsets]). +²: Not on all accessor types; morph targets and vertex positions only -³: Not on all accessor types; morph targets and vertex positions only +³: Animation clips can be imported Mecanim compatible, but they won't be assigned and cannot be played back without further work. ## Extensions @@ -96,37 +96,59 @@ The glTF 2.0 specification is fully supported, with only a few minor remarks. |------------| ------ | ------ | | | | **Khronos** +| KHR_animation_pointer | | | | KHR_draco_mesh_compression | ✅ | ✅ -| KHR_materials_pbrSpecularGlossiness | ✅ | -| KHR_materials_unlit | ✅ | ✅ -| KHR_texture_transform | ✅ | ✅ -| KHR_mesh_quantization | ✅ | -| KHR_texture_basisu | ✅ | | KHR_lights_punctual | ✅ | ✅ +| KHR_materials_anisotropy | | | | KHR_materials_clearcoat | ✅ | ✅ +| KHR_materials_dispersion | | | +| KHR_materials_emissive_strength | | | +| KHR_materials_ior | [ℹ️][IOR] | +| KHR_materials_iridescence | | | | KHR_materials_sheen | [ℹ️][Sheen] | +| KHR_materials_specular | [ℹ️][Specular] | | KHR_materials_transmission | [ℹ️][Transmission] | +| KHR_materials_unlit | ✅ | ✅ | KHR_materials_variants | ✅ | -| KHR_materials_ior | [ℹ️][IOR] | -| KHR_materials_specular | [ℹ️][Specular] | | KHR_materials_volume | [ℹ️][Volume] | +| KHR_mesh_quantization | ✅ | +| KHR_texture_basisu | ✅ | +| KHR_texture_transform | ✅ | ✅ | KHR_xmp_json_ld |️ | +| ²KHR_materials_pbrSpecularGlossiness | ☑️ | | | | | **Vendor** | ¹EXT_mesh_gpu_instancing | ✅ | | EXT_meshopt_compression | ✅ | | EXT_lights_image_based | [ℹ️][IBL] | +| EXT_texture_webp | | | ¹: Without support for custom vertex attributes (e.g. `_ID`) +²: Archived/obsolete; Superseded by KHR_materials_specular + Not investigated yet: +- ADOBE_materials_clearcoat_tint - AGI_articulations - AGI_stk_metadata - CESIUM_primitive_outline +- EXT_lights_ies +- EXT_mesh_manifold +- GRIFFEL_bim_data +- MPEG_accessor_timed +- MPEG_animation_timing +- MPEG_audio_spatial +- MPEG_buffer_circular +- MPEG_media +- MPEG_mesh_linking +- MPEG_scene_dynamic +- MPEG_texture_video +- MPEG_viewport_recommended - MSFT_lod - MSFT_packing_normalRoughnessMetallic - MSFT_packing_occlusionRoughnessMetallic +- NV_materials_mdl Will not become supported (reason in brackets): @@ -134,7 +156,6 @@ Not investigated yet: - KHR_techniques_webgl (archived) - ADOBE_materials_clearcoat_specular (prefer KHR_materials_clearcoat) - ADOBE_materials_thin_transparency (prefer KHR_materials_transmission) -- EXT_texture_webp (prefer KTX/basisu) - FB_geometry_metadata (prefer KTX_xmp) - MSFT_texture_dds (prefer KTX/basisu) @@ -224,7 +245,7 @@ Other shaders might (partially) work if they have similar properties (with ident ³: Built-In Render Pipeline Standard and Unlit Shader -⁴: Vertex colors are always exported, regardless whether the shader makes use of them. +⁴: The vertex color attribute is only exported if the material/shader makes use of it (see [Vertex Attribute Discarding](ExportRuntime.md#vertex-attribute-discarding)). #### glTFast Shaders From 64f3257d9354fd61e8a9232690648cc2f1d4b941 Mon Sep 17 00:00:00 2001 From: Andreas Atteneder Date: Thu, 5 Sep 2024 15:18:42 +0200 Subject: [PATCH 16/16] Release 6.8.0 (#187) * fix: Ignore export non-readable mesh tests if OpenGL(ES) is used, since tests on Ubuntu/OpenGL with 2022.3 and 6000.0 fail consistently. --- CHANGELOG.md | 2 +- Runtime/Scripts/Export/Constants.cs | 2 +- Tests/Runtime/Scripts/Export/ExportNonReadableTests.cs | 7 +++++++ package.json | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55ab7790..f71decb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] - +## [6.8.0] - 2024-09-05 ### Added - (Import) Setting to create textures readable. This allows users to access resulting textures from their scripts. diff --git a/Runtime/Scripts/Export/Constants.cs b/Runtime/Scripts/Export/Constants.cs index 45c766d5..9650ea3a 100644 --- a/Runtime/Scripts/Export/Constants.cs +++ b/Runtime/Scripts/Export/Constants.cs @@ -7,7 +7,7 @@ namespace GLTFast.Export { static class Constants { - public const string version = "6.7.1"; + public const string version = "6.8.0"; internal const string mimeTypePNG = "image/png"; internal const string mimeTypeJPG = "image/jpeg"; diff --git a/Tests/Runtime/Scripts/Export/ExportNonReadableTests.cs b/Tests/Runtime/Scripts/Export/ExportNonReadableTests.cs index babacecc..68e398a0 100644 --- a/Tests/Runtime/Scripts/Export/ExportNonReadableTests.cs +++ b/Tests/Runtime/Scripts/Export/ExportNonReadableTests.cs @@ -12,6 +12,7 @@ using Unity.glTF.Validator; #endif // GLTF_VALIDATOR using UnityEngine; +using UnityEngine.Rendering; using UnityEngine.TestTools; namespace GLTFast.Tests.Export @@ -129,6 +130,12 @@ public void OneTimeSetup() void Certify() { + if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.OpenGLCore + || SystemInfo.graphicsDeviceType == GraphicsDeviceType.OpenGLES2 + || SystemInfo.graphicsDeviceType == GraphicsDeviceType.OpenGLES3) + { + Assert.Ignore("Exporting non-readable meshes is unreliable on OpenGL/OpenGLES."); + } #if !(UNITY_6000_0_OR_NEWER || (UNITY_EDITOR && UNITY_2022_3_OR_NEWER)) Assert.Ignore("Exporting non-readable meshes is unreliable on Unity versions before 6."); #endif diff --git a/package.json b/package.json index 38590648..a0843169 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.unity.cloud.gltfast", - "version": "6.7.1", + "version": "6.8.0", "displayName": "Unity glTFast", "description": "Use glTFast to import and export glTF 3D files efficiently at runtime or in the Editor", "unity": "2020.3",