x


Convert RGB heightmap to greyscale

Hi, I've grabbed a raw file from an OpenSim world and opened it up in Photoshop. I've noticed that the heightmap opens up in RGB format, and Unity only works with greyscale. Anyone know of a way to convert the raw file to greyscale? Thanks!

more ▼

asked Nov 17 '11 at 08:02 PM

zachypin gravatar image

zachypin
71 35 38 38

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

Alright so I've got it. Use this: http://dubaron.com/terrainconvert/ and it will solve all your problems. When you import the heightmap Unity will get all the numbers done for you so you can just click "okay".

Note: when I initially opened up the raw file from OpenSim in Photoshop it came out as a greyscale, but it was obviously wrong. When you open it up you need to make sure to set the size correctly, set 13 channels, and base 0 bytes. Oh and make sure to save it as Non-Interleaved.

more ▼

answered Nov 17 '11 at 08:43 PM

zachypin gravatar image

zachypin
71 35 38 38

(comments are locked)
10|3000 characters needed characters left

What do you want to do?

You could take the max of r,g,b at each pixel, or just use one channel, or use one of the rgb->gray formulas (google them), but these are usually about converting a color image to a gray image.

Shaders like Parallax use Heightmaps which are just 8 bits, but may be in the Alpha channel.

Heightmaps for terrains are usually 16-bit or float.

Is the image you have encoded in some way? Maybe you can post it. In other words, is it 16 or float spread across into the r,g,b components? Or some other kind of color-coded height?

more ▼

answered Nov 17 '11 at 08:32 PM

DaveA gravatar image

DaveA
26.5k 151 171 256

It was actually 8 bit. I could open it up directly in Photoshop so it wasn't encoded. I just needed it in a format Unity understands. Unity doesn't like RGB heightmaps.

Nov 17 '11 at 08:45 PM zachypin
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1478
x226
x14
x12
x12

asked: Nov 17 '11 at 08:02 PM

Seen: 2141 times

Last Updated: Nov 17 '11 at 08:45 PM