/usr/share/psychtoolbox-3/PsychOpenGL/PsychGLSLShaders/BasicGaussBlobShader.frag.txt is in psychtoolbox-3-common 3.0.12.20160126.dfsg1-1ubuntu1.
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 | /*
* File: BasicGaussBlobShader.frag.txt
* Shader for drawing of basic parameterized Gaussian blob patches.
*
* This is the fragment shader. It gets the per-patch-constant
* parameters as varyings from the vertex shader and hardware
* interpolators, then performs per fragment calculations to
* compute and write the final pixel color.
*
* (c) 2014 by Mario Kleiner, licensed under MIT license.
*
*/
uniform vec4 Offset;
varying vec4 baseColor;
varying float Expmultiplier;
varying float Angle;
varying float GammaSquared;
void main()
{
/* Compute sine and cosine coefficients, based on rotation angle: */
/* Note that this is a constant for all fragments, but we can not do it in */
/* the vertex shader, because the vertex shader does not have sufficient */
/* numeric precision on some common hardware out there. */
float st = sin(Angle);
float ct = cos(Angle);
/* Query current output texel position wrt. to Center of Gabor: */
vec2 pos = gl_TexCoord[0].xy;
/* Compute x' and y' terms: */
float xdash = dot(vec2( ct, st), pos);
float ydash = dot(vec2(-st, ct), pos);
/* Compute exponential hull for the gauss blob: */
float ev = exp(((xdash * xdash) + (GammaSquared * ydash * ydash)) * Expmultiplier);
/* Multiply/Modulate base color and alpha with calculated gauss blob */
/* values, add some constant color/alpha Offset, assign as final fragment */
/* output color: */
gl_FragColor = (baseColor * ev) + Offset;
}
|