fixed alpha over algorithm and node recursion issue

This commit is contained in:
itsmattkc
2019-12-09 23:43:47 +11:00
parent 4bb874a154
commit 0448451bc2
+12 -5
View File
@@ -45,19 +45,26 @@ QString AlphaOverBlend::Description() const
return tr("A blending node that composites one texture over another using its alpha channel.");
}
QString AlphaOverBlend::Code() const
bool AlphaOverBlend::IsAccelerated() const
{
return true;
}
QString AlphaOverBlend::CodeFragment() const
{
return "#version 110"
"\n"
"varying vec2 v_texcoord;\n"
"varying vec2 ove_texcoord;\n"
"\n"
"uniform sampler2D base_in;\n"
"uniform sampler2D blend_in;\n"
"\n"
"void main(void) {\n"
" vec4 base_col = texture2D(base_in, v_texcoord);\n"
" vec4 blend_col = texture2D(blend_in, v_texcoord);\n"
" vec4 base_col = texture2D(base_in, ove_texcoord);\n"
" vec4 blend_col = texture2D(blend_in, ove_texcoord);\n"
" base_col *= 1.0 - blend_col.a;\n"
" base_col += blend_col;\n"
" \n"
" gl_FragColor = base_col - blend_col.a + blend_col;\n"
" gl_FragColor = base_col;\n"
"}\n";
}