Hi guys, i’ve made a heightmap tool,
The idea is simple, create a ground mesh, edit elevation as wanted, then generate a heightmap based on that elevation.
For continuous results, It’s important that the ground is created with exact same subdivisions, and size/height ratios.
- I have yet to add a “load from existing heightmap” option, but it will be added in the future.
- Default CreateGroundFromHeightMap functions only take one “subdivisions” parameter, so subdivisionsX and subdivisionsZ inputs at creation should be the same value.
Left btn: + / Add Value
Right btn: - / Subtract Value
Value: Elevation Value to apply. default: 1, current range from 0 - 5
Radius: Radius from mouse click to apply elevation. default: 1, current range from 0 - 5
None - self-explaining.
Soft - Add/Subtract preset elevation value (full value per mouse movement)
Hard - Set elevation directly to preset value
Smooth - Incrementally smooth towards preset value (0.1 units per mouse movement)
New HeightMap will prompt for you to input size, subdivisions, min/max y (height) and generate a mesh with this data.
Save HeightMap willl open a new tab with heightmap image,
Right-click & save for image file
To get base64 string, right-click & open image on new tab, URL in the new tab will be base64 string.
The image generated will be minimal and (should be) production-ready.
A 10x10 subdivisions ground will be 20*20 pixels.
The code can be found @ GitHub - aWeirdo/HeightMapGenerator: HeightMap generator made with BabylonJs