Jump to content
  • Advertisement

Archived

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

Igilima

Practical to use greater than (8) bit depth (256 grayscale) heightmap for terrain?

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

From most of what I have read, I have gotten the impression that alot of people use 256bit grayscale images for their heightmaps. Is this really the case? If this is so, is there some reason people don't go with one that allows for more than 256? I'd like to get more than 256 heights to my terrain. I'm wanting to know if this is impractical and why before I go off and try it. [edited by - igilima on July 29, 2003 11:40:26 AM]

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
heightmaps are generally hand drawn... so theres no reason to use more than 8bits. a 256bit grayscale is very detailed... 8bits = 0-255

Share this post


Link to post
Share on other sites
Well, I''d like to have a little more range than 256. I might generate some of it by hand but I think for the scale I am looking for, I would go with a random procedural generation.

Share this post


Link to post
Share on other sites
I think the problem is that if you''re building a huge landscape.. the difference between a 1-byte value and a 4-byte value is the same as 64MB landscape against a 256MB landscape. If it''s small, it''s fine.. and you could just as easily use shorts.. though, that would double the size..

Share this post


Link to post
Share on other sites
Yeah the shorts will make the life A LOT easier.For example the low byte can be the height value and the hight byte can be some sort of a flag that tells something important for the segment.

"You losers better learn...NOONE CONTROLS OUR GOD DAMN LIFE!!!" - MANOWAR

Share this post


Link to post
Share on other sites
I think the reason 8bit values are used is because if you''re getting a heightmap from a paint program you only have the option to save greyscale as 16 or 256 levels of gray.

I''ve always held 256 height levels is very limited. In a big map you could easily have a difference of 100s of metres between highest and lowest points which implies your vertical resolution is only ~1m which sucks. Using 32bit ints or floats is memory hungry and almost certainly overkill so the easiest acceptable option is to use 16bit ints.

However I''ve found a better system in my engine. My landscape is broken into sections (if you use a quadtree this is forced on you anyway) and each section has a base height which can be as high precision as you want. Then the height values for vertices are given by adding the base height with an 8bit value from a local heightmap for that section. This gives great height resolution as well as good memory use. Using chunks of terrain like this with individual heightmaps also lets you optimise your map - the chunks don''t all have to be at the same detail level - one might be 32x32 vertices and another 4x4 which saves a lot of memory. Or you can even have sections of the map missing if you''re not going to go there - very handy for non-rectangular maps!

Share this post


Link to post
Share on other sites
quote:
Original post by d000hg
I think the reason 8bit values are used is because if you''re getting a heightmap from a paint program you only have the option to save greyscale as 16 or 256 levels of gray.



You''re wrong my friend.The paint programs are capable of saving the so called "grayscale-alpha" images.Which is exactly 16 bits per pixel.


"You losers better learn...NOONE CONTROLS OUR GOD DAMN LIFE!!!" - MANOWAR

Share this post


Link to post
Share on other sites
quote:
Original post by Mihail121
You''re wrong my friend.The paint programs are capable of saving the so called "grayscale-alpha" images.Which is exactly 16 bits per pixel.



true, but most paint program have each channel limited to 8 bits per channel, so even if you can save 16-bits per pixel, you cannot paint to it intuitively as you could to a single grayscale value. it isn''t about storing 16 bpp, its about painting it.

photoshop can do 16 bits/channel, but I would recommend using cinepaint (a gimp fork) which can handle a variety of bitdepths).

but painting heigthmap is akward imo, so I prefer to be able to alter the heightmaps interactively in 3D.

Share this post


Link to post
Share on other sites
I use 16 bit heightmaps, since 8 bit values simply do not give high enough resolution to represent more extreme real world altitude differances. But then, I usually don''t draw my heightmaps by hand, but instead use modified USGS data, which is provided in 32 bit float format.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!