With the following code:
// where gl is WebGL2RenderingContext, but I tried WebGLRenderingContext as well.
gl.drawArrays(gl.POINTS, 0, points.length / 2);
#version 300 es
in vec2 position;
void main() {
gl_Position = vec4(position, 0.0, 1.0);
}
My canvas isn’t rendering any of the points
on the canvas whatsoever. However, when mode
, the first argument, is gl.LINES
, the interconnected points render just fine. I also noticed this issue only happens in hardware acceleration mode in browsers for certain GPUs—it worked fine on Linux but not on Windows.
How can I render the points correctly?