File: BlurredMipmapDemoShader.vert.txt

package info (click to toggle)
psychtoolbox-3 3.0.17.9.dfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 84,408 kB
  • sloc: ansic: 171,572; cpp: 20,885; objc: 5,164; sh: 1,878; python: 1,366; php: 384; makefile: 193; java: 113
file content (41 lines) | stat: -rw-r--r-- 1,157 bytes parent folder | download | duplicates (6)
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
/* BlurredMipmapDemoShader.vert.txt
 * Shader used for BlurredMipmapDemo.m
 *
 * This shader computes the level of resolution for each output texel
 * during Screen('DrawTexture') of the video image texture. Resolution
 * directly depends on radial distance to the provided simulated center of gaze.
 *
 * Resolution level is used to determine the mip-map miplevel (lod) to use for
 * lookup of the mip-map filtered texel in the images mipmap pyramid.
 *
 * (C) 2012 Mario Kleiner - Licensed under MIT license.
 *
 */

/* Input from Screen('DrawTexture'): */
attribute vec4 auxParameters0;

/* Passed to fragment shader: */
varying vec2  gazePosition;
varying float gazeRadius;
varying vec4  baseColor;

void main(void)
{
    /* Apply standard geometric transformations: */
    gl_Position = ftransform();

    /* Pass standard texture coordinates: */
    gl_TexCoord[0] = gl_MultiTexCoord0;

    /* Pass 'gazePosition' from first two auxParameters: */
    gazePosition.xy = auxParameters0.xy;

    /* Pass 'gazeRadius' from third auxParameters element: */
    gazeRadius = auxParameters0[2];

    /* Base color: */
    baseColor = gl_Color;

    return;
}