This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- Credits to http://codepen.io/mikeambrosi/pen/JdEMmY --> | |
| <html> | |
| <head> | |
| <style> | |
| /* Run on https://autoprefixer.github.io/ to compile CSS */ | |
| .loading { | |
| position: absolute; | |
| top: 50%; | |
| left: 50%; | |
| margin: -15px 0 0 -15px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // because http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl is often down | |
| vec3 rgb2hsv(vec3 c) | |
| { | |
| vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); | |
| vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g)); | |
| vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r)); | |
| float d = q.x - min(q.w, q.y); | |
| float e = 1.0e-10; |
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
float rand(float n){return fract(sin(n) * 43758.5453123);}
float noise(float p){
float fl = floor(p);
float fc = fract(p);
NewerOlder