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

Started by
16 comments, last by Igilima 20 years, 8 months ago
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]
Advertisement
heightmaps are generally hand drawn... so theres no reason to use more than 8bits. a 256bit grayscale is very detailed... 8bits = 0-255
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.
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..
Disclaimer: "I am in no way qualified to present advice on any topic concerning anything and can not be held responsible for any damages that my advice may incurr (due to neither my negligence nor yours)"
Shorts are usually fine (did BF1942 use this?) and you can easily add compression to the heights.
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
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!
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
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.
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.

This topic is closed to new replies.

Advertisement