Created
November 5, 2014 15:01
-
-
Save smukkejohan/826c93ca846f2e70773b to your computer and use it in GitHub Desktop.
Simple crossfade shader gl2 GLSL version 120
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
#version 120 | |
uniform sampler2DRect tex0; | |
uniform sampler2DRect tex1; | |
uniform vec2 aTexSize; | |
uniform vec2 bTexSize; | |
uniform float fadeToB; | |
varying vec2 texCoordVarying; | |
void main() | |
{ | |
vec4 a = texture2DRect(tex0, texCoordVarying * aTexSize); | |
vec4 b = texture2DRect(tex1, texCoordVarying * bTexSize); | |
vec4 color = vec4(1.0, 1.0, 1.0, 1.0); | |
color = mix(a, b, fadeToB); | |
gl_FragColor = color; | |
} |
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
#version 120 | |
varying vec2 texCoordVarying; | |
void main() | |
{ | |
texCoordVarying = gl_MultiTexCoord0.xy; | |
gl_Position = ftransform(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment