Microsoft XNA code sample wont work with blender model
        Posted  
        
            by 
                FreakinaBox
            
        on Game Development
        
        See other posts from Game Development
        
            or by FreakinaBox
        
        
        
        Published on 2012-08-14T17:11:30Z
        Indexed on 
            2012/10/26
            17:22 UTC
        
        
        Read the original article
        Hit count: 273
        
I downloaded this code sample and integrated it into my game http://xbox.create.msdn.com/en-US/education/catalog/sample/mesh_instancing
It works with the model that they supplied, but throws and exception whenever I use one of my models.
The current vertex declaration does not include all the elements required by the current vertex shader. TextureCoordinate0 is missing.
I tried pluging my model into their original source code and same thing. My model is an fbx from blender and has a texture. This is the function that throws the error
GraphicsDevice.DrawInstancedPrimitives(
  PrimitiveType.TriangleList,
  0, 0,
  meshPart.NumVertices,
  meshPart.StartIndex, 
  meshPart.PrimitiveCount, 
  instances.Length
);
© Game Development or respective owner