Created
October 7, 2014 22:02
-
-
Save drewlustro/cb79dfa86d6adc19a928 to your computer and use it in GitHub Desktop.
This file contains 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
(function() { | |
define('shaders/ColorWheel.shader', [] , function () { | |
return { | |
uniforms: { | |
time: { type: 'f', value: 0.0 } | |
}, | |
fragmentShader: [ | |
"uniform float time;", | |
"varying vec2 vUv;", | |
"void main() {", | |
"vec2 position = -1.0 + 2.0 * vUv;", | |
"float red = abs(tan(position.x * position.y + time / 60.0));", | |
"float green = abs(tan(position.x * position.y + time / 20.0));", | |
"float blue = abs(tan(position.x * position.y + time / 5.0 ));", | |
"gl_FragColor = vec4(red, green, blue, 0.5);", | |
"}"].join("\n"), | |
vertexShader: [ | |
"uniform float time;", | |
"varying vec2 vUv;", | |
"void main() {", | |
"vUv = uv;", | |
"vec3 newPosition = position + normal * vec3(sin(time * 0.2) * 3.0);", | |
"gl_Position = projectionMatrix * modelViewMatrix * vec4(newPosition, 1.0);", | |
"}" | |
].join("\n") | |
}; | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment