Skip to content

Instantly share code, notes, and snippets.

@kajott
kajott / bluenoise.c
Created June 26, 2019 10:49
Blue Noise texture generation using the void-and-cluster algorithm
#if 0 // self-compiling code
gcc -std=c99 -Wall -Wextra -pedantic -Werror -g -O4 -march=native $0 -lm || exit 1
exec time ./a.out
#endif
// Blue Noise texture generation using the void-and-cluster algorithm
// implemented by Martin Fiedler <keyj@emphy.de>
// using an algorithm description written by Alan Wolfe:
// https://blog.demofox.org/2019/06/25/generating-blue-noise-textures-with-void-and-cluster/
@syoyo
syoyo / gist:831c4b1926aa88c0da9221211723da2d
Created December 17, 2018 13:12
C++ implementaion of "A simple method to construct isotropic quasirandom blue noise point sequences"
//
// C++ implementaion of "A simple method to construct isotropic quasirandom blue
// noise point sequences"
//
// http://extremelearning.com.au/a-simple-method-to-construct-isotropic-quasirandom-blue-noise-point-sequences/
//
// Assume 0 <= x
static double myfmod(double x) { return x - std::floor(x); }
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active May 24, 2024 03:20
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);