Communitygithub.com

cel-toon-3d

The 2D/3D animation style from the Rot Squad game, for three.js browser games — hard-banded cel shading with painted (coloured, not grey) shadows, a crisp rim light, dark outlines around every shape, and movement held "on twos" (poses update 12 times a second while positions stay smooth), so 3D reads like hand-drawn animation, as in Fortnite-meets-anime cartoon games. Comes with a starter project, a shading library, a low-poly modelling kit, a 9-bone rig with walk/run/jump/emote poses, and a way to apply the look to imported GLTF models. Palette- and theme-free. Use this skill whenever the user wants that Rot Squad shading or movement style, cel-shaded / toon / anime / cartoon 3D characters or scenes, "2D-looking 3D", stepped or "on twos" animation, or wants new models to match that look, even if they don't name the style.

What is cel-toon-3d?

cel-toon-3d is a Claude Code agent skill that the 2D/3D animation style from the Rot Squad game, for three.js browser games — hard-banded cel shading with painted (coloured, not grey) shadows, a crisp rim light, dark outlines around every shape, and movement held "on twos" (poses update 12 times a second while positions stay smooth), so 3D reads like hand-drawn animation, as in Fortnite-meets-anime cartoon games. Comes with a starter project, a shading library, a low-poly modelling kit, a 9-bone rig with walk/run/jump/emote poses, and a way to apply the look to imported GLTF models. Palette- and theme-free. Use this skill whenever the user wants that Rot Squad shading or movement style, cel-shaded / toon / anime / cartoon 3D characters or scenes, "2D-looking 3D", stepped or "on twos" animation, or wants new models to match that look, even if they don't name the style.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Jasbenben/cel-toon-3d/tree/HEAD

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Cel Toon 3D (Rot Squad's shading and movement)

This style makes 3D look and move like 2D animation. It has two halves, and both are needed:

  1. Shading: light falls in three hard bands instead of a smooth gradient. The shadow band is painted a cooler colour (as in ink-and-paint cels) rather than going grey, a thin hard rim light picks out silhouettes, and dark outlines sit around every shape.
  2. Movement: bodies hold each pose for a couple of frames, about 12 new poses a second, like hand-drawn animation on twos. Meanwhile positions, the camera and physics stay smooth at the full frame rate. Poses are big and readable, snapping between key positions instead of easing smoothly.

It has no palette, textures or UI style of its own. Use any colours, any theme, any HUD. (Rot Squad also had halftone dots, a comic print filter, neon pop colours and comic lettering. Those are not part of this skill; leave them out unless the user asks.)

Start from the starter

assets/starter/ is a working project: a small grassy scene in everyday colours, four example characters (dancing, waving, cheering, one walking a loop), tap-to-jump, and day / golden-hour / night lighting buttons.

  1. Copy assets/starter/ into the new project folder.
  2. npm install, then npm run dev (builds to dist/ and serves http://127.0.0.1:5180).
  3. Check the look is there, then replace buildWorld() and the cast in src/main.js with the game. Leave src/toon/ as it is unless you're deliberately changing the style.
FileHolds
src/toon/shading.jscelMaterial, outlines (inkMaterial, inkShellMaterial), Kit (low-poly parts with outlines), toonify() for imported models, gradient sky, LIGHT_PRESETS + applyLight, EdgePass (inner lines), Quality
src/toon/rig.js9-bone rig, assemble(), example makeHumanoid(look) + LOOKS, poseHumanoid() with on-twos timing, flash()
src/main.jsRenderer, lights and pass setup, plus the demo

To add the style to an existing three.js game, copy src/toon/ and the renderer, light and pass setup from the top of src/main.js.

Shading: what to keep

  • Renderer: outputColorSpace = SRGBColorSpace and toneMapping = NoToneMapping (filmic tone mapping smears the hard bands into gradients), PCF shadows (crisp-edged cast shadows read as painted shapes), autoClear = false for the edge pass.
  • celMaterial on every solid surface: a 3-texel gradient map with nearest filtering gives the bands. The darkest band is mixed toward shared.shadowTint (a cool blue/violet, never grey). A stepped rim light (step(0.66, …)) adds the edge highlight, and material.userData.flash turns a character white when hit. It needs vertex colours plus an aGlow attribute: Kit parts already have them, and anything else goes through toonReady(geometry) or toonify(object).
  • Outlines around every solid part, in a very dark, slightly coloured ink (INK), not pure black. Kit builds them as back-face hulls. Widths: characters 0.034, props 0.045, big ground 0.08, eyes 0.018, tiny details 0. EdgePass adds inner and far lines from depth jumps; it's optional but helps at a distance. Skipping outlines entirely gives a softer anime/Fortnite read: set Kit ink: 0 and render without EdgePass.
  • Lighting: a strong hemisphere light does most of the fill (sky colour above, bounce colour below), plus one shadow-casting sun, fog in the horizon colour, and a shadow tint and rim colour that match the mood. LIGHT_PRESETS has day, golden and night. Add your own with the same fields (references/shading.md explains each).
  • Quality steps down on slow frames (2 = edges + shadows, 1 = edges, 0 = plain), with pixel ratio capped at 1.5. That's what keeps it smooth on phones.

Movement: what to keep

  • On twos: pose functions run every frame, but they return early unless the 12-fps tick changed, and all pose maths uses the stepped time t = tick / POSE_FPS:

    const tick = Math.floor(now / (1000 / POSE_FPS) + a.phase * 0.5); // phase de-syncs crowds
    if (tick === a.poseClock) return;
    a.poseClock = tick;
    const t = tick / POSE_FPS;
    

    Move the character's group (position, facing, jumping) every frame as usual. Only the limbs step.

  • Big key poses: limb angles of 0.4–1.2 rad, anticipation then action (wind up over ~55% of the cycle, snap through the rest), small overshoot jitter on held poses, small root bobs (0.05–0.12). Snap between poses rather than tweening.

  • Effects follow the same beat: anything that grows or pops (hit sparks, dust puffs, UI pops) changes size in held steps (about every 83 ms) instead of smoothly.

  • poseHumanoid(actor, now, { speed, airborne, down, emote, emoteT }) already covers idle, walk to run (blended by speed), jump, crawl, dance, cheer, wave, sad and bonk. references/animation.md has the recipes and how to write new ones (attacks, enemies, bosses).

Models

Any model works with this look; the shading and movement carry the style.

  • Built in code (fast and consistent): Kit merges low-poly parts (boxes, 4–8-sided cylinders and cones, low-detail balls, tori) with outlines into one mesh. For characters, tag each part with a rig bone and call assemble(kit.build(), rigDef(scale, proportions)), with no weight painting. makeHumanoid(look) is a ready example (a chunky ~1.9-unit body with a big head and big hands; switches for build, eyes, hair, hats, cape/tail/backpack).
  • Imported (GLTF from Blender, Mixamo or AI model tools): toonify(gltf.scene, { ink }) swaps in celMaterial (keeping colours and texture maps) and adds an outline shell that follows the skeleton. Use ink ≈ 2% of the model's height. Play its animations through an AnimationMixer that only advances on the 12-fps tick, to keep the on-twos feel.
  • Flat colours and chunky shapes suit the look best. Detailed photo-textured models fight the bands.

references/models.md covers the Kit API, the rig, part recipes (faces, hands, shoes, hair) and how Rot Squad built its zombies and boss.

Before you call it done

Take screenshots and look at them (headless Chromium needs --use-angle=swiftshader):

  • Light falls in clear bands with a hard edge, and shadow sides are a cool colour, not grey.
  • Outlines are visible around characters and props (unless deliberately turned off).
  • Limbs move in visible steps (about 12 per second) while the character slides smoothly across the ground.
  • Colours look as authored: tone mapping is off.

References

  • references/shading.md: every shading number (bands, shadow tint, rim, outline widths, edge pass), light preset fields, camera and scale, performance tiers.
  • references/animation.md: on-twos timing, pose recipes, writing new poses, effect timing.
  • references/models.md: Kit API, the rig, part recipes, enemies and bosses, imported models.

The style comes from Rot Squad, a co-op browser game: its characters, enemies and boss were built with the same Kit and rig, and its shading is this library plus a comic print filter.

Related Skills