Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
1441746f
Commit
1441746f
authored
Dec 28, 2012
by
Adrien Maglo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[OpenGL] Make the GLSL shaders compatible with OpenGL ES 2.0
parent
198167d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
modules/video_output/opengl.c
modules/video_output/opengl.c
+13
-11
No files found.
modules/video_output/opengl.c
View file @
1441746f
...
...
@@ -191,7 +191,7 @@ static void BuildVertexShader(vout_display_opengl_t *vgl,
{
/* Basic vertex shader */
const
char
*
vertexShader
=
"#version 1
2
0
\n
"
"#version 1
0
0
\n
"
"varying vec4 TexCoord0,TexCoord1, TexCoord2;"
"attribute vec4 MultiTexCoord0,MultiTexCoord1,MultiTexCoord2;"
"attribute vec4 VertexPosition;"
...
...
@@ -234,16 +234,18 @@ static void BuildYUVFragmentShader(vout_display_opengl_t *vgl,
/* Basic linear YUV -> RGB conversion using bilinear interpolation */
const
char
*
template_glsl_yuv
=
"#version 120
\n
"
"uniform sampler2D Texture[3];"
"#version 100
\n
"
"uniform sampler2D Texture0;"
"uniform sampler2D Texture1;"
"uniform sampler2D Texture2;"
"uniform vec4 Coefficient[4];"
"varying vec4 TexCoord0,TexCoord1,TexCoord2;"
"void main(void) {"
" vec4 x,y,z,result;"
" x = texture2D(Texture
[0]
, TexCoord0.st);"
" %c = texture2D(Texture
[1]
, TexCoord1.st);"
" %c = texture2D(Texture
[2]
, TexCoord2.st);"
" x = texture2D(Texture
0
, TexCoord0.st);"
" %c = texture2D(Texture
1
, TexCoord1.st);"
" %c = texture2D(Texture
2
, TexCoord2.st);"
" result = x * Coefficient[0] + Coefficient[3];"
" result = (y * Coefficient[1]) + result;"
...
...
@@ -282,7 +284,7 @@ static void BuildRGBFragmentShader(vout_display_opengl_t *vgl,
{
// Simple shader for RGB
const
char
*
code
=
"#version 1
2
0
\n
"
"#version 1
0
0
\n
"
"uniform sampler2D Texture[3];"
"varying vec4 TexCoord0,TexCoord1,TexCoord2;"
"void main()"
...
...
@@ -299,7 +301,7 @@ static void BuildRGBAFragmentShader(vout_display_opengl_t *vgl,
{
// Simple shader for RGBA
const
char
*
code
=
"#version 1
2
0
\n
"
"#version 1
0
0
\n
"
"uniform sampler2D Texture;"
"uniform vec4 FillColor;"
"varying vec4 TexCoord0;"
...
...
@@ -781,9 +783,9 @@ static void DrawWithShaders(vout_display_opengl_t *vgl,
{
vgl
->
UseProgram
(
vgl
->
program
[
0
]);
vgl
->
Uniform4fv
(
vgl
->
GetUniformLocation
(
vgl
->
program
[
0
],
"Coefficient"
),
4
,
vgl
->
local_value
);
vgl
->
Uniform1i
(
vgl
->
GetUniformLocation
(
vgl
->
program
[
0
],
"Texture
[0]
"
),
0
);
vgl
->
Uniform1i
(
vgl
->
GetUniformLocation
(
vgl
->
program
[
0
],
"Texture
[1]
"
),
1
);
vgl
->
Uniform1i
(
vgl
->
GetUniformLocation
(
vgl
->
program
[
0
],
"Texture
[2]
"
),
2
);
vgl
->
Uniform1i
(
vgl
->
GetUniformLocation
(
vgl
->
program
[
0
],
"Texture
0
"
),
0
);
vgl
->
Uniform1i
(
vgl
->
GetUniformLocation
(
vgl
->
program
[
0
],
"Texture
1
"
),
1
);
vgl
->
Uniform1i
(
vgl
->
GetUniformLocation
(
vgl
->
program
[
0
],
"Texture
2
"
),
2
);
static
const
GLfloat
vertexCoord
[]
=
{
-
1
.
0
,
1
.
0
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment