melonjs 20.1.0 → 20.2.0
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 +2 -2
- package/build/application/settings.d.ts +3 -2
- package/build/application/settings.d.ts.map +1 -1
- package/build/index.js +1399 -229
- package/build/index.js.map +4 -4
- package/build/input/pointerevent.d.ts.map +1 -1
- package/build/level/gltf/GLTFModel.d.ts +17 -1
- package/build/level/gltf/GLTFModel.d.ts.map +1 -1
- package/build/loader/parsers/fontface.d.ts.map +1 -1
- package/build/particles/emitter.d.ts +81 -3
- package/build/particles/emitter.d.ts.map +1 -1
- package/build/particles/particle.d.ts +62 -1
- package/build/particles/particle.d.ts.map +1 -1
- package/build/particles/settings.d.ts +50 -7
- package/build/particles/settings.d.ts.map +1 -1
- package/build/physics/builtin/builtin-adapter.d.ts.map +1 -1
- package/build/physics/builtin/detector.d.ts.map +1 -1
- package/build/renderable/container.d.ts +10 -0
- package/build/renderable/container.d.ts.map +1 -1
- package/build/renderable/entity/entity.d.ts +10 -0
- package/build/renderable/entity/entity.d.ts.map +1 -1
- package/build/renderable/frameAnimation.d.ts +20 -2
- package/build/renderable/frameAnimation.d.ts.map +1 -1
- package/build/renderable/renderable.d.ts +106 -22
- package/build/renderable/renderable.d.ts.map +1 -1
- package/build/system/timer.d.ts.map +1 -1
- package/build/video/blendmodes.d.ts +107 -0
- package/build/video/blendmodes.d.ts.map +1 -0
- package/build/video/canvas/canvas_renderer.d.ts +28 -24
- package/build/video/canvas/canvas_renderer.d.ts.map +1 -1
- package/build/video/effects/blendEffect.d.ts +57 -0
- package/build/video/effects/blendEffect.d.ts.map +1 -0
- package/build/video/renderer.d.ts +3 -4
- package/build/video/renderer.d.ts.map +1 -1
- package/build/video/rendertarget/canvasrendertarget.d.ts +1 -0
- package/build/video/rendertarget/canvasrendertarget.d.ts.map +1 -1
- package/build/video/webgl/batchers/batcher.d.ts.map +1 -1
- package/build/video/webgl/glshader.d.ts.map +1 -1
- package/build/video/webgl/utils/program.d.ts.map +1 -1
- package/build/video/webgl/webgl_renderer.d.ts +116 -29
- package/build/video/webgl/webgl_renderer.d.ts.map +1 -1
- package/build/video/webgpu/batchers/quad_batcher.d.ts +7 -0
- package/build/video/webgpu/batchers/quad_batcher.d.ts.map +1 -1
- package/build/video/webgpu/pipeline/cache.d.ts +0 -9
- package/build/video/webgpu/pipeline/cache.d.ts.map +1 -1
- package/build/video/webgpu/webgpu_renderer.d.ts +100 -6
- package/build/video/webgpu/webgpu_renderer.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* additional import for TypeScript
|
|
3
|
-
* @import {Matrix3d} from "../math/matrix3d.ts";
|
|
4
|
-
* @import Entity from "./entity/entity.js";
|
|
5
|
-
* @import Container from "./container.js";
|
|
6
|
-
* @import {Line} from "./../geometries/line.ts";
|
|
7
|
-
* @import {Ellipse} from "./../geometries/ellipse.ts";
|
|
8
|
-
* @import {Polygon} from "../geometries/polygon.ts";
|
|
9
|
-
* @import {RoundRect} from "./../geometries/roundrect.ts";
|
|
10
|
-
* @import Application from "./../application/application.ts";
|
|
11
|
-
* @import CanvasRenderer from "./../video/canvas/canvas_renderer.js";
|
|
12
|
-
* @import WebGLRenderer from "./../video/webgl/webgl_renderer.js";
|
|
13
|
-
* @import ResponseObject from "./../physics/response.js";
|
|
14
|
-
**/
|
|
15
1
|
/**
|
|
16
2
|
* A base class for renderable objects.
|
|
17
3
|
* @category Game Objects
|
|
@@ -261,7 +247,9 @@ export default class Renderable extends Rect {
|
|
|
261
247
|
*/
|
|
262
248
|
_postEffectManaged: boolean;
|
|
263
249
|
/**
|
|
264
|
-
* the blend mode to be applied to this renderable
|
|
250
|
+
* the blend mode to be applied to this renderable — any of the modes
|
|
251
|
+
* listed on {@link CanvasRenderer#setBlendMode}, honoured identically by
|
|
252
|
+
* every renderer
|
|
265
253
|
* @type {string}
|
|
266
254
|
* @default "normal"
|
|
267
255
|
* @see CanvasRenderer#setBlendMode
|
|
@@ -503,15 +491,111 @@ export default class Renderable extends Rect {
|
|
|
503
491
|
*/
|
|
504
492
|
updateBounds(absolute?: boolean): Bounds;
|
|
505
493
|
/**
|
|
506
|
-
*
|
|
507
|
-
*
|
|
508
|
-
*
|
|
509
|
-
*
|
|
510
|
-
*
|
|
511
|
-
*
|
|
512
|
-
*
|
|
494
|
+
* Where this renderable IS in the game world — its own `pos` plus every
|
|
495
|
+
* ancestor's, as a {@link Vector3d} so the z component is summed across
|
|
496
|
+
* the chain too (important for {@link Camera3d}'s frustum culling, which
|
|
497
|
+
* previously read `obj.depth` — local `pos.z` — and mis-culled children
|
|
498
|
+
* nested under a container with its own non-zero depth).
|
|
499
|
+
*
|
|
500
|
+
* **Reach for this** for anything positional: culling, distance checks,
|
|
501
|
+
* hit tests, placing one renderable relative to another. It is cheap, and
|
|
502
|
+
* it is what the engine's own culling uses.
|
|
503
|
+
*
|
|
504
|
+
* **Reach for {@link Renderable#getWorldTransform} instead** when a
|
|
505
|
+
* position is not enough — when rotation, scale or flip along the ancestor
|
|
506
|
+
* chain matters, or when you need to map an arbitrary point rather than
|
|
507
|
+
* just the origin. This method sums translations only, so under a rotated
|
|
508
|
+
* or scaled ancestor it reports where the renderable's *pivot* is and
|
|
509
|
+
* nothing about how its content is oriented.
|
|
510
|
+
*
|
|
511
|
+
* Note the two also frame the question differently. This one is "where am
|
|
512
|
+
* I"; `getWorldTransform()` is "what space is my content drawn in". For a
|
|
513
|
+
* {@link Container} those coincide, because a container offsets its
|
|
514
|
+
* children by its own position. For a leaf they differ by exactly that
|
|
515
|
+
* position, which a leaf applies inside its own `draw()`.
|
|
516
|
+
*
|
|
517
|
+
* The returned vector is pooled and reused — copy it if you need to hold
|
|
518
|
+
* onto the value across another call.
|
|
519
|
+
* @returns {Vector3d} this renderable's absolute position
|
|
520
|
+
* @see Renderable#getWorldTransform
|
|
513
521
|
*/
|
|
514
522
|
getAbsolutePosition(): Vector3d;
|
|
523
|
+
/**
|
|
524
|
+
* The transform this renderable interposes between its ancestor's frame
|
|
525
|
+
* and the frame its own content is drawn in — a mirror of what
|
|
526
|
+
* {@link Renderable#preDraw} applies to the renderer, as a matrix.
|
|
527
|
+
*
|
|
528
|
+
* **This is not {@link Renderable#currentTransform}.** A renderable's
|
|
529
|
+
* placement is split across two members: `pos` holds where it is, and
|
|
530
|
+
* `currentTransform` holds only what `rotate()` / `scale()` / `translate()`
|
|
531
|
+
* accumulate — it never contains the position. `preDraw` composes the two
|
|
532
|
+
* by conjugation, so a rotation pivots about the renderable's position
|
|
533
|
+
* rather than the origin. On a renderable you never rotated,
|
|
534
|
+
* `currentTransform` is therefore the *identity* and says nothing about
|
|
535
|
+
* where its content lands, while this method returns the translation that
|
|
536
|
+
* actually places it.
|
|
537
|
+
*
|
|
538
|
+
* {@link Container} extends this with the offset it applies to its
|
|
539
|
+
* children, which a leaf renderable does not have: a leaf's own `draw()`
|
|
540
|
+
* places itself from `pos`.
|
|
541
|
+
* @protected
|
|
542
|
+
* @param {Matrix3d} out - matrix to write into; nothing is stored on the
|
|
543
|
+
* renderable itself, so callers own the lifetime
|
|
544
|
+
* @returns {Matrix3d} `out`, for chaining
|
|
545
|
+
* @see Renderable#getWorldTransform
|
|
546
|
+
*/
|
|
547
|
+
protected getLocalTransform(out: Matrix3d): Matrix3d;
|
|
548
|
+
/**
|
|
549
|
+
* The space this renderable's content is drawn IN, as a matrix — the full
|
|
550
|
+
* form of {@link Renderable#getAbsolutePosition}, which sums positions up
|
|
551
|
+
* the ancestor chain and therefore cannot represent the rotation, scale or
|
|
552
|
+
* flip accumulated along the way.
|
|
553
|
+
*
|
|
554
|
+
* **Reach for `getAbsolutePosition()` instead** for ordinary positional
|
|
555
|
+
* work — culling, distance checks, hit tests. It is cheaper and it is what
|
|
556
|
+
* the engine culls with. **Use this** when a position is not enough:
|
|
557
|
+
*
|
|
558
|
+
* - an ancestor is rotated or scaled, so a translation cannot describe the
|
|
559
|
+
* result
|
|
560
|
+
* - you need to map an arbitrary point, not just the origin — a corner, a
|
|
561
|
+
* click position, one renderable's coordinates into another's space
|
|
562
|
+
* - you need to compose or invert the transform (`inv(A) · B` converts
|
|
563
|
+
* between two frames, which is how `ParticleEmitter.referenceSpace`
|
|
564
|
+
* measures particles against a container that is not their parent)
|
|
565
|
+
*
|
|
566
|
+
* The two also frame the question differently, and it shows on a leaf.
|
|
567
|
+
* `getAbsolutePosition()` is "where am I"; this is "what space is my
|
|
568
|
+
* content drawn in". For a {@link Container} those coincide, because a
|
|
569
|
+
* container offsets its children by its own position. For a leaf they
|
|
570
|
+
* differ by exactly that position, which a leaf applies inside its own
|
|
571
|
+
* `draw()`. So with no rotation, scale or flip anywhere, a container's
|
|
572
|
+
* translation column equals its `getAbsolutePosition()` while a leaf's
|
|
573
|
+
* equals its PARENT's.
|
|
574
|
+
*
|
|
575
|
+
* The walk stops at a `floating` ancestor, because a floating renderable
|
|
576
|
+
* draws in screen space: {@link Container#draw} resets the transform
|
|
577
|
+
* outright for those, so the chain genuinely ends there rather than
|
|
578
|
+
* continuing to the root.
|
|
579
|
+
*
|
|
580
|
+
* The camera needs no special handling — {@link Camera2d} folds its view
|
|
581
|
+
* transform into the root container's `currentTransform`, so it is picked
|
|
582
|
+
* up like any other level.
|
|
583
|
+
* @param {Matrix3d} out - matrix to write into; nothing is stored on the
|
|
584
|
+
* renderable itself, so callers own the lifetime
|
|
585
|
+
* @returns {Matrix3d} `out`, for chaining
|
|
586
|
+
* @see Renderable#getAbsolutePosition
|
|
587
|
+
* @example
|
|
588
|
+
* // map a point from one renderable's space into another's
|
|
589
|
+
* const from = a.getWorldTransform(new Matrix3d());
|
|
590
|
+
* const into = b.getWorldTransform(new Matrix3d()).invert();
|
|
591
|
+
* const point = new Vector2d(10, 20); // in a's space
|
|
592
|
+
* from.apply(point); // -> world
|
|
593
|
+
* into.apply(point); // -> b's space
|
|
594
|
+
* @example
|
|
595
|
+
* // just need to know where something is? use the cheaper call
|
|
596
|
+
* const where = renderable.getAbsolutePosition();
|
|
597
|
+
*/
|
|
598
|
+
getWorldTransform(out: Matrix3d): Matrix3d;
|
|
515
599
|
/**
|
|
516
600
|
* Prepare the rendering context before drawing (automatically called by melonJS).
|
|
517
601
|
* This will apply any defined transforms, anchor point, tint or blend mode and translate the context accordingly to this renderable position.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderable.d.ts","sourceRoot":"","sources":["../../src/renderable/renderable.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"renderable.d.ts","sourceRoot":"","sources":["../../src/renderable/renderable.js"],"names":[],"mappings":"AAyCA;;;GAGG;AACH;IAkBG,iBAAmB;IAGpB;;;;;;;;;;;;;;;OAeG;IACH,aAHU,eAAe,CAMvB;IAGD;;;;;;;OAOG;IACH,kBAFU,QAAQ,CAEoB;IAIvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwCG;IACH,MAlCU,WAAW,CAkCA;IAErB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,SAHU,MAAM,GAAC,SAAS,CAGF;IAExB;;;;;OAKG;IACH,MAFU,MAAM,CAEK;IAErB;;;;;;;;;;OAUG;IACH,6BAAmC;IAEnC;;;;OAIG;IACH,cAHU,OAAO,CAGQ;IAEzB;;;;OAIG;IACH,kBAHU,OAAO,CAGY;IAE7B;;;;OAIG;IACH,cAHU,OAAO,CAGQ;IAEzB;;;;;OAKG;IACH,UAHU,OAAO,CAGI;IAErB;;;;;;;OAOG;IACH,qBAHU,OAAO,CAGe;IAEhC;;;;;;;;;;;;;;;;OAgBG;IACH,eAdU,OAAO,CAcQ;IAEzB;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,sBAJU,OAAO,CAIe;IAEhC;;;;;;;OAOG;IACH,OAHU,MAAM,CAGA;IAEhB;;;;OAIG;IACH,UAHU,SAAS,GAAC,MAAM,CAGD;IAEzB;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAlB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E,KAAK,GAAG,CAAC;QAC5B,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,OAAO,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,OAAO,CAAC;QACnB,IAAI,EAAE,GAAG,EAAE,CAAC;KACZ,EAAE,CAAC;IACJ,OAAO,EAAE,MAAM,CAAC;;IAsEhB;;;OAGG;IACH,KAAK;IAWL;;;;;;;;;;;;OAYG;IACH,UAAU,CACT,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAC3B,KAAK,EAAE,MAAM,EACb,SAAS,CAAC,EAAE,OAAO,EACnB,GAAG,IAAI,EAAE,GAAG,EAAE;IAcf;;;;;;;;;;;;OAYG;IACH,WAAW,CACV,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAC3B,KAAK,EAAE,MAAM,EACb,SAAS,CAAC,EAAE,OAAO,EACnB,GAAG,IAAI,EAAE,GAAG,EAAE;IAcf;;;OAGG;IACH,YAAY,CAAC,SAAS,EAAE,MAAM;IAQ9B;;;OAGG;IACH,aAAa,CAAC,UAAU,EAAE,MAAM;IAQhC;;;;OAIG;IACH,OAAO;IAIP;;;OAGG;IACH,QAAQ;IAIR;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM;IAgCnB;;;OAGG;IACH,UAAU,CAAC,OAAO,EAAE,MAAM;IAS1B;;;OAGG;IACH,YAAY;CA8BZ;AAED,QAAA,MAAM,KAAK,OAAc,CAAC;AAE1B;;;;;;;;;;;;GAYG;AACH,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a blend mode needs the shader path rather than fixed-function state.
|
|
3
|
+
* @param {string} mode - the blend mode to test
|
|
4
|
+
* @returns {boolean} true when the mode needs the shader path
|
|
5
|
+
* @ignore
|
|
6
|
+
*/
|
|
7
|
+
export function isAdvancedBlendMode(mode: string): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* The `uBlendMode` uniform value for an advanced blend mode.
|
|
10
|
+
* @param {string} mode - the blend mode
|
|
11
|
+
* @returns {number} the shader's mode index, or -1 when not an advanced mode
|
|
12
|
+
* @ignore
|
|
13
|
+
*/
|
|
14
|
+
export function advancedBlendModeIndex(mode: string): number;
|
|
15
|
+
/**
|
|
16
|
+
* Normalize a user-facing blend-mode string to its canonical token: `add` and
|
|
17
|
+
* `lighter` are spellings of `additive`, and anything unrecognized collapses
|
|
18
|
+
* to `normal`.
|
|
19
|
+
*
|
|
20
|
+
* The six advanced modes normalize to `"normal"` on purpose — that is their
|
|
21
|
+
* PIPELINE state, since the geometry really does rasterize under ordinary
|
|
22
|
+
* source-over before the shader composites it. Use {@link isAdvancedBlendMode}
|
|
23
|
+
* to ask the other question, and {@link reportedBlendMode} for what
|
|
24
|
+
* `setBlendMode` should tell the caller.
|
|
25
|
+
* @param {string} mode - blend mode as set through `setBlendMode`
|
|
26
|
+
* @returns {string} the canonical token
|
|
27
|
+
* @ignore
|
|
28
|
+
*/
|
|
29
|
+
export function normalizeBlendMode(mode: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the engine can honour this blend mode at all, by either route.
|
|
32
|
+
* @param {string} mode - the blend mode to test
|
|
33
|
+
* @returns {boolean} false only for a mode no backend implements
|
|
34
|
+
* @ignore
|
|
35
|
+
*/
|
|
36
|
+
export function isSupportedBlendMode(mode: string): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* What `setBlendMode` reports back as applied.
|
|
39
|
+
*
|
|
40
|
+
* The return value is a capability probe: callers compare it against their
|
|
41
|
+
* request, and a mismatch means the renderer could not honour the mode. So a
|
|
42
|
+
* mode that WAS honoured must report itself verbatim — including an alias
|
|
43
|
+
* like `add`, which shares a pipeline with `additive` but must not come back
|
|
44
|
+
* under that name — while anything unimplemented reports `"normal"`.
|
|
45
|
+
* @param {string} mode - the requested blend mode
|
|
46
|
+
* @returns {string} the mode actually applied
|
|
47
|
+
* @ignore
|
|
48
|
+
*/
|
|
49
|
+
export function reportedBlendMode(mode: string): string;
|
|
50
|
+
/**
|
|
51
|
+
* The blend state for a mode, in WebGPU's vocabulary — the neutral form each
|
|
52
|
+
* backend translates from.
|
|
53
|
+
*
|
|
54
|
+
* `srcFactor` depends on whether sources carry premultiplied alpha: a
|
|
55
|
+
* premultiplied source has already been scaled, so it takes `one` where a
|
|
56
|
+
* straight one takes `src-alpha`.
|
|
57
|
+
*
|
|
58
|
+
* Every mode here is EXACT for a translucent source as well as an opaque one
|
|
59
|
+
* — `multiply`, `screen` and `exclusion` were long commented as
|
|
60
|
+
* "approximate", but the algebra works out and measurement agrees. The two
|
|
61
|
+
* that genuinely could not be expressed this way, `darken` and `lighten`,
|
|
62
|
+
* moved to the shader path instead of staying approximate.
|
|
63
|
+
* @param {string} mode - a canonical mode from {@link normalizeBlendMode}
|
|
64
|
+
* @param {boolean} premultipliedAlpha - whether sources are premultiplied
|
|
65
|
+
* @returns {{operation: string, srcFactor: string, dstFactor: string}|undefined} the
|
|
66
|
+
* blend state, or `undefined` for `"none"`, which means replace (no blending)
|
|
67
|
+
* @ignore
|
|
68
|
+
*/
|
|
69
|
+
export function blendStateFor(mode: string, premultipliedAlpha: boolean): {
|
|
70
|
+
operation: string;
|
|
71
|
+
srcFactor: string;
|
|
72
|
+
dstFactor: string;
|
|
73
|
+
} | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* The engine's blend-mode registry — one definition of every mode, shared by
|
|
76
|
+
* all three renderers.
|
|
77
|
+
*
|
|
78
|
+
* Blending is described here in **backend-neutral** terms and translated by
|
|
79
|
+
* each backend: WebGPU consumes these tokens directly (they are its own
|
|
80
|
+
* vocabulary), WebGL maps them onto `gl.*` enums, and Canvas ignores them
|
|
81
|
+
* entirely in favour of `globalCompositeOperation`.
|
|
82
|
+
*
|
|
83
|
+
* Keeping the table in one place is not tidiness. The two GPU backends
|
|
84
|
+
* previously each carried their own copy — a `switch` of `blendEquation` /
|
|
85
|
+
* `blendFunc` calls on one side and a `GPUBlendState` table on the other —
|
|
86
|
+
* which meant a mode added, removed or corrected on one backend could
|
|
87
|
+
* silently disagree with the other, and `video.AUTO` would then render the
|
|
88
|
+
* same scene differently depending on which backend it happened to pick.
|
|
89
|
+
*/
|
|
90
|
+
/**
|
|
91
|
+
* The CSS blend modes that cannot be expressed as `src * sfactor + dst * dfactor`.
|
|
92
|
+
*
|
|
93
|
+
* Fixed-function blending computes one multiply-add per channel, which covers
|
|
94
|
+
* `multiply`, `screen`, `additive` and `exclusion` — exactly, translucent
|
|
95
|
+
* sources included. The modes below cannot be reached that way: most need a
|
|
96
|
+
* per-pixel branch, a division or a `sqrt` on the DESTINATION, and `darken` /
|
|
97
|
+
* `lighten` need a term the `min` / `max` operations leave no room for.
|
|
98
|
+
* Neither GPU backend can read the destination in a fragment shader, so all of
|
|
99
|
+
* them are implemented by capturing the destination to a texture and
|
|
100
|
+
* compositing in `BlendEffect`.
|
|
101
|
+
*
|
|
102
|
+
* The array ORDER is the wire format: the index is the `uBlendMode` uniform
|
|
103
|
+
* value the shader branches on, so reordering it silently remaps every mode.
|
|
104
|
+
* @ignore
|
|
105
|
+
*/
|
|
106
|
+
export const ADVANCED_BLEND_MODES: string[];
|
|
107
|
+
//# sourceMappingURL=blendmodes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blendmodes.d.ts","sourceRoot":"","sources":["../../src/video/blendmodes.js"],"names":[],"mappings":"AAkDA;;;;;GAKG;AACH,0CAJW,MAAM,GACJ,OAAO,CAKnB;AAED;;;;;GAKG;AACH,6CAJW,MAAM,GACJ,MAAM,CAKlB;AAED;;;;;;;;;;;;;GAaG;AACH,yCAJW,MAAM,GACJ,MAAM,CAkBlB;AAED;;;;;GAKG;AACH,2CAJW,MAAM,GACJ,OAAO,CASnB;AAED;;;;;;;;;;;GAWG;AACH,wCAJW,MAAM,GACJ,MAAM,CAKlB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,oCANW,MAAM,sBACN,OAAO,GACL;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAC,GAAC,SAAS,CAwC/E;AA1LD;;;;;;;;;;;;;;;GAeG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,4CAeE"}
|
|
@@ -27,7 +27,7 @@ export default class CanvasRenderer extends Renderer {
|
|
|
27
27
|
setProjection(matrix: Matrix3d): void;
|
|
28
28
|
/**
|
|
29
29
|
* set the current blend mode for this renderer. <br>
|
|
30
|
-
*
|
|
30
|
+
* Every renderer supports the full set: <br>
|
|
31
31
|
* - "normal" : draws new content on top of the existing content <br>
|
|
32
32
|
* <img src="../images/normal-blendmode.png" width="180"/> <br>
|
|
33
33
|
* - "add", "additive", or "lighter" : color values are added together <br>
|
|
@@ -36,26 +36,30 @@ export default class CanvasRenderer extends Renderer {
|
|
|
36
36
|
* <img src="../images/multiply-blendmode.png" width="180"/> <br>
|
|
37
37
|
* - "screen" : pixels are inverted, multiplied, and inverted again (opposite of multiply) <br>
|
|
38
38
|
* <img src="../images/screen-blendmode.png" width="180"/> <br>
|
|
39
|
-
* Canvas (browser-dependent) and WebGL2: <br>
|
|
40
39
|
* - "darken" : retains the darkest pixels of both layers <br>
|
|
41
40
|
* <img src="../images/darken-blendmode.png" width="180"/> <br>
|
|
42
41
|
* - "lighten" : retains the lightest pixels of both layers <br>
|
|
43
42
|
* <img src="../images/lighten-blendmode.png" width="180"/> <br>
|
|
44
|
-
*
|
|
45
|
-
* - "overlay" <br>
|
|
43
|
+
* - "overlay" : multiplies or screens, depending on the backdrop <br>
|
|
46
44
|
* <img src="../images/overlay-blendmode.png" width="180"/> <br>
|
|
47
|
-
* - "
|
|
48
|
-
* <img src="../images/color-dodge-blendmode.png" width="180"/> <br>
|
|
49
|
-
* - "color-burn" <br>
|
|
50
|
-
* <img src="../images/color-burn-blendmode.png" width="180"/> <br>
|
|
51
|
-
* - "hard-light" <br>
|
|
45
|
+
* - "hard-light" : overlay with the layers swapped — a harsh spotlight <br>
|
|
52
46
|
* <img src="../images/hard-light-blendmode.png" width="180"/> <br>
|
|
53
|
-
* - "soft-light" <br>
|
|
47
|
+
* - "soft-light" : a diffused spotlight, gentler than hard-light <br>
|
|
54
48
|
* <img src="../images/soft-light-blendmode.png" width="180"/> <br>
|
|
55
|
-
* - "
|
|
49
|
+
* - "color-dodge" : brightens the backdrop to reflect the source <br>
|
|
50
|
+
* <img src="../images/color-dodge-blendmode.png" width="180"/> <br>
|
|
51
|
+
* - "color-burn" : darkens the backdrop to reflect the source <br>
|
|
52
|
+
* <img src="../images/color-burn-blendmode.png" width="180"/> <br>
|
|
53
|
+
* - "difference" : the absolute difference of the two layers <br>
|
|
56
54
|
* <img src="../images/difference-blendmode.png" width="180"/> <br>
|
|
57
|
-
* - "exclusion" <br>
|
|
55
|
+
* - "exclusion" : like difference, but lower in contrast <br>
|
|
58
56
|
* <img src="../images/exclusion-blendmode.png" width="180"/> <br>
|
|
57
|
+
* - "none" : blending disabled — the source replaces the destination
|
|
58
|
+
* outright, alpha included <br>
|
|
59
|
+
* A few draw types cannot honour every mode — 3D meshes, and fills using
|
|
60
|
+
* a {@link Gradient} — and fall back to "normal" with a one-time console
|
|
61
|
+
* warning. `setBlendMode` returns what it actually applied, so comparing
|
|
62
|
+
* the result against your request detects that case.
|
|
59
63
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation
|
|
60
64
|
* @param {string} [mode="normal"] - blend mode
|
|
61
65
|
* @returns {string} the blend mode actually applied (may differ if the requested mode is unsupported)
|
|
@@ -301,24 +305,24 @@ export default class CanvasRenderer extends Renderer {
|
|
|
301
305
|
* Reset (overrides) the renderer transformation matrix to the
|
|
302
306
|
* identity one, and then apply the given transformation matrix.
|
|
303
307
|
* @param {Matrix2d|Matrix3d|number} a - a matrix to transform by, or the a component to multiply the current matrix by
|
|
304
|
-
* @param {number} b - the b component to multiply the current matrix by
|
|
305
|
-
* @param {number} c - the c component to multiply the current matrix by
|
|
306
|
-
* @param {number} d - the d component to multiply the current matrix by
|
|
307
|
-
* @param {number} e - the e component to multiply the current matrix by
|
|
308
|
-
* @param {number} f - the f component to multiply the current matrix by
|
|
308
|
+
* @param {number} [b] - the b component to multiply the current matrix by; omitted when `a` is a matrix
|
|
309
|
+
* @param {number} [c] - the c component to multiply the current matrix by; omitted when `a` is a matrix
|
|
310
|
+
* @param {number} [d] - the d component to multiply the current matrix by; omitted when `a` is a matrix
|
|
311
|
+
* @param {number} [e] - the e component to multiply the current matrix by; omitted when `a` is a matrix
|
|
312
|
+
* @param {number} [f] - the f component to multiply the current matrix by; omitted when `a` is a matrix
|
|
309
313
|
*/
|
|
310
|
-
setTransform(a: Matrix2d | Matrix3d | number, b
|
|
314
|
+
setTransform(a: Matrix2d | Matrix3d | number, b?: number, c?: number, d?: number, e?: number, f?: number): void;
|
|
311
315
|
/**
|
|
312
316
|
* Multiply given matrix into the renderer tranformation matrix
|
|
313
317
|
* @see {@link CanvasRenderer.setTransform} which will reset the current transform matrix prior to performing the new transformation
|
|
314
318
|
* @param {Matrix2d|Matrix3d|number} a - a matrix to transform by, or the a component to multiply the current matrix by
|
|
315
|
-
* @param {number} b - the b component to multiply the current matrix by
|
|
316
|
-
* @param {number} c - the c component to multiply the current matrix by
|
|
317
|
-
* @param {number} d - the d component to multiply the current matrix by
|
|
318
|
-
* @param {number} e - the e component to multiply the current matrix by
|
|
319
|
-
* @param {number} f - the f component to multiply the current matrix by
|
|
319
|
+
* @param {number} [b] - the b component to multiply the current matrix by; omitted when `a` is a matrix
|
|
320
|
+
* @param {number} [c] - the c component to multiply the current matrix by; omitted when `a` is a matrix
|
|
321
|
+
* @param {number} [d] - the d component to multiply the current matrix by; omitted when `a` is a matrix
|
|
322
|
+
* @param {number} [e] - the e component to multiply the current matrix by; omitted when `a` is a matrix
|
|
323
|
+
* @param {number} [f] - the f component to multiply the current matrix by; omitted when `a` is a matrix
|
|
320
324
|
*/
|
|
321
|
-
transform(a: Matrix2d | Matrix3d | number, b
|
|
325
|
+
transform(a: Matrix2d | Matrix3d | number, b?: number, c?: number, d?: number, e?: number, f?: number): void;
|
|
322
326
|
/**
|
|
323
327
|
* A mask limits rendering elements to the shape and position of the given mask object.
|
|
324
328
|
* If the drawing or rendering area is larger than the mask, only the intersecting part of the renderable will be visible.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canvas_renderer.d.ts","sourceRoot":"","sources":["../../../src/video/canvas/canvas_renderer.js"],"names":[],"mappings":"AAcA;;;;;;;;;;GAUG;AAEH;;;GAGG;AACH;IAiBE,oBAAmC;IAiCnC,wBAEC;IAyBD,8CAA4B;IAyE1B,mBAA0B;IA6B7B;;;;;OAKG;IACH,sBAFW,QAAQ,QAclB;IAED
|
|
1
|
+
{"version":3,"file":"canvas_renderer.d.ts","sourceRoot":"","sources":["../../../src/video/canvas/canvas_renderer.js"],"names":[],"mappings":"AAcA;;;;;;;;;;GAUG;AAEH;;;GAGG;AACH;IAiBE,oBAAmC;IAiCnC,wBAEC;IAyBD,8CAA4B;IAyE1B,mBAA0B;IA6B7B;;;;;OAKG;IACH,sBAFW,QAAQ,QAclB;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACH,oBAHW,MAAM,GACJ,MAAM,CAqClB;IAWD;;;;OAIG;IACH,mBAHW,KAAK,GAAC,MAAM,WACZ,OAAO,QAajB;IAED;;;;;;OAMG;IACH,aALW,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,QAIhB;IAED;;;;;;;;;;;OAWG;IACH,qBAVW,gBAAgB,GAAC,eAAe,GAAC,gBAAgB,GAAC,iBAAiB,GAAC,WAAW,GAAC,eAAe,GAAC,UAAU,WAC1G,MAAM,GACJ,aAAa,CAezB;IAiID;;;;;;;;OAQG;IACH,qBAP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AAO,SACP,OAAO,QAyBjB;IAED;;;OAGG;IACH,kBAFW,OAAO,QAIjB;IA+BD;;;;;;;;OAQG;IACH,mBAPW,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,UACN,MAAM,SACN,OAAO,QAYjB;IAED;;;;;;;OAOG;IACH,iBANW,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,UACN,MAAM,QAIhB;IAED;;;;OAIG;IACH,eAHW,MAAM,KACN,MAAM,QAIhB;IAED;;;;;;OAMG;IACH,aALW,MAAM,KACN,MAAM,QAMhB;IA+GD;;;OAGG;IACH,kBAFa,MAAM,CAIlB;IA4BD;;OAEG;IACH,oBAVU,MAAM,EAaf;IAhBD;;;;;OAKG;IACH,gBAHU,MAAM,CAKf;IAUD;;;;;;;;;OASG;IACH,gBAPW,QAAQ,GAAC,QAAQ,GAAC,MAAM,MACxB,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QAKhB;IAED;;;;;;;;;OASG;IACH,aAPW,QAAQ,GAAC,QAAQ,GAAC,MAAM,MACxB,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QA+BhB;IA4FD;;;;;;;OAOG;IACH,eAHW,IAAI,GAAC,SAAS,GAAC,OAAO,GAAC,IAAI,GAAC,OAAO,WACnC,OAAO,QAgGjB;IApFC,2CAAkC;CAgGpC;qBAzgDoB,kBAAkB;yBACd,uBAAuB;sBAX1B,uBAAuB;0BAgBtB,iCAAiC;+BAC5B,iCAAiC;6BACnC,6BAA6B;0BAChC,4BAA4B;6BACzB,+BAA+B;4BAEhC,yBAAyB;8BADvB,wBAAwB"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export const wgslFragment: "\nstruct BlendUniforms {\n\tuBlendMode : f32,\n};\n@group(3) @binding(0) var<uniform> fx : BlendUniforms;\n@group(3) @binding(1) var backdrop : texture_2d<f32>;\n@group(3) @binding(2) var backdrop_sampler : sampler;\n\n// HardLight(Cb, Cs) \u2014 also the kernel for Overlay, which the W3C spec\n// defines as HardLight with the arguments swapped\nfn ME_hardLight(b : vec3f, s : vec3f) -> vec3f {\n\tlet lo = 2.0 * b * s;\n\tlet hi = 1.0 - 2.0 * (1.0 - b) * (1.0 - s);\n\treturn mix(lo, hi, step(vec3f(0.5), s));\n}\n\nfn ME_softLight(b : vec3f, s : vec3f) -> vec3f {\n\tlet d = mix(((16.0 * b - 12.0) * b + 4.0) * b, sqrt(b), step(vec3f(0.25), b));\n\tlet lo = b - (1.0 - 2.0 * s) * b * (1.0 - b);\n\tlet hi = b + (2.0 * s - 1.0) * (d - b);\n\treturn mix(lo, hi, step(vec3f(0.5), s));\n}\n\n// Cb == 0 wins over Cs == 1, so it is applied last\nfn ME_colorDodge(b : vec3f, s : vec3f) -> vec3f {\n\tvar r = min(vec3f(1.0), b / max(1.0 - s, vec3f(1e-4)));\n\tr = mix(r, vec3f(1.0), step(vec3f(1.0), s));\n\treturn mix(r, vec3f(0.0), step(b, vec3f(0.0)));\n}\n\n// Cb == 1 wins over Cs == 0, so it is applied last\nfn ME_colorBurn(b : vec3f, s : vec3f) -> vec3f {\n\tvar r = 1.0 - min(vec3f(1.0), (1.0 - b) / max(s, vec3f(1e-4)));\n\tr = mix(r, vec3f(0.0), step(s, vec3f(0.0)));\n\treturn mix(r, vec3f(1.0), step(vec3f(1.0), b));\n}\n\nfn ME_blend(b : vec3f, s : vec3f) -> vec3f {\n\tif (fx.uBlendMode < 0.5) { return abs(b - s); }\n\tif (fx.uBlendMode < 1.5) { return ME_hardLight(s, b); }\n\tif (fx.uBlendMode < 2.5) { return ME_hardLight(b, s); }\n\tif (fx.uBlendMode < 3.5) { return ME_colorDodge(b, s); }\n\tif (fx.uBlendMode < 4.5) { return ME_colorBurn(b, s); }\n\tif (fx.uBlendMode < 5.5) { return ME_softLight(b, s); }\n\tif (fx.uBlendMode < 6.5) { return min(b, s); }\n\treturn max(b, s);\n}\n\nfn apply(color : vec4f, uv : vec2f) -> vec4f {\n\t// sampled BEFORE any branch, so plain textureSampleLevel is safe here\n\tlet Cb = textureSampleLevel(backdrop, backdrop_sampler, screen_uv, 0.0).rgb;\n\tlet a = color.a;\n\tlet Cs = color.rgb / max(a, 1e-4);\n\tlet B = clamp(ME_blend(Cb, Cs), vec3f(0.0), vec3f(1.0));\n\treturn vec4f(a * B, a);\n}\n";
|
|
2
|
+
/**
|
|
3
|
+
* The compositing shader behind the six CSS blend modes that fixed-function
|
|
4
|
+
* blending cannot express: `overlay`, `hard-light`, `color-dodge`,
|
|
5
|
+
* `color-burn`, `soft-light` and `difference`.
|
|
6
|
+
*
|
|
7
|
+
* Internal — owned by the renderer, one instance per renderer, never
|
|
8
|
+
* constructed or configured by user code. A game selects a mode the ordinary
|
|
9
|
+
* way (`sprite.blendMode = "overlay"`, or `renderer.setBlendMode("overlay")`)
|
|
10
|
+
* and the renderer drives this effect from there.
|
|
11
|
+
*
|
|
12
|
+
* ### How it composites
|
|
13
|
+
*
|
|
14
|
+
* The renderer captures the destination, renders the draw to an offscreen
|
|
15
|
+
* target, then blits that target through this effect. Everything arriving in
|
|
16
|
+
* `color` is PREMULTIPLIED (the offscreen was drawn source-over into a
|
|
17
|
+
* transparent clear), while the W3C formulas are defined on straight colour —
|
|
18
|
+
* so the body un-premultiplies, blends, and re-premultiplies.
|
|
19
|
+
*
|
|
20
|
+
* Emitting premultiplied and letting ordinary source-over run the composite
|
|
21
|
+
* yields `as*B + (1-as)*Cb` and a correct output alpha for free. It also keeps
|
|
22
|
+
* the premultiplied invariant `rgb <= a` — a texel with `rgb > a` is undefined
|
|
23
|
+
* and diverges across browsers — which is why `B` is clamped even though all
|
|
24
|
+
* six formulas land in `[0,1]` analytically.
|
|
25
|
+
*
|
|
26
|
+
* The backdrop is treated as opaque (`ab = 1`). The GL capture is an RGB
|
|
27
|
+
* texture so that is true by construction there; the WebGPU capture preserves
|
|
28
|
+
* alpha and is deliberately ignored, so the two backends agree.
|
|
29
|
+
*
|
|
30
|
+
* ### Why not the `: screen_texture` builtin
|
|
31
|
+
*
|
|
32
|
+
* That annotation wires the sampler to the renderer's SHARED capture slot,
|
|
33
|
+
* which `drawImage` already refreshes on behalf of any custom shader that
|
|
34
|
+
* samples the screen. A renderable carrying an advanced blend mode AND a
|
|
35
|
+
* screen-sampling {@link ShaderEffect} would then have the two fighting over
|
|
36
|
+
* one texture. This declares a plain sampler instead and the renderer binds
|
|
37
|
+
* its own capture, so the two are independent. Referencing `screen_uv` still
|
|
38
|
+
* activates that varying on its own.
|
|
39
|
+
* @see {@link https://www.w3.org/TR/compositing-1/#blending}
|
|
40
|
+
* @ignore
|
|
41
|
+
*/
|
|
42
|
+
export default class BlendEffect extends ShaderEffect {
|
|
43
|
+
/**
|
|
44
|
+
* @param {import("../webgl/webgl_renderer.js").default|import("../webgpu/webgpu_renderer.js").default} renderer - the renderer that owns this effect
|
|
45
|
+
*/
|
|
46
|
+
constructor(renderer: import("../webgl/webgl_renderer.js").default | import("../webgpu/webgpu_renderer.js").default);
|
|
47
|
+
/**
|
|
48
|
+
* Select which of the six formulas the shader evaluates.
|
|
49
|
+
* @param {string} mode - one of the modes in {@link ADVANCED_BLEND_MODES}
|
|
50
|
+
* @returns {boolean} false when the mode is not an advanced blend mode, in
|
|
51
|
+
* which case the uniform is left untouched
|
|
52
|
+
* @ignore
|
|
53
|
+
*/
|
|
54
|
+
setBlendMode(mode: string): boolean;
|
|
55
|
+
}
|
|
56
|
+
import ShaderEffect from "./shadereffect.js";
|
|
57
|
+
//# sourceMappingURL=blendEffect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blendEffect.d.ts","sourceRoot":"","sources":["../../../src/video/effects/blendEffect.js"],"names":[],"mappings":"AAgBA,soEAwDE;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH;IACC;;OAEG;IACH,sBAFW,OAAO,4BAA4B,EAAE,OAAO,GAAC,OAAO,8BAA8B,EAAE,OAAO,EA4DrG;IAED;;;;;;OAMG;IACH,mBALW,MAAM,GACJ,OAAO,CAWnB;CACD;yBAhMwB,mBAAmB"}
|
|
@@ -447,11 +447,10 @@ declare class Renderer {
|
|
|
447
447
|
*/
|
|
448
448
|
getBlendMode(): string;
|
|
449
449
|
/**
|
|
450
|
-
* set the current blend mode.
|
|
451
|
-
*
|
|
452
|
-
* lands) implement the actual backend logic.
|
|
450
|
+
* set the current blend mode. Every renderer supports the same set —
|
|
451
|
+
* see {@link CanvasRenderer#setBlendMode} for the list and what each does.
|
|
453
452
|
* @param {string} [mode="normal"] - blend mode
|
|
454
|
-
* @param {boolean} [premultipliedAlpha=true] - whether textures use premultiplied alpha
|
|
453
|
+
* @param {boolean} [premultipliedAlpha=true] - whether textures use premultiplied alpha
|
|
455
454
|
*/
|
|
456
455
|
setBlendMode(mode?: string): void;
|
|
457
456
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/video/renderer.js"],"names":[],"mappings":"AAUA;;GAEG;AAEH;;;;;;;;GAQG;AAEH;;;GAGG;AACH;IA2dC;;;;;;;;;;;;OAYG;IACH,2BANW,MAAM,UACN,MAAM,0BACN,OAAO,GAEL,iBAAiB,GAAC,eAAe,CAI7C;IAED;;;;;;;;;;;;OAYG;IACH,wBAFa,iBAAiB,GAAC,eAAe,CAgB7C;IAtgBD;;OAEG;IACH,sBAFW,mBAAmB,EA4N7B;IAzNA;;;;OAIG;IACH,cAFU,kBAAkB,CAS3B;IAED;;;;OAIG;IACH,iBAFU,MAAM,CAEO;IAEvB;;;;OAIG;IACH,oBAFU,MAAM,CAE6C;IAE7D;;;;OAIG;IACH,YAHU,QAAQ,CAGsD;IAExE;;;;OAIG;IACH,gBAFU,OAAO,CAES;IAE1B;;;;OAIG;IACH,aAFU,MAAM,GAAC,SAAS,CAEE;IAE5B;;;;;;OAMG;IACH,cAHU,QAAQ,GAAC,YAAY,GAAC,SAAS,CAGZ;I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APW,MAAM,eACN,QAAQ,QACR,MAAM,cACN,MAAM,QAqBhB;IADA,kBAA0B;IAG3B;;;;;;;;OAQG;IACH,2BAmDC;IAxCA,qCAA2B;IA0C5B;;;;;;;;;;;;;;;;;OAiBG;IAEH,eAJW,IAAI,gBACJ,QAAQ,QAGW;IAE9B;;OAEG;IACH,cAeC;IAED;;;;OAIG;IACH,gBAAY;IAEZ;;;OAGG;IACH,aAFa,iBAAiB,CAI7B;IAED;;;;;;;;;;OAUG;IACH,oBALW,MAAM,UACN,MAAM,0BACN,OAAO,GACL,iBAAiB,GAAC,eAAe,CAI7C;IAgDD;;;OAGG;IACH,cAFa,wBAAwB,GAAC,qBAAqB,GAAC,gBAAgB,CAI3E;IAED;;;;;;;OAOG;IACH,wCAFa,MAAM,CAYlB;IAED;;;;OAIG;IACH,sCAHW,MAAM,GACJ,OAAO,CAgBnB;IAED;;;;;;;OAOG;IACH,4BAJW,UAAU,GACR,OAAO,CAcnB;IAED;;;;;;OAMG;IAEH,0BAJW,UAAU,QAIO;IAE5B;;;;;;;;;;;;OAYG;IAEH,mBATW,YAAY,KACZ,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,UACN,YAAY,cACZ,OAAO,QAG2C;IAE7D;;;;;;;;OAQG;IAEH,gBANW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QAGiB;IAElC;;;;OAIG;IACH,0BAAsB;IAEtB;;;;;;;OAOG;IAEH,iBANW,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,QAGoB;IAErC;;;OAGG;IACH,uBAAmB;IAEnB;;;;OAIG;IAEH,wBAHW,OAAO,QAGQ;IAE1B;;;OAGG;IACH,gBAFa,MAAM,CAIlB;IAED
|
|
1
|
+
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/video/renderer.js"],"names":[],"mappings":"AAUA;;GAEG;AAEH;;;;;;;;GAQG;AAEH;;;GAGG;AACH;IA2dC;;;;;;;;;;;;OAYG;IACH,2BANW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;;;;;;;;;;;;;;;;;OAkBG;IAEH,iBAXW,gBAAgB,GAAC,eAAe,GAAC,gBAAgB,GAAC,iBAAiB,GAAC,WAAW,GAAC,eAAe,GAAC,UAAU,MAC1G,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QAGkC;IAEnD;;;;;;OAMG;IACH,gBAAY;IAEZ;;;OAGG;IACH,kBAAc;IAEd;;;;OAIG;IACH,cAHW,KAAK,UACL,MAAM,QAMhB;IAED;;;OAGG;IACH,kBAGC;IAED;;;;;;;;;;;;;;;OAeG;IACH,gBAHW,MAAM,QAgBhB;IAED;;;;;;;OAOG;IACH,cANW,MAAM,YACN,MAAM,gBAOhB;IAED;;;;;;;;OAQG;IACH,qBANW,MAAM,YACN,MAAM,gBAOhB;IAED;;;;;;;OAOG;IACH,iBANW,MAAM,YACN,MAAM,gBAOhB;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IAEH,yBAfG;QAAiC,MAAM;QAIwC,MAAM;eAAlE,MAAM;eAAK,MAAM;mBAAS,MAAM;oBAAU,MAAM;;KAMnE,GAAU,SAAS,CAOrB;CACD;;;;;+BAp2C8B,sCAAsC;yBAL5C,qBAAqB;kCAQb,sCAAsC;mBAXpD,2BAA2B;sBACxB,oBAAoB;wBAMlB,kBAAkB;yBALjB,qBAAqB;0BAavB,8BAA8B;yBAT5B,eAAe;4BAcf,wBAAwB;+BAJrB,8BAA8B;6BAChC,0BAA0B;0BAC7B,yBAAyB;6BACtB,4BAA4B;0CAEf,wBAAwB"}
|
|
@@ -82,6 +82,7 @@ declare class CanvasRenderTarget extends RenderTarget {
|
|
|
82
82
|
* @ignore
|
|
83
83
|
*/
|
|
84
84
|
destroy(renderer?: CanvasRenderer | WebGLRenderer): void;
|
|
85
|
+
#private;
|
|
85
86
|
}
|
|
86
87
|
import RenderTarget from "./rendertarget.ts";
|
|
87
88
|
import type CanvasRenderer from "./../canvas/canvas_renderer.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canvasrendertarget.d.ts","sourceRoot":"","sources":["../../../src/video/rendertarget/canvasrendertarget.js"],"names":[],"mappings":";AA6EA;;;;;;GAMG;AACH;IACC;;;;;;;;;OASG;IACH,mBATW,MAAM,UACN,MAAM,eAEd;QAA4B,OAAO;QACN,WAAW;QACX,eAAe;QACf,kBAAkB;QAClB,SAAS;KACxC,EAoCA;IAhCA;;;;;;;;;;;;;;;;;MAAkE;IASjE,YAA+B;IAUhC,aAA0D;IAGzD;;;;OAIG;IACH,cAHU,MAAM,CAGK;IAOvB;;OAEG;IACH,4CAGC;IAUD;;;OAGG;IACH,sBAFW,OAAO,QAwBjB;IAYD;;;;;;;;OAQG;IACH,gBANW,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,GACJ,SAAS,CAUrB;IAoDD;;;;OAIG;IACH,qBAFW,cAAc,GAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"canvasrendertarget.d.ts","sourceRoot":"","sources":["../../../src/video/rendertarget/canvasrendertarget.js"],"names":[],"mappings":";AA6EA;;;;;;GAMG;AACH;IACC;;;;;;;;;OASG;IACH,mBATW,MAAM,UACN,MAAM,eAEd;QAA4B,OAAO;QACN,WAAW;QACX,eAAe;QACf,kBAAkB;QAClB,SAAS;KACxC,EAoCA;IAhCA;;;;;;;;;;;;;;;;;MAAkE;IASjE,YAA+B;IAUhC,aAA0D;IAGzD;;;;OAIG;IACH,cAHU,MAAM,CAGK;IAOvB;;OAEG;IACH,4CAGC;IAUD;;;OAGG;IACH,sBAFW,OAAO,QAwBjB;IAYD;;;;;;;;OAQG;IACH,gBANW,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,GACJ,SAAS,CAUrB;IAoDD;;;;OAIG;IACH,qBAFW,cAAc,GAAC,aAAa,QAsBtC;IAWC,mBAEC;IAeH;;;;OAIG;IACH,mBAHW,cAAc,GAAC,aAAa,QAyCtC;;CA2BD;yBAvXwB,mBAAmB;gCAIb,gCAAgC;+BACjC,8BAA8B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batcher.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/batchers/batcher.js"],"names":[],"mappings":"AASA;;;;;;GAMG;AAEH;;;;;;;GAOG;AACH;IAgBC;;;OAGG;IACH,sBAHW,aAAa,YACb,MAAM,EAKhB;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,eAfW,aAAa,YAErB;QAA2B,UAAU,EACrC;YAAoC,IAAI,EAAhC,MAAM;YACsB,IAAI,EAAhC,MAAM;YACsB,IAAI,EAAhC,MAAM;YACuB,UAAU,EAAvC,OAAO;YACqB,MAAM,EAAlC,MAAM;SACd;QAAyB,MAAM,EAC/B;YAAgC,MAAM,EAA9B,MAAM;YACkB,QAAQ,EAAhC,MAAM;SACd;QAA0B,WAAW;QACV,OAAO;QACR,iBAAiB;KAC7C,QA+IA;IAzIA,QAAqB;IAGrB,iCAA2C;IAE3C;;;OAGG;IACH,oCAA8B;IAE9B;;;OAGG;IACH,oCAA8B;
|
|
1
|
+
{"version":3,"file":"batcher.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/batchers/batcher.js"],"names":[],"mappings":"AASA;;;;;;GAMG;AAEH;;;;;;;GAOG;AACH;IAgBC;;;OAGG;IACH,sBAHW,aAAa,YACb,MAAM,EAKhB;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,eAfW,aAAa,YAErB;QAA2B,UAAU,EACrC;YAAoC,IAAI,EAAhC,MAAM;YACsB,IAAI,EAAhC,MAAM;YACsB,IAAI,EAAhC,MAAM;YACuB,UAAU,EAAvC,OAAO;YACqB,MAAM,EAAlC,MAAM;SACd;QAAyB,MAAM,EAC/B;YAAgC,MAAM,EAA9B,MAAM;YACkB,QAAQ,EAAhC,MAAM;SACd;QAA0B,WAAW;QACV,OAAO;QACR,iBAAiB;KAC7C,QA+IA;IAzIA,QAAqB;IAGrB,iCAA2C;IAE3C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.d.ts","sourceRoot":"","sources":["../../../src/video/webgl/glshader.js"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH;IACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACH,iBAtCW,qBAAqB,UAGrB,MAAM,GAAC,MAAM,aAGb,MAAM,cACN,MAAM,EAiKhB;IArHA;;;OAGG;IACH,IAFU,qBAAqB,CAEnB;IAEZ;;;;;OAKG;IACH,kBAHU,OAAO,CAIwD;IAEzE;;;;;OAKG;IACH,mBAHU,OAAO,CAGuB;IAExC;;;OAGG;IACH,MAFU,MAAM,GAAC,SAAS,CAEV;IAEhB;;;;OAIG;IACH,OAFU,MAAM,GAAC,SAAS,CAER;IAIlB,mBAAqB;IAKrB;;;MAAwD;IAWxD;;;;;;;OAOG;IACH,oBAHU,OAAO,CAGK;IAEtB;;;;;;;;;OASG;IACH,QAHU,OAAO,CAGE;IAEnB;;;;;;;;;;OAUG;IACH,oBAHU,OAAO,CAGK;IAGtB,+BAA2B;IAC3B,oCAA+B;IAC/B,+BAA2B;IAG3B,mBAAwC;IAMtC,sBAAmB;IACnB,iBAAoB;IACpB,qBAAsB;IAgBzB;;;;;;OAMG;IACH,iBA0CC;IAzCA,YAGC;IACD,cAGC;IAoCF;;;;;OAKG;IACH,uBAgBC;IAED;;;;;OAKG;IACH,2BAMC;IAED;;OAEG;IACH,
|
|
1
|
+
{"version":3,"file":"glshader.d.ts","sourceRoot":"","sources":["../../../src/video/webgl/glshader.js"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH;IACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACH,iBAtCW,qBAAqB,UAGrB,MAAM,GAAC,MAAM,aAGb,MAAM,cACN,MAAM,EAiKhB;IArHA;;;OAGG;IACH,IAFU,qBAAqB,CAEnB;IAEZ;;;;;OAKG;IACH,kBAHU,OAAO,CAIwD;IAEzE;;;;;OAKG;IACH,mBAHU,OAAO,CAGuB;IAExC;;;OAGG;IACH,MAFU,MAAM,GAAC,SAAS,CAEV;IAEhB;;;;OAIG;IACH,OAFU,MAAM,GAAC,SAAS,CAER;IAIlB,mBAAqB;IAKrB;;;MAAwD;IAWxD;;;;;;;OAOG;IACH,oBAHU,OAAO,CAGK;IAEtB;;;;;;;;;OASG;IACH,QAHU,OAAO,CAGE;IAEnB;;;;;;;;;;OAUG;IACH,oBAHU,OAAO,CAGK;IAGtB,+BAA2B;IAC3B,oCAA+B;IAC/B,+BAA2B;IAG3B,mBAAwC;IAMtC,sBAAmB;IACnB,iBAAoB;IACpB,qBAAsB;IAgBzB;;;;;;OAMG;IACH,iBA0CC;IAzCA,YAGC;IACD,cAGC;IAoCF;;;;;OAKG;IACH,uBAgBC;IAED;;;;;OAKG;IACH,2BAMC;IAED;;OAEG;IACH,aAcC;IAED;;;;OAIG;IACH,wBAHW,MAAM,GACJ,KAAK,CAcjB;IAED;;;;;;OAMG;IACH,iBALW,MAAM,SACN,MAAM,GAAC,YAAY,QA4C7B;IAED;;;;;;;;;;;;;OAaG;IACH,wBAJW,qBAAqB,cACrB,MAAM,EAAE,UACR,MAAM,QAmBhB;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,SAFa,QAAQ,CA8BpB;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,oBATW,MAAM,QACN,MAAM,oBACN,kBAAkB,EAAE,mBACpB,MAAM,GACJ,MAAM,GAAC,IAAI,CAgFvB;IAED;;;;;OAKG;IACH,gBAkCC;CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/utils/program.js"],"names":[],"mappings":"AAeA;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/utils/program.js"],"names":[],"mappings":"AAeA;;;GAGG;AACH,0FA8CC"}
|