1.6.3 • Published 11 months ago

@epok.tech/glsl-optical-flow v1.6.3

Weekly downloads
4
License
MIT
Repository
github
Last release
11 months ago

glsl-optical-flow

Optical flow advection demo

Optical flow shader for WebGL - BYORenderer.

No drawing dependencies - for easier compatibility with any renderer which may rely on tracking the WebGL state (e.g: regl).

Check out the demo.

Installation

Install from npm using:

npm install @epok.tech/glsl-optical-flow

or:

yarn add @epok.tech/glsl-optical-flow

Usage

Check out the demo, and its source code, a comprehensive example of blurring input, blending across frames, and advecting by the flow to get smooth optical-flow over time:

You may also use this in your shader...

precision highp float;

uniform sampler2D next;
uniform sampler2D past;
uniform float offset;
uniform float lambda;

varying vec2 uv;

#pragma glslify: opticalFlow = require(@epok.tech/glsl-optical-flow)

void main() {
  gl_FragColor = vec4(opticalFlow(uv, next, past, offset, lambda), 0.0, 1.0);
}

... or the provided fragment shader, for example, or for direct usage (with glslify).

See Also

Examples in the wild

Based on

1.6.3

11 months ago

1.6.2

11 months ago

1.6.1

11 months ago

1.6.0

11 months ago

1.5.8

3 years ago

1.5.6

4 years ago

1.2.0

4 years ago

1.5.5

4 years ago

1.5.4

4 years ago

1.3.6

4 years ago

1.5.3

4 years ago

1.3.5

4 years ago

1.5.2

4 years ago

1.3.4

4 years ago

1.5.1

4 years ago

1.4.2

4 years ago

1.3.3

4 years ago

1.5.0

4 years ago

1.4.1

4 years ago

1.3.2

4 years ago

1.4.0

4 years ago

1.2.2

4 years ago

1.3.0

4 years ago

1.2.1

4 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

6 years ago

1.1.0

6 years ago