Skip to content

v0.3.0

Choose a tag to compare

@github-actions github-actions released this 10 Oct 06:21
· 28 commits to main since this release
3fa1a23
  • Point lights picked per view (pickLights): unlit lights and lights out of the frustum drop, and past MAX_LIGHTS the nearest to the eye win. Scenes with 8 or fewer lights in view are unchanged.

  • Glow particles: Environment.glow draws billboards additively (PipelineOptions.additive, web and native), fading to nothing in fog; Emitter.colors is a color ramp over the life and Emitter.radius spawns inside a sphere.

  • A material may define fn vertex(position, time, params0, params1) -> vec3f to move its mesh's positions before the model transform and skinning, on static and skinned meshes.

  • Static meshes are culled against the frustum and anything scaled to zero is skipped; skinned meshes are always drawn. The Ones' night 4 runs at 60 fps on an iPhone 15 Plus.

  • iOS keeps Storage in the app's preferences (src/native/storage.ts, shared with macOS and Windows), so saves survive quitting the app.

  • replay verify --native reads each replay's inputs and checksums from files next to the binary instead of one huge literal: 33 replays verify in 15 s on scriptc 0.2.7, which never finished compiling the old entry.

  • Limits that drop things warn once: spot lights past MAX_SPOTS, fog volumes past MAX_FOG_VOLUMES, joints past MAX_JOINTS, iOS library mode past 28 of its 32 callbacks, and a plan wait that hits its default 6000 frames.

  • dotframe/src/rig: posing a skeleton by hand (createRig, solve, turn, aim, headLook, stare, snap, follow, twoBoneIk, lockRoot, eulerYXZ). twoBoneIk also bends a leg that is straight at rest.

  • Four music channels: playMusic, stopMusic, pauseMusic and setMusicVolume take an optional channel (default 0, so existing games are unchanged), streamed together on web and mixed in df_audio.c natively with no new iOS callback.

  • UiStyle.align: "left" and pad: labels at the item's edge and a row's value with its arrows on the right, for settings lists.

  • Fixed: on the web a key pressed and released between two frames was never seen; it now reads as down for one frame.

  • assets slim --decimate <ratio> or --decimate file.glb=ratio,...: quadric edge collapse in TypeScript for static and rigid-skinned meshes (welded across seams, rims slide along themselves, flips rejected, unused vertices dropped). dotframe.json assets.decimate applies it to iOS bundles. The Ones' tripod went from 9.2 MB to 3.8 MB at 0.35.

  • Volumetric fog stand-in: Environment.fog.scatter adds the light the fog throws toward the eye, so point lights get halos (PointLight.fog scales each one, like Godot's light_volumetric_fog_energy), and fog.volumes adds up to MAX_FOG_VOLUMES boxes of thicker fog with a height falloff (Godot FogVolume). Both are closed-form per fragment, no extra pass and no samples, so phones run the same code. Off by default; scenes without them render as before.

  • Several spot lights: Environment.spots lights together with spot, up to MAX_SPOTS (4). The first spot that asks for shadows gets the shadow map and the others light without shadows, on every platform, so phones pay one map as before; each extra spot costs a few ALU ops per fragment. The Ones lights the flashlight and the camcorder IR at once.

  • Custom material shaders: Renderer.createMaterial(wgsl) takes a WGSL fn surface(s: SurfaceIn) -> Surface (Godot's fragment(): albedo and emission from the world position, normal, UV, view vector, MeshRef.color, eight floats of MeshRef.params, time and the mesh texture), and MeshRef.material draws a mesh with it on static, skinned and instanced meshes. Built-in lighting, shadows, fog and exposure apply unchanged; meshes without a material keep the same shader and uniforms. One pipeline per material and mesh kind, made on first draw; phones run the same shader with no extra pass. The Ones ports one_skin.gdshader with it.

  • Post passes render at 0.75 of the asked size on mobile (gpu.mobile, POST_MOBILE_SCALE). On an iPhone 15 Plus, The Ones' camcorder viewfinder (a second full-screen pass) went from p95 21 ms with 146 ms spikes to p95 17.0 ms.

  • perf sets the viewport before opening the game and draws 30 untimed frames at --frame before measuring: runs used to start with up to nine one-second "hitches" from the resize and the first shader compiles.

  • Fixed: one renderer drawing two worlds (an in-game TV's set and the scene) reused per-entity GPU buffers across them, since both number entities from 0; buffers are now keyed by World.id too.

  • Renderer.updateInstances(set, data) rewrites an instance set in place (same count). Camera.aspect draws into a target of another shape than the surface, Camera.roll turns the view about its direction, and Camera.fixed keeps a camera inside the scene (one filming an in-game TV) from being replaced by snap --camera.

  • Render layers: MeshRef.layers and Camera.layers (bitmasks, default 1), like Godot's layers and cull mask. A mesh off layer 1 casts no shadow. The Ones uses it for what only the camcorder shows.

  • replay record --plan plan.json: go, look, press, wait (frames or until a state() path has a value) and expect steps, each able to hold named buttons ("with": ["crouch"]), steered through the new optional Sim.pilot and SimRun.pose. Replaces hand-tuned inputs and per-replay route scripts (The Ones had five copies of one). A failed step names its frame and writes nothing.

  • assets font --chars-from collects every character past Latin-1 (it skipped U+0100 to U+02FF, so ō, ā, ł and ş never baked: The Ones' "Gorō (shōbōdan)" drew as "Gor (shbdan)"), and the baker leaves out characters the font lacks instead of baking its .notdef box, and says how many.

  • replay verify --native compiles the sim with scriptc and runs each replay there, one process per replay, reporting the frame an abort happened after. doctor runs it over replays/*.json as native-replays, and CI runs it on the templates. Bun replays had passed The Ones' 15 replays while the iPhone aborted in a dialog.

  • MeshRef.emissive glows with the texture (surface color times emissive), so a textured emitter keeps its pattern; untextured meshes look the same as before.

  • fitFootprint(model, length) in src/model: scales a flat prop by its longest horizontal side.

  • The template's gitignore ignores only snaps in the repo root (/*.png); *.png hid every PNG asset, so a fresh clone lost the HUD font and textures.

From porting The Ones (Godot, first-person 3D horror) to dotframe.

  • Native sound effects stay 16-bit in their own channel count instead of float stereo, a quarter of the memory for mono files. The Ones' decoded audio went from about 159 MB to 40 MB.

  • Environment.sky: a procedural sky drawn behind the scene in its own pass: zenith to horizon gradient (Godot's sky_curve), ground, sun disc, a textured moon, twinkling stars, a Milky Way band and a low horizon glow, tonemapped like the scene.

  • assets slim: copies assets for shipping, with GLBs cut to what loadGlb reads (unused maps, tangents and UV sets dropped, 16-bit indices when they fit) and opaque PNG textures recoded as JPEG through ffmpeg. The web template and iOS builds use it. The Ones' models went from 15.2 MB to 8.7 MB with the same loadGlb output.

  • deploy links the build folder to deploy.project before deploying, so vercel 60 no longer uploads the repo root or links a project named after the folder. The template's build-web.ts keeps dist/web/.vercel.

  • doctor: native-traps:<target> warns on code that aborts natively while web passes (unguarded Record reads into a variable or argument, obj && expr as a value; silence a line with // dotframe-allow-native). tool:xcodebuild runs xcodebuild -version. build, device and doctor use Xcode when xcode-select points at Command Line Tools.

  • snap fails with the WGSL error and line instead of a black frame (gpuErrors in web/run), uses one browser session per run (back-to-back snaps timed out), and a timeout prints the page console.

  • Native mouse look: reading input.look() arms capture; a click enters relative mode, Escape or focus loss releases.

  • iOS launch screen: launchColor and an optional launch image, shown while init loads.

  • dev reports PORT_IN_USE; desync on a single-player sim points at doctor; Windows builds name the runtime pack version mismatch and the macos skill; src/native is type-checked in CI.

  • 3D under a 2D HUD in one frame: Renderer.draws() returns a scene's draws without presenting, Draw2D.scene(draws) queues them before the 2D batch, and both backends split a frame into passes when depth and non-depth pipelines mix (native: df_pass). Sim.render(draw) is unchanged, so snap and doctor work for 3D games.

  • Renderer: triplanar textures (MeshRef.texture, tile), emissive, and an optional Environment (ambient, sun, up to 8 point lights, a spot light, fog, ACES exposure); Camera.near/far. Without an environment the old look is kept.

  • glTF: loadGlb loads whole models (nodes, materials, embedded images, alpha modes, rest-pose skins); src/model.ts uploads and spawns them fitted to a height.

  • Skeletal animation: src/anim.ts (clip sampling with crossfade weights, joint matrices) and a GPU-skinned pipeline (addSkinnedMesh, MeshRef.joints).

  • Audio: steerable looping voices (start, setVoice, stopVoice) and spatial().

  • Post-processing: gpu.createTarget and gpu.frame(clear, draws, target) render into textures; src/post.ts runs a full-screen pass with your WGSL. RenderGpu.createTarget and destroyTexture are now required (scriptc cannot call optional functions): custom stub GPUs need both.

  • Mipmaps (createTexture/createImage mipmaps flag), instancing (addInstances, MeshRef.instances, sway, Environment.time) and spot light shadows (SpotLight.shadows, a 1024 shadow map with 4-tap PCF). bind takes an optional second texture (bindings 3 and 4).

  • src/retarget.ts: humanoid retargeting across Mixamo, Quaternius UAL and Character Creator 3 skeletons (ported from The Ones).

  • Fixed: worldMatrices composed the wrong local matrix when a child node came before its parent in the file (UAL's Head is node 0), which skewed animated poses of such models.

  • Input.look() with run(..., { pointerLock: true }) on the web, for first-person cameras.

  • SimPlatform.image (decode for snap) and Sim.clear (snap's clear color).

  • Native decodes JPEG (stb_image was PNG-only).

  • dotframe new depends on the CLI's own engine version (it pinned ^0.1.0), and templates ship a discord target.