by tarnith · 1y ago · 0 comments
A bit of an older article but still very relevant.
I've found with webGL2 you can also skip the whole upload/binding of the buffer and just emit the vertexes/coordinates from the vertex shader as well.
Less of an impact than cutting it down, but if you're just trying to get a a fragment going, why not use the least amount of data and CPU-> GPU upload possible.
ivec2 vert = ivec2(gl_VertexID & 1, gl_VertexID >> 1);
out_uv = 2.0 * vec2(vert);
gl_Position = vec4(out_uv * 2.0 - 1.0, 0.0, 1.0);