Jump to content
  • Advertisement
Sign in to follow this  
aliesky

Creating a terrain...?

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

Hello everybody, i want to create a terrain for a outside level(FPS) for use with OGRE or Irrlicht, no defined yet, but i have a big question in my head: which is the better method? In this moment i have to ways but both have pros and cons: 1- Create a Height map, is easy to create and i can get a very smooth terrain if i want, but if the terrain is too big then how can i can get a good performance and what happens with the texture size? 2- Using a mesh as terrain done in any 3D program, can i get smoothed version of this mesh in the engine without make a new model? Require more memory than the height map method? Extra questions: 1- Can i split the terrain in tiles for get more performance? 2- Exist a relation between height map size and texture size? Ex: for a height map = 256x256 -> a texture of 1024x1024. Please guys let me know the best way for you. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
I've never used OGRE or Irrlicht, so I'm not sure what types of stuff those engines support. I've written my own terrain engine. At first I used standard mesh models that I created in Blender. Later I switched to using heightmaps, which saves a lot of space on disk (I only needed to save a grayscale PNG instead of an entire model). My original models were essentially the same resolution (i.e. same number of triangles) as my heightmaps now are, so they took the same amount of space in RAM. With heightmaps, really you're only saving disk space.

I split my heightmap terrain into chunks of 64x64 "tiles" (i.e. triangle pairs), which improves rendering speed because I can cull non-visible chunks against the view frustum.

The relationship between heightmap and texture size is whatever you want it to be. There is no magic relationship, if that's what you're asking. If your terrain is very large, a single texture will end up looking blurry unless you turn on repeating. In my engine, I have a few non-repeating base textures, but also a repeating detail texture which alleviates the blurriness up close.

Share this post


Link to post
Share on other sites
strtok:

Then can i split my terrain in small tiles and load it all in the scene?? another question: exit a relationship between pixels and meters, i mean, a cube of 10x10x10 pixels how much meters are inside the engine??

I ask because i see in the landscape editors that the size are in pixels but which is the equivalent in meters for each pixel?

Share this post


Link to post
Share on other sites
Quote:
Original post by aliesky
strtok:

Then can i split my terrain in small tiles and load it all in the scene?? another question: exit a relationship between pixels and meters, i mean, a cube of 10x10x10 pixels how much meters are inside the engine??

I ask because i see in the landscape editors that the size are in pixels but which is the equivalent in meters for each pixel?


Yeah just divide you terrain up in smaller patches and render them.

As far as I know is there no no relation between the internal representation and meters. That is something you have to chose be your self. For instance that a distance of 10.0f is 1 meter, or something else. It all depends how you want your scale.

Share this post


Link to post
Share on other sites
Quote:
Original post by thallish
Quote:
Original post by aliesky
strtok:

Then can i split my terrain in small tiles and load it all in the scene?? another question: exit a relationship between pixels and meters, i mean, a cube of 10x10x10 pixels how much meters are inside the engine??

I ask because i see in the landscape editors that the size are in pixels but which is the equivalent in meters for each pixel?


Yeah just divide you terrain up in smaller patches and render them.

As far as I know is there no no relation between the internal representation and meters. That is something you have to chose be your self. For instance that a distance of 10.0f is 1 meter, or something else. It all depends how you want your scale.


Thanks by your answer, the last question for now: Exist any relation between # of faces and RAM used?

Share this post


Link to post
Share on other sites
Each face is made from three vertices (some faces can share vertices). More faces -> more vertices -> more memory/processing power, so yeah there is a direct correlation between number of faces and memory use.

Share this post


Link to post
Share on other sites
Quote:
Original post by thallish
Each face is made from three vertices (some faces can share vertices). More faces -> more vertices -> more memory/processing power, so yeah there is a direct correlation between number of faces and memory use.


Yes, but maybe my question don't was the best, i mean for example 1000 faces = 1 MB Ram, or depend it of the face size? of course I'm talking about a object without texture.

Share this post


Link to post
Share on other sites
Every vertex has an x, y, and z value. If you're using a height-map, the x and y values can be generated on the fly if you want to save memory. The actual amount of memory used depends how you're storing these vertex values. For example, a double precision floating point takes up twice as much memory as a floating point and a floating point takes up four times as much memory as a char. If you're using floats, the relationship should be Height * Width * sizeof(float).

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!