This is a simple heightmap exporter for Unity. It takes a PNG image and converts it in a raw file Unity can read.
First you need to download or clone this repository. Then:
- for linux you can build with g++:
g++ -o heightmapExporter heightmapExporter.cpp
(A pre-built version for linux is already given).
- for windows you can use Visual Studio or MinGW.
You can simply run in your shell:
./heightmapExporter "path/to/imageToConvert.png"
and the heightmap is stored in "terr.raw" file.
The picopng library is used in order to load the PNG images (see https://lodev.org/lodepng/picopng.cpp ).