Skip to content

Instantly share code, notes, and snippets.

@mfandl
Created January 13, 2017 12:31
Show Gist options
  • Save mfandl/065d4d5773b52c8dda3e1846fa12f257 to your computer and use it in GitHub Desktop.
Save mfandl/065d4d5773b52c8dda3e1846fa12f257 to your computer and use it in GitHub Desktop.
texture webgl
const texture = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, texture);
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment