mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-05-27 22:00:23 -04:00
fixed bug
This commit is contained in:
parent
df3e5b31cd
commit
100238d232
@ -997,14 +997,9 @@ namespace Unity_Studio
|
|||||||
if (m_Mesh.m_Normals != null && m_Mesh.m_Normals.Length > 0)
|
if (m_Mesh.m_Normals != null && m_Mesh.m_Normals.Length > 0)
|
||||||
{
|
{
|
||||||
if (m_Mesh.m_Normals.Length == m_Mesh.m_VertexCount * 3)
|
if (m_Mesh.m_Normals.Length == m_Mesh.m_VertexCount * 3)
|
||||||
{
|
|
||||||
count = 3;
|
count = 3;
|
||||||
}
|
|
||||||
else if (m_Mesh.m_Normals.Length == m_Mesh.m_VertexCount * 4)
|
else if (m_Mesh.m_Normals.Length == m_Mesh.m_VertexCount * 4)
|
||||||
{
|
|
||||||
count = 4;
|
count = 4;
|
||||||
}
|
|
||||||
|
|
||||||
normalData = new Vector3[m_Mesh.m_VertexCount];
|
normalData = new Vector3[m_Mesh.m_VertexCount];
|
||||||
for (int n = 0; n < m_Mesh.m_VertexCount; n++)
|
for (int n = 0; n < m_Mesh.m_VertexCount; n++)
|
||||||
{
|
{
|
||||||
@ -1014,6 +1009,8 @@ namespace Unity_Studio
|
|||||||
m_Mesh.m_Normals[n * count + 2]);
|
m_Mesh.m_Normals[n * count + 2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
normalData = null;
|
||||||
#endregion
|
#endregion
|
||||||
#region Colors
|
#region Colors
|
||||||
if (m_Mesh.m_Colors == null)
|
if (m_Mesh.m_Colors == null)
|
||||||
@ -1738,7 +1735,7 @@ namespace Unity_Studio
|
|||||||
{
|
{
|
||||||
GL.GenBuffers(1, out vboAddress);
|
GL.GenBuffers(1, out vboAddress);
|
||||||
GL.BindBuffer(BufferTarget.ArrayBuffer, vboAddress);
|
GL.BindBuffer(BufferTarget.ArrayBuffer, vboAddress);
|
||||||
GL.BufferData<Vector3>(BufferTarget.ArrayBuffer,
|
GL.BufferData(BufferTarget.ArrayBuffer,
|
||||||
(IntPtr)(data.Length * Vector3.SizeInBytes),
|
(IntPtr)(data.Length * Vector3.SizeInBytes),
|
||||||
data,
|
data,
|
||||||
BufferUsageHint.StaticDraw);
|
BufferUsageHint.StaticDraw);
|
||||||
@ -1750,7 +1747,7 @@ namespace Unity_Studio
|
|||||||
{
|
{
|
||||||
GL.GenBuffers(1, out vboAddress);
|
GL.GenBuffers(1, out vboAddress);
|
||||||
GL.BindBuffer(BufferTarget.ArrayBuffer, vboAddress);
|
GL.BindBuffer(BufferTarget.ArrayBuffer, vboAddress);
|
||||||
GL.BufferData<Vector4>(BufferTarget.ArrayBuffer,
|
GL.BufferData(BufferTarget.ArrayBuffer,
|
||||||
(IntPtr)(data.Length * Vector4.SizeInBytes),
|
(IntPtr)(data.Length * Vector4.SizeInBytes),
|
||||||
data,
|
data,
|
||||||
BufferUsageHint.StaticDraw);
|
BufferUsageHint.StaticDraw);
|
||||||
@ -1781,7 +1778,8 @@ namespace Unity_Studio
|
|||||||
GL.GenVertexArrays(1, out vao);
|
GL.GenVertexArrays(1, out vao);
|
||||||
GL.BindVertexArray(vao);
|
GL.BindVertexArray(vao);
|
||||||
createVBO(out vboPositions, vertexData, attributeVertexPosition);
|
createVBO(out vboPositions, vertexData, attributeVertexPosition);
|
||||||
createVBO(out vboNormals, normalData, attributeNormalDirection);
|
if (normalData != null)
|
||||||
|
createVBO(out vboNormals, normalData, attributeNormalDirection);
|
||||||
createVBO(out vboColors, colorData, attributeVertexColor);
|
createVBO(out vboColors, colorData, attributeVertexColor);
|
||||||
createVBO(out vboViewMatrix, viewMatrixData, uniformViewMatrix);
|
createVBO(out vboViewMatrix, viewMatrixData, uniformViewMatrix);
|
||||||
createEBO(out eboElements, indiceData);
|
createEBO(out eboElements, indiceData);
|
||||||
|
Loading…
Reference in New Issue
Block a user