@babylonjs/lite 0.1.1 → 0.2.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/_mat4-storage-f64-Bvh5TymE.js +10 -0
- package/_mat4-storage-f64-Bvh5TymE.js.map +1 -0
- package/{alpha-test-fragment-CUiHCw7W.js → alpha-test-fragment-BCChpzaV.js} +2 -2
- package/{alpha-test-fragment-CUiHCw7W.js.map → alpha-test-fragment-BCChpzaV.js.map} +1 -1
- package/{background-dds-skybox-yHTqabU3.js → background-dds-skybox-ZjrSIxrT.js} +4 -4
- package/background-dds-skybox-ZjrSIxrT.js.map +1 -0
- package/{background-ground-DIw6D3qf.js → background-ground-B2Mie-MI.js} +3 -3
- package/background-ground-B2Mie-MI.js.map +1 -0
- package/{background-hdr-skybox-c4uuTmkP.js → background-hdr-skybox-DDRJYuT2.js} +3 -3
- package/background-hdr-skybox-DDRJYuT2.js.map +1 -0
- package/{background-solid-skybox-DPGBpPbm.js → background-solid-skybox-fjXlnWaD.js} +3 -3
- package/{background-solid-skybox-DPGBpPbm.js.map → background-solid-skybox-fjXlnWaD.js.map} +1 -1
- package/{billboard-renderable-D8mlVGCd.js → billboard-renderable-DKmlOgbM.js} +2 -2
- package/{billboard-renderable-D8mlVGCd.js.map → billboard-renderable-DKmlOgbM.js.map} +1 -1
- package/{clamp-block-BdII67hT.js → clamp-block-CxRBPlUq.js} +2 -2
- package/{clamp-block-BdII67hT.js.map → clamp-block-CxRBPlUq.js.map} +1 -1
- package/{clearcoat-fragment-LCiG98Rf.js → clearcoat-fragment-KbZAa0TA.js} +2 -2
- package/{clearcoat-fragment-LCiG98Rf.js.map → clearcoat-fragment-KbZAa0TA.js.map} +1 -1
- package/{create-skeleton-C9JdIJnb.js → create-skeleton-BBI5urcj.js} +2 -2
- package/{create-skeleton-C9JdIJnb.js.map → create-skeleton-BBI5urcj.js.map} +1 -1
- package/{cubemap-skybox-material-DvXMVc4k.js → cubemap-skybox-material-DvW81drX.js} +2 -2
- package/{cubemap-skybox-material-DvXMVc4k.js.map → cubemap-skybox-material-DvW81drX.js.map} +1 -1
- package/{curve-block-BlJpXVYv.js → curve-block-Dh_xdUj-.js} +2 -2
- package/{curve-block-BlJpXVYv.js.map → curve-block-Dh_xdUj-.js.map} +1 -1
- package/{emissive-fragment-BnNvbBCw.js → emissive-fragment-DD8cvHyx.js} +2 -2
- package/{emissive-fragment-BnNvbBCw.js.map → emissive-fragment-DD8cvHyx.js.map} +1 -1
- package/{esm-shadow-view-DGKdF1NI.js → esm-shadow-view-15S4JK6p.js} +2 -2
- package/{esm-shadow-view-DGKdF1NI.js.map → esm-shadow-view-15S4JK6p.js.map} +1 -1
- package/{esm-shadow-view-Dk9NFtLq.js → esm-shadow-view-DHVS9r7H.js} +2 -2
- package/{esm-shadow-view-Dk9NFtLq.js.map → esm-shadow-view-DHVS9r7H.js.map} +1 -1
- package/{esm-shadow-view-DN9HIaM4.js → esm-shadow-view-DYAc62Kl.js} +2 -2
- package/{esm-shadow-view-DN9HIaM4.js.map → esm-shadow-view-DYAc62Kl.js.map} +1 -1
- package/{gaussian-splatting-pipeline-sh-DgJl7l56.js → gaussian-splatting-pipeline-sh-BvkUhA9V.js} +2 -2
- package/{gaussian-splatting-pipeline-sh-DgJl7l56.js.map → gaussian-splatting-pipeline-sh-BvkUhA9V.js.map} +1 -1
- package/{gltf-animation-D7uyTyO3.js → gltf-animation-KnPzeOIY.js} +3 -3
- package/{gltf-animation-D7uyTyO3.js.map → gltf-animation-KnPzeOIY.js.map} +1 -1
- package/gltf-color-normalize-Qxl-9C48.js +29 -0
- package/gltf-color-normalize-Qxl-9C48.js.map +1 -0
- package/{gltf-ext-basisu-CPg5kPrx.js → gltf-ext-basisu-kmth3UWX.js} +7 -4
- package/gltf-ext-basisu-kmth3UWX.js.map +1 -0
- package/{gltf-ext-node-visibility-MafA9ot2.js → gltf-ext-node-visibility-BjRRd6si.js} +2 -2
- package/{gltf-ext-node-visibility-MafA9ot2.js.map → gltf-ext-node-visibility-BjRRd6si.js.map} +1 -1
- package/{gltf-ext-uv-transform-CE_-T1Tr.js → gltf-ext-uv-transform-MHmR-YyM.js} +2 -2
- package/{gltf-ext-uv-transform-CE_-T1Tr.js.map → gltf-ext-uv-transform-MHmR-YyM.js.map} +1 -1
- package/{gltf-feature-animation-pointer-BjpwOOqo.js → gltf-feature-animation-pointer-rFqLfbO_.js} +3 -3
- package/{gltf-feature-animation-pointer-BjpwOOqo.js.map → gltf-feature-animation-pointer-rFqLfbO_.js.map} +1 -1
- package/{gltf-feature-animations-CCizegp8.js → gltf-feature-animations-DikONdzi.js} +2 -2
- package/{gltf-feature-animations-CCizegp8.js.map → gltf-feature-animations-DikONdzi.js.map} +1 -1
- package/{gltf-feature-gpu-instancing-2e_CFQnl.js → gltf-feature-gpu-instancing-Cj1XjmM6.js} +5 -4
- package/gltf-feature-gpu-instancing-Cj1XjmM6.js.map +1 -0
- package/{gltf-feature-lights-punctual-DDDg4j0U.js → gltf-feature-lights-punctual-C-0SlGmD.js} +5 -5
- package/{gltf-feature-lights-punctual-DDDg4j0U.js.map → gltf-feature-lights-punctual-C-0SlGmD.js.map} +1 -1
- package/{gltf-feature-morph-CKCw6tkX.js → gltf-feature-morph-BAcY14XU.js} +3 -3
- package/{gltf-feature-morph-CKCw6tkX.js.map → gltf-feature-morph-BAcY14XU.js.map} +1 -1
- package/gltf-feature-registry-97sY_x5O.js +59 -0
- package/gltf-feature-registry-97sY_x5O.js.map +1 -0
- package/{gltf-feature-skeleton-D8hWLqi2.js → gltf-feature-skeleton-lVjkDfIU.js} +3 -3
- package/{gltf-feature-skeleton-D8hWLqi2.js.map → gltf-feature-skeleton-lVjkDfIU.js.map} +1 -1
- package/{gltf-feature-variants-Ds6v9byg.js → gltf-feature-variants-BphF4JmV.js} +2 -2
- package/{gltf-feature-variants-Ds6v9byg.js.map → gltf-feature-variants-BphF4JmV.js.map} +1 -1
- package/{gltf-interleave-DGnUlz28.js → gltf-interleave-C9eBqH_F.js} +2 -2
- package/{gltf-interleave-DGnUlz28.js.map → gltf-interleave-C9eBqH_F.js.map} +1 -1
- package/gltf-normals-b2h74380.js +37 -0
- package/gltf-normals-b2h74380.js.map +1 -0
- package/{gltf-pbr-builder-ext-BFOxOCnQ.js → gltf-pbr-builder-ext-DPC0zg_u.js} +2 -2
- package/{gltf-pbr-builder-ext-BFOxOCnQ.js.map → gltf-pbr-builder-ext-DPC0zg_u.js.map} +1 -1
- package/{gltf-variants-DFbr8EES.js → gltf-variants-CnBEZr0o.js} +4 -4
- package/{gltf-variants-DFbr8EES.js.map → gltf-variants-CnBEZr0o.js.map} +1 -1
- package/{gs-picking-pipeline-DzfMASL9.js → gs-picking-pipeline-Bx8LTav6.js} +2 -2
- package/{gs-picking-pipeline-DzfMASL9.js.map → gs-picking-pipeline-Bx8LTav6.js.map} +1 -1
- package/{index-C8HOR2sB.js → index-B7Qhw0xL.js} +3047 -1037
- package/index-B7Qhw0xL.js.map +1 -0
- package/index.d.ts +504 -17
- package/index.js +322 -304
- package/{input-block-DgAJBzN_.js → input-block-Coi_aZwl.js} +2 -2
- package/{input-block-DgAJBzN_.js.map → input-block-Coi_aZwl.js.map} +1 -1
- package/{iridescence-fragment-Gymp7or5.js → iridescence-fragment-DwZcCTdD.js} +2 -2
- package/{iridescence-fragment-Gymp7or5.js.map → iridescence-fragment-DwZcCTdD.js.map} +1 -1
- package/{light-block-B11ew7FA.js → light-block-Np_h5gPI.js} +2 -2
- package/{light-block-B11ew7FA.js.map → light-block-Np_h5gPI.js.map} +1 -1
- package/{loop-block-Bb23EOMb.js → loop-block-BFkLFYGm.js} +2 -2
- package/{loop-block-Bb23EOMb.js.map → loop-block-BFkLFYGm.js.map} +1 -1
- package/{mesh-features-BLENkYVt.js → mesh-features-BAJpbMog.js} +6 -3
- package/mesh-features-BAJpbMog.js.map +1 -0
- package/{morph-fragment-DOVo70gP.js → morph-fragment-DqH-w61u.js} +2 -2
- package/{morph-fragment-DOVo70gP.js.map → morph-fragment-DqH-w61u.js.map} +1 -1
- package/{multilight-wgsl-BGyiIOp3.js → multilight-wgsl-B9Mf9d-q.js} +4 -4
- package/{multilight-wgsl-BGyiIOp3.js.map → multilight-wgsl-B9Mf9d-q.js.map} +1 -1
- package/no-color-view-DsyLSL-W.js +8 -0
- package/no-color-view-DsyLSL-W.js.map +1 -0
- package/{node-registry-DwgC4yth.js → node-registry-Bd-AlrgC.js} +8 -8
- package/{node-registry-DwgC4yth.js.map → node-registry-Bd-AlrgC.js.map} +1 -1
- package/{node-registry-extra-compat-Dhrw8fDQ.js → node-registry-extra-compat-Ch7ApZHF.js} +2 -2
- package/{node-registry-extra-compat-Dhrw8fDQ.js.map → node-registry-extra-compat-Ch7ApZHF.js.map} +1 -1
- package/{node-registry-extra-math-CsAHvIZo.js → node-registry-extra-math-6ezzTkPj.js} +2 -2
- package/{node-registry-extra-math-CsAHvIZo.js.map → node-registry-extra-math-6ezzTkPj.js.map} +1 -1
- package/{node-renderable-DlLIdBmd.js → node-renderable-CS0CmsSp.js} +28 -11
- package/node-renderable-CS0CmsSp.js.map +1 -0
- package/{node-shadow-DKrcqmNg.js → node-shadow-CpnrdvtJ.js} +2 -2
- package/{node-shadow-DKrcqmNg.js.map → node-shadow-CpnrdvtJ.js.map} +1 -1
- package/{normal-map-fragment-DpsIXrJf.js → normal-map-fragment-DradEMl-.js} +3 -3
- package/{normal-map-fragment-DpsIXrJf.js.map → normal-map-fragment-DradEMl-.js.map} +1 -1
- package/pack-mat4-with-offset-BqB8Jqo7.js +37 -0
- package/pack-mat4-with-offset-BqB8Jqo7.js.map +1 -0
- package/package.json +3 -3
- package/{parse-camera-DM3oJJeT.js → parse-camera-CgV4bWc0.js} +2 -2
- package/{parse-camera-DM3oJJeT.js.map → parse-camera-CgV4bWc0.js.map} +1 -1
- package/pbr-fog-wgsl-BqdCid6r.js +8 -0
- package/pbr-fog-wgsl-BqdCid6r.js.map +1 -0
- package/{pbr-metallic-roughness-block-h_KAOZrW.js → pbr-metallic-roughness-block-BFwZj2Nw.js} +2 -2
- package/{pbr-metallic-roughness-block-h_KAOZrW.js.map → pbr-metallic-roughness-block-BFwZj2Nw.js.map} +1 -1
- package/{pbr-metallic-roughness-block-full-6vMm1Jk6.js → pbr-metallic-roughness-block-full-5t0HT3xl.js} +2 -2
- package/{pbr-metallic-roughness-block-full-6vMm1Jk6.js.map → pbr-metallic-roughness-block-full-5t0HT3xl.js.map} +1 -1
- package/{pbr-mr-helper-core-CIwm-T1G.js → pbr-mr-helper-core-R5tOZ8Ap.js} +2 -2
- package/{pbr-mr-helper-core-CIwm-T1G.js.map → pbr-mr-helper-core-R5tOZ8Ap.js.map} +1 -1
- package/{pbr-refraction-DGmMSa2v.js → pbr-refraction-Dd11HnaI.js} +2 -2
- package/{pbr-refraction-DGmMSa2v.js.map → pbr-refraction-Dd11HnaI.js.map} +1 -1
- package/{pbr-renderable-BJxUtPBb.js → pbr-renderable-BHAdF5Vw.js} +80 -38
- package/pbr-renderable-BHAdF5Vw.js.map +1 -0
- package/{pbr-shadow-fragment-LO9SlbJj.js → pbr-shadow-fragment-BxUrFJYZ.js} +6 -1
- package/pbr-shadow-fragment-BxUrFJYZ.js.map +1 -0
- package/{pbr-template-ext-8q7BcTDf.js → pbr-template-ext-CGgB2n2y.js} +3 -2
- package/{pbr-template-ext-8q7BcTDf.js.map → pbr-template-ext-CGgB2n2y.js.map} +1 -1
- package/{pbr-tracking-B3alzn91.js → pbr-tracking-D6i3yPb7.js} +2 -2
- package/{pbr-tracking-B3alzn91.js.map → pbr-tracking-D6i3yPb7.js.map} +1 -1
- package/pbr-transmission-ext-Dll8EYwE.js +190 -0
- package/pbr-transmission-ext-Dll8EYwE.js.map +1 -0
- package/{reflectance-fragment-BCrgPmrt.js → reflectance-fragment-ejMJ4O1o.js} +2 -2
- package/{reflectance-fragment-BCrgPmrt.js.map → reflectance-fragment-ejMJ4O1o.js.map} +1 -1
- package/{shader-renderable-D-6796KR.js → shader-renderable-BMf_vvO0.js} +41 -12
- package/shader-renderable-BMf_vvO0.js.map +1 -0
- package/shader-thin-instance-5_WUfi3m.js +150 -0
- package/shader-thin-instance-5_WUfi3m.js.map +1 -0
- package/shadow-fragment-core-DHN2G6FI.js.map +1 -1
- package/{sheen-fragment-Dze2f7XJ.js → sheen-fragment-CS6z29Fs.js} +2 -2
- package/{sheen-fragment-Dze2f7XJ.js.map → sheen-fragment-CS6z29Fs.js.map} +1 -1
- package/{singlelight-directional-wgsl-CmUDZxwz.js → singlelight-directional-wgsl-4MIgZMeC.js} +2 -2
- package/{singlelight-directional-wgsl-CmUDZxwz.js.map → singlelight-directional-wgsl-4MIgZMeC.js.map} +1 -1
- package/{singlelight-hemispheric-wgsl-t-83IP_s.js → singlelight-hemispheric-wgsl-CK-GUYWe.js} +2 -2
- package/{singlelight-hemispheric-wgsl-t-83IP_s.js.map → singlelight-hemispheric-wgsl-CK-GUYWe.js.map} +1 -1
- package/{singlelight-point-wgsl-CLzULIYV.js → singlelight-point-wgsl-CYtzqCbP.js} +2 -2
- package/{singlelight-point-wgsl-CLzULIYV.js.map → singlelight-point-wgsl-CYtzqCbP.js.map} +1 -1
- package/{singlelight-spot-wgsl-DEEUrfVM.js → singlelight-spot-wgsl-DVbaVufF.js} +2 -2
- package/{singlelight-spot-wgsl-DEEUrfVM.js.map → singlelight-spot-wgsl-DVbaVufF.js.map} +1 -1
- package/{skeleton-fragment-B_XlFbtx.js → skeleton-fragment-BOVmc8YS.js} +2 -2
- package/{skeleton-fragment-B_XlFbtx.js.map → skeleton-fragment-BOVmc8YS.js.map} +1 -1
- package/{skybox-renderable-DDwzu-PT.js → skybox-renderable-DDcCPSly.js} +3 -3
- package/{skybox-renderable-DDwzu-PT.js.map → skybox-renderable-DDcCPSly.js.map} +1 -1
- package/{standard-renderable-GjxL9xSf.js → standard-renderable-D1bhoF0K.js} +27 -81
- package/standard-renderable-D1bhoF0K.js.map +1 -0
- package/{std-ambient-fragment-BoUsD06w.js → std-ambient-fragment-C6WNm8dQ.js} +2 -2
- package/{std-ambient-fragment-BoUsD06w.js.map → std-ambient-fragment-C6WNm8dQ.js.map} +1 -1
- package/{std-cube-reflection-fragment-ulqc3bsP.js → std-cube-reflection-fragment-Bqutpy2q.js} +2 -2
- package/{std-cube-reflection-fragment-ulqc3bsP.js.map → std-cube-reflection-fragment-Bqutpy2q.js.map} +1 -1
- package/{std-emissive-fragment-DNGj1HdQ.js → std-emissive-fragment-B-A83rqX.js} +2 -2
- package/{std-emissive-fragment-DNGj1HdQ.js.map → std-emissive-fragment-B-A83rqX.js.map} +1 -1
- package/{std-lightmap-fragment-Bqj89aIe.js → std-lightmap-fragment-Df7KJezh.js} +2 -2
- package/{std-lightmap-fragment-Bqj89aIe.js.map → std-lightmap-fragment-Df7KJezh.js.map} +1 -1
- package/{std-opacity-fragment-KuPh5N2Z.js → std-opacity-fragment-D9et2jip.js} +2 -2
- package/{std-opacity-fragment-KuPh5N2Z.js.map → std-opacity-fragment-D9et2jip.js.map} +1 -1
- package/{std-reflection-fragment-BA5Ghn_M.js → std-reflection-fragment-DBJeT-yg.js} +2 -2
- package/{std-reflection-fragment-BA5Ghn_M.js.map → std-reflection-fragment-DBJeT-yg.js.map} +1 -1
- package/std-shadow-fragment-C6fD8rW-.js +13 -0
- package/std-shadow-fragment-C6fD8rW-.js.map +1 -0
- package/{std-specular-fragment-CE-6scqd.js → std-specular-fragment-C2ZOss-t.js} +2 -2
- package/{std-specular-fragment-CE-6scqd.js.map → std-specular-fragment-C2ZOss-t.js.map} +1 -1
- package/{std-tracking-CNKZ-hJN.js → std-tracking-C4L4nQGc.js} +2 -2
- package/{std-tracking-CNKZ-hJN.js.map → std-tracking-C4L4nQGc.js.map} +1 -1
- package/{subsurface-fragment-liM3y2-P.js → subsurface-fragment-C1H4ytqK.js} +2 -2
- package/{subsurface-fragment-liM3y2-P.js.map → subsurface-fragment-C1H4ytqK.js.map} +1 -1
- package/thin-instance-cull-binding-CCxrPNO6.js +310 -0
- package/thin-instance-cull-binding-CCxrPNO6.js.map +1 -0
- package/{thin-instance-gpu-C9Gv_Z1w.js → thin-instance-gpu-E8DBd8XL.js} +20 -3
- package/thin-instance-gpu-E8DBd8XL.js.map +1 -0
- package/{tracking-primitives-wgdBY85t.js → tracking-primitives-w4BVV9p9.js} +2 -2
- package/{tracking-primitives-wgdBY85t.js.map → tracking-primitives-w4BVV9p9.js.map} +1 -1
- package/{unlit-fragment-BIlhJpz6.js → unlit-fragment-DU9_mhzZ.js} +2 -2
- package/{unlit-fragment-BIlhJpz6.js.map → unlit-fragment-DU9_mhzZ.js.map} +1 -1
- package/{wgsl-helpers-DyzNzCeE.js → wgsl-helpers-D8sl1VVA.js} +4 -4
- package/{wgsl-helpers-DyzNzCeE.js.map → wgsl-helpers-D8sl1VVA.js.map} +1 -1
- package/background-dds-skybox-yHTqabU3.js.map +0 -1
- package/background-ground-DIw6D3qf.js.map +0 -1
- package/background-hdr-skybox-c4uuTmkP.js.map +0 -1
- package/gltf-ext-basisu-CPg5kPrx.js.map +0 -1
- package/gltf-feature-gpu-instancing-2e_CFQnl.js.map +0 -1
- package/index-C8HOR2sB.js.map +0 -1
- package/mesh-features-BLENkYVt.js.map +0 -1
- package/node-renderable-DlLIdBmd.js.map +0 -1
- package/pbr-renderable-BJxUtPBb.js.map +0 -1
- package/pbr-shadow-fragment-LO9SlbJj.js.map +0 -1
- package/pbr-transmission-ext-BxW4CEGu.js +0 -581
- package/pbr-transmission-ext-BxW4CEGu.js.map +0 -1
- package/shader-renderable-D-6796KR.js.map +0 -1
- package/standard-renderable-GjxL9xSf.js.map +0 -1
- package/std-shadow-fragment-FNQfrJuC.js +0 -8
- package/std-shadow-fragment-FNQfrJuC.js.map +0 -1
- package/thin-instance-gpu-C9Gv_Z1w.js.map +0 -1
package/index.d.ts
CHANGED
|
@@ -48,6 +48,15 @@ export declare function addBillboardSpriteIndex(system: BillboardSpriteSystem, p
|
|
|
48
48
|
*/
|
|
49
49
|
export declare function addBoxObstacle(plugin: NavigationPlugin, position: Vec3, halfExtents: Vec3, angle: number): ObstacleHandle | null;
|
|
50
50
|
|
|
51
|
+
/**
|
|
52
|
+
* Register a clustered light container on a scene, building its GPU state and
|
|
53
|
+
* wiring it into the PBR materials already present in the scene.
|
|
54
|
+
*
|
|
55
|
+
* @param scene - The scene to attach the container to.
|
|
56
|
+
* @param container - The clustered light container to register.
|
|
57
|
+
*/
|
|
58
|
+
export declare function addClusteredLightContainer(scene: SceneContext, container: ClusteredLightContainer): void;
|
|
59
|
+
|
|
51
60
|
/**
|
|
52
61
|
* Add a cylinder obstacle to a tile-cache navmesh.
|
|
53
62
|
*
|
|
@@ -124,9 +133,11 @@ export declare function addTaskBefore(target: FrameGraph | SceneContext, task: T
|
|
|
124
133
|
export declare function addThinInstance(mesh: Mesh, matrix: Mat4): number;
|
|
125
134
|
|
|
126
135
|
/**
|
|
127
|
-
* Adds an entity
|
|
128
|
-
*
|
|
129
|
-
*
|
|
136
|
+
* Adds an entity (mesh, light, camera, transform node, shadow generator, or asset container)
|
|
137
|
+
* to the scene, dispatching on its type. Asset containers are unpacked and each contained
|
|
138
|
+
* entity added recursively. Optional scene-hosted systems such as depth-hosted sprites
|
|
139
|
+
* expose their own opt-in add functions so mesh-only scenes do not pay feature-specific
|
|
140
|
+
* routing bytes here.
|
|
130
141
|
* @param scene - The owning scene (pillar 4b: entities never reference the scene themselves).
|
|
131
142
|
* @param entity - The entity (or asset container) to add.
|
|
132
143
|
*/
|
|
@@ -338,11 +349,39 @@ export declare interface ArcRotateCamera extends Camera, IWorldMatrixProvider, I
|
|
|
338
349
|
inertialRadiusOffset: number;
|
|
339
350
|
inertialPanningX: number;
|
|
340
351
|
inertialPanningY: number;
|
|
341
|
-
|
|
352
|
+
/**
|
|
353
|
+
* Optional orbit limits enforced by {@link attachControl}'s per-frame loop.
|
|
354
|
+
* `undefined` means unbounded on that side. Set these via {@link setCameraLimits}
|
|
355
|
+
* so the current pose is clamped immediately (and inertia zeroed at the wall),
|
|
356
|
+
* avoiding any overshoot-then-snap jiggle. Angles are in radians.
|
|
357
|
+
*/
|
|
358
|
+
lowerAlphaLimit?: number;
|
|
359
|
+
upperAlphaLimit?: number;
|
|
360
|
+
lowerBetaLimit?: number;
|
|
361
|
+
upperBetaLimit?: number;
|
|
362
|
+
lowerRadiusLimit?: number;
|
|
363
|
+
upperRadiusLimit?: number;
|
|
342
364
|
parent: IWorldMatrixProvider | null;
|
|
343
365
|
readonly worldMatrix: Mat4;
|
|
344
366
|
readonly worldMatrixVersion: number;
|
|
345
367
|
}
|
|
346
368
|
|
|
369
|
+
/** Orbit limits for an {@link ArcRotateCamera}. Omit a field to leave that bound
|
|
370
|
+
* unbounded; pass an explicit `undefined` to clear a previously-set bound. */
|
|
371
|
+
export declare interface ArcRotateCameraLimits {
|
|
372
|
+
/** Minimum alpha (orbit) angle, radians. */
|
|
373
|
+
lowerAlphaLimit?: number;
|
|
374
|
+
/** Maximum alpha (orbit) angle, radians. */
|
|
375
|
+
upperAlphaLimit?: number;
|
|
376
|
+
/** Minimum beta (elevation) angle, radians. */
|
|
377
|
+
lowerBetaLimit?: number;
|
|
378
|
+
/** Maximum beta (elevation) angle, radians. */
|
|
379
|
+
upperBetaLimit?: number;
|
|
380
|
+
/** Minimum radius (closest zoom). */
|
|
381
|
+
lowerRadiusLimit?: number;
|
|
382
|
+
/** Maximum radius (farthest zoom). */
|
|
383
|
+
upperRadiusLimit?: number;
|
|
384
|
+
}
|
|
385
|
+
|
|
347
386
|
/**
|
|
348
387
|
* Result returned by loadGltf / loadBabylon.
|
|
349
388
|
* Pass directly to addToScene() — it handles all fields automatically.
|
|
@@ -378,7 +417,11 @@ export declare interface AssetContainer {
|
|
|
378
417
|
* - Pinch: zoom (touch, direct — no inertia)
|
|
379
418
|
*
|
|
380
419
|
* Input handlers accumulate into the camera's inertial offset properties.
|
|
381
|
-
* Inertia is applied each frame via scene._beforeRender (
|
|
420
|
+
* Inertia is applied each frame via scene._beforeRender (the engine's render
|
|
421
|
+
* loop); a scene is required for inertia, there is no standalone rAF fallback.
|
|
422
|
+
*
|
|
423
|
+
* Orbit/zoom limits are entirely opt-in via {@link setCameraLimits}; the camera
|
|
424
|
+
* self-clamps in its setters, so this loop carries no limit code.
|
|
382
425
|
*
|
|
383
426
|
* Camera stays plain data — this function reads/writes its properties.
|
|
384
427
|
* Returns a cleanup function to remove all listeners and the beforeRender hook.
|
|
@@ -596,7 +639,13 @@ export declare interface BlurPostProcessTaskConfig extends Omit<PostProcessTaskC
|
|
|
596
639
|
|
|
597
640
|
/** Minimal camera contract — any camera that can provide view/projection matrices.
|
|
598
641
|
* Both ArcRotateCamera and FreeCamera implement this interface.
|
|
599
|
-
* Pure state, no scene knowledge (pillar 4b).
|
|
642
|
+
* Pure state, no scene knowledge (pillar 4b).
|
|
643
|
+
*
|
|
644
|
+
* The view/projection matrix caches below are allocated by the camera factory
|
|
645
|
+
* via the process-global `allocateMat4()` singleton — F32 by default, F64
|
|
646
|
+
* after any HPM engine is constructed (see
|
|
647
|
+
* `docs/architecture/33-high-precision-matrix.md`). The storage
|
|
648
|
+
* type is fixed at construction and never changes. */
|
|
600
649
|
export declare interface Camera {
|
|
601
650
|
fov: number;
|
|
602
651
|
nearPlane: number;
|
|
@@ -680,34 +729,72 @@ export declare function clearSpriteAnimations(manager: SpriteAnimationManager):
|
|
|
680
729
|
/** A clipping plane expressed as the coefficients `[a, b, c, d]` of `a·x + b·y + c·z + d`. */
|
|
681
730
|
export declare type ClipPlane = readonly [number, number, number, number];
|
|
682
731
|
|
|
732
|
+
/** Create a fresh Texture2D wrapper that shares GPU resources with `base`
|
|
733
|
+
* but carries its own UV transform. Use this when the same underlying image
|
|
734
|
+
* is referenced with different transforms (e.g. glTF KHR_texture_transform
|
|
735
|
+
* on different textureInfos pointing at the same source). The caller is
|
|
736
|
+
* responsible for acquireTexture/release pairing if the wrapper outlives
|
|
737
|
+
* the base. */
|
|
738
|
+
export declare function cloneTexture2D(base: Texture2D, transform: Partial<Pick<Texture2D, "uScale" | "vScale" | "uOffset" | "vOffset" | "uAng">> & {
|
|
739
|
+
_texCoord?: 0 | 1;
|
|
740
|
+
_hasTx?: true;
|
|
741
|
+
}): Texture2D;
|
|
742
|
+
|
|
683
743
|
/** Deep-clone a SceneNode tree. Meshes are shallow-cloned (shared GPU buffers).
|
|
684
744
|
* Lights, cameras, and other non-mesh/non-TN children are shallow-cloned. */
|
|
685
745
|
export declare function cloneTransformNode(src: SceneNode): SceneNode;
|
|
686
746
|
|
|
747
|
+
/**
|
|
748
|
+
* Holds a large set of point lights that are binned into screen-space clusters
|
|
749
|
+
* on the GPU, so PBR materials can shade hundreds of lights efficiently. Add it
|
|
750
|
+
* to a scene with {@link addClusteredLightContainer}.
|
|
751
|
+
*/
|
|
687
752
|
export declare interface ClusteredLightContainer {
|
|
753
|
+
/** Discriminant tag identifying this object as a clustered light container. */
|
|
688
754
|
readonly kind: "clusteredLightContainer";
|
|
755
|
+
/** The point lights managed by this container. */
|
|
689
756
|
pointLights: ClusteredPointLight[];
|
|
757
|
+
/** Number of cluster tiles across the screen horizontally. */
|
|
690
758
|
horizontalTiles: number;
|
|
759
|
+
/** Number of cluster tiles across the screen vertically. */
|
|
691
760
|
verticalTiles: number;
|
|
761
|
+
/** Number of depth slices used to bin lights along view-space Z. */
|
|
692
762
|
zSlices: number;
|
|
693
763
|
|
|
764
|
+
/** Options for {@link createClusteredLightContainer}. */
|
|
694
765
|
export declare interface ClusteredLightContainerOptions {
|
|
766
|
+
/** Number of cluster tiles across the screen horizontally. Default `64`. */
|
|
695
767
|
horizontalTiles?: number;
|
|
768
|
+
/** Number of cluster tiles across the screen vertically. Default `64`. */
|
|
696
769
|
verticalTiles?: number;
|
|
770
|
+
/** Number of depth slices used to bin lights along view-space Z. Default `16`. */
|
|
697
771
|
zSlices?: number;
|
|
698
772
|
}
|
|
699
773
|
|
|
774
|
+
/**
|
|
775
|
+
* A single point light stored inside a {@link ClusteredLightContainer}. Plain
|
|
776
|
+
* data — created via {@link createClusteredPointLight} and mutated in place.
|
|
777
|
+
*/
|
|
700
778
|
export declare interface ClusteredPointLight {
|
|
779
|
+
/** World-space position `[x, y, z]`. */
|
|
701
780
|
position: [number, number, number];
|
|
781
|
+
/** Diffuse colour `[r, g, b]` in linear space. */
|
|
702
782
|
diffuse: [number, number, number];
|
|
783
|
+
/** Falloff range in world units. */
|
|
703
784
|
range: number;
|
|
785
|
+
/** Light intensity multiplier. */
|
|
704
786
|
intensity: number;
|
|
705
787
|
}
|
|
706
788
|
|
|
789
|
+
/** Options for {@link createClusteredPointLight}. */
|
|
707
790
|
export declare interface ClusteredPointLightOptions {
|
|
791
|
+
/** World-space position `[x, y, z]`. */
|
|
708
792
|
position: [number, number, number];
|
|
793
|
+
/** Diffuse colour `[r, g, b]` in linear space. */
|
|
709
794
|
diffuse: [number, number, number];
|
|
795
|
+
/** Falloff range in world units. Default `1`. */
|
|
710
796
|
range?: number;
|
|
797
|
+
/** Light intensity multiplier. Default `1`. */
|
|
711
798
|
intensity?: number;
|
|
712
799
|
}
|
|
713
800
|
|
|
@@ -802,6 +889,26 @@ export declare function createBox(engine: EngineContext, size?: number): Mesh;
|
|
|
802
889
|
*/
|
|
803
890
|
export declare function createChromaticAberrationPostProcessTask(config: ChromaticAberrationPostProcessTaskConfig, engine: EngineContext, scene?: SceneContext): ChromaticAberrationPostProcessTask;
|
|
804
891
|
|
|
892
|
+
/**
|
|
893
|
+
* Create an empty {@link ClusteredLightContainer}. Add point lights with
|
|
894
|
+
* {@link createClusteredPointLight}, then register it on a scene via
|
|
895
|
+
* {@link addClusteredLightContainer}.
|
|
896
|
+
*
|
|
897
|
+
* @param options - Optional cluster tiling overrides.
|
|
898
|
+
* @returns A new, empty clustered light container.
|
|
899
|
+
*/
|
|
900
|
+
export declare function createClusteredLightContainer(options?: ClusteredLightContainerOptions): ClusteredLightContainer;
|
|
901
|
+
|
|
902
|
+
/**
|
|
903
|
+
* Add a point light to a clustered light container.
|
|
904
|
+
*
|
|
905
|
+
* @param container - The container to add the light to.
|
|
906
|
+
* @param options - The light's position, colour and (optional) range/intensity.
|
|
907
|
+
* @returns The created light (also pushed onto `container.pointLights`); mutate
|
|
908
|
+
* it in place and call {@link markClusteredLightContainerDirty} to animate it.
|
|
909
|
+
*/
|
|
910
|
+
export declare function createClusteredPointLight(container: ClusteredLightContainer, options: ClusteredPointLightOptions): ClusteredPointLight;
|
|
911
|
+
|
|
805
912
|
/**
|
|
806
913
|
* Builds a {@link Csg2Solid} from a mesh's CPU geometry, baking its world transform.
|
|
807
914
|
* @param mesh - Source mesh; must retain CPU positions, normals, and indices.
|
|
@@ -818,6 +925,22 @@ export declare function createCsg2FromMesh(mesh: Mesh, materialSlot?: number): C
|
|
|
818
925
|
*/
|
|
819
926
|
export declare function createCsgFromMesh(mesh: Mesh, materialSlot?: number): CsgSolid;
|
|
820
927
|
|
|
928
|
+
/**
|
|
929
|
+
* Creates a cascaded shadow map (CSM) generator for a directional light.
|
|
930
|
+
*
|
|
931
|
+
* The shadow map is a `depth32float` `texture_2d_array` with one layer per
|
|
932
|
+
* cascade; each cascade is fit to a logarithmic/uniform slice of the active
|
|
933
|
+
* camera frustum and sampled on the receiver with a 5×5 PCF kernel. Casters are
|
|
934
|
+
* supplied via {@link setShadowTaskCasterMeshes} and the receiver is any mesh
|
|
935
|
+
* with `receiveShadows = true`.
|
|
936
|
+
*
|
|
937
|
+
* @param engine - The engine providing the GPU device.
|
|
938
|
+
* @param _light - The directional light that casts the shadows.
|
|
939
|
+
* @param cfg - Optional cascade, map-size and bias configuration.
|
|
940
|
+
* @returns A `ShadowGenerator` wired to the CSM render path.
|
|
941
|
+
*/
|
|
942
|
+
export declare function createCsmDirectionalShadowGenerator(engine: EngineContext, _light: DirectionalLight, cfg?: CsmDirectionalShadowGeneratorConfig): ShadowGenerator;
|
|
943
|
+
|
|
821
944
|
/** Create a cylinder (or cone / truncated cone / prism) mesh. Caller must assign material. */
|
|
822
945
|
export declare function createCylinder(engine: EngineContext, options?: CylinderOptions): Mesh;
|
|
823
946
|
|
|
@@ -1282,6 +1405,18 @@ export declare function createTexture2DFromPixels(engine: EngineContext, data: U
|
|
|
1282
1405
|
/** Create a torus mesh. Caller must assign material. */
|
|
1283
1406
|
export declare function createTorus(engine: EngineContext, options?: TorusOptions): Mesh;
|
|
1284
1407
|
|
|
1408
|
+
/** Create a torus-knot mesh. Caller must assign material. */
|
|
1409
|
+
export declare function createTorusKnot(engine: EngineContext, options?: TorusKnotOptions): Mesh;
|
|
1410
|
+
|
|
1411
|
+
/**
|
|
1412
|
+
* Builds the CPU vertex data for a torus knot, matching Babylon.js byte-for-byte
|
|
1413
|
+
* (same curve math, same Frenet frame, same ComputeNormals, same index winding).
|
|
1414
|
+
*
|
|
1415
|
+
* @param opts - Optional radius / tube / segmentation / winding parameters.
|
|
1416
|
+
* @returns Tightly-packed `positions`, `normals`, `uvs` and `indices` typed arrays.
|
|
1417
|
+
*/
|
|
1418
|
+
export declare function createTorusKnotData(opts?: TorusKnotOptions): TorusKnotData;
|
|
1419
|
+
|
|
1285
1420
|
/** Create a TransformNode (SceneNode) with TRS values and lazy world matrix.
|
|
1286
1421
|
* Parameters: name, position (px,py,pz), rotation quaternion (qx,qy,qz,qw), scaling (sx,sy,sz). */
|
|
1287
1422
|
export declare function createTransformNode(name: string, px?: number, py?: number, pz?: number, qx?: number, qy?: number, qz?: number, qw?: number, sx?: number, sy?: number, sz?: number): TransformNode;
|
|
@@ -1354,6 +1489,30 @@ export declare function csgSubtract(a: CsgSolid, b: CsgSolid): CsgSolid;
|
|
|
1354
1489
|
*/
|
|
1355
1490
|
export declare function csgUnion(a: CsgSolid, b: CsgSolid): CsgSolid;
|
|
1356
1491
|
|
|
1492
|
+
/** Configuration for a directional-light cascaded shadow generator. */
|
|
1493
|
+
export declare interface CsmDirectionalShadowGeneratorConfig {
|
|
1494
|
+
/** Shadow map resolution per cascade (square). Default 1024. */
|
|
1495
|
+
mapSize?: number;
|
|
1496
|
+
/** Number of cascades. Default 4 (max 4). */
|
|
1497
|
+
numCascades?: number;
|
|
1498
|
+
/** Split blend between logarithmic and uniform partitioning, 0..1. Default 0.5. */
|
|
1499
|
+
lambda?: number;
|
|
1500
|
+
/** Fraction of a cascade used to cross-fade into the next one. Default 0.1. Set 0 to disable blending. */
|
|
1501
|
+
cascadeBlendPercentage?: number;
|
|
1502
|
+
/** Use a stable bounding-sphere fit (no shimmering) instead of a tight AABB fit. Default false. */
|
|
1503
|
+
stabilizeCascades?: boolean;
|
|
1504
|
+
/** Maximum shadow distance in world units. Default = camera far plane. */
|
|
1505
|
+
shadowMaxZ?: number;
|
|
1506
|
+
/** Depth bias added during shadow-map generation. Default 0.00005. */
|
|
1507
|
+
bias?: number;
|
|
1508
|
+
/** Shadow darkness (0 = black shadow, 1 = no shadow). Default 0. */
|
|
1509
|
+
darkness?: number;
|
|
1510
|
+
/** Soft fade-out at the edge of each cascade frustum, 0..1. Default 0. */
|
|
1511
|
+
frustumEdgeFalloff?: number;
|
|
1512
|
+
/** Regenerate every cascade every frame even when nothing moved. Default false. */
|
|
1513
|
+
forceRefreshEveryFrame?: boolean;
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1357
1516
|
/** One extra texture bound after the atlas. In WGSL it becomes `<name>Tex` + `<name>Samp`. */
|
|
1358
1517
|
export declare interface CustomShaderTexture {
|
|
1359
1518
|
/** Identifier used in WGSL: becomes `<name>Tex` (texture) and `<name>Samp` (sampler). */
|
|
@@ -1549,6 +1708,21 @@ export declare function enableAnimationBlending(manager: AnimationManager): void
|
|
|
1549
1708
|
*/
|
|
1550
1709
|
export declare function enableDetailedPicking(picker: GpuPicker): void;
|
|
1551
1710
|
|
|
1711
|
+
/**
|
|
1712
|
+
* Enable material-plugin support for `scene`.
|
|
1713
|
+
*
|
|
1714
|
+
* - Registers the PBR plugin bridge: its `detect` hook encodes a per-signature
|
|
1715
|
+
* index into each PBR material's feature bits during the build, so no mesh
|
|
1716
|
+
* walk is needed here.
|
|
1717
|
+
* - Registers the Standard plugin bridge and walks `scene.meshes`, pre-baking a
|
|
1718
|
+
* per-signature index into every Standard plugin material's cached
|
|
1719
|
+
* `_renderFeatures` (Standard's feature computation is not ext-extensible, so
|
|
1720
|
+
* the index must be baked in up front). Standard plugin uniforms are delivered
|
|
1721
|
+
* through a self-managed uniform buffer built here and bound via the
|
|
1722
|
+
* pre-existing `StdExt._bind` loop.
|
|
1723
|
+
*/
|
|
1724
|
+
export declare function enableMaterialPlugins(scene: SceneContext): void;
|
|
1725
|
+
|
|
1552
1726
|
/** Enable automatic dirty tracking on a PBR or Standard material.
|
|
1553
1727
|
* After calling this, any UBO-backed property mutation marks the source material UBO dirty. */
|
|
1554
1728
|
export declare function enableMaterialTracking(material: Material & {
|
|
@@ -1558,6 +1732,10 @@ export declare function enableMaterialTracking(material: Material & {
|
|
|
1558
1732
|
/** Enables weighted property-animation blending on `manager` by registering its category handler. */
|
|
1559
1733
|
export declare function enablePropertyAnimationBlending(manager: AnimationManager): void;
|
|
1560
1734
|
|
|
1735
|
+
export declare function enableRenderTaskTransmission(task: RenderTask, engine: EngineContext, options?: TransmissionOptions): SceneColorGrab;
|
|
1736
|
+
|
|
1737
|
+
export declare function enableSceneTransmission(scene: SceneContext, engine: EngineContext): void;
|
|
1738
|
+
|
|
1561
1739
|
/** Enable or disable GPU frustum culling for an existing thin-instanced mesh.
|
|
1562
1740
|
*
|
|
1563
1741
|
* Call this after `setThinInstances()`/`addThinInstance()` and before `registerScene()`.
|
|
@@ -1578,6 +1756,22 @@ export declare interface EngineContext {
|
|
|
1578
1756
|
readonly format: GPUTextureFormat;
|
|
1579
1757
|
/** Number of GPU draw calls in the last rendered frame. */
|
|
1580
1758
|
drawCallCount: number;
|
|
1759
|
+
/**
|
|
1760
|
+
* When true, world matrices are computed using Float64 intermediate precision
|
|
1761
|
+
* and downcast to Float32 at GPU upload time. Defaults to false.
|
|
1762
|
+
*/
|
|
1763
|
+
useHighPrecisionMatrix: boolean;
|
|
1764
|
+
/**
|
|
1765
|
+
* When true, every scene on this engine uses the floating-origin (eye-relative
|
|
1766
|
+
* upload) trick to render large-world coordinates without F32 jitter. Requires
|
|
1767
|
+
* `useHighPrecisionMatrix: true`. Defaults to false.
|
|
1768
|
+
*
|
|
1769
|
+
* LWR is engine-wide: all scenes created against this engine inherit the
|
|
1770
|
+
* mode. The LWR runtime module (`large-world/floating-origin.js`) is
|
|
1771
|
+
* dynamically imported during `createEngine` only when this flag is true,
|
|
1772
|
+
* so non-LWR engines never pull the module into their bundle.
|
|
1773
|
+
*/
|
|
1774
|
+
useFloatingOrigin: boolean;
|
|
1581
1775
|
/** Clamps the effective device pixel ratio used for the swapchain backing store.
|
|
1582
1776
|
* The backing store is sized at `min(devicePixelRatio, maxDevicePixelRatio) * cssPixels`.
|
|
1583
1777
|
* `maxDevicePixelRatio = 1` renders at native CSS-pixel resolution (no DPR upscaling);
|
|
@@ -1598,6 +1792,21 @@ export declare interface EngineOptions {
|
|
|
1598
1792
|
* with `alpha < 1` will let HTML content underneath show through). Defaults to "opaque".
|
|
1599
1793
|
*/
|
|
1600
1794
|
alphaMode?: GPUCanvasAlphaMode;
|
|
1795
|
+
/**
|
|
1796
|
+
* Enable Float64 intermediate precision for world matrix computations. Defaults to false.
|
|
1797
|
+
*/
|
|
1798
|
+
useHighPrecisionMatrix?: boolean;
|
|
1799
|
+
/**
|
|
1800
|
+
* Enable floating-origin (Large World Rendering) for every scene on this engine.
|
|
1801
|
+
* Requires `useHighPrecisionMatrix: true` — throws synchronously if set without it.
|
|
1802
|
+
* Defaults to false.
|
|
1803
|
+
*
|
|
1804
|
+
* When true, `createEngine` dynamically imports the LWR runtime
|
|
1805
|
+
* (`large-world/floating-origin.js`) so engines without LWR never pull the
|
|
1806
|
+
* module into their bundle (tree-shaken via the dynamic-import gate, same
|
|
1807
|
+
* pattern as the F64 storage module).
|
|
1808
|
+
*/
|
|
1809
|
+
useFloatingOrigin?: boolean;
|
|
1601
1810
|
/**
|
|
1602
1811
|
* Clamps the effective device pixel ratio used for the swapchain backing store.
|
|
1603
1812
|
* The backing store is sized at `min(devicePixelRatio, maxDevicePixelRatio) * cssPixels`.
|
|
@@ -1805,6 +2014,12 @@ export declare function getClosestPoint(plugin: NavigationPlugin, position: Vec3
|
|
|
1805
2014
|
/** Returns the render-target aspect ratio adjusted for the camera's normalized viewport, or the raw ratio if none. */
|
|
1806
2015
|
export declare function getEffectiveAspectRatio(camera: Camera | null | undefined, targetWidth: number, targetHeight: number): number;
|
|
1807
2016
|
|
|
2017
|
+
/** Read the current floating-origin offset from a scene as a `Vec3`. The
|
|
2018
|
+
* offset is the active camera's world position. Returns the zero vector
|
|
2019
|
+
* when no camera is set (typical headless/precompute case). For non-LWR
|
|
2020
|
+
* engines this module is not imported, so the function is unreachable. */
|
|
2021
|
+
export declare function getFloatingOriginOffset(scene: SceneContext): Vec3;
|
|
2022
|
+
|
|
1808
2023
|
/** Get the scene's frame graph. Always non-null — created in `createSceneContext`. */
|
|
1809
2024
|
export declare function getFrameGraph(scene: SceneContext): FrameGraph;
|
|
1810
2025
|
|
|
@@ -1865,7 +2080,19 @@ export declare function getSprite2DHandleIndex(handle: Sprite2DHandle): number;
|
|
|
1865
2080
|
*/
|
|
1866
2081
|
export declare function getVariantNames(container: AssetContainer): readonly string[];
|
|
1867
2082
|
|
|
1868
|
-
/** Compute the view matrix for a camera. Cached per worldMatrixVersion.
|
|
2083
|
+
/** Compute the view matrix for a camera. Cached per worldMatrixVersion.
|
|
2084
|
+
*
|
|
2085
|
+
* Floating-origin awareness: when `camera._useFloatingOrigin` is set
|
|
2086
|
+
* (LWR — wired by the scene's `_update` when the active scene camera is
|
|
2087
|
+
* bound to an LWR engine), the view matrix translation column is forced
|
|
2088
|
+
* to zero. The GPU vertex shader then sees the camera at the origin in
|
|
2089
|
+
* the eye-relative frame, matching the mesh-world UBO pack which
|
|
2090
|
+
* subtracted the camera position from world translations. View × world
|
|
2091
|
+
* in the shader produces eye-relative vertex coordinates at full
|
|
2092
|
+
* precision regardless of how far from world-origin the scene is.
|
|
2093
|
+
*
|
|
2094
|
+
* When the flag is unset (standard non-LWR rendering), this path is
|
|
2095
|
+
* bit-identical to a normal `R_inv * -cameraPos` view matrix. */
|
|
1869
2096
|
export declare function getViewMatrix(camera: Camera): Mat4;
|
|
1870
2097
|
|
|
1871
2098
|
/** Compute the view-projection matrix for a camera. Cached per worldMatrixVersion + aspect. */
|
|
@@ -2273,16 +2500,24 @@ export declare function loadSPZ(scene: SceneContext, url: string): Promise<Gauss
|
|
|
2273
2500
|
* @returns A promise resolving to the uploaded `Texture2D`. */
|
|
2274
2501
|
export declare function loadTexture2D(engine: EngineContext, url: string, opts?: Texture2DOptions): Promise<Texture2D>;
|
|
2275
2502
|
|
|
2503
|
+
/** Force the container's GPU light state to re-upload next frame. Call after mutating a light's
|
|
2504
|
+
* position / range / intensity / diffuse in place (e.g. animated lights such as drifting fireflies),
|
|
2505
|
+
* since those edits don't bump the container version on their own. */
|
|
2506
|
+
export declare function markClusteredLightContainerDirty(container: ClusteredLightContainer): void;
|
|
2507
|
+
|
|
2276
2508
|
/** Mark a material source (or one of its views) as needing UBO re-upload.
|
|
2277
2509
|
* The source owns a monotonic version so multiple renderables/views can observe
|
|
2278
2510
|
* the same mutation independently without racing on a single cleared boolean. */
|
|
2279
2511
|
export declare function markMaterialUboDirty(materialOrView: Material): void;
|
|
2280
2512
|
|
|
2281
|
-
/** 4x4 column-major matrix
|
|
2282
|
-
* Layout matches WebGPU/WGSL mat4x4<f32> memory order.
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2513
|
+
/** 4x4 column-major matrix (16 elements).
|
|
2514
|
+
* Layout matches WebGPU/WGSL mat4x4<f32> memory order. Opaque-by-convention:
|
|
2515
|
+
* callers MUST NOT depend on the underlying storage (Float32Array vs
|
|
2516
|
+
* Float64Array). Internal kernels and uploaders use the `Mat4Storage` view
|
|
2517
|
+
* defined below to access the concrete typed array behind the brand. */
|
|
2518
|
+
export declare interface Mat4 {
|
|
2286
2519
|
readonly length: 16;
|
|
2520
|
+
readonly [index: number]: number;
|
|
2521
|
+
}
|
|
2287
2522
|
|
|
2288
2523
|
/** Compose TRS (translation * rotation * scale) into a single Mat4. */
|
|
2289
2524
|
export declare function mat4Compose(tx: number, ty: number, tz: number, qx: number, qy: number, qz: number, qw: number, sx: number, sy: number, sz: number): Mat4;
|
|
@@ -2290,6 +2525,9 @@ export declare function mat4Compose(tx: number, ty: number, tz: number, qx: numb
|
|
|
2290
2525
|
/** Create a new identity Mat4. */
|
|
2291
2526
|
export declare function mat4Identity(): Mat4;
|
|
2292
2527
|
|
|
2528
|
+
/** Compute inverse of a Mat4. Returns null if singular. */
|
|
2529
|
+
export declare function mat4Invert(input: Mat4): Mat4 | null;
|
|
2530
|
+
|
|
2293
2531
|
/** Create a scaling matrix. */
|
|
2294
2532
|
export declare function mat4Scale(x: number, y: number, z: number): Mat4;
|
|
2295
2533
|
|
|
@@ -2304,6 +2542,37 @@ export declare interface Material {
|
|
|
2304
2542
|
/** Optional human-readable name. Popula
|
|
2305
2543
|
* (e.g. the glTF material name) so callers can look a material up by name. */
|
|
2306
2544
|
name?: string;
|
|
2307
2545
|
|
|
2546
|
+
/** Plain-data material plugin. All behaviour is via optional function members. */
|
|
2547
|
+
export declare interface MaterialPlugin {
|
|
2548
|
+
/** Stable identifier. Factored into the pipeline cache key. */
|
|
2549
|
+
readonly name: string;
|
|
2550
|
+
/** Lower runs first. Default 500. */
|
|
2551
|
+
priority?: number;
|
|
2552
|
+
/** Default true when attached. A disabled plugin contributes no shader code
|
|
2553
|
+
* but still changes the pipeline cache key (so toggling forces a rebuild). */
|
|
2554
|
+
isEnabled?: boolean;
|
|
2555
|
+
/** Static defines folded into the pipeline cache key (and available to the
|
|
2556
|
+
* plugin when it builds its custom code). */
|
|
2557
|
+
defines?: Record<string, boolean | number>;
|
|
2558
|
+
/** Return WGSL snippets keyed by injection point, or null. */
|
|
2559
|
+
getCustomCode?(shaderType: "vertex" | "fragment"): Partial<Record<MaterialPluginPoint, string>> | null;
|
|
2560
|
+
/** Declare custom UBO fields appended to the host material's uniform buffer. */
|
|
2561
|
+
getUniforms?(): {
|
|
2562
|
+
ubo?: PluginUboField[];
|
|
2563
|
+
};
|
|
2564
|
+
/** Declare custom texture/sampler bindings. */
|
|
2565
|
+
getSamplers?(): PluginSamplerDecl[];
|
|
2566
|
+
/** Write this plugin's UBO slice. `offsets` maps field name → byte offset. */
|
|
2567
|
+
writeUbo?(data: Float32Array, offsets: ReadonlyMap<string, number>): void;
|
|
2568
|
+
/** Emit texture bindings in the same order as {@link getSamplers}. */
|
|
2569
|
+
bindTextures?(out: PluginTextureBinding[]): void;
|
|
2570
|
+
/** Enumerate textures for acquire/release bookkeeping. */
|
|
2571
|
+
getActiveTextures?(out: Texture2D[]): void;
|
|
2572
|
+
}
|
|
2573
|
+
|
|
2574
|
+
/** BJS-compatible injection-point names accepted by {@link MaterialPlugin.getCustomCode}. */
|
|
2575
|
+
export declare type MaterialPluginPoint = "CUSTOM_FRAGMENT_DEFINITIONS" | "CUSTOM_FRAGMENT_MAIN_BEGIN" | "CUSTOM_FRAGMENT_UPDATE_ALPHA" | "CUSTOM_FRAGMENT_UPDATE_DIFFUSE" | "CUSTOM_FRAGMENT_BEFORE_LIGHTS" | "CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION" | "CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR" | "CUSTOM_VERTEX_MAIN_BEGIN" | "CUSTOM_VERTEX_UPDATE_WORLDPOS" | "CUSTOM_VERTEX_MAIN_END";
|
|
2576
|
+
|
|
2308
2577
|
/** Exact material render-feature override used by MaterialView.
|
|
2309
2578
|
* Feature bits are interpreted by each concrete material family. */
|
|
2310
2579
|
export declare interface MaterialRenderFeatures {
|
|
@@ -2361,6 +2630,12 @@ export declare interface Mesh extends SceneNode {
|
|
|
2361
2630
|
/** User-controlled render order. Lower = drawn first within phase.
|
|
2362
2631
|
* Only affects ordering within the opaque or transparent phase. */
|
|
2363
2632
|
renderOrder?: number;
|
|
2633
|
+
/** On a transmission-enabled render task, draw this transparent mesh LAST — after the transmissive
|
|
2634
|
+
* surface and after the scene-colour grab — so it sits on top of the water/glass AND is excluded from
|
|
2635
|
+
* what that surface refracts (e.g. lily pads resting on water should not appear in the refraction).
|
|
2636
|
+
* Enable transmission on the task with `enableRenderTaskTransmission`; only transparent surfaces
|
|
2637
|
+
* (`needAlphaBlending`) are deferred. No effect on tasks without transmission. */
|
|
2638
|
+
renderOnTop?: boolean;
|
|
2364
2639
|
/** Thin instance data (CPU-side). GPU buffer managed by render system. */
|
|
2365
2640
|
thinInstances?: ThinInstanceData | null;
|
|
2366
2641
|
|
|
@@ -2672,7 +2947,12 @@ export declare class ObservableQuat implements Quat {
|
|
|
2672
2947
|
private _z;
|
|
2673
2948
|
private _w;
|
|
2674
2949
|
private readonly _onDirty;
|
|
2950
|
+
/** Bumped on every value change. Lets derived caches (e.g. the Euler proxy) detect
|
|
2951
|
+
* external quaternion writes and re-sync only when needed. */
|
|
2952
|
+
private _version;
|
|
2675
2953
|
constructor(x: number, y: number, z: number, w: number, onDirty: () => void);
|
|
2954
|
+
/** Monotonic change counter — incremented whenever any component changes. */
|
|
2955
|
+
get version(): number;
|
|
2676
2956
|
get x(): number;
|
|
2677
2957
|
set x(v: number);
|
|
2678
2958
|
get y(): number;
|
|
@@ -2728,6 +3008,27 @@ export declare interface OffMeshConnection {
|
|
|
2728
3008
|
/** Register a callback to run before each rendered frame. */
|
|
2729
3009
|
export declare function onBeforeRender(scene: SceneContext, cb: (deltaMs: number) => void): void;
|
|
2730
3010
|
|
|
3011
|
+
/**
|
|
3012
|
+
* Register a callback fired each frame the CSM cascades are recomputed, right after the receiver
|
|
3013
|
+
* UBO is updated and uploaded — and before the shadow map and main pass are rendered.
|
|
3014
|
+
*
|
|
3015
|
+
* Custom `ShaderMaterial` receivers that mirror the cascade transforms into their own uniforms
|
|
3016
|
+
* (rather than binding the generator's receiver UBO directly, as the built-in standard/PBR/node
|
|
3017
|
+
* receivers do) MUST sync from inside this callback. Syncing from an `onBeforeRender` callback
|
|
3018
|
+
* reads the *previous* frame's transforms — a one-frame lag that makes those shadows visibly swim
|
|
3019
|
+
* while the camera moves (the cascade window can slide many texels per frame during a zoom).
|
|
3020
|
+
*
|
|
3021
|
+
* Multiple receivers may register on the same generator; every registered callback is invoked each
|
|
3022
|
+
* frame. The callback receives the 80-float receiver UBO (layout: four `mat4x4` cascade transforms,
|
|
3023
|
+
* `viewFrustumZ`, `frustumLengths`, `shadowsInfo`, `csmParams` — see the cascaded-shadow
|
|
3024
|
+
* architecture doc). The array is reused each frame; copy what you need.
|
|
3025
|
+
*
|
|
3026
|
+
* @param sg - A cascaded-shadow generator from {@link createCsmDirectionalShadowGenerator}.
|
|
3027
|
+
* @param cb - Receiver-sync callback.
|
|
3028
|
+
* @returns A disposer that unregisters this callback.
|
|
3029
|
+
*/
|
|
3030
|
+
export declare function onCsmReceiverUpdate(sg: ShadowGenerator, cb: (data: Float32Array) => void): () => void;
|
|
3031
|
+
|
|
2731
3032
|
/** Register a callback to run when `disposeScene` is called. Used to tie
|
|
2732
3033
|
* user-owned GPU resources (e.g. a `SpriteRenderer`) to the scene's lifetime. */
|
|
2733
3034
|
export declare function onSceneDispose(scene: SceneContext, cb: () => void): void;
|
|
@@ -2776,6 +3077,10 @@ export declare function pauseAnimation(group: AnimationGroup): void;
|
|
|
2776
3077
|
* Optional sub-feature objects (clearcoat, sheen, anisotropy, subsurface) are
|
|
2777
3078
|
* only bundled when referenced. */
|
|
2778
3079
|
export declare interface PbrMaterialProps extends Material {
|
|
3080
|
+
/** Optional opt-in material plugins (custom WGSL + uniforms + samplers layered
|
|
3081
|
+
* on top of the built-in PBR pipeline). Attach via `material.plugins = [plugin]`,
|
|
3082
|
+
* then call `enableMaterialPlugins(scene)` before `registerScene`. */
|
|
3083
|
+
plugins?: MaterialPlugin[];
|
|
2779
3084
|
baseColorTexture?: Texture2D;
|
|
2780
3085
|
/** Linear RGB/A factor multiplied with the base-color texture (glTF baseColorFactor). Default [1,1,1,1]. */
|
|
2781
3086
|
baseColorFactor?: [number, number, number, number];
|
|
@@ -3084,6 +3389,32 @@ export declare interface PlaySpriteAnimationOptions {
|
|
|
3084
3389
|
/** Replay an animation; omit options to keep callbacks/removal, pass options to overwrite them, or `{}` to clear them. */
|
|
3085
3390
|
export declare function playSpriteFrameAnimation(animation: SpriteFrameAnimation, from?: number, to?: number, loop?: boolean, delayMs?: number, options?: PlaySpriteAnimationOptions): void;
|
|
3086
3391
|
|
|
3392
|
+
/** A texture + sampler pair contributed by a plugin. `texture`/`sampler` are the
|
|
3393
|
+
* WGSL variable names used by the plugin's custom code; the engine wires up the
|
|
3394
|
+
* GPU bindings in declaration order from {@link MaterialPlugin.bindTextures}. */
|
|
3395
|
+
export declare interface PluginSamplerDecl {
|
|
3396
|
+
readonly texture: string;
|
|
3397
|
+
readonly sampler: string;
|
|
3398
|
+
/** Defaults to "texture_2d<f32>". */
|
|
3399
|
+
readonly textureType?: "texture_2d<f32>";
|
|
3400
|
+
/** Defaults to "sampler". */
|
|
3401
|
+
readonly samplerType?: "sampler" | "sampler_non_filtering";
|
|
3402
|
+
}
|
|
3403
|
+
|
|
3404
|
+
/** A texture binding emitted by {@link MaterialPlugin.bindTextures}. Public types
|
|
3405
|
+
* only — no raw GPU handles (GUIDANCE §4d). The engine reads `texture.view` /
|
|
3406
|
+
* `texture.sampler` internally. */
|
|
3407
|
+
export declare interface PluginTextureBinding {
|
|
3408
|
+
readonly texture: Texture2D;
|
|
3409
|
+
}
|
|
3410
|
+
|
|
3411
|
+
/** A custom uniform contributed by a plugin. The WGSL `type` is used verbatim
|
|
3412
|
+
* (e.g. "vec4<f32>", "f32", "mat4x4<f32>") inside the host material's UBO. */
|
|
3413
|
+
export declare interface PluginUboField {
|
|
3414
|
+
readonly name: string;
|
|
3415
|
+
readonly type: string;
|
|
3416
|
+
}
|
|
3417
|
+
|
|
3087
3418
|
export declare interface PointLight extends LightBase {
|
|
3088
3419
|
readonly lightType: "point";
|
|
3089
3420
|
position: ObservableVec3;
|
|
@@ -3474,6 +3805,15 @@ declare interface ScatteringProps {
|
|
|
3474
3805
|
metersPerUnit?: number;
|
|
3475
3806
|
}
|
|
3476
3807
|
|
|
3808
|
+
/** Handle to a render task's scene-color grab, returned by `enableRenderTaskTransmission`. */
|
|
3809
|
+
export declare interface SceneColorGrab {
|
|
3810
|
+
/** The live opaque-scene-color texture sampled by transmissive surfaces, or null before the
|
|
3811
|
+
* frame graph has built the task at least once. Its identity changes when the task rebuilds
|
|
3812
|
+
* (e.g. on resize), so consumers that bind it to a custom material should re-bind when it
|
|
3813
|
+
* changes. */
|
|
3814
|
+
readonly texture: Texture2D | null;
|
|
3815
|
+
}
|
|
3816
|
+
|
|
3477
3817
|
/** Top-level scene context — pure state, no attached methods. */
|
|
3478
3818
|
export declare interface SceneContext extends RenderingContext_2 {
|
|
3479
3819
|
readonly engine: EngineContext;
|
|
@@ -3577,6 +3917,42 @@ export declare function setBillboardSpriteFrame(handle: BillboardSpriteHandle, f
|
|
|
3577
3917
|
*/
|
|
3578
3918
|
export declare function setBillboardSpriteFrameIndex(system: BillboardSpriteSystem, index: number, frame: number): void;
|
|
3579
3919
|
|
|
3920
|
+
/**
|
|
3921
|
+
* Configure orbit/zoom limits on an ArcRotateCamera. This is fully opt-in and
|
|
3922
|
+
* self-contained: cameras that never call it pay zero cost and bundle no clamping
|
|
3923
|
+
* code (the camera's scalar setters call an undefined hook).
|
|
3924
|
+
*
|
|
3925
|
+
* What it does:
|
|
3926
|
+
* 1. Stores the provided bounds on the camera and clamps the current pose into
|
|
3927
|
+
* range right away (inertia zeroed), so enabling limits never causes a jump.
|
|
3928
|
+
* 2. Installs a self-clamp hook on the camera (`_clampToLimits`). The
|
|
3929
|
+
* alpha/beta/radius setters invoke it on every mutation, so any caller —
|
|
3930
|
+
* pinch direct-write, inertial overshoot, auto-rotate — is snapped back to
|
|
3931
|
+
* the wall in the same statement that pushed past it. The camera is therefore
|
|
3932
|
+
* never observably out of bounds at any point a per-frame callback reads it
|
|
3933
|
+
* (e.g. a camera-pinned skybox), eliminating both the overshoot-then-snap
|
|
3934
|
+
* jiggle and the one-frame clip "blink" of a deferred per-frame clamp.
|
|
3935
|
+
*
|
|
3936
|
+
* Only the fields present on `limits` are written, so calls compose; pass a field
|
|
3937
|
+
* as `undefined` to remove that bound. Returns a disposer that removes the
|
|
3938
|
+
* self-clamp hook.
|
|
3939
|
+
*
|
|
3940
|
+
* The optional `scene` parameter is accepted for backward compatibility and is
|
|
3941
|
+
* unused — enforcement no longer needs a per-frame scene hook.
|
|
3942
|
+
*/
|
|
3943
|
+
export declare function setCameraLimits(camera: ArcRotateCamera, limits: ArcRotateCameraLimits, scene?: SceneContext): () => void;
|
|
3944
|
+
|
|
3945
|
+
/**
|
|
3946
|
+
* Set the scene clip plane and register its scene-uniform contributor.
|
|
3947
|
+
*
|
|
3948
|
+
* The clip plane is opt-in: importing `setClipPlane` is what pulls the clip-plane
|
|
3949
|
+
* UBO writer into the bundle, keeping those bytes out of scenes that never clip.
|
|
3950
|
+
*
|
|
3951
|
+
* @param scene - The scene to configure.
|
|
3952
|
+
* @param plane - The clip plane as `[a, b, c, d]` coefficients of `a·x + b·y + c·z + d`.
|
|
3953
|
+
*/
|
|
3954
|
+
export declare function setClipPlane(scene: SceneContext, plane: ClipPlane): void;
|
|
3955
|
+
|
|
3580
3956
|
/**
|
|
3581
3957
|
* Bind a texture to one of the effect's texture slots, marking the bind group dirty so it is rebuilt.
|
|
3582
3958
|
* @param wrapper - The effect wrapper to update.
|
|
@@ -3600,6 +3976,17 @@ export declare function setEffectUniforms(wrapper: EffectWrapper, data: ArrayBuf
|
|
|
3600
3976
|
* optional `_resize` hook. */
|
|
3601
3977
|
export declare function setEngineSize(engine: EngineContext, widthPx: number, heightPx: number): void;
|
|
3602
3978
|
|
|
3979
|
+
/**
|
|
3980
|
+
* Enable scene fog and register its scene-uniform contributor.
|
|
3981
|
+
*
|
|
3982
|
+
* Fog is an opt-in feature: importing `setFog` is what pulls the fog UBO writer
|
|
3983
|
+
* into the bundle, keeping those bytes out of scenes that never use fog.
|
|
3984
|
+
*
|
|
3985
|
+
* @param scene - The scene to configure.
|
|
3986
|
+
* @param config - The fog configuration (mode, density, start, end, color).
|
|
3987
|
+
*/
|
|
3988
|
+
export declare function setFog(scene: SceneContext, config: FogConfig): void;
|
|
3989
|
+
|
|
3603
3990
|
/** Raise (or lower) the maximum number of scene lights in the shared lights UBO.
|
|
3604
3991
|
* Must be called BEFORE scene pipelines are compiled — existing pipelines
|
|
3605
3992
|
* and UBOs bake the cap into their WGSL/layout. */
|
|
@@ -3674,8 +4061,11 @@ export declare function setPhysicsVelocityLimits(world: PhysicsWorld, maxLinear:
|
|
|
3674
4061
|
/** Set a declared `f32` uniform. Convenience wrapper over `setShaderUniform()`. */
|
|
3675
4062
|
export declare function setShaderFloat(material: ShaderMaterial, name: string, value: number): void;
|
|
3676
4063
|
|
|
3677
|
-
/** Set a declared `mat4x4<f32>` uniform. Convenience wrapper over `setShaderUniform()`.
|
|
3678
|
-
|
|
4064
|
+
/** Set a declared `mat4x4<f32>` uniform. Convenience wrapper over `setShaderUniform()`.
|
|
4065
|
+
* Accepts a raw `Float32Array` or the engine's branded `Mat4` (e.g. the result of
|
|
4066
|
+
* `getViewProjectionMatrix()` / `mat4Invert()`), so camera/math matrices can be fed
|
|
4067
|
+
* straight into a matrix uniform without laundering through a typed array. */
|
|
4068
|
+
export declare function setShaderMatrix(material: ShaderMaterial, name: string, value: Float32Array | Mat4): void;
|
|
3679
4069
|
|
|
3680
4070
|
/** Bind (or clear) the texture for a declared sampler, enforcing that depth and
|
|
3681
4071
|
* non-depth samplers receive a matching `Texture2D`.
|
|
@@ -3746,7 +4136,7 @@ export declare function setThinInstanceColors(mesh: Mesh, colors: Float32Array):
|
|
|
3746
4136
|
export declare function setThinInstanceMatrix(mesh: Mesh, index: number, matrix: Mat4): void;
|
|
3747
4137
|
|
|
3748
4138
|
/** Set all instances from a pre-built matrix array. */
|
|
3749
|
-
export declare function setThinInstances(mesh: Mesh, matrices: Float32Array, count: number): void;
|
|
4139
|
+
export declare function setThinInstances(mesh: Mesh, matrices: Float32Array | Float64Array, count: number): void;
|
|
3750
4140
|
|
|
3751
4141
|
/**
|
|
3752
4142
|
* Write bytes into the uniform effect's single uniform buffer.
|
|
@@ -3783,6 +4173,8 @@ export declare interface ShaderMaterial extends Material {
|
|
|
3783
4173
|
readonly defines: readonly ShaderDefine[];
|
|
3784
4174
|
readonly needAlphaBlending: boolean;
|
|
3785
4175
|
readonly blendMode: "alpha" | "additive";
|
|
4176
|
+
/** True for transmissive/refractive surfaces (see `ShaderMaterialOptions.transmissive`). */
|
|
4177
|
+
readonly transmissive: boolean;
|
|
3786
4178
|
readonly needAlphaTesting: boolean;
|
|
3787
4179
|
readonly backFaceCulling: boolean;
|
|
3788
4180
|
readonly depthWrite: boolean;
|
|
@@ -3803,6 +4195,13 @@ export declare interface ShaderMaterialOptions {
|
|
|
3803
4195
|
* standard src-over; "additive" adds the fragment's premultiplied-by-alpha
|
|
3804
4196
|
* color to the framebuffer, which is the right choice for glows/light FX. */
|
|
3805
4197
|
readonly blendMode?: "alpha" | "additive";
|
|
4198
|
+
/** Mark this surface as transmissive/refractive: the renderer grabs the opaque scene color
|
|
4199
|
+
* behind it just before it draws, so the fragment can sample what is *through* it (water,
|
|
4200
|
+
* glass). Requires `needAlphaBlending` (the surface composites over the grabbed scene
|
|
4201
|
+
* color). Enable the scene-color grab on the surface's render task with
|
|
4202
|
+
* `enableRenderTaskTransmission`, then bind the resulting texture via `setShaderTexture`.
|
|
4203
|
+
* Default false. */
|
|
4204
|
+
readonly transmissive?: boolean;
|
|
3806
4205
|
readonly needAlphaTesting?: boolean;
|
|
3807
4206
|
readonly backFaceCulling?: boolean;
|
|
3808
4207
|
readonly depthWrite?: boolean;
|
|
@@ -3813,6 +4212,12 @@ export declare interface ShaderMaterialOptions {
|
|
|
3813
4212
|
export declare interface ShaderSamplerDecl {
|
|
3814
4213
|
readonly name: string;
|
|
3815
4214
|
readonly sampleType?: "float" | "unfilterable-float" | "depth";
|
|
4215
|
+
/** Texture view dimension. Default "2d". Use "2d-array" for layered maps such as
|
|
4216
|
+
* cascaded-shadow (CSM) depth arrays. */
|
|
4217
|
+
readonly viewDimension?: "2d" | "2d-array";
|
|
4218
|
+
/** Bind a hardware comparison sampler (`sampler_comparison`) for depth compare / PCF
|
|
4219
|
+
* filtering. Implies a depth texture. Default false. */
|
|
4220
|
+
readonly comparison?: boolean;
|
|
3816
4221
|
}
|
|
3817
4222
|
|
|
3818
4223
|
/** A sampler entry: either a bare sampler name or an explicit declaration. */
|
|
@@ -4246,6 +4651,10 @@ declare interface StageState {
|
|
|
4246
4651
|
|
|
4247
4652
|
/** StandardMaterial properties — plain data. */
|
|
4248
4653
|
export declare interface StandardMaterialProps extends Material {
|
|
4654
|
+
/** Optional opt-in material plugins (custom WGSL + uniforms + samplers layered
|
|
4655
|
+
* on top of the built-in Standard pipeline). Attach via `material.plugins = [plugin]`,
|
|
4656
|
+
* then call `enableMaterialPlugins(scene)` before `registerScene`. */
|
|
4657
|
+
plugins?: MaterialPlugin[];
|
|
4249
4658
|
diffuseColor: [number, number, number];
|
|
4250
4659
|
alpha: number;
|
|
4251
4660
|
specularColor: [number, number, number];
|
|
@@ -4445,8 +4854,11 @@ export declare interface ThicknessProps {
|
|
|
4445
4854
|
|
|
4446
4855
|
/** CPU-side data backing a thin-instanced mesh: world matrices, optional colors, and GPU sync state. */
|
|
4447
4856
|
export declare interface ThinInstanceData {
|
|
4448
|
-
/** CPU-side instance world matrices (16 floats per instance).
|
|
4449
|
-
|
|
4857
|
+
/** CPU-side instance world matrices (16 floats per instance). Storage may
|
|
4858
|
+
* be Float32Array (default) or Float64Array (after an HPM engine is
|
|
4859
|
+
* constructed; the caller built the slab via `allocateMat4()`). The GPU
|
|
4860
|
+
* upload path in thin-instance-gpu.ts handles both (REQ-API-3, D5). */
|
|
4861
|
+
matrices: Float32Array | Float64Array;
|
|
4450
4862
|
/** Active instance count. */
|
|
4451
4863
|
count: number;
|
|
4452
4864
|
/** Optional per-instance RGBA colors (4 floats per instance). */
|
|
4453
4865
|
colors?: Float32Array | null;
|
|
@@ -4459,6 +4871,51 @@ export declare interface TintProps {
|
|
|
4459
4871
|
atDistance?: number;
|
|
4460
4872
|
}
|
|
4461
4873
|
|
|
4874
|
+
/**
|
|
4875
|
+
* Torus-knot mesh generator — matches Babylon.js `CreateTorusKnotVertexData` exactly.
|
|
4876
|
+
*
|
|
4877
|
+
* The knot centre-line is the (p, q) torus knot curve:
|
|
4878
|
+
*
|
|
4879
|
+
* getPos(angle):
|
|
4880
|
+
* cu = cos(angle), su = sin(angle), s = (q/p) * angle
|
|
4881
|
+
* x = radius * (2 + cos(s)) * 0.5 * cu
|
|
4882
|
+
* y = radius * (2 + cos(s)) * 0.5 * su
|
|
4883
|
+
* z = radius * sin(s) * 0.5
|
|
4884
|
+
*
|
|
4885
|
+
* A Frenet-like frame (tangent / normal / bitangent built from cross products of
|
|
4886
|
+
* the curve point and a nearby sample) sweeps a circle of `tube` radius around
|
|
4887
|
+
* the curve. Normals are computed with the area-weighted-per-face-then-normalize
|
|
4888
|
+
* scheme of Babylon's `VertexData.ComputeNormals` (see {@link computeNormals}),
|
|
4889
|
+
* NOT analytically, so the knot shades pixel-identically to Babylon.js.
|
|
4890
|
+
*
|
|
4891
|
+
* Loop bounds mirror Babylon precisely: the vertex loop runs `i <= radialSegments`
|
|
4892
|
+
* (with `i % radialSegments` wrap) while the index loop runs `i < radialSegments`
|
|
4893
|
+
* and `j < tubularSegments` (with `(j + 1) % tubularSegments` wrap).
|
|
4894
|
+
*/
|
|
4895
|
+
/** CPU geometry for a torus knot: tightly-packed typed arrays ready for GPU upload. */
|
|
4896
|
+
export declare interface TorusKnotData {
|
|
4897
|
+
positions: Float32Array;
|
|
4898
|
+
normals: Float32Array;
|
|
4899
|
+
uvs: Float32Array;
|
|
4900
|
+
indices: Uint32Array;
|
|
4901
|
+
}
|
|
4902
|
+
|
|
4903
|
+
/** Options for {@link createTorusKnotData}. Subset of Babylon's CreateTorusKnot. */
|
|
4904
|
+
export declare interface TorusKnotOptions {
|
|
4905
|
+
/** Global radius of the torus knot. Default 2. */
|
|
4906
|
+
radius?: number;
|
|
4907
|
+
/** Thickness of the tube. Default 0.5. */
|
|
4908
|
+
tube?: number;
|
|
4909
|
+
/** Number of sides on each tube segment. Default 32. */
|
|
4910
|
+
radialSegments?: number;
|
|
4911
|
+
/** Number of tubes the knot is decomposed into. Default 32. */
|
|
4912
|
+
tubularSegments?: number;
|
|
4913
|
+
/** Number of windings around the z axis. Default 2. */
|
|
4914
|
+
p?: number;
|
|
4915
|
+
/** Number of windings around the x axis. Default 3. */
|
|
4916
|
+
q?: number;
|
|
4917
|
+
}
|
|
4918
|
+
|
|
4462
4919
|
/** Options for `createTorusData`. Subset of Babylon's CreateTorus. */
|
|
4463
4920
|
export declare interface TorusOptions {
|
|
4464
4921
|
diameter?: number;
|
|
@@ -4480,6 +4937,19 @@ export declare interface TranslucencyProps {
|
|
|
4480
4937
|
diffusionDistance?: [number, number, number];
|
|
4481
4938
|
}
|
|
4482
4939
|
|
|
4940
|
+
export declare interface TransmissionOptions {
|
|
4941
|
+
/** When true (the default), retarget the task's color buffer to a linear `rgba16float`
|
|
4942
|
+
* offscreen and tone-map it in a trailing image-processing pass — the model PBR
|
|
4943
|
+
* transmission uses so refractive materials read scene color in *linear* space.
|
|
4944
|
+
*
|
|
4945
|
+
* Set false to perform ONLY the mid-pass scene-color grab: the task's render target
|
|
4946
|
+
* format / sample count / clear are left untouched and no tone-map pass is added. Use
|
|
4947
|
+
* this for consumers that own their tone mapping / post (e.g. a custom depth-of-field
|
|
4948
|
+
* stack) and just need the opaque scene color exposed to a custom transmissive
|
|
4949
|
+
* `ShaderMaterial`. */
|
|
4950
|
+
linear?: boolean;
|
|
4951
|
+
}
|
|
4952
|
+
|
|
4483
4953
|
/** Options for `createTubeData`: a circular cross-section swept along a path. */
|
|
4484
4954
|
export declare interface TubeOptions {
|
|
4485
4955
|
path: Vec3[];
|
|
@@ -4585,6 +5055,23 @@ export declare function updateSprite2DIndex(layer: Sprite2DLayer, index: number,
|
|
|
4585
5055
|
*/
|
|
4586
5056
|
export declare function updateSpriteAnimationManager(manager: SpriteAnimationManager, deltaMs: number): void;
|
|
4587
5057
|
|
|
5058
|
+
/**
|
|
5059
|
+
* Update a rectangular region of an existing `Texture2D` from a tightly-packed RGBA8 byte buffer.
|
|
5060
|
+
*
|
|
5061
|
+
* The texture must have been created with `COPY_DST` usage (as `createTexture2DFromPixels` does).
|
|
5062
|
+
* This is the runtime counterpart to `createTexture2DFromPixels` — for data textures the app mutates
|
|
5063
|
+
* each frame / on demand (e.g. a terrain carve heightmap stamped by a dig tool).
|
|
5064
|
+
*
|
|
5065
|
+
* @param engine - Engine context.
|
|
5066
|
+
* @param tex - Target texture (from `createTexture2DFromPixels`).
|
|
5067
|
+
* @param data - `width * height * 4` bytes for the sub-region, row-major, straight alpha.
|
|
5068
|
+
* @param x - Destination origin X in texels (default 0).
|
|
5069
|
+
* @param y - Destination origin Y in texels (default 0).
|
|
5070
|
+
* @param width - Region width in texels (default `tex.width`).
|
|
5071
|
+
* @param height - Region height in texels (default `tex.height`).
|
|
5072
|
+
*/
|
|
5073
|
+
export declare function updateTexture2DFromPixels(engine: EngineContext, tex: Texture2D, data: Uint8Array, x?: number, y?: number, width?: number, height?: number): void;
|
|
5074
|
+
|
|
4588
5075
|
/** Per-mesh original + variant material entry. */
|
|
4589
5076
|
declare interface VariantMeshEntry {
|
|
4590
5077
|
mesh: Mesh;
|