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 am generating vertices at runtime that represent terrain.

I've always drawn the vertices as triangles with GraphicsDevice.DrawUserPrimitives<VertexPositionColor>, but I'm wondering: Can vertices be converted into a "Model" so I could handle model and terrain rendering in a unified way?

This page is quite similar to what I am searching for.

I want to later port my game to Mono. Would this approach cause problems when using the Content Pipeline to convert the data?

share|improve this question
up vote 3 down vote accepted

The official answer from Shawn Hargreaves (one of the developers of XNA) is

The XNA Model class doesn't do any optimization at runtime: that all happens at build time inside the ModelProcessor. This is exactly why it is impossible to create a Model instance at runtime: the Model class depends on the processor to have optimized its data ready for rendering. If you are generating your data procedurally at runtime, there is no place for those optimizations to happen, so you're as well off just using your own standalone class.


I do not believe this behaviour has changed. But of course you can create a wrapper class yourselves so that you can handle a series of vertices and Models in a unified way.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.