{"record":{"id":"9789cfecee07b442","repo":"remotion-dev/remotion","slug":"failed-to-create-white-balance-vertex-buffer","errorCode":null,"errorMessage":"Failed to create white balance vertex buffer","messagePattern":"Failed to create white balance vertex buffer","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/white-balance.ts","lineNumber":202,"sourceCode":"\t\tpremultipliedAlpha: true,\n\t\talpha: true,\n\t\tpreserveDrawingBuffer: true,\n\t});\n\tif (!gl) {\n\t\tthrow createWebGL2ContextError('white balance effect');\n\t}\n\n\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n\n\tconst program = createProgram(gl);\n\tconst vao = gl.createVertexArray();\n\tif (!vao) {\n\t\tthrow new Error('Failed to create white balance vertex array');\n\t}\n\n\tconst vbo = gl.createBuffer();\n\tif (!vbo) {\n\t\tthrow new Error('Failed to create white balance vertex buffer');\n\t}\n\n\tgl.bindVertexArray(vao);\n\tgl.bindBuffer(gl.ARRAY_BUFFER, vbo);\n\tgl.bufferData(\n\t\tgl.ARRAY_BUFFER,\n\t\tnew Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, -1, 1, 0, 1, 1, 1, 1, 1]),\n\t\tgl.STATIC_DRAW,\n\t);\n\n\tconst aPos = gl.getAttribLocation(program, 'aPos');\n\tconst aUv = gl.getAttribLocation(program, 'aUv');\n\tgl.enableVertexAttribArray(aPos);\n\tgl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 16, 0);\n\tgl.enableVertexAttribArray(aUv);\n\tgl.vertexAttribPointer(aUv, 2, gl.FLOAT, false, 16, 8);\n\tgl.bindVertexArray(null);\n","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/white-balance.ts#L184-L220","documentation":"White balance setup creates a vertex buffer (gl.createBuffer) to upload the fullscreen-quad vertices that the shader draws. A null return from gl.createBuffer means the GL context refused to allocate another buffer object, and the effect aborts because it has no geometry to draw. This is a resource/context failure, independent of any effect parameter.","triggerScenarios":"First-frame setup of whiteBalance() when gl.createBuffer() returns null — context lost, buffer-object limit reached, or software-renderer WebGL2 with degraded allocation.","commonSituations":"Headless render farms without working GPU acceleration; long-running Studio sessions that leaked GL objects; multiple effects each opening their own context on a single page; VM/Remote-Desktop GPU forwarding that drops buffer allocation.","solutions":["Ensure the render browser has a working WebGL2 context that is not lost (probe getContext('webgl2') and isContextLost()).","Render with Remotion's bundled Chromium (Lambda/CLI) which enables the software GPU path correctly, instead of a system browser with GPU disabled.","Decrease concurrent WebGL contexts by rendering effects in fewer parallel compositions.","Recover from webglcontextlost by unmounting and re-mounting the composition so setup reinitializes.","Update or replace GPU drivers / backend where allocation fails."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const gl = document.createElement('canvas').getContext('webgl2');\nconst webglOk = gl != null && gl.createBuffer() != null && !gl.isContextLost();","typeGuard":"const canAllocateBuffer = (): boolean => {\n  const gl = document.createElement('canvas').getContext('webgl2');\n  return gl != null && !gl.isContextLost() && gl.createBuffer() != null;\n};","tryCatchPattern":"try {\n  return <VideoEffects effects={[whiteBalance({temperature: 0.1})]} />;\n} catch (err) {\n  if (err instanceof Error && /white balance vertex buffer/.test(err.message)) {\n    return <Video />;\n  }\n  throw err;\n}","preventionTips":["Probe WebGL2 buffer allocation before mounting effects.","Use Remotion's bundled Chromium for headless rendering.","Limit concurrent WebGL contexts.","Handle webglcontextlost by re-mounting."],"tags":["webgl","gpu","rendering","headless","context-loss"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}