{"record":{"id":"e23352a16fea2858","repo":"BabylonJS/Babylon.js","slug":"extensioncontext-gaussian-splatting-primitives","errorCode":null,"errorMessage":"${extensionContext}: Gaussian splatting primitives must use POINTS mode","messagePattern":"(.+?): Gaussian splatting primitives must use POINTS mode","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/loaders/src/glTF/2.0/Extensions/KHR_gaussian_splatting.pure.ts","lineNumber":75,"sourceCode":"    public dispose(): void {\r\n        (this._loader as any) = null;\r\n    }\r\n\r\n    /**\r\n     * @internal\r\n     */\r\n    // eslint-disable-next-line no-restricted-syntax\r\n    public _loadMeshPrimitiveAsync(\r\n        context: string,\r\n        name: string,\r\n        node: INode,\r\n        mesh: IMesh,\r\n        primitive: IMeshPrimitive,\r\n        assign: (babylonMesh: AbstractMesh) => void\r\n    ): Nullable<Promise<AbstractMesh>> {\r\n        return GLTFLoader.LoadExtensionAsync<IKHRGaussianSplatting, AbstractMesh>(context, primitive, this.name, async (extensionContext) => {\r\n            if (primitive.mode != undefined && primitive.mode !== MeshPrimitiveMode.POINTS) {\r\n                throw new Error(`${extensionContext}: Gaussian splatting primitives must use POINTS mode`);\r\n            }\r\n\r\n            const loader = this._loader;\r\n\r\n            const loadAttribute = (attributeName: string): Nullable<Promise<Float32Array>> => {\r\n                const accessorIndex = primitive.attributes[attributeName];\r\n                if (accessorIndex == undefined) {\r\n                    return null;\r\n                }\r\n                const accessor = ArrayItem.Get(`${context}/attributes/${attributeName}`, loader.gltf.accessors, accessorIndex) as IAccessor;\r\n                return loader._loadFloatAccessorAsync(`/accessors/${accessor.index}`, accessor);\r\n            };\r\n\r\n            const positionsPromise = loadAttribute(\"POSITION\");\r\n            if (!positionsPromise) {\r\n                throw new Error(`${extensionContext}: Gaussian splatting primitive is missing the POSITION attribute`);\r\n            }\r\n\r","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/loaders/src/glTF/2.0/Extensions/KHR_gaussian_splatting.pure.ts#L57-L93","documentation":"The KHR_gaussian_splatting glTF extension loader only supports primitives whose rendering mode is POINTS (mode 0), since splats are rendered as point clouds. When a gaussian-splatting mesh primitive declares any other primitive mode (triangles, lines, etc.), the loader throws immediately in _loadMeshPrimitiveAsync to prevent silently rendering the splat data incorrectly.","triggerScenarios":"Loading a .gltf/.glb that uses the KHR_gaussian_splatting extension on a mesh primitive whose 'mode' property is defined and is not 0 (POINTS), e.g. mode 4 (TRIANGLES) exported by a splat-to-glTF converter.","commonSituations":"Using a converter/exporter that defaults primitives to TRIANGLES while attaching the gaussian splatting extension; hand-editing glTF JSON and forgetting mode:0; a spec update changing mode requirements so older assets no longer load.","solutions":["Set \"mode\": 0 (POINTS) on the gaussian splatting mesh primitive in the glTF JSON","Re-export the asset with a converter that emits POINTS mode for KHR_gaussian_splatting primitives","If the primitive is not actually a splat, remove the KHR_gaussian_splatting extension from that primitive"],"exampleFix":"// before\n\"primitives\": [{ \"attributes\": { \"POSITION\": 0 }, \"mode\": 4, \"extensions\": { \"KHR_gaussian_splatting\": {} } }]\n// after\n\"primitives\": [{ \"attributes\": { \"POSITION\": 0 }, \"mode\": 0, \"extensions\": { \"KHR_gaussian_splatting\": {} } }]","handlingStrategy":"validation","validationCode":"function validateSplatPrimitive(primitive) {\n  if (primitive.mode !== undefined && primitive.mode !== 0 /* POINTS */) {\n    throw new Error(`KHR_gaussian_splatting primitive must use POINTS mode (got ${primitive.mode})`);\n  }\n}\n// run for each primitive of each mesh before loader.loadAsync","typeGuard":"const isPointsMode = (p: { mode?: number }): p is { mode: 0 } => p.mode === undefined || p.mode === 0;","tryCatchPattern":"try {\n  await loader.loadAsync(url);\n} catch (e) {\n  if (e instanceof Error && e.message.includes(\"must use POINTS mode\")) {\n    console.error(\"Asset has gaussian-splatting primitive with non-POINTS mode; re-export it.\");\n  } else throw e;\n}","preventionTips":["Always export splat primitives with mode 0 (POINTS)","Run glTF validation on assets in CI before loading them at runtime","Keep splat conversion tools up to date with the KHR_gaussian_splatting spec"],"tags":["gltf","loader","extension","gaussian-splatting"],"backgroundTag":"gltf-primitive-mode-unsupported","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}