lecodes-sdk 2.2.14 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -129,17 +129,6 @@ export type SceneOptions = {
129
129
  * loses its top mip levels on load, a glTF image is downsampled. Applied before this scene's
130
130
  * assets load; like `anisotropy` it does not touch textures already loaded. */
131
131
  maxTextureSize?: number;
132
- /** The look on an HDR display (a screen with headroom above SDR white — Apple XDR panels, the
133
- * macOS host today); ignored on SDR. `strength` 0..1 is how much of the picture reaches for the
134
- * display's headroom (0 only what SDR clipped, 1 nearly everything; default 0.35). `paperWhite`
135
- * 1..8 is where white lands as a multiple of SDR white — the "HDR brightness" of a console
136
- * calibration screen, where 1.5–2 is the norm; default 1 keeps a white wall at the UI's white,
137
- * faithful but dim next to what "HDR on" is expected to look like. Engine-wide like `anisotropy`;
138
- * `device.hdr` is the runtime form and tells you whether the display has any headroom at all. */
139
- hdr?: {
140
- strength?: number;
141
- paperWhite?: number;
142
- };
143
132
  };
144
133
  export declare class Scene implements Presentable {
145
134
  readonly camera: Camera;
@@ -95,6 +95,25 @@ export type ColorCurves = {
95
95
  midPoint?: Rgb;
96
96
  highlightScale?: Rgb;
97
97
  };
98
+ /** The look on an HDR display — a screen with headroom above SDR white (Apple's XDR panels, an
99
+ * external display in HDR mode), where the operator is stretched past SDR white toward the peak.
100
+ * Ignored on SDR: stored, read back, nothing changes on screen (`device.hdr.available` says which
101
+ * display this is). Part of the grading band — a change is a bake — and quantised to 0.05 steps. */
102
+ export type HdrLook = {
103
+ /** How much of the picture reaches for the display's headroom, 0..1 (default 0.35). 0 touches only
104
+ * what SDR clipped — the SDR grade kept exactly, but a mostly-mid-tone frame then looks flat next
105
+ * to its one bright spot; 1 lifts nearly everything above black toward the peak. A sunlit
106
+ * exterior takes 1, a dim interior wants less. */
107
+ strength?: number;
108
+ /** Where white lands, as a multiple of SDR white, 1..8 (default 1) — the "HDR brightness" of a
109
+ * console game's calibration screen, where 1.5–2 is the norm. It scales the WHOLE picture: at 1
110
+ * a white wall is as bright as the UI's white (faithful, and dim next to what "HDR on" is
111
+ * expected to look like), at 2 twice that, and highlights still climb above it (the engine keeps
112
+ * `headroom / paperWhite` for them, clamped at the peak). `strength` decides how much of the
113
+ * picture reaches for the peak; this decides where the picture starts — a game that wants to read
114
+ * as "HDR on" rather than "SDR with a brighter sun" wants this over `strength`. */
115
+ paperWhite?: number;
116
+ };
98
117
  export type PostProcessingOptions = {
99
118
  /** The operator that folds the scene's HDR light into the display's range (default 'aces').
100
119
  * `'aces'` (filament's ACES legacy) desaturates bright colours towards white — HDR fire reads
@@ -128,6 +147,11 @@ export type PostProcessingOptions = {
128
147
  * the operator, in display-referred sRGB — a `.cube` file: `asset('./look.cube')`, or a bare
129
148
  * staged filename. `null` removes it. */
130
149
  lut?: string | null;
150
+ /** The look on an HDR display: `strength` 0..1 (how much of the picture reaches for the peak:
151
+ * 0 only what SDR clipped … 1 nearly everything; default 0.35), `paperWhite` 1..8 (where white
152
+ * lands × SDR white — the console "HDR brightness", 1.5–2 the norm; default 1). Ignored on SDR.
153
+ * An overlay takes its parent's, like the rest of the grading. */
154
+ hdr?: HdrLook;
131
155
  /** `true` = defaults (intensity 0.2), an object = its knobs, `false` = off. */
132
156
  bloom?: boolean | BloomOptions;
133
157
  /** `true` = defaults (a soft black edge), an object = its knobs, `false` = off. */
@@ -140,7 +164,8 @@ export type PostProcessingOptions = {
140
164
  depthOfField?: boolean | DepthOfFieldOptions;
141
165
  };
142
166
  /** The float layout of `_creator.setColorGrading` — creator.h's ColorGradingParam. Indices never
143
- * move; a new field goes at the end and COUNT grows. */
167
+ * move; a new field goes at the end and COUNT grows (the engine takes an older bundle's shorter
168
+ * array, down to the 39 before HDR_*, with the tail at its defaults). */
144
169
  export declare const CG: {
145
170
  readonly TONE_MAPPING: 0;
146
171
  readonly EXPOSURE: 1;
@@ -160,7 +185,9 @@ export declare const CG: {
160
185
  readonly MID_POINT: 32;
161
186
  readonly HIGHLIGHT_SCALE: 35;
162
187
  readonly LUT: 38;
163
- readonly COUNT: 39;
188
+ readonly HDR_STRENGTH: 39;
189
+ readonly HDR_PAPER_WHITE: 40;
190
+ readonly COUNT: 41;
164
191
  };
165
192
  /** The scene's post-processing (`scene.postProcessing`). Read a field for the current value, write
166
193
  * one to change it; `apply(options)` writes the named ones; `reset()` is the defaults. */
@@ -212,6 +239,8 @@ export declare class PostProcessing {
212
239
  set curves(v: ColorCurves);
213
240
  get lut(): string | null;
214
241
  set lut(v: string | null);
242
+ get hdr(): Required<HdrLook>;
243
+ set hdr(v: HdrLook);
215
244
  get bloom(): Required<BloomOptions> | false;
216
245
  set bloom(v: boolean | BloomOptions);
217
246
  get vignette(): Required<VignetteOptions> | false;
@@ -88,11 +88,13 @@ export declare const device: {
88
88
  * `(0,0,0)` when not running. */
89
89
  readonly gravity: Vec3;
90
90
  };
91
- /** The display's extended dynamic range — HDR. On a screen with headroom above SDR white (Apple's
92
- * XDR panels; the macOS host today) the 3D surface is float and the engine renders past 1.0:
93
- * 1.0 is the white of the UI and of a diffuse white surface, and the sun, emissives and speculars
94
- * climb up to `headroom` times that. Everywhere else it is SDR: `available` false, `headroom` 1,
95
- * the look setters remembered but invisible.
91
+ /** The display's extended dynamic range — HDR: the FACTS about the display. On the macOS desktop
92
+ * host, in a visible window on a screen with headroom above SDR white (Apple's XDR panels, an HDR
93
+ * external display), the 3D surface is float and the engine renders past 1.0: 1.0 is the white of
94
+ * the UI and of a diffuse white surface, and the sun, emissives and speculars climb up to
95
+ * `headroom` times that. Everywhere else it is SDR (the other hosts, a hidden window, a render to
96
+ * PNG): `available` false, `headroom` 1. The LOOK on such a display — how much of the picture
97
+ * reaches for the peak, where white lands — is the scene's: `scene.postProcessing.hdr`.
96
98
  *
97
99
  * Branch content on `available`, not on `headroom` — the live value ramps up from 1 over the
98
100
  * first seconds after launch and follows the brightness keys. Particle `emissive` is the thing
@@ -108,20 +110,6 @@ export declare const device: {
108
110
  * white, quantised to half-stops. Moves with brightness and the screen under the window
109
111
  * (`hdrchange` event); never below 1. */
110
112
  readonly headroom: number;
111
- /** How much of the picture reaches for the headroom, 0..1 (default 0.35). 0 touches only what
112
- * SDR clipped — faithful to the SDR grade, but a mostly-mid-tone frame then looks flat next to
113
- * the one bright spot; 1 lifts nearly everything above black toward the peak. A sunlit exterior
114
- * takes 1, a dim interior wants less. A host may pin it (`LECODES_HDR_STRENGTH`). */
115
- strength: number;
116
- /** Where white lands, as a multiple of SDR white, 1..8 (default 1) — the "HDR brightness" of a
117
- * console game's calibration screen, where paper white sits at ~200 nits against SDR's ~100.
118
- * It scales the WHOLE picture: at 1 a white wall is as bright as the UI's white, at 2 it is
119
- * twice that, and highlights still climb above it (the engine keeps `headroom / paperWhite` for
120
- * them, clamped at the peak). `strength` decides how much of the picture reaches for the
121
- * peak; this decides where the picture starts. 1.5–2 is the console norm; a game that wants to
122
- * read as "HDR on" rather than "SDR with a brighter sun" wants this over `strength`. A host may
123
- * pin it (`LECODES_HDR_PAPER_WHITE`). */
124
- paperWhite: number;
125
113
  };
126
114
  /** Current connectivity — best-effort navigator.onLine semantics: `false` only when the platform
127
115
  * is sure there's no network. `true` on hosts that don't track it. Change events: `"online"` /
@@ -1,4 +1,4 @@
1
- export declare const SDK_VERSION = "2.2.14";
1
+ export declare const SDK_VERSION = "2.3.1";
2
2
  /** The major of a semver string, or null when it is not one. */
3
3
  export declare const sdkMajor: (version: string | null | undefined) => number | null;
4
4
  /** The `// sdk: <version>` line of a compiled bundle's header (sdk/src/compile/header.ts), read from