@woosh/meep-engine 2.46.36 → 2.47.1
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/meep.cjs +108 -86
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +108 -86
- package/package.json +3 -2
- package/src/engine/ecs/terrain/ecs/makeTerrainWorkerProxy.js +4 -2
- package/src/engine/graphics/micron/prototypeVirtualGeometry.js +2 -2
- package/src/engine/graphics/texture/sampler/Sampler2D.js +4 -82
- package/src/engine/graphics/texture/sampler/Sampler2D.spec.js +0 -37
- package/src/engine/graphics/texture/sampler/Sampler2D2Canvas.js +2 -2
- package/src/engine/graphics/texture/sampler/resize/sampler2d_downsample_mipmap.js +2 -2
- package/src/engine/graphics/texture/sampler/sampler2d_channel_compute_max.js +51 -0
- package/src/engine/graphics/texture/sampler/sampler2d_channel_compute_max.spec.js +40 -0
- package/src/engine/graphics/texture/sampler/sampler2d_channel_compute_min.js +51 -0
- package/src/engine/graphics/texture/sampler/sampler2d_compute_texel_value_conversion_scale_to_uint8.js +4 -2
- package/src/engine/graphics/texture/sampler/{sampler2D_scale_down_linear.js → sampler2d_scale_down_linear.js} +1 -1
- package/src/engine/graphics/texture/sampler/{downsampleSample2D.spec.js → sampler2d_scale_down_linear.spec.js} +2 -2
- package/src/engine/graphics/texture/sampler/{sample2d_write_to_canvas_raw.js → sampler2d_write_to_canvas_raw.js} +5 -1
- package/src/engine/graphics/texture/sampler/scaleSampler2D.js +2 -2
- package/src/engine/input/ecs/util/TerrainCameraTargetSampler.js +2 -2
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { Sampler2D } from "./Sampler2D.js";
|
|
2
2
|
import { sampler2d_to_uint8_RGBA } from "./sampler2d_to_uint8_RGBA.js";
|
|
3
|
+
import { assert } from "../../../../core/assert.js";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
*
|
|
6
7
|
* @param {Sampler2D} sampler
|
|
7
8
|
* @param {HTMLCanvasElement} canvas
|
|
8
9
|
*/
|
|
9
|
-
export function
|
|
10
|
+
export function sampler2d_write_to_canvas_raw(sampler, canvas) {
|
|
11
|
+
|
|
12
|
+
assert.defined(sampler, 'sampler');
|
|
13
|
+
assert.defined(canvas, 'canvas');
|
|
10
14
|
|
|
11
15
|
const width = sampler.width;
|
|
12
16
|
const height = sampler.height;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { assert } from "../../../../core/assert.js";
|
|
2
|
-
import {
|
|
2
|
+
import { sampler2d_scale_down_linear } from "./sampler2d_scale_down_linear.js";
|
|
3
3
|
import { Sampler2D } from "./Sampler2D.js";
|
|
4
4
|
import { upsampleSampler2D } from "./upsampleSampler2D.js";
|
|
5
5
|
import { genericResampleSampler2D } from "./genericResampleSampler2D.js";
|
|
@@ -29,7 +29,7 @@ export function scaleSampler2D(input, output) {
|
|
|
29
29
|
// downscaling
|
|
30
30
|
if (Number.isInteger(sourceWidth / targetWidth) && Number.isInteger(sourceHeight / targetHeight)) {
|
|
31
31
|
// dimensions are multiples of source/target
|
|
32
|
-
|
|
32
|
+
sampler2d_scale_down_linear(input, output);
|
|
33
33
|
} else {
|
|
34
34
|
// generic downsample
|
|
35
35
|
genericResampleSampler2D(input, output, 3);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Sampler2D } from "../../../graphics/texture/sampler/Sampler2D.js";
|
|
2
|
-
import {
|
|
2
|
+
import { sampler2d_scale_down_linear } from "../../../graphics/texture/sampler/sampler2d_scale_down_linear.js";
|
|
3
3
|
import { computeWholeDivisorLow } from "../../../../core/math/computeWholeDivisorLow.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -20,7 +20,7 @@ export function buildCameraTargetSampler({ heightSampler }) {
|
|
|
20
20
|
|
|
21
21
|
const result = Sampler2D.float32(1, s(heightSampler.width), s(heightSampler.height));
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
sampler2d_scale_down_linear(heightSampler, result);
|
|
24
24
|
|
|
25
25
|
return result;
|
|
26
26
|
}
|