{"record":{"id":"2377156dee3eb859","repo":"remotion-dev/remotion","slug":"thermal-vision-shader-compile-failed-log-n","errorCode":null,"errorMessage":"Thermal vision shader compile failed: ${log ?? '(no log)'}","messagePattern":"Thermal vision shader compile failed: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/effects/src/thermal-vision.ts","lineNumber":164,"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 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(\n\t\t\t`Thermal vision shader compile failed: ${log ?? '(no log)'}`,\n\t\t);\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);","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/thermal-vision.ts#L146-L182","documentation":"The thermal vision effect's GLSL shader failed to compile. After `gl.createShader` succeeds and the source is uploaded, the driver reports `COMPILE_STATUS === false` and the info log is appended. The shader sources (`THERMAL_VISION_VS`/`THERMAL_VISION_FS`) are static library constants, so a compile failure almost always indicates a driver/GPU compatibility bug rather than user input. The shader is deleted before throwing.","triggerScenarios":"A GPU driver rejecting valid GLSL ES 3.00 (`#version 300 es`) code; a browser/OS combination with a buggy WebGL2 implementation; a regression introduced by editing the bundled shader strings.","commonSituations":"Outdated mobile GPU drivers; older integrated GPUs; software-rendered WebGL2 (SwiftShader/LLVMpipe) with GLSL gaps; a library regression after modifying `THERMAL_VISION_FS` or `THERMAL_VISION_VS`.","solutions":["Read the info log embedded in the message to find the driver's GLSL error.","Update GPU drivers and browser to the latest version.","Reproduce on another machine/browser to isolate a driver-specific bug.","If editing the shader source, validate against GLSL ES 3.00 (e.g. `precision` qualifier present, `texture()` used for sampler2D in ES 3.00).","Report the driver/browser and info log to Remotion maintainers if shaders are unmodified."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  thermalVision({...params});\n} catch (e) {\n  const msg = (e as Error).message;\n  if (/shader compile failed/.test(msg)) {\n    console.error('Driver GLSL bug:', msg);\n    renderFallbackFrame();\n  } else throw e;\n}","preventionTips":["Keep GPU drivers and browsers current for GLSL ES 3.00 support.","If editing shaders, validate against the spec and test on multiple drivers.","Provide a non-webgl2 fallback for environments where compilation fails."],"tags":["thermal-vision","webgl2","shader","glsl","compile","driver"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}