{"record":{"id":"28b5558ac7539de2","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-palette-texture","errorCode":null,"errorMessage":"Failed to create WebGL palette texture","messagePattern":"Failed to create WebGL palette texture","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/effects/src/starburst.ts","lineNumber":331,"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 paletteTexture = gl.createTexture();\n\t\tif (!paletteTexture) {\n\t\t\tthrow new Error('Failed to create WebGL palette texture');\n\t\t}\n\n\t\tgl.bindTexture(gl.TEXTURE_2D, paletteTexture);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\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\tpaletteTexture,\n\t\t\tuColorPalette: gl.getUniformLocation(program, 'colorPalette'),\n\t\t\tuNumRays: gl.getUniformLocation(program, 'numRays'),\n\t\t\tuRotationOffset: gl.getUniformLocation(program, 'rotationOffset'),","sourceCodeStart":313,"sourceCodeEnd":349,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/starburst.ts#L313-L349","documentation":"During starburst effect `setup`, `gl.createTexture()` returned `null` while allocating the color palette texture. This is the last GL resource created during setup and indicates the context cannot allocate a texture object — context loss or resource exhaustion. The VAO, VBO, program, and shaders have all been created successfully by this point.","triggerScenarios":"Context lost late in setup; GPU texture memory exhausted; too many live GL textures across effects; destroyed GL context.","commonSituations":"Many concurrent webgl2 effects each holding textures; large palette arrays across many instances; long-running Studio with leaked textures; mobile GPUs with low texture limits.","solutions":["Reduce the number of concurrent webgl2 effects and/or palette sizes.","Restart the render/session to free leaked textures and reset context.","Ensure effect `cleanup` is being called so textures are deleted (`gl.deleteTexture`) between renders.","Handle `webglcontextlost` and rebuild GL state."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  starburst({...params});\n} catch (e) {\n  if (/Failed to create WebGL palette texture/.test((e as Error).message)) {\n    renderFallbackFrame();\n  } else throw e;\n}","preventionTips":["Cap the number of concurrent webgl2 effects and palette sizes to limit texture usage.","Confirm `cleanup` runs and calls `gl.deleteTexture` between renders.","Handle `webglcontextlost` to rebuild textures and re-upload palettes."],"tags":["starburst","webgl2","gpu","resource-exhaustion","context-lost","texture","setup"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}