/usr/share/psychtoolbox-3/PsychOpenGL/PsychGLSLShaders/BasicSineGratingShader.vert.txt is in psychtoolbox-3-common 3.0.11.20140816.dfsg1-1.
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 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | /*
* File: BasicSineGratingShader.vert.txt
* Shader for drawing of basic parameterized sine grating patches.
*
* This is the vertex shader. It takes the attributes (parameters)
* provided by the Screen('DrawTexture(s)') command, performs some
* basic calculations on it - the calculations that only need to be
* done once per grating patch and that can be reliably carried out
* at sufficient numeric precision in a vertex shader - then it passes
* results of computations and other attributes as 'varying' parameters
* to the fragment shader.
*
* (c) 2007 by Mario Kleiner, licensed under MIT license.
*
*/
/* Constants that we need 2*pi: */
const float twopi = 2.0 * 3.141592654;
/* Conversion factor from degrees to radians: */
const float deg2rad = 3.141592654 / 180.0;
/* Constant from setup code: Premultiply to contrast value: */
uniform float contrastPreMultiplicator;
/* Attributes passed from Screen(): See the ProceduralShadingAPI.m file for infos: */
attribute vec4 modulateColor;
attribute vec4 auxParameters0;
/* Information passed to the fragment shader: Attributes and precalculated per patch constants: */
varying vec4 baseColor;
varying float Phase;
varying float FreqTwoPi;
void main()
{
/* Apply standard geometric transformations to patch: */
gl_Position = ftransform();
/* Don't pass real texture coordinates, but ones corrected for hardware offsets (-0.5,0.5) */
gl_TexCoord[0] = (gl_TextureMatrix[0] * gl_MultiTexCoord0) + vec4(-0.5, 0.5, 0.0, 0.0);
/* Contrast value is stored in auxParameters0[2]: */
float Contrast = auxParameters0[2];
/* Convert Phase from degrees to radians: */
Phase = deg2rad * auxParameters0[0];
/* Precalc a couple of per-patch constant parameters: */
FreqTwoPi = auxParameters0[1] * twopi;
/* Premultiply the wanted Contrast to the color: */
baseColor = modulateColor * Contrast * contrastPreMultiplicator;
}
|