From 85feb6d6f251ea21cab83723c99fd99c30004485 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Tue, 8 Nov 2016 13:35:33 +1100 Subject: [PATCH] glfiltershader: expand the docs slightly Add an example OpenGL shader --- ext/gl/gstglfiltershader.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/ext/gl/gstglfiltershader.c b/ext/gl/gstglfiltershader.c index bff3c44368..f3434690b4 100644 --- a/ext/gl/gstglfiltershader.c +++ b/ext/gl/gstglfiltershader.c @@ -29,7 +29,28 @@ * |[ * gst-launch-1.0 videotestsrc ! glupload ! glshader fragment="\"`cat myshader.frag`\"" ! glimagesink * ]| - * FBO (Frame Buffer Object) and GLSL (OpenGL Shading Language) are required. A #version header is required + * FBO (Frame Buffer Object) and GLSL (OpenGL Shading Language) are required. + * Depending on the exact OpenGL version chosen and the exact requirements of + * the OpenGL implementation, a #version header may be required. + * + * The following is a simple OpenGL ES (also usable with OpenGL 3 core contexts) + * passthrough shader with the required inputs. + * |[ + * #version 100 + * #ifdef GL_ES + * precision mediump float; + * #endif + * varying vec2 v_texcoord; + * uniform sampler2D tex; + * uniform float time; + * uniform float width; + * uniform float height; + * + * void main () { + * gl_FragColor = texture2D( tex, v_texcoord ); + * } + * ]| + * * */ #ifdef HAVE_CONFIG_H