Style Cookbook: Mix Your Own Art Style from Stackable Look Blocks
- Author
- claude-code @ auraAgent
- Opened
- Nov 13, 2026
- From
- stylekit-sky-distance
- Into
- main
- Merged
- Nov 13, 2026
styleKit 1.8.2: the sky distance a depth mask uses is no longer looked up on the render path.
Why: in the Sensor Looks world (desktop, styleKit 1.8.1, a 2-3 block look, ~2,900 entities) the Luau sampling profiler put about 24 ms of every second in StyleRuntime replayChecks -> skyDistance -> its pcall closure (camera.active, entity.exists, entity(id).component.get("Camera").far), more than all the look's other scripts together. The same calls from a script cost microseconds, so the expense is specific to calling them inside the render feature's render(ctx).
Change (StyleRuntime.module/init.luau):
- skyDistance() only returns the cached far distance; at most every 2 s (time.realtime) it schedules readSkyDistance with task.defer, off the frame, which does the same lookups as before and updates the cache (errors logged).
- replayChecks still nudges the refresh every 60 frames, and a replayed frame takes the full path whenever the cached distance differs from the one it was built with (a field compare, no engine call).
- Behaviour kept: a depth mask still gets the camera's far plane as where the sky lies; a far-plane change lands within about 2 s.
Version bumps (publish gate: every Cookbook package that depends on styleKit names 1.8.2): styleKit 1.8.2, inkBlocks 1.2.13, paperBlocks 1.2.5, pencilBlocks 1.4.10, starterBlocks 1.0.52, styleRoles 1.4.5, toonBlocks 1.4.5, watercolorBlocks 1.2.15, lookbookKit 1.0.55 (names styleKit 1.8.2, starterBlocks 1.0.52), lookbookShowcaseKit 1.0.54 (names lookbookKit 1.0.55). Also upgrades the world's @builtin pin to 44bf0e5 (separate commit). README version history has a 1.8.2 line.
24 files changed
- ChangedinkBlocks.packageFolderBeforeAfter
- ChangedinkBlocks.package/package.yaml969 B → 969 BBeforeAfter
- Changedlibs/@builtin194 B → 194 BBeforeAfter
- ChangedlookbookKit.packageFolderBeforeAfter
- ChangedlookbookKit.package/package.yaml1.0 KB → 1.0 KBBeforeAfter
- ChangedlookbookShowcaseKit.packageFolderBeforeAfter
- ChangedlookbookShowcaseKit.package/package.yaml2.3 KB → 2.3 KBBeforeAfter
- ChangedpaperBlocks.packageFolderBeforeAfter
- ChangedpaperBlocks.package/package.yaml1.2 KB → 1.2 KBBeforeAfter
- ChangedpencilBlocks.packageFolderBeforeAfter
- ChangedpencilBlocks.package/package.yaml1.5 KB → 1.5 KBBeforeAfter
- ChangedstarterBlocks.packageFolderBeforeAfter
- ChangedstarterBlocks.package/package.yaml744 B → 744 BBeforeAfter
- ChangedstyleKit.packageFolderBeforeAfter
- ChangedstyleKit.package/README.md86.3 KB → 87.1 KBBeforeAfter
- ChangedstyleKit.package/StyleRuntime.moduleFolderBeforeAfter
- ChangedstyleKit.package/StyleRuntime.module/init.luau75.7 KB → 76.2 KBBeforeAfter
- ChangedstyleKit.package/package.yaml1.3 KB → 1.3 KBBeforeAfter
- ChangedstyleRoles.packageFolderBeforeAfter
- ChangedstyleRoles.package/package.yaml1.2 KB → 1.2 KBBeforeAfter
- ChangedtoonBlocks.packageFolderBeforeAfter
- ChangedtoonBlocks.package/package.yaml1.4 KB → 1.4 KBBeforeAfter
- ChangedwatercolorBlocks.packageFolderBeforeAfter
- ChangedwatercolorBlocks.package/package.yaml957 B → 957 BBeforeAfter
Checks
From the author and the world's members
- Failedtests13 passed, 1 failed, 0 skipped. Failing: styleKit: the dim guard keeps a dark scene dark. Suites: styleKit
Reviews
No reviews yet.
Conversation
- claude-code @ auraAgentNov 13, 2026
Measurements (Luau sampling profiler, 20 s each, play, Cookbook recipeToon scene with its look on plus 2,500 temporary cubes, desktop headless sub-client; samples are 1 ms):
- Before (1.8.1): skyDistance 1 sample in 20 s (~0.05 ms/s, under 0.001 ms a frame), all on the render path.
- After (1.8.2): skyDistance on the render path 1 sample in 20 s (~0.05 ms/s: a time.realtime read and a compare, noise level), readSkyDistance in the deferred task 1 sample in 20 s. No camera/entity/component lookup runs inside render(ctx) any more.
- The 24 ms/s cost seen in Sensor Looks does not reproduce in the Cookbook (the same lookups cost microseconds here, from a script and from the render feature). The change removes the lookups from the render path entirely and cuts them from ~2/s to one every 2 s, so whatever makes them expensive in that world no longer lands on the frame; confirm there after updating to 1.8.2. Tests: styleKit suite 13/14 passed; the one failure is the known headless-flaky 'the dim guard keeps a dark scene dark' (it also fails on 1.8.1 in sub-clients). Frame drawn unchanged; a far-plane change is picked up within ~2 s.
Sign in to comment or review.