Created
March 6, 2014 15:33
-
-
Save darrinhenein/9392277 to your computer and use it in GitHub Desktop.
RGB Split Shader
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
form sampler2D CC_Texture0; | |
varying vec2 v_texCoord; | |
uniform float u_displacement; | |
void main( ) { | |
vec4 color = texture2D( CC_Texture0, v_texCoord ); | |
vec2 DisplacementScroll = vec2(u_displacement, -u_displacement); | |
vec2 texCoord2 = v_texCoord + DisplacementScroll; | |
DisplacementScroll = vec2(-u_displacement, u_displacement); | |
vec2 texCoord3 = v_texCoord - DisplacementScroll; | |
vec4 color1 = texture2D(CC_Texture0, v_texCoord); | |
vec4 color2 = texture2D(CC_Texture0, texCoord2); | |
vec4 color3 = texture2D(CC_Texture0, texCoord3); | |
gl_FragColor = vec4(color1.r,color2.g,color3.b,1.0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment