Greyscale = height in TG

Started by TheBadger, February 04, 2015, 01:54:05 AM

Previous topic - Next topic

TheBadger

A pixel is one meter. What is one percentage of a greyscale in height? if 0% and 100% are black and white?
When searching on line I found that there are programs people use to set up their scales for creating their own height maps. here is something http://www.realitymod.com/forum/f189-modding-tutorials/99495-understanding-heightmaps-how-paint-them-photoshop.html as an example.

Or do you have to also include the known height of the tallest part to calculate. So the tallest part of what I am doing is 100 meters above the default terrain. In this case 100% would be = 100 meters since I set the DisAmp to that, does that then make a %=1meter?

Dont think that I have ever read anything about this exactly so thought I should ask.
It has been eaten.

Ashley

This is basically a displacement, with values black = 0% to white = 100%
If your painting in photoshop 16bit is good but 8bit does work too.

Setting up an sss to displace to the height you are after will give you a reference to compare/tune your painted maps.

Alternatively if you have another 3d app like zbrush, you can extract an height field of a basic sculpt.   

TheBadger

#2
Quoteto compare/tune your painted maps.

Yes this is the reason I am asking! :) I hate going back and forth. Its a big pain in the ass. But I have pretty much done what you said.
So I know that the tallest part of my terrain is 100 meters. My problem is that I also have very fine transitions to make. And I am doing that (trying to do that) at real scale. So transitions from 0 (for example) to say 1-2 meters.

But I am so into the painting now I am trying to control that transition very finely. So between 0 and 1/2 meter there is a lot of (potential grey scale) not just a whole % but all of the fractions. And if in my OP example, a % is a meter, then I know where 5 feet is, 60 feet, 56.3 meters, so on. Since I am painting from some arial and ground photos, knowing for sure would really help me. I can paint slopes and levels pretty correctly then. And only have to check it in TG a few times rather than constantly. see?


Hmmm. I think I answered my own question...
If you import the image into TG, and set up the macro displacement, so black and white being 0 an 100%, and you set the displacement amplitude, then what ever the displacement amplitude is, that is the 100%, and the grey scale is a percentage of whatever that displacement amplitude is.

So in my case a % must = 1meter. And IF I used a different displacement value, than a % would = some other number.

Doesn't that sound right?

I think I see how people paint their own height maps now, I mean the super detailed ones that look like sat data.
It has been eaten.

Dune

I'd say a greyscale goes from 0 (black) to 256 (white), so if you make a grey of 128 and the top will be 100m hight, that 128 area will be 50m. And so on, interpolated.

TheBadger

#4
Are there only 250 shades of grey?... Ahh crap. I just check and you CANNOt put a .5 (or any fraction) in PS. SHit. That would have made this very easy.

No mater. I am going to sculpt this in MUd. But I wanted it close as heck in TG first. I do the same in MAya. Model as detailed as I can before sending to mud. But may not be so good for me here.

Crappy. Cause its not too easy to get height and slope right when sculpting either.
It has been eaten.

Tangled-Universe

There are only 50 shades of grey ;)

Dune


bobbystahr

Well this got me curious again as to the number of levels in a GS image so I asked Mr. Google and he said:

Grayscale is a range of monochromatic shades from black to white. Therefore, a grayscale image contains only shades of gray and no color.

While digital images can be saved as grayscale (or black and white) images, even color images contain grayscale information. This is because each pixel has a luminance value, regardless of its color. Luminance can also be described as brightness or intensity, which can be measured on a scale from black (zero intensity) to white (full intensity). Most image file formats support a minimum of 8-bit grayscale, which provides 2^8 or 256 levels of luminance per pixel. Some formats support 16-bit grayscale, which provides 2^16 or 65,536 levels of luminance.

how does this impact TheBadger's problem then as there seems to be some disagreement re: number of levels...
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

Dune

White is still white (255) and black is black (and beautiful), but the gradients are smoother. 128 grey is still 50m if 255 is 100m, IMO.

bobbystahr

something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

Ashley

#10
256 shades only for 8bit, for 16bit alot more :-)
I think you'll end up looking like 'Christopher Lloyd' from 'back to the future' if you don't simplify it to a % ;-)

I would of thought merging sss together would of given you a good base to start with.
However you can get very specific results by moving your terrain from external sculpting app back into TG.

If you really want to get into more 2D filter trickery in PS, look into the "highpass filter" it is possible to extract from rgb a heightfield.

You got mudbrush so choose life.  ;D

Edit:
Just to illustrate what I meant I've attached a clip. It shows 2 image maps, one at full range and the second after a highpass filter in PS.
The images where created by making a white circle in PS, blurring it over a black background. Then I used the highpass filter to essentially reduce its luminosity down by approx half.
I multiplied this back over the original.

So you could paint on the separate layer before multiplying back down but since height field are calculated top down in TG, you might need to add/merge these laterally along the normal.

Easier to just sculpt it and bring it back into TG  8)




Oshyan

This is why people use dedicated heightfield modelers, because trying to interpret grayscale values to heights in a normal image editor is challenging. You can do the math (and yes, I think your basic idea is sound), but it's a pain.

- Oshyan

TheBadger

Hey guys. It works. Pretty well for the most part.
Here are the real problems with it.

Stepping.
There is no fractions in PS. So the space between one value (% and another is a step) Blurring helps, but that in its self is a series of degrees. One thing that was interesting is that the gradient tool seems to have more degrees than the paint tool.

Eye strain.
When painting you have to get close. And values of grey only 1% different can get mixed up pretty easy.

But I did mange to do what I wanted. More or less.
And it did not take very long really, even though it is of a really complex terrain with many different Heights and terrain flow. I understood where to start and where to stop. And how to do it. So the painting part (other than the two things I mentioned) was kinda nice.

No, would not want to do this every day. But its good that I can now.

Would have been better if I had better source material though, thats for sure. In this case I only found one single high quality arial photo to use. And It was not the ideal photo to paint from if you only get one.

Anyway, its a good tool to be able to paint a really complex height map. I am sure of that at least.

It has been eaten.

engineer

Hello Badger

just a tipp: one of the best tools of PS for helping to paint heigt maps is the shading fill.
One can easily set several points to assign a particular value to a percentage.
Take a look at http://www.renderosity.com/mod/gallery/index.php?image_id=411747&username=engineer&page=8&member&np
which was created using this methode.

bobbystahr

Quote from: engineer on February 07, 2015, 03:59:48 PM
Hello Badger

just a tipp: one of the best tools of PS for helping to paint heigt maps is the shading fill.
One can easily set several points to assign a particular value to a percentage.
Take a look at http://www.renderosity.com/mod/gallery/index.php?image_id=411747&username=engineer&page=8&member&np
which was created using this methode.

I'd like to see this technique done in Terragen 3 for reference...pretty cool image for Classic Terragen...
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist