implement glsl hack for corner pin

This commit is contained in:
itsmattkc
2022-03-04 15:46:08 -08:00
parent 780342881e
commit 63c807b902
3 changed files with 12 additions and 6 deletions
@@ -97,8 +97,18 @@ void CornerPinDistortNode::Value(const NodeValueRow &value, const NodeGlobals &g
ShaderCode CornerPinDistortNode::GetShaderCode(const QString &shader_id) const
{
Q_UNUSED(shader_id)
return ShaderCode(FileFunctions::ReadFileAsString(QStringLiteral(":/shaders/cornerpin.frag")),
FileFunctions::ReadFileAsString(QStringLiteral(":/shaders/cornerpin.vert")));
QString frag = FileFunctions::ReadFileAsString(QStringLiteral(":/shaders/cornerpin.frag"));
QString vert = FileFunctions::ReadFileAsString(QStringLiteral(":/shaders/cornerpin.vert"));
// HACK: No good, very bad hack
#ifndef Q_OS_MAC
frag.prepend(QStringLiteral("#version 130"));
vert.prepend(QStringLiteral("#version 130"));
#else
vert.prepend(QStringLiteral("#extension GL_EXT_gpu_shader4 : require"));
#endif
return ShaderCode(frag, vert);
}
QPointF CornerPinDistortNode::ValueToPixel(int value, const NodeValueRow& row, const QVector2D &resolution) const
-2
View File
@@ -1,5 +1,3 @@
#version 130
// Input texture
uniform sampler2D ove_maintex;
uniform sampler2D tex_in;
-2
View File
@@ -1,5 +1,3 @@
#version 130
uniform bool perspective_in;
uniform vec2 top_left_in;
uniform vec2 top_right_in;