{"record":{"id":"bcc983f285911c98","repo":"remotion-dev/remotion","slug":"shrinkwrap-shader-compile-failed-log-no-lo","errorCode":null,"errorMessage":"Shrinkwrap shader compile failed: ${log ?? '(no log)'}","messagePattern":"Shrinkwrap shader compile failed: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/shrinkwrap.ts","lineNumber":411,"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(`Shrinkwrap 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":393,"sourceCodeEnd":429,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/shrinkwrap.ts#L393-L429","documentation":"The shrinkwrap() effect compiles a complex fragment shader (with fBm noise, multiple curved-fold fields, and specular lighting). If the GLSL compiler rejects the source (COMPILE_STATUS is false), the effect reads the info log, deletes the shader, and throws this Error with the driver diagnostic. The shrinkwrap shader is particularly demanding — it uses nested loops and many function calls that may exceed driver limits.","triggerScenarios":"Calling shrinkwrap() on a GPU/driver that cannot compile the shader's fBm loops (4 iterations), multiple curvedFoldField calls, or the extensive math operations. Drivers with strict instruction count limits, loop unrolling caps, or incomplete GLSL ES 3.00 support will fail here. The error message includes the specific compiler diagnostic.","commonSituations":"Software rasterizers (SwiftShader) with instruction limits; older mobile GPU drivers; low-end integrated graphics with conservative shader resource limits; ANGLE/D3D translation layers that reject complex shaders.","solutions":["Read the info log in the error message to identify the specific compilation failure.","Update GPU drivers and Chromium to the latest stable version.","Use a render environment with a more capable WebGL2 implementation (dedicated GPU, newer driver).","If the shader consistently fails on a target platform, consider whether shrinkwrap() is supported there and file a Remotion issue with the driver info and log."],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"null","typeGuard":"null","tryCatchPattern":"try {\n  shrinkwrap({ amount: 1 });\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Shrinkwrap shader compile failed')) {\n    console.error('Shrinkwrap shader compile error:', e.message);\n    // The shader is very complex — may not be supported on all GPUs\n  } else {\n    throw e;\n  }\n}","preventionTips":["Use a render environment with a capable, up-to-date WebGL2 stack — the shrinkwrap shader is complex and demanding.","Keep GPU drivers and Chromium current.","The shader source is a library constant — compile failures indicate a driver/platform limitation.","Report persistent failures with GPU vendor, driver version, and the full info log from the error message."],"tags":["webgl2","gpu","shader","glsl","driver-compat","complex-shader"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}