mirror of
https://github.com/redstrate/Physis.git
synced 2025-04-23 05:07:46 +00:00
Normals are typically three half-width floats, not three full floats
This commit is contained in:
parent
195726b1d0
commit
287d807f01
1 changed files with 4 additions and 1 deletions
|
@ -380,7 +380,10 @@ impl MDL {
|
|||
vertices[k as usize].bone_id = <[u8; 4]>::read(&mut cursor).unwrap();
|
||||
}
|
||||
VertexUsage::Normal => {
|
||||
vertices[k as usize].normal = <[f32; 3]>::read(&mut cursor).unwrap();
|
||||
// TODO: normals are assumed to be half4
|
||||
vertices[k as usize].normal[0] = f16::from_bits(<u16 as BinRead>::read(&mut cursor).unwrap()).to_f32();
|
||||
vertices[k as usize].normal[1] = f16::from_bits(<u16 as BinRead>::read(&mut cursor).unwrap()).to_f32();
|
||||
vertices[k as usize].normal[2] = f16::from_bits(<u16 as BinRead>::read(&mut cursor).unwrap()).to_f32();
|
||||
}
|
||||
VertexUsage::UV => {
|
||||
vertices[k as usize].uv[0] = f16::from_bits(<u16 as BinRead>::read(&mut cursor).unwrap()).to_f32();
|
||||
|
|
Loading…
Add table
Reference in a new issue