@aethervtt/shard-terrain 0.0.1 → 0.1.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/dist/render.js CHANGED
@@ -7,6 +7,7 @@ import {
7
7
  import { Mesh } from "@aethervtt/shard-mesh";
8
8
  import { computeOrigins } from "@aethervtt/shard-noise";
9
9
  import {
10
+ addRenderFeatures,
10
11
  Camera3d,
11
12
  Cameras,
12
13
  DebugOverlays,
@@ -35,7 +36,7 @@ import {
35
36
  } from "@aethervtt/shard-transform";
36
37
  import { chunkCenter, chunkIndices, chunkLayout } from "./chunk.js";
37
38
  import { collidersOf, skirtDepth } from "./colliders.js";
38
- import { Chunk, TerrainBudget } from "./components.js";
39
+ import { Chunk, Planet, TerrainBudget } from "./components.js";
39
40
  import { keyString } from "./cube.js";
40
41
  import { Terrain } from "./heights.js";
41
42
  import {
@@ -1160,6 +1161,13 @@ function registerNode(app) {
1160
1161
  for (const [path, source] of Object.entries(TERRAIN_SHADERS)) {
1161
1162
  app.world.resource(Shaders).register(path, source, "@aethervtt/shard-terrain");
1162
1163
  }
1164
+ addRenderFeatures(app.world, {
1165
+ name: "terrain",
1166
+ description: "Planet terrain: GPU heights, chunk vertices and normal tiles.",
1167
+ nodes: ["terrain/generate"],
1168
+ baseline: "unsupported",
1169
+ components: [Planet]
1170
+ });
1163
1171
  graph.addNode("terrain/generate", {
1164
1172
  kind: "raw",
1165
1173
  phase: RenderPhase.Setup,
@@ -1187,7 +1195,7 @@ function registerNode(app) {
1187
1195
  (name) => ctx.timestamps(name)
1188
1196
  );
1189
1197
  world.tryResource(ProfilerResource)?.record("terrain/encode", performance.now() - t0);
1190
- }
1198
+ } else pr.stats.lastFrameJobs = 0;
1191
1199
  pr.stats.gpuFrames++;
1192
1200
  }
1193
1201
  }
@@ -29,7 +29,7 @@ async function planetApp(gpu, o) {
29
29
  const app = new App().addPlugin(TransformPlugin);
30
30
  if (gpu)
31
31
  app.addPlugin(renderPlugin({ gpu, windowView: false }), forwardPlugin({ msaa: o.msaa ?? 1 }));
32
- if (o.physics) app.addPlugin(physics3dPlugin);
32
+ if (o.physics) app.addPlugin(physics3dPlugin());
33
33
  app.addPlugin(terrainPlugin(), ...o.extra ?? []);
34
34
  await app.init();
35
35
  const world = app.world;
package/dist/testing.js CHANGED
@@ -33,7 +33,7 @@ async function walkChecksum(characters = 4, seconds = 3) {
33
33
  const t0 = performance.now();
34
34
  await loadNoiseKernel();
35
35
  const graph = NoiseGraph.fromJson(WALK_PLANET);
36
- const app = new App().addPlugin(TransformPlugin, physics3dPlugin, terrainPlugin());
36
+ const app = new App().addPlugin(TransformPlugin, physics3dPlugin(), terrainPlugin());
37
37
  await app.init();
38
38
  const w = app.world;
39
39
  const R = 6371e3;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aethervtt/shard-terrain",
3
- "version": "0.0.1",
3
+ "version": "0.1.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -20,20 +20,20 @@
20
20
  "README.md"
21
21
  ],
22
22
  "dependencies": {
23
- "@aethervtt/shard-assets": "0.0.1",
24
- "@aethervtt/shard-core": "0.0.1",
25
- "@aethervtt/shard-gpu": "0.0.1",
26
- "@aethervtt/shard-mesh": "0.0.1",
27
- "@aethervtt/shard-nav": "0.0.1",
28
- "@aethervtt/shard-noise": "0.0.1",
29
- "@aethervtt/shard-physics": "0.0.1",
30
- "@aethervtt/shard-platform": "0.0.1",
31
- "@aethervtt/shard-protocol": "0.0.1",
32
- "@aethervtt/shard-render": "0.0.1",
33
- "@aethervtt/shard-runtime": "0.0.1",
34
- "@aethervtt/shard-shader": "0.0.1",
35
- "@aethervtt/shard-texture": "0.0.1",
36
- "@aethervtt/shard-transform": "0.0.1"
23
+ "@aethervtt/shard-assets": "0.1.0",
24
+ "@aethervtt/shard-core": "0.1.0",
25
+ "@aethervtt/shard-gpu": "0.1.0",
26
+ "@aethervtt/shard-mesh": "0.1.0",
27
+ "@aethervtt/shard-nav": "0.1.0",
28
+ "@aethervtt/shard-noise": "0.1.0",
29
+ "@aethervtt/shard-physics": "0.1.0",
30
+ "@aethervtt/shard-platform": "0.1.0",
31
+ "@aethervtt/shard-protocol": "0.1.0",
32
+ "@aethervtt/shard-render": "0.1.0",
33
+ "@aethervtt/shard-runtime": "0.1.0",
34
+ "@aethervtt/shard-shader": "0.1.0",
35
+ "@aethervtt/shard-texture": "0.1.0",
36
+ "@aethervtt/shard-transform": "0.1.0"
37
37
  },
38
38
  "repository": {
39
39
  "type": "git",
@@ -45,6 +45,6 @@
45
45
  "provenance": true
46
46
  },
47
47
  "shard": {
48
- "buildSha": "d6c5c6aef4675575c878b02cf2c8f738b4190229"
48
+ "buildSha": "8e14c9896f82a3554b156f1ffdd68f2cc3e7d78a"
49
49
  }
50
50
  }