Skip to content

Sampling Nodes

Geometry Proximity

Finds the closest point on a geometry surface to an input position, returning closest point, distance, and surface normal.

Inputs

  • Geometry (Geometry)
  • Position (Vector3)

Outputs

  • Closest Point (Vector3)
  • Distance (Float)
  • Normal (Vector3)

Tips

  • Wire Distance into a Compare or Clamp node to test whether a position is within range of a surface (useful for keeping scatter away from building footprints or wall boundaries).
  • Closest Point gives the projection of the query position onto the nearest triangle: wire to a GeometryTransform Translate port to snap objects onto the surface.
  • Normal at the closest point gives the facing direction of the nearest surface: use to orient spawns toward or away from the nearest face.

Raycast

Casts a ray against a geometry mesh, returning hit position, surface normal, distance, and a hit flag.

Inputs

  • Geometry (Geometry)
  • Ray Origin (Vector3)
  • Ray Direction (Vector3)

Outputs

  • Hit Position (Vector3)
  • Normal (Vector3)
  • Distance (Float)
  • Hit (Float)

Tips

  • Hit outputs 1 on intersection, 0 on miss (not an error). Always check Hit before consuming Hit Position or Distance.
  • Geometry must contain triangle indices. Empty Geometry or a point-cloud produces no hits.
  • Ray Direction is normalised at evaluation time. The un-normalised magnitude does not scale the ray’s maximum range.

Sample Heightmap

Samples the Y height of a geometry mesh at a given XZ position using triangle intersection and barycentric interpolation.

Inputs

  • Geometry (Geometry)
  • X (Float)
  • Z (Float)

Outputs

  • Height (Float)
  • Hit (Float)

Tips

  • Returns Height = 0 and Hit = 0 when XZ is outside the mesh: check the Hit output rather than testing height against zero.
  • The source mesh must have dense enough triangulation to cover the sampled area. A coarse plane produces staircase artifacts between vertices.

Sample Ramp

Samples an AnimationCurve LUT at a given t position and returns the remapped float output. Wire a Curve Ramp parameter to the Curve port.

Inputs

  • Curve (Float)
  • T (Float)

Outputs

  • Value (Float)

Tips

  • t outside [0,1] is handled by the wrap mode set on the Curve Ramp parameter node.
  • Clamp: t < 0 returns the first sample; t > 1 returns the last.
  • Repeat: t cycles as a sawtooth; Mirror: t bounces back and forth.

Sample Texture 2D

Samples a Texture2D at UV coordinates using bilinear filtering, returning R, G, B, and A as separate float outputs.

Inputs

  • Texture (Texture)
  • U (Float)
  • V (Float)

Outputs

  • R (Float)
  • G (Float)
  • B (Float)
  • A (Float)

Splat Height Blend

Blends 4 authored height scales by normalised RGBA splat-channel weights; wire the result into the Height Scale input of a geometry node that reads world surface height.

Inputs

  • R (Float)
  • G (Float)
  • B (Float)
  • A (Float)

Outputs

  • Height Scale (Float)

Options

  • h0: Height scale for splat region R (red channel fully dominant). Wire the blended output into the Height Scale input of a geometry node that reads world surface height.
  • h1: Height scale for splat region G (green channel fully dominant).
  • h2: Height scale for splat region B (blue channel fully dominant).
  • h3: Height scale for splat region A (alpha channel fully dominant).

Tips

  • Wire R, G, B, A from a Sample Texture 2D sampling the splat map. Each output represents one authored region’s contribution to the final height scale.
  • The blend is normalised: mixed-region pixels blend proportionally. A pixel that is 50 % R and 50 % G outputs (h0 + h1) / 2.
  • Height Scale is evaluated once per terrain chunk, not per-vertex. For smooth inter-region height transitions within a chunk, wire a height ramp into the geometry node’s heightmap input instead.
  • When the splat is fully empty (all zero channels), h0 (region R) is used as the fallback.

Splat Region Pick

Returns the index (0–3) of the dominant RGBA splat channel at a sampled point: R=0, G=1, B=2, A=3.

Inputs

  • R (Float)
  • G (Float)
  • B (Float)
  • A (Float)

Outputs

  • Region Index (Float)

Tips

  • Wire R, G, B, A from a Sample Texture 2D node sampling the splat texture. Each channel represents one authored region.
  • Feed the output into a Weighted Pick or Material Tag node to select a material or biome per region index.
  • When the splat is fully empty (all channels zero), region 0 (R) wins. Paint a base R=1 layer to set the fallback region explicitly.

World Height

Samples a world capture’s heightfield at an XZ position, returning height, surface normal, and a hit flag.

Inputs

  • Position (Vector3)

Outputs

  • Height (Float)
  • Normal (Vector3)
  • Hit (Float)

World To Splat UV

Converts world XZ coordinates to splat texture UV by dividing by tile size and applying a UV offset.

Inputs

  • World X (Float)
  • World Z (Float)

Outputs

  • U (Float)
  • V (Float)

Options

  • tileSize: Size in world units that the splat texture spans per tile. A value of 100 means UV 0–1 covers 100 world units along each axis. Match this to the terrain tile size your splat map was painted for.
  • offsetU: UV offset along U before sampling (0–1 wraps). Shifts the splat horizontally relative to world origin.
  • offsetV: UV offset along V before sampling (0–1 wraps). Shifts the splat vertically relative to world origin.

Tips

  • Connect the X and Z outputs of a Position node to World X and World Z. Tile Size controls how many world units span one full UV tile: 100 means the texture repeats every 100 units.
  • Compose with Texture2D Input → Sample Texture 2D to read a splat map: World X/Z → World To Splat UV → U/V → Sample Texture 2D → R/G/B/A region weights.
  • Use Offset U and Offset V to shift the splat relative to world origin when the splat was authored offset from (0, 0).