@nova-lab/core 1.2.2-dev.259 → 1.2.2-dev.272
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/README.md +55 -0
- package/dist/2d/effects.js +165 -404
- package/dist/2d/lighting.d.ts +2 -0
- package/dist/2d/lighting.js +483 -227
- package/dist/2d/lottie.js +1 -1
- package/dist/2d/meshes.js +2 -2
- package/dist/2d/render-textures.js +3 -537
- package/dist/2d.js +3 -3
- package/dist/{NovaNode-CBZ-Ol-W.js → NovaNode-CshmSV9Y.js} +21 -21
- package/dist/{NovaRenderCommandWriter-CWQRa42y.js → NovaRenderCommandWriter-DeHyKjke.js} +272 -251
- package/dist/NovaRenderTexture-Desjl5-m.js +539 -0
- package/dist/{NovaTextSelectionService-7JqMcRrP.js → NovaTextSelectionService-CWJKn7TW.js} +3948 -3517
- package/dist/{NovaWebGLProgram-BO250QNF.js → NovaWebGLProgram-ytnblA5d.js} +28 -25
- package/dist/core.js +3 -3
- package/dist/model/lighting/LightingFields2D.d.ts +35 -0
- package/dist/model/lighting/LightingRenderer2D.d.ts +11 -18
- package/dist/model/lighting/LightingScene2D.d.ts +43 -0
- package/dist/model/lighting/NovaLighting2D.d.ts +18 -33
- package/dist/model/lighting/NovaLightingEffect2D.d.ts +46 -0
- package/dist/model/lighting/lighting-effect.d.ts +24 -0
- package/dist/model/lighting/lighting-shaders.d.ts +2 -2
- package/dist/model/lighting/lighting.types.d.ts +5 -1
- package/dist/model/render/backends/webgl/NovaWebGLCompositionPass.d.ts +2 -1
- package/dist/model/render/backends/webgl/NovaWebGLFrameRenderer.d.ts +26 -2
- package/dist/model/render/backends/webgl/NovaWebGLPathClipPass.d.ts +3 -2
- package/dist/model/render/backends/webgl/NovaWebGLProgram.d.ts +1 -1
- package/dist/model/render/graph/nova-render-dirty-items.d.ts +12 -0
- package/dist/model/runtime/cursor/NovaCursorManager.d.ts +7 -0
- package/dist/shader-effect-CHXZBHrO.js +247 -0
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class m {
|
|
2
2
|
constructor(r, e) {
|
|
3
3
|
this.gl = r, this.program = e;
|
|
4
4
|
}
|
|
@@ -41,57 +41,60 @@ class d {
|
|
|
41
41
|
if (r)
|
|
42
42
|
throw e;
|
|
43
43
|
}
|
|
44
|
-
static create(r, e, t) {
|
|
45
|
-
let a,
|
|
44
|
+
static create(r, e, t, c) {
|
|
45
|
+
let a, n, o = null;
|
|
46
46
|
try {
|
|
47
|
-
if (a =
|
|
47
|
+
if (a = d(r, r.VERTEX_SHADER, e), n = d(r, r.FRAGMENT_SHADER, t), o = r.createProgram(), !o)
|
|
48
48
|
throw new Error("Failed to create WebGL2 program");
|
|
49
|
-
if (r.attachShader(o, a), r.attachShader(o,
|
|
49
|
+
if (r.attachShader(o, a), r.attachShader(o, n), c)
|
|
50
|
+
for (const [l, u] of Object.entries(c))
|
|
51
|
+
r.bindAttribLocation(o, u, l);
|
|
52
|
+
if (r.linkProgram(o), !r.getProgramParameter(o, r.LINK_STATUS))
|
|
50
53
|
throw new Error(`Failed to link WebGL2 program: ${r.getProgramInfoLog(o) ?? "unknown link error"}`);
|
|
51
|
-
const
|
|
52
|
-
a = void 0, r.deleteShader(
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
return o = null,
|
|
57
|
-
} catch (
|
|
58
|
-
for (const
|
|
54
|
+
const h = a;
|
|
55
|
+
a = void 0, r.deleteShader(h);
|
|
56
|
+
const s = n;
|
|
57
|
+
n = void 0, r.deleteShader(s);
|
|
58
|
+
const f = new m(r, o);
|
|
59
|
+
return o = null, f;
|
|
60
|
+
} catch (h) {
|
|
61
|
+
for (const s of [
|
|
59
62
|
() => {
|
|
60
63
|
a && r.deleteShader(a);
|
|
61
64
|
},
|
|
62
65
|
() => {
|
|
63
|
-
|
|
66
|
+
n && r.deleteShader(n);
|
|
64
67
|
},
|
|
65
68
|
() => {
|
|
66
69
|
o && r.deleteProgram(o);
|
|
67
70
|
}
|
|
68
71
|
])
|
|
69
72
|
try {
|
|
70
|
-
|
|
73
|
+
s();
|
|
71
74
|
} catch {
|
|
72
75
|
}
|
|
73
|
-
throw
|
|
76
|
+
throw h;
|
|
74
77
|
}
|
|
75
78
|
}
|
|
76
79
|
}
|
|
77
|
-
function
|
|
78
|
-
const t =
|
|
80
|
+
function d(i, r, e) {
|
|
81
|
+
const t = i.createShader(r);
|
|
79
82
|
if (!t)
|
|
80
83
|
throw new Error("Failed to create WebGL2 shader");
|
|
81
84
|
try {
|
|
82
|
-
if (
|
|
83
|
-
const
|
|
84
|
-
throw new Error(`Failed to compile WebGL2 shader: ${
|
|
85
|
+
if (i.shaderSource(t, e), i.compileShader(t), !i.getShaderParameter(t, i.COMPILE_STATUS)) {
|
|
86
|
+
const a = i.getShaderInfoLog(t) ?? "unknown compile error";
|
|
87
|
+
throw new Error(`Failed to compile WebGL2 shader: ${a}`);
|
|
85
88
|
}
|
|
86
89
|
return t;
|
|
87
|
-
} catch (
|
|
90
|
+
} catch (c) {
|
|
88
91
|
try {
|
|
89
|
-
|
|
92
|
+
i.deleteShader(t);
|
|
90
93
|
} catch {
|
|
91
94
|
}
|
|
92
|
-
throw
|
|
95
|
+
throw c;
|
|
93
96
|
}
|
|
94
97
|
}
|
|
95
98
|
export {
|
|
96
|
-
|
|
99
|
+
m as N
|
|
97
100
|
};
|
package/dist/core.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as o, a as s, N as t, b as r, R as n, S as N, c as v, d as i, e as c, f as d, g as l, h as p, i as S, j as m, k as R, m as u, n as C, r as A, l as T, o as h, p as E, q as g, s as P, t as y, u as f, v as M } from "./NovaNode-
|
|
2
|
-
import { A as b, C as _, a as x, E as D, G as O, N as B, b as V, c as G, d as L, e as k, f as F, g as H, h as j, i as z, j as q, k as K, l as Y, m as U, n as W, o as w, p as J, q as Q, r as X, s as Z, t as $, u as aa, v as ea, w as oa, x as sa, y as ta, z as ra, B as na, D as Na, F as va, H as ia, I as ca, J as da, J as la, K as pa, L as Sa, M as ma, O as Ra, P as ua, Q as Ca, R as Aa, S as Ta, T as ha, U as Ea, V as ga, W as Pa, X as ya, Y as fa, Z as Ma, _ as Ia, $ as ba, a0 as _a, a1 as xa, a2 as Da, a3 as Oa, a4 as Ba, a5 as Va, a6 as Ga, a7 as La, a8 as ka, a9 as Fa, aa as Ha, ab as ja, ac as za, ad as qa, ae as Ka, af as Ya, ag as Ua, ah as Wa, ai as wa, aj as Ja, ak as Qa, al as Xa, am as Za, an as $a, ao as ae, ap as ee, aq as oe, ar as se, as as te, at as re, au as ne, av as Ne, aw as ve, ax as ie, ay as ce, az as de, aA as le, aB as pe, aC as Se, aD as me, aE as Re, aF as ue, aG as Ce, aH as Ae, aI as Te, aJ as he, aK as Ee, aL as ge, aM as Pe, aN as ye, aO as fe, aP as Me, aQ as Ie, aR as be, aS as _e, aT as xe, aU as De, aV as Oe, aW as Be, aX as Ve, aY as Ge, aZ as Le, a_ as ke, a$ as Fe, b0 as He, b1 as je, b2 as ze, b3 as qe, b4 as Ke, b5 as Ye, b6 as Ue, b7 as We, b8 as we } from "./NovaTextSelectionService-
|
|
3
|
-
import { N as Qe, R as Xe, c as Ze, a as $e, b as ao, d as eo, e as oo, f as so, g as to, h as ro, i as no, j as No, k as vo, l as io, m as co, n as lo, o as po, r as So, p as mo, s as Ro, q as uo } from "./NovaRenderCommandWriter-
|
|
1
|
+
import { D as o, a as s, N as t, b as r, R as n, S as N, c as v, d as i, e as c, f as d, g as l, h as p, i as S, j as m, k as R, m as u, n as C, r as A, l as T, o as h, p as E, q as g, s as P, t as y, u as f, v as M } from "./NovaNode-CshmSV9Y.js";
|
|
2
|
+
import { A as b, C as _, a as x, E as D, G as O, N as B, b as V, c as G, d as L, e as k, f as F, g as H, h as j, i as z, j as q, k as K, l as Y, m as U, n as W, o as w, p as J, q as Q, r as X, s as Z, t as $, u as aa, v as ea, w as oa, x as sa, y as ta, z as ra, B as na, D as Na, F as va, H as ia, I as ca, J as da, J as la, K as pa, L as Sa, M as ma, O as Ra, P as ua, Q as Ca, R as Aa, S as Ta, T as ha, U as Ea, V as ga, W as Pa, X as ya, Y as fa, Z as Ma, _ as Ia, $ as ba, a0 as _a, a1 as xa, a2 as Da, a3 as Oa, a4 as Ba, a5 as Va, a6 as Ga, a7 as La, a8 as ka, a9 as Fa, aa as Ha, ab as ja, ac as za, ad as qa, ae as Ka, af as Ya, ag as Ua, ah as Wa, ai as wa, aj as Ja, ak as Qa, al as Xa, am as Za, an as $a, ao as ae, ap as ee, aq as oe, ar as se, as as te, at as re, au as ne, av as Ne, aw as ve, ax as ie, ay as ce, az as de, aA as le, aB as pe, aC as Se, aD as me, aE as Re, aF as ue, aG as Ce, aH as Ae, aI as Te, aJ as he, aK as Ee, aL as ge, aM as Pe, aN as ye, aO as fe, aP as Me, aQ as Ie, aR as be, aS as _e, aT as xe, aU as De, aV as Oe, aW as Be, aX as Ve, aY as Ge, aZ as Le, a_ as ke, a$ as Fe, b0 as He, b1 as je, b2 as ze, b3 as qe, b4 as Ke, b5 as Ye, b6 as Ue, b7 as We, b8 as we } from "./NovaTextSelectionService-CWJKn7TW.js";
|
|
3
|
+
import { N as Qe, R as Xe, c as Ze, a as $e, b as ao, d as eo, e as oo, f as so, g as to, h as ro, i as no, j as No, k as vo, l as io, m as co, n as lo, o as po, r as So, p as mo, s as Ro, q as uo } from "./NovaRenderCommandWriter-DeHyKjke.js";
|
|
4
4
|
import { b as Ao, a as To, c as ho, d as Eo, e as go, p as Po, f as yo, s as fo, t as Mo, u as Io } from "./nova-color-parser-BCN_rFRN.js";
|
|
5
5
|
import { N as _o, a as xo, c as Do, b as Oo, d as Bo, e as Vo, f as Go, g as Lo, h as ko, i as Fo, j as Ho, k as jo, l as zo, m as qo, n as Ko, o as Yo, r as Uo } from "./NovaAssetRegistry-p2QlCwvT.js";
|
|
6
6
|
import { RaphSchedulerType as wo } from "@raphy-js/raph/runtime";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { LightState2D } from './lighting-state.js';
|
|
2
|
+
import { NovaLightingBounds2D, NovaLightingOptions2D, NovaLightOccluderOptions2D, NovaLightReceiverOptions2D } from './lighting.types.js';
|
|
3
|
+
export declare function lightingCanvas(width?: number, height?: number): HTMLCanvasElement;
|
|
4
|
+
export interface LightingFrame2D {
|
|
5
|
+
lights: LightState2D[];
|
|
6
|
+
occluders: Readonly<NovaLightOccluderOptions2D>[];
|
|
7
|
+
receivers: Readonly<NovaLightReceiverOptions2D>[];
|
|
8
|
+
ignoredOccluders: ReadonlyMap<Readonly<NovaLightReceiverOptions2D>, number>;
|
|
9
|
+
receiverRevision: number;
|
|
10
|
+
ambient: readonly number[];
|
|
11
|
+
bounds: NovaLightingBounds2D;
|
|
12
|
+
}
|
|
13
|
+
export declare class LightingFields2D {
|
|
14
|
+
private readonly _options;
|
|
15
|
+
private readonly _field;
|
|
16
|
+
private readonly _fieldContext;
|
|
17
|
+
private readonly _receiverMasks;
|
|
18
|
+
private _normalField?;
|
|
19
|
+
private _responseField?;
|
|
20
|
+
private _surfaceField;
|
|
21
|
+
private _fieldKey;
|
|
22
|
+
private _disposed;
|
|
23
|
+
constructor(_options: Required<NovaLightingOptions2D>);
|
|
24
|
+
update(frame: LightingFrame2D, width: number, height: number): boolean;
|
|
25
|
+
invalidate(): void;
|
|
26
|
+
get image(): HTMLCanvasElement;
|
|
27
|
+
get normal(): HTMLCanvasElement | undefined;
|
|
28
|
+
get response(): HTMLCanvasElement | undefined;
|
|
29
|
+
get surface(): boolean;
|
|
30
|
+
get state(): {
|
|
31
|
+
receiverMasks: number;
|
|
32
|
+
ownedCanvases: number;
|
|
33
|
+
};
|
|
34
|
+
dispose(): void;
|
|
35
|
+
}
|
|
@@ -1,24 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
export interface LightingFrame2D {
|
|
5
|
-
lights: LightState2D[];
|
|
6
|
-
occluders: Readonly<NovaLightOccluderOptions2D>[];
|
|
7
|
-
receivers: Readonly<NovaLightReceiverOptions2D>[];
|
|
8
|
-
ignoredOccluders: ReadonlyMap<Readonly<NovaLightReceiverOptions2D>, number>;
|
|
9
|
-
receiverRevision: number;
|
|
10
|
-
ambient: readonly number[];
|
|
11
|
-
bounds: NovaLightingBounds2D;
|
|
12
|
-
}
|
|
1
|
+
import { NovaLightingOptions2D } from './lighting.types.js';
|
|
2
|
+
import { LightingFrame2D } from './LightingFields2D.js';
|
|
3
|
+
export type { LightingFrame2D } from './LightingFields2D.js';
|
|
13
4
|
/** Private compositor; all GPU/canvas resources belong to this one mounted owner. */
|
|
14
5
|
export declare class LightingRenderer2D {
|
|
15
6
|
private readonly _options;
|
|
16
7
|
readonly canvas: HTMLCanvasElement;
|
|
17
|
-
private readonly _field;
|
|
18
8
|
private readonly _source;
|
|
19
|
-
private readonly _fieldContext;
|
|
20
9
|
private readonly _sourceContext;
|
|
21
|
-
private readonly
|
|
10
|
+
private readonly _fields;
|
|
11
|
+
private _surfaceField;
|
|
22
12
|
private readonly _lifetime;
|
|
23
13
|
private readonly _gl;
|
|
24
14
|
private _textures;
|
|
@@ -26,13 +16,15 @@ export declare class LightingRenderer2D {
|
|
|
26
16
|
private _shaders;
|
|
27
17
|
private _framebuffer?;
|
|
28
18
|
private readonly _uniforms;
|
|
29
|
-
private _fieldKey;
|
|
30
19
|
private _lost;
|
|
31
20
|
private _disposed;
|
|
32
21
|
private _renders;
|
|
33
22
|
private _generation;
|
|
34
23
|
private _lightWidth;
|
|
35
24
|
private _lightHeight;
|
|
25
|
+
private _lightBufferComplete;
|
|
26
|
+
private _floatAvailable;
|
|
27
|
+
private _lightFloat;
|
|
36
28
|
private _geometryValid;
|
|
37
29
|
private _lastOccluders;
|
|
38
30
|
constructor(_options: Required<NovaLightingOptions2D>);
|
|
@@ -45,15 +37,16 @@ export declare class LightingRenderer2D {
|
|
|
45
37
|
private _releaseGPU;
|
|
46
38
|
get available(): boolean;
|
|
47
39
|
get state(): {
|
|
40
|
+
ownedCanvases: number;
|
|
41
|
+
receiverMasks: number;
|
|
48
42
|
available: boolean;
|
|
49
43
|
generation: number;
|
|
50
44
|
renders: number;
|
|
45
|
+
lightPrecision: "float16" | "unorm8";
|
|
51
46
|
textures: number;
|
|
52
47
|
programs: number;
|
|
53
48
|
shaders: number;
|
|
54
49
|
framebuffers: number;
|
|
55
|
-
receiverMasks: number;
|
|
56
|
-
ownedCanvases: number;
|
|
57
50
|
};
|
|
58
51
|
dispose(): void;
|
|
59
52
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { NovaDirectionalLightOptions2D, NovaLightingHandle2D, NovaLightingOptions2D, NovaLightingRenderOptions2D, NovaLightOccluderOptions2D, NovaLightReceiverOptions2D, NovaPointLightOptions2D, NovaSpotLightOptions2D } from './lighting.types.js';
|
|
2
|
+
import { LightingFrame2D } from './LightingRenderer2D.js';
|
|
3
|
+
/**
|
|
4
|
+
* Experimental lighting scene for explicit 2D render passes. No timers or hidden
|
|
5
|
+
* NovaNode discovery. The mounting scene owns this service and calls dispose.
|
|
6
|
+
* Inputs are borrowed; output is a reusable canvas, valid until the next render.
|
|
7
|
+
*/
|
|
8
|
+
export declare class LightingScene2D {
|
|
9
|
+
private readonly _lights;
|
|
10
|
+
private readonly _occluders;
|
|
11
|
+
private readonly _occluderValues;
|
|
12
|
+
private readonly _receivers;
|
|
13
|
+
protected readonly _options: Required<NovaLightingOptions2D>;
|
|
14
|
+
private _receiverRevision;
|
|
15
|
+
private _revision;
|
|
16
|
+
protected _disposed: boolean;
|
|
17
|
+
private _ambient;
|
|
18
|
+
constructor(options?: NovaLightingOptions2D);
|
|
19
|
+
private _alive;
|
|
20
|
+
private _ambientValue;
|
|
21
|
+
setAmbient(value: readonly [
|
|
22
|
+
number,
|
|
23
|
+
number,
|
|
24
|
+
number
|
|
25
|
+
]): void;
|
|
26
|
+
private _handle;
|
|
27
|
+
private _light;
|
|
28
|
+
createDirectionalLight(options: NovaDirectionalLightOptions2D): NovaLightingHandle2D<NovaDirectionalLightOptions2D>;
|
|
29
|
+
createPointLight(options: NovaPointLightOptions2D): NovaLightingHandle2D<NovaPointLightOptions2D>;
|
|
30
|
+
createSpotLight(options: NovaSpotLightOptions2D): NovaLightingHandle2D<NovaSpotLightOptions2D>;
|
|
31
|
+
createOccluder(options: NovaLightOccluderOptions2D): NovaLightingHandle2D<NovaLightOccluderOptions2D>;
|
|
32
|
+
createReceiver(options: NovaLightReceiverOptions2D): NovaLightingHandle2D<NovaLightReceiverOptions2D>;
|
|
33
|
+
protected _frame(options: NovaLightingRenderOptions2D): LightingFrame2D;
|
|
34
|
+
get state(): {
|
|
35
|
+
disposed: boolean;
|
|
36
|
+
revision: number;
|
|
37
|
+
lights: number;
|
|
38
|
+
occluders: number;
|
|
39
|
+
receivers: number;
|
|
40
|
+
ambient: readonly [number, number, number];
|
|
41
|
+
};
|
|
42
|
+
dispose(): void;
|
|
43
|
+
}
|
|
@@ -1,50 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export declare class NovaLighting2D {
|
|
8
|
-
private readonly _lights;
|
|
9
|
-
private readonly _occluders;
|
|
10
|
-
private readonly _occluderValues;
|
|
11
|
-
private readonly _receivers;
|
|
1
|
+
import { EventList } from '@endge/utils';
|
|
2
|
+
import { NovaApp } from '../runtime/app/NovaApp.js';
|
|
3
|
+
import { NovaLightingOptions2D, NovaLightingRenderOptions2D } from './lighting.types.js';
|
|
4
|
+
import { LightingScene2D } from './LightingScene2D.js';
|
|
5
|
+
/** Explicit Canvas2D adapter; the scene owns descriptors, this owner owns its device. */
|
|
6
|
+
export declare class NovaLighting2D extends LightingScene2D {
|
|
12
7
|
private readonly _renderer;
|
|
13
|
-
private readonly
|
|
14
|
-
private _receiverRevision;
|
|
15
|
-
private _revision;
|
|
16
|
-
private _disposed;
|
|
17
|
-
private _ambient;
|
|
8
|
+
private readonly _effects;
|
|
18
9
|
constructor(options?: NovaLightingOptions2D);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
private _light;
|
|
28
|
-
createDirectionalLight(options: NovaDirectionalLightOptions2D): NovaLightingHandle2D<NovaDirectionalLightOptions2D>;
|
|
29
|
-
createPointLight(options: NovaPointLightOptions2D): NovaLightingHandle2D<NovaPointLightOptions2D>;
|
|
30
|
-
createSpotLight(options: NovaSpotLightOptions2D): NovaLightingHandle2D<NovaSpotLightOptions2D>;
|
|
31
|
-
createOccluder(options: NovaLightOccluderOptions2D): NovaLightingHandle2D<NovaLightOccluderOptions2D>;
|
|
32
|
-
createReceiver(options: NovaLightReceiverOptions2D): NovaLightingHandle2D<NovaLightReceiverOptions2D>;
|
|
33
|
-
private _frame;
|
|
10
|
+
/** Same descriptors, app-owned composition. Host detaches effect before disposal. */
|
|
11
|
+
createEffect<E extends EventList>(app: NovaApp<E>): {
|
|
12
|
+
effect: import('../render/effects/shader-effect.js').NovaShaderEffect<{
|
|
13
|
+
readonly illumination: "sampler2D";
|
|
14
|
+
}>;
|
|
15
|
+
update: (options: NovaLightingRenderOptions2D) => void;
|
|
16
|
+
dispose: () => void;
|
|
17
|
+
};
|
|
34
18
|
/** Shade a source image representing bounds; draw the borrowed result with drawImage/custom Canvas2D primitive. */
|
|
35
19
|
render(source: CanvasImageSource, options: NovaLightingRenderOptions2D): HTMLCanvasElement | undefined;
|
|
36
20
|
/** In-place pass for an axis-aligned Canvas2D camera. Other transforms use render. */
|
|
37
21
|
apply(context: CanvasRenderingContext2D, options: NovaLightingRenderOptions2D): boolean;
|
|
38
22
|
get state(): {
|
|
23
|
+
ownedCanvases: number;
|
|
24
|
+
receiverMasks: number;
|
|
39
25
|
available: boolean;
|
|
40
26
|
generation: number;
|
|
41
27
|
renders: number;
|
|
28
|
+
lightPrecision: "float16" | "unorm8";
|
|
42
29
|
textures: number;
|
|
43
30
|
programs: number;
|
|
44
31
|
shaders: number;
|
|
45
32
|
framebuffers: number;
|
|
46
|
-
receiverMasks: number;
|
|
47
|
-
ownedCanvases: number;
|
|
48
33
|
disposed: boolean;
|
|
49
34
|
revision: number;
|
|
50
35
|
lights: number;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { EventList } from '@endge/utils';
|
|
2
|
+
import { NovaApp } from '../runtime/app/NovaApp.js';
|
|
3
|
+
import { NovaLightingOptions2D, NovaLightingRenderOptions2D } from './lighting.types.js';
|
|
4
|
+
import { LightingFrame2D } from './LightingFields2D.js';
|
|
5
|
+
import { LightingScene2D } from './LightingScene2D.js';
|
|
6
|
+
/**
|
|
7
|
+
* An explicit scene-local effect for the owning app. Attach effect to a node,
|
|
8
|
+
* call update after descriptor changes, detach before dispose. No own device/RAF.
|
|
9
|
+
*/
|
|
10
|
+
export declare class NovaLightingEffect2D<E extends EventList = Record<string, never>> extends LightingScene2D {
|
|
11
|
+
private readonly _app;
|
|
12
|
+
private readonly _fields;
|
|
13
|
+
private readonly _geometryLow;
|
|
14
|
+
private readonly _geometryHigh;
|
|
15
|
+
private readonly _normal;
|
|
16
|
+
private readonly _response;
|
|
17
|
+
private readonly _bundle;
|
|
18
|
+
private _geometry;
|
|
19
|
+
private _geometryValid;
|
|
20
|
+
private _updates;
|
|
21
|
+
private _frameSource?;
|
|
22
|
+
private readonly _fieldEffect;
|
|
23
|
+
private readonly _lightTexture;
|
|
24
|
+
readonly effect: import('../render/effects/shader-effect.js').NovaShaderEffect<{
|
|
25
|
+
readonly illumination: "sampler2D";
|
|
26
|
+
}>;
|
|
27
|
+
constructor(_app: NovaApp<E>, options?: NovaLightingOptions2D);
|
|
28
|
+
/** @internal */
|
|
29
|
+
static bound<E extends EventList>(app: NovaApp<E>, options: NovaLightingOptions2D, frame: (options: NovaLightingRenderOptions2D) => LightingFrame2D): NovaLightingEffect2D<E>;
|
|
30
|
+
update(options: NovaLightingRenderOptions2D): void;
|
|
31
|
+
get state(): {
|
|
32
|
+
ownedCanvases: number;
|
|
33
|
+
receiverMasks: number;
|
|
34
|
+
backend: "app-effect";
|
|
35
|
+
lightBuffer: number[];
|
|
36
|
+
updates: number;
|
|
37
|
+
disposed: boolean;
|
|
38
|
+
revision: number;
|
|
39
|
+
lights: number;
|
|
40
|
+
occluders: number;
|
|
41
|
+
receivers: number;
|
|
42
|
+
ambient: readonly [number, number, number];
|
|
43
|
+
};
|
|
44
|
+
dispose(): void;
|
|
45
|
+
}
|
|
46
|
+
export declare function createLightingEffect2D<E extends EventList>(app: NovaApp<E>, options?: NovaLightingOptions2D): NovaLightingEffect2D<E>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Same lighting/occluder math; app backend owns source, effects and optional RTTs.
|
|
3
|
+
* No float data texture or raw WebGL handle crosses the public boundary.
|
|
4
|
+
*/
|
|
5
|
+
export declare const lightingFieldEffect2D: import('../render/effects/shader-effect.js').NovaShaderEffectDefinition<{
|
|
6
|
+
readonly heights: "sampler2D";
|
|
7
|
+
readonly normals: "sampler2D";
|
|
8
|
+
readonly lightMask: "sampler2D";
|
|
9
|
+
readonly geometryLow: "sampler2D";
|
|
10
|
+
readonly geometryHigh: "sampler2D";
|
|
11
|
+
readonly bounds: "vec4";
|
|
12
|
+
readonly ambient: "vec3";
|
|
13
|
+
readonly fieldSize: "vec2";
|
|
14
|
+
readonly groundScale: "float";
|
|
15
|
+
readonly maxHeight: "float";
|
|
16
|
+
readonly irradianceScale: "float";
|
|
17
|
+
readonly lightCount: "int";
|
|
18
|
+
readonly casterCount: "int";
|
|
19
|
+
readonly categoricalField: "int";
|
|
20
|
+
readonly surfaceField: "int";
|
|
21
|
+
}>;
|
|
22
|
+
export declare const lightingEffect2D: import('../render/effects/shader-effect.js').NovaShaderEffectDefinition<{
|
|
23
|
+
readonly illumination: "sampler2D";
|
|
24
|
+
}>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const lightingVertex2D = "#version 300 es\nprecision highp float;\nout vec2 uv;\nvoid main(){\n vec2 p=vec2(float((gl_VertexID<<1)&2),float(gl_VertexID&2));\n uv=vec2(p.x,1.-p.y);\n gl_Position=vec4(p*2.-1.,0.,1.);\n}";
|
|
2
|
-
export declare const lightingFragment2D = "#version 300 es\nprecision highp float;\nprecision highp int;\nin vec2 uv;\nout vec4 outColor;\nuniform sampler2D heights;\nuniform highp sampler2D geometry;\nuniform vec4 bounds;\nuniform vec3 ambient;\nuniform float groundScale, maxHeight;\nuniform int lightCount, casterCount, categoricalField;\nuniform vec4 positions[8], colors[8], directions[8], cones[8], shadows[8];\nfloat cross2(vec2 a,vec2 b){return a.x*b.y-a.y*b.x;}\nbool blocked(vec3 p,vec3 end,int layers,int ignored){\n vec3 d=end-p;\n for(int c=0;c<64;c++){\n if(c>=casterCount)break;\n if(c==ignored)continue;\n vec4 h=texelFetch(geometry,ivec2(0,c),0);\n if((int(h.z)&layers)==0)continue;\n vec4 bb=texelFetch(geometry,ivec2(9,c),0);\n if(any(lessThan(max(p.xy,end.xy),bb.xy))||any(greaterThan(min(p.xy,end.xy),bb.zw)))continue;\n float lo=.001, hi=.999;\n if(abs(d.z)<.00001){if(p.z<h.y||p.z>h.y+h.x)continue;}\n else{\n float a=(h.y-p.z)/d.z,b=(h.y+h.x-p.z)/d.z;\n lo=max(lo,min(a,b));hi=min(hi,max(a,b));\n }\n int n=int(h.w);\n for(int i=0;i<8;i++){\n if(i>=n||lo>hi)break;\n vec2 a=texelFetch(geometry,ivec2(i+1,c),0).xy;\n vec2 b=texelFetch(geometry,ivec2((i+1)%n+1,c),0).xy;\n float f=cross2(b-a,p.xy-a),g=cross2(b-a,d.xy);\n if(abs(g)<.00001){if(f<0.){hi=-1.;break;}}\n else if(g>0.)lo=max(lo,-f/g);\n else hi=min(hi,-f/g);\n }\n if(lo<hi)return true;\n }\n return false;\n}\nvoid main(){\n vec2 screen=bounds.xy+uv*bounds.zw;\n vec4 field=texture(heights,uv);\n ivec2 size=textureSize(heights,0);\n vec4 material=categoricalField>0?texelFetch(heights,clamp(ivec2(uv*vec2(size)),ivec2(0),size-1),0):field;\n if(material.b>(categoricalField>0?.99:.5)){outColor=vec4(vec3(
|
|
3
|
-
export declare const lightingComposite2D = "#version 300 es\nprecision highp float;\nin vec2 uv;\nout vec4 outColor;\nuniform sampler2D albedo, illumination;\nvec3 linearRGB(vec3 c){return mix(c/12.92,pow((c+.055)/1.055,vec3(2.4)),step(vec3(.04045),c));}\nvec3 srgb(vec3 c){return mix(c*12.92,1.055*pow(max(c,vec3(0.)),vec3(1./2.4))-.055,step(vec3(.0031308),c));}\nvoid main(){\n vec4 art=texture(albedo,uv);\n vec3 irradiance=texture(illumination,vec2(uv.x,1.-uv.y)).rgb*
|
|
2
|
+
export declare const lightingFragment2D = "#version 300 es\nprecision highp float;\nprecision highp int;\nin vec2 uv;\nout vec4 outColor;\nuniform sampler2D heights;\nuniform sampler2D normals, lightMask;\nuniform highp sampler2D geometry;\nuniform vec4 bounds;\nuniform vec3 ambient;\nuniform float groundScale, maxHeight, irradianceScale;\nuniform int lightCount, casterCount, categoricalField, surfaceField;\nuniform vec4 positions[8], colors[8], directions[8], cones[8], shadows[8];\nfloat cross2(vec2 a,vec2 b){return a.x*b.y-a.y*b.x;}\nbool blocked(vec3 p,vec3 end,int layers,int ignored){\n vec3 d=end-p;\n for(int c=0;c<64;c++){\n if(c>=casterCount)break;\n if(c==ignored)continue;\n vec4 h=texelFetch(geometry,ivec2(0,c),0);\n if((int(h.z)&layers)==0)continue;\n vec4 bb=texelFetch(geometry,ivec2(9,c),0);\n if(any(lessThan(max(p.xy,end.xy),bb.xy))||any(greaterThan(min(p.xy,end.xy),bb.zw)))continue;\n float lo=.001, hi=.999;\n if(abs(d.z)<.00001){if(p.z<h.y||p.z>h.y+h.x)continue;}\n else{\n float a=(h.y-p.z)/d.z,b=(h.y+h.x-p.z)/d.z;\n lo=max(lo,min(a,b));hi=min(hi,max(a,b));\n }\n int n=int(h.w);\n for(int i=0;i<8;i++){\n if(i>=n||lo>hi)break;\n vec2 a=texelFetch(geometry,ivec2(i+1,c),0).xy;\n vec2 b=texelFetch(geometry,ivec2((i+1)%n+1,c),0).xy;\n float f=cross2(b-a,p.xy-a),g=cross2(b-a,d.xy);\n if(abs(g)<.00001){if(f<0.){hi=-1.;break;}}\n else if(g>0.)lo=max(lo,-f/g);\n else hi=min(hi,-f/g);\n }\n if(lo<hi)return true;\n }\n return false;\n}\nvoid main(){\n vec2 screen=bounds.xy+uv*bounds.zw;\n vec4 field=texture(heights,uv);\n ivec2 size=textureSize(heights,0);\n vec4 material=categoricalField>0?texelFetch(heights,clamp(ivec2(uv*vec2(size)),ivec2(0),size-1),0):field;\n if(material.b>(categoricalField>0?.99:.5)){outColor=vec4(vec3(irradianceScale),1.);return;}\n float z=field.r*maxHeight;\n int receiverLayers=int(round(material.g*255.));\n int ignored=categoricalField>0?int(round(material.b*255.))-1:-1;\n vec3 p=vec3(screen.x,(screen.y+z)/groundScale,z);\n vec2 response=surfaceField>0?texture(lightMask,uv).rg:vec2(1.);\n vec3 normal=surfaceField>0?clamp((texture(normals,uv).rgb*255.-128.)/127.,-1.,1.):vec3(0.);\n bool hasNormal=length(normal)>.1;\n if(hasNormal)normal=normalize(normal);\n vec3 light=ambient*response.g;\n for(int i=0;i<8;i++){\n if(i>=lightCount)break;\n int layers=int(cones[i].z);\n if((layers&receiverLayers)==0)continue;\n bool directional=positions[i].w<.5;\n vec3 end=directional?p-directions[i].xyz*shadows[i].w:positions[i].xyz;\n float amount=colors[i].w;\n if(!directional){\n vec3 delta=p-end;\n float dist=length(delta);\n if(dist>=directions[i].w)continue;\n amount*=pow(max(0.,1.-dist/directions[i].w),cones[i].w);\n if(positions[i].w>1.5)amount*=smoothstep(cones[i].y,cones[i].x,dot(delta/max(dist,.00001),directions[i].xyz));\n }\n if(amount<.00001)continue;\n if(shadows[i].x>0.){\n float visibility=0.;\n float radius=shadows[i].y*(directional?shadows[i].w:1.);\n int samples=radius>0.?8:1;\n for(int s=0;s<8;s++){\n if(s>=samples)break;\n float angle=float(s)*2.39996323;\n vec2 disk=vec2(cos(angle),sin(angle))*sqrt((float(s)+.5)/8.);\n vec3 target=end+vec3(disk*radius,0.);\n visibility+=blocked(p,target,layers,ignored)?0.:1./float(samples);\n }\n amount*=mix(1.,visibility,shadows[i].x);\n }\n if(hasNormal){vec3 toLight=end-p;amount*=max(0.,dot(normal,toLight/max(length(toLight),.00001)));}\n light+=colors[i].rgb*amount*response.r;\n }\n // 1 maps EXACTLY to byte 64: the neutral baseline does not introduce a seam.\n outColor=vec4(max(light,vec3(0.))*irradianceScale,1.);\n}";
|
|
3
|
+
export declare const lightingComposite2D = "#version 300 es\nprecision highp float;\nin vec2 uv;\nout vec4 outColor;\nuniform sampler2D albedo, illumination;\nuniform float irradianceScale;\nvec3 linearRGB(vec3 c){return mix(c/12.92,pow((c+.055)/1.055,vec3(2.4)),step(vec3(.04045),c));}\nvec3 srgb(vec3 c){return mix(c*12.92,1.055*pow(max(c,vec3(0.)),vec3(1./2.4))-.055,step(vec3(.0031308),c));}\nvoid main(){\n vec4 art=texture(albedo,uv);\n vec3 irradiance=texture(illumination,vec2(uv.x,1.-uv.y)).rgb*irradianceScale;\n outColor=vec4(srgb(clamp(linearRGB(art.rgb)*irradiance,0.,1.)),art.a);\n}";
|
|
@@ -71,13 +71,17 @@ export interface NovaLightReceiverOptions2D {
|
|
|
71
71
|
ignoreOccluder?: NovaLightingHandle2D<NovaLightOccluderOptions2D>;
|
|
72
72
|
/** Borrowed alpha silhouette. The engine never closes this image. */
|
|
73
73
|
image: CanvasImageSource;
|
|
74
|
+
/** Borrowed RGB world-space normal map: XYZ, Z up; 128 is zero, 255 is +1. Same UV as image. */
|
|
75
|
+
normalMap?: CanvasImageSource;
|
|
76
|
+
/** Borrowed linear-data mask: R direct-light response, G ambient visibility (0..1). B is unused. Same UV as image. */
|
|
77
|
+
lightMask?: CanvasImageSource;
|
|
74
78
|
/** Projected image bounds; top-of-image height ramps down to its bottom. */
|
|
75
79
|
bounds: NovaLightingBounds2D;
|
|
76
80
|
height: number;
|
|
77
81
|
baseHeight?: number;
|
|
78
82
|
layers?: number;
|
|
79
83
|
enabled?: boolean;
|
|
80
|
-
/** Increment after modifying
|
|
84
|
+
/** Increment after modifying image alpha, normalMap or lightMask in place. */
|
|
81
85
|
imageRevision?: number;
|
|
82
86
|
/** Back-to-front receiver order; defaults to projected bounds bottom. Higher is in front. */
|
|
83
87
|
order?: number;
|
|
@@ -4,6 +4,7 @@ export declare class NovaWebGLCompositionPass {
|
|
|
4
4
|
private readonly _gl;
|
|
5
5
|
private readonly _program;
|
|
6
6
|
constructor(_gl: WebGL2RenderingContext);
|
|
7
|
-
|
|
7
|
+
/** Internal role: primary defaults to image isolation; additional is always image isolation. */
|
|
8
|
+
draw(color: WebGLTexture, backdrop: WebGLTexture, bounds: NovaBounds, width: number, height: number, opacity: number, mode: NovaBlendMode, mask?: WebGLTexture, additionalMask?: WebGLTexture, maskIsClip?: boolean): void;
|
|
8
9
|
destroy(): void;
|
|
9
10
|
}
|
|
@@ -18,6 +18,9 @@ export declare class NovaWebGLFrameRenderer {
|
|
|
18
18
|
private readonly _solidProgram;
|
|
19
19
|
private _dashedSolidProgram?;
|
|
20
20
|
private readonly _autoRectProgram;
|
|
21
|
+
private _anchorAutoRectProgram?;
|
|
22
|
+
private _anchorPrecisionSupported?;
|
|
23
|
+
private _anchorBytes;
|
|
21
24
|
private readonly _textureProgram;
|
|
22
25
|
private _circleImagePass?;
|
|
23
26
|
private _distanceFieldTextProgram?;
|
|
@@ -51,6 +54,7 @@ export declare class NovaWebGLFrameRenderer {
|
|
|
51
54
|
private readonly _textRasterCanvas;
|
|
52
55
|
private _deviceTextRasterCanvas?;
|
|
53
56
|
private _deviceTextRasterCanvasContext;
|
|
57
|
+
private _deviceTextViewportDirty?;
|
|
54
58
|
private readonly _textures;
|
|
55
59
|
private readonly _renderTargets;
|
|
56
60
|
private readonly _textAtlasPages;
|
|
@@ -61,6 +65,7 @@ export declare class NovaWebGLFrameRenderer {
|
|
|
61
65
|
private _textAtlasCellSize?;
|
|
62
66
|
private _deviceTextGeneration;
|
|
63
67
|
private readonly _deviceTextFrameSlots;
|
|
68
|
+
private _hasAffineNativeText;
|
|
64
69
|
private _deviceTextDirection?;
|
|
65
70
|
private _textViewport?;
|
|
66
71
|
private readonly _glyphAtlasPages;
|
|
@@ -162,6 +167,7 @@ export declare class NovaWebGLFrameRenderer {
|
|
|
162
167
|
private _glyphAtlasEvictionCount;
|
|
163
168
|
private readonly _textRasterBucketStateByScope;
|
|
164
169
|
private readonly _textRunShapeCache;
|
|
170
|
+
private readonly _nativeTextWidths;
|
|
165
171
|
private _glyphTextBatchCache;
|
|
166
172
|
private _maxAutoRectBatchSize;
|
|
167
173
|
/**
|
|
@@ -252,6 +258,15 @@ export declare class NovaWebGLFrameRenderer {
|
|
|
252
258
|
private _commitLinearRectLane;
|
|
253
259
|
/** Отбрасывает только lease; переписанная spare lane остаётся переиспользуемой. */
|
|
254
260
|
private _abortLinearRectLane;
|
|
261
|
+
/**
|
|
262
|
+
* Updates only a strictly ordered compact solid plan under its compiler lease.
|
|
263
|
+
* The first activation rebuilds canonical data; only committed factor residency is reused.
|
|
264
|
+
*/
|
|
265
|
+
private _prepareAutoRectAnchor;
|
|
266
|
+
/** Known full-float vertex highp only; missing/throwing/other capabilities use canonical replay. */
|
|
267
|
+
private _supportsAutoRectAnchorPrecision;
|
|
268
|
+
/** Subnormal, overflow and nonfinite intermediates do not enter the factor shader. */
|
|
269
|
+
private _anchorFloatSupported;
|
|
255
270
|
/**
|
|
256
271
|
* Обновляет resident instance slots после compiler-reported handle changes.
|
|
257
272
|
*/
|
|
@@ -537,6 +552,9 @@ export declare class NovaWebGLFrameRenderer {
|
|
|
537
552
|
private _resolvedDeviceTextDirection;
|
|
538
553
|
private _resolveDeviceTextMap;
|
|
539
554
|
private _setDeviceTextStreamOrigin;
|
|
555
|
+
/** A bounded root plane may not cut any part of the existing baked clip. */
|
|
556
|
+
private _deviceTextViewportRaster;
|
|
557
|
+
private _deviceTextRasterSignature;
|
|
540
558
|
/** One current phase per existing run key; integer device translations reuse texels. */
|
|
541
559
|
private _resolveDeviceText;
|
|
542
560
|
/** Reuses resident same-content ink in LOCAL coordinates; baked affine clips cannot expand. */
|
|
@@ -737,6 +755,8 @@ export declare class NovaWebGLFrameRenderer {
|
|
|
737
755
|
* Рисует retained text batch через retained text atlas.
|
|
738
756
|
*/
|
|
739
757
|
private _drawTextBatch;
|
|
758
|
+
/** Returns true only when affine history requires the existing primitive fallback. */
|
|
759
|
+
private _drawRunTextBatch;
|
|
740
760
|
/**
|
|
741
761
|
* Выбирает text path для retained batch без полного прохода по всем строкам.
|
|
742
762
|
*/
|
|
@@ -859,8 +879,8 @@ export declare class NovaWebGLFrameRenderer {
|
|
|
859
879
|
*/
|
|
860
880
|
private _createTextStreamBatchCacheFromLayout;
|
|
861
881
|
/**
|
|
862
|
-
*
|
|
863
|
-
*
|
|
882
|
+
* Согласует текущие groups с раскладкой без замены живых buffers/VAO.
|
|
883
|
+
* Новые lanes создаются по необходимости, исчезнувшие освобождаются сразу.
|
|
864
884
|
*/
|
|
865
885
|
private _rewriteTextStreamBatchCache;
|
|
866
886
|
/**
|
|
@@ -1178,6 +1198,8 @@ export declare class NovaWebGLFrameRenderer {
|
|
|
1178
1198
|
* Выполняет внутреннюю операцию upload array buffer.
|
|
1179
1199
|
*/
|
|
1180
1200
|
private _uploadArrayBuffer;
|
|
1201
|
+
/** Reuses the same sorted dirty slots for the auxiliary vec2 stream. */
|
|
1202
|
+
private _uploadAutoRectAnchors;
|
|
1181
1203
|
/**
|
|
1182
1204
|
* Загружает sorted dirty slots auto rect batch без временных ranges и subarray views.
|
|
1183
1205
|
* Соседние transform-only slots используют один непрерывный AoS span; неизменные
|
|
@@ -1344,6 +1366,8 @@ export declare class NovaWebGLFrameRenderer {
|
|
|
1344
1366
|
* Создает text key без raster scale для fallback между buckets.
|
|
1345
1367
|
*/
|
|
1346
1368
|
private _createTextBaseKey;
|
|
1369
|
+
/** An untruncated left-aligned native run has the same ink at every wider box. */
|
|
1370
|
+
private _nativeTextFits;
|
|
1347
1371
|
/**
|
|
1348
1372
|
* Вычисляет source key.
|
|
1349
1373
|
*/
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** Internal path/image masking; no stencil attachment or per-primitive shader changes. */
|
|
2
2
|
export declare class NovaWebGLPathClipPass {
|
|
3
3
|
private readonly _gl;
|
|
4
4
|
private readonly _program;
|
|
5
5
|
constructor(_gl: WebGL2RenderingContext);
|
|
6
|
+
/** Internal role: primary defaults to final clip; additional is always image isolation. */
|
|
6
7
|
draw(color: WebGLTexture, mask: WebGLTexture, bounds: {
|
|
7
8
|
x: number;
|
|
8
9
|
y: number;
|
|
9
10
|
width: number;
|
|
10
11
|
height: number;
|
|
11
|
-
}, width: number, height: number, backdrop?: WebGLTexture, opacity?: number, additionalMask?: WebGLTexture): void;
|
|
12
|
+
}, width: number, height: number, backdrop?: WebGLTexture, opacity?: number, additionalMask?: WebGLTexture, maskIsClip?: boolean): void;
|
|
12
13
|
destroy(): void;
|
|
13
14
|
}
|
|
@@ -29,5 +29,5 @@ export declare class NovaWebGLProgram {
|
|
|
29
29
|
/**
|
|
30
30
|
* Выполняет внутреннюю операцию create.
|
|
31
31
|
*/
|
|
32
|
-
static create(gl: WebGL2RenderingContext, vertexSource: string, fragmentSource: string): NovaWebGLProgram;
|
|
32
|
+
static create(gl: WebGL2RenderingContext, vertexSource: string, fragmentSource: string, attributeLocations?: Readonly<Record<string, number>>): NovaWebGLProgram;
|
|
33
33
|
}
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import { NovaRenderFrame, NovaRenderItemId } from '../../../domain/types/rendering/index.js';
|
|
2
|
+
/** One backend participant in the existing compiler-owned prepare transaction. @internal */
|
|
3
|
+
export interface NovaPreparedBackendLease {
|
|
4
|
+
readonly frame: NovaRenderFrame;
|
|
5
|
+
readonly autoRectTranslationAllowed: boolean;
|
|
6
|
+
bindBackend: (commit: () => void, abort: () => void) => boolean;
|
|
7
|
+
}
|
|
8
|
+
/** Attaches the already allocated compiler transaction; no independent registry. @internal */
|
|
9
|
+
export declare function attachNovaPreparedBackendLease(frame: NovaRenderFrame, lease: NovaPreparedBackendLease): void;
|
|
10
|
+
/** Bare or already settled frames cannot enter a transactional backend path. @internal */
|
|
11
|
+
export declare function getNovaPreparedBackendLease(frame: NovaRenderFrame): NovaPreparedBackendLease | undefined;
|
|
12
|
+
/** Clears only the transaction that owns this frame metadata. @internal */
|
|
13
|
+
export declare function clearNovaPreparedBackendLease(frame: NovaRenderFrame, lease: NovaPreparedBackendLease): void;
|
|
2
14
|
export type NovaRenderDirtyItemProvenance = 'none' | 'transform' | 'unknown' | 'mixed';
|
|
3
15
|
/**
|
|
4
16
|
* Накапливает точные retained item ids до успешного backend replay.
|
|
@@ -22,6 +22,8 @@ export declare class NovaCursorManager<E extends EventList = Record<string, any>
|
|
|
22
22
|
private _spatialFullDirty;
|
|
23
23
|
private _overlaySurface;
|
|
24
24
|
private _activeComponentKey;
|
|
25
|
+
private _activeHotspotX;
|
|
26
|
+
private _activeHotspotY;
|
|
25
27
|
private _lastCursorKey;
|
|
26
28
|
private _lastDomCursor;
|
|
27
29
|
private _lastSource;
|
|
@@ -46,6 +48,11 @@ export declare class NovaCursorManager<E extends EventList = Record<string, any>
|
|
|
46
48
|
* Синхронизирует cursor с текущим pointer state.
|
|
47
49
|
*/
|
|
48
50
|
syncPointer(input: NovaCursorPointerSync<E>): void;
|
|
51
|
+
/**
|
|
52
|
+
* Перемещает уже активный component cursor без hit-test и смены его состояния.
|
|
53
|
+
* Hover, recipe, pressed и dragging обновляются обычной синхронизацией pointer.
|
|
54
|
+
*/
|
|
55
|
+
updatePointerPosition(x: number, y: number): void;
|
|
49
56
|
/**
|
|
50
57
|
* Сбрасывает cursor в default.
|
|
51
58
|
*/
|