Skip to content

Instantly share code, notes, and snippets.

View ggwzrd's full-sized avatar
👨‍🚀
Exploring galaxies

Giulio ggwzrd

👨‍🚀
Exploring galaxies
View GitHub Profile
@akella
akella / noise.glsl
Created June 19, 2022 07:43
noise.glsl
//
// GLSL textureless classic 3D noise "cnoise",
// with an RSL-style periodic variant "pnoise".
// Author: Stefan Gustavson ([email protected])
// Version: 2011-10-11
//
// Many thanks to Ian McEwan of Ashima Arts for the
// ideas for permutation and gradient selection.
//
// Copyright (c) 2011 Stefan Gustavson. All rights reserved.
vec2 rotate(vec2 v, float a) {
float s = sin(a);
float c = cos(a);
mat2 m = mat2(c, s, -s, c);
return m * v;
}