{"record":{"id":"4370d79ef2747cba","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-texture-4370d7","errorCode":null,"errorMessage":"Failed to create WebGL texture","messagePattern":"Failed to create WebGL texture","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/effects/src/zoom-blur/zoom-blur-runtime.ts","lineNumber":80,"sourceCode":"};\n\nconst createProgram = (\n\tgl: WebGL2RenderingContext,\n\tvertexSource: string,\n\tfragmentSource: string,\n): WebGLProgram => {\n\tconst vs = compileShader(gl, gl.VERTEX_SHADER, vertexSource);\n\tconst fs = compileShader(gl, gl.FRAGMENT_SHADER, fragmentSource);\n\tconst program = linkProgram(gl, vs, fs);\n\tgl.deleteShader(vs);\n\tgl.deleteShader(fs);\n\treturn program;\n};\n\nconst createRgbaTexture = (gl: WebGL2RenderingContext): WebGLTexture => {\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_MIN_FILTER, gl.LINEAR);\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\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.bindTexture(gl.TEXTURE_2D, null);\n\treturn texture;\n};\n\nexport const setupZoomBlur = (target: HTMLCanvasElement): ZoomBlurState => {\n\tconst gl = target.getContext('webgl2', {\n\t\tpremultipliedAlpha: true,\n\t\talpha: true,\n\t\tpreserveDrawingBuffer: true,\n\t});\n\tif (!gl) {","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/zoom-blur/zoom-blur-runtime.ts#L62-L98","documentation":"During zoomBlur setup, `gl.createTexture()` returned `null`, meaning the GPU could not allocate another texture object. This is a resource exhaustion or context-loss condition, not a parameter validation issue. The effect creates one RGBA texture for its source image during setup.","triggerScenarios":"WebGL context lost, GPU texture memory exhausted by other effects or large images, or a driver refusing further texture allocation.","commonSituations":"Compositions with many concurrent WebGL effects each allocating textures, very large source images filling GPU memory, headless rendering with limited GPU memory, or context loss after system GPU reset.","solutions":["Reduce the number of concurrent WebGL effects or large image sources.","Downscale source images before applying the effect.","Handle WebGL context loss and recreate the effect.","Use a GPU with more available memory."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  zoomBlur({ amount: 40 });\n} catch (err) {\n  if (err instanceof Error && err.message.includes('WebGL texture')) {\n    // reduce concurrent effects or source image size and retry\n  } else {\n    throw err;\n  }\n}","preventionTips":["Downscale large source images before applying effects.","Limit the number of concurrent WebGL effects.","Ensure effect cleanup frees GPU textures."],"tags":["webgl","effects","zoom-blur","gpu","memory","runtime"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}