@forgeax/engine-render 0.1.35 → 0.1.36
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/README.md +17 -0
- package/dist/assembly/webgpu-vertex-layouts.d.ts.map +1 -1
- package/dist/{chunk-MXTWKZO4.mjs → chunk-2OZAS3WU.mjs} +225 -4
- package/dist/chunk-2OZAS3WU.mjs.map +1 -0
- package/dist/{chunk-G6HDNGY7.mjs → chunk-BZQ4CDRF.mjs} +24 -230
- package/dist/chunk-BZQ4CDRF.mjs.map +1 -0
- package/dist/{chunk-LNIUIKQ7.mjs → chunk-CJOV2XLO.mjs} +77 -19
- package/dist/chunk-CJOV2XLO.mjs.map +1 -0
- package/dist/{chunk-3XUBWRY2.mjs → chunk-D6WSBXJ2.mjs} +4 -4
- package/dist/{chunk-3XUBWRY2.mjs.map → chunk-D6WSBXJ2.mjs.map} +1 -1
- package/dist/{chunk-LM5IE7GF.mjs → chunk-DRF6OULX.mjs} +3 -3
- package/dist/{chunk-LM5IE7GF.mjs.map → chunk-DRF6OULX.mjs.map} +1 -1
- package/dist/{chunk-SGPUJW3F.mjs → chunk-OB5WAFYH.mjs} +3 -3
- package/dist/{chunk-SGPUJW3F.mjs.map → chunk-OB5WAFYH.mjs.map} +1 -1
- package/dist/{chunk-MZ4C7EHF.mjs → chunk-OEYKKMXG.mjs} +5 -5
- package/dist/{chunk-MZ4C7EHF.mjs.map → chunk-OEYKKMXG.mjs.map} +1 -1
- package/dist/construct-renderer.mjs +130 -71
- package/dist/construct-renderer.mjs.map +1 -1
- package/dist/device/device-scope.d.ts.map +1 -1
- package/dist/features/particle-mesh-layout.d.ts +19 -0
- package/dist/features/particle-mesh-layout.d.ts.map +1 -0
- package/dist/features/types.d.ts +5 -1
- package/dist/features/types.d.ts.map +1 -1
- package/dist/gpu-driven/production-raster.d.ts +1 -1
- package/dist/gpu-driven/production-raster.d.ts.map +1 -1
- package/dist/gpu-driven/shadow-views.d.ts +1 -1
- package/dist/gpu-driven/shadow-views.d.ts.map +1 -1
- package/dist/gpu-driven/view-gpu.d.ts +1 -1
- package/dist/gpu-driven/view-gpu.d.ts.map +1 -1
- package/dist/index.mjs +48 -36
- package/dist/index.mjs.map +1 -1
- package/dist/internal.mjs +5 -5
- package/dist/pbr-pipeline.d.ts.map +1 -1
- package/dist/publication/publisher.d.ts +1 -0
- package/dist/publication/publisher.d.ts.map +1 -1
- package/dist/record/frame.d.ts.map +1 -1
- package/dist/record/prepared-material-bindings.d.ts +1 -2
- package/dist/record/prepared-material-bindings.d.ts.map +1 -1
- package/dist/record/render-context.d.ts +2 -0
- package/dist/record/render-context.d.ts.map +1 -1
- package/dist/record/shadow-pass.d.ts +2 -2
- package/dist/record/shadow-pass.d.ts.map +1 -1
- package/dist/record/typed-frame-graph.d.ts.map +1 -1
- package/dist/recovery/render-system-candidate.d.ts +1 -8
- package/dist/recovery/render-system-candidate.d.ts.map +1 -1
- package/dist/render-system-extract-tail.d.ts.map +1 -1
- package/dist/render-system-extract.d.ts.map +1 -1
- package/dist/render-system.d.ts.map +1 -1
- package/dist/temporal/index.mjs +4 -4
- package/dist/typed-shadow-passes.d.ts.map +1 -1
- package/package.json +21 -21
- package/src/__tests__/device-scope-lifecycle.unit.test.ts +26 -0
- package/src/__tests__/gpu-driven-production.integration.test.ts +18 -1
- package/src/__tests__/gpu-driven-shadow-views.unit.test.ts +23 -0
- package/src/__tests__/material-vertex-texture.browser.test.ts +7 -0
- package/src/__tests__/material-vertex-texture.dawn.test.ts +7 -0
- package/src/__tests__/material-vertex-texture.fixture.ts +31 -0
- package/src/__tests__/recovery-candidate-prepare.contract.test.ts +5 -0
- package/src/__tests__/renderer-factory-material-contract.unit.test.ts +106 -4
- package/src/__tests__/runtime-material-program.integration.test.ts +79 -0
- package/src/__tests__/vertex-layouts-ssot.unit.test.ts +23 -3
- package/src/assembly/webgpu-renderer.ts +12 -9
- package/src/assembly/webgpu-vertex-layouts.ts +2 -9
- package/src/device/device-scope.ts +3 -0
- package/src/features/particle-mesh-layout.ts +25 -0
- package/src/features/types.ts +5 -1
- package/src/gpu-driven/production-raster.ts +9 -3
- package/src/gpu-driven/shadow-views.ts +27 -2
- package/src/gpu-driven/view-gpu.ts +5 -0
- package/src/pbr-pipeline.ts +4 -1
- package/src/publication/__tests__/features.integration.test.ts +51 -0
- package/src/publication/__tests__/publication.integration.test.ts +45 -0
- package/src/publication/publisher.ts +56 -29
- package/src/record/__tests__/prepared-runtime-material.integration.test.ts +134 -0
- package/src/record/frame.ts +45 -6
- package/src/record/prepared-material-bindings.ts +11 -37
- package/src/record/render-context.ts +2 -0
- package/src/record/shadow-pass.ts +65 -4
- package/src/record/typed-frame-graph.ts +5 -1
- package/src/recovery/render-system-candidate.ts +1 -9
- package/src/render-system-extract-tail.ts +15 -6
- package/src/render-system-extract.ts +9 -2
- package/src/render-system.ts +0 -1
- package/src/typed-shadow-passes.ts +36 -5
- package/dist/chunk-G6HDNGY7.mjs.map +0 -1
- package/dist/chunk-LNIUIKQ7.mjs.map +0 -1
- package/dist/chunk-MXTWKZO4.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GlyphText, SpriteRegionOverride, SpriteInstances, selectActiveCameraIndex, getActiveCamera } from './chunk-X2KA6WHM.mjs';
|
|
2
|
-
import { RenderIntentInvalidError, DynamicResolutionRequiresTaaError, ShadowInvalidConfigError, VolumeDensityShapeMismatchError, VolumeInvalidBoundsError, VolumeInvalidParametersError, VolumeOwnerConflictError, MotionBlurValidationError, gpuDrivenShadowDrawKey, STANDARD_OUTPUT_TRANSFORM_FEATURE_ID, IES_SLICE_CAPACITY, COOKIE_SLICE_CAPACITY, SHADOW_ATLAS_DEFAULT_LAYERS, MaterialSkinAttrMissingError, isStandardPbrSkinMaterialShader, SkinMaterialMismatchError, validateInstanceTransforms, buildGpuDrivenDraws, worldEntityKey, gpuDrivenSourceDrawItemIndex, selectPasses, resolveRenderTargetMaterialSource, isCanonicalStandardPbrMaterialShader, BarrelDistortionInvalidParameterError, DynamicResolutionInvalidParameterError, COOKIE_SLICE_SIZE, EnvironmentSourceConflictError, FogCardinalityError, resolveMotionBlurParams, isStandardPbrMaterialShader, AtmosphereInvalidParameterError } from './chunk-
|
|
2
|
+
import { RenderIntentInvalidError, DynamicResolutionRequiresTaaError, ShadowInvalidConfigError, VolumeDensityShapeMismatchError, VolumeInvalidBoundsError, VolumeInvalidParametersError, VolumeOwnerConflictError, MotionBlurValidationError, gpuDrivenShadowDrawKey, STANDARD_OUTPUT_TRANSFORM_FEATURE_ID, IES_SLICE_CAPACITY, COOKIE_SLICE_CAPACITY, SHADOW_ATLAS_DEFAULT_LAYERS, MaterialSkinAttrMissingError, isStandardPbrSkinMaterialShader, SkinMaterialMismatchError, validateInstanceTransforms, buildGpuDrivenDraws, deriveInstancesUnionBounds, worldEntityKey, gpuDrivenSourceDrawItemIndex, selectPasses, resolveRenderTargetMaterialSource, isCanonicalStandardPbrMaterialShader, BarrelDistortionInvalidParameterError, DynamicResolutionInvalidParameterError, COOKIE_SLICE_SIZE, EnvironmentSourceConflictError, FogCardinalityError, resolveMotionBlurParams, isStandardPbrMaterialShader, AtmosphereInvalidParameterError } from './chunk-2OZAS3WU.mjs';
|
|
3
3
|
import { defineComponent, Entity, Time } from '@forgeax/engine-ecs';
|
|
4
4
|
import { R_MIN, err, ok, TextError, toShared, handleSlot, AssetError, ASSET_ERROR_HINTS, materialValuesToLinearRuntime, derive, unpackSlot, materialGuidText } from '@forgeax/engine-types';
|
|
5
5
|
import { TONEMAP_SHADER_MODE, standardTextureMask, DEFAULT_STANDARD_PBR_PARAM_SCHEMA, STANDARD_PIPELINE_PARAM_SCHEMA, DEFAULT_STANDARD_SURFACE_MODULE } from '@forgeax/engine-shader';
|
|
@@ -2651,224 +2651,6 @@ function asFontHandle(raw) {
|
|
|
2651
2651
|
return toShared(raw);
|
|
2652
2652
|
}
|
|
2653
2653
|
|
|
2654
|
-
// src/instances-derived-bounds.ts
|
|
2655
|
-
var fingerprintScalar = new Float32Array(1);
|
|
2656
|
-
var fingerprintBits = new Uint32Array(fingerprintScalar.buffer);
|
|
2657
|
-
function fingerprintNumericArray(values) {
|
|
2658
|
-
let hash = 2166136261;
|
|
2659
|
-
for (let index = 0; index < values.length; index += 1) {
|
|
2660
|
-
fingerprintScalar[0] = Number(values[index]);
|
|
2661
|
-
hash = Math.imul(hash ^ (fingerprintBits[0] ?? 0), 16777619) >>> 0;
|
|
2662
|
-
}
|
|
2663
|
-
return hash >>> 0;
|
|
2664
|
-
}
|
|
2665
|
-
function finiteAabb(aabb) {
|
|
2666
|
-
if (aabb === void 0 || aabb.length < 6) return false;
|
|
2667
|
-
const minX = aabb[0];
|
|
2668
|
-
const minY = aabb[1];
|
|
2669
|
-
const minZ = aabb[2];
|
|
2670
|
-
const maxX = aabb[3];
|
|
2671
|
-
const maxY = aabb[4];
|
|
2672
|
-
const maxZ = aabb[5];
|
|
2673
|
-
return Number.isFinite(minX) && Number.isFinite(minY) && Number.isFinite(minZ) && Number.isFinite(maxX) && Number.isFinite(maxY) && Number.isFinite(maxZ) && minX <= maxX && minY <= maxY && minZ <= maxZ;
|
|
2674
|
-
}
|
|
2675
|
-
function finiteMatrix(matrix) {
|
|
2676
|
-
if (matrix.length < 16) return false;
|
|
2677
|
-
for (let index = 0; index < 16; index += 1) {
|
|
2678
|
-
if (!Number.isFinite(matrix[index])) return false;
|
|
2679
|
-
}
|
|
2680
|
-
return true;
|
|
2681
|
-
}
|
|
2682
|
-
function multiplyMat4(out, left, right, rightOffset = 0) {
|
|
2683
|
-
for (let column = 0; column < 4; column += 1) {
|
|
2684
|
-
const rightColumn = rightOffset + column * 4;
|
|
2685
|
-
const right0 = Number(right[rightColumn] ?? 0);
|
|
2686
|
-
const right1 = Number(right[rightColumn + 1] ?? 0);
|
|
2687
|
-
const right2 = Number(right[rightColumn + 2] ?? 0);
|
|
2688
|
-
const right3 = Number(right[rightColumn + 3] ?? 0);
|
|
2689
|
-
const outOffset = column * 4;
|
|
2690
|
-
out[outOffset] = Number(left[0] ?? 0) * right0 + Number(left[4] ?? 0) * right1 + Number(left[8] ?? 0) * right2 + Number(left[12] ?? 0) * right3;
|
|
2691
|
-
out[outOffset + 1] = Number(left[1] ?? 0) * right0 + Number(left[5] ?? 0) * right1 + Number(left[9] ?? 0) * right2 + Number(left[13] ?? 0) * right3;
|
|
2692
|
-
out[outOffset + 2] = Number(left[2] ?? 0) * right0 + Number(left[6] ?? 0) * right1 + Number(left[10] ?? 0) * right2 + Number(left[14] ?? 0) * right3;
|
|
2693
|
-
out[outOffset + 3] = Number(left[3] ?? 0) * right0 + Number(left[7] ?? 0) * right1 + Number(left[11] ?? 0) * right2 + Number(left[15] ?? 0) * right3;
|
|
2694
|
-
}
|
|
2695
|
-
}
|
|
2696
|
-
function finiteMatrixAt(values, offset) {
|
|
2697
|
-
if (values.length - offset < 16) return false;
|
|
2698
|
-
for (let index = 0; index < 16; index += 1) {
|
|
2699
|
-
if (!Number.isFinite(values[offset + index])) return false;
|
|
2700
|
-
}
|
|
2701
|
-
return true;
|
|
2702
|
-
}
|
|
2703
|
-
function isAffine(matrix) {
|
|
2704
|
-
return matrix[3] === 0 && matrix[7] === 0 && matrix[11] === 0 && matrix[15] === 1;
|
|
2705
|
-
}
|
|
2706
|
-
function includeBox(out, candidate, initialized) {
|
|
2707
|
-
const minX = candidate[0];
|
|
2708
|
-
const minY = candidate[1];
|
|
2709
|
-
const minZ = candidate[2];
|
|
2710
|
-
const maxX = candidate[3];
|
|
2711
|
-
const maxY = candidate[4];
|
|
2712
|
-
const maxZ = candidate[5];
|
|
2713
|
-
if (!initialized) {
|
|
2714
|
-
out[0] = minX;
|
|
2715
|
-
out[1] = minY;
|
|
2716
|
-
out[2] = minZ;
|
|
2717
|
-
out[3] = maxX;
|
|
2718
|
-
out[4] = maxY;
|
|
2719
|
-
out[5] = maxZ;
|
|
2720
|
-
return true;
|
|
2721
|
-
}
|
|
2722
|
-
if (minX < (out[0] ?? Number.POSITIVE_INFINITY)) out[0] = minX;
|
|
2723
|
-
if (minY < (out[1] ?? Number.POSITIVE_INFINITY)) out[1] = minY;
|
|
2724
|
-
if (minZ < (out[2] ?? Number.POSITIVE_INFINITY)) out[2] = minZ;
|
|
2725
|
-
if (maxX > (out[3] ?? Number.NEGATIVE_INFINITY)) out[3] = maxX;
|
|
2726
|
-
if (maxY > (out[4] ?? Number.NEGATIVE_INFINITY)) out[4] = maxY;
|
|
2727
|
-
if (maxZ > (out[5] ?? Number.NEGATIVE_INFINITY)) out[5] = maxZ;
|
|
2728
|
-
return true;
|
|
2729
|
-
}
|
|
2730
|
-
function transformAabb(out, local, matrix) {
|
|
2731
|
-
const minX = local[0];
|
|
2732
|
-
const minY = local[1];
|
|
2733
|
-
const minZ = local[2];
|
|
2734
|
-
const maxX = local[3];
|
|
2735
|
-
const maxY = local[4];
|
|
2736
|
-
const maxZ = local[5];
|
|
2737
|
-
const centerX = (minX + maxX) * 0.5;
|
|
2738
|
-
const centerY = (minY + maxY) * 0.5;
|
|
2739
|
-
const centerZ = (minZ + maxZ) * 0.5;
|
|
2740
|
-
const extentX = (maxX - minX) * 0.5;
|
|
2741
|
-
const extentY = (maxY - minY) * 0.5;
|
|
2742
|
-
const extentZ = (maxZ - minZ) * 0.5;
|
|
2743
|
-
if (isAffine(matrix)) {
|
|
2744
|
-
const centerWorldX = matrix[0] * centerX + matrix[4] * centerY + matrix[8] * centerZ + matrix[12];
|
|
2745
|
-
const centerWorldY = matrix[1] * centerX + matrix[5] * centerY + matrix[9] * centerZ + matrix[13];
|
|
2746
|
-
const centerWorldZ = matrix[2] * centerX + matrix[6] * centerY + matrix[10] * centerZ + matrix[14];
|
|
2747
|
-
const extentWorldX = Math.abs(matrix[0]) * extentX + Math.abs(matrix[4]) * extentY + Math.abs(matrix[8]) * extentZ;
|
|
2748
|
-
const extentWorldY = Math.abs(matrix[1]) * extentX + Math.abs(matrix[5]) * extentY + Math.abs(matrix[9]) * extentZ;
|
|
2749
|
-
const extentWorldZ = Math.abs(matrix[2]) * extentX + Math.abs(matrix[6]) * extentY + Math.abs(matrix[10]) * extentZ;
|
|
2750
|
-
out[0] = centerWorldX - extentWorldX;
|
|
2751
|
-
out[1] = centerWorldY - extentWorldY;
|
|
2752
|
-
out[2] = centerWorldZ - extentWorldZ;
|
|
2753
|
-
out[3] = centerWorldX + extentWorldX;
|
|
2754
|
-
out[4] = centerWorldY + extentWorldY;
|
|
2755
|
-
out[5] = centerWorldZ + extentWorldZ;
|
|
2756
|
-
return finiteAabb(out);
|
|
2757
|
-
}
|
|
2758
|
-
let minimumW = Number.POSITIVE_INFINITY;
|
|
2759
|
-
let maximumW = Number.NEGATIVE_INFINITY;
|
|
2760
|
-
for (let corner = 0; corner < 8; corner += 1) {
|
|
2761
|
-
const x = (corner & 1) === 0 ? minX : maxX;
|
|
2762
|
-
const y = (corner & 2) === 0 ? minY : maxY;
|
|
2763
|
-
const z = (corner & 4) === 0 ? minZ : maxZ;
|
|
2764
|
-
const w = matrix[3] * x + matrix[7] * y + matrix[11] * z + matrix[15];
|
|
2765
|
-
if (!Number.isFinite(w)) return false;
|
|
2766
|
-
if (w < minimumW) minimumW = w;
|
|
2767
|
-
if (w > maximumW) maximumW = w;
|
|
2768
|
-
}
|
|
2769
|
-
if (minimumW <= 0 && maximumW >= 0) return false;
|
|
2770
|
-
let unionMinX = Number.POSITIVE_INFINITY;
|
|
2771
|
-
let unionMinY = Number.POSITIVE_INFINITY;
|
|
2772
|
-
let unionMinZ = Number.POSITIVE_INFINITY;
|
|
2773
|
-
let unionMaxX = Number.NEGATIVE_INFINITY;
|
|
2774
|
-
let unionMaxY = Number.NEGATIVE_INFINITY;
|
|
2775
|
-
let unionMaxZ = Number.NEGATIVE_INFINITY;
|
|
2776
|
-
for (let corner = 0; corner < 8; corner += 1) {
|
|
2777
|
-
const x = (corner & 1) === 0 ? minX : maxX;
|
|
2778
|
-
const y = (corner & 2) === 0 ? minY : maxY;
|
|
2779
|
-
const z = (corner & 4) === 0 ? minZ : maxZ;
|
|
2780
|
-
const rawX = matrix[0] * x + matrix[4] * y + matrix[8] * z + matrix[12];
|
|
2781
|
-
const rawY = matrix[1] * x + matrix[5] * y + matrix[9] * z + matrix[13];
|
|
2782
|
-
const rawZ = matrix[2] * x + matrix[6] * y + matrix[10] * z + matrix[14];
|
|
2783
|
-
const w = matrix[3] * x + matrix[7] * y + matrix[11] * z + matrix[15];
|
|
2784
|
-
const projectedX = rawX / w;
|
|
2785
|
-
const projectedY = rawY / w;
|
|
2786
|
-
const projectedZ = rawZ / w;
|
|
2787
|
-
if (!Number.isFinite(projectedX) || !Number.isFinite(projectedY) || !Number.isFinite(projectedZ)) {
|
|
2788
|
-
return false;
|
|
2789
|
-
}
|
|
2790
|
-
if (projectedX < unionMinX) unionMinX = projectedX;
|
|
2791
|
-
if (projectedY < unionMinY) unionMinY = projectedY;
|
|
2792
|
-
if (projectedZ < unionMinZ) unionMinZ = projectedZ;
|
|
2793
|
-
if (projectedX > unionMaxX) unionMaxX = projectedX;
|
|
2794
|
-
if (projectedY > unionMaxY) unionMaxY = projectedY;
|
|
2795
|
-
if (projectedZ > unionMaxZ) unionMaxZ = projectedZ;
|
|
2796
|
-
}
|
|
2797
|
-
out[0] = unionMinX;
|
|
2798
|
-
out[1] = unionMinY;
|
|
2799
|
-
out[2] = unionMinZ;
|
|
2800
|
-
out[3] = unionMaxX;
|
|
2801
|
-
out[4] = unionMaxY;
|
|
2802
|
-
out[5] = unionMaxZ;
|
|
2803
|
-
return finiteAabb(out);
|
|
2804
|
-
}
|
|
2805
|
-
function deriveInstancesUnionBounds(input) {
|
|
2806
|
-
const { meshAabb, entityWorld, transforms } = input;
|
|
2807
|
-
if (!finiteAabb(meshAabb) || !finiteMatrix(entityWorld) || transforms === void 0) {
|
|
2808
|
-
return void 0;
|
|
2809
|
-
}
|
|
2810
|
-
if (transforms.length === 0 || transforms.length % 16 !== 0) return void 0;
|
|
2811
|
-
const local = meshAabb;
|
|
2812
|
-
const union = new Float32Array(6);
|
|
2813
|
-
const composed = new Float32Array(16);
|
|
2814
|
-
const transformed = new Float32Array(6);
|
|
2815
|
-
let initialized = false;
|
|
2816
|
-
for (let offset = 0; offset < transforms.length; offset += 16) {
|
|
2817
|
-
if (!finiteMatrixAt(transforms, offset)) return void 0;
|
|
2818
|
-
multiplyMat4(composed, entityWorld, transforms, offset);
|
|
2819
|
-
if (!finiteMatrix(composed) || !transformAabb(transformed, local, composed)) return void 0;
|
|
2820
|
-
initialized = includeBox(union, transformed, initialized);
|
|
2821
|
-
}
|
|
2822
|
-
return initialized && finiteAabb(union) ? union : void 0;
|
|
2823
|
-
}
|
|
2824
|
-
var InstanceBoundsCache = class {
|
|
2825
|
-
entries = /* @__PURE__ */ new Map();
|
|
2826
|
-
hits = 0;
|
|
2827
|
-
misses = 0;
|
|
2828
|
-
derives = 0;
|
|
2829
|
-
invalidations = 0;
|
|
2830
|
-
key(input) {
|
|
2831
|
-
return `${input.worldId === void 0 ? "" : `${input.worldId}:`}${input.entityKey}`;
|
|
2832
|
-
}
|
|
2833
|
-
get(input) {
|
|
2834
|
-
const previous = this.entries.get(this.key(input));
|
|
2835
|
-
if (previous !== void 0 && previous.meshGeneration === input.meshGeneration && previous.transformGeneration === input.transformGeneration && previous.matrixGeneration === input.matrixGeneration) {
|
|
2836
|
-
this.hits += 1;
|
|
2837
|
-
return previous.bounds;
|
|
2838
|
-
}
|
|
2839
|
-
this.misses += 1;
|
|
2840
|
-
this.derives += 1;
|
|
2841
|
-
const bounds = deriveInstancesUnionBounds(input);
|
|
2842
|
-
this.entries.set(this.key(input), {
|
|
2843
|
-
...input.worldId === void 0 ? {} : { worldId: input.worldId },
|
|
2844
|
-
entityKey: input.entityKey,
|
|
2845
|
-
meshGeneration: input.meshGeneration,
|
|
2846
|
-
transformGeneration: input.transformGeneration,
|
|
2847
|
-
matrixGeneration: input.matrixGeneration,
|
|
2848
|
-
bounds
|
|
2849
|
-
});
|
|
2850
|
-
return bounds;
|
|
2851
|
-
}
|
|
2852
|
-
invalidate(entityKey, worldId) {
|
|
2853
|
-
if (entityKey === void 0) {
|
|
2854
|
-
if (this.entries.size > 0) this.invalidations += this.entries.size;
|
|
2855
|
-
this.entries.clear();
|
|
2856
|
-
} else {
|
|
2857
|
-
if (this.entries.delete(this.key({ entityKey, ...worldId === void 0 ? {} : { worldId } }))) {
|
|
2858
|
-
this.invalidations += 1;
|
|
2859
|
-
}
|
|
2860
|
-
}
|
|
2861
|
-
}
|
|
2862
|
-
inspect() {
|
|
2863
|
-
return {
|
|
2864
|
-
hits: this.hits,
|
|
2865
|
-
misses: this.misses,
|
|
2866
|
-
derives: this.derives,
|
|
2867
|
-
invalidations: this.invalidations
|
|
2868
|
-
};
|
|
2869
|
-
}
|
|
2870
|
-
};
|
|
2871
|
-
|
|
2872
2654
|
// src/points-lines/bounds.ts
|
|
2873
2655
|
function expandPointsLinesBounds(bounds, style) {
|
|
2874
2656
|
if (bounds.length < 6 || style === void 0) return new Float32Array(bounds);
|
|
@@ -4281,6 +4063,8 @@ function extractFrame(world, context) {
|
|
|
4281
4063
|
if (asset.kind !== "material") {
|
|
4282
4064
|
materialSnap = defaultMaterialSnapshot(handleRaw);
|
|
4283
4065
|
} else {
|
|
4066
|
+
const source = world.sharedRefs.resolve(tagged);
|
|
4067
|
+
const programOwner = source.ok && source.value.kind === "material" ? source.value : asset;
|
|
4284
4068
|
const resolvedResult = walkMaterialPassesOverSharedRefs(world, tagged, assets);
|
|
4285
4069
|
if (!resolvedResult.ok) {
|
|
4286
4070
|
const err13 = resolvedResult.error;
|
|
@@ -4317,17 +4101,21 @@ function extractFrame(world, context) {
|
|
|
4317
4101
|
};
|
|
4318
4102
|
try {
|
|
4319
4103
|
materialProgramSelections = materialProgramSelectionsForMaterial(
|
|
4320
|
-
|
|
4104
|
+
programOwner,
|
|
4321
4105
|
assets,
|
|
4322
4106
|
materialContext
|
|
4323
4107
|
);
|
|
4324
4108
|
} catch (error) {
|
|
4325
4109
|
if (isMissingMaterialProgram(error) && materialContext?.geometry === "mesh") {
|
|
4326
4110
|
try {
|
|
4327
|
-
const skinnedSelections = materialProgramSelectionsForMaterial(
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4111
|
+
const skinnedSelections = materialProgramSelectionsForMaterial(
|
|
4112
|
+
programOwner,
|
|
4113
|
+
assets,
|
|
4114
|
+
{
|
|
4115
|
+
...materialContext,
|
|
4116
|
+
geometry: "skinned"
|
|
4117
|
+
}
|
|
4118
|
+
);
|
|
4331
4119
|
if (skinnedSelections?.some(materialProgramSelectionRequiresSkin) === true && gpuDrivenMesh !== void 0) {
|
|
4332
4120
|
const hasSkinIndex = gpuDrivenMesh.attributes.skinIndex !== void 0;
|
|
4333
4121
|
const hasSkinWeight = gpuDrivenMesh.attributes.skinWeight !== void 0;
|
|
@@ -4352,7 +4140,7 @@ function extractFrame(world, context) {
|
|
|
4352
4140
|
])
|
|
4353
4141
|
);
|
|
4354
4142
|
const materialSceneIndexProgramKeys = materialSceneIndexProgramKeysForMaterial(
|
|
4355
|
-
|
|
4143
|
+
programOwner,
|
|
4356
4144
|
assets,
|
|
4357
4145
|
materialContext
|
|
4358
4146
|
);
|
|
@@ -5755,9 +5543,15 @@ function resolveMaterialSnapshot(handleRaw, world, assetsRef, materialSnapshotCa
|
|
|
5755
5543
|
if (!resolvedResult.ok) return defaultMaterialSnapshot(handleRaw);
|
|
5756
5544
|
const resolved = resolvedResult.value;
|
|
5757
5545
|
const allPasses = resolved.passes;
|
|
5758
|
-
const
|
|
5546
|
+
const source = world.sharedRefs.resolve(tagged);
|
|
5547
|
+
const programOwner = source.ok && source.value.kind === "material" ? source.value : asset;
|
|
5548
|
+
const materialProgramKeys = materialProgramKeysForMaterial(
|
|
5549
|
+
programOwner,
|
|
5550
|
+
assetsRef,
|
|
5551
|
+
materialContext
|
|
5552
|
+
);
|
|
5759
5553
|
const materialSceneIndexProgramKeys = materialSceneIndexProgramKeysForMaterial(
|
|
5760
|
-
|
|
5554
|
+
programOwner,
|
|
5761
5555
|
assetsRef,
|
|
5762
5556
|
materialContext
|
|
5763
5557
|
);
|
|
@@ -6477,6 +6271,6 @@ function extractVolumeSnapshot(world, assets, worldInternal) {
|
|
|
6477
6271
|
};
|
|
6478
6272
|
}
|
|
6479
6273
|
|
|
6480
|
-
export { ANTIALIAS_FXAA, ANTIALIAS_MSAA, ANTIALIAS_NONE, ANTIALIAS_TAA, Atmosphere, BLOOM_DISABLED, BLOOM_ENABLED, BarrelDistortion, CAMERA_BLOOM_INTENSITY_MAX, CAMERA_BLOOM_INTENSITY_MIN, CAMERA_BLOOM_SCATTER_MAX, CAMERA_BLOOM_SCATTER_MIN, CAMERA_BLOOM_SOFT_KNEE_MAX, CAMERA_BLOOM_SOFT_KNEE_MIN, CAMERA_BLOOM_THRESHOLD_MAX, CAMERA_BLOOM_THRESHOLD_MIN, CAMERA_EXPOSURE_MODE_AUTO, CAMERA_EXPOSURE_MODE_MANUAL, CAMERA_PROJECTION_ORTHOGRAPHIC, CAMERA_PROJECTION_PERSPECTIVE, CAMERA_TEMPERATURE_MAX, CAMERA_TEMPERATURE_MIN, CAMERA_TINT_MAX, CAMERA_TINT_MIN, CLOUD_EXTINCTION_COEFFICIENT, CLOUD_QUALITY_PROFILES, CUBE_CAMERA_FACE_ORDER, CUBE_CAMERA_UPDATE_CONTINUOUS, CUBE_CAMERA_UPDATE_ONCE, CUBE_CAMERA_UPDATE_ON_DEMAND, Camera, CameraError, CloudLayer, CloudLayerCacheInvalidError, CloudLayerCapabilityMissingError, CloudLayerInvalidParameterError, CloudLayerOwnerConflictError, CloudLayerResourceFailureError, CloudQualityValue, CubeCamera, DEFAULT_CLOUD_LAYER, DEFAULT_DEPTH_OF_FIELD_PARAMS, DEPTH_OF_FIELD_PARAMS_BYTE_SIZE, DepthOfField, DepthOfFieldQualityValue, DepthOfFieldSideValue, DepthOfFieldValidationError, DirectionalLight, DirectionalShadowFilterValue, DynamicResolution, Fog,
|
|
6481
|
-
//# sourceMappingURL=chunk-
|
|
6482
|
-
//# sourceMappingURL=chunk-
|
|
6274
|
+
export { ANTIALIAS_FXAA, ANTIALIAS_MSAA, ANTIALIAS_NONE, ANTIALIAS_TAA, Atmosphere, BLOOM_DISABLED, BLOOM_ENABLED, BarrelDistortion, CAMERA_BLOOM_INTENSITY_MAX, CAMERA_BLOOM_INTENSITY_MIN, CAMERA_BLOOM_SCATTER_MAX, CAMERA_BLOOM_SCATTER_MIN, CAMERA_BLOOM_SOFT_KNEE_MAX, CAMERA_BLOOM_SOFT_KNEE_MIN, CAMERA_BLOOM_THRESHOLD_MAX, CAMERA_BLOOM_THRESHOLD_MIN, CAMERA_EXPOSURE_MODE_AUTO, CAMERA_EXPOSURE_MODE_MANUAL, CAMERA_PROJECTION_ORTHOGRAPHIC, CAMERA_PROJECTION_PERSPECTIVE, CAMERA_TEMPERATURE_MAX, CAMERA_TEMPERATURE_MIN, CAMERA_TINT_MAX, CAMERA_TINT_MIN, CLOUD_EXTINCTION_COEFFICIENT, CLOUD_QUALITY_PROFILES, CUBE_CAMERA_FACE_ORDER, CUBE_CAMERA_UPDATE_CONTINUOUS, CUBE_CAMERA_UPDATE_ONCE, CUBE_CAMERA_UPDATE_ON_DEMAND, Camera, CameraError, CloudLayer, CloudLayerCacheInvalidError, CloudLayerCapabilityMissingError, CloudLayerInvalidParameterError, CloudLayerOwnerConflictError, CloudLayerResourceFailureError, CloudQualityValue, CubeCamera, DEFAULT_CLOUD_LAYER, DEFAULT_DEPTH_OF_FIELD_PARAMS, DEPTH_OF_FIELD_PARAMS_BYTE_SIZE, DepthOfField, DepthOfFieldQualityValue, DepthOfFieldSideValue, DepthOfFieldValidationError, DirectionalLight, DirectionalShadowFilterValue, DynamicResolution, Fog, Instances, Layer, LightProbe, Lines, MAX_VOLUMETRIC_FOG_OWNERS, MeshFilter, MeshRenderer, MotionBlur, PointLight, PointLightShadow, PointShapeValue, Points, PostProcessParams, REFLECTION_PROBE_UPDATE_CONTINUOUS, REFLECTION_PROBE_UPDATE_ONCE, REFLECTION_PROBE_UPDATE_ON_CHANGE, RectAreaLight, ReflectionProbe, SKYBOX_MODE_CUBEMAP, SKYLIGHT_RECOVERY_FALLBACK, SceneInstance, ScreenSpaceReflection, SkyboxBackground, Skylight, SortKey, SpotLight, SunCardinalityError, TONEMAP_ACES_FILMIC, TONEMAP_AGX, TONEMAP_CINEON, TONEMAP_LINEAR, TONEMAP_NEUTRAL, TONEMAP_NONE, TONEMAP_REINHARD, TONEMAP_REINHARD_EXTENDED, Visibility, VisibilityStateValue, VolumetricFog, VolumetricFogSamplingValue, attachBarrelDistortionCameraFrame, buildCubeCameraFaceViews, buildRectAreaWorldFrame, buildShadowFrusta, cameraExposureFromColumns, cameraProjectionFromF32, cloudLayerFormationKey, cloudLayerSourceKey, cloudQualityFromF32, cloudShadowResolutionForQuality, cloudViewDistanceForQuality, computeInvRangeSquared, createBarrelDistortionMapping, createCookieProjectionMatrixData, cubeCameraUpdateIntentFromF32, cubeCameraUpdateIntentToF32, degToCos, depthOfFieldQualityCode, depthOfFieldQualityFromF32, depthOfFieldRequestFailure, depthOfFieldSideCode, depthOfFieldSideFromF32, depthOfFieldTapCount, directionalShadowQualityFromF32, extractCloudLayer, extractFrames, extractVolumetricFog, freezeBarrelDistortionMapping, glyphTextLayoutSystem, hasVolumetricFogCapability, internSharedRefFromGuid, mapDisplayToScene, mapDisplayUvToSceneUv, mapSceneToDisplay, mapSceneUvToDisplayUv, orthographic, packDepthOfFieldParams, perspective, pointShapeFromU32, projectMeshMaterialBindingObservation, rectAreaFacesPoint, reflectionProbeUpdateIntentFromF32, reflectionProbeUpdateIntentToF32, resolveDepthOfFieldFrameParams, resolveDepthOfFieldParams, resolveIntegratedVolumeConsumer, resolveMaterialSnapshot, resolveSelectedVolumetricLight, resolveVisibility, resolveVolumetricFogLightPair, selectCloudLayerFrame, signedDepthOfFieldCoC, summarizeMeshMaterialBindings, validateBarrelDistortionParameters, validateCameraBloom, validateCameraColorGrading, validateCameraExposure, validateCloudLayer, validateDepthOfFieldFrameParams, validateDepthOfFieldParams, validateDirection, validateDirectionalLightData, validateDynamicResolutionCamera, validateDynamicResolutionParameters, validateLightProbeData, validatePointLightData, validatePointLightShadowData, validateRectAreaLightData, validateSpotLightData, validateVolumetricFog, visibilityStateFromU32 };
|
|
6275
|
+
//# sourceMappingURL=chunk-BZQ4CDRF.mjs.map
|
|
6276
|
+
//# sourceMappingURL=chunk-BZQ4CDRF.mjs.map
|