{"record":{"id":"8bbbaef9de19e223","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-texture-8bbbae","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/skew.ts","lineNumber":230,"sourceCode":"\n\tgl.bindVertexArray(vao);\n\tgl.bindBuffer(gl.ARRAY_BUFFER, vbo);\n\tgl.bufferData(\n\t\tgl.ARRAY_BUFFER,\n\t\tnew Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, -1, 1, 0, 1, 1, 1, 1, 1]),\n\t\tgl.STATIC_DRAW,\n\t);\n\tconst aPos = gl.getAttribLocation(program, 'aPos');\n\tconst aUv = gl.getAttribLocation(program, 'aUv');\n\tgl.enableVertexAttribArray(aPos);\n\tgl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 16, 0);\n\tgl.enableVertexAttribArray(aUv);\n\tgl.vertexAttribPointer(aUv, 2, gl.FLOAT, false, 16, 8);\n\tgl.bindVertexArray(null);\n\n\tconst texture = gl.createTexture();\n\tif (!texture) {\n\t\tthrow new Error('Failed to create WebGL texture');\n\t}\n\n\tgl.bindTexture(gl.TEXTURE_2D, texture);\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.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n\tgl.bindTexture(gl.TEXTURE_2D, null);\n\n\treturn {\n\t\tgl,\n\t\tprogram,\n\t\tvao,\n\t\tvbo,\n\t\ttexture,\n\t\tuSource: gl.getUniformLocation(program, 'uSource'),\n\t\tuResolution: gl.getUniformLocation(program, 'uResolution'),\n\t\tuSkew: gl.getUniformLocation(program, 'uSkew'),","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/skew.ts#L212-L248","documentation":"The final allocation step in setupSkew() is gl.createTexture() for the source sampler; if it returns null, skew() throws 'Failed to create WebGL texture'. Without a texture handle the effect cannot receive the input frame, so setup aborts. Like the other skew allocation errors, this reflects a lost/exhausted context rather than a parameter problem.","triggerScenarios":"Context loss or texture-memory exhaustion at the tail of setupSkew(); hitting a driver-imposed texture-object limit with many live WebGL2 effects; GPU memory pressure from large frame resolutions times many effects.","commonSituations":"Many parallel high-resolution renders each using multiple WebGL2 effects; software GPUs with low texture memory; driver crash/reset; leaked textures from effects whose cleanup did not run.","solutions":["Force ANGLE (--gl=angle / chromiumOptions.gl='angle' / Studio OpenGL=angle) for more dependable texture allocation.","Lower render concurrency and reduce simultaneous WebGL2 effects or output resolution to ease texture memory pressure.","Ensure gl.deleteTexture runs on cleanup so textures are recycled between effect instances.","Render on a machine with adequate GPU memory and supported drivers."],"exampleFix":"// before\nawait renderMedia({ composition, serveUrl, chromiumOptions: {} });\n\n// after\nawait renderMedia({ composition, serveUrl, chromiumOptions: { gl: 'angle' } });","handlingStrategy":"try-catch","validationCode":"function webgl2Available(): boolean {\n  try {\n    return !!document.createElement('canvas').getContext('webgl2');\n  } catch {\n    return false;\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await renderMedia({ composition, codec: 'h264', chromiumOptions: { gl: 'angle' } });\n} catch (err) {\n  if (err instanceof Error && /Failed to create WebGL texture/.test(err.message)) {\n    console.error('skew() texture allocation failed (context lost/GPU memory pressure). Lower resolution or concurrency.', err);\n    throw err;\n  }\n  throw err;\n}","preventionTips":["Render WebGL2 effects with ANGLE.","Lower output resolution or concurrency to reduce texture memory pressure.","Confirm gl.deleteTexture runs on cleanup to recycle textures.","Render on a host with adequate GPU memory."],"tags":["webgl","gpu","texture","effects","skew","context-loss"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}