Skip to content

Instantly share code, notes, and snippets.

@vorg
Last active September 12, 2016 18:42
Show Gist options
  • Save vorg/d49eaaad758fcf0b57a9ef16422c331d to your computer and use it in GitHub Desktop.
Save vorg/d49eaaad758fcf0b57a9ef16422c331d to your computer and use it in GitHub Desktop.
FXStage.prototype.drawFullScreenQuadAt = function (x, y, width, height, image, program) {
var regl = this.regl
program = program || this.fullscreenQuad.program
if (!this.blitCmd) {
this.blitCmd = regl({
// depth: { enable: false },
// viewport: { x: x, y: y, width: width, height: height },
attributes: this.fullscreenQuad.attributes,
elements: this.fullscreenQuad.elements,
vert: regl.prop('vert'),
frag: regl.prop('frag'),
uniforms: {
image: regl.prop('image')
}
})
}
this.blitCmd({
vert: program.vert,
frag: program.frag,
image: image,
imageSize: [image.width, image.height]
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment