gl-fbo-matching

1.0.0 • Public • Published

gl-fbo-matching experimental

Compare two gl-fbo instances' contents for matching pixels. There are certainly smarter ways of doing this but this is the simplest :)

Usage

NPM

channels = matching(fbo1, fbo2, [threshold])

Returns an array of values: one for each channel (RGBA). A value of 1 means that all of the pixels in fbo1 match those in fbo2, and a value of 0 means that none of them do.

Optionally, you can pass in a threshold value to limit the comparison's sensitivity – effectively, setting the maximum distance between two pixels' values before considering that pixel matching. Defaults to 0.

Note that using this function will result in gl.bindFramebuffer(gl.FRAMEBUFFER, null) being called.

License

MIT. See LICENSE.md for details.

Package Sidebar

Install

npm i gl-fbo-matching

Weekly Downloads

7

Version

1.0.0

License

MIT

Last publish

Collaborators

  • hughsk