community. Just started playing with Monogame and stuck with a quite simple, but still unanswered issue, at least I couldn't find any answer.
The model rendered in Monogame (XNA) is not overlapping with its own parts:
Originally in Blender, it looks OK:

The same in Windows 3D Viewer:

I believe it depends on the order I'm rendering bones:
private void DrawModel(Model model, Matrix world, Matrix view, Matrix projection)
{
Matrix[] transforms = new Matrix[model.Bones.Count];
model.CopyAbsoluteBoneTransformsTo( transforms );
var fixBlenderRotation = Matrix.CreateRotationZ(MathHelper.ToRadians(90));
var scale = Matrix.CreateScale(0.1f);
//for (int i = model.Meshes.Count; i > 0; i--) // -> this looks OK
for (int i = 1; i <= model.Meshes.Count; i++) // -> this looks BAD
{
ModelMesh mesh = model.Meshes[i - 1];
foreach (var effect in mesh.Effects)
{
if (effect is BasicEffect basicEffect)
{
basicEffect.EnableDefaultLighting();
basicEffect.Alpha = 1;
basicEffect.View = view;
basicEffect.Projection = projection;
var boneTransform = transforms[mesh.ParentBone.Index];
basicEffect.World = (world * boneTransform * scale * Matrix.CreateTranslation(_modelPosition)) * fixBlenderRotation;
}
}
mesh.Draw();
}
}
Depth buffer is enabled:
protected override void Initialize()
{
_graphics.GraphicsDevice.DepthStencilState = DepthStencilState.Default;
_world = Matrix.CreateWorld(Vector3.Zero, Vector3.Forward, Vector3.Up);
var cameraPosition = new Vector3(_radius, 0, 0);
_camera = new FpsCamera(this, cameraPosition, Vector3.Zero, Vector3.Up);
Components.Add(_camera);
base.Initialize();
}
So, cannot figure out how other tools render my model correctly while monogame is messing things up? The hierarchy of objects in Blender is correct:

