{"record":{"id":"652157f1b02f9fb9","repo":"mrdoob/three.js","slug":"three-nodebuilder-uniform-type-not-impleme","errorCode":null,"errorMessage":"THREE.NodeBuilder: Uniform \"${ type }\" not implemented.","messagePattern":"THREE\\.NodeBuilder: Uniform \"(.+?)\" not implemented\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/nodes/core/NodeBuilder.js","lineNumber":3334,"sourceCode":"\tgetNodeUniform( uniformNode, type ) {\n\n\t\tconst nodeData = this.getSharedDataFromNode( uniformNode );\n\n\t\tlet node = nodeData.cache;\n\n\t\tif ( node === undefined ) {\n\n\t\t\tif ( type === 'float' || type === 'int' || type === 'uint' ) node = new NumberNodeUniform( uniformNode );\n\t\t\telse if ( type === 'vec2' || type === 'ivec2' || type === 'uvec2' ) node = new Vector2NodeUniform( uniformNode );\n\t\t\telse if ( type === 'vec3' || type === 'ivec3' || type === 'uvec3' ) node = new Vector3NodeUniform( uniformNode );\n\t\t\telse if ( type === 'vec4' || type === 'ivec4' || type === 'uvec4' ) node = new Vector4NodeUniform( uniformNode );\n\t\t\telse if ( type === 'color' ) node = new ColorNodeUniform( uniformNode );\n\t\t\telse if ( type === 'mat2' ) node = new Matrix2NodeUniform( uniformNode );\n\t\t\telse if ( type === 'mat3' ) node = new Matrix3NodeUniform( uniformNode );\n\t\t\telse if ( type === 'mat4' ) node = new Matrix4NodeUniform( uniformNode );\n\t\t\telse {\n\n\t\t\t\tthrow new Error( `THREE.NodeBuilder: Uniform \"${ type }\" not implemented.` );\n\n\t\t\t}\n\n\t\t\tnodeData.cache = node;\n\n\t\t}\n\n\t\treturn node;\n\n\t}\n\n\t/**\n\t * Formats the given shader snippet from a given type into another one. E.g.\n\t * this method might be used to convert a simple float string `\"1.0\"` into a\n\t * `vec3` representation: `\"vec3<f32>( 1.0 )\"`.\n\t *\n\t * @param {string} snippet - The shader snippet.\n\t * @param {string} fromType - The source type.","sourceCodeStart":3316,"sourceCodeEnd":3352,"githubUrl":"https://github.com/mrdoob/three.js/blob/da05705fa31f02710c19772a2aa70c7454807f0c/src/nodes/core/NodeBuilder.js#L3316-L3352","documentation":"Thrown by NodeBuilder.getNodeUniform() when a uniform's type is not one of the supported scalar/vector/matrix/color types (float/int/uint, vec/ivec/uvec 2-4, color, mat2/3/4). Any other type (bool, struct, array, sampler-as-uniform, custom) cannot be turned into a NodeUniform.","triggerScenarios":"Declaring a uniform with `uniform('bool')` or an unregistered/custom type; passing a uniform whose inferred type is an array or struct; using a texture/_sampler where a value uniform is expected; a node reporting a type string the uniform factory does not handle.","commonSituations":"Authoring a custom node that exposes a uniform of an unsupported type; mis-typing a uniform declaration; version mismatch where a type was not yet wired into the uniform factory.","solutions":["Use a supported primitive type for the uniform (float/int/uint, vec2-4, ivec2-4, uvec2-4, color, mat2-4).","Represent booleans as uint/int and convert in the shader body.","For array/struct data, use a buffer/instanced attribute or multiple scalar uniforms instead of a single typed uniform."],"exampleFix":"// before\nconst flag = uniform( 'bool' ).onBeforeRender( ... );\n\n// after\nconst flag = uniform( 'uint' );\n// convert in tsl: flag.equal( 1 )","handlingStrategy":"validation","validationCode":"const SUPPORTED_UNIFORM_TYPES = new Set( [ 'float','int','uint','vec2','vec3','vec4','ivec2','ivec3','ivec4','uvec2','uvec3','uvec4','color','mat2','mat3','mat4' ] );\nfunction assertUniformType( type ) {\n  if ( ! SUPPORTED_UNIFORM_TYPES.has( type ) ) throw new TypeError( `Unsupported uniform type: ${ type }` );\n}","typeGuard":"const isSupportedUniformType = ( t ) => SUPPORTED_UNIFORM_TYPES.has( t );","tryCatchPattern":null,"preventionTips":["Use only supported primitive types for node uniforms.","Encode booleans as uint/int and convert in the shader.","Use buffers/instanced attributes instead of typed uniforms for arrays/structs."],"tags":["node-builder","uniform","type-system"],"backgroundTag":null,"analyzedSha":"da05705fa31f02710c19772a2aa70c7454807f0c","analyzedAt":"2026-08-12T22:51:37.160Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}