@woosh/meep-engine 2.51.0 → 2.53.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/editor/actions/concrete/WriteGridValueAction.js +1 -1
- package/editor/ecs/component/prototypeObjectEditor.js +1 -1
- package/editor/process/ObstacleGridDisplayProcess.js +2 -2
- package/editor/process/symbolic/makeGridPositionSymbolDisplay.js +1 -1
- package/editor/tools/GridPaintTool.js +2 -2
- package/package.json +4 -3
- package/samples/generation/SampleGenerator0.js +1 -1
- package/samples/generation/generators/interactive/mir_generator_place_buff_objects.js +1 -1
- package/samples/generation/generators/mir_generator_place_bases.js +1 -1
- package/samples/generation/generators/mir_generator_place_road_decorators.js +1 -1
- package/samples/generation/generators/mir_generator_place_starting_point.js +1 -1
- package/samples/generation/main.js +2 -2
- package/samples/generation/rules/matcher_play_area.js +1 -1
- package/samples/generation/rules/matcher_tag_occupied.js +1 -1
- package/samples/generation/rules/matcher_tag_traversable.js +1 -1
- package/samples/generation/themes/SampleTheme0.js +5 -5
- package/src/core/NumberFormat.js +0 -71
- package/src/core/bvh2/bvh3/ExplicitBinaryBoundingVolumeHierarchy.js +1 -0
- package/src/core/bvh2/bvh3/query/BVHQueryAny.js +16 -0
- package/src/core/bvh2/bvh3/query/bvh_collect_user_data.js +5 -5
- package/src/core/bvh2/bvh3/query/bvh_query_leaves_generic.js +2 -3
- package/src/core/bvh2/bvh3/query/bvh_query_leaves_generic.spec.js +22 -0
- package/src/core/bvh2/bvh3/query/bvh_query_leaves_ray.js +2 -2
- package/src/core/bvh2/bvh3/query/bvh_query_leaves_ray.spec.js +64 -0
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_generic.js +2 -3
- package/src/core/collection/table/RowFirstTableSpec.js +8 -4
- package/src/core/geom/3d/aabb/aabb3_from_threejs_geometry.js +41 -0
- package/src/core/geom/3d/matrix/MATRIX_4_IDENTITY.spec.js +10 -0
- package/src/core/geom/3d/topology/struct/TopoMesh.js +3 -2
- package/src/core/geom/3d/topology/struct/prototypeBinaryTopology.js +4 -4
- package/src/core/geom/Vector2.d.ts +9 -0
- package/src/core/geom/Vector2.js +8 -22
- package/src/core/geom/Vector2.spec.js +153 -0
- package/src/core/model/ModuleRegistry.js +2 -4
- package/src/core/model/ModuleRegistry.spec.js +31 -0
- package/src/core/model/reactive/js/compileReactiveToJS.spec.js +14 -0
- package/src/core/model/reactive/model/logic/ReactiveAnd.spec.js +31 -1
- package/src/core/model/reactive/model/logic/ReactiveOr.spec.js +53 -0
- package/src/core/model/stat/LinearModifier.js +2 -2
- package/src/core/model/stat/LinearModifier.spec.js +62 -0
- package/src/core/model/stat/Stat.js +12 -0
- package/src/core/model/stat/Stat.spec.js +36 -0
- package/src/core/primitives/array/computeStridedIntegerArrayHash.spec.js +28 -0
- package/src/core/primitives/numbers/number_format_by_thousands.js +14 -0
- package/src/core/primitives/numbers/number_pretty_print.js +49 -0
- package/src/core/primitives/strings/computeStringHash.spec.js +12 -5
- package/src/core/process/BaseProcess.js +8 -8
- package/src/engine/Clock.js +30 -29
- package/src/engine/Clock.spec.js +26 -0
- package/src/engine/Engine.spec.js +4 -0
- package/src/engine/ecs/EntityBuilder.js +3 -1
- package/src/engine/ecs/EntityBuilder.spec.js +21 -0
- package/src/engine/ecs/EntityComponentDataset.js +1 -1
- package/src/engine/ecs/EntityObserver.spec.js +1 -1
- package/src/engine/ecs/dynamic_actions/actions/definition/{WhiteToBlackboardActionDescription.js → WriteToBlackboardActionDescription.js} +2 -2
- package/src/engine/ecs/dynamic_actions/actions/definition/deserializeActionFromJSON.js +2 -2
- package/src/engine/ecs/gui/GUIElement.js +1 -1
- package/src/engine/ecs/gui/position/ViewportPosition.js +3 -3
- package/src/engine/ecs/guid/GUIDSerializationAdapter.spec.js +21 -0
- package/src/engine/ecs/parent/EntityNode.js +1 -1
- package/src/engine/ecs/parent/EntityNode.spec.js +104 -0
- package/src/engine/ecs/speaker/Voice.js +4 -0
- package/src/engine/ecs/team/Team.js +0 -44
- package/src/engine/ecs/team/TeamSerializationAdapter.js +46 -0
- package/src/engine/ecs/terrain/ecs/TerrainClassifier.js +1 -1
- package/src/engine/ecs/terrain/ecs/layers/TerrainLayers.js +1 -1
- package/src/engine/ecs/transform/Transform.js +2 -1
- package/src/engine/ecs/transform/Transform.spec.js +24 -0
- package/src/engine/graphics/camera/testClippingPlaneComputation.js +2 -6
- package/src/engine/graphics/ecs/animation/animator/graph/AnimationGraph.spec.js +5 -0
- package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationGraphDefinition.js +24 -25
- package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationGraphDefinition.spec.js +5 -0
- package/src/engine/graphics/ecs/decal/DecalSystem.js +2 -20
- package/src/engine/graphics/ecs/decal/v2/Decal.js +32 -32
- package/src/engine/graphics/ecs/decal/v2/Decal.spec.js +5 -0
- package/src/engine/graphics/ecs/decal/v2/FPDecalSystem.js +4 -2
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometry.js +4 -33
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.js +8 -4
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMesh.spec.js +5 -0
- package/src/engine/graphics/ecs/mesh-v2/sample/prototypeShadedGeometry.js +0 -12
- package/src/engine/graphics/ecs/path/testPathDisplaySystem.js +0 -2
- package/src/engine/graphics/ecs/path/tube/prototypeAnimatedPathMask.js +2 -6
- package/src/engine/graphics/ecs/water2/shader/testWaterShader.js +2 -4
- package/src/engine/graphics/geometry/buffered/computeBufferAttributeHash.js +1 -1
- package/src/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +0 -2
- package/src/engine/graphics/render/buffer/buffers/prototypeNormalFrameBuffer.js +2 -6
- package/src/engine/graphics/render/forward_plus/plugin/ptototypeFPPlugin.js +2 -6
- package/src/engine/graphics/render/forward_plus/prototype/prototypeLightManager.js +2 -2
- package/src/engine/graphics/render/visibility/hiz/prototypeHiZ.js +4 -8
- package/src/engine/graphics/sh3/path_tracer/GeometryBVHBatched.js +2 -1
- package/src/engine/graphics/sh3/path_tracer/PathTracer.js +6 -1
- package/src/engine/graphics/sh3/path_tracer/prototypePathTracer.js +2 -2
- package/src/engine/graphics/shadows/testShadowMapRendering.js +0 -2
- package/src/engine/graphics/texture/TextureBackedMemoryRegion.js +4 -1
- package/src/engine/graphics/texture/sampler/Sampler2D.js +1 -1
- package/src/engine/graphics/texture/sampler/filter/filter_lanczos3.js +7 -2
- package/src/engine/graphics/three/expand_aabb_by_transformed_three_object.js +3 -23
- package/src/engine/grid/grid2transform/GridPosition2Transform.js +122 -0
- package/src/engine/grid/grid2transform/GridPosition2TransformSerializationAdapter.js +70 -0
- package/src/engine/grid/grid2transform/GridPosition2TransformSerializationUpgrader_0_1.js +40 -0
- package/src/engine/grid/{systems → grid2transform}/GridPosition2TransformSystem.js +3 -3
- package/src/engine/grid/{components → obstacle}/GridObstacle.js +45 -25
- package/src/engine/grid/obstacle/GridObstacle.spec.js +175 -0
- package/src/engine/grid/{components → position}/GridPosition.js +6 -14
- package/src/engine/grid/{systems → position}/GridPositionSystem.js +1 -1
- package/src/engine/grid/transform2grid/Transform2GridPositionSystem.js +1 -1
- package/src/engine/input/devices/PointerDevice.spec.js +5 -0
- package/src/engine/navigation/ecs/components/computeCatmullRomSpline.js +5 -1
- package/src/engine/navigation/ecs/path_following/PathFollower.js +40 -32
- package/src/engine/navigation/ecs/path_following/PathFollower.spec.js +27 -0
- package/src/engine/plugin/EnginePlugin.js +12 -14
- package/src/engine/plugin/EnginePlugin.spec.js +5 -0
- package/src/engine/plugin/EnginePluginManager.js +18 -22
- package/src/engine/scene/transitionToScene.js +12 -1
- package/src/engine/simulation/Ticker.js +1 -1
- package/src/generation/filtering/CellFilter.js +6 -9
- package/src/generation/filtering/boolean/CellFilterLiteralBoolean.js +1 -4
- package/src/generation/filtering/core/CellFilterBinaryOperation.js +12 -15
- package/src/generation/filtering/core/CellFilterOperationTertiary.js +15 -19
- package/src/generation/filtering/numeric/CellFilterLiteralFloat.js +6 -9
- package/src/generation/grid/actions/ContinuousGridCellActionSetTerrainObstacle.js +1 -1
- package/src/generation/grid/actions/ContinuousGridCellActionWriteObstacle.js +2 -2
- package/src/generation/grid/generation/road/GridTaskGenerateRoads.js +1 -1
- package/src/generation/markers/actions/MarkerNodeActionEntityPlacement.js +1 -1
- package/src/generation/theme/TerrainLayerDescription.js +1 -1
- package/src/view/common/LabelView.js +3 -3
- package/src/engine/ecs/components/AimController.js +0 -18
- package/src/engine/ecs/components/Attacker.js +0 -13
- package/src/engine/ecs/components/MeshCollider.js +0 -15
- package/src/engine/ecs/components/RangedAttack.js +0 -12
- package/src/engine/ecs/components/TargetAI.js +0 -11
- package/src/engine/ecs/components/ViewportMeshProjection.js +0 -18
- package/src/engine/ecs/systems/AimControllerSystem.js +0 -63
- package/src/engine/ecs/systems/AttackerSystem.js +0 -67
- package/src/engine/ecs/systems/MeshColliderSystem.js +0 -47
- package/src/engine/ecs/systems/MonsterAISystem.js +0 -163
- package/src/engine/ecs/systems/MortalitySystem.js +0 -46
- package/src/engine/ecs/systems/RangedAttackSystem.js +0 -132
- package/src/engine/ecs/systems/SerializationMetadataSystem.js +0 -10
- package/src/engine/ecs/systems/TargetAISystem.js +0 -107
- package/src/engine/ecs/systems/ViewportMeshProjectionSystem.js +0 -68
- package/src/engine/graphics/particles/ParticleEmitterLibrary.js +0 -87
- package/src/engine/graphics/texture/ExportCanvasAsPNG.js +0 -7
- package/src/engine/grid/components/GridObstacle.spec.js +0 -46
- package/src/engine/grid/components/GridPosition2Transform.js +0 -232
- package/src/engine/grid/components/ViewportGridProjection.js +0 -20
- package/src/engine/grid/systems/GridObstacleSystem.js +0 -58
- package/src/engine/grid/systems/ViewportGridProjectionSystem.js +0 -105
- package/src/engine/navigation/PathFinder.js +0 -172
- package/src/engine/navigation/PathWorker.js +0 -78
- package/src/engine/navigation/ecs/systems/PathFinderSystem.js +0 -63
- package/src/engine/navigation/ecs/systems/PathSystem.js +0 -19
- package/src/engine/navigation/funnel/Funnel.js +0 -196
- package/src/generation/ZoneNode.js +0 -9
- /package/{src/generation → samples/generation/grid}/GridTags.js +0 -0
- /package/src/{engine → core/primitives/array}/computeStridedIntegerArrayHash.js +0 -0
- /package/src/engine/grid/{components → grid2transform}/GridPosition2TransformFlags.js +0 -0
- /package/src/engine/grid/{components → obstacle}/GridObstacleSerializationAdapter.js +0 -0
- /package/src/engine/grid/{components → position}/GridPositionSerializationAdapter.js +0 -0
- /package/src/engine/grid/{components → position}/GridPositionSerializationUpdater_0_1.js +0 -0
|
@@ -10,25 +10,7 @@ import LoadMaterial from "../../material/LoadMaterial.js";
|
|
|
10
10
|
|
|
11
11
|
import Decal from "./Decal.js";
|
|
12
12
|
import DecalGeometry from "./threejs/DecalGeometry.js";
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
*
|
|
16
|
-
* @param {string} str
|
|
17
|
-
* @returns {number}
|
|
18
|
-
*/
|
|
19
|
-
function stringHash(str) {
|
|
20
|
-
let hash = 5381,
|
|
21
|
-
i = str.length;
|
|
22
|
-
|
|
23
|
-
while (i) {
|
|
24
|
-
hash = (hash * 33) ^ str.charCodeAt(--i)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/* JavaScript does bitwise operations (like XOR, above) on 32-bit signed
|
|
28
|
-
* integers. Since we want the results to be always positive, convert the
|
|
29
|
-
* signed int to an unsigned by doing an unsigned bitshift. */
|
|
30
|
-
return hash >>> 0;
|
|
31
|
-
}
|
|
13
|
+
import { computeStringHash } from "../../../../core/primitives/strings/computeStringHash.js";
|
|
32
14
|
|
|
33
15
|
const MaterialCache = function () {
|
|
34
16
|
this.materialLoader = new MaterialLoader();
|
|
@@ -37,7 +19,7 @@ const MaterialCache = function () {
|
|
|
37
19
|
|
|
38
20
|
MaterialCache.prototype.get = function (json) {
|
|
39
21
|
const str = JSON.stringify(json);
|
|
40
|
-
const hash =
|
|
22
|
+
const hash = computeStringHash(str);
|
|
41
23
|
if (this.table.hasOwnProperty(hash)) {
|
|
42
24
|
return this.table[hash];
|
|
43
25
|
} else {
|
|
@@ -3,38 +3,38 @@ import { computeStringHash } from "../../../../../core/primitives/strings/comput
|
|
|
3
3
|
import { assert } from "../../../../../core/assert.js";
|
|
4
4
|
|
|
5
5
|
export class Decal {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Asset URL
|
|
9
|
+
* @type {string}
|
|
10
|
+
*/
|
|
11
|
+
uri = "";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Controls draw order
|
|
15
|
+
* @type {number}
|
|
16
|
+
*/
|
|
17
|
+
priority = 0;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Color of the decal will be pre-multiplied by this
|
|
21
|
+
* @type {Color}
|
|
22
|
+
*/
|
|
23
|
+
color = new Color(1, 1, 1, 1);
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Internal transient reference to loaded asset
|
|
27
|
+
* @type {Sampler2D|null}
|
|
28
|
+
* @private
|
|
29
|
+
*/
|
|
30
|
+
__cached_sampler = null;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @type {String|null}
|
|
35
|
+
* @private
|
|
36
|
+
*/
|
|
37
|
+
__cached_uri = null;
|
|
38
38
|
|
|
39
39
|
static fromJSON(j) {
|
|
40
40
|
const r = new Decal();
|
|
@@ -387,7 +387,9 @@ export class FPDecalSystem extends AbstractContextSystem {
|
|
|
387
387
|
|
|
388
388
|
const leaves = [];
|
|
389
389
|
|
|
390
|
-
const
|
|
390
|
+
const bvh = this.bvh;
|
|
391
|
+
|
|
392
|
+
const hit_count = bvh_query_leaves_ray(bvh,bvh.root, leaves, 0,
|
|
391
393
|
origin_x, origin_y, origin_z,
|
|
392
394
|
direction_x, direction_y, direction_z
|
|
393
395
|
);
|
|
@@ -399,7 +401,7 @@ export class FPDecalSystem extends AbstractContextSystem {
|
|
|
399
401
|
for (let i = 0; i < hit_count; i++) {
|
|
400
402
|
const node = leaves[i];
|
|
401
403
|
|
|
402
|
-
const entity =
|
|
404
|
+
const entity = bvh.node_get_user_data(node);
|
|
403
405
|
|
|
404
406
|
|
|
405
407
|
/**
|
|
@@ -5,8 +5,8 @@ import { aabb3_matrix4_project } from "../../../../core/geom/3d/aabb/aabb3_matri
|
|
|
5
5
|
import { mat4 } from "gl-matrix";
|
|
6
6
|
import { ray3_array_apply_matrix4 } from "../../../../core/geom/3d/ray/ray3_array_apply_matrix4.js";
|
|
7
7
|
import { GeometrySpatialQueryAccelerator } from "../../geometry/buffered/query/GeometrySpatialQueryAccelerator.js";
|
|
8
|
-
import { assert } from "../../../../core/assert.js";
|
|
9
8
|
import { EBBVHLeafProxy } from "../../../../core/bvh2/bvh3/EBBVHLeafProxy.js";
|
|
9
|
+
import { aabb3_from_threejs_geometry } from "../../../../core/geom/3d/aabb/aabb3_from_threejs_geometry.js";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @readonly
|
|
@@ -267,38 +267,9 @@ export class ShadedGeometry {
|
|
|
267
267
|
|
|
268
268
|
update_bounds() {
|
|
269
269
|
// update bounds
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
const min = gbb.min;
|
|
273
|
-
|
|
274
|
-
const x0 = min.x;
|
|
275
|
-
const y0 = min.y;
|
|
276
|
-
const z0 = min.z;
|
|
277
|
-
|
|
278
|
-
const max = gbb.max;
|
|
279
|
-
|
|
280
|
-
const x1 = max.x;
|
|
281
|
-
const y1 = max.y;
|
|
282
|
-
const z1 = max.z;
|
|
283
|
-
|
|
284
|
-
// validate bounds
|
|
285
|
-
assert.notNaN(x0, 'x0');
|
|
286
|
-
assert.notNaN(y0, 'y0');
|
|
287
|
-
assert.notNaN(z0, 'z0');
|
|
288
|
-
|
|
289
|
-
assert.notNaN(x1, 'x1');
|
|
290
|
-
assert.notNaN(y1, 'y1');
|
|
291
|
-
assert.notNaN(z1, 'z1');
|
|
292
|
-
|
|
293
|
-
// marshal into transform-accepted format
|
|
294
|
-
scratch_aabb3_array[0] = x0;
|
|
295
|
-
scratch_aabb3_array[1] = y0;
|
|
296
|
-
scratch_aabb3_array[2] = z0;
|
|
297
|
-
|
|
298
|
-
scratch_aabb3_array[3] = x1;
|
|
299
|
-
scratch_aabb3_array[4] = y1;
|
|
300
|
-
scratch_aabb3_array[5] = z1;
|
|
270
|
+
aabb3_from_threejs_geometry(scratch_aabb3_array, this.geometry);
|
|
301
271
|
|
|
272
|
+
// transform
|
|
302
273
|
aabb3_matrix4_project(this.__bvh_leaf.bounds, scratch_aabb3_array, this.transform);
|
|
303
274
|
}
|
|
304
275
|
|
|
@@ -315,7 +286,7 @@ export class ShadedGeometry {
|
|
|
315
286
|
mat4.invert(scratch_m4, transform_matrix4);
|
|
316
287
|
|
|
317
288
|
// transform ray to local space
|
|
318
|
-
if (!ray3_array_apply_matrix4(scratch_ray_0,0, ray,0, scratch_m4)) {
|
|
289
|
+
if (!ray3_array_apply_matrix4(scratch_ray_0, 0, ray, 0, scratch_m4)) {
|
|
319
290
|
// invalid transform matrix
|
|
320
291
|
return false;
|
|
321
292
|
}
|
|
@@ -369,7 +369,9 @@ export class ShadedGeometrySystem extends System {
|
|
|
369
369
|
|
|
370
370
|
const hits = [];
|
|
371
371
|
|
|
372
|
-
const
|
|
372
|
+
const bvh = this.__bvh_binary;
|
|
373
|
+
|
|
374
|
+
const hit_count = bvh_query_leaves_generic(hits, 0, bvh, bvh.root, BVHQueryIntersectsRay.from([origin_x, origin_y, origin_z, direction_x, direction_y, direction_z]));
|
|
373
375
|
|
|
374
376
|
const ecd = this.entityManager.dataset;
|
|
375
377
|
|
|
@@ -383,7 +385,7 @@ export class ShadedGeometrySystem extends System {
|
|
|
383
385
|
for (let i = 0; i < hit_count; i++) {
|
|
384
386
|
const node_id = hits[i];
|
|
385
387
|
|
|
386
|
-
const entity =
|
|
388
|
+
const entity = bvh.node_get_user_data(node_id);
|
|
387
389
|
|
|
388
390
|
/**
|
|
389
391
|
*
|
|
@@ -447,7 +449,9 @@ export class ShadedGeometrySystem extends System {
|
|
|
447
449
|
|
|
448
450
|
const hits = [];
|
|
449
451
|
|
|
450
|
-
const
|
|
452
|
+
const bvh = this.__bvh_binary;
|
|
453
|
+
|
|
454
|
+
const hit_count = bvh_query_leaves_generic(hits, 0, bvh, bvh.root, BVHQueryIntersectsRay.from([origin_x, origin_y, origin_z, direction_x, direction_y, direction_z]));
|
|
451
455
|
|
|
452
456
|
const ecd = this.entityManager.dataset;
|
|
453
457
|
|
|
@@ -460,7 +464,7 @@ export class ShadedGeometrySystem extends System {
|
|
|
460
464
|
for (let i = 0; i < hit_count; i++) {
|
|
461
465
|
const node_id = hits[i];
|
|
462
466
|
|
|
463
|
-
const entity =
|
|
467
|
+
const entity = bvh.node_get_user_data(node_id);
|
|
464
468
|
|
|
465
469
|
/**
|
|
466
470
|
*
|
|
@@ -20,10 +20,6 @@ import { randomFromArray } from "../../../../../core/math/random/randomFromArray
|
|
|
20
20
|
import { BehaviorComponent } from "../../../../intelligence/behavior/ecs/BehaviorComponent.js";
|
|
21
21
|
import { OrbitingBehavior } from "../../../../../../../model/game/util/behavior/OrbitingBehavior.js";
|
|
22
22
|
import { BehaviorSystem } from "../../../../intelligence/behavior/ecs/BehaviorSystem.js";
|
|
23
|
-
import {
|
|
24
|
-
MicronShadedGeometryRenderAdapter
|
|
25
|
-
} from "../../../micron/plugin/shaded_geometry/MicronShadedGeometryRenderAdapter.js";
|
|
26
|
-
import { MicronRenderContext } from "../../../micron/render/v1/MicronRenderContext.js";
|
|
27
23
|
import Vector2 from "../../../../../core/geom/Vector2.js";
|
|
28
24
|
|
|
29
25
|
const eh = new EngineHarness();
|
|
@@ -57,14 +53,6 @@ async function main(engine) {
|
|
|
57
53
|
|
|
58
54
|
const sgs = new ShadedGeometrySystem(engine);
|
|
59
55
|
|
|
60
|
-
const mrc = new MicronRenderContext();
|
|
61
|
-
sgs.register_render_adapter(2, () => {
|
|
62
|
-
const adapter = new MicronShadedGeometryRenderAdapter();
|
|
63
|
-
adapter.ctx = mrc;
|
|
64
|
-
|
|
65
|
-
return adapter;
|
|
66
|
-
});
|
|
67
|
-
|
|
68
56
|
await em.addSystem(sgs);
|
|
69
57
|
await em.addSystem(new BehaviorSystem(engine));
|
|
70
58
|
|
|
@@ -38,7 +38,6 @@ import LightSystem from "../light/LightSystem.js";
|
|
|
38
38
|
import AnimationControllerSystem from "../animation/AnimationControllerSystem.js";
|
|
39
39
|
import { AnimationGraphSystem } from "../animation/animator/AnimationGraphSystem.js";
|
|
40
40
|
import { BehaviorSystem } from "../../../intelligence/behavior/ecs/BehaviorSystem.js";
|
|
41
|
-
import { SerializationMetadataSystem } from "../../../ecs/systems/SerializationMetadataSystem.js";
|
|
42
41
|
import { InverseKinematicsSystem } from "../../../ecs/ik/InverseKinematicsSystem.js";
|
|
43
42
|
import { PathDisplaySystem } from "./PathDisplaySystem.js";
|
|
44
43
|
import { PathDisplay } from "./PathDisplay.js";
|
|
@@ -121,7 +120,6 @@ function makeConfig(engine) {
|
|
|
121
120
|
new AnimationGraphSystem(graphics.viewport.size),
|
|
122
121
|
headsUpDisplaySystem,
|
|
123
122
|
new BehaviorSystem(engine),
|
|
124
|
-
new SerializationMetadataSystem(),
|
|
125
123
|
new InverseKinematicsSystem(),
|
|
126
124
|
new ShadedGeometryHighlightSystem(engine),
|
|
127
125
|
new PathDisplaySystem(engine),
|
|
@@ -24,11 +24,10 @@ import WaterSystem from "../../water/WaterSystem.js";
|
|
|
24
24
|
import Trail2DSystem from "../../trail2d/Trail2DSystem.js";
|
|
25
25
|
import { Foliage2System } from "../../../../ecs/foliage/ecs/Foliage2System.js";
|
|
26
26
|
import ViewportPositionSystem from "../../../../ecs/gui/position/ViewportPositionSystem.js";
|
|
27
|
-
import { GridPosition2TransformSystem } from "../../../../grid/
|
|
27
|
+
import { GridPosition2TransformSystem } from "../../../../grid/grid2transform/GridPosition2TransformSystem.js";
|
|
28
28
|
import { Transform2GridPositionSystem } from "../../../../grid/transform2grid/Transform2GridPositionSystem.js";
|
|
29
29
|
import SynchronizePositionSystem from "../../../../ecs/systems/SynchronizePositionSystem.js";
|
|
30
|
-
import
|
|
31
|
-
import GridPositionSystem from "../../../../grid/systems/GridPositionSystem.js";
|
|
30
|
+
import GridPositionSystem from "../../../../grid/position/GridPositionSystem.js";
|
|
32
31
|
import InputControllerSystem from "../../../../input/ecs/systems/InputControllerSystem.js";
|
|
33
32
|
import { InputSystem } from "../../../../input/ecs/systems/InputSystem.js";
|
|
34
33
|
import MeshHighlightSystem from "../../highlight/system/MeshHighlightSystem.js";
|
|
@@ -36,7 +35,6 @@ import LightSystem from "../../light/LightSystem.js";
|
|
|
36
35
|
import AnimationControllerSystem from "../../animation/AnimationControllerSystem.js";
|
|
37
36
|
import { AnimationGraphSystem } from "../../animation/animator/AnimationGraphSystem.js";
|
|
38
37
|
import { BehaviorSystem } from "../../../../intelligence/behavior/ecs/BehaviorSystem.js";
|
|
39
|
-
import { SerializationMetadataSystem } from "../../../../ecs/systems/SerializationMetadataSystem.js";
|
|
40
38
|
import { InverseKinematicsSystem } from "../../../../ecs/ik/InverseKinematicsSystem.js";
|
|
41
39
|
import { PathDisplaySystem } from "../PathDisplaySystem.js";
|
|
42
40
|
import {
|
|
@@ -119,7 +117,6 @@ function makeConfig(engine) {
|
|
|
119
117
|
new GridPosition2TransformSystem(),
|
|
120
118
|
new Transform2GridPositionSystem(),
|
|
121
119
|
new SynchronizePositionSystem(),
|
|
122
|
-
new GridObstacleSystem(),
|
|
123
120
|
new GridPositionSystem(),
|
|
124
121
|
new InputControllerSystem(devices),
|
|
125
122
|
new InputSystem(devices),
|
|
@@ -131,7 +128,6 @@ function makeConfig(engine) {
|
|
|
131
128
|
new AnimationGraphSystem(graphics.viewport.size),
|
|
132
129
|
headsUpDisplaySystem,
|
|
133
130
|
new BehaviorSystem(engine),
|
|
134
|
-
new SerializationMetadataSystem(),
|
|
135
131
|
new InverseKinematicsSystem(),
|
|
136
132
|
new PathDisplaySystem(engine),
|
|
137
133
|
);
|
|
@@ -11,11 +11,10 @@ import { MeshSystem } from "../../mesh/MeshSystem.js";
|
|
|
11
11
|
import TerrainSystem from "../../../../ecs/terrain/ecs/TerrainSystem.js";
|
|
12
12
|
import WaterSystem from "../../water/WaterSystem.js";
|
|
13
13
|
import ViewportPositionSystem from "../../../../ecs/gui/position/ViewportPositionSystem.js";
|
|
14
|
-
import { GridPosition2TransformSystem } from "../../../../grid/
|
|
14
|
+
import { GridPosition2TransformSystem } from "../../../../grid/grid2transform/GridPosition2TransformSystem.js";
|
|
15
15
|
import { Transform2GridPositionSystem } from "../../../../grid/transform2grid/Transform2GridPositionSystem.js";
|
|
16
16
|
import SynchronizePositionSystem from "../../../../ecs/systems/SynchronizePositionSystem.js";
|
|
17
|
-
import
|
|
18
|
-
import GridPositionSystem from "../../../../grid/systems/GridPositionSystem.js";
|
|
17
|
+
import GridPositionSystem from "../../../../grid/position/GridPositionSystem.js";
|
|
19
18
|
import InputControllerSystem from "../../../../input/ecs/systems/InputControllerSystem.js";
|
|
20
19
|
import { InputSystem } from "../../../../input/ecs/systems/InputSystem.js";
|
|
21
20
|
import MeshHighlightSystem from "../../highlight/system/MeshHighlightSystem.js";
|
|
@@ -54,7 +53,6 @@ function makeConfig(engine) {
|
|
|
54
53
|
new GridPosition2TransformSystem(),
|
|
55
54
|
new Transform2GridPositionSystem(),
|
|
56
55
|
new SynchronizePositionSystem(),
|
|
57
|
-
new GridObstacleSystem(),
|
|
58
56
|
new GridPositionSystem(),
|
|
59
57
|
new InputControllerSystem(devices),
|
|
60
58
|
new InputSystem(devices),
|
package/src/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js
CHANGED
|
@@ -22,7 +22,6 @@ import { InputSystem } from "../../../../../../input/ecs/systems/InputSystem.js"
|
|
|
22
22
|
import MeshHighlightSystem from "../../../../../ecs/highlight/system/MeshHighlightSystem.js";
|
|
23
23
|
import LightSystem from "../../../../../ecs/light/LightSystem.js";
|
|
24
24
|
import { BehaviorSystem } from "../../../../../../intelligence/behavior/ecs/BehaviorSystem.js";
|
|
25
|
-
import { SerializationMetadataSystem } from "../../../../../../ecs/systems/SerializationMetadataSystem.js";
|
|
26
25
|
import { PathDisplaySystem } from "../../../../../ecs/path/PathDisplaySystem.js";
|
|
27
26
|
import RenderSystem from "../../../../../../ecs/systems/RenderSystem.js";
|
|
28
27
|
import { makeEngineOptionsModel } from "../../../../../../../../../model/game/options/makeEngineOptionsModel.js";
|
|
@@ -125,7 +124,6 @@ function makeConfig(engine) {
|
|
|
125
124
|
}),
|
|
126
125
|
headsUpDisplaySystem,
|
|
127
126
|
new BehaviorSystem(engine),
|
|
128
|
-
new SerializationMetadataSystem(),
|
|
129
127
|
new PathDisplaySystem(engine),
|
|
130
128
|
new ParticleEmitterSystem(engine),
|
|
131
129
|
new ShadedGeometrySystem(engine)
|
|
@@ -24,11 +24,10 @@ import WaterSystem from "../../../ecs/water/WaterSystem.js";
|
|
|
24
24
|
import Trail2DSystem from "../../../ecs/trail2d/Trail2DSystem.js";
|
|
25
25
|
import { Foliage2System } from "../../../../ecs/foliage/ecs/Foliage2System.js";
|
|
26
26
|
import ViewportPositionSystem from "../../../../ecs/gui/position/ViewportPositionSystem.js";
|
|
27
|
-
import { GridPosition2TransformSystem } from "../../../../grid/
|
|
27
|
+
import { GridPosition2TransformSystem } from "../../../../grid/grid2transform/GridPosition2TransformSystem.js";
|
|
28
28
|
import { Transform2GridPositionSystem } from "../../../../grid/transform2grid/Transform2GridPositionSystem.js";
|
|
29
29
|
import SynchronizePositionSystem from "../../../../ecs/systems/SynchronizePositionSystem.js";
|
|
30
|
-
import
|
|
31
|
-
import GridPositionSystem from "../../../../grid/systems/GridPositionSystem.js";
|
|
30
|
+
import GridPositionSystem from "../../../../grid/position/GridPositionSystem.js";
|
|
32
31
|
import InputControllerSystem from "../../../../input/ecs/systems/InputControllerSystem.js";
|
|
33
32
|
import { InputSystem } from "../../../../input/ecs/systems/InputSystem.js";
|
|
34
33
|
import MeshHighlightSystem from "../../../ecs/highlight/system/MeshHighlightSystem.js";
|
|
@@ -38,7 +37,6 @@ import { AnimationGraphSystem } from "../../../ecs/animation/animator/AnimationG
|
|
|
38
37
|
import { FogOfWarSystem } from "../../../../ecs/fow/FogOfWarSystem.js";
|
|
39
38
|
import { FogOfWarRevealerSystem } from "../../../../ecs/fow/FogOfWarRevealerSystem.js";
|
|
40
39
|
import { BehaviorSystem } from "../../../../intelligence/behavior/ecs/BehaviorSystem.js";
|
|
41
|
-
import { SerializationMetadataSystem } from "../../../../ecs/systems/SerializationMetadataSystem.js";
|
|
42
40
|
import { InverseKinematicsSystem } from "../../../../ecs/ik/InverseKinematicsSystem.js";
|
|
43
41
|
import { CanvasView } from "../../../../../view/elements/CanvasView.js";
|
|
44
42
|
import Vector3 from "../../../../../core/geom/Vector3.js";
|
|
@@ -111,7 +109,6 @@ function makeConfig(engine) {
|
|
|
111
109
|
new GridPosition2TransformSystem(),
|
|
112
110
|
new Transform2GridPositionSystem(),
|
|
113
111
|
new SynchronizePositionSystem(),
|
|
114
|
-
new GridObstacleSystem(),
|
|
115
112
|
new GridPositionSystem(),
|
|
116
113
|
new InputControllerSystem(devices),
|
|
117
114
|
new InputSystem(devices),
|
|
@@ -125,7 +122,6 @@ function makeConfig(engine) {
|
|
|
125
122
|
new FogOfWarSystem(graphics),
|
|
126
123
|
new FogOfWarRevealerSystem(0),
|
|
127
124
|
new BehaviorSystem(engine),
|
|
128
|
-
new SerializationMetadataSystem(),
|
|
129
125
|
new InverseKinematicsSystem(),
|
|
130
126
|
new PathDisplaySystem(engine),
|
|
131
127
|
);
|
|
@@ -25,11 +25,10 @@ import WaterSystem from "../../../ecs/water/WaterSystem.js";
|
|
|
25
25
|
import Trail2DSystem from "../../../ecs/trail2d/Trail2DSystem.js";
|
|
26
26
|
import { Foliage2System } from "../../../../ecs/foliage/ecs/Foliage2System.js";
|
|
27
27
|
import ViewportPositionSystem from "../../../../ecs/gui/position/ViewportPositionSystem.js";
|
|
28
|
-
import { GridPosition2TransformSystem } from "../../../../grid/
|
|
28
|
+
import { GridPosition2TransformSystem } from "../../../../grid/grid2transform/GridPosition2TransformSystem.js";
|
|
29
29
|
import { Transform2GridPositionSystem } from "../../../../grid/transform2grid/Transform2GridPositionSystem.js";
|
|
30
30
|
import SynchronizePositionSystem from "../../../../ecs/systems/SynchronizePositionSystem.js";
|
|
31
|
-
import
|
|
32
|
-
import GridPositionSystem from "../../../../grid/systems/GridPositionSystem.js";
|
|
31
|
+
import GridPositionSystem from "../../../../grid/position/GridPositionSystem.js";
|
|
33
32
|
import InputControllerSystem from "../../../../input/ecs/systems/InputControllerSystem.js";
|
|
34
33
|
import { InputSystem } from "../../../../input/ecs/systems/InputSystem.js";
|
|
35
34
|
import MeshHighlightSystem from "../../../ecs/highlight/system/MeshHighlightSystem.js";
|
|
@@ -39,7 +38,6 @@ import { AnimationGraphSystem } from "../../../ecs/animation/animator/AnimationG
|
|
|
39
38
|
import { FogOfWarSystem } from "../../../../ecs/fow/FogOfWarSystem.js";
|
|
40
39
|
import { FogOfWarRevealerSystem } from "../../../../ecs/fow/FogOfWarRevealerSystem.js";
|
|
41
40
|
import { BehaviorSystem } from "../../../../intelligence/behavior/ecs/BehaviorSystem.js";
|
|
42
|
-
import { SerializationMetadataSystem } from "../../../../ecs/systems/SerializationMetadataSystem.js";
|
|
43
41
|
import { InverseKinematicsSystem } from "../../../../ecs/ik/InverseKinematicsSystem.js";
|
|
44
42
|
import { PathDisplaySystem } from "../../../ecs/path/PathDisplaySystem.js";
|
|
45
43
|
import {
|
|
@@ -139,7 +137,6 @@ function makeConfig(engine) {
|
|
|
139
137
|
new GridPosition2TransformSystem(),
|
|
140
138
|
new Transform2GridPositionSystem(),
|
|
141
139
|
new SynchronizePositionSystem(),
|
|
142
|
-
new GridObstacleSystem(),
|
|
143
140
|
new GridPositionSystem(),
|
|
144
141
|
new InputControllerSystem(devices),
|
|
145
142
|
new InputSystem(devices),
|
|
@@ -154,7 +151,6 @@ function makeConfig(engine) {
|
|
|
154
151
|
new FogOfWarSystem(graphics),
|
|
155
152
|
new FogOfWarRevealerSystem(0),
|
|
156
153
|
new BehaviorSystem(engine),
|
|
157
|
-
new SerializationMetadataSystem(),
|
|
158
154
|
new InverseKinematicsSystem(),
|
|
159
155
|
new PathDisplaySystem(engine),
|
|
160
156
|
new ShadedGeometrySystem(engine)
|
|
@@ -24,7 +24,6 @@ import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js";
|
|
|
24
24
|
import { MouseEvents } from "../../../../input/devices/events/MouseEvents.js";
|
|
25
25
|
import { RingBuffer } from "../../../../../core/collection/RingBuffer.js";
|
|
26
26
|
import { query_bvh_frustum_from_objects } from "../query/query_bvh_frustum_from_objects.js";
|
|
27
|
-
import { prettyPrint } from "../../../../../core/NumberFormat.js";
|
|
28
27
|
import { FPlusDebugMaterial } from "../materials/FPlusDebugMaterial.js";
|
|
29
28
|
import { parseColor } from "../../../../../core/color/parseColor.js";
|
|
30
29
|
import { buildLightClusterWidget } from "../debug/buildLightClusterWidget.js";
|
|
@@ -66,6 +65,7 @@ import { Localization } from "../../../../../core/localization/Localization.js";
|
|
|
66
65
|
import '../../../../../../../../../css/game.scss'
|
|
67
66
|
import { randomFromArray } from "../../../../../core/math/random/randomFromArray.js";
|
|
68
67
|
import { debugAtlas } from "../../../particles/particular/engine/shader/debugAtlas.js";
|
|
68
|
+
import { number_pretty_print } from "../../../../../core/primitives/numbers/number_pretty_print.js";
|
|
69
69
|
|
|
70
70
|
document.body.style.margin = 0;
|
|
71
71
|
|
|
@@ -1523,7 +1523,7 @@ function print_perf_stats() {
|
|
|
1523
1523
|
|
|
1524
1524
|
metric.computeStats(stats);
|
|
1525
1525
|
|
|
1526
|
-
values.push(`${m}: ${
|
|
1526
|
+
values.push(`${m}: ${number_pretty_print(stats.mean)}`);
|
|
1527
1527
|
});
|
|
1528
1528
|
|
|
1529
1529
|
console.log(values.join(", "));
|
|
@@ -24,11 +24,10 @@ import WaterSystem from "../../../ecs/water/WaterSystem.js";
|
|
|
24
24
|
import Trail2DSystem from "../../../ecs/trail2d/Trail2DSystem.js";
|
|
25
25
|
import { Foliage2System } from "../../../../ecs/foliage/ecs/Foliage2System.js";
|
|
26
26
|
import ViewportPositionSystem from "../../../../ecs/gui/position/ViewportPositionSystem.js";
|
|
27
|
-
import { GridPosition2TransformSystem } from "../../../../grid/
|
|
27
|
+
import { GridPosition2TransformSystem } from "../../../../grid/grid2transform/GridPosition2TransformSystem.js";
|
|
28
28
|
import { Transform2GridPositionSystem } from "../../../../grid/transform2grid/Transform2GridPositionSystem.js";
|
|
29
29
|
import SynchronizePositionSystem from "../../../../ecs/systems/SynchronizePositionSystem.js";
|
|
30
|
-
import
|
|
31
|
-
import GridPositionSystem from "../../../../grid/systems/GridPositionSystem.js";
|
|
30
|
+
import GridPositionSystem from "../../../../grid/position/GridPositionSystem.js";
|
|
32
31
|
import InputControllerSystem from "../../../../input/ecs/systems/InputControllerSystem.js";
|
|
33
32
|
import { InputSystem } from "../../../../input/ecs/systems/InputSystem.js";
|
|
34
33
|
import MeshHighlightSystem from "../../../ecs/highlight/system/MeshHighlightSystem.js";
|
|
@@ -38,7 +37,6 @@ import { AnimationGraphSystem } from "../../../ecs/animation/animator/AnimationG
|
|
|
38
37
|
import { FogOfWarSystem } from "../../../../ecs/fow/FogOfWarSystem.js";
|
|
39
38
|
import { FogOfWarRevealerSystem } from "../../../../ecs/fow/FogOfWarRevealerSystem.js";
|
|
40
39
|
import { BehaviorSystem } from "../../../../intelligence/behavior/ecs/BehaviorSystem.js";
|
|
41
|
-
import { SerializationMetadataSystem } from "../../../../ecs/systems/SerializationMetadataSystem.js";
|
|
42
40
|
import { InverseKinematicsSystem } from "../../../../ecs/ik/InverseKinematicsSystem.js";
|
|
43
41
|
import Vector3 from "../../../../../core/geom/Vector3.js";
|
|
44
42
|
import Vector2 from "../../../../../core/geom/Vector2.js";
|
|
@@ -55,7 +53,6 @@ import ViewportPosition from "../../../../ecs/gui/position/ViewportPosition.js";
|
|
|
55
53
|
import GUIElement from "../../../../ecs/gui/GUIElement.js";
|
|
56
54
|
import { MetricCollection } from "../../../../development/performance/MetricCollection.js";
|
|
57
55
|
import { MetricStatistics } from "../../../../development/performance/MetricStatistics.js";
|
|
58
|
-
import { prettyPrint } from "../../../../../core/NumberFormat.js";
|
|
59
56
|
import { buildCanvasViewFromTexture } from "./buildCanvasViewFromTexture.js";
|
|
60
57
|
import { BatchOcclusionQuery } from "./query/BatchOcclusionQuery.js";
|
|
61
58
|
import HeadsUpDisplay from "../../../../ecs/gui/hud/HeadsUpDisplay.js";
|
|
@@ -69,6 +66,7 @@ import { min2 } from "../../../../../core/math/min2.js";
|
|
|
69
66
|
import { mat4 } from "gl-matrix";
|
|
70
67
|
import { randomFloatBetween } from "../../../../../core/math/random/randomFloatBetween.js";
|
|
71
68
|
import { load_and_set_cubemap_v0 } from "../../../load_and_set_cubemap_v0.js";
|
|
69
|
+
import { number_pretty_print } from "../../../../../core/primitives/numbers/number_pretty_print.js";
|
|
72
70
|
|
|
73
71
|
const engineHarness = new EngineHarness();
|
|
74
72
|
|
|
@@ -115,7 +113,6 @@ function makeConfig(engine) {
|
|
|
115
113
|
new GridPosition2TransformSystem(),
|
|
116
114
|
new Transform2GridPositionSystem(),
|
|
117
115
|
new SynchronizePositionSystem(),
|
|
118
|
-
new GridObstacleSystem(),
|
|
119
116
|
new GridPositionSystem(),
|
|
120
117
|
new InputControllerSystem(devices),
|
|
121
118
|
new InputSystem(devices),
|
|
@@ -129,7 +126,6 @@ function makeConfig(engine) {
|
|
|
129
126
|
new FogOfWarSystem(graphics),
|
|
130
127
|
new FogOfWarRevealerSystem(0),
|
|
131
128
|
new BehaviorSystem(engine),
|
|
132
|
-
new SerializationMetadataSystem(),
|
|
133
129
|
new InverseKinematicsSystem(),
|
|
134
130
|
new PathDisplaySystem(engine),
|
|
135
131
|
);
|
|
@@ -186,7 +182,7 @@ function print_perf_stats() {
|
|
|
186
182
|
|
|
187
183
|
metric.computeStats(stats);
|
|
188
184
|
|
|
189
|
-
values.push(`${m}: ${
|
|
185
|
+
values.push(`${m}: ${number_pretty_print(stats.mean)}`);
|
|
190
186
|
});
|
|
191
187
|
|
|
192
188
|
console.log(values.join(", "));
|
|
@@ -179,7 +179,8 @@ export class GeometryBVHBatched {
|
|
|
179
179
|
|
|
180
180
|
// TODO we can unify BVH traversal with ray checks to reduce number of checks
|
|
181
181
|
const count = bvh_query_leaves_ray(
|
|
182
|
-
bvh,
|
|
182
|
+
bvh, bvh.root,
|
|
183
|
+
leaf_buffer, 0,
|
|
183
184
|
origin_x, origin_y, origin_z,
|
|
184
185
|
direction_x, direction_y, direction_z
|
|
185
186
|
);
|
|
@@ -378,7 +378,12 @@ export class PathTracer {
|
|
|
378
378
|
*/
|
|
379
379
|
trace(out, ray, min_distance, max_distance) {
|
|
380
380
|
const bvh = this.bvh_top_level;
|
|
381
|
-
|
|
381
|
+
|
|
382
|
+
const hit_count = bvh_query_leaves_ray(
|
|
383
|
+
bvh, bvh.root,
|
|
384
|
+
temp_ray_results, 0,
|
|
385
|
+
ray[0], ray[1], ray[2], ray[3], ray[4], ray[5]
|
|
386
|
+
);
|
|
382
387
|
|
|
383
388
|
let nearest_hit_distance = max_distance;
|
|
384
389
|
let nearest_mesh = null;
|
|
@@ -13,7 +13,6 @@ import { Sampler2D } from "../../texture/sampler/Sampler2D.js";
|
|
|
13
13
|
import sampler2D2Canvas from "../../texture/sampler/Sampler2D2Canvas.js";
|
|
14
14
|
import { ray3_array_compose } from "../../../../core/geom/3d/ray/ray3_array_compose.js";
|
|
15
15
|
import { Transform } from "../../../ecs/transform/Transform.js";
|
|
16
|
-
import { prettyPrint } from "../../../../core/NumberFormat.js";
|
|
17
16
|
import { float2uint8 } from "../../../../core/binary/float2uint8.js";
|
|
18
17
|
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader.js";
|
|
19
18
|
import { Camera } from "../../ecs/camera/Camera.js";
|
|
@@ -38,6 +37,7 @@ import { min2 } from "../../../../core/math/min2.js";
|
|
|
38
37
|
import { makeGeometryIndexed } from "../../geometry/buffered/makeGeometryIndexed.js";
|
|
39
38
|
import { DirectionalLight } from "../../render/forward_plus/model/DirectionalLight.js";
|
|
40
39
|
import { kelvin_to_rgb } from "../../../../core/color/kelvin_to_rgb.js";
|
|
40
|
+
import { number_pretty_print } from "../../../../core/primitives/numbers/number_pretty_print.js";
|
|
41
41
|
|
|
42
42
|
document.body.style.margin = 0;
|
|
43
43
|
document.body.style.overflow = "hidden";
|
|
@@ -500,7 +500,7 @@ function* render(target, pt, camera, progress = { current: 0, total: 0 }) {
|
|
|
500
500
|
|
|
501
501
|
const total_time = performance.now() - t0;
|
|
502
502
|
|
|
503
|
-
console.log(`Trace finished in ${
|
|
503
|
+
console.log(`Trace finished in ${number_pretty_print(total_time)}ms. Total of ${number_pretty_print(sample_count)} samples, ${number_pretty_print(sample_count * 1000 / total_time)} samples per second`);
|
|
504
504
|
|
|
505
505
|
}
|
|
506
506
|
|
|
@@ -23,7 +23,6 @@ import { InputSystem } from "../../input/ecs/systems/InputSystem.js";
|
|
|
23
23
|
import MeshHighlightSystem from "../ecs/highlight/system/MeshHighlightSystem.js";
|
|
24
24
|
import LightSystem from "../ecs/light/LightSystem.js";
|
|
25
25
|
import { BehaviorSystem } from "../../intelligence/behavior/ecs/BehaviorSystem.js";
|
|
26
|
-
import { SerializationMetadataSystem } from "../../ecs/systems/SerializationMetadataSystem.js";
|
|
27
26
|
import { PathDisplaySystem } from "../ecs/path/PathDisplaySystem.js";
|
|
28
27
|
import { ParticleEmitterSystem } from "../particles/ecs/ParticleEmitterSystem.js";
|
|
29
28
|
import { ShadedGeometrySystem } from "../ecs/mesh-v2/ShadedGeometrySystem.js";
|
|
@@ -96,7 +95,6 @@ function makeConfig(engine) {
|
|
|
96
95
|
}),
|
|
97
96
|
headsUpDisplaySystem,
|
|
98
97
|
new BehaviorSystem(engine),
|
|
99
|
-
new SerializationMetadataSystem(),
|
|
100
98
|
new PathDisplaySystem(engine),
|
|
101
99
|
new ParticleEmitterSystem(engine),
|
|
102
100
|
new ShadedGeometrySystem(engine),
|
|
@@ -21,7 +21,10 @@ const DATA_TEXTURE_WIDTH = 128;
|
|
|
21
21
|
const SHRINK_FACTOR = 0.5;
|
|
22
22
|
const GROW_FACTOR = 1.05;
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Mainly used for storing non-color data in GPU memory
|
|
26
|
+
* Useful for things like simulation and running general purpose GPU compute inside fragment shaders
|
|
27
|
+
*/
|
|
25
28
|
export class TextureBackedMemoryRegion {
|
|
26
29
|
|
|
27
30
|
constructor() {
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
compute_typed_array_constructor_from_data_type
|
|
16
16
|
} from "../../../../core/binary/type/DataType2TypedArrayConstructorMapping.js";
|
|
17
17
|
import { Base64 } from "../../../../core/binary/Base64.js";
|
|
18
|
-
import { computeStridedIntegerArrayHash } from "
|
|
18
|
+
import { computeStridedIntegerArrayHash } from "../../../../core/primitives/array/computeStridedIntegerArrayHash.js";
|
|
19
19
|
import { is_typed_array_equals } from "../../../../core/collection/array/typed/is_typed_array_equals.js";
|
|
20
20
|
|
|
21
21
|
/**
|