The Problem:
I have been making a model of a Steampunk-themed street light in Blender for use in my MonoGame/XNA Game. To test it I exported it to the *.fbx file format using the fbx export plugin for Blender.
After setting everything up in the code and starting the game, that was the result:
As you can see some of the triangles are missing or their vertices are connected in a wrong way. In addition to this you can recognise two additional faces on the top that were not intended to be there.
I am using a pretty standard code to render my model with a BasicEffect
:
foreach (ModelMesh mesh in model.Meshes)
{
foreach (ModelMeshPart part in mesh.MeshParts)
{
part.Effect = effect;
}
mesh.Draw();
}
What I tried so far to solve the issue:
- Searching on Stackexchange, no result
- Asking Google, no result
Playing arround with the
GraphicsDevice
settings was either not solving the problemgDevice.RasterizerState.CullMode = CullMode.None; gDevice.DepthStencilState = DepthStencilState.Default; gDevice.BlendState = BlendState.Opaque;
- Downloading the latest Blender version and exporting again did not solve anything despite the fbx plugin was updated
- I also suspected a problem with the normals so I recalculated them in Blender but it did not help too
What software/hardware did I use?
- Surface Pro 2 (intel core i5 with intel hd 4400 graphics)
- Blender 2.75a
- Visual Studio Express 2013
- MonoGame Framework(I believe its version 3.4)
So here are my questions:
What is causing this result? Could it be a problem with MonoGame/XNA or a problem with Blender/the fbx exporter (or my export settings?)?
Did maybe one of you had such issues with fbx models and MonoGame/XNA?
I would very appreciate any guesses, help or solutions from you. If you need more Information, just ask for it. Thanks in advance.
Step 4
in that site. The foreach statement is done a bit differently:foreach (ModelMesh mesh in myModel.Meshes)
. \$\endgroup\$