Skip to content

Instantly share code, notes, and snippets.

@kenjiSpecial
Created August 25, 2019 02:13
Show Gist options
  • Save kenjiSpecial/4c04eb4d8e2e826153bf286f5450032f to your computer and use it in GitHub Desktop.
Save kenjiSpecial/4c04eb4d8e2e826153bf286f5450032f to your computer and use it in GitHub Desktop.
rendering simple plane
gl.useProgram(program)
gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer());
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ -1,-1, 1,-1, -1, 1, 1, 1]), gl.STATIC_DRAW);
var positionLocation = gl.getAttribLocation(program, "position");
gl.enableVertexAttribArray(positionLocation);
gl.vertexAttribPointer(positionLocation, 2, gl.FLOAT, false, 0, 0);
gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment