@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.
- package/build/bundle-worker-image-decoder.js +1 -1
- package/build/meep.cjs +185 -189
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +185 -189
- package/package.json +1 -1
- package/src/core/binary/UINT32_MAX.js +5 -0
- package/src/core/bvh2/bvh3/BVH.js +44 -2
- package/src/core/bvh2/bvh3/BVH.spec.js +45 -0
- package/src/core/bvh2/bvh3/build_triangle_morton_codes.js +73 -0
- package/src/core/bvh2/bvh3/ebvh_build_for_geometry_morton.js +5 -101
- package/src/core/bvh2/bvh3/ebvh_build_hierarchy.js +59 -0
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_nearest_to_point.js +31 -32
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_nearest_to_point.spec.js +64 -0
- package/src/core/collection/SCRATCH_UINT32_TRAVERSAL_STACK.js +1 -0
- package/src/core/geom/3d/aabb/aabb3_signed_distance_sqr_to_point.js +1 -0
- package/src/core/geom/3d/aabb/aabb3_unsigned_distance_sqr_to_point.js +36 -0
- package/src/core/process/worker/OnDemandWorkerManager.js +5 -1
- package/src/engine/asset/loaders/ArrayBufferLoader.js +13 -15
- package/src/engine/asset/loaders/image/ImageDecoderWorker.js +1 -1
- package/src/engine/asset/loaders/image/ImageRGBADataLoader.js +5 -7
- package/src/engine/asset/loaders/image/codec/NativeImageDecoder.js +2 -1
- package/src/engine/asset/loaders/image/codec/ThreadedImageDecoder.js +5 -6
- package/src/engine/asset/loaders/image/png/PNG.js +339 -332
- package/src/engine/asset/loaders/image/png/PNGReader.js +77 -30
- package/src/engine/asset/loaders/image/png/prototypePNG.js +13 -4
- package/src/engine/graphics/generate_halton_jitter.js +21 -0
- package/src/engine/graphics/render/buffer/simple-fx/taa/TemporalSupersamplingRenderPlugin.js +3 -20
- package/src/engine/graphics/texture/virtual/v2/PageTexture.js +335 -0
- package/src/engine/graphics/texture/virtual/v2/ResidentTileTexture.js +46 -0
- package/src/engine/graphics/texture/virtual/v2/{TileLoader.js → VirtualTextureTileLoader.js} +33 -13
- package/src/engine/graphics/texture/virtual/v2/{UsageMetadata.js → VirtualTextureUsage.js} +68 -22
- package/src/engine/graphics/texture/virtual/v2/{VirtualTextureManager.js → VirtualTextureUsageUpdater.js} +66 -9
- package/src/engine/graphics/texture/virtual/v2/debug/ResidencyDebugView.js +70 -0
- package/src/engine/graphics/texture/virtual/v2/debug/UsageDebugView.js +63 -0
- package/src/engine/graphics/texture/virtual/v2/{UsagePyramidDebugView.js → debug/UsagePyramidDebugView.js} +31 -40
- package/src/engine/graphics/texture/virtual/v2/prototype.js +98 -54
- package/src/engine/graphics/texture/virtual/v2/{TextureTile.js → tile/VirtualTextureTile.js} +3 -3
- package/src/engine/graphics/texture/virtual/v2/tile/compose_finger_print.js +23 -0
- package/src/engine/graphics/texture/virtual/v2/tile/compose_tile_address.js +26 -0
- package/src/engine/graphics/texture/virtual/v2/tile/decompose_finger_print.js +12 -0
- package/src/engine/graphics/texture/virtual/v2/tile/finger_print_to_tile_address.js +16 -0
- package/src/engine/graphics/texture/virtual/v2/{tile_index_to_finger_print.js → tile/tile_address_to_finger_print.js} +7 -3
- package/src/view/CSS_ABSOLUTE_POSITIONING.js +5 -0
- package/src/engine/graphics/texture/virtual/v2/SparseTexture.js +0 -182
- package/src/engine/graphics/texture/virtual/v2/UsageDebugView.js +0 -64
- package/src/engine/graphics/texture/virtual/v2/compose_finger_print.js +0 -13
- package/src/engine/graphics/texture/virtual/v2/finger_print_to_tile_index.js +0 -37
- /package/src/engine/graphics/texture/virtual/v2/{ShaderUsage.js → VirtualTextureUsageShader.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {assert} from "../../assert.js";
|
|
1
|
+
import { assert } from "../../assert.js";
|
|
2
2
|
|
|
3
3
|
export class OnDemandWorkerManager {
|
|
4
4
|
|
|
@@ -35,6 +35,10 @@ export class OnDemandWorkerManager {
|
|
|
35
35
|
this.worker = worker;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
/**
|
|
39
|
+
* In milliseconds
|
|
40
|
+
* @param {number} v
|
|
41
|
+
*/
|
|
38
42
|
setTimeout(v) {
|
|
39
43
|
assert.isNonNegativeInteger(v, 'v');
|
|
40
44
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { noop } from "../../../core/function/Functions.js";
|
|
1
2
|
import { Asset } from "../Asset.js";
|
|
2
|
-
import { AssetLoader } from "./AssetLoader.js";
|
|
3
|
-
import { CrossOriginKind } from "../CORS/CrossOriginKind.js";
|
|
4
3
|
import { CrossOriginConfig } from "../CORS/CrossOriginConfig.js";
|
|
5
|
-
import {
|
|
4
|
+
import { CrossOriginKind } from "../CORS/CrossOriginKind.js";
|
|
5
|
+
import { AssetLoader } from "./AssetLoader.js";
|
|
6
6
|
|
|
7
7
|
export class ArrayBufferLoader extends AssetLoader {
|
|
8
8
|
/**
|
|
@@ -90,33 +90,31 @@ export class ArrayBufferLoader extends AssetLoader {
|
|
|
90
90
|
const reader = response.body.getReader();
|
|
91
91
|
const contentLength = response.headers.get('Content-Length');
|
|
92
92
|
const total = contentLength ? parseInt(contentLength) : 0;
|
|
93
|
-
const lengthComputable = total !== 0;
|
|
94
93
|
let loaded = 0;
|
|
95
94
|
|
|
96
95
|
// periodically read data into the new stream tracking while download progress
|
|
97
96
|
const stream = new ReadableStream({
|
|
97
|
+
type: "bytes",
|
|
98
98
|
start(controller) {
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
pump();
|
|
101
101
|
|
|
102
|
-
function
|
|
102
|
+
function pump() {
|
|
103
103
|
|
|
104
104
|
reader.read().then(({ done, value }) => {
|
|
105
105
|
|
|
106
106
|
if (done) {
|
|
107
|
-
|
|
107
|
+
// no more data, we're done
|
|
108
108
|
controller.close();
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
109
111
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
loaded += value.byteLength;
|
|
113
|
-
|
|
114
|
-
progress(loaded, length);
|
|
112
|
+
loaded += value.byteLength;
|
|
115
113
|
|
|
116
|
-
|
|
117
|
-
readData();
|
|
114
|
+
progress(loaded, total);
|
|
118
115
|
|
|
119
|
-
|
|
116
|
+
controller.enqueue(value);
|
|
117
|
+
pump();
|
|
120
118
|
|
|
121
119
|
});
|
|
122
120
|
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { GameAssetType } from "../../GameAssetType.js";
|
|
1
|
+
import { computeFileExtension } from "../../../../core/path/computeFileExtension.js";
|
|
3
2
|
import { convertTexture2Sampler2D } from "../../../graphics/texture/sampler/convertTexture2Sampler2D.js";
|
|
4
|
-
import {
|
|
3
|
+
import { GameAssetType } from "../../GameAssetType.js";
|
|
5
4
|
import { ArrayBufferLoader } from "../ArrayBufferLoader.js";
|
|
5
|
+
import { AssetLoader } from "../AssetLoader.js";
|
|
6
6
|
import { CodecWithFallback } from "./codec/CodecWithFallback.js";
|
|
7
7
|
import { ThreadedImageDecoder } from "./codec/ThreadedImageDecoder.js";
|
|
8
|
-
import {
|
|
9
|
-
import { computeFileExtension } from "../../../../core/path/computeFileExtension.js";
|
|
8
|
+
import { ImageRGBADataAsset } from "./ImageRGBADataAsset.js";
|
|
10
9
|
|
|
11
10
|
const ASSET_TYPE_ARRAY_BUFFER = "arraybuffer";
|
|
12
11
|
|
|
@@ -16,7 +15,7 @@ export class ImageRGBADataLoader extends AssetLoader {
|
|
|
16
15
|
|
|
17
16
|
this.decoder = new CodecWithFallback(
|
|
18
17
|
new ThreadedImageDecoder(),
|
|
19
|
-
new NativeImageDecoder()
|
|
18
|
+
// new NativeImageDecoder()
|
|
20
19
|
);
|
|
21
20
|
}
|
|
22
21
|
|
|
@@ -58,7 +57,6 @@ export class ImageRGBADataLoader extends AssetLoader {
|
|
|
58
57
|
|
|
59
58
|
const bitmap = await this.__decode_via_worker(path, scope);
|
|
60
59
|
|
|
61
|
-
|
|
62
60
|
let data;
|
|
63
61
|
|
|
64
62
|
const bitDepth = bitmap.bitDepth;
|
|
@@ -29,7 +29,8 @@ export class NativeImageDecoder extends Codec {
|
|
|
29
29
|
const image = new Image();
|
|
30
30
|
|
|
31
31
|
// convert binary data to image URL that we can load
|
|
32
|
-
const
|
|
32
|
+
const blob = new Blob([data]);
|
|
33
|
+
const url = URL.createObjectURL(blob);
|
|
33
34
|
|
|
34
35
|
image.src = url;
|
|
35
36
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Codec } from "./Codec.js";
|
|
2
|
-
import WorkerBuilder from "../../../../../core/process/worker/WorkerBuilder.js";
|
|
3
1
|
import { OnDemandWorkerManager } from "../../../../../core/process/worker/OnDemandWorkerManager.js";
|
|
2
|
+
import WorkerBuilder from "../../../../../core/process/worker/WorkerBuilder.js";
|
|
4
3
|
import { PNG_HEADER_BYTES } from "../png/PNG_HEADER_BYTES.js";
|
|
4
|
+
import { Codec } from "./Codec.js";
|
|
5
5
|
|
|
6
6
|
export class ThreadedImageDecoder extends Codec {
|
|
7
7
|
constructor() {
|
|
@@ -21,7 +21,7 @@ export class ThreadedImageDecoder extends Codec {
|
|
|
21
21
|
*/
|
|
22
22
|
this.worker = new OnDemandWorkerManager(workerBuilder.build());
|
|
23
23
|
|
|
24
|
-
this.worker.setTimeout(
|
|
24
|
+
this.worker.setTimeout(1200);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
async test(data) {
|
|
@@ -35,8 +35,7 @@ export class ThreadedImageDecoder extends Codec {
|
|
|
35
35
|
return true;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
return result;
|
|
38
|
+
decode(data) {
|
|
39
|
+
return this.worker.request('decode', [data.buffer]);
|
|
41
40
|
}
|
|
42
41
|
}
|