Created
September 21, 2016 19:27
-
-
Save capnmidnight/5a2bbd05e63c3870aebd8921c03a50dc 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
vertexShader: | |
"varying vec2 vUv;\n\ | |
\n\ | |
void main() {\n\ | |
vUv = uv;\n\ | |
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\ | |
}", | |
fragmentShader: | |
"uniform float amount;\n\ | |
uniform sampler2D tDiffuse;\n\ | |
\n\ | |
varying vec2 vUv;\n\ | |
\n\ | |
void main() {\n\ | |
vec4 texel = texture2D( tDiffuse, vUv );\n\ | |
vec2 p = vUv - vec2(0.5, 0.5);\n\ | |
float scale = amount * min(1.0, 4.0 - pow(4.0 * dot(p, p), 2.0));\n\ | |
gl_FragColor = vec4(texel.xyz * scale, texel.w);\n\ | |
}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment