{"record":{"id":"4cc619555766a512","repo":"remotion-dev/remotion","slug":"lut-3d-size-parsed-size-exceeds-this-browser-s-maximum-3d","errorCode":null,"errorMessage":"LUT_3D_SIZE ${parsed.size} exceeds this browser's maximum 3D texture size of ${maxSize}","messagePattern":"LUT_3D_SIZE (.+?) exceeds this browser's maximum 3D texture size of (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/effects/src/lut/lut-runtime.ts","lineNumber":179,"sourceCode":"\theight,\n\tcontent,\n\tparsed,\n\tflipSourceY,\n}: {\n\treadonly state: LutState;\n\treadonly source: CanvasImageSource;\n\treadonly width: number;\n\treadonly height: number;\n\treadonly content: string;\n\treadonly parsed: ParsedCubeLut;\n\treadonly flipSourceY: boolean;\n}): void => {\n\tconst {gl, program, sourceTexture, lutTexture, uniforms, vao} = state;\n\n\tif (state.cachedContent !== content) {\n\t\tconst maxSize = gl.getParameter(gl.MAX_3D_TEXTURE_SIZE) as number;\n\t\tif (parsed.size > maxSize) {\n\t\t\tthrow new Error(\n\t\t\t\t`LUT_3D_SIZE ${parsed.size} exceeds this browser's maximum 3D texture size of ${maxSize}`,\n\t\t\t);\n\t\t}\n\n\t\tgl.activeTexture(gl.TEXTURE1);\n\t\tgl.bindTexture(gl.TEXTURE_3D, lutTexture);\n\t\tgl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);\n\t\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n\t\tgl.texImage3D(\n\t\t\tgl.TEXTURE_3D,\n\t\t\t0,\n\t\t\tgl.RGBA16F,\n\t\t\tparsed.size,\n\t\t\tparsed.size,\n\t\t\tparsed.size,\n\t\t\t0,\n\t\t\tgl.RGBA,\n\t\t\tgl.FLOAT,","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/remotion-dev/remotion/blob/46a3a6bf13ca367376ff18bbb06dae2e87e0d068/packages/effects/src/lut/lut-runtime.ts#L161-L197","documentation":"applyLut() checks the parsed LUT's LUT_3D_SIZE against gl.getParameter(gl.MAX_3D_TEXTURE_SIZE), the largest 3D texture dimension the current browser/GPU supports. If the LUT grid is larger than that limit, the 3D texture upload would fail, so the library throws with both sizes in the message. The check runs only when the LUT content changes (cachedContent !== content).","triggerScenarios":"Loading a .cube file with a large LUT_3D_SIZE (e.g. 128 or 256) on hardware whose MAX_3D_TEXTURE_SIZE is smaller (commonly 64 on some mobile GPUs); switching to a bigger LUT in a composition that already works with a smaller one.","commonSituations":"Mobile/older GPUs often cap 3D textures at 64; professional color-grading LUTs are frequently exported at size 33, 65 or higher and can exceed low-end limits; users download high-resolution creative LUTs without checking hardware support.","solutions":["Resample/downsample the LUT to a smaller LUT_3D_SIZE (e.g. 32 or 33) before passing it to the effect","Query the limit first: gl.getParameter(gl.MAX_3D_TEXTURE_SIZE) and pick a LUT that fits","Use a LUT exported at a standard small size such as 17 or 33","Re-export the .cube from the grading tool with a reduced resolution"],"exampleFix":"// before: arbitrary large LUT\nconst lut = parseCubeLut(big128CubeFile);\n// after: check hardware limit and downsample if needed\nconst maxSize = gl.getParameter(gl.MAX_3D_TEXTURE_SIZE);\nif (lut.size > maxSize) {\n  lut = downsampleCubeLut(lut, Math.min(32, maxSize));\n}","handlingStrategy":"validation","validationCode":"const maxSize = gl.getParameter(gl.MAX_3D_TEXTURE_SIZE);\nconst declaredSize = Number(cubeText.match(/LUT_3D_SIZE (\\d+)/)?.[1]);\nif (declaredSize > maxSize) {\n  throw new Error(`LUT_3D_SIZE ${declaredSize} exceeds MAX_3D_TEXTURE_SIZE ${maxSize}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  applyLut(state, content);\n} catch (e) {\n  if (e.message.startsWith('LUT_3D_SIZE')) {\n    applyLut(state, downsampleCubeLut(parsed, 32));\n  }\n}","preventionTips":["Check gl.getParameter(gl.MAX_3D_TEXTURE_SIZE) before choosing LUT assets","Prefer standard small LUT sizes (17, 32, 33) for broad compatibility","Keep a downscaled variant of each LUT for low-end devices","Test compositions on mobile GPUs where the limit is often 64"],"tags":["webgl","texture3d","hardware-limit","lut"],"backgroundTag":"value-out-of-range","analyzedSha":"46a3a6bf13ca367376ff18bbb06dae2e87e0d068","analyzedAt":"2026-09-18T00:12:20.256Z","contentChangedAt":"2026-09-18T00:12:20.256Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}