- Initialize some variables in FModelVertex::Set

- Fix wrong normal vector in the FModelVertexBuffer constructor

This fixes models having strange flickering when the model animation frame changes
This commit is contained in:
nashmuhandes 2022-02-15 00:34:10 +08:00 committed by Rachael Alexanderson
parent 64ee08d80b
commit 396bac5e4f
2 changed files with 3 additions and 1 deletions

View File

@ -50,7 +50,7 @@ FModelVertexBuffer::FModelVertexBuffer(bool needindex, bool singleframe)
{ 1, VATTR_VERTEX2, VFmt_Float3, (int)myoffsetof(FModelVertex, x) },
{ 1, VATTR_NORMAL2, VFmt_Packed_A2R10G10B10, (int)myoffsetof(FModelVertex, packedNormal) }
};
mVertexBuffer->SetFormat(2, 5, sizeof(FModelVertex), format);
mVertexBuffer->SetFormat(2, 6, sizeof(FModelVertex), format);
}
//===========================================================================

View File

@ -17,6 +17,8 @@ struct FModelVertex
z = zz;
u = uu;
v = vv;
lu = 0.0f;
lv = 0.0f;
lindex = -1.0f;
}