{"record":{"id":"e7ba379d436f23fc","repo":"remotion-dev/remotion","slug":"noise-shader-compile-failed-log-no-log","errorCode":null,"errorMessage":"Noise shader compile failed: ${log ?? '(no log)'}","messagePattern":"Noise shader compile failed: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/effects/src/noise.ts","lineNumber":156,"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(`Noise 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":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/noise.ts#L138-L174","documentation":"Thrown by compileShader (packages/effects/src/noise.ts:156) when the hardcoded NOISE_VS or NOISE_FS fails gl.COMPILE_STATUS; the info log is appended. The shaders are valid GLSL ES 3.00 (#version 300 es), so a compile failure means the WebGL2 driver/implementation rejects correct source — a driver bug, outdated GPU driver, or an incomplete WebGL2 implementation.","triggerScenarios":"Rendering or previewing noise() on a machine whose GPU driver mis-compiles GLSL ES 3.00; running under a software rasterizer with partial WebGL2 support; a transient context corruption producing a bogus compile error.","commonSituations":"Outdated or buggy GPU drivers (especially older integrated GPUs and some VM display drivers); headless software WebGL that does not fully implement GLSL ES 3.00; rendering in a remote/VNC session with a fake GPU.","solutions":["Update the GPU driver on the render host to a version with complete WebGL2/GLSL ES 3.00 support.","Render on real GPU hardware (or GPU-enabled headless Chrome) rather than a software rasterizer.","Capture gl.getShaderInfoLog from the error message and file it against the driver/browser; switch effect off for that environment in the meantime."],"exampleFix":"// before: noise() renders, driver rejects the shader -> render aborts\nnoise({amount: 0.2});\n\n// after: gate the effect on a one-time shader-compile probe for this host\nimport {noise} from '@remotion/effects';\nconst supports = await probeNoiseShaderCompiles(); // compile NOISE_FS once\nconst effects = supports ? [noise({amount: 0.2})] : [];","handlingStrategy":"fallback","validationCode":"// One-time per host: compile a minimal GLSL ES 3.00 shader to see if the driver accepts it\nasync function hostSupportsNoiseShader(): Promise<boolean> {\n  try {\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;\\nout vec4 f;\\nvoid main(){f=vec4(1.0);}');\n    gl.compileShader(s);\n    const ok = !!gl.getShaderParameter(s, gl.COMPILE_STATUS);\n    gl.deleteShader(s);\n    return ok;\n  } catch {\n    return false;\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  scene.push(noise({amount: 0.2}));\n} catch (err) {\n  if (/Noise shader compile failed/.test(String(err?.message))) {\n    // driver cannot compile the shader: render without noise on this host\n  } else throw err;\n}","preventionTips":["Keep GPU drivers current on render hosts.","Render on real GPU hardware rather than software rasterizers.","Feature-probe shader compilation on the target environment and disable WebGL2 effects where it fails."],"tags":["webgl","gpu","noise","effects","shader","driver","glsl"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}