Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

tuvd

Best Way To Store Terrain Verticies

This topic is 5478 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

ok i have written a program that scanes the pixels and lets u edit the different values for heights. now i want to load my heightmap with defenitions from the other prog, (already know how to do that), but how should i store verticies, is it good to use vertex and index buffers, or better to compile them in to a DXMesh Object, which is easier to add textures and perform changes to if there is a better way please let me know, thanx in advance.

Share this post


Link to post
Share on other sites
Advertisement
You should save them in same way as you`re loading them.
Since the loading is almost the same as initializing, the way how you initialized them is same as you should save them.
Generally, pick a way that loads and inits the terrain fastest as possible, since later on in a project you`ll have lots of other objects,textures,sounds to be loaded and in the end every second counts and you may end up loading the level for 20 seconds even on a 2GHz CPU. Therefore preprocess everything you need to with terrain, save it into the file - and it`s best if it`s saved in same way how it is organized in memory.

VladR
Avenger game

Share this post


Link to post
Share on other sites
so i should save it as an XObject, but my main problem is how the hell do i manipulate, certain areas of the map to add textures .

Share this post


Link to post
Share on other sites
Well, you should definitely search the nets & forums for Terrain Texturing. There are many ways how to do this. The most simple way is to have one big texture over the whole terrain and another as a detail texture using multitexturing.

VladR
Avenger game

Share this post


Link to post
Share on other sites
Go to www.gametutorials.com. In the OpenGL section (yeah, it''s in OpenGL but that''s life) look for the heightmap tutorials. They show examples of heightmapping (via a raw file), detail mapping, and some other stuff. They store it using height (actually it is calculated every frame but if you use your brain you can convert it to use vertex and index buffers).

Share this post


Link to post
Share on other sites

  • 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!