mask: handle alpha channel too when inverting
This commit is contained in:
@@ -47,7 +47,7 @@ ShaderCode MaskDistortNode::GetShaderCode(const ShaderRequest &request) const
|
||||
} else if (request.id == QStringLiteral("feather")) {
|
||||
return ShaderCode(FileFunctions::ReadFileAsString(QStringLiteral(":/shaders/blur.frag")));
|
||||
} else if (request.id == QStringLiteral("invert")) {
|
||||
return ShaderCode(FileFunctions::ReadFileAsString(QStringLiteral(":/shaders/invertrgb.frag")));
|
||||
return ShaderCode(FileFunctions::ReadFileAsString(QStringLiteral(":/shaders/invertrgba.frag")));
|
||||
} else {
|
||||
return super::GetShaderCode(request);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
// Input texture
|
||||
uniform sampler2D tex_in;
|
||||
|
||||
// Input texture coordinate
|
||||
in vec2 ove_texcoord;
|
||||
out vec4 frag_color;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(tex_in, ove_texcoord);
|
||||
color = 1.0 - color;
|
||||
frag_color = color;
|
||||
}
|
||||
Reference in New Issue
Block a user