Scope camera picture milestones to the run whose frame drew them
A camera shown only as the screen's own view was never prepared: the note required a non-empty picture list. Two runs picking the same local id both claimed the screen's frame, though only the first one's camera was drawn from it. The client now notes whether the frame was a world frame and the (run, camera id) the screen's world was drawn from, so the main-view milestone belongs to the run whose selection the screen used, and a title or loading frame reports the path off without erasing earlier milestones. A world transition clears the submission, the main-view selection and the milestones: another world's cameras are not drawn. A camera given to set-main-view drops its picture target, so its milestone starts over until a frame is drawn from it. prepared stays a host-side encoding milestone, not target registration, not a GPU fence, not a visible pixel. Also gate the client's note on the `mods` feature: without it the default horizon-client build did not compile. Verified: horizon-mods 37 unit, 44 sandbox (1 ignored; real Wasmtime guests, the two-run test shows each id 7 follows only its own pictures and selection) and 4 api_reference; client checks and build with and without `mods`; gfx lib tests. Co-Authored-By: Kimi Code <noreply@moonshot.cn>
This commit is contained in:
@@ -820,7 +820,7 @@ API level 27: state for the calling mod and current world generation. Accepted m
|
||||
|
||||
### record `camera-readiness`
|
||||
|
||||
One `set-views` camera's readiness in the calling run and world generation. `request-accepted` means the run's latest non-empty `set-views` stored this camera this generation. `prepared` means the renderer encoded this camera's picture into its texture target in a real frame of this generation (or the camera is the run's `set-main-view` selection and a world frame rendered from it): a host-side encoding milestone, not GPU completion, not a visible pixel. A rotating per-frame budget may skip a picture camera some frames.
|
||||
One `set-views` camera's readiness in the calling run and world generation. `request-accepted` means the run's latest non-empty `set-views` stored this camera this generation. `prepared` means the renderer encoded this camera's picture into its texture target in a real frame of this generation, or a world frame was drawn from it as this run's `set-main-view` selection (only the run whose selection the screen used gets that milestone): a host-side encoding milestone, not GPU completion, not a visible pixel. A rotating per-frame budget may skip a picture camera some frames.
|
||||
|
||||
| Field | Type | |
|
||||
| --- | --- | --- |
|
||||
@@ -831,7 +831,7 @@ One `set-views` camera's readiness in the calling run and world generation. `req
|
||||
|
||||
### record `camera-state`
|
||||
|
||||
API level 30. State of the calling run's `set-views` cameras for this world. Available means this host implements the API. Enabled means the renderer's mod-camera picture path was live in the last noted frame (a world frame, not a title screen), not that any camera was drawn. `request-accepted` and `prepared` aggregate the per-camera list: accepted means the run's latest `set-views` stored cameras this generation, prepared means at least one was drawn (or rendered as the screen's main view). `main-view` is the camera id the run last selected with `set-main-view`, if any. An empty `set-views` clears the request; a world transition or mod reload invalidates readiness.
|
||||
API level 30. State of the calling run's `set-views` cameras for this world. Available means this host implements the API. Enabled means the last noted frame was a world frame, where the renderer draws the mods' pictures (not the title or a loading screen), not that any camera was drawn. `request-accepted` and `prepared` aggregate the per-camera list: accepted means the run's latest `set-views` stored cameras this generation, prepared means at least one has a milestone. `main-view` is the camera id the run last selected with `set-main-view`, if any; when runs select ids that meet, the screen uses the first running mod's. An empty `set-views` clears the request; a world transition clears the submission and the main-view selection, and a mod reload starts over.
|
||||
|
||||
| Field | Type | |
|
||||
| --- | --- | --- |
|
||||
@@ -942,7 +942,7 @@ Where a capture is.
|
||||
| `clear-post` | `func()` | Removes this mod's post pass: the world is shown as the game draws it. |
|
||||
| `set-params` | `func(params: list<f32>)` | The pass's `frame.params` (up to 1024 floats, as 256 vec4), kept until replaced; call it once a tick (the pass gets the partial tick in `frame.time.y`). |
|
||||
| `set-views` | `func(views: list<camera-view>)` | Replaces the mod's cameras: up to 8. A `view` shape shows one; the game renders up to three a frame, in turn. |
|
||||
| `set-main-view` | `func(view: option<u32>)` | Renders the screen's world from one of the `set-views` cameras (AirDef fork), with everything the player's own view has: the HD lighting, sky, clouds, fog, smoke, TAA and the post passes, at the window's resolution. The picture size of that camera is ignored, the player's hand, block outline and the game's HUD are not drawn (the mod's own `set-hud` shapes are); a `view` shape of that camera draws nothing. For a full-screen replay or a director's camera; the small pictures of monitors stay `view` shapes. None (or an unknown id) is the player's own view. The chunks stay those round the player. |
|
||||
| `set-main-view` | `func(view: option<u32>)` | Renders the screen's world from one of the `set-views` cameras (AirDef fork), with everything the player's own view has: the HD lighting, sky, clouds, fog, smoke, TAA and the post passes, at the window's resolution. The picture size of that camera is ignored, the player's hand, block outline and the game's HUD are not drawn (the mod's own `set-hud` shapes are); a `view` shape of that camera draws nothing, its picture target is dropped, and `camera-status` counts it prepared again only after a frame is drawn from it. For a full-screen replay or a director's camera; the small pictures of monitors stay `view` shapes. None (or an unknown id) is the player's own view. The chunks stay those round the player. |
|
||||
| `set-lights` | `func(lights: list<point-light>)` | Replaces the mod's lights: up to 512, interpolated per id between the last two calls. |
|
||||
| `set-lighting` | `func(lighting: lighting)` | Switches the HD lighting on or off for this mod's world, with its exposure and bloom; off, the world is drawn as the game draws it. |
|
||||
| `set-time-override` | `func(day-time: option<u64>)` | Shows the world at this time of day (AirDef fork): the sky, the sun and moon, the sky light and the fog, as `day-time` ticks (24000 a day, as `clock`). Only what the player sees changes: the world's own clock, its saves and its rules do not. None shows the world's own time. |
|
||||
|
||||
Reference in New Issue
Block a user