mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-14 22:50:45 +00:00
Renormalize normals & tangents from dmap .glb import
This commit is contained in:
parent
0b677fe752
commit
d8aba3e850
1 changed files with 5 additions and 0 deletions
|
@ -164,6 +164,10 @@ MapPolygonMesh* MapPolygonMesh::ConvertFromMeshGltf( const gltfMesh_Primitive* p
|
|||
normal.z = vec.z;
|
||||
|
||||
normal *= transform;
|
||||
|
||||
// renormalize because previous transforms may contain scale operations
|
||||
normal.Normalize();
|
||||
|
||||
mesh->verts[i].SetNormal( normal );
|
||||
}
|
||||
|
||||
|
@ -208,6 +212,7 @@ MapPolygonMesh* MapPolygonMesh::ConvertFromMeshGltf( const gltfMesh_Primitive* p
|
|||
tangent.z = vec.z;
|
||||
|
||||
tangent *= transform;
|
||||
tangent.Normalize();
|
||||
|
||||
mesh->verts[i].SetTangent( tangent );
|
||||
mesh->verts[i].SetBiTangentSign( vec.w );
|
||||
|
|
Loading…
Reference in a new issue