Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit3bb1da2647

README.md

debug_icons

The "icons" provider for @builtin::modules.debugViz: draws one camera-facing billboard icon per meshless entity (audio source, camera, light) every active tick. The debug-viz driver registers it; the ambient overlay draws it with no per-entity setup.

How it works

The three built-in visuals are registered once with debugViz.registerIcon (procedural glyphs from the debugBillboard shader). tick(emit) then queries each meshless component type and draws its icon at the entity's world position via emit.icon, tinted per entity:

  • AudioSource — a yellow audio (speaker) icon, plus a faint yellow wireframe sphere via emit.wireSphere sized to maxDistance when the source is spatial.
  • Camera — a light-blue camera icon. (debug_frustum already draws the camera's frustum; this marks its position.)
  • Light — a light (sun) icon, tinted by the light's own color.

The core owns the anchor, the per-icon billboard materials and vertex buffers, and the render feature that draws them — this module only registers the visuals and contributes their positions.

Defining your own icons

This is the pattern any system uses to show a gizmo icon. Register a visual once, then emit it wherever it belongs:

local debugViz = require("@builtin::modules.debugViz")

-- A built-in procedural glyph, or a texture the icon samples:
debugViz.registerIcon("spawnPoint", { glyph = "camera" })
debugViz.registerIcon("waypoint",   { texture = "@mylib::icons.waypoint", size = 0.05 })

-- From a provider's tick, draw it per entity (optionally tinted):
emit.icon(entity.position, "waypoint", { 0, 1, 0, 1 })

API

  • debug_icons.tick(emit) — draw one icon per meshless entity (audio source, camera, light) in the scene, into the shared batch.