Basic fragment shader for glshader

Michael Tyson michael at tyson.id.au
Sat Sep 13 21:17:31 PDT 2014


Hi folks,

I’m trying to assemble a pipeline that’ll apply an image distortion to suit the Oculus Rift. Happily,  one else has done the work, but there seem to be some compatibility issues I’m trying to address.

Having trouble even getting started though, not having any experience with shaders whatsoever, so I thought I’d ask: what’s the most basic operational ‘pass through’ fragment shader that’ll work with glshader?

I found the following test fragment shader in gst-libs/gst/gl/gstglshader.c, but this won’t compile ("Fragment shader uses a varying that has not been declared in the vertex shader”):

precision mediump float;
varying vec2 v_texCoord;
uniform sampler2D tex;
void main()
{
  gl_FragColor = texture2D( tex, v_texCoord );
}


Many thanks,
Michael


More information about the gstreamer-devel mailing list