@woosh/meep-engine 2.72.0 → 2.74.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.
Files changed (35) hide show
  1. package/build/bundle-worker-image-decoder.js +1 -1
  2. package/build/meep.cjs +38 -189
  3. package/build/meep.min.js +1 -1
  4. package/build/meep.module.js +38 -189
  5. package/package.json +3 -2
  6. package/src/engine/asset/loaders/image/codec/NativeImageDecoder.js +2 -1
  7. package/src/engine/asset/loaders/image/codec/ThreadedImageDecoder.js +4 -5
  8. package/src/engine/asset/loaders/image/png/PNGReader.js +23 -19
  9. package/src/engine/graphics/ecs/camera/FrustumProjector.js +31 -182
  10. package/src/engine/graphics/generate_halton_jitter.js +21 -0
  11. package/src/engine/graphics/render/buffer/simple-fx/taa/TemporalSupersamplingRenderPlugin.js +3 -20
  12. package/src/engine/graphics/texture/virtual/v2/NOTES.md +11 -1
  13. package/src/engine/graphics/texture/virtual/v2/ShaderUsage.js +7 -5
  14. package/src/engine/graphics/texture/virtual/v2/SparseTexture.js +291 -0
  15. package/src/engine/graphics/texture/virtual/v2/TileLoader.js +232 -0
  16. package/src/engine/graphics/texture/virtual/v2/UsageMetadata.js +118 -134
  17. package/src/engine/graphics/texture/virtual/v2/VirtualTextureManager.js +73 -9
  18. package/src/engine/graphics/texture/virtual/v2/debug/ResidencyDebugView.js +58 -0
  19. package/src/engine/graphics/texture/virtual/v2/debug/UsageDebugView.js +63 -0
  20. package/src/engine/graphics/texture/virtual/v2/{UsagePyramidDebugView.js → debug/UsagePyramidDebugView.js} +27 -23
  21. package/src/engine/graphics/texture/virtual/v2/prototype.js +62 -19
  22. package/src/engine/graphics/texture/virtual/v2/tile/TextureTile.js +31 -0
  23. package/src/engine/graphics/texture/virtual/v2/tile/compose_finger_print.js +23 -0
  24. package/src/engine/graphics/texture/virtual/v2/tile/compose_tile_address.js +22 -0
  25. package/src/engine/graphics/texture/virtual/v2/tile/decompose_finger_print.js +12 -0
  26. package/src/engine/graphics/texture/virtual/v2/tile/finger_print_to_tile_address.js +16 -0
  27. package/src/engine/graphics/texture/virtual/v2/tile/tile_address_to_finger_print.js +35 -0
  28. package/src/view/CSS_ABSOLUTE_POSITIONING.js +5 -0
  29. package/src/engine/graphics/clouds/MaterialTransformer.js +0 -0
  30. package/src/engine/graphics/clouds/TerrainCloudsPlugin.js +0 -0
  31. package/src/engine/graphics/clouds/cs_build_fragment_shader.js +0 -0
  32. package/src/engine/graphics/clouds/cs_build_vertex_shader.js +0 -0
  33. package/src/engine/graphics/ecs/camera/TiltCameraController.js +0 -69
  34. package/src/engine/graphics/ecs/camera/is_valid_distance_value.js +0 -11
  35. package/src/engine/graphics/texture/virtual/v2/UsageDebugView.js +0 -51
