Last active
February 17, 2021 10:40
-
-
Save gonnavis/6e1a58419e5835358122cb1526ece8e5 to your computer and use it in GitHub Desktop.
Revisions
-
gonnavis revised this gist
Feb 17, 2021 . 1 changed file with 9 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,14 @@ // http://glslsandbox.com/e#61476.1 float hash( float n ){ return fract(sin(n)*1751.5453); } float hash1( vec2 p ){ return fract(sin(p.x+131.1*p.y)*1751.5453); } vec3 hash3( float n ){ return fract(sin(vec3(n,n+1.0,n+2.0))*vec3(43758.5453123,22578.1459123,19642.3490423)); } vec3 random3(vec3 c) { -
gonnavis created this gist
Jan 29, 2021 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ vec3 hash3( float n ){ // http://glslsandbox.com/e#61476.1 return fract(sin(vec3(n,n+1.0,n+2.0))*vec3(43758.5453123,22578.1459123,19642.3490423)); } 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; }