Skip to content

Instantly share code, notes, and snippets.

View hug0hq's full-sized avatar
🔨

Hugo Costa hug0hq

🔨
View GitHub Profile
@hug0hq
hug0hq / GLSL-Noise.md
Created August 6, 2024 18:09 — forked from patriciogonzalezvivo/GLSL-Noise.md
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);
@hug0hq
hug0hq / GLSL-Math.md
Created November 17, 2022 16:55 — forked from patriciogonzalezvivo/GLSL-Math.md
GLSL Math functions

Trigonometry

const float PI = 3.1415926535897932384626433832795;
const float PI_2 = 1.57079632679489661923;
const float PI_4 = 0.785398163397448309616;

float PHI = (1.0+sqrtf(5.0))/2.0;

Keybase proof

I hereby claim:

  • I am hug0hq on github.
  • I am hug0 (https://keybase.io/hug0) on keybase.
  • I have a public key ASAuHBu5zqLzdcDG8aIap3o-Ng8zIgsgLfnG56IxhcFGHgo

To claim this, I am signing this object: