Skip to content

Instantly share code, notes, and snippets.

@manoloide
Last active May 27, 2020 12:59
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save manoloide/1cf46a335512ab699992860ffec8eac7 to your computer and use it in GitHub Desktop.
Save manoloide/1cf46a335512ab699992860ffec8eac7 to your computer and use it in GitHub Desktop.
#ifdef GL_ES
precision mediump float;
precision mediump int;
#endif
varying vec4 vertColor;
varying vec3 vertNormal;
varying vec3 vertLightDir;
varying vec4 vertTexCoord;
float rand(vec2 co){
return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);
}
void main() {
vec4 color = vertColor;
color.a *= pow(rand(gl_FragCoord.xy*0.001), 0.4);
gl_FragColor = color;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment