billboard.shader
- .metadata17 B
- README.md1.4 KB
- preview.png3.0 KB
- properties.yaml908 B
- shader.wgsl2.9 KB
This package holds more than this page lists. See all of its files in its world.
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.
exposure_weight (0 to 1, default 0) says how much of the camera's exposure the
colour is drawn against. At 0 the colour is light in the scene, so a night
exposure brightens it and a day exposure dims it, like a lamp of that colour. At
1 the exposure carries it back to the colour it states on screen at every
exposure, the way text and UI read: a label reads the same at noon and at
midnight.