cbrintnall / SoftNoise-GDScript-

GDScript function set generating noise (value noise, perlin noise, opensimplex(2d, 3d and 4d)...).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SoftNoise-GDScript-

GDScript function set generating noise (value noise, perlin noise, opensimplex(2d, 3d and 4d)...).

Example of how to use:

other_script.gd

extends Node

var preScript = preload("res://scripts/softnoise.gd")
var softnoise

func _ready():
	#Random
	softnoise = preScript.SoftNoise.new()
	#Passing a seed
	softnoise = preScript.SoftNoise.new(1729)
	
	softnoise.simple_noise1d(x)
	softnoise.simple_noise2d(x, y)
	
	softnoise.value_noise2d(x, y)
	softnoise.perlin_noise2d(x, y)
	
	softnoise.openSimplex2D(x, y)
	softnoise.openSimplex3D(x, y, z)
	softnoise.openSimplex4D(x, y, z, w)
	
	

Preview

Map generated using the perlin_noise2d() function.

SofNoise2D screenshot

Map generated using the openSimplex2D() function.

SofNoise2D screenshot

Important note

Be sure that your input values (x, y or z from the example above) are scaled by some sort of scalar value or use sqrt on them else you won't get a natural look on your maps.

About

GDScript function set generating noise (value noise, perlin noise, opensimplex(2d, 3d and 4d)...).

License:MIT License


Languages

Language:GDScript 100.0%