/usr/share/psychtoolbox-3/PsychOpenGL/PsychGLSLShaders/moglFDFTexturedDotsRenderShader.frag.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 | /* FDF shader for drawing 2D dots, applying a texture to them.
* The shader just implements standard texture mapping, the only
* speciality is that it mixes a constant settable color with the
* texels color, controlled by a mix weight.
*
* This to control the amount of object color information present in
* the 2D dot stimuli, kind of a SNR between dynamic and static form.
*
* (c) 2009 by Mario Kleiner, licensed under MIT license.
*/
uniform sampler2D Image;
uniform int doSmooth;
uniform float texWeight;
void main(void)
{
const float b = 0.1;
float r;
/* Read texel from texture: */
vec4 texel = texture2D(Image, gl_TexCoord[0].st);
/* Mix RGB colors between constant color and texel: */
gl_FragColor.rgb = mix(gl_Color.rgb, texel.rgb, texWeight);
/* Take alpha component from constant color: */
gl_FragColor.a = gl_Color.a;
if (doSmooth > 0) {
/* We adapt alpha value dependent on radius within a dot: */
/* This for point smoothing on GPU's that don't support this with shaders: */
/* 'b' controls smoothness of transition area, 0.5 is max radius at which */
/* point completely disappears, ie., alpha = 0. */
r = length(gl_TexCoord[1].st - vec2(0.5, 0.5));
gl_FragColor.a = gl_FragColor.a * smoothstep(r, r + b, 0.5);
}
}
|