threejs-worldgen
    Preparing search index...

    Function createTerrainMaterial

    • The terrain's node material: per-vertex biome soil colours, per-pixel rock / snow / sand / mud from slope, temperature, height and rivers, then procedural detail that depends on the ground (rock grain, snow sparkle, sand ripples, wet darkening) and micro bumps, all fading out with distance so far LODs don't shimmer. Each chunk mesh must set userData.detailOffset (its centre modulo the detail period, a Vector3) and userData.level.

      Parameters

      Returns {
          material: MeshStandardNodeMaterial;
          setDebug: (debug: TerrainDebug) => void;
          uniforms: {
              brightness: UniformNode<"float", number>;
              bump: UniformNode<"float", number>;
              detail: UniformNode<"float", number>;
              detailDistance: UniformNode<"float", number>;
              detailScale: UniformNode<"float", number>;
              mudColor: UniformNode<"color", Color>;
              rockColor: UniformNode<"color", Color>;
              rockSlope: UniformNode<"float", number>;
              sandBand: UniformNode<"float", number>;
              sandColor: UniformNode<"color", Color>;
              saturation: UniformNode<"float", number>;
              snowColor: UniformNode<"color", Color>;
              snowTemperature: UniformNode<"float", number>;
          };
      }