- Home /
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!
Answer by zachypin · Nov 17, 2011 at 08:43 PM
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.
Answer by DaveA · Nov 17, 2011 at 08:32 PM
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?
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.
Your answer
Follow this Question
Related Questions
Generate Terrain 2 Answers
Real 3D Terrain Help 0 Answers
Mesh to Terrain. 0 Answers
why heightmap flips in terrain import raw(certain case)? 0 Answers
Generate 16bit terrain map from real world elevation data 3 Answers