Last active
August 22, 2023 06:02
-
-
Save kezzardrix/d3b172c944794ac32689b43a8e2e135e to your computer and use it in GitHub Desktop.
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
| float hash_sin(vec2 co){ | |
| return -1.+2.*fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453); | |
| } | |
| // no bug | |
| float hash_fract(vec2 p) | |
| { | |
| p = fract( p*0.3183099+.1 ); | |
| p *= 17.0; | |
| return -1.+2.*fract( p.x*p.y*(p.x+p.y) ); | |
| } | |
| https://www.shadertoy.com/view/4djSRW | |
| //0b5vr blog | |
| https://scrapbox.io/0b5vr/pcg3d | |
| uvec3 pcg3d(uvec3 v) { | |
| v = v * 1664525u + 1013904223u; | |
| v.x += v.y * v.z; | |
| v.y += v.z * v.x; | |
| v.z += v.x * v.y; | |
| v ^= v >> 16u; | |
| v.x += v.y * v.z; | |
| v.y += v.z * v.x; | |
| v.z += v.x * v.y; | |
| return v; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment