[orx-fx] convert to MPP
This commit is contained in:
31
orx-fx/src/shaders/glsl/blend/source-in.frag
Normal file
31
orx-fx/src/shaders/glsl/blend/source-in.frag
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifdef OR_IN_OUT
|
||||
in vec2 v_texCoord0;
|
||||
#else
|
||||
varying vec2 v_texCoord0;
|
||||
#endif
|
||||
|
||||
uniform sampler2D tex0;
|
||||
uniform sampler2D tex1;
|
||||
|
||||
#ifndef OR_GL_FRAGCOLOR
|
||||
out vec4 o_color;
|
||||
#endif
|
||||
|
||||
void main() {
|
||||
#ifndef OR_GL_TEXTURE2D
|
||||
vec4 src = texture(tex0, v_texCoord0);
|
||||
vec4 dest = texture(tex1, v_texCoord0);
|
||||
#else
|
||||
vec4 src = texture2D(tex0, v_texCoord0);
|
||||
vec4 dest = texture2D(tex1, v_texCoord0);
|
||||
#endif
|
||||
|
||||
float lboth = src.a * dest.a;
|
||||
vec4 result = src * lboth;
|
||||
|
||||
#ifdef OR_GL_FRAGCOLOR
|
||||
gl_FragColor = result;
|
||||
#else
|
||||
o_color = result;
|
||||
#endif
|
||||
}
|
||||
Reference in New Issue
Block a user