{"record":{"id":"c20bccb8d69c4d13","repo":"remotion-dev/remotion","slug":"roughen-edges-shader-compile-failed-log-no","errorCode":null,"errorMessage":"Roughen edges shader compile failed: ${log ?? '(no log)'}","messagePattern":"Roughen edges shader compile failed: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/roughen-edges.ts","lineNumber":309,"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`Roughen edges 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":291,"sourceCodeEnd":327,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/roughen-edges.ts#L291-L327","documentation":"The `roughenEdges()` effect's GLSL shader failed to compile. The vertex and fragment shaders are static string constants bundled with the effect, so under normal conditions this never fires. A compile failure means the running WebGL2 driver rejected the GLSL ES 3.00 source — typically a non-conformant driver, a corrupted/patched effects build, or a context that lost its compiler after a GPU reset.","triggerScenarios":"Non-conformant GLSL ES 3.00 driver (older mobile, virtual, or software GPU); a fork of `@remotion/effects` where the `ROUGHEN_EDGES_FS` template literal was hand-edited; compiling after an unhandled `webglcontextlost`.","commonSituations":"Headless rendering via Xvfb; mobile WebView; remote-desktop virtual GPU; locally patched effects package.","solutions":["Run on a WebGL2-conformant browser/GPU with hardware acceleration.","Reinstall `@remotion/effects` to rule out a patched shader source.","Handle context loss/restore so the shader is recompiled cleanly.","Capture `gl.getShaderInfoLog()` (included in the message) and the renderer string, then file a Remotion issue."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  roughenEdges()({...});\n} catch (err) {\n  if (err instanceof Error && /Roughen edges shader compile failed/.test(err.message)) {\n    // capture err.message (the GLSL info log) for a bug report and fall back\n  } else {\n    throw err;\n  }\n}","preventionTips":["Run on a WebGL2-conformant browser/GPU with current drivers.","Do not hand-edit the GLSL in `@remotion/effects`.","Reinstall the package if a patched build is suspected.","Handle context loss so a stale compiler is not reused."],"tags":["webgl2","roughen-edges-effect","effects","glsl","gpu","shader"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}