1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-23 00:18:37 -05:00

OpenGL modernization: make shaders code compatible with OpenGL ES 2.0

This commit is contained in:
f4exb 2016-03-08 09:17:00 +01:00
parent dcbd61904c
commit f4f8c3d2f5
2 changed files with 8 additions and 8 deletions

View File

@ -103,8 +103,8 @@ void GLShaderSimple::cleanup()
}
const QString GLShaderSimple::m_vertexShaderSourceSimple = QString(
"uniform mat4 uMatrix;\n"
"attribute vec4 vertex;\n"
"uniform highp mat4 uMatrix;\n"
"attribute highp vec4 vertex;\n"
"void main() {\n"
" gl_Position = uMatrix * vertex;\n"
"}\n"

View File

@ -125,10 +125,10 @@ void GLShaderTextured::cleanup()
}
const QString GLShaderTextured::m_vertexShaderSourceTextured = QString(
"uniform mat4 uMatrix;\n"
"attribute vec4 vertex;\n"
"attribute vec2 texCoord;\n"
"varying vec2 texCoordVar;\n"
"uniform highp mat4 uMatrix;\n"
"attribute highp vec4 vertex;\n"
"attribute highp vec2 texCoord;\n"
"varying mediump vec2 texCoordVar;\n"
"void main() {\n"
" gl_Position = uMatrix * vertex;\n"
" texCoordVar = texCoord;\n"
@ -136,8 +136,8 @@ const QString GLShaderTextured::m_vertexShaderSourceTextured = QString(
);
const QString GLShaderTextured::m_fragmentShaderSourceTextured = QString(
"uniform sampler2D uTexture;\n"
"varying vec2 texCoordVar;\n"
"uniform lowp sampler2D uTexture;\n"
"varying mediump vec2 texCoordVar;\n"
"void main() {\n"
" gl_FragColor = texture2D(uTexture, texCoordVar);\n"
"}\n"