Star 历史趋势
数据来源: GitHub API · 生成自 Stargazers.cn
README.md

Shanshui

Ten Chinese ink-wash landscapes (shan shui, "mountains and water"), painted and animated entirely in code, cut into a one-minute film.

The ten paintings

No images, textures, fonts or audio samples are loaded anywhere. Every pine needle, cliff, mist bank, crane, ripple, snowflake and the closing seal are generated at runtime with WebGL2 shaders and Canvas2D brushwork. The soundtrack (guzheng, xiao flute, singing bowl, wind and water) is synthesized sample by sample in JavaScript.

The film is attached to the releases.

The film

One minute, ten paintings, one clock: 80 BPM, two bars per painting, every seam centred on a bar line.

paintingarrives by
0:00bamboo valleypainting itself in from bare paper, darkest ink first
0:06cranes over the fallsa bank of valley mist
0:12rope bridgesmist sweeping through the peaks
0:18floating peaksthe camera rising through a cloud bank
0:24red cascadea push through waterfall spray
0:30autumn ruinsa gust of maple leaves
0:36golden riverthe scroll unrolling, joined by mist
0:42stone bridge, red sunthe gold sun sliding onto the red one
0:48moon over the lakenight soaking down through wet paper
0:54snow templesnow thickening over the lake
0:57the seal is pressed; the painting evaporates back to paper

Watch it live

npm install
npm run serve

Open the printed URL: the film plays in real time in the browser (?scene=s03 shows one painting, ?scale=1 renders at full 1080p). Space pauses, arrow keys jump between paintings, M plays the soundtrack once you have generated it.

Render it

node tools/audio.mjs                                                    # soundtrack -> out/audio/soundtrack.wav
node tools/render.mjs --out out/shanshui.mp4 --audio out/audio/soundtrack.wav --samples 2

Frames are rendered by headless Chrome on the GPU, converted to YUV 4:2:0 in a shader and streamed straight into ffmpeg (x264, BT.709); nothing but the final MP4 touches the disk. Needs Node 20+, Chrome or Edge, and ffmpeg on the PATH.

How it is built

src/engine/       WebGL2 compositor: parallax cards on a 2.5D camera, bakes, reflections, wind sway, grading, YUV readback
src/lib/          the painter's vocabulary: brush strokes and ink effects, pines, rocks, peaks, mist and clouds,
                  water and waterfalls, architecture, cranes, falling leaves and snow, bamboo and maples, the seal
src/scenes/       the ten paintings, each with its own helpers
src/transitions/  the seams between paintings
src/timeline.js   one clock for picture and sound
src/film.js       shot list, transitions, overlays, sub-frame motion blur
src/lab/          small scenes that show single elements of the library
tools/            stills and comparisons, contact sheets, a warm render daemon, the film renderer, the soundtrack, frame forensics
docs/             ENGINE.md (API), STYLE.md (palette and painting rules), FILM.md (the cut), LIBRARY.md (element index)

Each painting is a back-to-front stack of layers placed at depths in front of one camera, so slow camera moves give real parallax between foreground pines, midground peaks and far ranges. Static brushwork is baked once into textures and passed through an ink pass that pools pigment at the edges and lets it granulate into the paper. Mist, clouds, water, waterfalls, snow, cranes and falling leaves are drawn every frame as pure functions of time, so any frame renders on its own, deterministically.

The paintings were built by matching each one, region by region, against a reference painting; the reference images are not part of this repository, so the comparison options of tools/still.mjs (--compare, --side, --crop) need your own images in ref/01.webp ... ref/10.webp.

License

MIT

关于 About

Ten Chinese ink-wash landscapes painted and animated entirely in code (WebGL2 + Canvas2D), cut into a one-minute film with a synthesized soundtrack.

语言 Languages

JavaScript100.0%
HTML0.0%

提交活跃度 Commit Activity

代码提交热力图
过去 52 周的开发活跃度
3
Total Commits
峰值: 3次/周
Less
More

核心贡献者 Contributors