Giter VIP home page Giter VIP logo

simplexnoise's Introduction

Perlin Simplex Noise Rust Implementation (1D, 2D, 3D)

example workflow

Showcase

Simplex Noise 2D Simplex Noise 2D with fBm Simple Terrain Synthesis

Algorithms

Simplex Noise

It is a coherent noise function by Perlin which is the improvement to his Perlin Noise. The 3D version of it was patented and expired in 2022. The main idea is to have an n dimensional space is subdivided into simplices, which are made approximately uniform by means of a skew factor, with which interpolation is carried out. A hashed gradient is usually used for interpolation, which is implemented by a permutation table and a gradient table.

Fractional Brownian motion (fBm)

The summation of successive octaves of the noise is suitable for terrain synthesis, procedural clouds or other things.

  • Frequency - Width of pattern
  • Amplitude - Height of pattern
  • Lacunarity - Change of frequency in succesives octaves
  • Gain - Change of amplitude in succesives octaves

RNG (Linear congruential generator)

The simplex noise makes use of a permutation table, therefore I have implemented a simple linear congruential generator by using the formula, where N0 is the hash of the seed.

N+1 = (134775813 * (N + 1)) mod (2^32 -1)

About

This implementation is based on the C++ implementation by Sebastien Rombauts. This implementation does not guarantee a correct or complete implementation of the simplex noise algorithm nor is it a goal of this project. The aim is to create an efficient implementation of a noise algorithm that can be used in conjunction with other algorithms for practical purposes.

Features

  • 1D, 2D and 3D implementation of Simplex Noise.
  • Fractional Brownian Motion (fBm) with noise summation.
  • Seedable permutation table
  • Gradient lookup table

Wishlist

  • Implement 4D and a generic algorithm for any dim
  • Optimization

License

The source code is copyrighted by: Dan Häßler and Sebastien Rombauts and it is distributed under the terms of the MIT license.

Please see LICENSE file for details or copy at http://opensource.org/licenses/MIT.

simplexnoise's People

Contributors

dan-haessler avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.