[vlc-commits] Simplified a bit RGBA frament shader (opengl).
Laurent Aimar
git at videolan.org
Thu Dec 20 22:49:55 CET 2012
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Thu Dec 20 21:21:12 2012 +0100| [7373aed3b3daf760acdf3fd25508716a93d8cb2d] | committer: Laurent Aimar
Simplified a bit RGBA frament shader (opengl).
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7373aed3b3daf760acdf3fd25508716a93d8cb2d
---
modules/video_output/opengl.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/modules/video_output/opengl.c b/modules/video_output/opengl.c
index 25df6de..0c9eb69 100644
--- a/modules/video_output/opengl.c
+++ b/modules/video_output/opengl.c
@@ -319,12 +319,12 @@ static void BuildRGBAFragmentShader(vout_display_opengl_t *vgl,
// Simple shader for RGBA
const char *code =
"#version 120\n"
- "uniform sampler2D Texture[3];"
+ "uniform sampler2D Texture;"
"uniform vec4 FillColor;"
- "varying vec4 TexCoord0,TexCoord1,TexCoord2;"
+ "varying vec4 TexCoord0;"
"void main()"
"{ "
- " gl_FragColor = texture2D(Texture[0], TexCoord0.st)*FillColor;"
+ " gl_FragColor = texture2D(Texture, TexCoord0.st) * FillColor;"
"}";
*shader = vgl->CreateShader(GL_FRAGMENT_SHADER);
vgl->ShaderSource(*shader, 1, &code, NULL);
@@ -897,7 +897,7 @@ int vout_display_opengl_Display(vout_display_opengl_t *vgl,
DrawWithShaders(vgl, left, top ,right, bottom);
// Change the program for overlays
vgl->UseProgram(vgl->program[1]);
- vgl->Uniform1i(vgl->GetUniformLocation(vgl->program[1], "Texture[0]"), 0);
+ vgl->Uniform1i(vgl->GetUniformLocation(vgl->program[1], "Texture"), 0);
} else {
DrawWithoutShaders(vgl, left, top, right, bottom);
}
More information about the vlc-commits
mailing list