Jump to content
  • Advertisement
Sign in to follow this  
JamesLewis

Loading terrain / levels

This topic is 4145 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've created a level in a terrain editor, it consists of terrain with 3 different textures on it and a sky box. Now I want to load it into my game. I'm using XNA and I've found a game component for loading sky boxes so that was easy but I'm not sure how to go about loading the terrain. I could try exporting it as a model and then loading it in but I think the model would be massive. I'm a pretty competent programmer so I'm not bothered if I have to create a component to load the terrain, I'd just like to know what the best way to go about it is and if there's some theory someone can point me in the direction of for doing it. Cheers, James

Share this post


Link to post
Share on other sites
Advertisement
Well if the editor has an option to export the heightmap. You could just simply export the heightmap to a file, read in that heightmap and store the height values in a float array. Then you can build your index and vertex buffer from these values. As for the textures, if you can export them to one texture you could use that one texture to stretch over the whole terrain. If you can't export the textures into one, you can do some form of multi-texturing on the terrain in a shader.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!