diff --git a/Source/Editor/Windows/Assets/ModelWindow.cs b/Source/Editor/Windows/Assets/ModelWindow.cs
index be7140d61..f08445862 100644
--- a/Source/Editor/Windows/Assets/ModelWindow.cs
+++ b/Source/Editor/Windows/Assets/ModelWindow.cs
@@ -538,9 +538,9 @@ namespace FlaxEditor.Windows.Assets
for (int i = 0; i < meshData.IndexBuffer.Length; i += 3)
{
// Cache triangle indices
- int i0 = meshData.IndexBuffer[i + 0];
- int i1 = meshData.IndexBuffer[i + 1];
- int i2 = meshData.IndexBuffer[i + 2];
+ uint i0 = meshData.IndexBuffer[i + 0];
+ uint i1 = meshData.IndexBuffer[i + 1];
+ uint i2 = meshData.IndexBuffer[i + 2];
// Cache triangle uvs positions and transform positions to output target
Vector2 uv0 = meshData.VertexBuffer[i0].TexCoord * uvScale;
@@ -562,9 +562,9 @@ namespace FlaxEditor.Windows.Assets
for (int i = 0; i < meshData.IndexBuffer.Length; i += 3)
{
// Cache triangle indices
- int i0 = meshData.IndexBuffer[i + 0];
- int i1 = meshData.IndexBuffer[i + 1];
- int i2 = meshData.IndexBuffer[i + 2];
+ uint i0 = meshData.IndexBuffer[i + 0];
+ uint i1 = meshData.IndexBuffer[i + 1];
+ uint i2 = meshData.IndexBuffer[i + 2];
// Cache triangle uvs positions and transform positions to output target
Vector2 uv0 = meshData.VertexBuffer[i0].LightmapUVs * uvScale;
diff --git a/Source/Editor/Windows/Assets/SkinnedModelWindow.cs b/Source/Editor/Windows/Assets/SkinnedModelWindow.cs
index 76639709c..ea5240cb5 100644
--- a/Source/Editor/Windows/Assets/SkinnedModelWindow.cs
+++ b/Source/Editor/Windows/Assets/SkinnedModelWindow.cs
@@ -645,9 +645,9 @@ namespace FlaxEditor.Windows.Assets
for (int i = 0; i < meshData.IndexBuffer.Length; i += 3)
{
// Cache triangle indices
- int i0 = meshData.IndexBuffer[i + 0];
- int i1 = meshData.IndexBuffer[i + 1];
- int i2 = meshData.IndexBuffer[i + 2];
+ uint i0 = meshData.IndexBuffer[i + 0];
+ uint i1 = meshData.IndexBuffer[i + 1];
+ uint i2 = meshData.IndexBuffer[i + 2];
// Cache triangle uvs positions and transform positions to output target
Vector2 uv0 = meshData.VertexBuffer[i0].TexCoord * uvScale;
@@ -820,7 +820,7 @@ namespace FlaxEditor.Windows.Assets
private struct MeshData
{
- public int[] IndexBuffer;
+ public uint[] IndexBuffer;
public SkinnedMesh.Vertex[] VertexBuffer;
}
diff --git a/Source/Engine/Graphics/Mesh.cs b/Source/Engine/Graphics/Mesh.cs
index 82491effd..6d855788a 100644
--- a/Source/Engine/Graphics/Mesh.cs
+++ b/Source/Engine/Graphics/Mesh.cs
@@ -592,10 +592,10 @@ namespace FlaxEngine
/// If mesh index buffer format (see ) is then it's faster to call .
/// If set to true the data will be downloaded from the GPU, otherwise it can be loaded from the drive (source asset file) or from memory (if cached). Downloading mesh from GPU requires this call to be made from the other thread than main thread. Virtual assets are always downloaded from GPU memory due to lack of dedicated storage container for the asset data.
/// The gathered data.
- public int[] DownloadIndexBuffer(bool forceGpu = false)
+ public uint[] DownloadIndexBuffer(bool forceGpu = false)
{
var triangles = TriangleCount;
- var result = new int[triangles * 3];
+ var result = new uint[triangles * 3];
if (Internal_DownloadBuffer(__unmanagedPtr, forceGpu, result, (int)InternalBufferType.IB32))
throw new FlaxException("Failed to download mesh data.");
return result;
diff --git a/Source/Engine/Graphics/SkinnedMesh.cs b/Source/Engine/Graphics/SkinnedMesh.cs
index d6d77a01b..ef5e5dcd2 100644
--- a/Source/Engine/Graphics/SkinnedMesh.cs
+++ b/Source/Engine/Graphics/SkinnedMesh.cs
@@ -263,10 +263,10 @@ namespace FlaxEngine
/// If mesh index buffer format (see ) is then it's faster to call .
/// If set to true the data will be downloaded from the GPU, otherwise it can be loaded from the drive (source asset file) or from memory (if cached). Downloading mesh from GPU requires this call to be made from the other thread than main thread. Virtual assets are always downloaded from GPU memory due to lack of dedicated storage container for the asset data.
/// The gathered data.
- public int[] DownloadIndexBuffer(bool forceGpu = false)
+ public uint[] DownloadIndexBuffer(bool forceGpu = false)
{
var triangles = TriangleCount;
- var result = new int[triangles * 3];
+ var result = new uint[triangles * 3];
if (Internal_DownloadBuffer(__unmanagedPtr, forceGpu, result, (int)InternalBufferType.IB32))
throw new FlaxException("Failed to download mesh data.");
return result;
diff --git a/Source/Engine/Utilities/MeshDataCache.cs b/Source/Engine/Utilities/MeshDataCache.cs
index 0978bdc40..c42b02865 100644
--- a/Source/Engine/Utilities/MeshDataCache.cs
+++ b/Source/Engine/Utilities/MeshDataCache.cs
@@ -20,7 +20,7 @@ namespace FlaxEngine.Utilities
///
/// The index buffer.
///
- public int[] IndexBuffer;
+ public uint[] IndexBuffer;
///
/// The vertex buffer.