File: vertex_vispy.glsl

package info (click to toggle)
python-vispy 0.6.6-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 21,240 kB
  • sloc: python: 57,407; javascript: 6,810; makefile: 63; sh: 5
file content (26 lines) | stat: -rwxr-xr-x 726 bytes parent folder | download | duplicates (4)
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
// Jump flooding algorithm for EDT according
// to Danielsson (1980) and Guodong Rong (2007).
// Implementation by Stefan Gustavson 2010.
// This code is in the public domain.

// This code represents one iteration of the flood filling.
// You need to run it multiple times with different step
// lengths to perform a full distance transformation.

uniform float texw;
uniform float texh;
uniform float step;
attribute vec2 position;
attribute vec2 texcoord;
varying float stepu;
varying float stepv;
varying vec2 uv;

void main( void )
{
  // Get the texture coordinates
  uv = texcoord.xy;
  stepu = step / texw; // Saves a division in the fragment shader
  stepv = step / texh;
  gl_Position = vec4(position.xy, 0., 1.);
}