removed all dependence on NodeOutputs
If Nodes only have the one output, we don't need to do so much differentiation between them. Previous iteration used outputs as like a distinct function within a Node (e.g. length output would return one result, buffer output would produce a different result - each run different code to produce their results). Now in this iteration, it's more accurate to say a Node is just one function (which seems more appropriate for a node system anyway).
This commit is contained in:
@@ -45,23 +45,19 @@ QString AlphaOverBlend::Description() const
|
||||
return tr("A blending node that composites one texture over another using its alpha channel.");
|
||||
}
|
||||
|
||||
QString AlphaOverBlend::Code(NodeOutput *output) const
|
||||
QString AlphaOverBlend::Code() const
|
||||
{
|
||||
if (output == texture_output()) {
|
||||
return "#version 110"
|
||||
"\n"
|
||||
"varying vec2 v_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"
|
||||
" \n"
|
||||
" gl_FragColor = base_col - blend_col.a + blend_col;\n"
|
||||
"}\n";
|
||||
}
|
||||
|
||||
return Node::Code(output);
|
||||
return "#version 110"
|
||||
"\n"
|
||||
"varying vec2 v_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"
|
||||
" \n"
|
||||
" gl_FragColor = base_col - blend_col.a + blend_col;\n"
|
||||
"}\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user