Created
May 30, 2017 05:39
-
-
Save GunnarKarlsson/a65813d70625b9c8e64efc5f7966e334 to your computer and use it in GitHub Desktop.
GLSL random noise
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
// Author @patriciogv - 2015 | |
// http://patriciogonzalezvivo.com | |
#ifdef GL_ES | |
precision mediump float; | |
#endif | |
uniform vec2 u_resolution; | |
uniform vec2 u_mouse; | |
uniform float u_time; | |
float random (vec2 st) { | |
return fract(sin(dot(st.xy, | |
vec2(12.9898,78.233)))* | |
43758.5453123); | |
} | |
void main() { | |
vec2 st = gl_FragCoord.xy/u_resolution.xy; | |
float rnd = random( st ); | |
gl_FragColor = vec4(vec3(rnd),1.0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment