Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I downloaded this code sample and integrated it into my game

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

  0, 0,
share|improve this question

closed as off-topic by Josh Petrie Dec 18 '14 at 17:25

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about debugging a problem in your project must present a concise selection of code and context so as to allow a reader to diagnose the issue without needing to read all of your code or to engage in extensive back-and-forth dialog. For more information, see this meta thread." – Josh Petrie
If this question can be reworded to fit the rules in the help center, please edit the question.

Does your model have textures? It says TextureCoordinate0 is missing, that might mean that there is no texture or UV data in the model file. It is also possible that you are trying to use a file of a different version than that of what the program was designed for. – smoth190 Aug 14 '12 at 17:24
I have a Clouds style texture that blender generates. Im not useing an image based texture – FreakinaBox Aug 14 '12 at 17:57
I haven't done XNA in a few months but I remember having a similar issue. When you exported to fbx from blender, did you check the "Strict XNA" option? Also, try doing an unwrap on your model and then exporting. I know sometimes i had issues when it expected an unwrapped model but it didnt have the UV data – Mungoid Aug 14 '12 at 18:25
I think Mungoid is right. Make sure you have assigned UV-coordinates before exporting. You do know that your generated clouds texture will not be exported in the model, right? So you will still have to assign a texture with UV-coords if you are using a shader with texture coloring in XNA – Mikael Högström Aug 14 '12 at 19:32
Procedurally generated textures will not export as an image with the model by default. – ChrisC Aug 14 '12 at 21:56