Log inGet started
World

Style Cookbook: Mix Your Own Art Style from Stackable Look Blocks

README.md

pencilBlocks (testSuite)

Twelve tests that prove pencilBlocks on the presented frame, at a 3D view of 1920 x 1080, on the campaign stage (lookbookShowcaseKit's stage where it is installed, as in the Style Cookbook; a stand-in set with the engine's humanoid figure otherwise): every block passes styleKit's block rules and each of the six media ships four or more shade and line variants; every whole look applies in one change; each medium reads as itself on the stage and on the figure (graphite neutral grey, coloured pencil coloured, charcoal darkest, conte warm, ballpoint blue, felt tip neutral black, all told apart); mark density grows with darkness and darker tones keep the lighter tone's strokes; the marks move with the world when the camera turns and zooms; charcoal and the soft leads draw masses, never zebra bands, never streaks close to a dark wall and never wide regular bands from 8 m; a figure painted with PencilHero carries its marks as it moves; adding, swapping and removing blocks gives the frame back; the held clock redraws without flashing; with every light off the picture stays black, and a dim room stays dim.

Every case brings its own lights and camera, holds the clock still, saves the scene's stack first and puts it back, and leaves no painted material behind. A frame is read only once every style shader has compiled and the frame was drawn after the change being judged, and two agreeing reads must be two different frames. Each test prints its numbers, and they are kept in /zero/source/tmp/pencilBlocks_suite.txt. Run it with asset.resolve("pencilBlocks.tests.pencilBlocks", "testSuite"):run(), in a scene nobody else is changing while it runs.

In a world that has only pencilBlocks installed, twelve cases run and one reports as skipped ("charcoal and the soft leads draw no wide bands from a normal distance"): the wide bands it looks for form only on the textured walls of lookbookShowcaseKit's campaign stage, so without that stage the case is skipped rather than passed on a reading that proves nothing. The runner prints a skip with a tick and counts it under Skipped, not Passed. To run it too, install lookbookShowcaseKit from the Style Cookbook and the kits its README lists. The suite can be run again in the same session: before a case builds its test room it rebuilds the room materials in place through the material type's own change handler (nothing is written to disk), because the scene swap at the end of a run lets the engine release them and a released material otherwise draws as the magenta error pattern on the next run.

The stage cases hold every sky in the open scene to one fixed day (the ProceduralSky defaults, 14:00) and put it back afterwards, as they switch the scene's own lights off, so a stage reading no longer follows the open scene's sky. Stage readings then repeat within 0.2 of 255 between runs; the density check's stroke counts land in one of two close states (up to 3% apart). The package README's "What repeats from run to run" says what was measured.

Where the campaign stage is not installed, the stand-in set's figure is the engine's humanoid, which arrives as a player's body: a character controller that poses and idles it, and a name label above it. The suite takes both off before it measures (since 1.1.18), so the figure is a still prop, as the campaign stage's figure is. Left on, they made one reading change from run to run in a fresh world (the held-clock case read 209.35 in one run and 209.71 in the next, every other reading the same).

The case "the darkest band stays the darkest, with the screen calm on" (pencilBlocks 1.1.24) builds one material turned three ways to its own sun (lit, glancing, shadow side) 600 m from the world's centre, under four light levels down to a dim scene where the screen calm engages, and reads every medium with its default settings and with screenCalm = 0. It fails when a medium's shadow band reads lighter than its glancing band (or the glancing lighter than the lit), or when the calm leaves the shadow band more than 1 level lighter than with the calm off. On the calm of 1.1.23 and earlier (strokes turned down, one layer's worth of tone rubbed in) the shadow band of graphite, coloured pencil and ballpoint read 2.9 to 3.5 lighter with the calm on at a fifth of the light; since 1.1.24 the calm rubs each layer into its average coverage and the gap is 0.4 at most.

Known limits

  • Frame tests read the presented frame, so a run needs a drawn view, and a busy machine moves the timing checks (#24548).
  • A two-client editor sometimes refuses to load two different scenes at once (#24666, #24667).
  • The web build was not checked from here (#20946).

The package README's Known limits lists the rest.