mask: handle alpha channel too when inverting

This commit is contained in:
itsmattkc
2023-03-20 10:27:30 -07:00
parent 2c2df99963
commit 5b40ac1548
2 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -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);
}
+12
View File
@@ -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;
}