gl-fbo-matching
v1.0.0
Published
Compare two gl-fbo instances' contents for matching pixels.
Downloads
32
Maintainers
Readme
gl-fbo-matching
Compare two gl-fbo instances' contents for matching pixels. There are certainly smarter ways of doing this but this is the simplest :)
Usage
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.