{"record":{"id":"deeb3c22f39641c0","repo":"remotion-dev/remotion","slug":"failed-to-create-vibrance-texture","errorCode":null,"errorMessage":"Failed to create vibrance texture","messagePattern":"Failed to create vibrance texture","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/vibrance.ts","lineNumber":144,"sourceCode":"\tgl.attachShader(program, vertexShader);\n\tgl.attachShader(program, fragmentShader);\n\tgl.linkProgram(program);\n\tgl.deleteShader(vertexShader);\n\tgl.deleteShader(fragmentShader);\n\n\tif (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n\t\tconst log = gl.getProgramInfoLog(program);\n\t\tgl.deleteProgram(program);\n\t\tthrow new Error(`Vibrance shader link failed: ${log ?? '(no log)'}`);\n\t}\n\n\treturn program;\n};\n\nconst createTexture = (gl: WebGL2RenderingContext): WebGLTexture => {\n\tconst texture = gl.createTexture();\n\tif (!texture) {\n\t\tthrow new Error('Failed to create vibrance texture');\n\t}\n\n\tgl.bindTexture(gl.TEXTURE_2D, texture);\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\tgl.bindTexture(gl.TEXTURE_2D, null);\n\treturn texture;\n};\n\nconst setupVibrance = (target: HTMLCanvasElement): VibranceState => {\n\tconst gl = target.getContext('webgl2', {\n\t\tpremultipliedAlpha: true,\n\t\talpha: true,\n\t\tpreserveDrawingBuffer: true,\n\t});\n\tif (!gl) {","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/vibrance.ts#L126-L162","documentation":"Thrown during vibrance setup when gl.createTexture() returns null. A null texture means WebGL refused to allocate the GL object, which happens on context loss or when the implementation's object/memory limit is exhausted. This is an environmental failure, not a parameter error.","triggerScenarios":"setupVibrance() calls createTexture(gl) right after creating the program/VAO/VBO; gl.createTexture() returns null because the context is lost (isContextLost() true) or too many GL objects are already live.","commonSituations":"Context loss from many concurrent effects in Studio; GPU memory exhaustion; rendering a long composition that leaks or accumulates GL objects; headless Chrome with constrained resources.","solutions":["Reload to reset the WebGL2 context and free GL objects.","Lower the count of simultaneously-active WebGL effects and verify effects are disposed when offscreen.","Check gl.isContextLost() diagnostics (chrome://gpu) and ensure hardware acceleration is on.","Update GPU drivers if context loss is recurring on otherwise idle hardware."],"exampleFix":"// before\nconst effect = vibrance({amount: 1}); // setup can throw if createTexture returns null\n\n// after - guard effect creation and degrade gracefully\nconst effect = (() => {\n  try {\n    return vibrance({amount: 1});\n  } catch {\n    return null;\n  }\n})();","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"let effect = null;\ntry {\n  effect = vibrance({amount: 1});\n} catch (err) {\n  console.warn('vibrance texture alloc failed, skipping effect', err);\n}","preventionTips":["Dispose offscreen WebGL effects to keep the live GL object count down.","Listen for 'webglcontextlost' and rebuild effects after 'webglcontextrestored'.","Avoid stacking many texture-heavy effects on the same frames.","Render on a machine with adequate GPU memory for the chosen resolution."],"tags":["webgl2","gpu-memory","context-loss","vibrance"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}