hex-world
    Preparing search index...

    Function createResourceIconMaterial

    • Camera-facing icon material for one resource type.

      The quad is billboarded in view space — the instance matrix contributes only its translation, and the corners are pushed out along the view axes — so icons stay legible from every camera angle without any per-frame CPU work.

      Fog is read from the same FogData texture the terrain samples, through a per-instance cellIndex attribute, so an icon follows the memory tiers its ground does: hidden while unexplored, dimmed once explored but out of sight, full strength while visible.

      Parameters

      • descriptor: ResourceDescriptor
      • Optionalicon: Texture<unknown, TextureEventMap>
      • opts: { depthTest?: boolean; occludedPass?: boolean; strength?: number } = {}
        • OptionaldepthTest?: boolean

          Disable to draw over occluders instead of being clipped by them. Default true.

        • OptionaloccludedPass?: boolean

          Build the ghost pass: reverse the depth test (GreaterDepth) so the material draws only where geometry occludes it. Pair with strength.

        • Optionalstrength?: number

          Alpha multiplier — the ghost pass's dimming. Default 1.

      Returns ShaderMaterial