"매 OpenGL ES 의 web — canvas 의 GPU draw". WebGL 매 OpenGL ES 2.0 (WebGL1) / ES 3.0 (WebGL2) binding 의 browser. 2026 매 WebGPU rising 매 WebGL 매 still ubiquitous — fallback / wide compatibility 의 사용.
constfbo=gl.createFramebuffer();gl.bindFramebuffer(gl.FRAMEBUFFER,fbo);consttex=gl.createTexture();gl.bindTexture(gl.TEXTURE_2D,tex);gl.texImage2D(gl.TEXTURE_2D,0,gl.RGBA16F,w,h,0,gl.RGBA,gl.HALF_FLOAT,null);gl.framebufferTexture2D(gl.FRAMEBUFFER,gl.COLOR_ATTACHMENT0,gl.TEXTURE_2D,tex,0);// 매 render → tex, then post-process
언제: cross-browser 3D / 2D GPU accel / data viz / WebGPU 의 fallback.
언제 X: heavy compute (no compute shader in WebGL) / cutting-edge graphics — WebGPU 사용.
❌ 안티패턴
State thrash: bind/unbind every draw — batch by program/texture.
Sync readback: readPixels 매 GPU stall — use PBO async (WebGL2).
No VAO: re-binding attributes every draw — VAO 매 cache.
Uniform per draw call: UBO 의 bulk update / instancing.
Premultiply confusion: alpha blending 의 incorrect — UNPACK_PREMULTIPLY_ALPHA_WEBGL.