@woosh/meep-engine 2.131.14 → 2.131.17
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/package.json +1 -1
- package/src/core/codegen/LineBuilder.d.ts +4 -2
- package/src/core/codegen/LineBuilder.d.ts.map +1 -1
- package/src/core/codegen/LineBuilder.js +5 -2
- package/src/core/color/YCbCr/YCbCr_to_rgb_uint24.d.ts +6 -5
- package/src/core/color/YCbCr/YCbCr_to_rgb_uint24.d.ts.map +1 -1
- package/src/core/color/YCbCr/YCbCr_to_rgb_uint24.js +19 -13
- package/src/core/color/YCbCr/rgb_to_YCbCr_uint24.d.ts +6 -5
- package/src/core/color/YCbCr/rgb_to_YCbCr_uint24.d.ts.map +1 -1
- package/src/core/color/YCbCr/rgb_to_YCbCr_uint24.js +18 -10
- package/src/core/color/illuminant/D65_spd_analytical.d.ts.map +1 -1
- package/src/core/color/illuminant/D65_spd_analytical.js +1 -25
- package/src/core/color/illuminant/planckian_radiance.d.ts +8 -0
- package/src/core/color/illuminant/planckian_radiance.d.ts.map +1 -0
- package/src/core/color/illuminant/planckian_radiance.js +41 -0
- package/src/core/color/kelvin/kelvin_to_rgb.d.ts +11 -4
- package/src/core/color/kelvin/kelvin_to_rgb.d.ts.map +1 -1
- package/src/core/color/kelvin/kelvin_to_rgb.js +134 -30
- package/src/core/color/kelvin/rgb_to_kelvin.d.ts +4 -1
- package/src/core/color/kelvin/rgb_to_kelvin.d.ts.map +1 -1
- package/src/core/color/kelvin/rgb_to_kelvin.js +34 -9
- package/src/core/color/rgb_to_luminance.d.ts +7 -4
- package/src/core/color/rgb_to_luminance.d.ts.map +1 -1
- package/src/core/color/rgb_to_luminance.js +8 -5
- package/src/core/color/sRGB/linear_to_sRGB.d.ts +6 -1
- package/src/core/color/sRGB/linear_to_sRGB.d.ts.map +1 -1
- package/src/core/color/sRGB/linear_to_sRGB.js +5 -0
- package/src/core/color/sRGB/sRGB_to_linear.d.ts +3 -2
- package/src/core/color/sRGB/sRGB_to_linear.d.ts.map +1 -1
- package/src/core/color/sRGB/sRGB_to_linear.js +2 -1
- package/src/core/color/xyz/xyz_cmf_tabulated.d.ts.map +1 -1
- package/src/core/color/xyz/xyz_cmf_tabulated.js +174 -175
- package/src/core/math/frexp.d.ts.map +1 -1
- package/src/core/math/frexp.js +1 -0
- package/src/core/model/node-graph/visual/NodeDescriptionVisualRegistry.d.ts.map +1 -1
- package/src/core/model/node-graph/visual/NodeDescriptionVisualRegistry.js +5 -7
- package/src/core/model/node-graph/visual/NodeGraphVisualData.d.ts.map +1 -1
- package/src/core/model/node-graph/visual/NodeGraphVisualData.js +10 -12
- package/src/core/model/node-graph/visual/NodeVisualData.d.ts.map +1 -1
- package/src/core/model/node-graph/visual/NodeVisualData.js +16 -17
- package/src/core/model/node-graph/visual/PortVisualData.d.ts.map +1 -1
- package/src/core/model/node-graph/visual/PortVisualData.js +7 -9
- package/src/core/model/node-graph/visual/layout/BoxLayoutSpec.d.ts +2 -1
- package/src/core/model/node-graph/visual/layout/BoxLayoutSpec.d.ts.map +1 -1
- package/src/core/model/node-graph/visual/layout/BoxLayoutSpec.js +14 -14
- package/src/core/model/node-graph/visual/layout/ConnectedBoxLayouter.d.ts.map +1 -1
- package/src/core/model/node-graph/visual/layout/ConnectedBoxLayouter.js +21 -23
- package/src/core/model/node-graph/visual/layout/ConnectionEndpointLayoutSpec.d.ts.map +1 -1
- package/src/core/model/node-graph/visual/layout/ConnectionEndpointLayoutSpec.js +10 -12
- package/src/core/model/node-graph/visual/layout/ConnectionLayoutSpec.d.ts.map +1 -1
- package/src/core/model/node-graph/visual/layout/ConnectionLayoutSpec.js +10 -14
- package/src/engine/ecs/storage/BinaryBufferDeSerializer.js +1 -1
- package/src/engine/graphics/particles/node-based/codegen/CodeContext.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/codegen/CodeContext.js +7 -10
- package/src/engine/graphics/particles/node-based/codegen/modules/FunctionModule.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/codegen/modules/FunctionModule.js +30 -32
- package/src/engine/graphics/particles/node-based/codegen/modules/FunctionModuleReference.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/codegen/modules/FunctionModuleReference.js +10 -12
- package/src/engine/graphics/particles/node-based/codegen/modules/FunctionModuleRegistry.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/codegen/modules/FunctionModuleRegistry.js +5 -8
- package/src/engine/graphics/particles/node-based/codegen/modules/FunctionParameterSpecification.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/codegen/modules/FunctionParameterSpecification.js +10 -12
- package/src/engine/graphics/particles/node-based/codegen/modules/FunctionSignature.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/codegen/modules/FunctionSignature.js +11 -13
- package/src/engine/graphics/particles/node-based/particle/ParticleAttributeBinding.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/particle/ParticleAttributeBinding.js +12 -12
- package/src/engine/graphics/particles/node-based/particle/ParticleAttributeSpecification.d.ts +8 -18
- package/src/engine/graphics/particles/node-based/particle/ParticleAttributeSpecification.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/particle/ParticleAttributeSpecification.js +9 -11
- package/src/engine/graphics/particles/node-based/particle/ParticleSpecification.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/particle/ParticleSpecification.js +34 -36
- package/src/engine/graphics/particles/node-based/rendering/ParticleRenderCommand.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/rendering/ParticleRenderCommand.js +10 -12
- package/src/engine/graphics/particles/node-based/rendering/ParticleRenderSpecification.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/rendering/ParticleRenderSpecification.js +6 -8
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleLayer.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleLayer.js +123 -124
- package/src/engine/graphics/particles/particular/engine/parameter/ParameterLookupTable.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/parameter/ParameterLookupTable.js +32 -30
- package/src/engine/graphics/particles/particular/engine/parameter/ParameterTrack.d.ts +7 -1
- package/src/engine/graphics/particles/particular/engine/parameter/ParameterTrack.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/parameter/ParameterTrack.js +6 -6
- package/src/engine/graphics/particles/particular/engine/parameter/ParameterTrackSet.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/parameter/ParameterTrackSet.js +5 -9
- package/src/engine/graphics/particles/particular/engine/parameter/ParticleParameter.d.ts +10 -10
- package/src/engine/graphics/particles/particular/engine/parameter/ParticleParameter.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/parameter/ParticleParameter.js +36 -29
- package/src/engine/graphics/particles/particular/engine/shader/MaterialRecord.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/shader/MaterialRecord.js +29 -33
- package/src/view/View.d.ts.map +1 -1
- package/src/view/View.js +4 -6
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleRenderProfile.d.ts +0 -14
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleRenderProfile.d.ts.map +0 -1
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleRenderProfile.js +0 -18
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleRendererType.d.ts +0 -8
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleRendererType.d.ts.map +0 -1
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleRendererType.js +0 -10
- package/src/engine/graphics/particles/particular/engine/parameter/ParameterSheet.d.ts +0 -38
- package/src/engine/graphics/particles/particular/engine/parameter/ParameterSheet.d.ts.map +0 -1
- package/src/engine/graphics/particles/particular/engine/parameter/ParameterSheet.js +0 -278
|
@@ -8,21 +8,49 @@ import { ParameterLookupTable } from "./ParameterLookupTable.js";
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
export class ParticleParameter {
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @type {List.<ParameterLookupTable>}
|
|
15
|
+
*/
|
|
16
|
+
tracks = new List();
|
|
17
|
+
|
|
11
18
|
/**
|
|
12
19
|
*
|
|
13
|
-
* @
|
|
14
|
-
|
|
20
|
+
* @type {number}
|
|
21
|
+
*/
|
|
22
|
+
trackCount = 0;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Statistics of the parameter value data
|
|
26
|
+
* @type {number}
|
|
27
|
+
*/
|
|
28
|
+
valueMin = 0;
|
|
29
|
+
/**
|
|
30
|
+
* Statistics of the parameter value data
|
|
31
|
+
* @type {number}
|
|
32
|
+
*/
|
|
33
|
+
valueMax = 0;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Set by the engine, points to texture piece that stores this parameter data
|
|
37
|
+
* @type {AtlasPatch|null}
|
|
38
|
+
*/
|
|
39
|
+
patch = null;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
* @param {string} [name]
|
|
44
|
+
* @param {number} [itemSize]
|
|
15
45
|
* @constructor
|
|
16
46
|
*/
|
|
17
|
-
constructor(name, itemSize) {
|
|
47
|
+
constructor(name = '', itemSize = 1) {
|
|
48
|
+
assert.isString(name, 'name');
|
|
49
|
+
assert.isNonNegativeInteger(itemSize, 'itemSize');
|
|
50
|
+
|
|
18
51
|
this.name = name;
|
|
19
52
|
this.itemSize = itemSize;
|
|
20
53
|
|
|
21
|
-
/**
|
|
22
|
-
*
|
|
23
|
-
* @type {List.<ParameterLookupTable>}
|
|
24
|
-
*/
|
|
25
|
-
this.tracks = new List();
|
|
26
54
|
|
|
27
55
|
/**
|
|
28
56
|
* Default lookup table value for a track
|
|
@@ -30,28 +58,7 @@ export class ParticleParameter {
|
|
|
30
58
|
*/
|
|
31
59
|
this.defaultTrackValue = new ParameterLookupTable(itemSize);
|
|
32
60
|
|
|
33
|
-
/**
|
|
34
|
-
*
|
|
35
|
-
* @type {number}
|
|
36
|
-
*/
|
|
37
|
-
this.trackCount = 0;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Statistics of the parameter value data
|
|
41
|
-
* @type {number}
|
|
42
|
-
*/
|
|
43
|
-
this.valueMin = 0;
|
|
44
|
-
/**
|
|
45
|
-
* Statistics of the parameter value data
|
|
46
|
-
* @type {number}
|
|
47
|
-
*/
|
|
48
|
-
this.valueMax = 0;
|
|
49
61
|
|
|
50
|
-
/**
|
|
51
|
-
* Set by the engine, points to texture piece that stores this parameter data
|
|
52
|
-
* @type {AtlasPatch|null}
|
|
53
|
-
*/
|
|
54
|
-
this.patch = null;
|
|
55
62
|
}
|
|
56
63
|
|
|
57
64
|
toJSON() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MaterialRecord.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/particles/particular/engine/shader/MaterialRecord.js"],"names":[],"mappings":"AAAA;
|
|
1
|
+
{"version":3,"file":"MaterialRecord.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/particles/particular/engine/shader/MaterialRecord.js"],"names":[],"mappings":"AAAA;IAEI;;;OAGG;IACH,mBAAgB;IAEhB;;;OAGG;IACH,OAFU,MAAM,CAEN;IAEV;;;OAGG;IACH,gBAFU,eAAe,CAEL;IAEpB;;;OAGG;IACH,UAFU,iBAAiB,CAEb;IAEd;;;OAGG;IACH,YAFU,eAAa,IAAI,CAET;IAElB;;;OAGG;IACH,gBAFU,MAAM,CAEG;CAEtB"}
|
|
@@ -1,43 +1,39 @@
|
|
|
1
1
|
export class MaterialRecord {
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
*
|
|
4
|
-
* @
|
|
5
|
+
* @type {Material}
|
|
5
6
|
*/
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
*
|
|
9
|
-
* @type {Material}
|
|
10
|
-
*/
|
|
11
|
-
this.material = null;
|
|
7
|
+
material = null;
|
|
12
8
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @type {number}
|
|
12
|
+
*/
|
|
13
|
+
count = 0;
|
|
18
14
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @type {SignalBinding[]}
|
|
18
|
+
*/
|
|
19
|
+
signalBindings = [];
|
|
24
20
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* @type {ParticleEmitter[]}
|
|
24
|
+
*/
|
|
25
|
+
emitters = [];
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* @type {ParameterSet|null}
|
|
30
|
+
*/
|
|
31
|
+
parameters = null;
|
|
30
32
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @type {number}
|
|
36
|
+
*/
|
|
37
|
+
lastAccessTime = 0;
|
|
36
38
|
|
|
37
|
-
/**
|
|
38
|
-
*
|
|
39
|
-
* @type {number}
|
|
40
|
-
*/
|
|
41
|
-
this.lastAccessTime = 0;
|
|
42
|
-
}
|
|
43
39
|
}
|
package/src/view/View.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"View.d.ts","sourceRoot":"","sources":["../../../src/view/View.js"],"names":[],"mappings":"wBAiBU,MAAM;;;;;;;AAchB;;;;;;;;GAQG;AACH;IAEI;;;;;OAKG;IACH,0BAAc;IAEd;;;OAGG;IACH,OAFU,SAAS,GAAC,MAAM,CAEJ;IAEtB;;;OAGG;IACH,mBAFU,OAAO,CAEY;IAE7B;;;OAGG;IACH,mBAFU,OAAO,CAES;IAE1B;;;OAGG;IACH,gBAFU,OAAO,CAES;IAE1B;;;OAGG;IACH,eAFU,OAAO,CAEQ;IAEzB;;;;OAIG;IACH,0BAFU,OAAO,CAEuB;IAExC;;OAEG;IACH;QACI;;WAEG;;QAEH;;WAEG;;MAEL;IAEF;;;;OAIG;IACH,mBAHU,IAAI,EAAE,CAGF;IAEd;;;OAGG;IACH,QAFU,IAAI,GAAC,IAAI,CAEL;
|
|
1
|
+
{"version":3,"file":"View.d.ts","sourceRoot":"","sources":["../../../src/view/View.js"],"names":[],"mappings":"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"}
|
package/src/view/View.js
CHANGED
|
@@ -117,14 +117,12 @@ class View {
|
|
|
117
117
|
#transform_current = new Float32Array(9);
|
|
118
118
|
|
|
119
119
|
/**
|
|
120
|
-
*
|
|
120
|
+
*
|
|
121
|
+
* @type {Element|NodeDescription|null}
|
|
121
122
|
*/
|
|
123
|
+
el = null;
|
|
124
|
+
|
|
122
125
|
constructor() {
|
|
123
|
-
/**
|
|
124
|
-
*
|
|
125
|
-
* @type {Element|NodeDescription|null}
|
|
126
|
-
*/
|
|
127
|
-
this.el = null;
|
|
128
126
|
|
|
129
127
|
this.position.onChanged.add(this.__updateTransform, this);
|
|
130
128
|
this.scale.onChanged.add(this.__updateTransform, this);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export class ParticleRenderProfile {
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* @type {number|ParticleRendererType}
|
|
5
|
-
*/
|
|
6
|
-
renderer: number | ParticleRendererType;
|
|
7
|
-
/**
|
|
8
|
-
*
|
|
9
|
-
* @type {*[]}
|
|
10
|
-
*/
|
|
11
|
-
settings: any[];
|
|
12
|
-
}
|
|
13
|
-
import { ParticleRendererType } from "./ParticleRendererType.js";
|
|
14
|
-
//# sourceMappingURL=ParticleRenderProfile.d.ts.map
|
package/src/engine/graphics/particles/particular/engine/emitter/ParticleRenderProfile.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ParticleRenderProfile.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/particles/particular/engine/emitter/ParticleRenderProfile.js"],"names":[],"mappings":"AAEA;IAGQ;;;OAGG;IACH,UAFU,MAAM,GAAC,oBAAoB,CAES;IAE9C;;;OAGG;IACH,UAFU,KAAG,CAEK;CAEzB;qCAjBoC,2BAA2B"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ParticleRendererType } from "./ParticleRendererType.js";
|
|
2
|
-
|
|
3
|
-
export class ParticleRenderProfile {
|
|
4
|
-
constructor() {
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
8
|
-
* @type {number|ParticleRendererType}
|
|
9
|
-
*/
|
|
10
|
-
this.renderer = ParticleRendererType.Billboard;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
14
|
-
* @type {*[]}
|
|
15
|
-
*/
|
|
16
|
-
this.settings = [];
|
|
17
|
-
}
|
|
18
|
-
}
|
package/src/engine/graphics/particles/particular/engine/emitter/ParticleRendererType.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ParticleRendererType.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/particles/particular/engine/emitter/ParticleRendererType.js"],"names":[],"mappings":"mCAEU,MAAM"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export class ParameterSheet {
|
|
2
|
-
atlas: TextureAtlas;
|
|
3
|
-
tables: List<any>;
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
* @type {Map<int, MapEntry>}
|
|
7
|
-
*/
|
|
8
|
-
tableMap: Map<int, MapEntry>;
|
|
9
|
-
__atlasNeedsUpdate: boolean;
|
|
10
|
-
paramterResolution: number;
|
|
11
|
-
update(): void;
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
14
|
-
* @param {ParticleParameter} parameter
|
|
15
|
-
*/
|
|
16
|
-
add(parameter: ParticleParameter): void;
|
|
17
|
-
/**
|
|
18
|
-
* @param {ParticleParameter} parameter
|
|
19
|
-
*/
|
|
20
|
-
remove(parameter: ParticleParameter): void;
|
|
21
|
-
}
|
|
22
|
-
import { TextureAtlas } from "../../../../texture/atlas/TextureAtlas.js";
|
|
23
|
-
import List from "../../../../../../core/collection/list/List.js";
|
|
24
|
-
declare class MapEntry {
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
* @param {number} hash
|
|
28
|
-
* @param {number} count
|
|
29
|
-
* @param {AtlasPatch} patch
|
|
30
|
-
* @constructor
|
|
31
|
-
*/
|
|
32
|
-
constructor(hash: number, count: number, patch: AtlasPatch);
|
|
33
|
-
hash: number;
|
|
34
|
-
count: number;
|
|
35
|
-
patch: AtlasPatch;
|
|
36
|
-
}
|
|
37
|
-
export {};
|
|
38
|
-
//# sourceMappingURL=ParameterSheet.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ParameterSheet.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/particles/particular/engine/parameter/ParameterSheet.js"],"names":[],"mappings":"AAqMA;IAEQ,oBAA+B;IAE/B,kBAAwB;IAExB;;;OAGG;IACH,UAFU,SAAS,QAAQ,CAAC,CAEH;IAEzB,4BAA+B;IAE/B,2BAA4B;IAGhC,eAMC;IAED;;;OAGG;IACH,wCA0BC;IAED;;OAEG;IACH,2CAeC;CACJ;6BA3Q4B,2CAA2C;iBADvD,gDAAgD;AAiLjE;IACI;;;;;;OAMG;IACH,kBALW,MAAM,SACN,MAAM,qBAQhB;IAHG,aAAgB;IAChB,cAAkB;IAClB,kBAAkB;CAEzB"}
|
|
@@ -1,278 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Collection of parameters, serves as an accelerated data structure and is also responsible for maintaining parameter lookup texture
|
|
3
|
-
* @constructor
|
|
4
|
-
*/
|
|
5
|
-
import { assert } from "../../../../../../core/assert.js";
|
|
6
|
-
import List from "../../../../../../core/collection/list/List.js";
|
|
7
|
-
import { TextureAtlas } from "../../../../texture/atlas/TextureAtlas.js";
|
|
8
|
-
import { Sampler2D } from "../../../../texture/sampler/Sampler2D.js";
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
*
|
|
12
|
-
* @param {number} itemSize
|
|
13
|
-
* @returns {function(sampleValue:number[], min:number, max:number, encodedValue: number[])}
|
|
14
|
-
*/
|
|
15
|
-
function computeParameterValueEncoder(itemSize) {
|
|
16
|
-
assert.equal(typeof itemSize, 'number', `itemSize must be a number, instead was '${typeof itemSize}'`);
|
|
17
|
-
|
|
18
|
-
if (itemSize === 1) {
|
|
19
|
-
return encodeParameterValueScalar;
|
|
20
|
-
} else if (itemSize === 2) {
|
|
21
|
-
return encodeParameterValueVector2;
|
|
22
|
-
} else if (itemSize === 3) {
|
|
23
|
-
return encodeParameterValueVector3;
|
|
24
|
-
} else if (itemSize === 4) {
|
|
25
|
-
return encodeParameterValueVector4;
|
|
26
|
-
} else {
|
|
27
|
-
throw new Error(`Unsupported item size ${itemSize}`);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
*
|
|
33
|
-
* @param {number[]} sampleValue
|
|
34
|
-
* @param {number} min
|
|
35
|
-
* @param {number} max
|
|
36
|
-
* @param {number[]} result
|
|
37
|
-
*/
|
|
38
|
-
function encodeParameterValueScalar(sampleValue, min, max, result) {
|
|
39
|
-
const range = max - min;
|
|
40
|
-
|
|
41
|
-
const normalizedValue = (sampleValue[0] - min) / range;
|
|
42
|
-
|
|
43
|
-
const scaledValue = normalizedValue * 4294967295;
|
|
44
|
-
|
|
45
|
-
result[0] = scaledValue & (0xFF);
|
|
46
|
-
result[1] = scaledValue >> 8 & (0xFF);
|
|
47
|
-
result[2] = scaledValue >> 16 & (0xFF);
|
|
48
|
-
result[3] = scaledValue >> 24 & (0xFF);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
*
|
|
53
|
-
* @param {number[]} sampleValue
|
|
54
|
-
* @param {number} min
|
|
55
|
-
* @param {number} max
|
|
56
|
-
* @param {number[]} result
|
|
57
|
-
*/
|
|
58
|
-
function encodeParameterValueVector2(sampleValue, min, max, result) {
|
|
59
|
-
const range = max - min;
|
|
60
|
-
|
|
61
|
-
const nX = (sampleValue[0] - min) / range;
|
|
62
|
-
const nY = (sampleValue[1] - min) / range;
|
|
63
|
-
|
|
64
|
-
const sX = nX * 65535;
|
|
65
|
-
const sY = nY * 65535;
|
|
66
|
-
|
|
67
|
-
result[0] = sX & 0xFF;
|
|
68
|
-
result[1] = sX >> 8 & 0xFF;
|
|
69
|
-
|
|
70
|
-
result[2] = sY & 0xFF;
|
|
71
|
-
result[3] = sY >> 8 & 0xFF;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
*
|
|
76
|
-
* @param {number[]} sampleValue
|
|
77
|
-
* @param {number} min
|
|
78
|
-
* @param {number} max
|
|
79
|
-
* @param {number[]} result
|
|
80
|
-
*/
|
|
81
|
-
function encodeParameterValueVector3(sampleValue, min, max, result) {
|
|
82
|
-
const range = max - min;
|
|
83
|
-
|
|
84
|
-
const nX = (sampleValue[0] - min) / range;
|
|
85
|
-
const nY = (sampleValue[1] - min) / range;
|
|
86
|
-
const nZ = (sampleValue[2] - min) / range;
|
|
87
|
-
|
|
88
|
-
const sX = nX * 255;
|
|
89
|
-
const sY = nY * 255;
|
|
90
|
-
const sZ = nZ * 255;
|
|
91
|
-
|
|
92
|
-
result[0] = sX;
|
|
93
|
-
result[1] = sY;
|
|
94
|
-
result[2] = sZ;
|
|
95
|
-
result[3] = 255;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
*
|
|
100
|
-
* @param {number[]} sampleValue
|
|
101
|
-
* @param {number} min
|
|
102
|
-
* @param {number} max
|
|
103
|
-
* @param {number[]} result
|
|
104
|
-
*/
|
|
105
|
-
function encodeParameterValueVector4(sampleValue, min, max, result) {
|
|
106
|
-
const range = max - min;
|
|
107
|
-
|
|
108
|
-
const nX = (sampleValue[0] - min) / range;
|
|
109
|
-
const nY = (sampleValue[1] - min) / range;
|
|
110
|
-
const nZ = (sampleValue[2] - min) / range;
|
|
111
|
-
const nW = (sampleValue[3] - min) / range;
|
|
112
|
-
|
|
113
|
-
const sX = nX * 255;
|
|
114
|
-
const sY = nY * 255;
|
|
115
|
-
const sZ = nZ * 255;
|
|
116
|
-
const sW = nW * 255;
|
|
117
|
-
|
|
118
|
-
result[0] = sX;
|
|
119
|
-
result[1] = sY;
|
|
120
|
-
result[2] = sZ;
|
|
121
|
-
result[3] = sW;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
*
|
|
126
|
-
* @param {ParticleParameter} parameter
|
|
127
|
-
* @param {number} length number of pixels to be used for each track, more - higher accuracy and smoother transitions
|
|
128
|
-
* @returns {Sampler2D}
|
|
129
|
-
*/
|
|
130
|
-
function buildParameterSampler(parameter, length) {
|
|
131
|
-
assert.equal(typeof length, 'number', `Parameter length must be a number, instead was '${typeof length}'`);
|
|
132
|
-
|
|
133
|
-
const trackThickness = 2;
|
|
134
|
-
|
|
135
|
-
const trackCount = parameter.getTrackCount();
|
|
136
|
-
|
|
137
|
-
assert.equal(trackCount, parameter.tracks.length, `parameter.trackCount(=${trackCount}) is not equal to parameter.tracks.length(=${parameter.tracks.length})`);
|
|
138
|
-
|
|
139
|
-
const itemSize = parameter.itemSize;
|
|
140
|
-
|
|
141
|
-
const sampler2D = Sampler2D.uint8(4, length, trackCount * trackThickness);
|
|
142
|
-
|
|
143
|
-
const uDivisor = Math.max(1, length - 1);
|
|
144
|
-
|
|
145
|
-
const sampleValue = new Array(itemSize);
|
|
146
|
-
|
|
147
|
-
const valueMin = parameter.valueMin;
|
|
148
|
-
const valueMax = parameter.valueMax;
|
|
149
|
-
|
|
150
|
-
const encodedValue = new Array(4);
|
|
151
|
-
|
|
152
|
-
const encoder = computeParameterValueEncoder(itemSize);
|
|
153
|
-
|
|
154
|
-
let i, j, k;
|
|
155
|
-
|
|
156
|
-
//encode values
|
|
157
|
-
for (i = 0; i < trackCount; i++) {
|
|
158
|
-
const track = parameter.tracks.get(i);
|
|
159
|
-
|
|
160
|
-
assert.notEqual(track, undefined, 'track is undefined');
|
|
161
|
-
assert.notEqual(track, null, 'track is null');
|
|
162
|
-
|
|
163
|
-
for (j = 0; j < length; j++) {
|
|
164
|
-
|
|
165
|
-
const u = j / uDivisor;
|
|
166
|
-
|
|
167
|
-
//sample value from the track
|
|
168
|
-
track.sample(u, sampleValue);
|
|
169
|
-
|
|
170
|
-
//encode values
|
|
171
|
-
encoder(sampleValue, valueMin, valueMax, encodedValue);
|
|
172
|
-
|
|
173
|
-
for (k = 0; k < trackThickness; k++) {
|
|
174
|
-
//write sampled value to the sampler
|
|
175
|
-
sampler2D.write(j, i * trackThickness + k, encodedValue);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
return sampler2D;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
class MapEntry {
|
|
184
|
-
/**
|
|
185
|
-
*
|
|
186
|
-
* @param {number} hash
|
|
187
|
-
* @param {number} count
|
|
188
|
-
* @param {AtlasPatch} patch
|
|
189
|
-
* @constructor
|
|
190
|
-
*/
|
|
191
|
-
constructor(hash, count, patch) {
|
|
192
|
-
this.hash = hash;
|
|
193
|
-
this.count = count;
|
|
194
|
-
this.patch = patch;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
export class ParameterSheet {
|
|
199
|
-
constructor() {
|
|
200
|
-
this.atlas = new TextureAtlas();
|
|
201
|
-
|
|
202
|
-
this.tables = new List();
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
*
|
|
206
|
-
* @type {Map<int, MapEntry>}
|
|
207
|
-
*/
|
|
208
|
-
this.tableMap = new Map();
|
|
209
|
-
|
|
210
|
-
this.__atlasNeedsUpdate = false;
|
|
211
|
-
|
|
212
|
-
this.paramterResolution = 32;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
update() {
|
|
216
|
-
if (this.__atlasNeedsUpdate) {
|
|
217
|
-
this.atlas.update();
|
|
218
|
-
|
|
219
|
-
this.__atlasNeedsUpdate = false;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
*
|
|
225
|
-
* @param {ParticleParameter} parameter
|
|
226
|
-
*/
|
|
227
|
-
add(parameter) {
|
|
228
|
-
this.tables.add(parameter);
|
|
229
|
-
|
|
230
|
-
const hash = parameter.hash();
|
|
231
|
-
|
|
232
|
-
let entry;
|
|
233
|
-
|
|
234
|
-
if (this.tableMap.has(hash)) {
|
|
235
|
-
entry = this.tableMap.get(hash);
|
|
236
|
-
entry.count++;
|
|
237
|
-
} else {
|
|
238
|
-
//create a sampler from lut
|
|
239
|
-
const sampler = buildParameterSampler(parameter, this.paramterResolution);
|
|
240
|
-
|
|
241
|
-
//create patch
|
|
242
|
-
const patch = this.atlas.add(sampler, 0);
|
|
243
|
-
|
|
244
|
-
//mark atlas for update
|
|
245
|
-
this.__atlasNeedsUpdate = true;
|
|
246
|
-
|
|
247
|
-
entry = new MapEntry(hash, 1, patch);
|
|
248
|
-
|
|
249
|
-
this.tableMap.set(hash, entry);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
parameter.patch = entry.patch;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* @param {ParticleParameter} parameter
|
|
257
|
-
*/
|
|
258
|
-
remove(parameter) {
|
|
259
|
-
this.tables.removeOneOf(parameter);
|
|
260
|
-
|
|
261
|
-
const hash = parameter.hash();
|
|
262
|
-
|
|
263
|
-
const entry = this.tableMap.get(hash);
|
|
264
|
-
|
|
265
|
-
entry.count--;
|
|
266
|
-
|
|
267
|
-
if (entry <= 0) {
|
|
268
|
-
//last usage removed
|
|
269
|
-
this.tableMap.delete(hash);
|
|
270
|
-
//clear from the atlas
|
|
271
|
-
this.atlas.remove(entry.patch);
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
export { ParameterSheet };
|
|
277
|
-
|
|
278
|
-
|