Skip to content

Visual system / shader study

Living Ink-Wash Renderer (WebGL Brush + Paper)

Tested with Claude · produced Ink Warden

The Prompt

Build a self-contained WebGL ink-wash rendering layer for a browser game, in ONE HTML file (no libraries, no external textures). The goal is a handscroll that looks painted rather than filtered, while holding 60fps on a mid-range phone.

Brush engine:
- Render each stroke into an offscreen RGBA texture at device pixel ratio, capped at 2x. Stamp a soft brush sprite along the path at a spacing of 12% of brush radius, with per-stamp jitter in rotation, size and opacity.
- Simulate ink load: opacity falls as the brush travels, so long strokes start wet and end dry. Modulate stamp count by stroke speed to create dry-brush gaps.
- Add a wet edge: a slightly darker rim on the stroke boundary implemented as a 1px offset double pass, not a blur.
Paper and composition:
- Procedural paper: value-noise grain at three scales, a subtle warm tint, two fibre streaks and a soft vignette. Generate once into a texture; never recompute per frame.
- One vermilion accent per scene (seal, lantern or banner) as the only saturated colour. Everything else stays in the ink ramp.
- Compose the background from layers: distant mountains (low opacity, large strokes), mid-ground trees, near rocks. Parallax them at different scroll speeds.
Camera and motion:
- A vertical or horizontal handscroll camera that advances continuously with slow easing, plus a brief pull-back on boss waves.
- Idle motion: 2-4px of paper breathe over 6 seconds. No screen shake by default; expose a toggle.
Performance and quality:
- Cap the stroke texture at 2048x2048, recycle it with a fade pass when full, and never allocate per frame.
- Add quality presets Auto/Low/High. Low disables the wet edge and halves grain resolution; Auto measures frame time over 3 seconds and steps down.
- Provide a reduced-motion mode that stops the camera and paper breathe.
- Include a debug panel (F) with frame time, texture fill percentage and active stamps.
Deliverable:
- A demo scene with one interactive stroke, a full-screen handscroll background and a toggle between ink-wash and flat rendering so the effect can be judged honestly.
- Print the shader/timer breakdown at the end: how many milliseconds go to stamps, paper and compositing.

What This Prompt Produces

Ink Warden’s scroll is the model: procedural ink-wash scenes, bleeding edges, dry-brush texture and paper grain, with WebAudio rather than samples. The 2048 texture cap and the Auto preset are what keep the look from costing frames on a phone.

Modification Tips

  • Bake paper grain once into a texture. Regenerating noise per frame is the most common way this effect becomes unshippable.
  • Render strokes to an offscreen canvas and recycle it. Thousands of live stamp objects will not survive a long run.
  • Restrict the palette to one ink ramp plus one accent colour; the restraint is what reads as ink wash rather than blur.
  • Ship a flat-render toggle. It is the fastest way to prove the shader is doing the work, not the assets.

The Game This Prompt Produced

Want to try it? Open Claude, paste the prompt, and you'll have a playable game in minutes. When you're happy with the result, submit it to Daily AI Games.