@plasius/gpu-world-generator 0.0.11 → 0.0.12

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/index.d.cts CHANGED
@@ -449,6 +449,44 @@ type WorldGeneratorWorkerProfileName = "streaming" | "bake";
449
449
  type WorldGeneratorWorkerDomain = "geometry" | "textures" | "custom";
450
450
  type WorldGeneratorWorkerAuthority = "visual" | "non-authoritative-simulation" | "authoritative";
451
451
  type WorldGeneratorWorkerImportance = "medium" | "high" | "critical";
452
+ type WorldGeneratorRepresentationBand = "near" | "mid" | "far" | "horizon";
453
+ type WorldGeneratorRepresentationOutput = "liveGeometry" | "simplifiedGeometry" | "rtProxy" | "mergedProxy" | "horizonShell";
454
+ type WorldGeneratorRepresentationRtParticipation = "full" | "selective" | "proxy" | "disabled";
455
+ type WorldGeneratorRepresentationShadowRelevance = "ray-traced-primary" | "selective-raster" | "proxy-caster" | "baked-impression";
456
+ interface WorldGeneratorRepresentationCadence {
457
+ readonly kind: "per-frame" | "interval";
458
+ readonly divisor: number;
459
+ }
460
+ interface WorldGeneratorRepresentationDescriptor {
461
+ readonly id: string;
462
+ readonly chunkId: string;
463
+ readonly profile: WorldGeneratorWorkerProfileName;
464
+ readonly band: WorldGeneratorRepresentationBand;
465
+ readonly output: WorldGeneratorRepresentationOutput;
466
+ readonly rasterMode: "full-live" | "simplified-live" | "proxy" | "not-rendered" | "horizon-shell";
467
+ readonly rtParticipation: WorldGeneratorRepresentationRtParticipation;
468
+ readonly shadowRelevance: WorldGeneratorRepresentationShadowRelevance;
469
+ readonly refreshCadence: WorldGeneratorRepresentationCadence;
470
+ readonly preservesChunkIdentity: boolean;
471
+ readonly sourceChunkIds: readonly string[];
472
+ readonly sourceJobKeys: readonly string[];
473
+ readonly suggestedAllocationIds: readonly string[];
474
+ readonly scheduling: Readonly<{
475
+ owner: "renderer";
476
+ queueClass: typeof worldGeneratorWorkerQueueClass;
477
+ priorityHint: number;
478
+ gameplayImportance: WorldGeneratorWorkerImportance;
479
+ representationBand: WorldGeneratorRepresentationBand;
480
+ }>;
481
+ }
482
+ interface WorldGeneratorRepresentationPlan {
483
+ readonly schemaVersion: 1;
484
+ readonly owner: typeof worldGeneratorDebugOwner;
485
+ readonly profile: WorldGeneratorWorkerProfileName;
486
+ readonly chunkId: string;
487
+ readonly representations: readonly WorldGeneratorRepresentationDescriptor[];
488
+ readonly bands: readonly WorldGeneratorRepresentationBand[];
489
+ }
452
490
  interface WorldGeneratorWorkerBudgetLevelConfig {
453
491
  maxDispatchesPerFrame: number;
454
492
  maxJobsPerDispatch: number;
@@ -512,10 +550,17 @@ interface WorldGeneratorWorkerManifest {
512
550
  declare const worldGeneratorDebugOwner = "world-generator";
513
551
  declare const worldGeneratorWorkerQueueClass = "voxel";
514
552
  declare const defaultWorldGeneratorWorkerProfile = "streaming";
553
+ declare const worldGeneratorRepresentationBands: readonly WorldGeneratorRepresentationBand[];
554
+ declare const worldGeneratorRepresentationOutputs: readonly WorldGeneratorRepresentationOutput[];
515
555
  declare const worldGeneratorWorkerProfiles: Readonly<Record<WorldGeneratorWorkerProfileName, WorldGeneratorWorkerProfile>>;
516
556
  declare const worldGeneratorWorkerProfileNames: readonly WorldGeneratorWorkerProfileName[];
517
557
  declare const worldGeneratorWorkerManifests: Readonly<Record<WorldGeneratorWorkerProfileName, WorldGeneratorWorkerManifest>>;
518
558
  declare function getWorldGeneratorWorkerProfile(name?: WorldGeneratorWorkerProfileName): WorldGeneratorWorkerProfile;
519
559
  declare function getWorldGeneratorWorkerManifest(name?: WorldGeneratorWorkerProfileName): WorldGeneratorWorkerManifest;
560
+ declare function createWorldGeneratorRepresentationPlan(options: {
561
+ profile?: WorldGeneratorWorkerProfileName;
562
+ chunkId: string;
563
+ gameplayImportance?: WorldGeneratorWorkerImportance;
564
+ }): WorldGeneratorRepresentationPlan;
520
565
 
521
- export { DEFAULT_TILE_SIZE_WORLD, FIELD_DOWNWARD_MAX, FIELD_UPWARD_MIN, FRACTAL_ASSET_VERSION, FRACTAL_SAMPLE_STRIDE, type FieldParams, type FieldSample, type FractalAsset, type FractalAssetPayload, type FractalMandelSettings, type FractalPrepassRunOptions, type FractalPrepassRunner, type HexCell, type HexLevelSpec, MacroBiome, type MacroBiomeId, MacroBiomeLabel, type MeshBuilder, type MeshBuilderOptions, type MeshGeomorph, MicroFeature, type MicroFeatureId, MicroFeatureLabel, type MixedForestLayer, type MixedForestOptions, type PerfMonitor, type PerfMonitorOptions, type PerfMonitorUpdate, SlopeBand, type SlopeBandId, SlopeBandLabel, SurfaceCover, type SurfaceCoverId, SurfaceCoverLabel, TILE_ASSET_VERSION, TerrainBiome, type TerrainBiomeId, TerrainBiomeLabel, type TerrainCell, type TerrainParams, type TileAsset, type TileAssetPayload, type TileBakeOutput, type TileBakeWriter, TileCache, type TileCacheEntry, type TileCacheOptions, type TileCacheStatus, type TileGenerator, type TileKey, type Vec3, type WorldGeneratorWorkerAuthority, type WorldGeneratorWorkerBudgetLevel, type WorldGeneratorWorkerBudgetLevelConfig, type WorldGeneratorWorkerDomain, type WorldGeneratorWorkerImportance, type WorldGeneratorWorkerManifest, type WorldGeneratorWorkerManifestJob, type WorldGeneratorWorkerProfile, type WorldGeneratorWorkerProfileName, type WorldGeneratorWorkerQueueClass, assetMatches, axialToWorld, bakeTileAsset, buildHexLevels, classifySlopeBand, computeNormal, createFractalPrepassRunner, createMeshBuilder, createPerfMonitor, defaultFieldParams, defaultFractalMandelSettings, defaultWorldGeneratorWorkerProfile, encodeTerrainParams, fieldWgslUrl, fractalPrepassWgslUrl, generateHexGrid, generateTemperateMixedForest, getWorldGeneratorWorkerManifest, getWorldGeneratorWorkerProfile, hexAreaFromSide, hexSideFromArea, loadFieldWgsl, loadFractalPrepassWgsl, loadTerrainWgsl, normalize, normalizeTileKey, packHexCells, parseFractalAsset, parseTileAssetBinary, parseTileAssetJson, resolveTileSizeWorld, sampleFieldStack, serializeFractalAsset, serializeTileAssetBinary, serializeTileAssetBinaryFromJson, serializeTileAssetJson, serializeTileAssetJsonFromBinary, shade, terrainWgslUrl, tileAssetFileStem, tileBoundsWorld, tileKeyFromWorldPosition, tileKeyToString, unpackTerrain, validateTileAssetPayload, worldGeneratorDebugOwner, worldGeneratorWorkerManifests, worldGeneratorWorkerProfileNames, worldGeneratorWorkerProfiles, worldGeneratorWorkerQueueClass };
566
+ export { DEFAULT_TILE_SIZE_WORLD, FIELD_DOWNWARD_MAX, FIELD_UPWARD_MIN, FRACTAL_ASSET_VERSION, FRACTAL_SAMPLE_STRIDE, type FieldParams, type FieldSample, type FractalAsset, type FractalAssetPayload, type FractalMandelSettings, type FractalPrepassRunOptions, type FractalPrepassRunner, type HexCell, type HexLevelSpec, MacroBiome, type MacroBiomeId, MacroBiomeLabel, type MeshBuilder, type MeshBuilderOptions, type MeshGeomorph, MicroFeature, type MicroFeatureId, MicroFeatureLabel, type MixedForestLayer, type MixedForestOptions, type PerfMonitor, type PerfMonitorOptions, type PerfMonitorUpdate, SlopeBand, type SlopeBandId, SlopeBandLabel, SurfaceCover, type SurfaceCoverId, SurfaceCoverLabel, TILE_ASSET_VERSION, TerrainBiome, type TerrainBiomeId, TerrainBiomeLabel, type TerrainCell, type TerrainParams, type TileAsset, type TileAssetPayload, type TileBakeOutput, type TileBakeWriter, TileCache, type TileCacheEntry, type TileCacheOptions, type TileCacheStatus, type TileGenerator, type TileKey, type Vec3, type WorldGeneratorRepresentationBand, type WorldGeneratorRepresentationCadence, type WorldGeneratorRepresentationDescriptor, type WorldGeneratorRepresentationOutput, type WorldGeneratorRepresentationPlan, type WorldGeneratorRepresentationRtParticipation, type WorldGeneratorRepresentationShadowRelevance, type WorldGeneratorWorkerAuthority, type WorldGeneratorWorkerBudgetLevel, type WorldGeneratorWorkerBudgetLevelConfig, type WorldGeneratorWorkerDomain, type WorldGeneratorWorkerImportance, type WorldGeneratorWorkerManifest, type WorldGeneratorWorkerManifestJob, type WorldGeneratorWorkerProfile, type WorldGeneratorWorkerProfileName, type WorldGeneratorWorkerQueueClass, assetMatches, axialToWorld, bakeTileAsset, buildHexLevels, classifySlopeBand, computeNormal, createFractalPrepassRunner, createMeshBuilder, createPerfMonitor, createWorldGeneratorRepresentationPlan, defaultFieldParams, defaultFractalMandelSettings, defaultWorldGeneratorWorkerProfile, encodeTerrainParams, fieldWgslUrl, fractalPrepassWgslUrl, generateHexGrid, generateTemperateMixedForest, getWorldGeneratorWorkerManifest, getWorldGeneratorWorkerProfile, hexAreaFromSide, hexSideFromArea, loadFieldWgsl, loadFractalPrepassWgsl, loadTerrainWgsl, normalize, normalizeTileKey, packHexCells, parseFractalAsset, parseTileAssetBinary, parseTileAssetJson, resolveTileSizeWorld, sampleFieldStack, serializeFractalAsset, serializeTileAssetBinary, serializeTileAssetBinaryFromJson, serializeTileAssetJson, serializeTileAssetJsonFromBinary, shade, terrainWgslUrl, tileAssetFileStem, tileBoundsWorld, tileKeyFromWorldPosition, tileKeyToString, unpackTerrain, validateTileAssetPayload, worldGeneratorDebugOwner, worldGeneratorRepresentationBands, worldGeneratorRepresentationOutputs, worldGeneratorWorkerManifests, worldGeneratorWorkerProfileNames, worldGeneratorWorkerProfiles, worldGeneratorWorkerQueueClass };
package/dist/index.d.ts CHANGED
@@ -449,6 +449,44 @@ type WorldGeneratorWorkerProfileName = "streaming" | "bake";
449
449
  type WorldGeneratorWorkerDomain = "geometry" | "textures" | "custom";
450
450
  type WorldGeneratorWorkerAuthority = "visual" | "non-authoritative-simulation" | "authoritative";
451
451
  type WorldGeneratorWorkerImportance = "medium" | "high" | "critical";
452
+ type WorldGeneratorRepresentationBand = "near" | "mid" | "far" | "horizon";
453
+ type WorldGeneratorRepresentationOutput = "liveGeometry" | "simplifiedGeometry" | "rtProxy" | "mergedProxy" | "horizonShell";
454
+ type WorldGeneratorRepresentationRtParticipation = "full" | "selective" | "proxy" | "disabled";
455
+ type WorldGeneratorRepresentationShadowRelevance = "ray-traced-primary" | "selective-raster" | "proxy-caster" | "baked-impression";
456
+ interface WorldGeneratorRepresentationCadence {
457
+ readonly kind: "per-frame" | "interval";
458
+ readonly divisor: number;
459
+ }
460
+ interface WorldGeneratorRepresentationDescriptor {
461
+ readonly id: string;
462
+ readonly chunkId: string;
463
+ readonly profile: WorldGeneratorWorkerProfileName;
464
+ readonly band: WorldGeneratorRepresentationBand;
465
+ readonly output: WorldGeneratorRepresentationOutput;
466
+ readonly rasterMode: "full-live" | "simplified-live" | "proxy" | "not-rendered" | "horizon-shell";
467
+ readonly rtParticipation: WorldGeneratorRepresentationRtParticipation;
468
+ readonly shadowRelevance: WorldGeneratorRepresentationShadowRelevance;
469
+ readonly refreshCadence: WorldGeneratorRepresentationCadence;
470
+ readonly preservesChunkIdentity: boolean;
471
+ readonly sourceChunkIds: readonly string[];
472
+ readonly sourceJobKeys: readonly string[];
473
+ readonly suggestedAllocationIds: readonly string[];
474
+ readonly scheduling: Readonly<{
475
+ owner: "renderer";
476
+ queueClass: typeof worldGeneratorWorkerQueueClass;
477
+ priorityHint: number;
478
+ gameplayImportance: WorldGeneratorWorkerImportance;
479
+ representationBand: WorldGeneratorRepresentationBand;
480
+ }>;
481
+ }
482
+ interface WorldGeneratorRepresentationPlan {
483
+ readonly schemaVersion: 1;
484
+ readonly owner: typeof worldGeneratorDebugOwner;
485
+ readonly profile: WorldGeneratorWorkerProfileName;
486
+ readonly chunkId: string;
487
+ readonly representations: readonly WorldGeneratorRepresentationDescriptor[];
488
+ readonly bands: readonly WorldGeneratorRepresentationBand[];
489
+ }
452
490
  interface WorldGeneratorWorkerBudgetLevelConfig {
453
491
  maxDispatchesPerFrame: number;
454
492
  maxJobsPerDispatch: number;
@@ -512,10 +550,17 @@ interface WorldGeneratorWorkerManifest {
512
550
  declare const worldGeneratorDebugOwner = "world-generator";
513
551
  declare const worldGeneratorWorkerQueueClass = "voxel";
514
552
  declare const defaultWorldGeneratorWorkerProfile = "streaming";
553
+ declare const worldGeneratorRepresentationBands: readonly WorldGeneratorRepresentationBand[];
554
+ declare const worldGeneratorRepresentationOutputs: readonly WorldGeneratorRepresentationOutput[];
515
555
  declare const worldGeneratorWorkerProfiles: Readonly<Record<WorldGeneratorWorkerProfileName, WorldGeneratorWorkerProfile>>;
516
556
  declare const worldGeneratorWorkerProfileNames: readonly WorldGeneratorWorkerProfileName[];
517
557
  declare const worldGeneratorWorkerManifests: Readonly<Record<WorldGeneratorWorkerProfileName, WorldGeneratorWorkerManifest>>;
518
558
  declare function getWorldGeneratorWorkerProfile(name?: WorldGeneratorWorkerProfileName): WorldGeneratorWorkerProfile;
519
559
  declare function getWorldGeneratorWorkerManifest(name?: WorldGeneratorWorkerProfileName): WorldGeneratorWorkerManifest;
560
+ declare function createWorldGeneratorRepresentationPlan(options: {
561
+ profile?: WorldGeneratorWorkerProfileName;
562
+ chunkId: string;
563
+ gameplayImportance?: WorldGeneratorWorkerImportance;
564
+ }): WorldGeneratorRepresentationPlan;
520
565
 
521
- export { DEFAULT_TILE_SIZE_WORLD, FIELD_DOWNWARD_MAX, FIELD_UPWARD_MIN, FRACTAL_ASSET_VERSION, FRACTAL_SAMPLE_STRIDE, type FieldParams, type FieldSample, type FractalAsset, type FractalAssetPayload, type FractalMandelSettings, type FractalPrepassRunOptions, type FractalPrepassRunner, type HexCell, type HexLevelSpec, MacroBiome, type MacroBiomeId, MacroBiomeLabel, type MeshBuilder, type MeshBuilderOptions, type MeshGeomorph, MicroFeature, type MicroFeatureId, MicroFeatureLabel, type MixedForestLayer, type MixedForestOptions, type PerfMonitor, type PerfMonitorOptions, type PerfMonitorUpdate, SlopeBand, type SlopeBandId, SlopeBandLabel, SurfaceCover, type SurfaceCoverId, SurfaceCoverLabel, TILE_ASSET_VERSION, TerrainBiome, type TerrainBiomeId, TerrainBiomeLabel, type TerrainCell, type TerrainParams, type TileAsset, type TileAssetPayload, type TileBakeOutput, type TileBakeWriter, TileCache, type TileCacheEntry, type TileCacheOptions, type TileCacheStatus, type TileGenerator, type TileKey, type Vec3, type WorldGeneratorWorkerAuthority, type WorldGeneratorWorkerBudgetLevel, type WorldGeneratorWorkerBudgetLevelConfig, type WorldGeneratorWorkerDomain, type WorldGeneratorWorkerImportance, type WorldGeneratorWorkerManifest, type WorldGeneratorWorkerManifestJob, type WorldGeneratorWorkerProfile, type WorldGeneratorWorkerProfileName, type WorldGeneratorWorkerQueueClass, assetMatches, axialToWorld, bakeTileAsset, buildHexLevels, classifySlopeBand, computeNormal, createFractalPrepassRunner, createMeshBuilder, createPerfMonitor, defaultFieldParams, defaultFractalMandelSettings, defaultWorldGeneratorWorkerProfile, encodeTerrainParams, fieldWgslUrl, fractalPrepassWgslUrl, generateHexGrid, generateTemperateMixedForest, getWorldGeneratorWorkerManifest, getWorldGeneratorWorkerProfile, hexAreaFromSide, hexSideFromArea, loadFieldWgsl, loadFractalPrepassWgsl, loadTerrainWgsl, normalize, normalizeTileKey, packHexCells, parseFractalAsset, parseTileAssetBinary, parseTileAssetJson, resolveTileSizeWorld, sampleFieldStack, serializeFractalAsset, serializeTileAssetBinary, serializeTileAssetBinaryFromJson, serializeTileAssetJson, serializeTileAssetJsonFromBinary, shade, terrainWgslUrl, tileAssetFileStem, tileBoundsWorld, tileKeyFromWorldPosition, tileKeyToString, unpackTerrain, validateTileAssetPayload, worldGeneratorDebugOwner, worldGeneratorWorkerManifests, worldGeneratorWorkerProfileNames, worldGeneratorWorkerProfiles, worldGeneratorWorkerQueueClass };
566
+ export { DEFAULT_TILE_SIZE_WORLD, FIELD_DOWNWARD_MAX, FIELD_UPWARD_MIN, FRACTAL_ASSET_VERSION, FRACTAL_SAMPLE_STRIDE, type FieldParams, type FieldSample, type FractalAsset, type FractalAssetPayload, type FractalMandelSettings, type FractalPrepassRunOptions, type FractalPrepassRunner, type HexCell, type HexLevelSpec, MacroBiome, type MacroBiomeId, MacroBiomeLabel, type MeshBuilder, type MeshBuilderOptions, type MeshGeomorph, MicroFeature, type MicroFeatureId, MicroFeatureLabel, type MixedForestLayer, type MixedForestOptions, type PerfMonitor, type PerfMonitorOptions, type PerfMonitorUpdate, SlopeBand, type SlopeBandId, SlopeBandLabel, SurfaceCover, type SurfaceCoverId, SurfaceCoverLabel, TILE_ASSET_VERSION, TerrainBiome, type TerrainBiomeId, TerrainBiomeLabel, type TerrainCell, type TerrainParams, type TileAsset, type TileAssetPayload, type TileBakeOutput, type TileBakeWriter, TileCache, type TileCacheEntry, type TileCacheOptions, type TileCacheStatus, type TileGenerator, type TileKey, type Vec3, type WorldGeneratorRepresentationBand, type WorldGeneratorRepresentationCadence, type WorldGeneratorRepresentationDescriptor, type WorldGeneratorRepresentationOutput, type WorldGeneratorRepresentationPlan, type WorldGeneratorRepresentationRtParticipation, type WorldGeneratorRepresentationShadowRelevance, type WorldGeneratorWorkerAuthority, type WorldGeneratorWorkerBudgetLevel, type WorldGeneratorWorkerBudgetLevelConfig, type WorldGeneratorWorkerDomain, type WorldGeneratorWorkerImportance, type WorldGeneratorWorkerManifest, type WorldGeneratorWorkerManifestJob, type WorldGeneratorWorkerProfile, type WorldGeneratorWorkerProfileName, type WorldGeneratorWorkerQueueClass, assetMatches, axialToWorld, bakeTileAsset, buildHexLevels, classifySlopeBand, computeNormal, createFractalPrepassRunner, createMeshBuilder, createPerfMonitor, createWorldGeneratorRepresentationPlan, defaultFieldParams, defaultFractalMandelSettings, defaultWorldGeneratorWorkerProfile, encodeTerrainParams, fieldWgslUrl, fractalPrepassWgslUrl, generateHexGrid, generateTemperateMixedForest, getWorldGeneratorWorkerManifest, getWorldGeneratorWorkerProfile, hexAreaFromSide, hexSideFromArea, loadFieldWgsl, loadFractalPrepassWgsl, loadTerrainWgsl, normalize, normalizeTileKey, packHexCells, parseFractalAsset, parseTileAssetBinary, parseTileAssetJson, resolveTileSizeWorld, sampleFieldStack, serializeFractalAsset, serializeTileAssetBinary, serializeTileAssetBinaryFromJson, serializeTileAssetJson, serializeTileAssetJsonFromBinary, shade, terrainWgslUrl, tileAssetFileStem, tileBoundsWorld, tileKeyFromWorldPosition, tileKeyToString, unpackTerrain, validateTileAssetPayload, worldGeneratorDebugOwner, worldGeneratorRepresentationBands, worldGeneratorRepresentationOutputs, worldGeneratorWorkerManifests, worldGeneratorWorkerProfileNames, worldGeneratorWorkerProfiles, worldGeneratorWorkerQueueClass };
package/dist/index.js CHANGED
@@ -1789,6 +1789,64 @@ function createMeshBuilder(sizeOrOptions = 1) {
1789
1789
  var worldGeneratorDebugOwner = "world-generator";
1790
1790
  var worldGeneratorWorkerQueueClass = "voxel";
1791
1791
  var defaultWorldGeneratorWorkerProfile = "streaming";
1792
+ var worldGeneratorRepresentationBands = Object.freeze([
1793
+ "near",
1794
+ "mid",
1795
+ "far",
1796
+ "horizon"
1797
+ ]);
1798
+ var worldGeneratorRepresentationOutputs = Object.freeze([
1799
+ "liveGeometry",
1800
+ "simplifiedGeometry",
1801
+ "rtProxy",
1802
+ "mergedProxy",
1803
+ "horizonShell"
1804
+ ]);
1805
+ var worldGeneratorRepresentationBandPriorityHints = Object.freeze({
1806
+ near: 400,
1807
+ mid: 300,
1808
+ far: 200,
1809
+ horizon: 100
1810
+ });
1811
+ function assertWorldGeneratorIdentifier(name, value) {
1812
+ if (typeof value !== "string" || value.trim().length === 0) {
1813
+ throw new Error(`${name} must be a non-empty string.`);
1814
+ }
1815
+ return value.trim();
1816
+ }
1817
+ function normalizeWorldGeneratorImportance(name, value) {
1818
+ if (value === "medium" || value === "high" || value === "critical") {
1819
+ return value;
1820
+ }
1821
+ throw new Error(`${name} must be one of: medium, high, critical.`);
1822
+ }
1823
+ function buildWorldGeneratorRepresentationDescriptor(options) {
1824
+ return Object.freeze({
1825
+ id: `${options.chunkId}.${options.band}.${options.output}`,
1826
+ chunkId: options.chunkId,
1827
+ profile: options.profile,
1828
+ band: options.band,
1829
+ output: options.output,
1830
+ rasterMode: options.rasterMode,
1831
+ rtParticipation: options.rtParticipation,
1832
+ shadowRelevance: options.shadowRelevance,
1833
+ refreshCadence: Object.freeze({
1834
+ kind: options.refreshCadence.kind,
1835
+ divisor: options.refreshCadence.divisor
1836
+ }),
1837
+ preservesChunkIdentity: options.preservesChunkIdentity,
1838
+ sourceChunkIds: Object.freeze([options.chunkId]),
1839
+ sourceJobKeys: Object.freeze([...options.sourceJobKeys]),
1840
+ suggestedAllocationIds: Object.freeze([...options.suggestedAllocationIds]),
1841
+ scheduling: Object.freeze({
1842
+ owner: "renderer",
1843
+ queueClass: worldGeneratorWorkerQueueClass,
1844
+ priorityHint: worldGeneratorRepresentationBandPriorityHints[options.band],
1845
+ gameplayImportance: options.gameplayImportance,
1846
+ representationBand: options.band
1847
+ })
1848
+ });
1849
+ }
1792
1850
  function buildBudgetLevels(jobType, queueClass, levels) {
1793
1851
  return Object.freeze(
1794
1852
  levels.map(
@@ -2369,6 +2427,108 @@ function getWorldGeneratorWorkerManifest(name = defaultWorldGeneratorWorkerProfi
2369
2427
  }
2370
2428
  return manifest;
2371
2429
  }
2430
+ function createWorldGeneratorRepresentationPlan(options) {
2431
+ const profile = options.profile ?? defaultWorldGeneratorWorkerProfile;
2432
+ const spec = worldGeneratorWorkerProfileSpecs[profile];
2433
+ if (!spec) {
2434
+ const available = worldGeneratorWorkerProfileNames.join(", ");
2435
+ throw new Error(
2436
+ `Unknown world-generator worker profile "${profile}". Available: ${available}.`
2437
+ );
2438
+ }
2439
+ const chunkId = assertWorldGeneratorIdentifier("chunkId", options.chunkId);
2440
+ const gameplayImportance = normalizeWorldGeneratorImportance(
2441
+ "gameplayImportance",
2442
+ options.gameplayImportance ?? "high"
2443
+ );
2444
+ const highValueAllocations = spec.suggestedAllocationIds;
2445
+ const farFieldAllocations = spec.suggestedAllocationIds.filter(
2446
+ (allocationId) => allocationId.includes("mesh") || allocationId.includes("asset") || allocationId.includes("tile")
2447
+ );
2448
+ const bakeSourceJobKeys = profile === "bake" ? ["meshBuild", "tileBake", "assetSerialize"] : ["meshBuild", "tileBake"];
2449
+ const representations = Object.freeze([
2450
+ buildWorldGeneratorRepresentationDescriptor({
2451
+ profile,
2452
+ chunkId,
2453
+ band: "near",
2454
+ output: "liveGeometry",
2455
+ rasterMode: "full-live",
2456
+ rtParticipation: "full",
2457
+ shadowRelevance: "ray-traced-primary",
2458
+ refreshCadence: { kind: "per-frame", divisor: 1 },
2459
+ preservesChunkIdentity: true,
2460
+ sourceJobKeys: ["meshBuild"],
2461
+ gameplayImportance: gameplayImportance === "medium" ? "high" : gameplayImportance,
2462
+ suggestedAllocationIds: highValueAllocations
2463
+ }),
2464
+ buildWorldGeneratorRepresentationDescriptor({
2465
+ profile,
2466
+ chunkId,
2467
+ band: "mid",
2468
+ output: "simplifiedGeometry",
2469
+ rasterMode: "simplified-live",
2470
+ rtParticipation: "selective",
2471
+ shadowRelevance: "selective-raster",
2472
+ refreshCadence: { kind: "interval", divisor: 2 },
2473
+ preservesChunkIdentity: true,
2474
+ sourceJobKeys: ["meshBuild"],
2475
+ gameplayImportance,
2476
+ suggestedAllocationIds: highValueAllocations
2477
+ }),
2478
+ buildWorldGeneratorRepresentationDescriptor({
2479
+ profile,
2480
+ chunkId,
2481
+ band: "mid",
2482
+ output: "rtProxy",
2483
+ rasterMode: "not-rendered",
2484
+ rtParticipation: "proxy",
2485
+ shadowRelevance: "selective-raster",
2486
+ refreshCadence: { kind: "interval", divisor: 2 },
2487
+ preservesChunkIdentity: true,
2488
+ sourceJobKeys: ["meshBuild", "tileBake"],
2489
+ gameplayImportance,
2490
+ suggestedAllocationIds: highValueAllocations
2491
+ }),
2492
+ buildWorldGeneratorRepresentationDescriptor({
2493
+ profile,
2494
+ chunkId,
2495
+ band: "far",
2496
+ output: "mergedProxy",
2497
+ rasterMode: "proxy",
2498
+ rtParticipation: "proxy",
2499
+ shadowRelevance: "proxy-caster",
2500
+ refreshCadence: { kind: "interval", divisor: 8 },
2501
+ preservesChunkIdentity: true,
2502
+ sourceJobKeys: bakeSourceJobKeys,
2503
+ gameplayImportance: "medium",
2504
+ suggestedAllocationIds: farFieldAllocations.length > 0 ? farFieldAllocations : highValueAllocations
2505
+ }),
2506
+ buildWorldGeneratorRepresentationDescriptor({
2507
+ profile,
2508
+ chunkId,
2509
+ band: "horizon",
2510
+ output: "horizonShell",
2511
+ rasterMode: "horizon-shell",
2512
+ rtParticipation: "disabled",
2513
+ shadowRelevance: "baked-impression",
2514
+ refreshCadence: { kind: "interval", divisor: 60 },
2515
+ preservesChunkIdentity: true,
2516
+ sourceJobKeys: profile === "bake" ? ["tileBake", "assetSerialize"] : ["tileBake"],
2517
+ gameplayImportance: "medium",
2518
+ suggestedAllocationIds: farFieldAllocations.length > 0 ? farFieldAllocations : highValueAllocations
2519
+ })
2520
+ ]);
2521
+ return Object.freeze({
2522
+ schemaVersion: 1,
2523
+ owner: worldGeneratorDebugOwner,
2524
+ profile,
2525
+ chunkId,
2526
+ representations,
2527
+ bands: Object.freeze(
2528
+ [...new Set(representations.map((representation) => representation.band))]
2529
+ )
2530
+ });
2531
+ }
2372
2532
  export {
2373
2533
  DEFAULT_TILE_SIZE_WORLD,
2374
2534
  FIELD_DOWNWARD_MAX,
@@ -2396,6 +2556,7 @@ export {
2396
2556
  createFractalPrepassRunner,
2397
2557
  createMeshBuilder,
2398
2558
  createPerfMonitor,
2559
+ createWorldGeneratorRepresentationPlan,
2399
2560
  defaultFieldParams,
2400
2561
  defaultFractalMandelSettings,
2401
2562
  defaultWorldGeneratorWorkerProfile,
@@ -2433,6 +2594,8 @@ export {
2433
2594
  unpackTerrain,
2434
2595
  validateTileAssetPayload,
2435
2596
  worldGeneratorDebugOwner,
2597
+ worldGeneratorRepresentationBands,
2598
+ worldGeneratorRepresentationOutputs,
2436
2599
  worldGeneratorWorkerManifests,
2437
2600
  worldGeneratorWorkerProfileNames,
2438
2601
  worldGeneratorWorkerProfiles,