1
/* BlurredMipmapDemoShader.vert.txt
2
* Shader used for BlurredMipmapDemo.m
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.
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.
11
* (C) 2012 Mario Kleiner - Licensed under MIT license.
15
/* Input from Screen('DrawTexture'): */
16
attribute vec4 auxParameters0;
18
/* Passed to fragment shader: */
19
varying vec2 gazePosition;
20
varying float gazeRadius;
21
varying vec4 baseColor;
25
/* Apply standard geometric transformations: */
26
gl_Position = ftransform();
28
/* Pass standard texture coordinates: */
29
gl_TexCoord[0] = gl_MultiTexCoord0;
31
/* Pass 'gazePosition' from first two auxParameters: */
32
gazePosition.xy = auxParameters0.xy;
34
/* Pass 'gazeRadius' from third auxParameters element: */
35
gazeRadius = auxParameters0[2];