Helper module for point picking rendering passes
npm install gl-select
var createSelectBuffer = require("gl-select")
var select = createSelectBuffer(gl, shape)Creates a select buffer with the given shape
select.begin(x, y, radius)Begins a selection pass for finding the closest point in the buffer to x,y
x and y are the coordinates of the query point starting from the top-left of the screenradius is the radius in pixels to searchselect.end()Finishes the selection pass.
Returns An object whose properties encode the result of the closest point to the query point within radius, or null if no points are found. The properties of this object are:
coord A length 2 array representing the coordinates of the closest pixelid The 8 bit identifier of the closest pointvalue a 3 component vector storing the value of the selectiondistance The distance of the closest point to the selection pointselect.dispose()Destroys the selection buffer and releases all associated resources
select.shapeUpdates or retrieves the shape of the selection buffer.
(c) 2014 Mikola Lysenko. MIT License