script
element. For examples:
<script id="vertexShader0" type="x-shader/x-vertex"> attribute vec3 vert_position; void main() { gl_Position = vec4(vert_position, 1.0); } </script>or
<script id="fragmentShader0" type="x-shader/x-fragment"> precision highp float; void main() { gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0); } </script>The source code is written in GLSL. We'll worry about its details in the next exhibit.
program
),
you can use it with gl.useProgram(program)
.
gl.useProgram(null)
gl.getParameter(gl.CURRENT_PROGRAM)
program0
and program1
and using no single program.