File: ExpandingRingsShader.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 (39 lines) | stat: -rw-r--r-- 1,202 bytes parent folder | download | duplicates (7)
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
/* ExpandingRings shader
 * Draws a sequence of rings of alternating color. The center
 * of all rings is assigned in 'RingCenter' by the Matlab script,
 * width of a ring is assigned in 'RingWidth', the radius of the
 * outermost ring is assigned in 'Radius', a shift (scrolling offset)
 * is assigned in 'Shift'. See ExpandingRingsDemo.m for explanation.
 *
 *
 * Written 2007 by Mario Kleiner, licensed to you under MIT license.
 */

#version 110

/* Attributes passed from Screen(): See the ProceduralShadingAPI.m file for infos: */
attribute vec4 modulateColor;
attribute vec4 auxParameters0;
attribute vec4 auxParameters1;

varying float RingWidth;
varying float Radius;
varying float Shift;
varying vec4  firstColor;
varying vec4  secondColor;

void main()
{
    /* Apply standard geometric transformations to patch: */
    gl_Position = ftransform();
    gl_TexCoord[0] = gl_MultiTexCoord0;

    /* Pass first and second ring color to fragment shader: */
    firstColor  = modulateColor;
    secondColor = auxParameters0;

    /* Pass shift, ring width and radius to fragment shader: */
    Shift     = auxParameters1[0];
    RingWidth = auxParameters1[1];
    Radius    = auxParameters1[2];
}