XNA doesn't display texture of my own fbx model

Since I ran out of models while creating an XNA game, I tried to make my own. But there is a problem - when I make a .fbx model, adding a texture through blender, doing uv mapping, and then applying this model to my XNA project, everything works fine, but the texture does not appear. The only thing I see is a gray model. What can I do to fix this?

+4
source share
1 answer

Textures are not saved with the model file. You must separately download the texture:

var texture = Content.Load<Texture>("TextureName"); 

When the texture is loaded, you can bind it to the effect :

 basicEffect.TextureEnabled = true; basicEffect.Texture = texture; 
+6
source

All Articles