Artifacts when loading a serialized scene

I exported an object using Blender. By importing the exported babylon file into the scene and assigning a PBR material with Albedo and Normal map the object appears correctly.

By serializing and reloading the serialized scene, the object has artifacts visible only if the normal map is applied. Is there any of you who can understand why?

In the playground Without Artifacts you can see the initial scene exported with Blender without any artifacts.

In the playground With artifacts you can see the loading of the serialized scene presenting artifacts.

I am also attaching the comparison images.

Any help is appreciated

@bghgary might be able to help as he solved some similar issues before.

The difference is that in the “ko” case the mesh has no vertex tangents: if you add scene.meshes[1].removeVerticesData("tangent"); in the PG that is ok, you will see it is not ok anymore.

1 Like

@Evgeni_Popov is right. The normal map is apparently in a different tangent space than what Babylon is generating in the shader. The tangent space must match the normal map in order to be completely artifact free. If the normal map and tangents are created by Blender, I believe they are MikkTSpace (though I can’t seem to confirm this by searching). If the tangents are not provided, Babylon does this.

1 Like

Hi guys and thanks for your answers,
I checked in the “ko” file and I noticed that tangents are present, but its property is called “tangets” instead of “tangents”. There seems to be a problem with the serialization of the geometry.
Trying to change the name to “tangents”, the artifacts disappear.


Thanks for the report, here’s the fix:

1 Like