{"record":{"id":"fcc968515ded4361","repo":"remotion-dev/remotion","slug":"speckle-shader-compile-failed-log-no-log","errorCode":null,"errorMessage":"Speckle shader compile failed: ${log ?? '(no log)'}","messagePattern":"Speckle shader compile failed: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/speckle.ts","lineNumber":174,"sourceCode":"\tuRandomness: WebGLUniformLocation | null;\n};\n\nconst compileShader = (\n\tgl: WebGL2RenderingContext,\n\ttype: number,\n\tsource: string,\n): WebGLShader => {\n\tconst shader = gl.createShader(type);\n\tif (!shader) {\n\t\tthrow new Error('Failed to create WebGL shader');\n\t}\n\n\tgl.shaderSource(shader, source);\n\tgl.compileShader(shader);\n\tif (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n\t\tconst log = gl.getShaderInfoLog(shader);\n\t\tgl.deleteShader(shader);\n\t\tthrow new Error(`Speckle shader compile failed: ${log ?? '(no log)'}`);\n\t}\n\n\treturn shader;\n};\n\nconst linkProgram = (\n\tgl: WebGL2RenderingContext,\n\tvs: WebGLShader,\n\tfs: WebGLShader,\n): WebGLProgram => {\n\tconst program = gl.createProgram();\n\tif (!program) {\n\t\tthrow new Error('Failed to create WebGL program');\n\t}\n\n\tgl.attachShader(program, vs);\n\tgl.attachShader(program, fs);\n\tgl.linkProgram(program);","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/speckle.ts#L156-L192","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nnpx remotion render main MyComp out.mp4\n// error: Speckle shader compile failed: ERROR: 0:120 'for' ...\n\n// after\nnpx remotion render main MyComp out.mp4 --gl=angle","handlingStrategy":"try-catch","validationCode":"// speckle shaders are internal; pre-check GLSL ES 3.00 compile capability.\nfunction supportsGLSL300(): boolean {\n  const c = document.createElement('canvas');\n  const gl = c.getContext('webgl2');\n  if (!gl) return false;\n  const s = gl.createShader(gl.FRAGMENT_SHADER);\n  if (!s) return false;\n  gl.shaderSource(s, '#version 300 es\\nprecision highp float;out vec4 o;void main(){o=vec4(1.);}');\n  gl.compileShader(s);\n  return gl.getShaderParameter(s, gl.COMPILE_STATUS) === true;\n}","typeGuard":null,"tryCatchPattern":"try {\n  await renderMedia({ composition, codec: 'h264', chromiumOptions: { gl: 'angle' } });\n} catch (err) {\n  if (err instanceof Error && /Speckle shader compile failed/.test(err.message)) {\n    console.error('speckle() GLSL compile failed — driver lacks GLSL ES 3.00 support:', err.message);\n    throw err;\n  }\n  throw err;\n}","preventionTips":["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."],"tags":["webgl","gpu","glsl","shader","effects","speckle","driver"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}