threejs-worldgen
    Preparing search index...

    Function createVehicleMaterial

    • The one material every vehicle part shares. Per vertex: color (own colour) and vstyle (paint, glow, finish). Per instance: vehicleLook (tint rgb, heat) and vehicleStates (wetness, snow, burn, damage, from threejs-weathering's InstanceStates). The tint goes in through colorNode, before the weathering states, so snow stays white and ash stays grey on any paint. Painted surfaces are metallic paint under a clear coat (lost under snow, ash and heavy damage); finishes give glass, chrome, brushed stainless steel (anisotropic, brushed along the vehicle) and rubber. Damage also dents the body.

      Parameters

      • u: { crumple: UniformNode<"float", number>; lights: UniformNode<"float", number> }
        • crumple: UniformNode<"float", number>

          Dent depth at full damage, metres.

        • lights: UniformNode<"float", number>

          Headlights and lit windows, 0…1.

      • Optionallook: StateLook

      Returns MeshPhysicalNodeMaterial