@@ -0,0 +1,5 @@
1
+ export const CSS_ABSOLUTE_POSITIONING = Object.freeze({
2
+ position: "absolute",
3
+ top: 0,
4
+ left: 0
5
+ });
File without changes
File without changes
@@ -1,69 +0,0 @@
1
- /**
2
- * Created by Alex on 30/06/2015.
3
- */
4
- import { Object3D, Vector3 as ThreeVector3 } from 'three';
5
-
6
- import Vector3 from "../../../../core/geom/Vector3.js";
7
- import Vector2 from '../../../../core/geom/Vector2.js';
8
- import { DEG_TO_RAD } from "../../../../core/math/DEG_TO_RAD.js";
9
-
10
- const CC = function () {
11
- this.target = new Vector3();
12
- this.rotationAxis = new Vector3(0, 1, 0);
13
- this.rotationAngle = DEG_TO_RAD * 0;
14
- //angle between rotation axis and vector from target to position
15
- this.tiltAngle = DEG_TO_RAD * 10;
16
-
17
- this.distance = 100;
18
- this.position = new Vector3();
19
- this.rotation = new Vector3();
20
- };
21
-
22
- CC.prototype.rotate = function (deltaAngle) {
23
- this.tiltAngle += deltaAngle;
24
- };
25
-
26
- CC.prototype.pan = function (deltaX, deltaY, cameraRotation) {
27
- //vector pointing in the direction of travel
28
- const vector = new ThreeVector3(deltaX, 0, deltaY);
29
- //var rotationMatrix = new THREE.Matrix4().makeRotationFromQuaternion(cameraRotation);
30
- //vector.applyMatrix4(rotationMatrix);
31
- ////add to delta vector
32
- //vector.y = 0;
33
- this.target.add(vector);
34
- };
35
-
36
- const object = new Object3D();
37
-
38
- function eulerJSON(o) {
39
- return { x: o.x, y: o.y, z: o.z };
40
- }
41
-
42
- CC.prototype.updatePositionAndRotation = function (transform) {
43
- const distance = this.distance;
44
- const target = this.target;
45
- const rotationAngle = this.rotationAngle;
46
- let rotationAxis = this.rotationAxis;
47
- const tiltAngle = this.tiltAngle;
48
-
49
- //position
50
- const dTilt = new Vector2();
51
- dTilt.x = Math.sin(tiltAngle) * distance;
52
- dTilt.y = Math.cos(tiltAngle) * distance;
53
-
54
- const position = new Vector3();
55
- position.x = Math.sin(rotationAngle) * dTilt.x;
56
- position.z = Math.cos(rotationAngle) * dTilt.x;
57
- position.y = dTilt.y;
58
-
59
- position.add(target);
60
- //finally look at the target
61
- object.position.copy(position);
62
- object.lookAt(target);
63
- //console.log(position.toJSON(), target.toJSON());
64
-
65
- //
66
- //transform.position.copy(position);
67
- //transform.rotation.setFromEuler(object.rotation);
68
- };
69
- export default CC;
@@ -1,11 +0,0 @@
1
- /**
2
- *
3
- * @param {number} value
4
- * @returns {boolean}
5
- */
6
- export function is_valid_distance_value(value) {
7
- return value !== Number.NEGATIVE_INFINITY
8
- && value !== Number.POSITIVE_INFINITY
9
- && !Number.isNaN(value)
10
- ;
11
- }
@@ -1,51 +0,0 @@
1
- import LabelView from "../../../../../view/common/LabelView.js";
2
- import EmptyView from "../../../../../view/elements/EmptyView.js";
3
-
4
- export class UsageDebugView extends EmptyView {
5
- #tileCount = new LabelView("")
6
- #tiles = new EmptyView();
7
-
8
-
9
- constructor(opt) {
10
- super(opt);
11
-
12
- this.addChild(this.#tileCount);
13
- this.addChild(this.#tiles);
14
-
15
- this.css({
16
- position: "absolute",
17
- left: "0",
18
- top: "0",
19
- background: "rgba(255,255,255,0.5)",
20
- fontFamily: "monospace",
21
- fontSize: "10px"
22
- });
23
- }
24
-
25
- /**
26
- *
27
- * @param {UsageMetadata} usage
28
- */
29
- set usage(usage) {
30
-
31
- const tileCount = usage.tile_count;
32
-
33
- this.#tileCount.updateText(`Tile Count: ${tileCount}`);
34
-
35
- this.#tiles.removeAllChildren();
36
-
37
- for (let i = 0; i < tileCount; i++) {
38
- const finger_print = usage.getTile(i);
39
- const count = usage.getCount(i);
40
-
41
- const level = (finger_print >> 24) & 0xFF;
42
- const x = (finger_print >> 16) & 0xFF;
43
- const y = (finger_print >> 8) & 0xFF;
44
- const texture_id = (finger_print) & 0xFF;
45
-
46
- this.#tiles.addChild(new LabelView(`ID: ${texture_id} Level: ${level} X: ${x} Y: ${y} USAGE: ${count}`));
47
- }
48
- }
49
-
50
-
51
- }