Skip to content

Instantly share code, notes, and snippets.

@guidoschmidt
Forked from manoloide/noiseShadowFrag.glsl
Created January 22, 2018 08:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guidoschmidt/0ae6755a85297a4720ffefe2d6d70975 to your computer and use it in GitHub Desktop.
Save guidoschmidt/0ae6755a85297a4720ffefe2d6d70975 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