@woosh/meep-engine 2.33.57 → 2.33.61
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/core/bvh2/aabb3/AABB3.js +4 -1
- package/core/bvh2/traversal/traverseBinaryNodeUsingVisitor.js +6 -6
- package/core/cache/Cache.js +7 -0
- package/core/collection/array/fastArrayEquals.js +17 -0
- package/core/collection/array/typed/is_typed_array_equals.js +58 -0
- package/core/collection/map/AbstractAsyncMap.js +30 -0
- package/core/collection/map/AsyncMapWrapper.js +16 -0
- package/core/collection/map/AsyncRemoteHashMap.js +358 -0
- package/core/collection/map/CachedAsyncMap.js +34 -0
- package/core/geom/3d/SurfacePoint3.js +44 -5
- package/core/geom/Vector2.d.ts +2 -0
- package/core/geom/Vector4.js +5 -5
- package/core/geom/packing/MaxRectangles.js +13 -4
- package/core/math/hash/murmur3_32.js +3 -3
- package/engine/animation/removeEntityGenericEffect.js +22 -31
- package/engine/asset/Asset.js +0 -45
- package/engine/asset/AssetDescription.js +51 -0
- package/engine/asset/AssetManager.d.ts +7 -0
- package/engine/asset/AssetManager.js +98 -2
- package/engine/asset/AssetTransformer.d.ts +5 -0
- package/engine/asset/AssetTransformer.js +15 -0
- package/engine/asset/loaders/GLTFAssetLoader.js +27 -25
- package/engine/asset/loaders/material/computeImageBitmapEquality.js +2 -2
- package/engine/asset/loaders/material/computeTextureEquality.js +2 -2
- package/engine/asset/loaders/material/computeTextureHash.js +7 -13
- package/engine/ecs/attachment/AttachmentSystem.js +18 -17
- package/engine/ecs/grid/HeightMap2NormalMap.js +1 -1
- package/engine/ecs/grid/NormalMap2AOMap.js +1 -1
- package/engine/ecs/gui/GUIElement.js +0 -106
- package/engine/ecs/gui/GUIElementSerializationAdapter.js +108 -0
- package/engine/ecs/gui/hud/HeadsUpDisplaySystem.js +60 -45
- package/engine/ecs/gui/position/ViewportPositionSystem.js +5 -5
- package/engine/ecs/parent/EntityNode.d.ts +20 -0
- package/engine/ecs/parent/EntityNode.js +284 -0
- package/engine/ecs/parent/FaceEditor.js +137 -0
- package/engine/ecs/parent/testCompositionEntityNode.js +153 -0
- package/engine/ecs/parent/testHuDPerf.js +123 -0
- package/engine/ecs/storage/binary/BinaryClassUpgrader.js +1 -0
- package/engine/ecs/terrain/ecs/Terrain.js +14 -5
- package/engine/ecs/util/removeComponentsExcept.js +3 -3
- package/engine/graphics/GraphicsEngine.js +4 -5
- package/engine/graphics/camera/testClippingPlaneComputation.js +0 -4
- package/engine/graphics/ecs/camera/topdown/TopDownCameraController.js +0 -1
- package/engine/graphics/ecs/camera/topdown/TopDownCameraController.spec.js +8 -0
- package/engine/graphics/ecs/light/LightSystem.js +1 -1
- package/engine/graphics/ecs/mesh/Mesh.js +5 -5
- package/engine/graphics/ecs/mesh/MeshSystem.js +12 -20
- package/engine/graphics/ecs/mesh-v2/ShadedGeometry.js +29 -0
- package/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.js +158 -1
- package/engine/graphics/ecs/path/PathDisplaySystem.d.ts +3 -1
- package/engine/graphics/ecs/path/testPathDisplaySystem.js +0 -2
- package/engine/graphics/ecs/trail2d/Trail2D.js +35 -1
- package/engine/graphics/ecs/trail2d/Trail2DSystem.js +26 -19
- package/engine/graphics/ecs/trail2d/makeGradientTrail.js +68 -0
- package/engine/graphics/geometry/buffered/query/GeometrySpatialQueryAccelerator.js +55 -11
- package/engine/graphics/micron/convert_three_object_to_micron.js +24 -7
- package/engine/graphics/micron/plugin/MicronRenderPlugin.js +107 -4
- package/engine/graphics/micron/plugin/serialization/BufferGeometrySerializationAdapter.js +176 -0
- package/engine/graphics/micron/render/v1/MaterialContext.js +1 -0
- package/engine/graphics/particles/particular/engine/simulator/SimulationStepFixedPhysics.js +19 -3
- package/engine/graphics/particles/particular/engine/utils/volume/ParticleVolume.d.ts +2 -0
- package/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +1 -4
- package/engine/graphics/render/buffer/buffers/prototypeNormalFrameBuffer.js +0 -2
- package/engine/graphics/render/buffer/simple-fx/DepthLimitedBlur.js +2 -2
- package/engine/graphics/render/forward_plus/plugin/ptototypeFPPlugin.js +0 -2
- package/engine/graphics/render/forward_plus/query/query_bvh_frustum_from_texture.js +3 -1
- package/engine/graphics/render/frame_graph/FrameGraphBuilder.js +36 -0
- package/engine/graphics/render/frame_graph/IRenderContext.js +8 -0
- package/engine/graphics/render/frame_graph/RenderPass.js +32 -0
- package/engine/graphics/render/frame_graph/RenderPassFlags.js +6 -0
- package/engine/graphics/render/frame_graph/RenderPassResources.js +15 -0
- package/engine/graphics/render/frame_graph/Resource.js +21 -0
- package/engine/graphics/render/frame_graph/ResourceReference.js +14 -0
- package/engine/graphics/render/frame_graph/TextureDescriptor.js +30 -0
- package/engine/graphics/render/frame_graph/UsageModeType.js +5 -0
- package/engine/graphics/render/frame_graph/sample/deferred/GBufferDrawPass.js +27 -0
- package/engine/graphics/render/frame_graph/sample/deferred/PresentPass.js +17 -0
- package/engine/graphics/render/visibility/hiz/prototypeHiZ.js +0 -2
- package/engine/graphics/render/webgpu/sample/_main.ts +650 -0
- package/engine/graphics/render/webgpu/sample/fragmentDeferredRendering.wgsl +67 -0
- package/engine/graphics/render/webgpu/sample/fragmentGBuffersDebugView.wgsl +38 -0
- package/engine/graphics/render/webgpu/sample/fragmentWriteGBuffers.wgsl +21 -0
- package/engine/graphics/render/webgpu/sample/lightUpdate.wgsl +34 -0
- package/engine/graphics/render/webgpu/sample/main.js +566 -0
- package/engine/graphics/render/webgpu/sample/vertexTextureQuad.wgsl +9 -0
- package/engine/graphics/render/webgpu/sample/vertexWriteGBuffers.wgsl +28 -0
- package/engine/graphics/shadows/ShadowMapRenderer.js +10 -4
- package/engine/graphics/shadows/testShadowMapRendering.js +0 -2
- package/engine/graphics/texture/sampler/Sampler2D.js +24 -45
- package/engine/{ecs/grid → graphics/texture/sampler}/sampler2DToFloat32Texture.js +1 -1
- package/engine/intelligence/behavior/ecs/WaitForEventBehavior.js +3 -0
- package/engine/save/storage/IndexedDBStorage.js +8 -1
- package/package.json +1 -1
- package/samples/terrain/main.js +117 -0
- package/engine/ecs/sockets/AttachmentSocketsSystem.js +0 -10
|
@@ -3,7 +3,7 @@ import { BlurShaderUtils, DepthLimitedBlurShader } from "three/examples/jsm/shad
|
|
|
3
3
|
import { renderScreenSpace } from "../../utils/renderScreenSpace.js";
|
|
4
4
|
|
|
5
5
|
export class DepthLimitedBlur {
|
|
6
|
-
constructor({ format = RGBAFormat }) {
|
|
6
|
+
constructor({ format = RGBAFormat, radius = 8 }) {
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
*
|
|
@@ -41,7 +41,7 @@ export class DepthLimitedBlur {
|
|
|
41
41
|
|
|
42
42
|
this.__depth_cutoff = 0.01;
|
|
43
43
|
|
|
44
|
-
this.__blur_radius =
|
|
44
|
+
this.__blur_radius = radius;
|
|
45
45
|
this.__blur_std_dev = 4;
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -9,7 +9,6 @@ import PathFollowingSystem from "../../../../navigation/ecs/path_following/PathF
|
|
|
9
9
|
import SteeringSystem from "../../../../ecs/systems/SteeringSystem.js";
|
|
10
10
|
import MotionSystem from "../../../../ecs/systems/MotionSystem.js";
|
|
11
11
|
import TagSystem from "../../../../ecs/systems/TagSystem.js";
|
|
12
|
-
import { AttachmentSocketsSystem } from "../../../../ecs/sockets/AttachmentSocketsSystem.js";
|
|
13
12
|
import { AttachmentSystem } from "../../../../ecs/attachment/AttachmentSystem.js";
|
|
14
13
|
import { SoundEmitterSystem } from "../../../../sound/ecs/emitter/SoundEmitterSystem.js";
|
|
15
14
|
import SoundControllerSystem from "../../../../sound/ecs/SoundControllerSystem.js";
|
|
@@ -120,7 +119,6 @@ function makeConfig(engine) {
|
|
|
120
119
|
new SteeringSystem(),
|
|
121
120
|
new MotionSystem(),
|
|
122
121
|
new TagSystem(),
|
|
123
|
-
new AttachmentSocketsSystem(),
|
|
124
122
|
new AttachmentSystem(),
|
|
125
123
|
new SoundEmitterSystem(assetManager, sound.destination, sound.context),
|
|
126
124
|
new SoundControllerSystem(),
|
|
@@ -116,14 +116,16 @@ export function query_bvh_frustum_from_texture(
|
|
|
116
116
|
const radius = source_data[light_address + 3];
|
|
117
117
|
|
|
118
118
|
if (!point_light_inside_volume(light_x, light_y, light_z, radius, points, planes)) {
|
|
119
|
+
// cull
|
|
119
120
|
continue;
|
|
120
121
|
}
|
|
122
|
+
|
|
121
123
|
} else if (light_type === 3) {
|
|
122
124
|
// decal
|
|
123
125
|
debugger;
|
|
124
126
|
|
|
125
127
|
} else {
|
|
126
|
-
throw new Error(
|
|
128
|
+
throw new Error(`Unsupported light type ${light_type}`);
|
|
127
129
|
}
|
|
128
130
|
|
|
129
131
|
// write to output
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { assert } from "../../../../core/assert.js";
|
|
2
|
+
|
|
3
|
+
export class FrameGraphBuilder {
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @param {TextureDescriptor} descriptor
|
|
7
|
+
* @returns {Resource}
|
|
8
|
+
*/
|
|
9
|
+
createTexture(descriptor) {
|
|
10
|
+
throw new Error('Not Implemented');
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @param {Resource} resource
|
|
16
|
+
* @param {number} flags
|
|
17
|
+
* @returns {ResourceReference}
|
|
18
|
+
*/
|
|
19
|
+
read(resource, flags) {
|
|
20
|
+
assert.equal(resource.isResource, true, 'resource.isResource !== true');
|
|
21
|
+
|
|
22
|
+
throw new Error('Not Implemented');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @param {Resource} resource
|
|
28
|
+
* @param {number} flags
|
|
29
|
+
* @returns {ResourceReference}
|
|
30
|
+
*/
|
|
31
|
+
write(resource, flags) {
|
|
32
|
+
assert.equal(resource.isResource, true, 'resource.isResource !== true');
|
|
33
|
+
|
|
34
|
+
throw new Error('Not Implemented');
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const DEFAULT_FLAGS = 0;
|
|
2
|
+
|
|
3
|
+
export class RenderPass {
|
|
4
|
+
|
|
5
|
+
constructor() {
|
|
6
|
+
this.ref_count = 0;
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @type {number|RenderPassFlags}
|
|
10
|
+
*/
|
|
11
|
+
this.flags = DEFAULT_FLAGS;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @param {FrameGraphBuilder} builder
|
|
17
|
+
* @param {Object<Resource>} inputs
|
|
18
|
+
* @returns {Object<Resource>}
|
|
19
|
+
*/
|
|
20
|
+
setup(builder, inputs) {
|
|
21
|
+
throw new Error('Not Implemented');
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @param {RenderPassResources} resources
|
|
27
|
+
* @param {IRenderContext} render_context
|
|
28
|
+
*/
|
|
29
|
+
execute(resources, render_context) {
|
|
30
|
+
throw new Error('Not Implemented');
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Built by FrameGraphBuilder, maps abstract resource handles to concrete, allocated GPU resources
|
|
5
|
+
*/
|
|
6
|
+
export class RenderPassResources {
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param {Resource} resource
|
|
10
|
+
* @returns {Texture}
|
|
11
|
+
*/
|
|
12
|
+
getTexture(resource) {
|
|
13
|
+
throw new Error('Not Implemented');
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export class Resource {
|
|
2
|
+
constructor() {
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @type {number}
|
|
6
|
+
*/
|
|
7
|
+
this.ref_count = 0;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @type {TextureDescriptor}
|
|
12
|
+
*/
|
|
13
|
+
this.descriptor = null;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @readonly
|
|
19
|
+
* @type {boolean}
|
|
20
|
+
*/
|
|
21
|
+
Resource.prototype.isResource = true;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FloatType } from "three";
|
|
2
|
+
|
|
3
|
+
const TextureInitialState = {
|
|
4
|
+
/**
|
|
5
|
+
* Clear the texture.
|
|
6
|
+
*/
|
|
7
|
+
Clear: 0,
|
|
8
|
+
/**
|
|
9
|
+
* Doesn't matter. No need to clear
|
|
10
|
+
*/
|
|
11
|
+
Undefined: 1
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export class TextureDescriptor {
|
|
15
|
+
constructor() {
|
|
16
|
+
this.height = 0;
|
|
17
|
+
this.width = 0;
|
|
18
|
+
/**
|
|
19
|
+
* Render texture type
|
|
20
|
+
* @type {number}
|
|
21
|
+
*/
|
|
22
|
+
this.format = FloatType;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* What should the texture be initialized to
|
|
26
|
+
* @type {number}
|
|
27
|
+
*/
|
|
28
|
+
this.initialState = TextureInitialState.Clear;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { RenderPass } from "../../RenderPass.js";
|
|
2
|
+
import { TextureDescriptor } from "../../TextureDescriptor.js";
|
|
3
|
+
|
|
4
|
+
export class GBufferDrawPass extends RenderPass {
|
|
5
|
+
setup(builder, inputs) {
|
|
6
|
+
// ignore inputs
|
|
7
|
+
|
|
8
|
+
const out_albedo = new TextureDescriptor();
|
|
9
|
+
const res_albedo = builder.createTexture(out_albedo);
|
|
10
|
+
|
|
11
|
+
const out_normal = new TextureDescriptor();
|
|
12
|
+
const res_normal = builder.createTexture(out_normal);
|
|
13
|
+
|
|
14
|
+
const out_depth = new TextureDescriptor();
|
|
15
|
+
const res_depth = builder.createTexture(out_depth);
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
albedo: res_albedo,
|
|
19
|
+
normal: res_normal,
|
|
20
|
+
depth: res_depth
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
execute(resources, render_context) {
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RenderPass } from "../../RenderPass.js";
|
|
2
|
+
|
|
3
|
+
export class PresentPass extends RenderPass {
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @param builder
|
|
7
|
+
* @param {Resource} data
|
|
8
|
+
* @return {{data: ResourceReference}}
|
|
9
|
+
*/
|
|
10
|
+
setup(builder, { data }) {
|
|
11
|
+
const input_ref = builder.read(data, 0);
|
|
12
|
+
|
|
13
|
+
return {
|
|
14
|
+
data: input_ref
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -8,7 +8,6 @@ import PathFollowingSystem from "../../../../navigation/ecs/path_following/PathF
|
|
|
8
8
|
import SteeringSystem from "../../../../ecs/systems/SteeringSystem.js";
|
|
9
9
|
import MotionSystem from "../../../../ecs/systems/MotionSystem.js";
|
|
10
10
|
import TagSystem from "../../../../ecs/systems/TagSystem.js";
|
|
11
|
-
import { AttachmentSocketsSystem } from "../../../../ecs/sockets/AttachmentSocketsSystem.js";
|
|
12
11
|
import { AttachmentSystem } from "../../../../ecs/attachment/AttachmentSystem.js";
|
|
13
12
|
import { SoundEmitterSystem } from "../../../../sound/ecs/emitter/SoundEmitterSystem.js";
|
|
14
13
|
import SoundControllerSystem from "../../../../sound/ecs/SoundControllerSystem.js";
|
|
@@ -97,7 +96,6 @@ function makeConfig(engine) {
|
|
|
97
96
|
new SteeringSystem(),
|
|
98
97
|
new MotionSystem(),
|
|
99
98
|
new TagSystem(),
|
|
100
|
-
new AttachmentSocketsSystem(),
|
|
101
99
|
new AttachmentSystem(),
|
|
102
100
|
new SoundEmitterSystem(assetManager, sound.destination, sound.context),
|
|
103
101
|
new SoundControllerSystem(),
|