From 7be5e40aad4d631a4f7512cfe751b1979babd0c7 Mon Sep 17 00:00:00 2001 From: David Lively Date: Fri, 3 Oct 2025 13:18:52 -0500 Subject: [PATCH 01/14] Removed some unused vars --- .../src/UnityPrepareRendererResources.cpp | 41 +++++++++++++++++-- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/native~/Runtime/src/UnityPrepareRendererResources.cpp b/native~/Runtime/src/UnityPrepareRendererResources.cpp index 1d5807f4..2ae72e4d 100644 --- a/native~/Runtime/src/UnityPrepareRendererResources.cpp +++ b/native~/Runtime/src/UnityPrepareRendererResources.cpp @@ -369,6 +369,14 @@ void loadPrimitive( computeFlatNormals = hasNormals = true; } + bool hasTangents = false; + auto tangentAcccessorIt = primitive.attributes.find("TANGENT"); + AccessorView tangentView; + if (tangentAcccessorIt != primitive.attributes.end()) { + tangentView = AccessorView(gltf, tangentAcccessorIt->second); + hasTangents = tangentView.status() == AccessorViewStatus::Valid; + } + // Check if we need to upgrade to a large index type to accommodate the // larger number of vertices we need for flat normals. if (computeFlatNormals && indexFormat == IndexFormat::UInt16 && @@ -450,6 +458,15 @@ void loadPrimitive( ++numberOfAttributes; } + if (hasTangents) { + assert(numberOfAttributes < MAX_ATTRIBUTES); + descriptor[numberOfAttributes].attribute = VertexAttribute::Tangent; + descriptor[numberOfAttributes].format = VertexAttributeFormat::Float32; + descriptor[numberOfAttributes].dimension = 4; + descriptor[numberOfAttributes].stream = streamIndex; + ++numberOfAttributes; + } + // Add the COLOR_0 attribute, if it exists. auto colorAccessorIt = primitive.attributes.find("COLOR_0"); bool hasVertexColors = @@ -571,19 +588,27 @@ void loadPrimitive( // The vertex layout will be as follows: // 1. position // 2. normals (skip if N/A) - // 3. vertex colors (skip if N/A) - // 4. texcoords (first all TEXCOORD_i, then all _CESIUMOVERLAY_i) + // 3. tangents (skip if N/A) + // 4. vertex colors (skip if N/A) + // 5. texcoords (first all TEXCOORD_i, then all _CESIUMOVERLAY_i) size_t stride = sizeof(Vector3); - size_t normalByteOffset, colorByteOffset; + size_t normalByteOffset; if (hasNormals) { normalByteOffset = stride; stride += sizeof(Vector3); } + + if (hasTangents) { + stride += sizeof(Vector4); + } + + size_t colorByteOffset; if (hasVertexColors) { colorByteOffset = stride; stride += sizeof(uint32_t); } + stride += numTexCoords * sizeof(Vector2); if (computeFlatNormals) { @@ -593,11 +618,16 @@ void loadPrimitive( indices, indexCount, positionView); + for (int64_t i = 0; i < vertexCount; ++i) { TIndex vertexIndex = indices[i]; *reinterpret_cast(pWritePos) = positionView[vertexIndex]; // skip position and normal pWritePos += 2 * sizeof(Vector3); + if (hasTangents) { + *reinterpret_cast(pWritePos) = tangentView[vertexIndex]; + pWritePos += sizeof(Vector4); + } // Skip the slot allocated for vertex colors, we will fill them in // bulk later. if (hasVertexColors) { @@ -620,6 +650,11 @@ void loadPrimitive( pWritePos += sizeof(Vector3); } + if (hasTangents) { + *reinterpret_cast(pWritePos) = tangentView[i]; + pWritePos += sizeof(Vector4); + } + // Skip the slot allocated for vertex colors, we will fill them in // bulk later. if (hasVertexColors) { From 7508ff5b52fb222041cb4eb98ae7228e9077defd Mon Sep 17 00:00:00 2001 From: David Lively Date: Fri, 3 Oct 2025 13:25:38 -0500 Subject: [PATCH 02/14] Corrected overlooked texcoord flip case --- native~/Runtime/src/UnityPrepareRendererResources.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/native~/Runtime/src/UnityPrepareRendererResources.cpp b/native~/Runtime/src/UnityPrepareRendererResources.cpp index 2ae72e4d..02cccce9 100644 --- a/native~/Runtime/src/UnityPrepareRendererResources.cpp +++ b/native~/Runtime/src/UnityPrepareRendererResources.cpp @@ -635,8 +635,9 @@ void loadPrimitive( } for (uint32_t texCoordIndex = 0; texCoordIndex < numTexCoords; ++texCoordIndex) { - *reinterpret_cast(pWritePos) = - texCoordViews[texCoordIndex][vertexIndex]; + Vector2 texCoord = texCoordViews[texCoordIndex][vertexIndex]; + texCoord.y = 1 - texCoord.y; + *reinterpret_cast(pWritePos) =texCoord; pWritePos += sizeof(Vector2); } } From 491ad866dd8252d9cda1cf054cd27966e8a8a8de Mon Sep 17 00:00:00 2001 From: David Lively Date: Fri, 3 Oct 2025 13:35:47 -0500 Subject: [PATCH 03/14] Spacing and formatting --- native~/Runtime/src/UnityPrepareRendererResources.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/native~/Runtime/src/UnityPrepareRendererResources.cpp b/native~/Runtime/src/UnityPrepareRendererResources.cpp index 02cccce9..4a814efc 100644 --- a/native~/Runtime/src/UnityPrepareRendererResources.cpp +++ b/native~/Runtime/src/UnityPrepareRendererResources.cpp @@ -636,6 +636,7 @@ void loadPrimitive( for (uint32_t texCoordIndex = 0; texCoordIndex < numTexCoords; ++texCoordIndex) { Vector2 texCoord = texCoordViews[texCoordIndex][vertexIndex]; + // flip Y to comply with Unity's left-handed UV coordinates texCoord.y = 1 - texCoord.y; *reinterpret_cast(pWritePos) =texCoord; pWritePos += sizeof(Vector2); @@ -650,18 +651,15 @@ void loadPrimitive( *reinterpret_cast(pWritePos) = normalView[i]; pWritePos += sizeof(Vector3); } - if (hasTangents) { *reinterpret_cast(pWritePos) = tangentView[i]; pWritePos += sizeof(Vector4); } - // Skip the slot allocated for vertex colors, we will fill them in // bulk later. if (hasVertexColors) { pWritePos += sizeof(uint32_t); } - for (uint32_t texCoordIndex = 0; texCoordIndex < numTexCoords; ++texCoordIndex) { Vector2 texCoord = texCoordViews[texCoordIndex][i]; From cdc5dbc3eea90654cb03696ade7431b16c4a92db Mon Sep 17 00:00:00 2001 From: David Lively Date: Fri, 3 Oct 2025 13:38:27 -0500 Subject: [PATCH 04/14] Updated change log. --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 5707df66..15e49e45 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,7 @@ ##### Fixes :wrench: - Corrected glTF import process to flip textures and UV coordinates from glTF's U-right, V-down convention to comply with Unity's U-right, V-up coordinate system. +- Modified model importer to include tangents when they are present in the source glTF. ## v1.18.1 - 2025-10-01 From c433b0dd040b703a511ab9861fed71940dcf18c6 Mon Sep 17 00:00:00 2001 From: David Lively Date: Fri, 3 Oct 2025 13:42:01 -0500 Subject: [PATCH 05/14] Formatting. --- native~/Runtime/src/UnityPrepareRendererResources.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/native~/Runtime/src/UnityPrepareRendererResources.cpp b/native~/Runtime/src/UnityPrepareRendererResources.cpp index 4a814efc..b9883efb 100644 --- a/native~/Runtime/src/UnityPrepareRendererResources.cpp +++ b/native~/Runtime/src/UnityPrepareRendererResources.cpp @@ -373,7 +373,8 @@ void loadPrimitive( auto tangentAcccessorIt = primitive.attributes.find("TANGENT"); AccessorView tangentView; if (tangentAcccessorIt != primitive.attributes.end()) { - tangentView = AccessorView(gltf, tangentAcccessorIt->second); + tangentView = + AccessorView(gltf, tangentAcccessorIt->second); hasTangents = tangentView.status() == AccessorViewStatus::Valid; } @@ -638,7 +639,7 @@ void loadPrimitive( Vector2 texCoord = texCoordViews[texCoordIndex][vertexIndex]; // flip Y to comply with Unity's left-handed UV coordinates texCoord.y = 1 - texCoord.y; - *reinterpret_cast(pWritePos) =texCoord; + *reinterpret_cast(pWritePos) = texCoord; pWritePos += sizeof(Vector2); } } From 5e5a7dfe72b843d341d534c0cb342a6a952041a7 Mon Sep 17 00:00:00 2001 From: David Lively Date: Mon, 6 Oct 2025 12:48:16 -0500 Subject: [PATCH 06/14] Updating with changes from 611 --- native~/Runtime/src/TextureLoader.cpp | 30 +++++++++---------- .../src/UnityPrepareRendererResources.cpp | 5 ++-- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/native~/Runtime/src/TextureLoader.cpp b/native~/Runtime/src/TextureLoader.cpp index d0b909c6..a938a9c9 100644 --- a/native~/Runtime/src/TextureLoader.cpp +++ b/native~/Runtime/src/TextureLoader.cpp @@ -71,15 +71,14 @@ getUncompressedPixelFormat(const CesiumGltf::ImageAsset& image) { /** * Copy image data while flipping the data vertically. According to the glTF 2.0 - * spec, glTF stores textures in x-right, y-down (right-handed) coordinates. + * spec, glTF stores textures in x-right, y-down coordinates. * However, Unity uses x-right, y-up coordinates, so we need to flip the - *textures and UV coordinates. See loadPrimitive() in - *UnityPrepareRenderResources.cpp for the corresponding UV flip. + * textures and UV coordinates. See loadPrimitive() in + * UnityPrepareRenderResources.cpp for the corresponding UV flip. **/ -template -void copyAndFlipY( - TSrcByte* dst, - const TDstByte* src, +void copyAndFlipTexture( + std::uint8_t* dst, + const std::byte* src, const size_t dataLength, const size_t height) { assert( @@ -88,8 +87,8 @@ void copyAndFlipY( const size_t stride = dataLength / height; - for (size_t j = 0; j < height; ++j) { - memcpy(dst, src + (height - j) * stride, stride); + for (int32_t i = int32_t(height) - 1; i >= 0; --i) { + memcpy(dst, src + i * stride, stride); dst += stride; } } @@ -125,7 +124,7 @@ TextureLoader::loadTexture(const CesiumGltf::ImageAsset& image, bool sRGB) { if (image.mipPositions.empty()) { // No mipmaps, copy the whole thing and then let Unity generate mipmaps on a // worker thread. - copyAndFlipY( + copyAndFlipTexture( pixels, image.pixelData.data(), image.pixelData.size(), @@ -136,26 +135,27 @@ TextureLoader::loadTexture(const CesiumGltf::ImageAsset& image, bool sRGB) { std::uint8_t* pWritePosition = pixels; const std::byte* pReadBuffer = image.pixelData.data(); - // track square image dimension for each mip level - int32_t mipHeight = image.height; + // Track image height for each mip level + size_t mipHeight = image.height; for (const ImageAssetMipPosition& mip : image.mipPositions) { assert(mipHeight > 0 && "Invalid image size."); const size_t start = mip.byteOffset; const size_t end = mip.byteOffset + mip.byteSize; if (start >= textureLength || end > textureLength) { + // Invalid mip, skip this level. mipHeight /= 2; - continue; // invalid mip spec, ignore it + continue; } - copyAndFlipY( + copyAndFlipTexture( pWritePosition, pReadBuffer + start, mip.byteSize, mipHeight); pWritePosition += mip.byteSize; // adjust height for next mip level. - mipHeight /= 2; + mipHeight >>= 1; } result.Apply(false, true); diff --git a/native~/Runtime/src/UnityPrepareRendererResources.cpp b/native~/Runtime/src/UnityPrepareRendererResources.cpp index 02b28255..21818d11 100644 --- a/native~/Runtime/src/UnityPrepareRendererResources.cpp +++ b/native~/Runtime/src/UnityPrepareRendererResources.cpp @@ -637,7 +637,7 @@ void loadPrimitive( for (uint32_t texCoordIndex = 0; texCoordIndex < numTexCoords; ++texCoordIndex) { Vector2 texCoord = texCoordViews[texCoordIndex][vertexIndex]; - // flip Y to comply with Unity's left-handed UV coordinates + // Flip Y to comply with Unity's V-up coordinate convention texCoord.y = 1 - texCoord.y; *reinterpret_cast(pWritePos) = texCoord; pWritePos += sizeof(Vector2); @@ -647,6 +647,7 @@ void loadPrimitive( for (int64_t i = 0; i < vertexCount; ++i) { *reinterpret_cast(pWritePos) = positionView[i]; pWritePos += sizeof(Vector3); + if (hasNormals) { *reinterpret_cast(pWritePos) = normalView[i]; pWritePos += sizeof(Vector3); @@ -663,7 +664,7 @@ void loadPrimitive( for (uint32_t texCoordIndex = 0; texCoordIndex < numTexCoords; ++texCoordIndex) { Vector2 texCoord = texCoordViews[texCoordIndex][i]; - // flip Y to comply with Unity's left-handed UV coordinates + // Flip Y to comply with Unity's V-up coordinate convention texCoord.y = 1 - texCoord.y; *reinterpret_cast(pWritePos) = texCoord; pWritePos += sizeof(Vector2); From 206bf1b5a2eea73957c47c821637e2823a975aa1 Mon Sep 17 00:00:00 2001 From: David Lively Date: Fri, 3 Oct 2025 13:38:27 -0500 Subject: [PATCH 07/14] Updated change log. --- CHANGES.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 15e49e45..822c53e0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,8 +3,7 @@ ## ? - ? ##### Fixes :wrench: - -- Corrected glTF import process to flip textures and UV coordinates from glTF's U-right, V-down convention to comply with Unity's U-right, V-up coordinate system. +- Textures and UV coordinates from glTFs are now flipped to properly comply with Unity's U-right, V-up convention. - Modified model importer to include tangents when they are present in the source glTF. ## v1.18.1 - 2025-10-01 From 0994280442328bb99ad8dff2369c430619768661 Mon Sep 17 00:00:00 2001 From: David Lively Date: Mon, 6 Oct 2025 13:30:27 -0500 Subject: [PATCH 08/14] Cleaned up the vertex copy loop to remove duplicated code. --- .../src/UnityPrepareRendererResources.cpp | 84 ++++++++----------- 1 file changed, 34 insertions(+), 50 deletions(-) diff --git a/native~/Runtime/src/UnityPrepareRendererResources.cpp b/native~/Runtime/src/UnityPrepareRendererResources.cpp index 21818d11..399c0189 100644 --- a/native~/Runtime/src/UnityPrepareRendererResources.cpp +++ b/native~/Runtime/src/UnityPrepareRendererResources.cpp @@ -572,9 +572,9 @@ void loadPrimitive( attributes.Item(i, descriptor[i]); } - int32_t vertexCount = computeFlatNormals - ? indexCount - : static_cast(positionView.size()); + const int32_t vertexCount = computeFlatNormals + ? indexCount + : static_cast(positionView.size()); meshData.SetVertexBufferParams(vertexCount, attributes); NativeArray1 nativeVertexBuffer = @@ -612,6 +612,7 @@ void loadPrimitive( stride += numTexCoords * sizeof(Vector2); + const bool duplicateVertices = computeFlatNormals; if (computeFlatNormals) { ::computeFlatNormals( pWritePos + normalByteOffset, @@ -619,56 +620,39 @@ void loadPrimitive( indices, indexCount, positionView); + } - for (int64_t i = 0; i < vertexCount; ++i) { - TIndex vertexIndex = indices[i]; - *reinterpret_cast(pWritePos) = positionView[vertexIndex]; - // skip position and normal - pWritePos += 2 * sizeof(Vector3); - if (hasTangents) { - *reinterpret_cast(pWritePos) = tangentView[vertexIndex]; - pWritePos += sizeof(Vector4); - } - // Skip the slot allocated for vertex colors, we will fill them in - // bulk later. - if (hasVertexColors) { - pWritePos += sizeof(uint32_t); - } - for (uint32_t texCoordIndex = 0; texCoordIndex < numTexCoords; - ++texCoordIndex) { - Vector2 texCoord = texCoordViews[texCoordIndex][vertexIndex]; - // Flip Y to comply with Unity's V-up coordinate convention - texCoord.y = 1 - texCoord.y; - *reinterpret_cast(pWritePos) = texCoord; - pWritePos += sizeof(Vector2); - } - } - } else { - for (int64_t i = 0; i < vertexCount; ++i) { - *reinterpret_cast(pWritePos) = positionView[i]; + for (int64_t i = 0; i < vertexCount; ++i) { + TIndex vertexIndex = duplicateVertices ? indices[i] : i; + *reinterpret_cast(pWritePos) = positionView[vertexIndex]; + pWritePos += sizeof(Vector3); + + if (computeFlatNormals) { + // skip computed normal pWritePos += sizeof(Vector3); + } else if (hasNormals) { + *reinterpret_cast(pWritePos) = normalView[vertexIndex]; + pWritePos += sizeof(Vector3); + } - if (hasNormals) { - *reinterpret_cast(pWritePos) = normalView[i]; - pWritePos += sizeof(Vector3); - } - if (hasTangents) { - *reinterpret_cast(pWritePos) = tangentView[i]; - pWritePos += sizeof(Vector4); - } - // Skip the slot allocated for vertex colors, we will fill them in - // bulk later. - if (hasVertexColors) { - pWritePos += sizeof(uint32_t); - } - for (uint32_t texCoordIndex = 0; texCoordIndex < numTexCoords; - ++texCoordIndex) { - Vector2 texCoord = texCoordViews[texCoordIndex][i]; - // Flip Y to comply with Unity's V-up coordinate convention - texCoord.y = 1 - texCoord.y; - *reinterpret_cast(pWritePos) = texCoord; - pWritePos += sizeof(Vector2); - } + if (hasTangents) { + *reinterpret_cast(pWritePos) = tangentView[vertexIndex]; + pWritePos += sizeof(Vector4); + } + + // Skip the slot allocated for vertex colors, we will fill them in + // bulk later. + if (hasVertexColors) { + pWritePos += sizeof(uint32_t); + } + + for (uint32_t texCoordIndex = 0; texCoordIndex < numTexCoords; + ++texCoordIndex) { + Vector2 texCoord = texCoordViews[texCoordIndex][vertexIndex]; + // Flip Y to comply with Unity's V-up coordinate convention + texCoord.y = 1 - texCoord.y; + *reinterpret_cast(pWritePos) = texCoord; + pWritePos += sizeof(Vector2); } } From 816f48c8b3241099d2ae64fbb4efdd4e6428c743 Mon Sep 17 00:00:00 2001 From: David Lively Date: Mon, 6 Oct 2025 13:37:34 -0500 Subject: [PATCH 09/14] Added a const and corrected a comment. --- native~/Runtime/src/UnityPrepareRendererResources.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/native~/Runtime/src/UnityPrepareRendererResources.cpp b/native~/Runtime/src/UnityPrepareRendererResources.cpp index 399c0189..6530e4e5 100644 --- a/native~/Runtime/src/UnityPrepareRendererResources.cpp +++ b/native~/Runtime/src/UnityPrepareRendererResources.cpp @@ -623,7 +623,7 @@ void loadPrimitive( } for (int64_t i = 0; i < vertexCount; ++i) { - TIndex vertexIndex = duplicateVertices ? indices[i] : i; + const TIndex vertexIndex = duplicateVertices ? indices[i] : i; *reinterpret_cast(pWritePos) = positionView[vertexIndex]; pWritePos += sizeof(Vector3); @@ -658,7 +658,7 @@ void loadPrimitive( // Fill in vertex colors separately, if they exist. if (hasVertexColors) { - // Color comes after position and normal. + // Color comes after position, normal and tangent createAccessorView( gltf, colorAccessorIt->second, From 7013995ea148d27a631c9d0fb9045f849761d3a1 Mon Sep 17 00:00:00 2001 From: David Lively Date: Mon, 6 Oct 2025 13:38:48 -0500 Subject: [PATCH 10/14] Clarified change log comment --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 3c981054..2c6ea4f0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,7 +4,7 @@ ##### Fixes :wrench: - Textures and UV coordinates from glTFs are now flipped to properly comply with Unity's U-right, V-up convention. -- Tangents from glTFs are properly imported. +- Vertex tangents from glTFs are properly imported. ## v1.18.1 - 2025-10-01 From 432ea7199d84fce6a375c125340e2dbb5d22df54 Mon Sep 17 00:00:00 2001 From: David Lively Date: Mon, 6 Oct 2025 13:58:29 -0500 Subject: [PATCH 11/14] Variable change. --- native~/Runtime/src/UnityPrepareRendererResources.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native~/Runtime/src/UnityPrepareRendererResources.cpp b/native~/Runtime/src/UnityPrepareRendererResources.cpp index 6530e4e5..c4118ac0 100644 --- a/native~/Runtime/src/UnityPrepareRendererResources.cpp +++ b/native~/Runtime/src/UnityPrepareRendererResources.cpp @@ -670,7 +670,7 @@ void loadPrimitive( indices}); } - if (computeFlatNormals) { + if (duplicateVertices) { // rewrite indices for (TIndex i = 0; i < indexCount; i++) { indices[i] = i; From d1dfd5b00b213067cbc63e62c5e9f25ed393cf19 Mon Sep 17 00:00:00 2001 From: David Lively Date: Mon, 6 Oct 2025 14:08:48 -0500 Subject: [PATCH 12/14] Adding untracked meta file so git will stop complaining --- CONTRIBUTING.md.meta | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 CONTRIBUTING.md.meta diff --git a/CONTRIBUTING.md.meta b/CONTRIBUTING.md.meta new file mode 100644 index 00000000..4c20f83c --- /dev/null +++ b/CONTRIBUTING.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3fd6df72dd74e4b4a9a1096d82b3e1b5 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: From 72cb61625e2c583e3e7fd2811c41d65fa77f62cc Mon Sep 17 00:00:00 2001 From: David Lively Date: Fri, 10 Oct 2025 10:12:31 -0500 Subject: [PATCH 13/14] Update CHANGES.md Co-authored-by: Janine Liu <32226860+j9liu@users.noreply.github.com> --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index f37bee6c..aa1b7452 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,7 +5,7 @@ ##### Fixes :wrench: - Textures and UV coordinates from glTFs are now flipped to properly comply with Unity's U-right, V-up convention. -- Vertex tangents from glTFs are properly imported. +- Vertex tangents are now properly imported when present in glTFs. ## v1.18.1 - 2025-10-01 From 25d481c94e770347724cef8f2d0c15f790ed047e Mon Sep 17 00:00:00 2001 From: David Lively Date: Fri, 10 Oct 2025 10:12:41 -0500 Subject: [PATCH 14/14] Update native~/Runtime/src/UnityPrepareRendererResources.cpp Co-authored-by: Janine Liu <32226860+j9liu@users.noreply.github.com> --- native~/Runtime/src/UnityPrepareRendererResources.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native~/Runtime/src/UnityPrepareRendererResources.cpp b/native~/Runtime/src/UnityPrepareRendererResources.cpp index c4118ac0..1ef9c51d 100644 --- a/native~/Runtime/src/UnityPrepareRendererResources.cpp +++ b/native~/Runtime/src/UnityPrepareRendererResources.cpp @@ -370,7 +370,7 @@ void loadPrimitive( } bool hasTangents = false; - auto tangentAcccessorIt = primitive.attributes.find("TANGENT"); + auto tangentAccessorIt = primitive.attributes.find("TANGENT"); AccessorView tangentView; if (tangentAcccessorIt != primitive.attributes.end()) { tangentView =