fast-mesh-wasm
    Preparing search index...

    Interface BindMeshOptions

    Options of bindMesh.

    interface BindMeshOptions {
        color?: ColorRepresentation;
        edgeSoftness?: number;
        map?: Texture<unknown, TextureEventMap>;
        material?:
            | MeshStandardMaterial
            | MeshPhongMaterial
            | MeshLambertMaterial
            | MeshBasicMaterial;
        opacity?: number;
        shading?: "vertex"
        | "fragment";
    }
    Index
    color?: ColorRepresentation

    The colour shown while the mesh has no colouring. Defaults to the given material's colour (left untouched), or light grey for the default material.

    edgeSoftness?: number

    Fragment shading: the width, in the field's distance units, of the blend at each colour step (a range edge to the base colour, the edges of a contact band). 0 (the default) is a hard edge. Ignored by vertex shading. See BoundMesh.setEdgeSoftness.

    map?: Texture<unknown, TextureEventMap>

    The texture to draw the mesh's UVs with: sets the material's map, and makes the default material's colour white. A material that already has a map needs no more. Either way the map is on while the mesh has UVs: an operation that drops them (see docs/uv-channel.md) takes it off rather than stretch one texel over the surface, and undo puts it back. The texture stays the caller's to dispose. glTF UVs want texture.flipY = false, as three's GLTFLoader sets.

    material?:
        | MeshStandardMaterial
        | MeshPhongMaterial
        | MeshLambertMaterial
        | MeshBasicMaterial

    The material to draw with. Defaults to a new MeshStandardMaterial, which BoundMesh.dispose then disposes; a material passed here is used as given and left to the caller to dispose.

    The binding controls the material's color, vertexColors, opacity, transparent and depthWrite (colouring and BoundMesh.setOpacity change them), so do not share one material between bound meshes: give each its own (material.clone()). With shading: "fragment" the binding calls the material's dispose() when it binds and again when it is disposed and puts the material back (dropping its compiled program so it is rebuilt with, then without, the shading); the material stays usable.

    opacity?: number

    Initial opacity in [0, 1], applied with BoundMesh.setOpacity. Without it, the default material is opaque and a given material keeps its opacity, transparent and depthWrite.

    shading?: "vertex" | "fragment"

    How a colouring is drawn.

    • "vertex" (the default): the engine's colours as a vertex attribute, interpolated across each triangle, so the edge between coloured and base-coloured vertices blurs over a triangle's width.

    • "fragment": every fragment is coloured from the interpolated field value through the colouring's rule (a lookup texture and a shader chunk added to the material with onBeforeCompile, so WebGLRenderer only). Range edges and colour steps (a contact heatmap's tolerance band) are crisp iso-lines of the value, softened with edgeSoftness, and gradients are smooth per pixel. At a vertex the colour equals its vertex colour. Far (Infinity) and NaN values never tint their neighbours. Needs a scene with coloring(mesh) and views(mesh).values (Scene and WorkerScene have both); on another host the binding falls back to "vertex" (BoundMesh.shading), and so does a material three's WebGLRenderer does not build from its own shader chunks (a node material for WebGPURenderer, say), with a warning.

      The binding patches the material it draws with, so each fragment-shaded binding needs its own material (material.clone()): binding a material another live fragment-shaded binding uses throws INVALID_ARGUMENT. Disposing the binding puts the material back as it was (and disposes its compiled program, so a later binding recompiles with its own uniforms).