{"record":{"id":"4bd570d00c115b0a","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-texture-4bd570","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/region-blur/region-blur-runtime.ts","lineNumber":131,"sourceCode":"\n\tgl.attachShader(program, vertexShader);\n\tgl.attachShader(program, fragmentShader);\n\tgl.linkProgram(program);\n\tgl.deleteShader(vertexShader);\n\tgl.deleteShader(fragmentShader);\n\tif (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n\t\tconst log = gl.getProgramInfoLog(program);\n\t\tgl.deleteProgram(program);\n\t\tthrow new Error(`Program link failed: ${log ?? '(no log)'}`);\n\t}\n\n\treturn program;\n};\n\nconst createTexture = (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\nconst getBlurUniforms = (\n\tgl: WebGL2RenderingContext,\n\tprogram: WebGLProgram,\n): BlurUniforms => ({\n\tsource: gl.getUniformLocation(program, 'uSource'),\n\tradius: gl.getUniformLocation(program, 'uRadius'),\n\ttexelSize: gl.getUniformLocation(program, 'uTexelSize'),","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/region-blur/region-blur-runtime.ts#L113-L149","documentation":"The region-blur runtime allocates an RGBA texture via gl.createTexture(). If the WebGL2 context returns null, the effect cannot create its source/intermediate/output render surfaces and throws. This indicates context loss or VRAM exhaustion.","triggerScenarios":"Calling setupRegionBlur() when the context is lost, when VRAM is fully consumed by existing textures, or when the texture object pool is depleted.","commonSituations":"High-resolution compositions consuming all VRAM; many effects with large intermediate textures; long sessions with texture leaks; mobile/integrated GPUs with limited memory.","solutions":["Dispose of unused effects and their textures before creating new ones","Reduce composition resolution or concurrent effect count","Handle context loss/restoration and reinitialize textures","Render on a GPU with more VRAM"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"canvas.addEventListener('webglcontextlost', (e) => { e.preventDefault(); }, false);\ncanvas.addEventListener('webglcontextrestored', () => {\n  // re-initialize region-blur effect, re-creating textures\n}, false);","preventionTips":["Dispose of unused effects to free texture memory","Reduce composition resolution when VRAM is tight","Handle context loss/restoration"],"tags":["webgl","gpu","texture","resource-exhaustion","context-lost","region-blur"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}