This project aims to create a simple script for generating heightmaps in godot.
This godot script generates a heightmap image that can be used for 2D or 3d terrains in godot. This is performed using a translated version of the perlin noise algorithm.
The original implementation was written in Java : Noise2D
The script, whilst fully functional could use some performance tweaks to improve the loading time within the godot game enigne. However using a seperate thread and reducing the width/height of your output image will reduce the performance requirements.
Put this script somewhere in your godot project and instance the script, Once the script has been instanced create a variable to store the result of the script (the image texture):
var heighmapGeneratorScript=load("res://Scripts/heightmap-generator.gd").new()
var imagetexture = heighmapGeneratorScript
Once the heightmap image generated by the script is returned it can then be used to generate your mesh. read the instructions below on a simple way to add the heightmap to a meshInstance.
As this script only generates the heightmap i.e doesent apply the image to a terrain another script is required to apply the image to the terrain. I recommend TheHX's heightmap.gd script
A special thanks to the godot forum community for their performance suggestions.
Contributions to the script are always welcome, just submit a pull-request after reading the guideline: Guideline
Whilst the godot implementation is functional and complete, the CSharp version is currently a work in progress as such it currently only outputs a 2D array.