Created
February 28, 2017 06:27
-
-
Save tai-fukaya/f09325cd5ff45c5de03e90db8deab196 to your computer and use it in GitHub Desktop.
2枚の画像を合成するシェーダー(上の画像に依存)
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 foreground; | |
varying vec2 texCoordVarying; | |
void main() | |
{ | |
vec4 bgtex = texture2DRect(tex0, texCoordVarying); | |
vec4 fgtex = texture2DRect(foreground, texCoordVarying); | |
gl_FragColor = bgtex * (1.0 - fgtex.a) + fgtex * fgtex.a; | |
} |
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