/* https://www.shadertoy.com/view/XsX3zB * * The MIT License * Copyright © 2013 Nikita Miropolskiy * * ( license has been changed from CCA-NC-SA 3.0 to MIT * * but thanks for attributing your source code when deriving from this sample * with a following link: https://www.shadertoy.com/view/XsX3zB ) * */ /* discontinuous pseudorandom uniformly distributed in [-0.5, +0.5]^3 */ vec3 random3(vec3 c) { float j = 4096.0*sin(dot(c,vec3(17.0, 59.4, 15.0))); vec3 r; r.z = fract(512.0*j); j *= .125; r.x = fract(512.0*j); j *= .125; r.y = fract(512.0*j); return r-0.5; } // https://godotshaders.com/snippet/random-value/ float random2(vec2 uv) { return fract(sin(dot(uv.xy, vec2(12.9898,78.233))) * 43758.5453123); }