melonjs 19.7.1 → 19.9.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 +21 -6
- package/build/application/application.d.ts.map +1 -1
- package/build/application/defaultApplicationSettings.d.ts +1 -0
- package/build/application/defaultApplicationSettings.d.ts.map +1 -1
- package/build/application/settings.d.ts +34 -0
- package/build/application/settings.d.ts.map +1 -1
- package/build/audio/audio.d.ts +1 -1
- package/build/audio/audio.d.ts.map +1 -1
- package/build/audio/backend.d.ts +21 -2
- package/build/audio/backend.d.ts.map +1 -1
- package/build/audio/playback.d.ts +8 -28
- package/build/audio/playback.d.ts.map +1 -1
- package/build/camera/camera3d.d.ts +49 -0
- package/build/camera/camera3d.d.ts.map +1 -1
- package/build/geometries/path2d.d.ts +188 -75
- package/build/geometries/path2d.d.ts.map +1 -1
- package/build/geometries/rectangle.d.ts.map +1 -1
- package/build/index.d.ts +11 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +19170 -13625
- package/build/index.js.map +4 -4
- package/build/level/gltf/GLTFModel.d.ts +173 -0
- package/build/level/gltf/GLTFModel.d.ts.map +1 -0
- package/build/level/gltf/GLTFScene.d.ts +84 -0
- package/build/level/gltf/GLTFScene.d.ts.map +1 -0
- package/build/level/gltf/gltf_sampler.d.ts +49 -0
- package/build/level/gltf/gltf_sampler.d.ts.map +1 -0
- package/build/level/level.d.ts +7 -3
- package/build/level/level.d.ts.map +1 -1
- package/build/level/tiled/TMXTileMap.d.ts +5 -0
- package/build/level/tiled/TMXTileMap.d.ts.map +1 -1
- package/build/{renderable → lighting}/light2d.d.ts +79 -78
- package/build/lighting/light2d.d.ts.map +1 -0
- package/build/lighting/light3d.d.ts +86 -0
- package/build/lighting/light3d.d.ts.map +1 -0
- package/build/loader/cache.d.ts +2 -0
- package/build/loader/cache.d.ts.map +1 -1
- package/build/loader/loader.d.ts +156 -8
- package/build/loader/loader.d.ts.map +1 -1
- package/build/loader/parsers/fetchdata.d.ts +14 -0
- package/build/loader/parsers/fetchdata.d.ts.map +1 -1
- package/build/loader/parsers/gltf.d.ts +71 -0
- package/build/loader/parsers/gltf.d.ts.map +1 -0
- package/build/loader/parsers/mtl.d.ts.map +1 -1
- package/build/loader/parsers/shader.d.ts +47 -0
- package/build/loader/parsers/shader.d.ts.map +1 -0
- package/build/loader/parsers/video.d.ts.map +1 -1
- package/build/math/color.d.ts.map +1 -1
- package/build/math/math.d.ts +2 -2
- package/build/math/matrix2d.d.ts.map +1 -1
- package/build/math/noise.d.ts +141 -0
- package/build/math/noise.d.ts.map +1 -0
- package/build/math/observableVector2d.d.ts +1 -1
- package/build/math/observableVector2d.d.ts.map +1 -1
- package/build/math/observableVector3d.d.ts +1 -1
- package/build/math/observableVector3d.d.ts.map +1 -1
- package/build/math/vector2d.d.ts +1 -1
- package/build/math/vector2d.d.ts.map +1 -1
- package/build/math/vector3d.d.ts +1 -1
- package/build/math/vector3d.d.ts.map +1 -1
- package/build/math/vertex.d.ts +25 -0
- package/build/math/vertex.d.ts.map +1 -1
- package/build/physics/adapter.d.ts +4 -3
- package/build/physics/adapter.d.ts.map +1 -1
- package/build/physics/broadphase/aabb3d.d.ts +23 -2
- package/build/physics/broadphase/aabb3d.d.ts.map +1 -1
- package/build/renderable/anchorPoint.d.ts +80 -0
- package/build/renderable/anchorPoint.d.ts.map +1 -0
- package/build/renderable/animation.d.ts +41 -0
- package/build/renderable/animation.d.ts.map +1 -0
- package/build/renderable/collectable.d.ts +7 -1
- package/build/renderable/collectable.d.ts.map +1 -1
- package/build/renderable/container.d.ts +0 -1
- package/build/renderable/container.d.ts.map +1 -1
- package/build/renderable/entity/entity.d.ts +5 -2
- package/build/renderable/entity/entity.d.ts.map +1 -1
- package/build/renderable/frameAnimation.d.ts +154 -0
- package/build/renderable/frameAnimation.d.ts.map +1 -0
- package/build/renderable/imagelayer.d.ts +5 -2
- package/build/renderable/imagelayer.d.ts.map +1 -1
- package/build/renderable/mesh.d.ts +175 -6
- package/build/renderable/mesh.d.ts.map +1 -1
- package/build/renderable/nineslicesprite.d.ts +5 -7
- package/build/renderable/nineslicesprite.d.ts.map +1 -1
- package/build/renderable/renderable.d.ts +28 -1
- package/build/renderable/renderable.d.ts.map +1 -1
- package/build/renderable/sprite.d.ts +84 -34
- package/build/renderable/sprite.d.ts.map +1 -1
- package/build/renderable/sprite3d.d.ts +350 -0
- package/build/renderable/sprite3d.d.ts.map +1 -0
- package/build/renderable/text/bitmaptext.d.ts +24 -12
- package/build/renderable/text/bitmaptext.d.ts.map +1 -1
- package/build/renderable/text/bitmaptextdata.d.ts +24 -1
- package/build/renderable/text/bitmaptextdata.d.ts.map +1 -1
- package/build/renderable/text/text.d.ts +50 -12
- package/build/renderable/text/text.d.ts.map +1 -1
- package/build/state/stage.d.ts +20 -1
- package/build/state/stage.d.ts.map +1 -1
- package/build/system/event.d.ts +18 -2
- package/build/system/event.d.ts.map +1 -1
- package/build/video/buffer/vertex.d.ts +7 -0
- package/build/video/buffer/vertex.d.ts.map +1 -1
- package/build/video/canvas/canvas_renderer.d.ts +4 -0
- package/build/video/canvas/canvas_renderer.d.ts.map +1 -1
- package/build/video/renderer.d.ts +62 -1
- package/build/video/renderer.d.ts.map +1 -1
- package/build/video/rendertarget/render_target_pool.d.ts +17 -6
- package/build/video/rendertarget/render_target_pool.d.ts.map +1 -1
- package/build/video/texture/atlas.d.ts +3 -2
- package/build/video/texture/atlas.d.ts.map +1 -1
- package/build/video/texture/cache.d.ts +55 -6
- package/build/video/texture/cache.d.ts.map +1 -1
- package/build/video/texture/frametexture.d.ts +73 -0
- package/build/video/texture/frametexture.d.ts.map +1 -0
- package/build/video/texture/noise_texture2d.d.ts +176 -0
- package/build/video/texture/noise_texture2d.d.ts.map +1 -0
- package/build/video/texture/parser/aseprite.d.ts.map +1 -1
- package/build/video/texture/texture2d.d.ts +83 -0
- package/build/video/texture/texture2d.d.ts.map +1 -0
- package/build/video/webgl/batchers/batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/lit_mesh_batcher.d.ts +18 -0
- package/build/video/webgl/batchers/lit_mesh_batcher.d.ts.map +1 -0
- package/build/video/webgl/batchers/lit_quad_batcher.d.ts +30 -4
- package/build/video/webgl/batchers/lit_quad_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/material_batcher.d.ts +39 -3
- package/build/video/webgl/batchers/material_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/mesh_batcher.d.ts +52 -11
- package/build/video/webgl/batchers/mesh_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/primitive_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/quad_batcher.d.ts.map +1 -1
- package/build/video/webgl/buffer/index.d.ts +13 -0
- package/build/video/webgl/buffer/index.d.ts.map +1 -1
- package/build/video/webgl/effects/hologram.d.ts +0 -5
- package/build/video/webgl/effects/hologram.d.ts.map +1 -1
- package/build/video/webgl/effects/shine.d.ts +1 -6
- package/build/video/webgl/effects/shine.d.ts.map +1 -1
- package/build/video/webgl/glshader.d.ts +29 -0
- package/build/video/webgl/glshader.d.ts.map +1 -1
- package/build/video/webgl/lighting/pack3d.d.ts +32 -0
- package/build/video/webgl/lighting/pack3d.d.ts.map +1 -0
- package/build/video/webgl/shadereffect.d.ts +183 -0
- package/build/video/webgl/shadereffect.d.ts.map +1 -1
- package/build/video/webgl/webgl_renderer.d.ts +59 -1
- package/build/video/webgl/webgl_renderer.d.ts.map +1 -1
- package/package.json +5 -5
- package/build/renderable/light2d.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/buffer/index.js"],"names":[],"mappings":"AAEA;;;GAGG;AAEH;IACC;;;;OAIG;IACH,gBAJW,qBAAqB,GAAC,sBAAsB,cAC5C,MAAM,cACN,OAAO,EAOjB;IAHA,mDAAY;IACZ,kBAA2D;IAC3D,oBAA+B;IAiBhC;;OAEG;IACH,eAOC;IAED;;OAEG;IACH,aAEC;CACD;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/buffer/index.js"],"names":[],"mappings":"AAEA;;;GAGG;AAEH;IACC;;;;OAIG;IACH,gBAJW,qBAAqB,GAAC,sBAAsB,cAC5C,MAAM,cACN,OAAO,EAOjB;IAHA,mDAAY;IACZ,kBAA2D;IAC3D,oBAA+B;IAiBhC;;OAEG;IACH,eAOC;IAED;;OAEG;IACH,aAEC;IAED;;;;;;OAMG;IACH,iBAIC;IAED;;;OAGG;IACH,gBAGC;CACD;wBA1EuB,uBAAuB"}
|
|
@@ -22,11 +22,6 @@ export default class HologramEffect extends ShaderEffect {
|
|
|
22
22
|
color?: number[] | undefined;
|
|
23
23
|
intensity?: number | undefined;
|
|
24
24
|
});
|
|
25
|
-
/**
|
|
26
|
-
* set the current time (call each frame for animation)
|
|
27
|
-
* @param {number} time - time in seconds
|
|
28
|
-
*/
|
|
29
|
-
setTime(time: number): void;
|
|
30
25
|
/**
|
|
31
26
|
* set the hologram tint color
|
|
32
27
|
* @param {number[]} color - color as [r, g, b] (0.0–1.0)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hologram.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/effects/hologram.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH;IACC;;;;;OAKG;IACH,sBALW,OAAO,sBAAsB,EAAE,OAAO,YAE9C;QAA2B,KAAK;QACP,SAAS;KACpC,EAyBA;IAED;;;OAGG;IACH,
|
|
1
|
+
{"version":3,"file":"hologram.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/effects/hologram.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH;IACC;;;;;OAKG;IACH,sBALW,OAAO,sBAAsB,EAAE,OAAO,YAE9C;QAA2B,KAAK;QACP,SAAS;KACpC,EAyBA;IAED;;;OAGG;IACH,gBAFW,MAAM,EAAE,QAIlB;CACD;yBAvDwB,oBAAoB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A shader effect that sweeps a bright highlight band across the sprite —
|
|
3
3
|
* the classic "shine" pass commonly used for coins, gems, polished metal,
|
|
4
|
-
* and hover-highlighted UI elements.
|
|
4
|
+
* and hover-highlighted UI elements.
|
|
5
5
|
*
|
|
6
6
|
* Set `bands` > 1 to tile the sweep into N parallel glints (useful for the
|
|
7
7
|
* "etched grooves" look of a coin's rim). An optional subtle brightness
|
|
@@ -57,11 +57,6 @@ export default class ShineEffect extends ShaderEffect {
|
|
|
57
57
|
pulseDepth?: number | undefined;
|
|
58
58
|
pulseSpeed?: number | undefined;
|
|
59
59
|
});
|
|
60
|
-
/**
|
|
61
|
-
* set the current time (call each frame for animation)
|
|
62
|
-
* @param {number} time - time in seconds
|
|
63
|
-
*/
|
|
64
|
-
setTime(time: number): void;
|
|
65
60
|
/**
|
|
66
61
|
* set the shine color
|
|
67
62
|
* @param {number[]} color - shine color as [r, g, b] (0.0–1.0)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shine.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/effects/shine.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH;IACC;;;;;;;;;;;OAWG;IACH,sBAXW,OAAO,sBAAsB,EAAE,OAAO,YAE9C;QAA2B,KAAK;QACP,KAAK;QACL,KAAK;QACL,SAAS;QACT,KAAK;QACL,KAAK;QACL,UAAU;QACV,UAAU;KACrC,EAuDA;IAED;;;OAGG;IACH,
|
|
1
|
+
{"version":3,"file":"shine.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/effects/shine.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH;IACC;;;;;;;;;;;OAWG;IACH,sBAXW,OAAO,sBAAsB,EAAE,OAAO,YAE9C;QAA2B,KAAK;QACP,KAAK;QACL,KAAK;QACL,SAAS;QACT,KAAK;QACL,KAAK;QACL,UAAU;QACV,UAAU;KACrC,EAuDA;IAED;;;OAGG;IACH,gBAFW,MAAM,EAAE,QAIlB;IAED;;;OAGG;IACH,gBAFW,MAAM,QAIhB;IAED;;;OAGG;IACH,oBAFW,MAAM,QAIhB;IAED;;;OAGG;IACH,gBAFW,MAAM,QAIhB;CACD;yBA1IwB,oBAAoB"}
|
|
@@ -45,6 +45,17 @@ export default class GLShader {
|
|
|
45
45
|
* @readonly
|
|
46
46
|
*/
|
|
47
47
|
readonly destroyed: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* When `true`, a renderable will NOT auto-destroy this shader when it is
|
|
50
|
+
* removed from its `postEffects` (via the `shader` setter,
|
|
51
|
+
* `removePostEffect`, `clearPostEffects`) or when the renderable itself
|
|
52
|
+
* is destroyed. Set this on a shader shared across several renderables so
|
|
53
|
+
* one of them going away doesn't free the GL program still used by the
|
|
54
|
+
* others — you then own its lifecycle and call {@link destroy} yourself.
|
|
55
|
+
* @type {boolean}
|
|
56
|
+
* @default false
|
|
57
|
+
*/
|
|
58
|
+
shared: boolean;
|
|
48
59
|
/**
|
|
49
60
|
* `true` while the WebGL context is lost (and until it's
|
|
50
61
|
* restored). The GL program/attributes/uniforms are released
|
|
@@ -113,6 +124,24 @@ export default class GLShader {
|
|
|
113
124
|
* @param {number} stride - the size of a single vertex in bytes
|
|
114
125
|
*/
|
|
115
126
|
setVertexAttributes(gl: WebGLRenderingContext, attributes: object[], stride: number): void;
|
|
127
|
+
/**
|
|
128
|
+
* Create an independent copy of this shader, compiled as its own GL
|
|
129
|
+
* program from the same vertex + fragment sources (and precision), with
|
|
130
|
+
* every uniform value set so far replayed onto the copy. Use it when
|
|
131
|
+
* several renderables need the same custom shader with *different*
|
|
132
|
+
* uniform values — a single instance has a single set of uniforms.
|
|
133
|
+
*
|
|
134
|
+
* Ownership and lifecycle state do NOT carry over: the clone's
|
|
135
|
+
* {@link shared} flag is **always reset to `false`**, even when cloning
|
|
136
|
+
* a shared shader — the clone is caller-owned and will be auto-destroyed
|
|
137
|
+
* by the renderable it is assigned to, unless you explicitly set
|
|
138
|
+
* `shared = true` on it yourself. Note that `ShaderEffect` (which wraps
|
|
139
|
+
* a GLShader by composition) has its own `clone()` with the same
|
|
140
|
+
* semantics, which additionally copies its effect-level state (extra
|
|
141
|
+
* `setTexture` bindings).
|
|
142
|
+
* @returns {GLShader} a new, caller-owned shader (`shared === false`)
|
|
143
|
+
*/
|
|
144
|
+
clone(): GLShader;
|
|
116
145
|
/**
|
|
117
146
|
* destroy this shader objects resources (program, attributes, uniforms).
|
|
118
147
|
* Idempotent — calling destroy twice (or after a context-lost suspend)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glshader.d.ts","sourceRoot":"","sources":["../../../src/video/webgl/glshader.js"],"names":[],"mappings":"AAYA;;;GAGG;AACH;IACC;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,gBA1BW,qBAAqB,UACrB,MAAM,YACN,MAAM,cACN,MAAM,
|
|
1
|
+
{"version":3,"file":"glshader.d.ts","sourceRoot":"","sources":["../../../src/video/webgl/glshader.js"],"names":[],"mappings":"AAYA;;;GAGG;AACH;IACC;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,gBA1BW,qBAAqB,UACrB,MAAM,YACN,MAAM,cACN,MAAM,EAqFhB;IA7DA;;;OAGG;IACH,IAFU,qBAAqB,CAEnB;IAEZ;;;;;;;OAOG;IACH,oBAHU,OAAO,CAGK;IAEtB;;;;;;;;;OASG;IACH,QAHU,OAAO,CAGE;IAEnB;;;;;;;;;;OAUG;IACH,oBAHU,OAAO,CAGK;IAGtB,sBAA2B;IAC3B,wBAA+B;IAC/B,+BAA2B;IAG3B,mBAAwC;IAKvC,sBAAmB;IACnB,iBAAoB;IACpB,qBAAsB;IASxB;;;;;;OAMG;IACH,iBA0CC;IAzCA,YAGC;IACD,cAGC;IAoCF;;;;;OAKG;IACH,uBAgBC;IAED;;;;;OAKG;IACH,2BAMC;IAED;;OAEG;IACH,aAKC;IAED;;;;OAIG;IACH,wBAHW,MAAM,GACJ,KAAK,CAYjB;IAED;;;;;;OAMG;IACH,iBALW,MAAM,SACN,MAAM,GAAC,YAAY,QA0C7B;IAED;;;;;OAKG;IACH,wBAJW,qBAAqB,cACrB,MAAM,EAAE,UACR,MAAM,QAmBhB;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,SAFa,QAAQ,CAyBpB;IAED;;;;;OAKG;IACH,gBA2BC;CACD"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Light3d } from "../../../lighting/light3d.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Uniform-ready packing of the active 3D lights for the mesh-lit shader.
|
|
4
|
+
* @ignore
|
|
5
|
+
*/
|
|
6
|
+
export interface PackedMeshLighting {
|
|
7
|
+
/** number of active directional lights, clamped to `MAX_LIGHTS`. */
|
|
8
|
+
count: number;
|
|
9
|
+
/** `MAX_LIGHTS × 3` surface→light directions (already negated, normalized). */
|
|
10
|
+
directions: Float32Array;
|
|
11
|
+
/** `MAX_LIGHTS × 3` directional light colors premultiplied by intensity. */
|
|
12
|
+
colors: Float32Array;
|
|
13
|
+
/** the summed ambient color (RGB, 0..1+). */
|
|
14
|
+
ambient: Float32Array;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Pack an iterable of {@link Light3d} (e.g. the active `Stage`'s 3D-light set)
|
|
18
|
+
* into the uniform arrays the mesh-lit shader reads:
|
|
19
|
+
* - **directional** lights contribute a surface→light direction (negated travel
|
|
20
|
+
* direction, normalized) + a color premultiplied by intensity, up to
|
|
21
|
+
* `MAX_LIGHTS`. Re-normalized here so a direction mutated at runtime without
|
|
22
|
+
* re-normalizing still shades correctly.
|
|
23
|
+
* - **ambient** lights are summed into a single flat ambient color.
|
|
24
|
+
*
|
|
25
|
+
* Other types (`"point"`) are skipped — not shaded yet. The same buffers are
|
|
26
|
+
* returned each call (overwritten in place).
|
|
27
|
+
* @param lights - iterable of lights, or `null`/`undefined` (treated as empty)
|
|
28
|
+
* @returns the packed lighting (reused instance)
|
|
29
|
+
* @ignore
|
|
30
|
+
*/
|
|
31
|
+
export declare function packMeshLights(lights: Iterable<Light3d> | null | undefined): PackedMeshLighting;
|
|
32
|
+
//# sourceMappingURL=pack3d.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pack3d.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/lighting/pack3d.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAG5D;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IAClC,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,UAAU,EAAE,YAAY,CAAC;IACzB,4EAA4E;IAC5E,MAAM,EAAE,YAAY,CAAC;IACrB,6CAA6C;IAC7C,OAAO,EAAE,YAAY,CAAC;CACtB;AAcD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAC7B,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,GAC1C,kBAAkB,CAuCpB"}
|
|
@@ -24,6 +24,23 @@
|
|
|
24
24
|
* mySprite.shader = pulse;
|
|
25
25
|
* // update the uniform each frame
|
|
26
26
|
* pulse.setUniform("uTime", time);
|
|
27
|
+
* @example
|
|
28
|
+
* // Shader builtins — no JS plumbing, no UV math:
|
|
29
|
+
* // `: screen_texture` keeps the sampler filled with everything drawn so
|
|
30
|
+
* // far (a back-buffer copy; one screen copy per draw of the effect),
|
|
31
|
+
* // `screen_uv` is this fragment's 0..1 screen position, and `noise_uv`
|
|
32
|
+
* // runs 0..1 across the sprite regardless of its atlas frame.
|
|
33
|
+
* const water = new ShaderEffect(renderer, `
|
|
34
|
+
* uniform sampler2D uNoise;
|
|
35
|
+
* uniform sampler2D screenTex : screen_texture;
|
|
36
|
+
* uniform float uTime;
|
|
37
|
+
* vec4 apply(vec4 color, vec2 uv) {
|
|
38
|
+
* vec2 flow = texture2D(uNoise, noise_uv + uTime * 0.25).rg;
|
|
39
|
+
* vec4 refracted = texture2D(screenTex, screen_uv + flow * 0.005);
|
|
40
|
+
* return refracted * texture2D(uSampler, uv + flow * 0.005);
|
|
41
|
+
* }
|
|
42
|
+
* `);
|
|
43
|
+
* water.setTexture("uNoise", noiseTexture.getTexture(), "repeat");
|
|
27
44
|
*/
|
|
28
45
|
export default class ShaderEffect {
|
|
29
46
|
/**
|
|
@@ -51,8 +68,56 @@ export default class ShaderEffect {
|
|
|
51
68
|
* @readonly
|
|
52
69
|
*/
|
|
53
70
|
readonly destroyed: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* When `true`, a renderable will NOT auto-destroy this effect when it is
|
|
73
|
+
* removed from its `postEffects` (via the `shader` setter,
|
|
74
|
+
* {@link Renderable#removePostEffect}, {@link Renderable#clearPostEffects})
|
|
75
|
+
* or when the renderable itself is destroyed. Set this on an effect shared
|
|
76
|
+
* across several renderables so one of them going away doesn't free the GL
|
|
77
|
+
* program still used by the others — you then own its lifecycle and call
|
|
78
|
+
* {@link destroy} yourself.
|
|
79
|
+
* @type {boolean}
|
|
80
|
+
* @default false
|
|
81
|
+
*/
|
|
82
|
+
shared: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* the renderer this effect was created for — kept so destroy and
|
|
85
|
+
* context-loss can release the texture units reserved on its cache
|
|
86
|
+
* for extra samplers ({@link setTexture}), and so {@link clone} can
|
|
87
|
+
* compile an independent copy
|
|
88
|
+
* @ignore
|
|
89
|
+
*/
|
|
90
|
+
_renderer: any;
|
|
91
|
+
/**
|
|
92
|
+
* the construction "recipe" (fragment body + precision), kept so
|
|
93
|
+
* {@link clone} can compile an independent copy. Stored before the
|
|
94
|
+
* Canvas-mode early return so cloning behaves consistently there too.
|
|
95
|
+
* @ignore
|
|
96
|
+
*/
|
|
97
|
+
_fragmentBody: string;
|
|
98
|
+
/** @ignore */
|
|
99
|
+
_precision: string | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* samplers annotated `: screen_texture` — the renderer checks this to
|
|
102
|
+
* know when to refresh the shared frame capture before the effect draws
|
|
103
|
+
* @type {Array<{name: string, repeat: string}>}
|
|
104
|
+
* @ignore
|
|
105
|
+
*/
|
|
106
|
+
_screenTextureUniforms: Array<{
|
|
107
|
+
name: string;
|
|
108
|
+
repeat: string;
|
|
109
|
+
}>;
|
|
110
|
+
/** @ignore */
|
|
111
|
+
_hasNoiseUV: boolean | undefined;
|
|
54
112
|
/** @ignore */
|
|
55
113
|
_shader: GLShader | undefined;
|
|
114
|
+
/**
|
|
115
|
+
* extra texture samplers bound via {@link setTexture}, keyed by the
|
|
116
|
+
* uniform name → `{ image, repeat, tex }` (`tex` is the uploaded GL
|
|
117
|
+
* texture, created lazily on first draw)
|
|
118
|
+
* @ignore
|
|
119
|
+
*/
|
|
120
|
+
_extraTextures: Map<any, any> | undefined;
|
|
56
121
|
/** @private */
|
|
57
122
|
private _onContextLost;
|
|
58
123
|
_enabledBeforeSuspend: boolean | undefined;
|
|
@@ -64,6 +129,123 @@ export default class ShaderEffect {
|
|
|
64
129
|
* @param {object|Float32Array} value - the value to assign to that uniform
|
|
65
130
|
*/
|
|
66
131
|
setUniform(name: string, value: object | Float32Array): void;
|
|
132
|
+
/**
|
|
133
|
+
* Set the shader's `uTime` uniform (elapsed time, in seconds). A convenience
|
|
134
|
+
* over `setUniform("uTime", ...)`; call it once per frame from your update
|
|
135
|
+
* loop to animate a shader that declares `uniform float uTime` (e.g. scrolling
|
|
136
|
+
* a static noise texture's UVs, pulsing, waving). Drive it with whatever clock
|
|
137
|
+
* you like — real time, a paused/scaled/scrubbed one.
|
|
138
|
+
*
|
|
139
|
+
* No-op if the shader does not declare a `uTime` uniform (nothing to update),
|
|
140
|
+
* or in Canvas mode. The engine does NOT call this for you — animation is
|
|
141
|
+
* opt-in, exactly like re-baking a {@link NoiseTexture2d} with `update(dt)`.
|
|
142
|
+
* @param {number} seconds - elapsed time in seconds
|
|
143
|
+
* @returns {ShaderEffect} this effect for chaining
|
|
144
|
+
* @example
|
|
145
|
+
* // a shader that scrolls a static seamless noise texture over time
|
|
146
|
+
* const flow = new me.ShaderEffect(renderer, `
|
|
147
|
+
* uniform float uTime;
|
|
148
|
+
* vec4 apply(vec4 color, vec2 uv) {
|
|
149
|
+
* return texture2D(uSampler, uv + vec2(uTime * 0.05, 0.0));
|
|
150
|
+
* }`);
|
|
151
|
+
* mySprite.shader = flow;
|
|
152
|
+
* // then in your Stage's update(dt):
|
|
153
|
+
* flow.setTime(me.timer.getTime() / 1000);
|
|
154
|
+
*/
|
|
155
|
+
setTime(seconds: number): ShaderEffect;
|
|
156
|
+
/**
|
|
157
|
+
* Feed the `noise_uv` builtin's frame rect for the object about to draw:
|
|
158
|
+
* the source texture dimensions, the destination (object) dimensions, and
|
|
159
|
+
* the frame's top-left UV origin. Called by the quad batchers per draw;
|
|
160
|
+
* a no-op unless this effect's fragment actually uses `noise_uv` (the
|
|
161
|
+
* `ME_*` uniforms only exist — and are only active — then).
|
|
162
|
+
* @param {number} sourceWidth - source texture width in pixels
|
|
163
|
+
* @param {number} sourceHeight - source texture height in pixels
|
|
164
|
+
* @param {number} objectWidth - destination (object) width in pixels
|
|
165
|
+
* @param {number} objectHeight - destination (object) height in pixels
|
|
166
|
+
* @param {number} u0 - the frame's left UV coordinate (flip-normalized)
|
|
167
|
+
* @param {number} v0 - the frame's top UV coordinate (flip-normalized)
|
|
168
|
+
* @ignore
|
|
169
|
+
*/
|
|
170
|
+
_setNoiseUVRect(sourceWidth: number, sourceHeight: number, objectWidth: number, objectHeight: number, u0: number, v0: number): void;
|
|
171
|
+
/**
|
|
172
|
+
* Apply the wrap mode a `: screen_texture(<repeat>)` annotation asked for
|
|
173
|
+
* onto the live capture handle. Captures are NPOT (canvas-sized), which
|
|
174
|
+
* WebGL 1 cannot repeat — warn once and keep the clamp there. The unit is
|
|
175
|
+
* force-activated first: the batcher's bind may have been skipped as
|
|
176
|
+
* redundant while the GL active unit points elsewhere.
|
|
177
|
+
* @ignore
|
|
178
|
+
*/
|
|
179
|
+
_applyCaptureWrap(batcher: any, glTex: any, entry: any): void;
|
|
180
|
+
_captureWrapWarned: boolean | undefined;
|
|
181
|
+
/**
|
|
182
|
+
* Bind an **extra** texture to a named `sampler2D` uniform in this shader, so
|
|
183
|
+
* a custom effect can read a *second* texture — a noise map, mask, gradient,
|
|
184
|
+
* flow/lookup table — besides the sprite/target it post-processes (`uSampler`).
|
|
185
|
+
* The engine uploads, caches, and re-binds it to a reserved texture unit each
|
|
186
|
+
* time the effect draws, and points the sampler uniform at it — no raw WebGL
|
|
187
|
+
* texture-unit juggling.
|
|
188
|
+
*
|
|
189
|
+
* Declare the sampler in your fragment (`uniform sampler2D <name>;`) and pass
|
|
190
|
+
* that name here. Any engine texture works — a {@link Texture2d} asset
|
|
191
|
+
* (`NoiseTexture2d`, `TextureAtlas`, …) can be passed directly, or a raw
|
|
192
|
+
* drawable source. No-op in Canvas mode.
|
|
193
|
+
* @param {string} name - the `sampler2D` uniform name declared in the fragment
|
|
194
|
+
* @param {Texture2d|HTMLImageElement|HTMLCanvasElement|OffscreenCanvas|ImageBitmap} image - the texture: an engine texture asset, or a raw drawable source
|
|
195
|
+
* @param {"repeat"|"repeat-x"|"repeat-y"|"no-repeat"} [repeat="no-repeat"] - wrap mode; use `"repeat"` for a tiled/scrolled texture (power-of-two size under WebGL 1)
|
|
196
|
+
* @returns {ShaderEffect} this effect for chaining
|
|
197
|
+
* @example
|
|
198
|
+
* // "water": distort the sprite by a static noise texture scrolled over time
|
|
199
|
+
* const noise = new me.NoiseTexture2d({ width: 256, height: 256, seamless: true });
|
|
200
|
+
* const water = new me.ShaderEffect(renderer, `
|
|
201
|
+
* uniform sampler2D uNoise;
|
|
202
|
+
* uniform float uTime;
|
|
203
|
+
* vec4 apply(vec4 color, vec2 uv) {
|
|
204
|
+
* vec2 flow = texture2D(uNoise, uv + uTime * 0.03).rg - 0.5;
|
|
205
|
+
* return texture2D(uSampler, uv + flow * 0.02);
|
|
206
|
+
* }`);
|
|
207
|
+
* water.setTexture("uNoise", noise, "repeat");
|
|
208
|
+
* waterSprite.shader = water;
|
|
209
|
+
* // each frame, in your Stage's update(dt):
|
|
210
|
+
* water.setTime(me.timer.getTime() / 1000);
|
|
211
|
+
*/
|
|
212
|
+
setTexture(name: string, image: Texture2d | HTMLImageElement | HTMLCanvasElement | OffscreenCanvas | ImageBitmap, repeat?: "repeat" | "repeat-x" | "repeat-y" | "no-repeat"): ShaderEffect;
|
|
213
|
+
/**
|
|
214
|
+
* (Re)bind this effect's extra textures ({@link setTexture}) to reserved GL
|
|
215
|
+
* texture units and point their sampler uniforms at them. Called by the
|
|
216
|
+
* renderer right after this effect's shader is bound — for both the
|
|
217
|
+
* post-effect blit and the single-effect `customShader` sprite path — so the
|
|
218
|
+
* bindings survive the batcher's rotating color-texture pool.
|
|
219
|
+
* @param {object} batcher - the active batcher (owns the GL texture units)
|
|
220
|
+
* @ignore
|
|
221
|
+
*/
|
|
222
|
+
_prepareTextures(batcher: object): void;
|
|
223
|
+
_textureOverflowWarned: boolean | undefined;
|
|
224
|
+
/**
|
|
225
|
+
* Create an independent copy of this effect, compiled as its own GL
|
|
226
|
+
* program. Use it when several renderables need the same effect with
|
|
227
|
+
* *different* uniform values — a single instance has a single set of
|
|
228
|
+
* uniforms, shared by everything it is assigned to.
|
|
229
|
+
*
|
|
230
|
+
* The clone copies the **recipe**: the fragment source, float precision,
|
|
231
|
+
* every uniform value set so far, and any extra textures bound via
|
|
232
|
+
* {@link setTexture} (the clone uploads and owns its own GL copies).
|
|
233
|
+
* It does NOT copy **ownership or lifecycle** state — in particular the
|
|
234
|
+
* clone's {@link shared} flag is **always reset to `false`**, even when
|
|
235
|
+
* cloning a shared shader (such as one returned by `loader.getShader()`):
|
|
236
|
+
* the clone is caller-owned and will be auto-destroyed by the renderable
|
|
237
|
+
* it is assigned to, exactly like a hand-constructed effect. Set
|
|
238
|
+
* `shared = true` on the clone yourself if you intend to reuse it across
|
|
239
|
+
* several renderables.
|
|
240
|
+
* @returns {ShaderEffect} a new, caller-owned effect (`shared === false`)
|
|
241
|
+
* @example
|
|
242
|
+
* // the loader's shader is ONE shared program — one uniform state for all
|
|
243
|
+
* sprite.shader = loader.getShader("flash");
|
|
244
|
+
* // the boss needs its own intensity — clone a private, caller-owned copy
|
|
245
|
+
* boss.shader = loader.getShader("flash").clone();
|
|
246
|
+
* boss.shader.setUniform("uIntensity", 0.9);
|
|
247
|
+
*/
|
|
248
|
+
clone(): ShaderEffect;
|
|
67
249
|
/** @ignore */
|
|
68
250
|
bind(): void;
|
|
69
251
|
/** @ignore */
|
|
@@ -88,4 +270,5 @@ export default class ShaderEffect {
|
|
|
88
270
|
destroy(): void;
|
|
89
271
|
}
|
|
90
272
|
import GLShader from "./glshader.js";
|
|
273
|
+
import Texture2d from "../texture/texture2d.ts";
|
|
91
274
|
//# sourceMappingURL=shadereffect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shadereffect.d.ts","sourceRoot":"","sources":["../../../src/video/webgl/shadereffect.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shadereffect.d.ts","sourceRoot":"","sources":["../../../src/video/webgl/shadereffect.js"],"names":[],"mappings":"AAoHA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH;IAiCC;;;;;;OAMG;IACH,sBANW,aAAa,GAAC,cAAc,gBAC5B,MAAM,cAGN,MAAM,EAyFhB;IA9HD;;;;;;OAMG;IACH,SAFU,OAAO,CAED;IAEhB;;;;;;;OAOG;IACH,oBAHU,OAAO,CAGC;IAElB;;;;;;;;;;OAUG;IACH,QAHU,OAAO,CAGF;IAUd;;;;;;OAMG;IACH,eAAyB;IAEzB;;;;;OAKG;IACH,sBAAiC;IACjC,cAAc;IACd,+BAA2B;IAc3B;;;;;OAKG;IACH,wBAHU,KAAK,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,CAAC,CAGM;IACrD,cAAc;IACd,iCAAmC;IAgBnC,cAAc;IACd,8BAKC;IAGD;;;;;OAKG;IACH,0CAA+B;IAkBhC,eAAe;IACf,uBAkBC;IAbA,2CAAyC;IAe1C,eAAe;IACf,2BAQC;IAED;;;;OAIG;IACH,iBAHW,MAAM,SACN,MAAM,GAAC,YAAY,QAY7B;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,iBAbW,MAAM,GACJ,YAAY,CA+BxB;IAED;;;;;;;;;;;;;OAaG;IACH,6BARW,MAAM,gBACN,MAAM,eACN,MAAM,gBACN,MAAM,MACN,MAAM,MACN,MAAM,QAyChB;IAED;;;;;;;OAOG;IACH,8DAwBC;IApBE,wCAA8B;IAsBjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,iBAnBW,MAAM,SACN,SAAS,GAAC,gBAAgB,GAAC,iBAAiB,GAAC,eAAe,GAAC,WAAW,WACxE,QAAQ,GAAC,UAAU,GAAC,UAAU,GAAC,WAAW,GACxC,YAAY,CA8DxB;IAED;;;;;;;;OAQG;IACH,0BAHW,MAAM,QAuFhB;IA3DI,4CAAkC;IA6DvC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,SARa,YAAY,CA0CxB;IAED,cAAc;IACd,aAIC;IAED,cAAc;IACd,qCAEC;IAED,cAAc;IACd,iEAIC;IAED,cAAc;IACd,mCAEC;IAED,cAAc;IACd,kBAEC;IAED,cAAc;IACd,oBAEC;IAED,cAAc;IACd,qBAEC;IAED,cAAc;IACd,uBAEC;IAED;;;;OAIG;IACH,gBA4BC;CACD;qBAvwBoB,eAAe;sBADd,yBAAyB"}
|
|
@@ -21,7 +21,8 @@ export default class WebGLRenderer extends Renderer {
|
|
|
21
21
|
* @type {Matrix3d}
|
|
22
22
|
* @ignore
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
_effectProjectionStack: Matrix3d;
|
|
25
|
+
_effectPassDepth: number;
|
|
25
26
|
/**
|
|
26
27
|
* sets or returns the shape used to join two line segments where they meet.
|
|
27
28
|
* Out of the three possible values for this property: "round", "bevel", and "miter", only "round" is supported for now in WebGL
|
|
@@ -57,6 +58,7 @@ export default class WebGLRenderer extends Renderer {
|
|
|
57
58
|
_clipAABB: Bounds;
|
|
58
59
|
_polyVerts: any[];
|
|
59
60
|
_currentGradient: any;
|
|
61
|
+
_maskVisibleRef: number;
|
|
60
62
|
/**
|
|
61
63
|
* The current transformation matrix used for transformations on the overall scene
|
|
62
64
|
* (alias to renderState.currentTransform for backward compatibility)
|
|
@@ -73,6 +75,15 @@ export default class WebGLRenderer extends Renderer {
|
|
|
73
75
|
* @type {WebGLProgram}
|
|
74
76
|
*/
|
|
75
77
|
currentProgram: WebGLProgram;
|
|
78
|
+
/**
|
|
79
|
+
* the GL texture unit currently active (`gl.activeTexture`) — global
|
|
80
|
+
* GL state, so tracked once per renderer and shared by every batcher
|
|
81
|
+
* through the `MaterialBatcher.currentTextureUnit` accessor. `-1`
|
|
82
|
+
* forces the next bind to re-issue `gl.activeTexture`.
|
|
83
|
+
* @type {number}
|
|
84
|
+
* @ignore
|
|
85
|
+
*/
|
|
86
|
+
_activeTextureUnit: number;
|
|
76
87
|
/**
|
|
77
88
|
* The list of active batchers
|
|
78
89
|
* @type {Map<Batcher>}
|
|
@@ -88,6 +99,7 @@ export default class WebGLRenderer extends Renderer {
|
|
|
88
99
|
get WebGLVersion(): number;
|
|
89
100
|
_lightShader: RadialGradientEffect | undefined;
|
|
90
101
|
_lightAtlas: TextureAtlas | undefined;
|
|
102
|
+
_frameTexture: FrameTexture | undefined;
|
|
91
103
|
_orthogonalTMXGPURenderer: OrthogonalTMXLayerGPURenderer | null | undefined;
|
|
92
104
|
/**
|
|
93
105
|
* Draw a TMX tile layer through whichever path the layer's `renderMode`
|
|
@@ -149,6 +161,32 @@ export default class WebGLRenderer extends Renderer {
|
|
|
149
161
|
* @ignore
|
|
150
162
|
*/
|
|
151
163
|
_getLightAtlas(): TextureAtlas;
|
|
164
|
+
/**
|
|
165
|
+
* The renderer-owned shared frame-capture slot, minted lazily so it has a
|
|
166
|
+
* stable identity from the moment an effect is constructed — before the
|
|
167
|
+
* first actual capture fills it (`glTexture` stays `null` until then, and
|
|
168
|
+
* the live-sampler bind path skips unfilled captures). `ShaderEffect`
|
|
169
|
+
* wires `: screen_texture` annotated samplers to this object.
|
|
170
|
+
* @returns {FrameTexture} the shared capture slot
|
|
171
|
+
* @ignore
|
|
172
|
+
*/
|
|
173
|
+
getSharedFrameTexture(): FrameTexture;
|
|
174
|
+
/**
|
|
175
|
+
* Forget the cached binding for GL texture `unit` on every batcher (except
|
|
176
|
+
* `except`). Call this whenever a texture is bound to a unit **directly** —
|
|
177
|
+
* bypassing the shared texture cache and its `GPU_TEXTURE_CACHE_RESET`
|
|
178
|
+
* coordination — as {@link WebGLRenderer#toFrameTexture}'s capture copy and
|
|
179
|
+
* {@link ShaderEffect#_prepareTextures}'s reserved extra samplers both do.
|
|
180
|
+
* Those binds land on the TOP of the unit range, which overlaps the lit quad
|
|
181
|
+
* batcher's normal-map units; without invalidation a later lit draw would
|
|
182
|
+
* assume its normal map is still resident there and skip re-binding it,
|
|
183
|
+
* sampling the directly-bound texture as a normal map (wrong lighting).
|
|
184
|
+
* @param {number} unit - the GL texture unit that was clobbered
|
|
185
|
+
* @param {Batcher} [except] - a batcher to skip (the one that just bound the
|
|
186
|
+
* texture — its own cache is already accurate)
|
|
187
|
+
* @ignore
|
|
188
|
+
*/
|
|
189
|
+
invalidateTextureUnit(unit: number, except?: Batcher): void;
|
|
152
190
|
/** @ignore */
|
|
153
191
|
endPostEffect(renderable: any): void;
|
|
154
192
|
/**
|
|
@@ -316,6 +354,24 @@ export default class WebGLRenderer extends Renderer {
|
|
|
316
354
|
*/
|
|
317
355
|
setBlendMode(mode?: string, premultipliedAlpha?: boolean): string;
|
|
318
356
|
currentPremultipliedAlpha: any;
|
|
357
|
+
/**
|
|
358
|
+
* Map the backend-neutral default filter mode
|
|
359
|
+
* ({@link Renderer#getDefaultTextureFilter}) to the GL enum
|
|
360
|
+
* (`gl.LINEAR` / `gl.NEAREST`) used for textures that don't carry their own
|
|
361
|
+
* `texture.filter`. The neutral resolver lives on the base renderer so a
|
|
362
|
+
* future WebGPU backend reuses it and maps to `GPUFilterMode` instead.
|
|
363
|
+
* @returns {number} `gl.LINEAR` or `gl.NEAREST`
|
|
364
|
+
* @ignore
|
|
365
|
+
*/
|
|
366
|
+
_glTextureFilter(): number;
|
|
367
|
+
/**
|
|
368
|
+
* Re-apply a min/mag filter to every currently-bound texture across all
|
|
369
|
+
* batchers (see https://github.com/melonjs/melonJS/issues/1279). Shared by
|
|
370
|
+
* {@link WebGLRenderer#setAntiAlias} and {@link WebGLRenderer#setTextureFilter}.
|
|
371
|
+
* @param {number} filter - `gl.LINEAR` or `gl.NEAREST`
|
|
372
|
+
* @ignore
|
|
373
|
+
*/
|
|
374
|
+
_reapplyTextureFilter(filter: number): void;
|
|
319
375
|
/**
|
|
320
376
|
* Return the global alpha
|
|
321
377
|
* @returns {number} global alpha value
|
|
@@ -435,6 +491,7 @@ export default class WebGLRenderer extends Renderer {
|
|
|
435
491
|
* @param {boolean} [invert=false] - either the given shape should define what is visible (default) or the opposite
|
|
436
492
|
*/
|
|
437
493
|
setMask(mask?: Rect | RoundRect | Polygon | Line | Ellipse, invert?: boolean): void;
|
|
494
|
+
_maskDepthWarned: boolean | undefined;
|
|
438
495
|
#private;
|
|
439
496
|
}
|
|
440
497
|
import Renderer from "./../renderer.js";
|
|
@@ -444,6 +501,7 @@ import type { Batcher } from "./batchers/batcher.js";
|
|
|
444
501
|
import TextureCache from "./../texture/cache.js";
|
|
445
502
|
import RadialGradientEffect from "./effects/radialGradient.js";
|
|
446
503
|
import { TextureAtlas } from "./../texture/atlas.js";
|
|
504
|
+
import { FrameTexture } from "./../texture/frametexture.js";
|
|
447
505
|
import OrthogonalTMXLayerGPURenderer from "./renderers/tmxlayer/orthogonal.js";
|
|
448
506
|
import { Color } from "./../../math/color.ts";
|
|
449
507
|
import type { Rect } from "./../../geometries/rectangle.ts";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgl_renderer.d.ts","sourceRoot":"","sources":["../../../src/video/webgl/webgl_renderer.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"webgl_renderer.d.ts","sourceRoot":"","sources":["../../../src/video/webgl/webgl_renderer.js"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "melonjs",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.9.0",
|
|
4
4
|
"description": "melonJS Game Engine",
|
|
5
5
|
"homepage": "http://www.melonjs.org/",
|
|
6
6
|
"type": "module",
|
|
@@ -59,16 +59,16 @@
|
|
|
59
59
|
"howler": "2.2.4"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@types/howler": "^2.2.
|
|
62
|
+
"@types/howler": "^2.2.13",
|
|
63
63
|
"@types/node": "^25.6.0",
|
|
64
64
|
"concurrently": "^9.2.1",
|
|
65
65
|
"del-cli": "^7.0.0",
|
|
66
66
|
"esbuild": "^0.27.3",
|
|
67
67
|
"serve": "^14.2.6",
|
|
68
68
|
"tsconfig": "workspace:^",
|
|
69
|
-
"tsx": "^4.
|
|
70
|
-
"type-fest": "^5.
|
|
71
|
-
"typedoc": "^0.28.
|
|
69
|
+
"tsx": "^4.23.0",
|
|
70
|
+
"type-fest": "^5.8.0",
|
|
71
|
+
"typedoc": "^0.28.20",
|
|
72
72
|
"typescript": "^6.0.2",
|
|
73
73
|
"vite": "8.0.16",
|
|
74
74
|
"vite-plugin-glsl": "^1.6.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"light2d.d.ts","sourceRoot":"","sources":["../../src/renderable/light2d.js"],"names":[],"mappings":"AAKA;;;;;GAKG;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;IACC;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,eAPW,MAAM,KACN,MAAM,WACN,MAAM,YACN,MAAM,UACN,KAAK,GAAC,MAAM,cACZ,MAAM,EAiGhB;IAlFA;;;;OAIG;IACH,OAHU,KAAK,CAG6B;IAE5C;;;OAGG;IACH,SAFU,MAAM,CAEM;IAEtB;;;OAGG;IACH,SAFU,MAAM,CAEM;IAEtB;;;;OAIG;IACH,WAHU,MAAM,CAGU;IAa1B,cAAc;IACd,qBAKC;IAKD;;;;;;;;;;;;;OAaG;IACH,kBAHU,OAAO,CAGY;IAE7B;;;;;;;;;;;;;;;;OAgBG;IACH,aAFU,MAAM,CAEqC;IAiCtD;;;;;;;;;;;;;;;;OAgBG;IACH,kBAHW,MAAM,YACN,MAAM,QAMhB;IAED;;;;;OAKG;IACH,kBAFa,OAAO,CAOnB;IAED;;;OAGG;IACH,UAFa,OAAO,CAInB;IAED;;;OAGG;IACH,kBAFW,QAAQ,QAKlB;IAED;;;;;;;;OAQG;IACH,eAFW,QAAQ,QAOlB;IAED;;;;;;OAMG;IACH,wBAKC;IAED;;;;OAIG;IACH,0BAKC;IAED;;;OAGG;IACH,gBAQC;CACD;uBArSsB,iBAAiB;2BAIhB,oBAAoB;6BAClB,4BAA4B;0BAC7B,wBAAwB"}
|