Force normalized normals
parent
0f4189c77e
commit
5e6cae3094
|
@ -708,6 +708,11 @@ void glTF2Exporter::ExportMeshes()
|
|||
if (v) p.attributes.position.push_back(v);
|
||||
|
||||
/******************** Normals ********************/
|
||||
// Normalize all normals as the validator can emit a warning otherwise
|
||||
for (auto i = 0u; i < aim->mNumVertices; ++i) {
|
||||
aim->mNormals[i].Normalize();
|
||||
}
|
||||
|
||||
Ref<Accessor> n = ExportData(*mAsset, meshId, b, aim->mNumVertices, aim->mNormals, AttribType::VEC3, AttribType::VEC3, ComponentType_FLOAT);
|
||||
if (n) p.attributes.normal.push_back(n);
|
||||
|
||||
|
|
Loading…
Reference in New Issue