1
votes

I'm working on a game in XNA, and i'm loading a model from blender. The model didn't have a texture until now, and when it tries to compile I get this error:

The mesh "", using BasicEffect, contains geometry that is missing texture coordinates for channel 0.

The model loaded before this point. I know I have to add the texture file in the same location as the .x file in my content, and I did that. The .x file contains the segment that references the texture.

   Material ShipMat {
       0.640000; 0.552144; 0.594688; 1.000000;;
       96.078431;
       0.500000; 0.500000; 0.500000;;
       0.000000; 0.000000; 0.000000;;
      TextureFilename {"shipTexture.jpg";}
    }

I'm using the add-on DirectX exporter for blender, because when I tried exporting my model as a .fbx it didn't load the texture and it was rotated in an odd direction. Any Ideas? Thanks in advance.

1

1 Answers

0
votes

For a texture to work, each model vertex needs texture coordinates.

Sounds like the model did not export from blender with a texture coordinate element for each vertex. Most likely, your model vertices only have position, color, & maybe normal elements only.

Just go back to blender, apply any old texture you want, then re-export it & swap out textures in Xna and you will get what you're expecting now.