Wireframe
Wireframe draws an anti-aliased outline along each triangle edge using barycentric coordinates derived in the fragment stage. It needs no geometry shader, runs on every URP-supported platform, and pairs with Emission for glowing sci-fi grid materials.
An emissive barycentric wireframe over a rotating low-poly mesh.
When to use it
- Debug visualization — verify mesh topology in-engine.
- Sci-fi grid materials — holographic ships and virtual-world props.
- Construction previews in strategy games.
- Stylized low-poly art — accentuate triangle edges.
Difference from Outline
How it works
Genesis writes a barycentric attribute per triangle vertex, then in the fragment stage computes the minimum barycentric and applies an anti-aliased smoothstep based on screen-space derivatives via fwidth(). No geometry shader and no mesh modification are needed.
A low-poly mesh with and without the wireframe overlay. Drag to compare.
Properties
Usage
- Enable Wireframe; the barycentric attribute is generated automatically.
- Set Wire Width in screen pixels (1.5 reads crisp, 3+ reads chunky).
- Pick wire and fill colors independently — for sci-fi, a cyan wire over a dark fill.
- For a debug overlay, enable Fill From Albedo to keep the surface readable beneath the wires.
material.SetColor("_WireframeColor", new Color(0.3f, 1.0f, 1.0f) * 3.0f);
material.SetFloat("_WireframeWidth", 1.5f);
material.SetFloat("_WireframeEmissive", 1.0f);Tips & gotchas
- It requires
fwidth()derivatives — supported on every URP GPU, but verify on very old Android (PowerVR SGX) if you target it. - Triangle count matters: a 100k-tri mesh becomes mostly wire at any reasonable width, so use proxy meshes for huge wireframes.
- Static batching merges meshes and can confuse barycentrics. Disable static batching on wireframe materials or use a unique submesh.
- Pairs with Emission and Bloom — HDR wire tints sell the sci-fi grid look.
Related
- Emission — feeds bloom for glowing wires.
- Outline — silhouette stroke alongside wireframe.
- Hologram — wireframe plus holo gives the full sci-fi look.
- Rendering Modes — pair with Unlit for pure-grid materials.
Last updated on