@kassoulet/cathode 0.1.0 → 0.1.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.
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,11 @@ All notable changes to `@kassoulet/cathode`. Format based on [Keep a Changelog](
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.1.1]
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
- Default look has no barrel curve and no glass reflection: `Default` preset (`curve: 0`, `reflections: 0`), `new Cathode()` default and `DEFAULTS`.
|
|
11
|
+
|
|
7
12
|
## [0.1.0]
|
|
8
13
|
|
|
9
14
|
### Added
|
package/package.json
CHANGED
package/src/cathode/cathode.js
CHANGED
|
@@ -17,11 +17,11 @@ export class Cathode {
|
|
|
17
17
|
/**
|
|
18
18
|
* @param {object} o
|
|
19
19
|
* @param {HTMLCanvasElement} o.canvas
|
|
20
|
-
* @param {object} [o.preset=
|
|
20
|
+
* @param {object} [o.preset=Detailed.Enhance with curvature 0] or `{complexity, tier}` (lowercase, as in the spec)
|
|
21
21
|
* @param {"gl"|"fast"} [o.backend="gl"] gl falls back to fast without WebGL2; wgpu/sw throw.
|
|
22
22
|
* @param {object} [o.gl] extra options forwarded to crt-canvas (e.g. dataUrl).
|
|
23
23
|
*/
|
|
24
|
-
constructor({ canvas, preset =
|
|
24
|
+
constructor({ canvas, preset = { complexity: "detailed", tier: "enhance", geometry: { curvature: 0 } }, backend = "gl", gl: glOptions } = {}) {
|
|
25
25
|
if (backend === "sw" || backend === "wgpu") throw new Error(`cathode: the '${backend}' backend is not implemented in cathode-js`);
|
|
26
26
|
if (!(canvas instanceof HTMLCanvasElement)) throw new Error("cathode: `canvas` must be a <canvas>");
|
|
27
27
|
this.canvas = canvas;
|
package/src/cathode/settings.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
export const DEFAULTS = {
|
|
4
4
|
// aspectRatio: undefined = follow the source (the spec's 4:3 default would distort 16:9 video)
|
|
5
|
-
geometry: { curvature: 0
|
|
5
|
+
geometry: { curvature: 0, cornerRadius: 0.05, vignette: 0.3, aspectRatio: undefined },
|
|
6
6
|
beam: { scanlineIntensity: 0.35, scanlineCount: 0, focus: 1.2 }, // scanlineCount 0 = auto
|
|
7
7
|
phosphor: { type: "aperture-grille", mask: 0.25, persistence: 0.15, bleed: 0.08 },
|
|
8
8
|
signal: { chromaticAberration: 0.003, compositeArtifacts: 0, noise: 0.02, humBar: 0, analog: "off" },
|
|
9
9
|
// Extension to the spec: glass/bloom knobs the multi-pass pipeline exposes.
|
|
10
|
-
glass: { bloom: 0.3, reflection: 0
|
|
10
|
+
glass: { bloom: 0.3, reflection: 0 },
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
/** Deep-merge `patch` into a copy of `base` (two levels: group → key). */
|