{"record":{"id":"94d671851dc2d6bd","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-texture-94d671","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/shine.ts","lineNumber":287,"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_MIN_FILTER, gl.LINEAR);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\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\tuResolution: gl.getUniformLocation(program, 'uResolution'),\n\t\t\tuBandNormal: gl.getUniformLocation(program, 'uBandNormal'),","sourceCodeStart":269,"sourceCodeEnd":305,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/shine.ts#L269-L305","documentation":"The shine() effect's setup function calls gl.createTexture() to allocate the source texture that will receive the input frame each render. If the WebGL2 driver returns null, the effect throws this Error. Texture allocation failure typically indicates VRAM exhaustion or a context that lost its resources after creation.","triggerScenarios":"Calling shine() when the GPU cannot allocate a texture — VRAM exhaustion from large frame sizes, too many simultaneous textures across effect instances, or a software renderer with hard texture limits. Especially common when rendering at 4K or higher with multiple WebGL2 effects.","commonSituations":"High-resolution renders (4K, 8K) that exceed software renderer texture caps; many concurrent effects each holding their own texture; SwiftShader or llvmpipe backends with limited texture memory; a context-loss event invalidating resources.","solutions":["Reduce output resolution or render in segments to lower per-frame texture memory.","Lower concurrency so fewer effect textures are live simultaneously.","Ensure GPU hardware acceleration is active in the render environment.","Run on a host with adequate VRAM for the target resolution."],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"// Probe texture allocation capability\nfunction canCreateTexture(canvas: HTMLCanvasElement): boolean {\n  const gl = canvas.getContext('webgl2');\n  if (!gl) return false;\n  const tex = gl.createTexture();\n  const ok = tex !== null;\n  if (tex) gl.deleteTexture(tex);\n  return ok;\n}","typeGuard":"null","tryCatchPattern":"try {\n  shine({ progress: 0.5 });\n} catch (e) {\n  if (e instanceof Error && e.message === 'Failed to create WebGL texture') {\n    console.warn('WebGL2 texture allocation failed — try reducing resolution');\n  } else {\n    throw e;\n  }\n}","preventionTips":["Reduce output resolution to lower per-frame texture memory.","Lower concurrency so fewer effect textures are live simultaneously.","Ensure GPU hardware acceleration is active.","Use a host with adequate VRAM for the target resolution."],"tags":["webgl2","gpu","resource-allocation","texture","memory"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}