Your first project
entelechy new <dir> writes a directory that runs: a Kernel, the scene that places it, a replay that checks what it draws, and a README saying what to change first.
entelechy new helloplay it: entelechy player hello/scene.esnrun it: entelechy run hello/scene.esn --window 640x400 --out frame.pngtest it: entelechy replay hello/tests/hello.replay--kind picture|sound|game picks the start (a picture by default).
What it writes
Section titled “What it writes”hello/├── README.md├── scene.esn the scene: nodes, params, outputs├── kernels/│ └── hello.ent the Kernel: what each pixel computes└── tests/ └── hello.replay the replay: a pixel's color at a framescene.esn: one node over the window.
// One node: the Kernel over a window's worth of pixels.use "kernels/";
param rate: Float = 0.35;
node picture: hello.draw@1 { rate = rate; domain = window(); }
output result <- picture.result;kernels/hello.ent: each pixel works out its color from where it is and what time it is.
kernel hello.draw@1 { requires { field.write; time.read; } param rate: Float = 0.35; // how fast the colors turn output result: Image; compute { // Where this pixel is, from -1 to 1 across the shorter side. let { x: width, y: height } = domain(); let place = (coord() * 2.0 - domain()) / min(width, height); let away = length(place); let turn = time() * rate; // Rings that move outwards, and a color that goes round. let ring = sin(away * 8.0 - turn * 6.2831853) * 0.5 + 0.5; let color = mix( vec3(0.15, 0.25, 0.45), vec3(0.95, 0.65, 0.35), ring * saturate(1.2 - away) ); return vec4(color, 1.0); }}Note requires { field.write; time.read; }: reading the clock needs the time.read capability. See Capabilities & security.
tests/hello.replay:
scene ../scene.esn
# A small window, so the pixels are few and the test is quick.window 64 40 1frame 0.0expect 32 20 = 0.550 0.450 0.400 0.01frame 0.5expect 32 20 = 0.194 0.272 0.445 0.01Run it
Section titled “Run it”entelechy player hello/scene.esn # a window (needs entelechy-player)entelechy run hello/scene.esn --window 640x400 --out frame.png # no window, one pictureentelechy replay hello/tests/hello.replay # the testEdit kernels/hello.ent while the Player is open and the picture changes as you save; a Kernel that does not compile leaves the running one alone and says why.
Try next
Section titled “Try next”The README suggests two exercises:
- Give the scene another
paramand use it in the Kernel. - Add a second node that reads the first (
input under: Image;andsample(under)) to draw over it.
Next, write a Kernel from scratch: Your first Kernel.

