MythTV  master
Variables
mythrenderopenglshaders.h File Reference
#include <QString>
Include dependency graph for mythrenderopenglshaders.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Variables

static const QString kDefaultVertexShader
 
static const QString kDefaultFragmentShader
 
static const QString kDefaultFragmentShaderLimited
 
static const QString kSimpleVertexShader
 
static const QString kSimpleFragmentShader
 
static const QString kDrawVertexShader
 
static const QString kSDF
 
static const QString kRoundedRectShader
 
static const QString kRoundedEdgeShader
 

Variable Documentation

◆ kDefaultVertexShader

const QString kDefaultVertexShader
static
Initial value:
=
"attribute vec2 a_position;\n"
"attribute vec4 a_color;\n"
"attribute vec2 a_texcoord0;\n"
"varying vec4 v_color;\n"
"varying vec2 v_texcoord0;\n"
"uniform mat4 u_projection;\n"
"uniform mat4 u_transform;\n"
"void main() {\n"
" gl_Position = u_projection * u_transform * vec4(a_position, 0.0, 1.0);\n"
" v_texcoord0 = a_texcoord0;\n"
" v_color = a_color;\n"
"}\n"

Definition at line 6 of file mythrenderopenglshaders.h.

Referenced by MythRenderOpenGL::CreateDefaultShaders(), and MythRenderOpenGL::CreateShaderProgram().

◆ kDefaultFragmentShader

const QString kDefaultFragmentShader
static
Initial value:
=
"uniform sampler2D s_texture0;\n"
"varying highp vec4 v_color;\n"
"varying highp vec2 v_texcoord0;\n"
"void main(void)\n"
"{\n"
" gl_FragColor = texture2D(s_texture0, v_texcoord0) * v_color;\n"
"}\n"

Definition at line 20 of file mythrenderopenglshaders.h.

Referenced by MythRenderOpenGL::CreateDefaultShaders(), and MythRenderOpenGL::CreateShaderProgram().

◆ kDefaultFragmentShaderLimited

const QString kDefaultFragmentShaderLimited
static
Initial value:
=
"uniform sampler2D s_texture0;\n"
"varying highp vec4 v_color;\n"
"varying highp vec2 v_texcoord0;\n"
"void main(void)\n"
"{\n"
" gl_FragColor = (texture2D(s_texture0, v_texcoord0) * v_color * vec4(0.85882, 0.85882, 0.85882, 1.0)) + vec4(0.06274, 0.06274, 0.06274, 0.0);\n"
"}\n"

Definition at line 29 of file mythrenderopenglshaders.h.

Referenced by MythRenderOpenGL::CreateDefaultShaders().

◆ kSimpleVertexShader

const QString kSimpleVertexShader
static
Initial value:
=
"attribute vec2 a_position;\n"
"attribute vec4 a_color;\n"
"varying vec4 v_color;\n"
"uniform mat4 u_projection;\n"
"uniform mat4 u_transform;\n"
"void main() {\n"
" gl_Position = u_projection * u_transform * vec4(a_position, 0.0, 1.0);\n"
" v_color = a_color;\n"
"}\n"

Definition at line 38 of file mythrenderopenglshaders.h.

Referenced by MythRenderOpenGL::CreateDefaultShaders(), and MythVisualMonoScopeOpenGL::Initialise().

◆ kSimpleFragmentShader

const QString kSimpleFragmentShader
static
Initial value:
=
"varying highp vec4 v_color;\n"
"void main(void)\n"
"{\n"
" gl_FragColor = v_color;\n"
"}\n"

Definition at line 49 of file mythrenderopenglshaders.h.

Referenced by MythRenderOpenGL::CreateDefaultShaders(), and MythVisualMonoScopeOpenGL::Initialise().

◆ kDrawVertexShader

const QString kDrawVertexShader
static
Initial value:
=
"attribute vec2 a_position;\n"
"attribute vec4 a_color;\n"
"varying vec4 v_color;\n"
"varying vec2 v_position;\n"
"uniform mat4 u_projection;\n"
"uniform mat4 u_transform;\n"
"void main() {\n"
" gl_Position = u_projection * u_transform * vec4(a_position, 0.0, 1.0);\n"
" v_color = a_color;\n"
" v_position = a_position;\n"
"}\n"

Definition at line 56 of file mythrenderopenglshaders.h.

Referenced by MythRenderOpenGL::CreateDefaultShaders().

◆ kSDF

const QString kSDF
static
Initial value:
=
"highp float SignedDistance(highp vec2 p, highp vec2 b, highp float r)\n"
"{\n"
" return length(max(abs(p) - b + r, 0.0)) - r;"
"}\n"

Definition at line 69 of file mythrenderopenglshaders.h.

◆ kRoundedRectShader

const QString kRoundedRectShader
static
Initial value:
=
"varying highp vec4 v_color;\n"
"varying highp vec2 v_position;\n"
"uniform highp mat4 u_parameters;\n"
+ kSDF +
"void main(void)\n"
"{\n"
" highp float dist = SignedDistance(v_position - u_parameters[0].xy,\n"
" u_parameters[1].xy, u_parameters[0].z);\n"
" gl_FragColor = v_color * vec4(1.0, 1.0, 1.0, smoothstep(0.0, -1.0, dist));\n"
"}\n"

Definition at line 75 of file mythrenderopenglshaders.h.

Referenced by MythRenderOpenGL::CreateDefaultShaders().

◆ kRoundedEdgeShader

const QString kRoundedEdgeShader
static
Initial value:
=
"varying highp vec4 v_color;\n"
"varying highp vec2 v_position;\n"
"uniform highp mat4 u_parameters;\n"
+ kSDF +
"void main(void)\n"
"{\n"
" highp float outer = SignedDistance(v_position - u_parameters[0].xy,\n"
" u_parameters[1].xy, u_parameters[0].z);\n"
" highp float inner = SignedDistance(v_position - u_parameters[0].xy,\n"
" u_parameters[1].zw, u_parameters[0].w);\n"
" highp float both = smoothstep(0.0, -1.0, outer) * smoothstep(-1.0, 0.0, inner);\n"
" gl_FragColor = vec4(v_color.rgb, v_color.a * both);\n"
"}\n"

Definition at line 87 of file mythrenderopenglshaders.h.

Referenced by MythRenderOpenGL::CreateDefaultShaders().

kSDF
static const QString kSDF
Definition: mythrenderopenglshaders.h:69