remotion-dev/remotion · error · Error
Speckle shader compile failed: ${log ?? '(no log)'}
Error message
Speckle shader compile failed: ${log ?? '(no log)'} What it means
After gl.createShader() succeeded for the speckle() effect, the GLSL ES 3.00 shader failed gl.COMPILE_STATUS. compileShader() deletes the shader and throws, embedding the driver info log. The SPECKLE_VS/SPECKLE_FS sources are library-internal, so a compile failure indicates a non-conformant WebGL2 compiler (note the speckle fragment shader uses loops, hashing, and dynamic branching some software drivers mishandle).
Source
Thrown at packages/effects/src/speckle.ts:174
uRandomness: WebGLUniformLocation | null;
};
const compileShader = (
gl: WebGL2RenderingContext,
type: number,
source: string,
): WebGLShader => {
const shader = gl.createShader(type);
if (!shader) {
throw new Error('Failed to create WebGL 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(`Speckle shader compile failed: ${log ?? '(no log)'}`);
}
return shader;
};
const linkProgram = (
gl: WebGL2RenderingContext,
vs: WebGLShader,
fs: WebGLShader,
): WebGLProgram => {
const program = gl.createProgram();
if (!program) {
throw new Error('Failed to create WebGL program');
}
gl.attachShader(program, vs);
gl.attachShader(program, fs);
gl.linkProgram(program);View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Switch to ANGLE (--gl=angle / chromiumOptions.gl='angle' / Studio OpenGL=angle) for a conformant GLSL ES 3.00 compiler.
- Read the info log in the error message, confirm it is a compiler-feature gap, and update/replace the GPU driver.
- Render on a host with verified WebGL2 conformance.
- As a workaround, lower speckle density/size to 0-equivalent or remove the effect for that frame.
Example fix
// before npx remotion render main MyComp out.mp4 // error: Speckle shader compile failed: ERROR: 0:120 'for' ... // after npx remotion render main MyComp out.mp4 --gl=angle
Defensive patterns
Strategy: try-catch
Validate before calling
// speckle shaders are internal; pre-check GLSL ES 3.00 compile capability.
function supportsGLSL300(): boolean {
const c = document.createElement('canvas');
const gl = c.getContext('webgl2');
if (!gl) return false;
const s = gl.createShader(gl.FRAGMENT_SHADER);
if (!s) return false;
gl.shaderSource(s, '#version 300 es\nprecision highp float;out vec4 o;void main(){o=vec4(1.);}');
gl.compileShader(s);
return gl.getShaderParameter(s, gl.COMPILE_STATUS) === true;
} Try / catch
try {
await renderMedia({ composition, codec: 'h264', chromiumOptions: { gl: 'angle' } });
} catch (err) {
if (err instanceof Error && /Speckle shader compile failed/.test(err.message)) {
console.error('speckle() GLSL compile failed — driver lacks GLSL ES 3.00 support:', err.message);
throw err;
}
throw err;
} Prevention
- Prefer the ANGLE backend for conformant GLSL ES 3.00 compilation.
- Keep GPU drivers current.
- Don't trust headless WebGL2 without verifying shader compilation.
- Capture the driver info log when reporting the issue.
When it happens
Trigger: Running speckle() on a WebGL2 context whose driver cannot compile the shader's GLSL ES 3.00 (loop bound handling, function calls, or smoothstep/clamp intrinsics). The driver info log in the message identifies the failing line.
Common situations: Software rasterizers (SwiftShader, llvmpipe) with incomplete GLSL ES 3.00 support; outdated/blacklisted GPU drivers; virtualized remoting that strips WebGL2; a driver-specific bug exposed by the speckle shader's hashing/loop structure.
Related errors
- Speckle program link failed: ${log ?? '(no log)'}
- Noise shader compile failed: ${log ?? '(no log)'}
- Paper shader compile failed: ${log ?? '(no log)'}
- Skew shader compile failed: ${log ?? '(no log)'}
- Skew program link failed: ${log ?? '(no log)'}
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/fcc968515ded4361.
Report an issue: GitHub.