Skip to content
glyphcss

Render Modes

Loading…
Mesh: Horse.glb

Switch modes on the same object, then drag to orbit. Code follows the selection. Set scene mode through createGlyphScene, GlyphScene, or <glyph-scene>; a mesh can override it with its own layer.

ModeAppearance / use
wireframeAll polygon edges; geometric cages and line art
solidFilled surfaces with a shaded glyph ramp; default mode
inkSilhouettes and crease outlines; empty interiors
voxelCurrently uses wireframe rasterization; no dedicated voxel density mapping
Loading…
Mesh: Shark.glb

Braille draws up to eight dots per cell for smoother wireframe edges. ASCII uses the selected glyph palette.

Loading…
Mesh: Frog.glb
charModeSupported modeWhat changes
"ascii" (default)AllOne ramp or edge glyph per cell
"braille"Wireframe2×4 dot coverage
"halfblock"SolidTwo vertically stacked colors per cell
"quadrant"Solid2×2 coverage with up to two colors per cell

Unsupported combinations are no-ops. Halfblock and quadrant are also inactive with transformCells or active temporalBlend. Uncovered subcells keep a transparent background. These encodings require a font with the corresponding Unicode glyphs.

Box-drawing junctions (wireframeJunctions)

Section titled “Box-drawing junctions (wireframeJunctions)”
Loading…

Enable junctions for connected corners and crossings (┌┐└┘├┤┬┴┼─│). Default: false. Applies only to near-axis-aligned ASCII wireframe edges; diagonal strokes keep their usual glyphs. Runtime-only.

Loading…

Choose "hide" to suppress strokes behind nearer surfaces; default "show" keeps them. Works with ASCII/Braille wireframe and ink. Solid already depth-tests its cells. Accepted by compileScene and GlyphSceneStatic too.

scene.setOptions({ smoothShading: true, creaseAngle: 60 });

Solid uses flat shading by default. Smooth shading averages vertex normals across creases up to creaseAngle degrees. Lighting and palette options are listed in GlyphScene.

import { calibrateWeightedGlyphRamp } from "@glyphcss/effects";
const { steps } = calibrateWeightedGlyphRamp({
font: { family: "monospace", size: 32 }, steps: 24, weights: [400, 700],
});
scene.setOptions({ solidWeightRamp: steps.map(({ glyph, weight }) => ({ glyph, weight: Number(weight) })) });

solidWeightRamp replaces the solid glyph ramp with glyph/weight steps ordered darkest → densest. Default: unset. Inactive outside solid, with halfblock/quadrant, or during temporal blending. Also accepted by compileScene; custom elements take it as a JavaScript property.

<GlyphScene mode="solid" shadow={{ color: "#000000", opacity: 0.25, lift: 0.05 }}>
<GlyphMesh geometry="cube" castShadow receiveShadow />
<GlyphGround />
</GlyphScene>

Place this scene inside a camera. Shadows are opt-in; each mesh must enable casting/receiving. GlyphGround receives by default. lift is a world-unit depth bias; scale it to your scene. maxExtend is accepted but has no effect.

Use the geometry selector in creating shapes or load your own mesh.