All Projects → Xrayez → godot-anl

Xrayez / godot-anl

Licence: other
Accidental Noise Library in Godot Engine enhanced with visual noise editor

Programming Languages

C++
36643 projects - #6 most used programming language
python
139335 projects - #7 most used programming language
GDScript
375 projects
shell
77523 projects

Projects that are alternatives of or similar to godot-anl

sparksl-noise
minimum proof of concept about procedural noise generation in SparkAR's shader language (SparkSL).
Stars: ✭ 16 (-83.16%)
Mutual labels:  simplex-noise, value-noise, gradient-noise
godot-modules
A collection of community C++ modules for Godot Engine curated by the Goost project.
Stars: ✭ 37 (-61.05%)
Mutual labels:  godotengine, godot-module
SiVi
Simplex texture visualization tool
Stars: ✭ 20 (-78.95%)
Mutual labels:  simplex-noise, gradient-noise
godot-android-plugin-firebase
Godot 3.2.2 Android plugin for Firebase
Stars: ✭ 41 (-56.84%)
Mutual labels:  godotengine, godot-module
MySQL Module
MySQL connector to Godot Engine.
Stars: ✭ 30 (-68.42%)
Mutual labels:  godotengine, godot-module
godot-local-notification
Godot module for local notifications (android and iOS)
Stars: ✭ 111 (+16.84%)
Mutual labels:  godotengine, godot-module
godot box2d
A C++ module that integrates the Box2D library with the Godot game engine by providing nodes for standard Box2D objects.
Stars: ✭ 32 (-66.32%)
Mutual labels:  godotengine, godot-module
Procedural-Terrain-Generation
3D computer graphics program in C++ OpenFrameworks of a procedural terrain generator based on simplex noise with camera movement and real-time adjustable parameters from the GUI
Stars: ✭ 18 (-81.05%)
Mutual labels:  simplex-noise
godot-admob-editor
This repository is for Godot's Addons to integrate natively AdMob to your Game Project without much configurations, with a beautiful UI and directly inside Godot Editor!
Stars: ✭ 43 (-54.74%)
Mutual labels:  godotengine
godot-sugar
Experimental post-processing toolkit for Godot
Stars: ✭ 37 (-61.05%)
Mutual labels:  godotengine
Project-Map
No description or website provided.
Stars: ✭ 52 (-45.26%)
Mutual labels:  godotengine
GodotFAN
Facebook Audience Network Ad module for godot
Stars: ✭ 25 (-73.68%)
Mutual labels:  godot-module
godot-shader-to-image
A simple tool to render Image from Shader with Godot (Tested on 3.2)
Stars: ✭ 30 (-68.42%)
Mutual labels:  godotengine
debugconsole
A general-purpose debug console for the Godot Engine.
Stars: ✭ 24 (-74.74%)
Mutual labels:  godotengine
toziuha-night-oota
Opensource Metroidvania inspired on Castlevania Order of Ecclesia
Stars: ✭ 78 (-17.89%)
Mutual labels:  godotengine
Moonwards-Virtual-Moon
Development continues on Unreal, in the MoonwardsUE repository
Stars: ✭ 97 (+2.11%)
Mutual labels:  godotengine
vr-streaming-overlay
SteamVR overlay for streamers on Linux/Windows
Stars: ✭ 29 (-69.47%)
Mutual labels:  godotengine
godot-cpp-cmake
CMake scripts to build cross-platform GDNative C++ bindings
Stars: ✭ 20 (-78.95%)
Mutual labels:  godotengine
A-Key-s-Path
A short puzzle-platformer game made with Godot, running on GLES 2.0.
Stars: ✭ 146 (+53.68%)
Mutual labels:  godotengine
godot-ideas
Freely share and discuss ideas for Godot Engine core, module and plugin development
Stars: ✭ 27 (-71.58%)
Mutual labels:  godotengine

Accidental Noise Library in Godot Engine

