Wireface for three.js · games and 3D

Faces for your three.js characters.

Give a game character, an NPC, a robot, a ghost or a pumpkin a face that talks with real lip sync, shows what it feels, and looks at whatever you choose: Wireface's own face as three.js geometry, a face drawn on the object itself, or a model's own eyes and mouth brought to life. Lit by your scene, and as many as you like.

See licence information

Wireface for three.js promo preview

Live demo

Meet the cast, live in your browser.

Pick a character, move your pointer and turn on sound. The face is rendered live with three.js, using the same animation engine as the SDK.

Eleven three.js characters on a stage, Count Dracula speaking while the others look at him: a portrait, a ghost with a face drawn on its sheet, a jack-o'-lantern scarecrow, an astronaut, a TV head

What a face can do

Everything Wireface's face does, in your scene

It's the same animator that runs Wireface Desktop and the face at the top of this site: the blinks, breathing, gestures, expressions and lip sync, frame for frame. Here it moves three.js geometry, and your characters move with it.

Lip sync, three ways

Recorded lines aligned phoneme by phoneme (the lips close on every m, b and p); live audio from a microphone or a call; and streamed speech, Gemini Live conversations included.

await face.say(clip, { audioContext })

Expressions and moods

Fifteen moods for a few seconds or worn standing, states like thinking and asleep that change the eyes and posture, and expressions of your own from the rig's channels.

face.express('surprised')

Eyes on the world

Look at anything in the scene: the camera, a point, another character's head. The eyes go first and converge on it; the head turns for the rest, as a person's does.

face.gazeAt(camera)

Four looks

Photo skins (any portrait, made in the browser), sculpted, cel-shaded and Wireface's glowing hologram in seven colours. Skins sweep on, wireframes cross-fade, faces burn away and come back.

face.set({ style: 'toon' })

A whole head

The face brings the back of a head in its skin's colour. It tells you where its eyes, ears and crown are for hair, hats and glasses, and gives ears and hands its own skin.

face.head.add(hat)

Rigged models

Put it on a glTF model's head bone: the face's nods and turns are added on top of your animations, so a character can wave, dance and talk at once.

attachFace(findBone(robot, /head/i), face)

Three ways

Three ways to give a character a face

The same face four ways: a photo skin, a sculpted head, a cel-shaded one, and a violet hologram

Wireface's face on a head

FaceMesh: Wireface's 468-point face, posed every frame and drawn by three.js, with the back of a head. Lit and shadowed by your scene, seen from any side, as many as you like. For people, creatures, aliens and crowds.

A red tin can with a cartoon face drawn on it, wrapped round its curve and lit with the metal

A face drawn on the object

Draw a face in the object's own colours and Wireface 2D makes the drawing talk, wrapped round its curve (wrapGeometry) and painted on its own material (paintOn). A ghost's sheet, a pumpkin, a can.

A glTF robot with lids over its own eyes and a mouth on its face, talking

A model's own face, rigged

ModelFace: a model's own eyes get lids that blink and a glint that follows you, and it gets a mouth that lip-syncs, laid on its head. Gemini Pro finds where they go; the result is saved and played back.

A monitor on a desk showing Wireface's glowing cyan hologram face

And on a screen

FaceScreen: a whole Wireface face drawn by its own engine as a live texture, on a monitor, a visor or a TV, or Wireface 2D making a painting talk.

All of them answer to the same methods, so a character doesn't need to know which it has.

The cast

Eleven characters to start from

Each one is a short file showing one way to give a character a face, and all of them are on one stage in the demo: click anyone to hear them, and the rest turn to look.

The whole cast on the Wireface Theatre's stage
  • Sarah a photo skin, long red hair, ears in her skin tone
  • Walter glasses and a cap placed from the face's own measurements
  • Count Dracula a skin that brings its fangs, and a lined cape
  • Grub an ogre whose belly, hands and ears all match his skin
  • Unit-7 a metal skull, and lights that blink to its voice
  • Zib no photo: a sculpted alien with a bigger brain
  • Wisp a face drawn on its ghost sheet, wrapped round the cloth
  • Patch a jack-o'-lantern face carved in his pumpkin, lit from inside
  • Captain Amara Wireface core's renderer on a helmet's visor
  • Eleanor Wireface 2D makes an oil portrait talk
  • Kit a TV for a head, showing 2D's pixel art: change the channel

For developers

A few lines on any head

import { FaceMesh, attachFace } from '@wireface/sdk/three';

const face = new FaceMesh({ skin: 'sarah', size: 0.27 });
attachFace(character.head, face);   // it nods and sways the head
face.gazeAt(camera);                // eyes first, then the head
face.express('happy');
await face.say(await face.clip('sarah'), { audioContext });

What's in it

  • Three ways to a face: FaceMesh on a head, a face drawn on the object (FaceScreen, wrapGeometry, paintOn), and a model's own face (ModelFace); and FaceScreen on screens.
  • Wireface core's animation: the same expressions, gaze and lip sync, and the same method names.
  • Eleven characters and the kit they're built from: hair, ears, bodies and toy materials.
  • Fourteen examples: a glTF robot given a face of its own, a face drawn on a can, a snowman, a crowd, a microphone, a Gemini Live chat, each with a line to say.
  • A user guide, tests that run in Node, and no build step.
A glTF robot with lids over its own eyes and a mouth on its face, talking

On a rigged model: its own eyes blink and its new mouth talks (ModelFace, on the head findBone() finds), while the model's own animations play underneath.

Run it yourself

It's in the Wireface SDK, with the three.js examples. Get the SDK, add it to your project next to three.js, then follow the three.js user guide.

See it for real

Step into the Wireface Theatre

Eleven characters on one stage, in your browser. Click anyone to hear their line, change their looks and their skins, and watch the others turn to look.

Using Wireface with the SDK is free under the Personal Licence for personal and commercial use, such as your own website, including character creation and the optional detection API. Putting it into a product, app or service you sell or charge for, such as a SaaS product, needs a Developer Licence (freelancers, indie developers and companies with fewer than 10 employees) or, for larger companies, an Enterprise Licence. Desktop and Chat have their own licences. See licensing.