Log inGet started
World

Painted Valley

Branchmain
Branchesmain
Commit12ad3f264b

README.md

Painted Valley on Zero

A port of Painted valley by blendi on Patch (https://patch.gg/blendi/painted-valley, v1.1.1; code MIT, art CC0 1.0): a summer valley to walk through, drawn in the look of hand-painted animated-film backgrounds, with a wanderer in a straw hat and a blue cloak drawn in flat colour and ink. The original is three.js 0.186 on WebGL2. This is the same valley rebuilt as Zero content (Luau + WGSL), from the original's own maths, numbers and shaders.

Walk: WASD, Shift to sprint, Alt to walk, Space to jump, mouse to look, wheel to bring the eye in or out, gamepad too. V goes into the wanderer's eyes and back. T cycles the time of day (noon, afternoon, golden hour, sunset), 1–4 go straight to one, , and . nudge the hour, 0 lets the day pass by itself (sunset twenty minutes after the afternoon you start in). P takes the paint finish off and on. There is nothing to do but walk: down the hill to the village, along the river, up to the tarn.

How it is put together

scenes/valley.scene holds only a valley entity with the Valley component and the player setup. Everything else is made from code on every peer (the valley is the same everywhere because it is deterministic), drawn with renderer.mesh.drawInstanced, render features and a few local entities. Nothing of it is synced.

FolderWhatFrom the original
world.moduleThe land: heightAt, paint, paths, tarn, river, fields, forest. Bit-exact with the originalsrc/valley/world.js
core/The field's shared maps baked on the GPU (heights, what grows where, slope), the noise, the shared light, the WGSL library every material includes (valleyCommon, valleyShade, valleyPaint, valleyLand), the scene driver Valley, the keys, the loading screenlib/glsl.js, lib/noise.js, lib/bake.js, lib/index.js, main.js
frame/The finish: the paint brush (Kuwahara), the inked line round the wanderer, bloom, vignette, exposure and the painter's curvelib/frame.js
sky/The sky and its hours, the cumulus heaps ray-marched into a cube, the painted mountains and foothillssky.js, clouds.js, backdrop.js
meadow/The grass, flowers, ground, brushwork, trodden-grass memory, stones and drifting seedslib/blades.js, flowers.js, ground.js, state.js, strokes.js, dressing.js
far/The plain out to 6 km, its painted fields, roads and river, the far woods and the millhorizon.js, floor.js, farwoods.js
village/The village, church and farms, the near trees and bushes with their shade, the tarnvillage.js, trees.js, water.js
wanderer/The wanderer (cel look, hat, cloak cloth), his movement, camera, animation and footstepsfigure/*, wanderer.js, sounds.js

Each part has its own README with its decisions and every place it differs from the original.

Differences from the original that matter

  • The original tags surfaces through its scene target's alpha (what the brush leaves alone; the wanderer's ink line numbers). On Zero's deferred path a surface's alpha does not reach the frame, so the frame draws those tags itself: a tag pass over the village's and the wanderer's entities, the sky's own alpha from its painted strip, and the far plain's fade from depth.
  • The sounds: as in the original repo, only the five footstep recordings (Kenney, CC0) are here. The five Sonniss ambiences of the released demo may not be passed on as files (see the original's MISSING_ASSETS.md). The sound code keeps their hooks, so they play if someone adds them.
  • Temporal antialiasing stands where the original uses 4x MSAA. Alpha-to-coverage edges become cut-outs that TAA smooths.
  • Each peer keeps its own time of day and paint setting, as each viewer does in the original. The world is multiplayer: every joining player gets a wanderer of their own.

Credits

The valley, its code and its look: blendi's Painted valley (MIT; what it draws CC0). The wanderer is Patch's starter man (a MakeHuman figure, CC0) with clips from Quaternius' Universal Animation Library (CC0) and Patch's own (CC0). The footpaths' earth is two ambientCG grounds (CC0); the footsteps are Kenney's (CC0).