Skip to content
View source

Examples

examples/ holds 33 examples. Each is a directory with a scene.esn entry, usually kernels/ (the .ent libraries it uses), tests/ (.replay scripts and their scenes) and a README.md saying how to run it. Examples use packages; nothing uses an example, and packages are tested by their own tests/.

终端窗口
entelechy run examples/<example>/scene.esn --out output.ppm --watch
entelechy replay examples/<example>/tests/*.replay
Example What it shows
grayscale a gradient through grayscale and pixelate Kernels; the first proof.
life Conway’s Life on a Grid<Cell> through a feedback binding, painted with the pointer.
ant Langton’s ant as a scan over a grid memory.
modes how a Kernel runs, in five parts: a merge reduction meters a frame, two maps sort, one Kernel writes three outputs by name, a scatter splats particles, and a machine steps off the frame with async.
image pictures from arrays, matrices, volumes and samplers, in five parts: a Gaussian from a weight table and a Mat3 emboss, a cube through its model matrix, marching squares from a case table, a Volume<Float> cloud, and a tile scrolled through mod.
data how Fields hold what they hold, in five parts: every Field as narrow as it holds, a part half a million meters out in Double and Long, a Grid<Tile> flooded a step a frame, and a tally written to a file and read back, and an input read frame by frame from a directory with frames.
Example What it shows
path a progressive path tracer; samples and bounces are graph parameters, the running sum is state.
mesh a torus subdivided, projected, rasterized by the raster package and shaded, native.rasterize@1 its fast path; parts: a GLB crate imported and textured with at_linear, and geometry sized inside the frame by domain = value(detail) * value(detail).
mipmap a ground read at the mip level each pixel needs, levels from a sub-graph placed with carry.
culled ten million triangles, of which a frame places the chunks it sees through the parallel package.
surface a blob meshed from a Volume<Int> every frame, the cells compacted and counted.
text rows of glyphs drawn through a font atlas baked by run --save.
ui a settings screen and a hero’s panel drawn with the ui package, moved through by keys, a pad or the pointer.
controls a dot walked by the keyboard or a pad alike, actions read from a table by the controls package.
vector an SVG imported by entelechy-import and drawn sharp at any size by the vector package; drag and zoom.
showcase a signed-distance gamepad under physically based shading, with a toolbar in logical pixels.
darkroom a raw photograph developed with the image package: equalized, graded, sharpened, and a neon outline drawn from a signed distance field.
nebula a drift through a nebula made by the random package, finished by a camera look of its own over the image package’s steps: glow, depth of field, tone and grain.
logo Entelechy’s logo, a constructed mark and a name drawn in strokes, every version from one Kernel, and the mark’s drawing sheet drawn from the same functions.
Example What it shows
genesis a world that rewrites its own law of growth until its life is in balance, writing each law through an output to files.
swarm many bodies at once: a million stepped by a map and drawn by a scatter, and sixty-five thousand finding their neighbors through a grid built by scatter sum and prefix with sum.
physics boxes and balls that fall, stack, slide and bounce, stepped by the physics package; a sensor, a ray, a click drops a ball.
fluid smoke by Navier-Stokes, the pressure solve one Jacobi Kernel placed with times.
collapse wave function collapse on a Grid<Int> of tile bitmasks.
learn a 2-16-1 network trained by gradient descent, the gradient a scatter.
cube-puzzle a playable cube puzzle and a 54-32-1 network trained on its scrambles; play.esn reads kept weights.
Example What it shows
sound sound written as Kernels, heard and seen: a synthesizer’s rows filtered by a scan and drawn as a scope, beside a voice and its spectrum, the two mixed into one output; parts: six plucked strings each a delay line in a memory, a drum WAV played and resampled, a MIDI file played as a piano roll and exported back, a game’s music from a mood, a band and a seed, and every event sound in each material and style.
Example What it shows
animation a skeleton, its clips and the mesh that follows, in four parts: an imported arm as rig rows with two clips blended by the pointer, a crowd of sixty-four, a shoulder aimed at a point while the elbow plays its clip, and root motion carried through <~.
Example What it shows
slg a tactics game with a turn machine and movement ranges as a sub-graph placed three times.
arcade small games of a few Kernels: falling blocks with pieces as a bit-mask table, and snake; the replays play them through.
machines processors as a scan over their memory: a CHIP-8 interpreter and an ARM7TDMI Thumb core painting a framebuffer.
voxel a voxel editor over a Volume<Int> with undo and a toolbar, drawn by the voxel package; parts: a crypt by firelight or by day with a statue turning in a box of its own, and a body of voxel shapes walked by the animation package’s rows.
Example What it shows
level a binary level format read by a Kernel from bytes.