🐧 Linux 🍎 macOS 🎨 Windows 🤖 Android 🍏 iOS 🌐 JavaScript

This is a wrapper for the Accidental Noise Library originally written by Joshua Tippetts, modified to be properly compiled for Godot Engine and be used freely in both GDScript and C#.

The master branch aims to be in sync with Godot's master branch. Checkout other branches and/or releases for compatible versions. You can decide which version you need based on the following compatibility table:

Compatibility table (ANL/Godot)

3.0 3.1 3.2 4.0
1.0 👍 👎 👎 👎
2.0 👎 👍 👎 👎
2.1 👎 👍 👍 🤞
2.2 👎 🤞

Note: the latests versions may not be released yet and are kept for reference, but expect them to be compatible.

Notable features:

  • generate height, normal and bump maps from noise directly;
  • ability to construct noise from visual nodes in editor and via code;
  • make custom modular noise as components from base nodes.

Visual Accidental Noise Workbench Visual Accidental Noise Normalmap

See wiki on how to get started creating noise with visual nodes.

Overview

The AccidentalNoise class encapsulates the two main classes required for noise generation: CKernel and CNoiseExecutor.

The kernel holds any amount of noise functions together creating compound noise function. The noise executor then evaluates the function chain at any point of the pipeline.

The library is full of features compared to other noise generation libraries with a drawback of poorer performance.

Compiling

If you'd like to try out or develop the module:

git clone https://github.com/Xrayez/godot-anl anl
scons

Note that scons will clone Godot Engine repository and compile the engine with the module for you. Make sure that the module's directory name is exactly anl. Once the compilation is done, the resulting binaries should be available under godot/bin directory.

If you'd like to compile the module the traditional way, please refer to Godot Engine: Compiling documentation.

Configuring the build

Extending the noise period

Noise functions will have a period of 256; with coordinates higher than that, the patterns will repeat. If a larger period is required, build with anl_use_expressions_camelcase command line option to use a long-period hash instead in exchange for a slight decrease in performance:

scons anl_use_long_period=yes

Expression naming convention

The original library uses camelCase to parse function tokens in an expression, yet the module uses snake_case to confirm to Godot's naming convention. If you still want to use camelCase style, build with anl_use_expressions_camelcase command line option:

scons anl_use_expressions_camelcase=yes

Usage examples

GDScript

Generating 2D landscape:

See landscape.gd.

Result

Simple 2D terrain

You can also map the noise to an image with dedicated method instead to simplify the above example:

image = noise.get_image(width, height)

... or even tiled texture!

noise.mode = AccidentalNoise.SEAMLESS_XY
texture = noise.get_texture(width, height)

Expression builder can be used to simplify the process of chaining functions together to one-liners:

var n = AccidentalNoise.new()

var expression = "translate(select(0, 1, (x + y), 0.5, 0), 10)"
var function = noise.evaluate(expression)
var value = noise.color_2d(x, y, function)

But please note that the expression builder feature is a work in progress as stated by original author. Some functions work, some don't and might crash the engine.

C#

See demo project: AnlTest.cs.

using Godot;
using System;

public class AnlTest : Godot.Node2D
{
	public override void _Ready()
	{
		AccidentalNoise an = new Godot.AccidentalNoise();
		AccidentalNoise.InterpolationTypes interp = AccidentalNoise.InterpolationTypes.Linear;
		int seed = 37;
		an.Function = an.GradientBasis(an.Constant((double)interp), an.Constant(seed));
		an.Function = an.Scale(an.Function, an.Constant(5.0));
		an.Mode = AccidentalNoise.MappingModes.Xy;
		ImageTexture noise = an.GetTexture(128, 128) as ImageTexture;
		GetNode<TextureRect>("Noise").Texture = noise;
	}
}

Programmable noise

It's possible to modify noise parameters via special noise variables which are like constant() but can be set and retrieved by name.

See random_noise.gd.

Result

Before After

Other examples

Texture synthesis

Water or Smoke? Stones with moss? Lapis lazuli?

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].