{"record":{"id":"32390d78c6396e13","repo":"remotion-dev/remotion","slug":"exposure-shader-compile-failed-log-no-log","errorCode":null,"errorMessage":"Exposure shader compile failed: ${log ?? '(no log)'}","messagePattern":"Exposure shader compile failed: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/exposure.ts","lineNumber":123,"sourceCode":"}\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 exposure 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(`Exposure shader compile failed: ${log ?? '(no log)'}`);\n\t}\n\n\treturn shader;\n};\n\nconst createProgram = (gl: WebGL2RenderingContext): WebGLProgram => {\n\tconst vertexShader = compileShader(gl, gl.VERTEX_SHADER, VERTEX_SHADER);\n\tconst fragmentShader = compileShader(gl, gl.FRAGMENT_SHADER, FRAGMENT_SHADER);\n\tconst program = gl.createProgram();\n\tif (!program) {\n\t\tthrow new Error('Failed to create exposure shader program');\n\t}\n\n\tgl.attachShader(program, vertexShader);\n\tgl.attachShader(program, fragmentShader);\n\tgl.linkProgram(program);\n\tgl.deleteShader(vertexShader);\n\tgl.deleteShader(fragmentShader);","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/exposure.ts#L105-L141","documentation":"Thrown inside compileShader() in exposure.ts when gl.getShaderParameter(shader, gl.COMPILE_STATUS) is false (exposure.ts:120-124). The driver's shader translator rejected the GLSL ES 3.00 source (VERTEX_SHADER or FRAGMENT_SHADER); the InfoLog is captured, the failed shader is deleted, and the error includes the log. Unlike the null-handle case, this is a real compile rejection.","triggerScenarios":"setupExposure() compiles VERTEX_SHADER or FRAGMENT_SHADER and the Angle/driver translator reports a compile error. Because the GLSL is a fixed package string, this points at a buggy/incompatible driver translator (not user input). The InfoLog in the message identifies which stage and why.","commonSituations":"Headless Chromium with software GL whose translator mishandles the sRGB helpers injected via COLOR_SPACE_GLSL; outdated mobile/Intel drivers; a context that is partially degraded after a GPU reset; a local edit to FRAGMENT_SHADER that introduced a syntax error.","solutions":["Render with --gl=angle (CLI) / chromiumOptions.gl='angle' (SSR) / Angle (Studio) so a consistent, well-tested translator is used.","Read the InfoLog in the message — it names the offending line/uniform; verify packages/effects/src/exposure.ts and color-correction-shader-utils.ts were not locally modified.","Update GPU drivers on the render host, or force a software GL path known to compile the shaders.","If the InfoLog references the injected COLOR_SPACE_GLSL helpers, check for a version drift between @remotion/effects and remotion/core.","Report a driver/translator bug upstream if the GLSL is valid ES 3.00 yet rejected."],"exampleFix":"// before\nconst shader = gl.createShader(type);\ngl.shaderSource(shader, source);\ngl.compileShader(shader);\nif (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n  // translator rejected FRAGMENT_SHADER -> render fails\n}\n\n// after (ensure a consistent translator)\n// CLI: remotion render <comp> --gl=angle\n// SSR: renderMedia({ chromiumOptions: { gl: 'angle' } })","handlingStrategy":"try-catch","validationCode":"// There is no user-facing input to validate: VERTEX_SHADER/FRAGMENT_SHADER are\n// fixed package strings. The only pre-check is context health and GLSL version.\nconst supportsGlslEs300 = (gl: WebGL2RenderingContext): boolean =>\n  !gl.isContextLost() &&\n  (gl.getParameter(gl.SHADING_LANGUAGE_VERSION) ?? '').includes('3.00');","typeGuard":null,"tryCatchPattern":"try {\n  // apply exposure(); for a custom canvas: const state = setupExposure(canvas);\n} catch (err) {\n  if (err instanceof Error && /Exposure shader compile failed/.test(err.message)) {\n    // err.message contains the InfoLog; render on Angle (--gl=angle) and retry.\n    console.error('exposure compile failure:', err.message);\n    throw err;\n  }\n  throw err;\n}","preventionTips":["Render with the Angle backend everywhere for a consistent, well-tested translator.","Do not locally edit VERTEX_SHADER/FRAGMENT_SHADER or color-correction-shader-utils.ts.","Keep @remotion/effects and remotion/core versions in sync so injected GLSL matches.","Pin a stable software GL path in CI; update GPU drivers on render hosts."],"tags":["webgl","shader","glsl","compiler","gpu","exposure","setup"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}