/usr/share/psychtoolbox-3/PsychOpenGL/PsychGLSLShaders/moglFDFTrackingRenderShader.vert.txt is in psychtoolbox-3-common 3.0.11.20131230.dfsg1-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | /* FDF vertex shader for 2nd object render pass: Encodes texture coordinates
* into vertex position and transformed vertex position into texture coordinates.
*
* Normal vectors and color vectors are not assigned, as they are meaningless
* for this pure "geometry encoded in texture coords." render pass.
*
* (c) 2008 by Mario Kleiner, licensed under MIT license.
*/
uniform vec4 TextureOffsetBias;
uniform vec4 Viewport;
void main(void)
{
/* Position encodes 2D surface texture coordinate -> Position in our pseudo-texture: */
gl_Position.xy = (gl_TextureMatrix[0] * gl_MultiTexCoord0).st;
/* Need to remap to normalized range -1 to +1 so vertex clipping doesn't spoil our day: */
gl_Position.xy = ((gl_Position.xy - TextureOffsetBias.xy) * TextureOffsetBias.zw) - vec2(1.0, 1.0);
/* Set z to zero and w to 1, so automatic perspective division and clipping don't make trouble: */
gl_Position.zw = vec2(0.0, 1.0);
/* Actual vertex position is transformed via usual Modelview+Projection matrix etc. */
/* but then written to texture coordinate interpolators: */
/* Apply modelview+projection transform to input vertex, just as fixed pipeline would do: */
gl_TexCoord[0] = ftransform();
/* Perform perspective division by w-component manually to get normalized device coordinates: */
gl_TexCoord[0] = gl_TexCoord[0] / gl_TexCoord[0].w;
/* We do not clip against frustum -- assume our objects are within frustum and let scissor test */
/* handle corner cases, if any. */
/* We have to apply the viewport and depth range transform though... */
gl_TexCoord[0].xy = ((gl_TexCoord[0].xy + vec2(1.0, 1.0)) * Viewport.zw) + Viewport.xy;
/* Keep depth range fixed to a mapping into range 0 - 1: */
gl_TexCoord[0].z = (gl_TexCoord[0].z + 1.0) * 0.5;
}
|