API

Interface GridMaterialOptions

Options for createGridMaterial. Mirrors Babylon.js GridMaterial: an unlit, procedural object-space grid. All fields are optional and fall back to the Babylon defaults.

interface GridMaterialOptions {
    antialias?: boolean;
    backFaceCulling?: boolean;
    gridOffset?: GridVec3;
    gridRatio?: number;
    lineColor?: GridVec3;
    mainColor?: GridVec3;
    majorUnitFrequency?: number;
    minorUnitVisibility?: number;
    name?: string;
    opacity?: number;
    opacityTexture?: Texture2D;
    preMultiplyAlpha?: boolean;
    useMaxLine?: boolean;
    visibility?: number;
}
Index
antialias?: boolean

Cosine-based antialiasing of the lines. Default true.

backFaceCulling?: boolean

Cull back faces. Default true.

gridOffset?: GridVec3

Object-space offset added before computing the grid. Default [0,0,0].

gridRatio?: number

Spacing of the grid in object-space units. Default 1.

lineColor?: GridVec3

Color of the grid lines. Default teal [0,0.5,0.5].

mainColor?: GridVec3

Background color between the lines. Default black [0,0,0].

majorUnitFrequency?: number

Every Nth line is a major line. Rounded with Math.round. Default 10.

minorUnitVisibility?: number

Visibility of the minor (non-major) lines, 0..1. Default 0.33.

name?: string
opacity?: number

Opacity of the grid outside of the lines. <1 enables the transparent path. Default 1.

opacityTexture?: Texture2D

Optional opacity texture; its .a channel multiplies the final opacity.

preMultiplyAlpha?: boolean

Premultiply rgb by alpha (transparent path only). Default false.

useMaxLine?: boolean

Combine axes with max instead of additive sum. Default false.

visibility?: number

Per-material visibility multiplier applied to the final alpha. Default 1.