Skip to content

Instantly share code, notes, and snippets.

@robertleeplummerjr
Created June 16, 2017 22:58
Show Gist options
  • Select an option

  • Save robertleeplummerjr/0bf90e3f84159ede043553bffb4ba2b9 to your computer and use it in GitHub Desktop.

Select an option

Save robertleeplummerjr/0bf90e3f84159ede043553bffb4ba2b9 to your computer and use it in GitHub Desktop.
const outputTextureName = `TEXTURE${ paramNames.length + i + 1 }`;
const subKernelOutputTexture = this.subKernelOutputTextures[i];
gl.activeTexture(gl[outputTextureName]);
gl.bindTexture(gl.TEXTURE_2D, subKernelOutputTexture);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
if (this.floatOutput) {
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, texSize[0], texSize[1], 0, gl.RGBA, gl.FLOAT, null);
} else {
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, texSize[0], texSize[1], 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
}
gl.framebufferTexture2D(gl.FRAMEBUFFER, this.extDrawBuffers[i], gl.TEXTURE_2D, this.subKernelOutputTextures[i], 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment