Display a WebGL texture. Usefull to display the content of a fbo.
$ npm install --save @vaalentin/gl-texture-display
import TextureDisplay from '@vaalentin/gl-texture-display';
// set gl and texture
const display = new TextureDisplay(gl, texture);
// then in the render loop
display.render();
Create a new instance, where:
gl
is the WebGL context.texture
is a Texturewidth
(default0.25
),height
(default0.25
),left
(default0.75
) andtop
(default0
) are all normalized values (1
being fullscreen).
Render using the given unit
(default is 0
).
Delete instance. Let the texture
intact.
MIT, see LICENSE.md for more details.