Skip to content

sqrew/carp-noise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

carp-noise

A fast, seeded Simplex Noise implementation for the Carp programming language.

Features

  • Seeded Noise State: Independent noise generators that do not rely on global RNG state.
  • 2D & 3D Simplex Noise: Implementation based on the canonical Simplex algorithms.
  • Fractal Brownian Motion (FBM): Composable fractal noise with configurable octaves, persistence, and lacunarity.
  • Performance: Uses unsafe array access for hot paths and avoids allocations during sampling.

Installation

Clone this repository into your project or add it as a submodule:

git submodule add https://github.com/sqrew/carp-noise.git

Usage

(load "carp-noise/noise.carp")
(use Noise)

(defn main []
  (let [state (make-noise 12345)
        val (noise2d &state 0.5 0.5)]
    (IO.println &(Double.to-string val))))

Fractal Noise (FBM)

(let [state (make-noise 123)
      config (FBMConfig.init 6 0.5 2.0)
      val (fbm2d &state 0.1 0.2 &config)]
  (IO.println &(Double.to-string val)))

Testing

Run the test suite with:

carp -x test/noise_test.carp

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors