{"record":{"id":"d4f5edea00a45376","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-texture-d4f5ed","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/light-leak.ts","lineNumber":284,"sourceCode":"\t\tif (!vbo) {\n\t\t\tthrow new Error('Failed to create WebGL buffer');\n\t\t}\n\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, vbo);\n\t\tgl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);\n\n\t\tconst aPos = gl.getAttribLocation(program, 'aPos');\n\t\tconst aUv = gl.getAttribLocation(program, 'aUv');\n\t\tgl.enableVertexAttribArray(aPos);\n\t\tgl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 16, 0);\n\t\tgl.enableVertexAttribArray(aUv);\n\t\tgl.vertexAttribPointer(aUv, 2, gl.FLOAT, false, 16, 8);\n\n\t\tgl.bindVertexArray(null);\n\n\t\tconst texture = gl.createTexture();\n\t\tif (!texture) {\n\t\t\tthrow new Error('Failed to create WebGL texture');\n\t\t}\n\n\t\tgl.bindTexture(gl.TEXTURE_2D, texture);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\t\tgl.bindTexture(gl.TEXTURE_2D, null);\n\n\t\treturn {\n\t\t\tgl,\n\t\t\tprogram,\n\t\t\tvao,\n\t\t\tvbo,\n\t\t\ttexture,\n\t\t\tuSource: gl.getUniformLocation(program, 'uSource'),\n\t\t\tuEvolveProgress: gl.getUniformLocation(program, 'evolveProgress'),\n\t\t\tuRetractProgress: gl.getUniformLocation(program, 'retractProgress'),\n\t\t\tuSeed: gl.getUniformLocation(program, 'seed'),\n\t\t\tuRetractSeed: gl.getUniformLocation(program, 'retractSeed'),","sourceCodeStart":266,"sourceCodeEnd":302,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/light-leak.ts#L266-L302","documentation":"Thrown inside `lightLeak`'s setup when `gl.createTexture()` returns `null`. The effect's working texture cannot be allocated — context loss or GPU texture-memory/object-slot exhaustion.","triggerScenarios":"Context lost before texture creation; excessive simultaneous texture allocations; VRAM exhaustion on large frames.","commonSituations":"Many layered effects at high resolution; leaked textures across frames; constrained environments.","solutions":["Reduce per-frame texture pressure: fewer concurrent effects, lower concurrency.","Dispose prior WebGL resources to prevent texture leaks.","Handle context-loss events and recreate the effect on restore.","Render on an instance with more GPU VRAM."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  lightLeak({...})(...);\n} catch (err) {\n  if (/Failed to create WebGL texture/.test(String(err))) {\n    console.warn('lightLeak() texture unavailable', err);\n  } else {\n    throw err;\n  }\n}","preventionTips":["Free textures between frames to avoid VRAM exhaustion.","Lower concurrency and resolution when stacking many effects.","Handle context loss before retrying."],"tags":["light-leak","webgl2","gpu","texture","context-loss","resource-exhaustion"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}