{"record":{"id":"582c32cb93078897","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-texture-582c32","errorCode":null,"errorMessage":"Failed to create WebGL texture","messagePattern":"Failed to create WebGL texture","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/burlap.ts","lineNumber":323,"sourceCode":"\tif (!vbo) {\n\t\tthrow new Error('Failed to create WebGL buffer');\n\t}\n\n\tgl.bindBuffer(gl.ARRAY_BUFFER, vbo);\n\tgl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);\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\n\tgl.bindVertexArray(null);\n\n\tconst texture = gl.createTexture();\n\tif (!texture) {\n\t\tthrow new Error('Failed to create WebGL texture');\n\t}\n\n\tgl.bindTexture(gl.TEXTURE_2D, texture);\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n\tgl.bindTexture(gl.TEXTURE_2D, null);\n\n\tconst colorCanvas = document.createElement('canvas');\n\tcolorCanvas.width = 1;\n\tcolorCanvas.height = 1;\n\tconst colorCtx = colorCanvas.getContext('2d', {willReadFrequently: true});\n\tif (!colorCtx) {\n\t\tthrow new Error('Failed to acquire 2D context for color parsing');\n\t}\n\n\treturn {","sourceCodeStart":305,"sourceCodeEnd":341,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/burlap.ts#L305-L341","documentation":"Thrown by setupBurlap when gl.createTexture() returns null while allocating the source texture used to upload frames into the burlap shader. createTexture() returns null for the same reasons as other GL object creators: lost context, exhausted GPU texture memory, or too many live textures. Without the texture the effect has nothing to sample, so setup aborts.","triggerScenarios":"setupBurlap() reaches gl.createTexture() at burlap.ts:321 after the VAO/VBO were built; the call returns null (context lost or GPU texture memory exhausted) and the guard at :322 throws.","commonSituations":"Large/many compositions consuming GPU texture memory, integrated GPUs with limited VRAM, software rendering (SwiftShader) under load, rendering at very high resolutions where prior textures were not freed, or a context-loss event between VBO and texture creation.","solutions":["Free WebGL resources from other effects/compositions before initializing burlap (call the effect cleanup paths).","Lower the composition resolution or reduce concurrent compositions to cut peak texture memory.","Enable GPU acceleration in the render environment (avoid --disable-gpu / pure software raster).","Handle 'webglcontextlost' on the canvas and re-run setupBurlap after 'webglcontextrestored'.","Update GPU drivers; verify the GPU is not blacklisted by the browser."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"function probeWebGL2(): boolean {\n  try {\n    const c = document.createElement('canvas');\n    const gl = c.getContext('webgl2');\n    return !!gl && !gl.isContextLost();\n  } catch {\n    return false;\n  }\n}\nif (!probeWebGL2()) skipOrFallback();","typeGuard":null,"tryCatchPattern":"try {\n  return <Burlap {...props} />;\n} catch (err) {\n  if (/Failed to create WebGL texture/.test(String(err))) return <FallbackFrame />;\n  throw err;\n}","preventionTips":["Tear down other effects' GL resources before initializing burlap to free texture memory.","Render at the lowest acceptable resolution to reduce per-texture VRAM.","Prefer GPU-accelerated rendering environments over software rasterizers.","Reuse a single composition/canvas rather than spinning up many."],"tags":["webgl","gpu","texture","effects","burlap","rendering"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}