Skip to content

Threedog 2.0.0

Latest

Choose a tag to compare

@penstic123-code penstic123-code released this 16 Nov 04:59
· 1 commit to main since this release

Threedog 2.0.0, the stable release: one start command, new games that open lit and in color, and a reset order you can rely on. Some 1.x games need a small change to upgrade (below).

npm install threedog@2 @threedog/tools@2
npx threedog init my-game

Every change is in the changelog.

Upgrading from 1.x

  • Install the packages together at 2.0 (threedog, @threedog/tools, and @threedog/post-effects, @threedog/terrain-noise if you use them). The threedog command now comes with the threedog package.
  • characters() requires world(): add it before, engine.use(world(), collision(), characters()). openWorld() already has it.
  • On newGame and load, a game's own world:load listener now runs after the player is placed back. Code that relied on running first moves into a module's worldLoad(e, info) hook.
  • Something your picture sizes from engine.tier when it is made (a shadow map, a light count) follows a later change only if it listens to the new tier:change event.

Start

  • npm install threedog @threedog/tools and npx threedog init is the one way in; the README and llms.txt open with it. A missing tools package prints the install line.
  • New games start from a neutral daytime picture instead of grey: sun with soft shadows, the sky as the fill light, tone mapping, ambient occlusion and a light bloom, a temperate sky, muted ground, water and player colors. All of it is plain three.js in the game's own picture/ folder, and the generated CLAUDE.md says it is a placeholder to restyle.
  • A new game's CLAUDE.md has a "Before you call it done" checklist: compare threedog shot with the target style.

Fixed

  • On WebGPU, engine.sky.environment() stalled the game at each rebuild (100 ms to seconds, once a second while the sky moved). The same map is now refilled.
  • Adding a pass that only reads the scene render (such as GTAOPass) to engine.post blanked the screen.
  • Ambient occlusion on WebGPU was grainy; it is denoised.
  • start() resolved before a module that waited for a replaced provider had finished its init, and a critical one failing there did not stop the start.
  • On test and screenshot pages, a halt taken and removed left the engine running in real time.
  • After a lost WebGL context came back, adaptive resolution could stay low for good.
  • Physics solver settings were lost on newGame and load.

New

  • tier:change event; particles, weather, terrain color detail, shadow cascades and post effects follow a tier change while running.
  • The newGame / load reset runs in one declared order (sessionEnd, worldLoad, sessionStart hooks on a module), no longer in install order.
  • engine.sky.keyframes() with no argument returns the rows in use.
  • threedog perf measures for a duration: 2 s warm-up, three runs, average FPS, 1% low and spike frames.
  • Screen shake without taking the camera (recipe 21 §6b).

Tools

  • One browser lifecycle for shot, perf, stress, capture, gallery and bake: a failed launch closes everything it opened and prints one line with the fix. A missing browser says npx playwright install chromium.
  • threedog init warns when a kept index.html, vite config or dev script would keep the game from starting.

Tested on Chrome on Windows (D3D) with real WebGPU, one NVIDIA laptop GPU: 11,155 checks, all pass apart from one WebGPU path-trace photo test that timed out under load (left as is).


中文摘要: 2.0.0 正式版。新项目一条命令起步,打开就有正确的光照和中性配色;新开一局和读档的重置顺序固定下来;修好了 WebGPU 上天空当光源时卡顿、部分后期效果整屏变空等问题。从 1.x 升级:几个包一起升到 2,用了 characters() 的游戏要先装 world(),详见上面的 "Upgrading from 1.x"。