remotion-dev/remotion · critical · Error

White balance shader compile failed: ${log ?? '(no log)'}

Error message

White balance shader compile failed: ${log ?? '(no log)'}

What it means

Thrown by compileShader() in the white balance effect when gl.getShaderParameter(shader, gl.COMPILE_STATUS) returns false. This means the GLSL ES 3.00 shader (which includes color space conversion and white balance correction functions) failed to compile on the current GPU driver. The error includes the GL driver's info log. The shader source is a static library constant, so this is a driver/GPU compatibility issue.

Source

Thrown at packages/effects/src/white-balance.ts:136

}
`;

const compileShader = (
	gl: WebGL2RenderingContext,
	type: number,
	source: string,
): WebGLShader => {
	const shader = gl.createShader(type);
	if (!shader) {
		throw new Error('Failed to create white balance shader');
	}

	gl.shaderSource(shader, source);
	gl.compileShader(shader);
	if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
		const log = gl.getShaderInfoLog(shader);
		gl.deleteShader(shader);
		throw new Error(
			`White balance shader compile failed: ${log ?? '(no log)'}`,
		);
	}

	return shader;
};

const createProgram = (gl: WebGL2RenderingContext): WebGLProgram => {
	const vertexShader = compileShader(gl, gl.VERTEX_SHADER, VERTEX_SHADER);
	const fragmentShader = compileShader(gl, gl.FRAGMENT_SHADER, FRAGMENT_SHADER);
	const program = gl.createProgram();
	if (!program) {
		throw new Error('Failed to create white balance shader program');
	}

	gl.attachShader(program, vertexShader);
	gl.attachShader(program, fragmentShader);
	gl.linkProgram(program);

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Update GPU drivers to the latest version.
  2. For headless/server rendering, ensure the Chrome build (e.g., @remotion/renderer's bundled Chrome) is current and WebGL2-capable.
  3. Check chrome://gpu for WebGL2 status and any denylisted features.
  4. Try a different GPU or toggle hardware acceleration to switch between driver and SwiftShader.
  5. Report the issue with the full info log and GPU details.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  const state = setupWhiteBalance(canvas);
} catch (e) {
  if ((e as Error).message.startsWith('White balance shader compile failed')) {
    console.warn('GPU driver rejected white balance shader:', (e as Error).message);
    // fall back to a non-WebGL color correction approach
  }
}

Prevention

When it happens

Trigger: Called transitively from setupWhiteBalance() at packages/effects/src/white-balance.ts:194 via createProgram(gl). Fires when the GPU driver rejects the GLSL — the white balance shader uses sRGB↔linear color space conversion functions and white balance math that may exercise driver-specific GLSL compiler bugs.

Common situations: Older or buggy GPU drivers with incomplete GLSL ES 3.00 support; software rasterizers (SwiftShader) in headless/CI environments with partial shader compiler support; older mobile/integrated GPUs; outdated Chrome versions with WebGL2 regressions.

Related errors


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