Upgrade to OpenGL ES 3.2 (#1879)
* upgrade to opengl 3.2 * cornerpin: no need for hack * renderer: Update OCIO shader language to ES 3.0 Co-authored-by: Thomas Wilshaw <thomaswilshaw@gmail.com>
This commit is contained in:
co-authored by
Thomas Wilshaw
parent
cdf9efa7f6
commit
a4056d8454
@@ -97,18 +97,9 @@ void CornerPinDistortNode::Value(const NodeValueRow &value, const NodeGlobals &g
|
||||
ShaderCode CornerPinDistortNode::GetShaderCode(const QString &shader_id) const
|
||||
{
|
||||
Q_UNUSED(shader_id)
|
||||
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\n\n"));
|
||||
vert.prepend(QStringLiteral("#version 130\n\n"));
|
||||
#else
|
||||
vert.prepend(QStringLiteral("#extension GL_EXT_gpu_shader4 : require\n\n"));
|
||||
#endif
|
||||
|
||||
return ShaderCode(frag, vert);
|
||||
return ShaderCode(FileFunctions::ReadFileAsString(QStringLiteral(":/shaders/cornerpin.frag")),
|
||||
FileFunctions::ReadFileAsString(QStringLiteral(":/shaders/cornerpin.vert")));
|
||||
}
|
||||
|
||||
QPointF CornerPinDistortNode::ValueToPixel(int value, const NodeValueRow& row, const QVector2D &resolution) const
|
||||
|
||||
@@ -52,10 +52,10 @@ ShaderCode MathNodeBase::GetShaderCodeInternal(const QString &shader_id, const Q
|
||||
|
||||
vert = QStringLiteral("uniform mat4 %1;\n"
|
||||
"\n"
|
||||
"attribute vec4 a_position;\n"
|
||||
"attribute vec2 a_texcoord;\n"
|
||||
"in vec4 a_position;\n"
|
||||
"in vec2 a_texcoord;\n"
|
||||
"\n"
|
||||
"varying vec2 ove_texcoord;\n"
|
||||
"out vec2 ove_texcoord;\n"
|
||||
"\n"
|
||||
"void main() {\n"
|
||||
" gl_Position = %1 * a_position;\n"
|
||||
@@ -97,12 +97,13 @@ ShaderCode MathNodeBase::GetShaderCodeInternal(const QString &shader_id, const Q
|
||||
frag = QStringLiteral("uniform %1 %3;\n"
|
||||
"uniform %2 %4;\n"
|
||||
"\n"
|
||||
"varying vec2 ove_texcoord;\n"
|
||||
"in vec2 ove_texcoord;\n"
|
||||
"out vec4 frag_color;\n"
|
||||
"\n"
|
||||
"void main(void) {\n"
|
||||
" vec4 c = %5;\n"
|
||||
" c.a = clamp(c.a, 0.0, 1.0);\n" // Ensure alpha is between 0.0 and 1.0
|
||||
" gl_FragColor = c;\n"
|
||||
" frag_color = c;\n"
|
||||
"}\n").arg(GetShaderUniformType(type_a),
|
||||
GetShaderUniformType(type_b),
|
||||
param_a_in,
|
||||
|
||||
Reference in New Issue
Block a user