~ubuntu-branches/ubuntu/trusty/psychtoolbox-3/trusty-proposed

« back to all changes in this revision

Viewing changes to Psychtoolbox/PsychDemos/BlurredMipmapDemoShader.vert.txt

  • Committer: Package Import Robot
  • Author(s): Yaroslav Halchenko
  • Date: 2013-11-19 23:34:50 UTC
  • mfrom: (3.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20131119233450-f7nf92vb8qavjmk8
Tags: 3.0.11.20131017.dfsg1-3
Upload to unsable since fresh glew has arrived to sid!

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* BlurredMipmapDemoShader.vert.txt
 
2
 * Shader used for BlurredMipmapDemo.m
 
3
 *
 
4
 * This shader computes the level of resolution for each output texel
 
5
 * during Screen('DrawTexture') of the video image texture. Resolution
 
6
 * directly depends on radial distance to the provided simulated center of gaze.
 
7
 *
 
8
 * Resolution level is used to determine the mip-map miplevel (lod) to use for
 
9
 * lookup of the mip-map filtered texel in the images mipmap pyramid.
 
10
 *
 
11
 * (C) 2012 Mario Kleiner - Licensed under MIT license.
 
12
 *
 
13
 */
 
14
 
 
15
/* Input from Screen('DrawTexture'): */
 
16
attribute vec4 auxParameters0;
 
17
 
 
18
/* Passed to fragment shader: */
 
19
varying vec2  gazePosition;
 
20
varying float gazeRadius;
 
21
varying vec4  baseColor;
 
22
 
 
23
void main(void)
 
24
{
 
25
    /* Apply standard geometric transformations: */
 
26
    gl_Position = ftransform();
 
27
 
 
28
    /* Pass standard texture coordinates: */
 
29
    gl_TexCoord[0] = gl_MultiTexCoord0;
 
30
 
 
31
    /* Pass 'gazePosition' from first two auxParameters: */
 
32
    gazePosition.xy = auxParameters0.xy;
 
33
 
 
34
    /* Pass 'gazeRadius' from third auxParameters element: */
 
35
    gazeRadius = auxParameters0[2];
 
36
 
 
37
    /* Base color: */
 
38
    baseColor = gl_Color;
 
39
 
 
40
    return;
 
41
}