{"record":{"id":"e53d31f67e8f37fc","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-texture-e53d31","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/radial-progressive-blur/radial-progressive-blur-runtime.ts","lineNumber":113,"sourceCode":"const getUniforms = (\n\tgl: WebGL2RenderingContext,\n\tprogram: WebGLProgram,\n): RadialProgressiveBlurUniforms => ({\n\tuSource: gl.getUniformLocation(program, 'uSource'),\n\tuTexelSize: gl.getUniformLocation(program, 'uTexelSize'),\n\tuCenter: gl.getUniformLocation(program, 'uCenter'),\n\tuWidth: gl.getUniformLocation(program, 'uWidth'),\n\tuHeight: gl.getUniformLocation(program, 'uHeight'),\n\tuRotation: gl.getUniformLocation(program, 'uRotation'),\n\tuStart: gl.getUniformLocation(program, 'uStart'),\n\tuStartBlur: gl.getUniformLocation(program, 'uStartBlur'),\n\tuEndBlur: gl.getUniformLocation(program, 'uEndBlur'),\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 setupRadialProgressiveBlur = (\n\ttarget: HTMLCanvasElement,\n): RadialProgressiveBlurState => {\n\tconst gl = target.getContext('webgl2', {\n\t\tpremultipliedAlpha: true,\n\t\talpha: true,\n\t\tpreserveDrawingBuffer: true,","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/radial-progressive-blur/radial-progressive-blur-runtime.ts#L95-L131","documentation":"The radial-progressive-blur runtime allocates an RGBA texture for the source and intermediate ping-pong surfaces via gl.createTexture(). If the WebGL2 context returns null, there are insufficient GPU resources or the context is in a lost state, and the effect cannot set up its render targets.","triggerScenarios":"Calling setupRadialProgressiveBlur() when GPU memory is exhausted, when the context has been lost, or when too many textures have already been allocated without being reclaimed by the garbage collector.","commonSituations":"Large video resolutions consuming all VRAM; many effects running concurrently in a single composition; long render sessions with gradual VRAM fragmentation; mobile or integrated GPUs with small memory budgets.","solutions":["Dispose of unused effects and their WebGL resources before creating new ones","Reduce composition resolution or the number of concurrent GPU effects","Handle context loss/restore events and reinitialize textures after restoration","Render on a machine with more VRAM or a discrete GPU"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"canvas.addEventListener('webglcontextlost', (e) => { e.preventDefault(); }, false);\ncanvas.addEventListener('webglcontextrestored', () => {\n  // re-create all textures and effects\n}, false);","preventionTips":["Dispose of unused effects to free texture memory","Reduce composition resolution when VRAM is constrained","Monitor VRAM usage during long renders"],"tags":["webgl","gpu","texture","resource-exhaustion","context-lost","radial-progressive-blur"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}