fixed alpha over algorithm and node recursion issue
This commit is contained in:
@@ -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";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user