It’s not meant to be used directly, but rather the already existing implementations which work just like regular three.js materials but offer relative to eye rendering support.
- SpeckleStandardMaterial
- SpeckleBasicMaterial
- SpeckleLineMaterial
- SpecklePointMaterial
- SpeckleTextMaterial
Accessors
Gets the base three.js uniforms for this material. So for example SpeckleStandardMaterial has the base uniforms as ShaderLib.standard.uniforms.
Returns: An object containing the uniforms
fragmentProgram
Gets the fragment program source code.
Returns: string
pointSize
Sets the point size for point materials.
Returns: number
stencilOutline
Can enable the material to have stencil outlines.
Returns: void
Define the custom uniforms for the material.
Returns: _Uniforms_ which is an alias for Record<string, any>
vertexProgram
Gets the vertex program source code.
Returns: string
Methods
fastCopy
Copies properties from one from Material to to Material. The data copied over is restricted to no more and no less than what the viewer needs, so unlike three.js default material copying this aims to be as fast as possible.
Parameters:
Returns: void
Typedefs
DisplayStyle
Speckle model for material properties on lines.
- id: The id of the style object
- color: The color of the line
- lineWeigth: The thickness of the line in world units
- optional opacity: The opacity of the line
FilterMaterial
Filter materials are pre-defined materials that you can directly apply with as little configuration as possible.
- filterType: FilterMaterialType
- optional rampIndex: The index of the color in the ramp texture. Applies only for FilterMaterialType.COLORED and FilterMaterialType.GRADIENT
- optional rampIndexColor: The actual color from the ramp texture. Applies only for FilterMaterialType.COLORED and FilterMaterialType.GRADIENT
- optional rampTexture: The ramp texture. Applies only for FilterMaterialType.COLORED and FilterMaterialType.GRADIENT
FilterMaterialType
The list of available filter materials.
MaterialOptions
Custom options for materials.
- optional stencilOutlines: StencilOutlineType. Only applies to meshes
- optional pointSize: The point size for point materials. Only applies to points
- optional depthWrite: Whether the material should write to depth
RenderMaterial
Speckle model for material properties of meshes.
- id: The id if the render material
- color: Color as a int32
- opacity: Opacity
- roughness: Roughness
- metalness: Metalness
- vertexColors: Whether the material reads vertex colors
StencilOutlineType
- NONE: No outlines
- OVERLAY: Outline on top of object
- OUTLINE_ONLY: Outline only, rest of the object is not visible
Last modified on July 18, 2026