{"record":{"id":"ee085dd531aec68e","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-shader-ee085d","errorCode":null,"errorMessage":"Failed to create WebGL shader","messagePattern":"Failed to create WebGL shader","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/evolve.ts","lineNumber":198,"sourceCode":"\treturn 1.0 - smoothstep(p, min(p + f, 1.0), t);\n}\n\nvoid main() {\n\tvec4 source = texture(uSource, vUv);\n\tfloat t = getT(vUv);\n\tfloat mask = maskValue(t, uProgress, uFeather);\n\tfragColor = vec4(source.rgb * mask, source.a * mask);\n}\n`;\n\nconst compileShader = (\n\tgl: WebGL2RenderingContext,\n\ttype: number,\n\tsource: string,\n): WebGLShader => {\n\tconst shader = gl.createShader(type);\n\tif (!shader) {\n\t\tthrow new Error('Failed to create WebGL shader');\n\t}\n\n\tgl.shaderSource(shader, source);\n\tgl.compileShader(shader);\n\tif (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n\t\tconst log = gl.getShaderInfoLog(shader);\n\t\tgl.deleteShader(shader);\n\t\tthrow new Error(`Evolve shader compile failed: ${log ?? '(no log)'}`);\n\t}\n\n\treturn shader;\n};\n\nconst linkProgram = (\n\tgl: WebGL2RenderingContext,\n\tvs: WebGLShader,\n\tfs: WebGLShader,\n): WebGLProgram => {","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/evolve.ts#L180-L216","documentation":"Thrown by the evolve effect's compileShader() when gl.createShader(type) returns null. The WebGL2 context was acquired (createWebGL2ContextError would have thrown earlier in setup), so a null shader object means the driver refused to allocate one, per spec indicating a lost context or resource exhaustion.","triggerScenarios":"Rendering or previewing evolve() on a Chrome GPU process that is unavailable, has crashed, or has exhausted its shader-object budget during the evolve effect setup.","commonSituations":"Headless/CI Chrome with no GPU, hardware acceleration disabled, many concurrent GPU-effect renders exhausting WebGL objects, or a driver reset mid-render.","solutions":["Render with a software WebGL backend: `npx remotion render <comp> --gl=swiftshader`.","Enable hardware acceleration for local preview, or preview on a machine with a working GPU.","Lower render concurrency to reduce simultaneous WebGL context load.","Update the Chromium build / GPU driver."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"async function safeRender(opts) {\n  try {\n    return await renderMedia(opts);\n  } catch (err) {\n    if (/Failed to create WebGL shader/.test(String(err?.message ?? ''))) {\n      return await renderMedia({...opts, gl: 'swiftshader'});\n    }\n    throw err;\n  }\n}","preventionTips":["Pin a reliable GL backend for the environment (`gl: 'swiftshader'`).","Cap concurrency so the GPU can serve per-frame shader allocation.","Run Studio preview with hardware acceleration on, or on a GPU-equipped machine.","Keep the Chromium build / GPU driver current."],"tags":["webgl","gpu","rendering","effects","runtime"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}