Planetside Software Forums

General => Terragen Discussion => Topic started by: N-drju on May 20, 2018, 09:03:30 AM

Title: Grayscale terrain export
Post by: N-drju on May 20, 2018, 09:03:30 AM
How can I export a grayscale .bmp image of a TG terrain? Where do I find a relevant tool?

It would be great if the generated image is an 8-bit grayscale .bmp without any stupid approximations or artifacts that damn Photoshop always leaves behind...
Title: Re: Grayscale terrain export
Post by: Dune on May 20, 2018, 09:36:19 AM
You mean a heightmap? If you don't have overhangs, I'd make an ortho render with a gradient from low to high. You can save that even as 16-bit tiff, or just as 8-bit bmp.
Title: Re: Grayscale terrain export
Post by: N-drju on May 20, 2018, 10:19:17 AM
Yes, a heightmap.

The top view shot was my first thought too. But then, you have an atmosphere... and you have a sunlight. Both of which heavily influence colors beneath. ::)

I need "clean" blacks and whites so to say.


Scratch that. Actually it does not have an impact.
Title: Re: Grayscale terrain export
Post by: Dune on May 20, 2018, 10:58:45 AM
Turn of all lights and make the grayscale gradient in luminosity.
Title: Re: Grayscale terrain export
Post by: digitalguru on May 20, 2018, 02:27:42 PM
You can just plug a heightfield generate into your tree where you want to sample the heightmap, set number of points (pixels in the image) and the size of terrain to be sampled.

Hit Generate Now then right click on the node as Save as.. to Open Exr.

You've now got a map that can be used for displacement in most 3d apps.

If you load it into Photoshop it will invariably be completely white (unless you've rendered a flat terrain at sea level!) as all values will be over 1.

If you then convert to 8 bit it will normalize the image squeezing the low and high values into 0-1 range (or in Photoshop 8 bitness 0-255) and you'll see the contours of your terrain.

I'm not a Photoshop expert, but it looks like if you choose Equalise Histogram when you convert to an 8-bit image it will normalize the 32-bit image correctly.



Title: Re: Grayscale terrain export
Post by: Oshyan on May 20, 2018, 04:16:36 PM
To clarify, you need to plug the end of your shader network (that you want to convert into a Heightfield/Image output) to the *Shader* input of a Heightfield Generate. Then follow the rest of digitalguru's instructions.

- Oshyan
Title: Re: Grayscale terrain export
Post by: N-drju on May 21, 2018, 03:04:18 AM
Thanks guys. This is what I was looking for.