Skip to content
glyphcss

Density & Detail

Loading…
Mesh: Elephant.glb

Raise density to shrink the cells while keeping the object the same size. This control changes the whole scene’s font size; open Code to see the CSS setting. Per-mesh density increases detail for individual objects instead.

<GlyphMesh geometry="cube" />
<GlyphMesh geometry="icosahedron" density={3} />

Place these inside your GlyphScene. The second mesh uses cells one-third the size in its own <pre>; omitted density or 1 uses the shared grid. Vanilla: scene.add(polygons, { density: 3 }). Vue uses :density="3"; HTML uses density="3".

OptionDefaultEffect
density1Resolution multiplier at the same screen size
fontSize—Explicit px number or CSS length; overrides density
lineHeight—Explicit row height multiplier; overrides density for that metric
transparentfalseSee-through layer: neither occludes nor is occluded

Detail layers require browser layout and are unavailable in static compilation. They work with orthographic, perspective, and first-person cameras.

Loading…
Mesh: Owl.glb

Line height changes vertical cell spacing. The camera projection uses the measured cell aspect, preserving the object’s proportions.

scene.add(polygons, { density: 2, mode: "ink", transparent: true });
Per-mesh optionEffect
glyphPaletteOwn solid ramp; unknown names use the default
ambientIntensityOwn ambient intensity; ambient color and key light stay scene-wide
modeOwn render mode; shares the base grid when it matches the scene

These overrides create separate layers even at base resolution. Character encoding, junctions, and weight ramps remain scene options. Opaque outline layers claim their full surface footprint; add transparent for an outline over other geometry.

Opaque layers resolve depth together. Use these options only when a detail mesh needs a different claim:

OptionDefaultEffect / limit
occlusionPriority0Higher values win regardless of depth; depth resolves equal priorities
occlusionClaim"alpha"Claim opaque texels; "geometry" claims the full triangle
occlusionContourPxunsetClaim ink plus a screen-pixel margin; 0 is tightest

occlusionContourPx does not steal another detail mesh’s cells. It costs a 4×-per-axis coverage pass across the scene; the margin caps at 6 / supersample output cells. Transparent layers skip occlusion entirely.

Each detail mesh adds a <pre> and render pass. Doubling density roughly quadruples cells. Keep detail for a few objects; set scene interactiveDownscale: 2 to lower resolution during gestures and restore detail on release. See performance.