Remove deprecated asset data upgrades and old model vertex structures
This commit is contained in:
@@ -97,55 +97,6 @@ void MeshData::InitFromModelVertices(ModelVertex19* vertices, uint32 verticesCou
|
||||
}
|
||||
}
|
||||
|
||||
void MeshData::InitFromModelVertices(ModelVertex18* vertices, uint32 verticesCount)
|
||||
{
|
||||
Positions.Resize(verticesCount, false);
|
||||
UVs.Resize(verticesCount, false);
|
||||
Normals.Resize(verticesCount, false);
|
||||
Tangents.Resize(verticesCount, false);
|
||||
BitangentSigns.Resize(0);
|
||||
LightmapUVs.Resize(verticesCount, false);
|
||||
Colors.Resize(0);
|
||||
BlendIndices.Resize(0);
|
||||
BlendWeights.Resize(0);
|
||||
BlendShapes.Resize(0);
|
||||
|
||||
for (uint32 i = 0; i < verticesCount; i++)
|
||||
{
|
||||
Positions[i] = vertices->Position;
|
||||
UVs[i] = vertices->TexCoord.ToFloat2();
|
||||
Normals[i] = vertices->Normal.ToFloat3() * 2.0f - 1.0f;
|
||||
Tangents[i] = vertices->Tangent.ToFloat3() * 2.0f - 1.0f;
|
||||
LightmapUVs[i] = vertices->LightmapUVs.ToFloat2();
|
||||
|
||||
vertices++;
|
||||
}
|
||||
}
|
||||
|
||||
void MeshData::InitFromModelVertices(ModelVertex15* vertices, uint32 verticesCount)
|
||||
{
|
||||
Positions.Resize(verticesCount, false);
|
||||
UVs.Resize(verticesCount, false);
|
||||
Normals.Resize(verticesCount, false);
|
||||
Tangents.Resize(verticesCount, false);
|
||||
BitangentSigns.Resize(0);
|
||||
LightmapUVs.Resize(0);
|
||||
Colors.Resize(0);
|
||||
BlendIndices.Resize(0);
|
||||
BlendWeights.Resize(0);
|
||||
BlendShapes.Resize(0);
|
||||
|
||||
for (uint32 i = 0; i < verticesCount; i++)
|
||||
{
|
||||
Positions[i] = vertices->Position;
|
||||
UVs[i] = vertices->TexCoord.ToFloat2();
|
||||
Normals[i] = vertices->Normal.ToFloat3() * 2.0f - 1.0f;
|
||||
Tangents[i] = vertices->Tangent.ToFloat3() * 2.0f - 1.0f;
|
||||
|
||||
vertices++;
|
||||
}
|
||||
}
|
||||
|
||||
void MeshData::InitFromModelVertices(VB0ElementType18* vb0, VB1ElementType18* vb1, uint32 verticesCount)
|
||||
{
|
||||
Positions.Resize(verticesCount, false);
|
||||
@@ -210,31 +161,6 @@ void MeshData::InitFromModelVertices(VB0ElementType18* vb0, VB1ElementType18* vb
|
||||
}
|
||||
}
|
||||
|
||||
void MeshData::InitFromModelVertices(VB0ElementType15* vb0, VB1ElementType15* vb1, uint32 verticesCount)
|
||||
{
|
||||
Positions.Resize(verticesCount, false);
|
||||
UVs.Resize(verticesCount, false);
|
||||
Normals.Resize(verticesCount, false);
|
||||
Tangents.Resize(verticesCount, false);
|
||||
BitangentSigns.Resize(0);
|
||||
LightmapUVs.Resize(0, false);
|
||||
Colors.Resize(0);
|
||||
BlendIndices.Resize(0);
|
||||
BlendWeights.Resize(0);
|
||||
BlendShapes.Resize(0);
|
||||
|
||||
for (uint32 i = 0; i < verticesCount; i++)
|
||||
{
|
||||
Positions[i] = vb0->Position;
|
||||
UVs[i] = vb1->TexCoord.ToFloat2();
|
||||
Normals[i] = vb1->Normal.ToFloat3() * 2.0f - 1.0f;
|
||||
Tangents[i] = vb1->Tangent.ToFloat3() * 2.0f - 1.0f;
|
||||
|
||||
vb0++;
|
||||
vb1++;
|
||||
}
|
||||
}
|
||||
|
||||
void MeshData::SetIndexBuffer(void* data, uint32 indicesCount)
|
||||
{
|
||||
bool use16BitIndexBuffer = indicesCount <= MAX_uint16;
|
||||
@@ -339,19 +265,6 @@ bool MeshData::Pack2Model(WriteStream* stream) const
|
||||
vb1.Tangent = Float1010102(tangent * 0.5f + 0.5f, static_cast<byte>(bitangentSign < 0 ? 1 : 0));
|
||||
vb1.LightmapUVs = Half2(lightmapUV);
|
||||
stream->WriteBytes(&vb1, sizeof(vb1));
|
||||
|
||||
// Pack TBN matrix into a quaternion
|
||||
/*Quaternion quaternionTBN;
|
||||
bool invertedHandednessTBN;
|
||||
CalculateQuaternionFromTBN(tangent, bitangent, normal, &quaternionTBN, &invertedHandednessTBN);
|
||||
quaternionTBN.Normalize();
|
||||
uint32 packedQuaternionTBN = QuantizeNormalizedQuaternionWithHandedness(quaternionTBN, invertedHandednessTBN);
|
||||
|
||||
Float4 unpackedQuaternionTBN = Float4(quaternionTBN.X, quaternionTBN.Y, quaternionTBN.Z, ((invertedHandednessTBN ? 0.0f : 128.0f) + (127.0f * (quaternionTBN.W * 0.5f + 0.5f))) / 255.0f);
|
||||
|
||||
//lods.WriteUint32(packedQuaternionTBN);
|
||||
//lods.WriteFloat4(unpackedQuaternionTBN);
|
||||
*/
|
||||
}
|
||||
|
||||
// Vertex Buffer 2
|
||||
|
||||
@@ -149,22 +149,6 @@ public:
|
||||
/// <param name="verticesCount">Amount of vertices</param>
|
||||
void InitFromModelVertices(ModelVertex19* vertices, uint32 verticesCount);
|
||||
|
||||
/// <summary>
|
||||
/// Init from model vertices array
|
||||
/// [Deprecated on 28.04.2023, expires on 01.01.2024]
|
||||
/// </summary>
|
||||
/// <param name="vertices">Array of vertices</param>
|
||||
/// <param name="verticesCount">Amount of vertices</param>
|
||||
void InitFromModelVertices(ModelVertex18* vertices, uint32 verticesCount);
|
||||
|
||||
/// <summary>
|
||||
/// Init from model vertices array
|
||||
/// [Deprecated on 28.04.2023, expires on 01.01.2024]
|
||||
/// </summary>
|
||||
/// <param name="vertices">Array of vertices</param>
|
||||
/// <param name="verticesCount">Amount of vertices</param>
|
||||
void InitFromModelVertices(ModelVertex15* vertices, uint32 verticesCount);
|
||||
|
||||
/// <summary>
|
||||
/// Init from model vertices array
|
||||
/// </summary>
|
||||
@@ -182,15 +166,6 @@ public:
|
||||
/// <param name="verticesCount">Amount of vertices</param>
|
||||
void InitFromModelVertices(VB0ElementType18* vb0, VB1ElementType18* vb1, VB2ElementType18* vb2, uint32 verticesCount);
|
||||
|
||||
/// <summary>
|
||||
/// Init from model vertices array
|
||||
/// [Deprecated on 28.04.2023, expires on 01.01.2024]
|
||||
/// </summary>
|
||||
/// <param name="vb0">Array of data for vertex buffer 0</param>
|
||||
/// <param name="vb1">Array of data for vertex buffer 1</param>
|
||||
/// <param name="verticesCount">Amount of vertices</param>
|
||||
void InitFromModelVertices(VB0ElementType15* vb0, VB1ElementType15* vb1, uint32 verticesCount);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the index buffer data.
|
||||
/// </summary>
|
||||
|
||||
@@ -70,25 +70,6 @@ enum class MeshBufferType
|
||||
};
|
||||
|
||||
// Vertex structure for all models (versioned)
|
||||
// [Deprecated on 28.04.2023, expires on 01.01.2024]
|
||||
PACK_STRUCT(struct ModelVertex15
|
||||
{
|
||||
Float3 Position;
|
||||
Half2 TexCoord;
|
||||
Float1010102 Normal;
|
||||
Float1010102 Tangent;
|
||||
});
|
||||
|
||||
// [Deprecated on 28.04.2023, expires on 01.01.2024]
|
||||
PACK_STRUCT(struct ModelVertex18
|
||||
{
|
||||
Float3 Position;
|
||||
Half2 TexCoord;
|
||||
Float1010102 Normal;
|
||||
Float1010102 Tangent;
|
||||
Half2 LightmapUVs;
|
||||
});
|
||||
|
||||
// [Deprecated in v1.10]
|
||||
PACK_STRUCT(struct ModelVertex19
|
||||
{
|
||||
@@ -116,19 +97,6 @@ struct RawModelVertex
|
||||
};
|
||||
|
||||
// For vertex data we use three buffers: one with positions, one with other attributes, and one with colors
|
||||
// [Deprecated on 28.04.2023, expires on 01.01.2024]
|
||||
PACK_STRUCT(struct VB0ElementType15
|
||||
{
|
||||
Float3 Position;
|
||||
});
|
||||
// [Deprecated on 28.04.2023, expires on 01.01.2024]
|
||||
PACK_STRUCT(struct VB1ElementType15
|
||||
{
|
||||
Half2 TexCoord;
|
||||
Float1010102 Normal;
|
||||
Float1010102 Tangent;
|
||||
});
|
||||
|
||||
// [Deprecated in v1.10]
|
||||
PACK_STRUCT(struct VB0ElementType18
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user