Builtin Library
- ..
- .metadata17 B
- README.md1.0 KB
- preview.png3.0 KB
- properties.yaml538 B
- shader.wgsl2.6 KB
README.md
billboard
Camera-facing billboard shader for textured quads — labels, sprites, and 3D text. All four corners of the quad sit at the same anchor, so the vertex's world position is the anchor under any entity or parent transform. Each corner carries its in-plane offset in the vertex colour; the vertex stage offsets the corner in world space facing whichever camera renders the pass, so the quad is visible and correctly framed from the main viewport, an offscreen capture, and a render-texture camera alike. Because the offset is applied in world space before projection, the quad keeps real extent and stays drawn when the anchor leaves the frustum. The horizontal axis stays world-level, so it tracks a pitching camera without rolling.
The world size lives in the per-corner offset (resizing rebuilds the vertex
colours), so there are no size material properties, and the mesh declares its own
render bounds so frustum culling keeps it. The fragment mirrors unlit:
base_color * base_color_texture with masked-transparency cutoff.