remotion-dev/remotion · error · Error

Failed to create WebGL texture

Error message

Failed to create WebGL texture

What it means

Thrown by setupBurlap when gl.createTexture() returns null while allocating the source texture used to upload frames into the burlap shader. createTexture() returns null for the same reasons as other GL object creators: lost context, exhausted GPU texture memory, or too many live textures. Without the texture the effect has nothing to sample, so setup aborts.

Source

Thrown at packages/effects/src/burlap.ts:323

	if (!vbo) {
		throw new Error('Failed to create WebGL buffer');
	}

	gl.bindBuffer(gl.ARRAY_BUFFER, vbo);
	gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);

	const aPos = gl.getAttribLocation(program, 'aPos');
	const aUv = gl.getAttribLocation(program, 'aUv');
	gl.enableVertexAttribArray(aPos);
	gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 16, 0);
	gl.enableVertexAttribArray(aUv);
	gl.vertexAttribPointer(aUv, 2, gl.FLOAT, false, 16, 8);

	gl.bindVertexArray(null);

	const texture = gl.createTexture();
	if (!texture) {
		throw new Error('Failed to create WebGL texture');
	}

	gl.bindTexture(gl.TEXTURE_2D, texture);
	gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
	gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
	gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
	gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
	gl.bindTexture(gl.TEXTURE_2D, null);

	const colorCanvas = document.createElement('canvas');
	colorCanvas.width = 1;
	colorCanvas.height = 1;
	const colorCtx = colorCanvas.getContext('2d', {willReadFrequently: true});
	if (!colorCtx) {
		throw new Error('Failed to acquire 2D context for color parsing');
	}

	return {

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Free WebGL resources from other effects/compositions before initializing burlap (call the effect cleanup paths).
  2. Lower the composition resolution or reduce concurrent compositions to cut peak texture memory.
  3. Enable GPU acceleration in the render environment (avoid --disable-gpu / pure software raster).
  4. Handle 'webglcontextlost' on the canvas and re-run setupBurlap after 'webglcontextrestored'.
  5. Update GPU drivers; verify the GPU is not blacklisted by the browser.
Defensive patterns

Strategy: try-catch

Validate before calling

function probeWebGL2(): boolean {
  try {
    const c = document.createElement('canvas');
    const gl = c.getContext('webgl2');
    return !!gl && !gl.isContextLost();
  } catch {
    return false;
  }
}
if (!probeWebGL2()) skipOrFallback();

Try / catch

try {
  return <Burlap {...props} />;
} catch (err) {
  if (/Failed to create WebGL texture/.test(String(err))) return <FallbackFrame />;
  throw err;
}

Prevention

When it happens

Trigger: setupBurlap() reaches gl.createTexture() at burlap.ts:321 after the VAO/VBO were built; the call returns null (context lost or GPU texture memory exhausted) and the guard at :322 throws.

Common situations: Large/many compositions consuming GPU texture memory, integrated GPUs with limited VRAM, software rendering (SwiftShader) under load, rendering at very high resolutions where prior textures were not freed, or a context-loss event between VBO and texture creation.

Related errors


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/582c32cb93078897. Report an issue: GitHub.