/usr/share/psychtoolbox-3/PsychOpenGL/PsychGLSLShaders/TextureWarpShader.frag.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 | /* Shader for warping/distortion of textures during drawing.
* This shader is meant for image distortion/warping. It is used by
* the high-level routine AddImageWarpToGLOperator.m
*
* The shader is meant for blitting a texture to the framebuffer. It
* perturbs the texture lookup coordinates by some 2D offset, which it
* reads from a distortion/warpmap bound to the "WarpMap" sampler.
*
* (w)2007 by Mario Kleiner. Licensed under MIT license.
*/
#extension GL_ARB_texture_rectangle : enable
uniform sampler2DRect Image;
uniform sampler2DRect WarpMap;
void main()
{
/* Get wanted texture coordinate for which we should perform lookup: */
vec2 texinpos = gl_TexCoord[0].st;
/* Retrieve texture lookup 2D offset from red and green channels of WarpMap: */
vec2 delta = texture2DRect(WarpMap, texinpos).rg;
/* Perform perturbed lookup in source image texture and */
/* assign result as output fragment color: */
gl_FragColor = texture2DRect(Image, texinpos + delta);
}
|