{"record":{"id":"bdd95a67981aee68","repo":"BabylonJS/Babylon.js","slug":"unsupported-pixeltype-decoder-type-for-header","errorCode":null,"errorMessage":"Unsupported pixelType ${decoder.type} for ${header.compression}","messagePattern":"Unsupported pixelType (.+?) for (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/Materials/Textures/Loaders/EXR/exrLoader.decoder.ts","lineNumber":228,"sourceCode":"            case EXROutputType.HalfFloat:\r\n                decoder.getter = ParseUint16;\r\n                decoder.inputSize = INT16_SIZE;\r\n                break;\r\n        }\r\n    } else if (decoder.type === 2) {\r\n        // float\r\n        switch (outputType) {\r\n            case EXROutputType.Float:\r\n                decoder.getter = ParseFloat32;\r\n                decoder.inputSize = FLOAT32_SIZE;\r\n                break;\r\n\r\n            case EXROutputType.HalfFloat:\r\n                decoder.getter = DecodeFloat32;\r\n                decoder.inputSize = FLOAT32_SIZE;\r\n        }\r\n    } else {\r\n        throw new Error(\"Unsupported pixelType \" + decoder.type + \" for \" + header.compression);\r\n    }\r\n\r\n    decoder.blockCount = decoder.height / decoder.scanlineBlockSize;\r\n\r\n    for (let i = 0; i < decoder.blockCount; i++) {\r\n        ParseInt64(dataView, offset); // scanlineOffset\r\n    }\r\n\r\n    // we should be passed the scanline offset table, ready to start reading pixel data.\r\n    const size = decoder.width * decoder.height * decoder.outputChannels;\r\n\r\n    switch (outputType) {\r\n        case EXROutputType.Float:\r\n            decoder.byteArray = new Float32Array(size);\r\n            decoder.textureType = Constants.TEXTURETYPE_FLOAT;\r\n\r\n            // Fill initially with 1s for the alpha value if the texture is not RGBA, RGB values will be overwritten\r\n            if (fillAlpha) {\r","sourceCodeStart":210,"sourceCodeEnd":246,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/Materials/Textures/Loaders/EXR/exrLoader.decoder.ts#L210-L246","documentation":"The decoder only supports EXR pixel types 1 (half, UINT16) and 2 (float, FLOAT32). If decoder.type ends up as 0 (UINT) or any other value, it throws because no getter can be selected for integer pixels.","triggerScenarios":"Raised in CreateDecoderAsync when the recognized R/G/B/A/Y channel has pixelType !== 1 and !== 2 — i.e. an EXR whose image channels are stored as 32-bit unsigned integers (pixelType 0), possibly combined with any compression code.","commonSituations":"ID/object-index passes and cryptomatte-style integer EXRs exported from renderers; misconfigured exporters that write UINT instead of HALF/FLOAT.","solutions":["Re-export the EXR with half (UINT16) or float (FLOAT32) pixel type instead of UINT","Convert with oiiotool: `oiiotool in.exr -type half -o out.exr`","Check exporter settings — disable 'integer/ID pass' output for textures meant as color data","Inspect the file with exrheader to confirm channel pixel types"],"exampleFix":"// before: integer EXR (pixelType 0)\n// oiiotool id.exr -o id_uint.exr\n// after: convert to half float\n// oiiotool id.exr -type half -o id.exr","handlingStrategy":"validation","validationCode":"// EXR channels declare pixelType in the header; ensure exports use HALF(1)/FLOAT(2), not UINT(0)\n// pipeline check: reject assets whose pixelType is 0\nif (assetMeta.pixelType === 0) throw new Error(\"integer EXR not supported; re-export as half/float\");","typeGuard":"function isSupportedExrPixelType(pixelType: number): boolean {\n  return pixelType === 1 || pixelType === 2; // half or float, not UINT\n}","tryCatchPattern":"try {\n  await loader.loadAsync(file);\n} catch (e) {\n  if (/Unsupported pixelType/.test(String(e))) {\n    return loadHalfConverted(url); // re-converted to half float\n  }\n  throw e;\n}","preventionTips":["Disable UINT/ID-pass output for textures meant as images","Convert integer EXRs with `oiiotool in.exr -type half -o out.exr`","Verify pixel types with exrheader during asset validation","Keep ID/cryptomatte passes in a separate pipeline from textures"],"tags":["exr","pixel-type","unsupported-format"],"backgroundTag":"unsupported-exr-pixel-type","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}