hex-world
    Preparing search index...

    Function injectSeasonLookup

    • Inject the per-cell climate lookup into a stock material, once per shader however many seasonal effects are attached to it — a second copy would redeclare cellIndex and fail to compile.

      Publishes five varyings for the effects to read: vSeasonSnow (depth), vSeasonTemp (season-adjusted temperature), vSeasonSeed (a stable per-instance hash), vSeasonUp (how far the surface faces the sky, in world space so it doesn't swing with the camera), and vSeasonWorldXZ.

      Requires a per-instance (or per-vertex) cellIndex attribute — buildScatterMeshes attaches one to every scatter mesh. Without it every instance reads cell 0.

      Parameters

      • shader: ShaderSource

      Returns void