Created
September 24, 2021 18:33
-
-
Save greggman/34267b546d2a4568efeb90aa202e4006 to your computer and use it in GitHub Desktop.
check WebGL_multi_draw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*bug-in-github-api-content-can-not-be-empty*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*bug-in-github-api-content-can-not-be-empty*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as twgl from 'https://twgljs.org/dist/4.x/twgl-full.module.js'; | |
const vs = `#version 300 es | |
#extension GL_ANGLE_multi_draw : require | |
uniform float foo; | |
uniform float moo; | |
void main() { | |
gl_Position = vec4(gl_DrawID, foo, moo, 1); | |
} | |
`; | |
const fs = `#version 300 es | |
precision highp float; | |
out vec4 outColor; | |
void main() | |
{ | |
outColor = vec4(0, 1, 0, 1); | |
}`; | |
const canvas = document.createElement('canvas'); | |
const gl = canvas.getContext('webgl2'); | |
const ext = gl.getExtension('WEBGL_multi_draw'); | |
const programInfo = twgl.createProgramInfo(gl, [vs, fs]); | |
console.log(programInfo); | |
console.log(gl.getError()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"name":"check WebGL_multi_draw","settings":{},"filenames":["index.html","index.css","index.js"]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment