@woosh/meep-engine 2.73.0 → 2.75.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 (48) hide show
  1. package/build/bundle-worker-image-decoder.js +1 -1
  2. package/build/meep.cjs +185 -189
  3. package/build/meep.min.js +1 -1
  4. package/build/meep.module.js +185 -189
  5. package/package.json +1 -1
  6. package/src/core/binary/UINT32_MAX.js +5 -0
  7. package/src/core/bvh2/bvh3/BVH.js +44 -2
  8. package/src/core/bvh2/bvh3/BVH.spec.js +45 -0
  9. package/src/core/bvh2/bvh3/build_triangle_morton_codes.js +73 -0
  10. package/src/core/bvh2/bvh3/ebvh_build_for_geometry_morton.js +5 -101
  11. package/src/core/bvh2/bvh3/ebvh_build_hierarchy.js +59 -0
  12. package/src/core/bvh2/bvh3/query/bvh_query_user_data_nearest_to_point.js +31 -32
  13. package/src/core/bvh2/bvh3/query/bvh_query_user_data_nearest_to_point.spec.js +64 -0
  14. package/src/core/collection/SCRATCH_UINT32_TRAVERSAL_STACK.js +1 -0
  15. package/src/core/geom/3d/aabb/aabb3_signed_distance_sqr_to_point.js +1 -0
  16. package/src/core/geom/3d/aabb/aabb3_unsigned_distance_sqr_to_point.js +36 -0
  17. package/src/core/process/worker/OnDemandWorkerManager.js +5 -1
  18. package/src/engine/asset/loaders/ArrayBufferLoader.js +13 -15
  19. package/src/engine/asset/loaders/image/ImageDecoderWorker.js +1 -1
  20. package/src/engine/asset/loaders/image/ImageRGBADataLoader.js +5 -7
  21. package/src/engine/asset/loaders/image/codec/NativeImageDecoder.js +2 -1
  22. package/src/engine/asset/loaders/image/codec/ThreadedImageDecoder.js +5 -6
  23. package/src/engine/asset/loaders/image/png/PNG.js +339 -332
  24. package/src/engine/asset/loaders/image/png/PNGReader.js +77 -30
  25. package/src/engine/asset/loaders/image/png/prototypePNG.js +13 -4
  26. package/src/engine/graphics/generate_halton_jitter.js +21 -0
  27. package/src/engine/graphics/render/buffer/simple-fx/taa/TemporalSupersamplingRenderPlugin.js +3 -20
  28. package/src/engine/graphics/texture/virtual/v2/PageTexture.js +335 -0
  29. package/src/engine/graphics/texture/virtual/v2/ResidentTileTexture.js +46 -0
  30. package/src/engine/graphics/texture/virtual/v2/{TileLoader.js → VirtualTextureTileLoader.js} +33 -13
  31. package/src/engine/graphics/texture/virtual/v2/{UsageMetadata.js → VirtualTextureUsage.js} +68 -22
  32. package/src/engine/graphics/texture/virtual/v2/{VirtualTextureManager.js → VirtualTextureUsageUpdater.js} +66 -9
  33. package/src/engine/graphics/texture/virtual/v2/debug/ResidencyDebugView.js +70 -0
  34. package/src/engine/graphics/texture/virtual/v2/debug/UsageDebugView.js +63 -0
  35. package/src/engine/graphics/texture/virtual/v2/{UsagePyramidDebugView.js → debug/UsagePyramidDebugView.js} +31 -40
  36. package/src/engine/graphics/texture/virtual/v2/prototype.js +98 -54
  37. package/src/engine/graphics/texture/virtual/v2/{TextureTile.js → tile/VirtualTextureTile.js} +3 -3
  38. package/src/engine/graphics/texture/virtual/v2/tile/compose_finger_print.js +23 -0
  39. package/src/engine/graphics/texture/virtual/v2/tile/compose_tile_address.js +26 -0
  40. package/src/engine/graphics/texture/virtual/v2/tile/decompose_finger_print.js +12 -0
  41. package/src/engine/graphics/texture/virtual/v2/tile/finger_print_to_tile_address.js +16 -0
  42. package/src/engine/graphics/texture/virtual/v2/{tile_index_to_finger_print.js → tile/tile_address_to_finger_print.js} +7 -3
  43. package/src/view/CSS_ABSOLUTE_POSITIONING.js +5 -0
  44. package/src/engine/graphics/texture/virtual/v2/SparseTexture.js +0 -182
  45. package/src/engine/graphics/texture/virtual/v2/UsageDebugView.js +0 -64
  46. package/src/engine/graphics/texture/virtual/v2/compose_finger_print.js +0 -13
  47. package/src/engine/graphics/texture/virtual/v2/finger_print_to_tile_index.js +0 -37
  48. /package/src/engine/graphics/texture/virtual/v2/{ShaderUsage.js → VirtualTextureUsageShader.js} +0 -0
@@ -1,64 +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
- #mip_levels = 0;
8
-
9
-
10
- constructor(opt) {
11
- super(opt);
12
-
13
- this.addChild(this.#tileCount);
14
- this.addChild(this.#tiles);
15
-
16
- this.css({
17
- position: "absolute",
18
- left: "0",
19
- top: "0",
20
- background: "rgba(255,255,255,0.5)",
21
- fontFamily: "monospace",
22
- fontSize: "10px"
23
- });
24
- }
25
-
26
- set mip_levels(v) {
27
- this.#mip_levels = v;
28
- }
29
-
30
- /**
31
- *
32
- * @param {UsageMetadata} usage
33
- */
34
- set usage(usage) {
35
-
36
-
37
- this.#tiles.removeAllChildren();
38
-
39
- let tileCount = 0;
40
-
41
- for (let mip = 0; mip < this.#mip_levels; mip++) {
42
- const resolution = 1 << mip;
43
-
44
- for (let y = 0; y < resolution; y++) {
45
- for (let x = 0; x < resolution; x++) {
46
-
47
- const count = usage.getCountBy(mip, x, y);
48
-
49
- if (count <= 0) {
50
- continue;
51
- }
52
-
53
- this.#tiles.addChild(new LabelView(`ID: ${0} Level: ${mip} X: ${x} Y: ${y} USAGE: ${count}`));
54
-
55
- tileCount++;
56
- }
57
- }
58
- }
59
-
60
- this.#tileCount.updateText(`Tile Count: ${tileCount}`);
61
- }
62
-
63
-
64
- }
@@ -1,13 +0,0 @@
1
- /**
2
- *
3
- * @param {number} mip
4
- * @param {number} x
5
- * @param {number} y
6
- * @returns {number}
7
- */
8
- export function compose_finger_print(mip, x, y) {
9
- return (mip << 24)
10
- | (x << 16)
11
- | (y << 8)
12
- ;
13
- }
@@ -1,37 +0,0 @@
1
- import { split_by_2 } from "../../../../../core/geom/3d/morton/split_by_2.js";
2
-
3
- /**
4
- *
5
- * @param {number} finger_print
6
- * @returns {{mip: number, x: number, y: number}}
7
- */
8
- export function decompose_finger_print(finger_print) {
9
- const mip = (finger_print >> 24) & 0xFF;
10
- const x = (finger_print >> 16) & 0xFF;
11
- const y = (finger_print >> 8) & 0xFF;
12
-
13
- return { mip, x, y };
14
- }
15
-
16
- /**
17
- *
18
- * @param {number} finger_print
19
- * @returns {number}
20
- */
21
- export function finger_print_to_tile_index(finger_print) {
22
- // decode fingerprint
23
- const mip = (finger_print >> 24) & 0xFF;
24
- const x = (finger_print >> 16) & 0xFF;
25
- const y = (finger_print >> 8) & 0xFF;
26
-
27
- // figure out resolution of this mip level
28
- const mip_resolution = 1 << mip;
29
-
30
- // this is basically converting something like 0100 to 0011;
31
- const mip_mask = mip_resolution - 1;
32
-
33
- // where data for this mip starts
34
- const index_offset = split_by_2(mip_mask);
35
-
36
- return index_offset + x + y * mip_resolution;
37
- }