Mesh built with BuildFromMeshDescriptions is always generating normals

I’m generating a mesh using BuildFromMeshDescriptions, and I’m passing the vertex instances normals and tangents using SetInstanceTangentSpace, however when the mesh is generated it calculated it’s own normals and tangents instead of using the ones I pass in. Is there anyway to use the ones I specify instead?

If I use bFastBuild = true, then it uses my normals, but it doesn’t seem to generate nanite geometry even though it appears enabled.

I ended up figuring it out by digging into the engine source a bit. Turns out by default recompute normals and tangents are on. The way to turn them off is by modifying the source model like so:

	FStaticMeshSourceModel& sourceModel= staticMesh->GetSourceModel(0);
	sourceModel.BuildSettings.bRecomputeNormals = false;
	sourceModel.BuildSettings.bRecomputeTangents = false;

For those to apply you have to build the static mesh as well (or restart the editor as I found out and was confused by for awhile lol)

	staticMesh->Build();

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.