{"record":{"id":"43c20d4042d6f8cc","repo":"remotion-dev/remotion","slug":"failed-to-create-vibrance-shader","errorCode":null,"errorMessage":"Failed to create vibrance shader","messagePattern":"Failed to create vibrance shader","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/vibrance.ts","lineNumber":104,"sourceCode":"\t\tfragColor = vec4(0.0);\n\t\treturn;\n\t}\n\n\tvec3 color = sourceColor.rgb / alpha;\n\tvec3 adjusted = applyVibrance(color, uAmount);\n\n\tfragColor = vec4(adjusted * alpha, alpha);\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 vibrance 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(`Vibrance shader compile failed: ${log ?? '(no log)'}`);\n\t}\n\n\treturn shader;\n};\n\nconst createProgram = (gl: WebGL2RenderingContext): WebGLProgram => {\n\tconst vertexShader = compileShader(gl, gl.VERTEX_SHADER, VERTEX_SHADER);\n\tconst fragmentShader = compileShader(gl, gl.FRAGMENT_SHADER, FRAGMENT_SHADER);\n\tconst program = gl.createProgram();\n\tif (!program) {","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/vibrance.ts#L86-L122","documentation":"Thrown by the vibrance effect's compileShader helper when gl.createShader() returns null during createProgram -> compileShader. A null shader handle indicates the WebGL2 context is lost or GPU object allocation is exhausted. The library aborts immediately rather than proceeding with an invalid shader.","triggerScenarios":"setupVibrance -> createProgram -> compileShader -> gl.createShader(gl.VERTEX_SHADER or gl.FRAGMENT_SHADER) returns null. Occurs under context loss, GPU memory exhaustion, or too many live GL contexts.","commonSituations":"Headless rendering (Lambda/CI) with many parallel jobs exhausting GL contexts; GPU driver crash or TDR; long-running Studio sessions; VMs with software rendering.","solutions":["Reduce render concurrency to lower simultaneous WebGL2 context count","Ensure hardware GPU acceleration in the rendering browser","Handle webglcontextlost and retry the render after webglcontextrestored","Update GPU drivers or switch to a GPU with adequate resources"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const state = setupVibrance(canvas);\n} catch (err) {\n  if (err instanceof Error && err.message === 'Failed to create vibrance shader') {\n    throw new Error('WebGL2 context lost during vibrance shader creation. Retry render.');\n  }\n  throw err;\n}","preventionTips":["Monitor webglcontextlost on the canvas to detect context loss proactively","Keep concurrent render process count within GPU context/object budgets","Ensure the rendering browser has hardware GPU acceleration enabled"],"tags":["webgl","gpu","vibrance","context-loss","resource-exhaustion"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}