threejs-worldgen
    Preparing search index...

    Interface StateContext

    Where and how the states are applied. Every field is optional.

    interface StateContext {
        cutout?: boolean;
        foliage?: boolean | Node<"float">;
        geometryNormal?: Node<"vec3">;
        look?: StateLook;
        position?: Node<"vec3">;
        puddles?: boolean;
        streaks?: boolean;
        time?: Node<"float">;
        worldNormal?: Node<"vec3">;
    }
    Index
    cutout?: boolean

    Allow damage to cut holes through opacity (needs alphaTest). Off for terrain.

    foliage?: boolean | Node<"float">

    Foliage (or a 0…1 foliage mask node): burn removes leaves through opacity.

    geometryNormal?: Node<"vec3">

    View-space geometric normal (no normal map): snow and puddles smooth the surface towards it. Default normalView.

    look?: StateLook

    Look to use. Default defaultStateLook.

    position?: Node<"vec3">

    Position the patterns (puddles, cracks, snow edges, …) are anchored to, metres. Default positionWorld. With a floating origin pass something that does not jump on rebase, e.g. positionLocal for objects or positionWorld + uniform(origin mod period) for terrain.

    puddles?: boolean

    Puddles on flat ground. Default true.

    streaks?: boolean

    Drip streaks on vertical faces. Default true.

    time?: Node<"float">

    Seconds, animating drips and embers. Default: the TSL time node; pass a uniform for scrubbable time.

    worldNormal?: Node<"vec3">

    World-space normal deciding up-facing (snow, puddles) and vertical (streaks). Default normalWorld.