@babylonjs/lite 0.1.1 → 1.0.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-CjDoht2w.js +11 -0
- package/_mat4-storage-f64-CjDoht2w.js.map +1 -0
- package/{alpha-test-fragment-CUiHCw7W.js → alpha-test-fragment-B7DjSnF7.js} +2 -2
- package/{alpha-test-fragment-CUiHCw7W.js.map → alpha-test-fragment-B7DjSnF7.js.map} +1 -1
- package/assets/splat-sort-worker-DT3eybMZ.js.map +1 -0
- package/{background-dds-skybox-yHTqabU3.js → background-dds-skybox-BEX309u3.js} +14 -14
- package/background-dds-skybox-BEX309u3.js.map +1 -0
- package/{background-ground-DIw6D3qf.js → background-ground-BU0HOcM4.js} +20 -20
- package/background-ground-BU0HOcM4.js.map +1 -0
- package/{background-hdr-skybox-c4uuTmkP.js → background-hdr-skybox--RRRic_K.js} +10 -10
- package/background-hdr-skybox--RRRic_K.js.map +1 -0
- package/{background-solid-skybox-DPGBpPbm.js → background-solid-skybox-BrH2fXSu.js} +12 -13
- package/background-solid-skybox-BrH2fXSu.js.map +1 -0
- package/{billboard-renderable-D8mlVGCd.js → billboard-renderable-BHWryAeC.js} +46 -10
- package/billboard-renderable-BHWryAeC.js.map +1 -0
- package/{clamp-block-BdII67hT.js → clamp-block-DqbwnQGW.js} +2 -2
- package/{clamp-block-BdII67hT.js.map → clamp-block-DqbwnQGW.js.map} +1 -1
- package/{clearcoat-fragment-LCiG98Rf.js → clearcoat-fragment-D6FSCie1.js} +2 -2
- package/{clearcoat-fragment-LCiG98Rf.js.map → clearcoat-fragment-D6FSCie1.js.map} +1 -1
- package/{create-skeleton-C9JdIJnb.js → create-skeleton-D_uplboC.js} +9 -9
- package/create-skeleton-D_uplboC.js.map +1 -0
- package/{cubemap-skybox-material-DvXMVc4k.js → cubemap-skybox-material-DQcMMdf-.js} +6 -7
- package/cubemap-skybox-material-DQcMMdf-.js.map +1 -0
- package/{curve-block-BlJpXVYv.js → curve-block-21rT0JjG.js} +2 -2
- package/{curve-block-BlJpXVYv.js.map → curve-block-21rT0JjG.js.map} +1 -1
- package/{emissive-fragment-BnNvbBCw.js → emissive-fragment-C5FtBs3y.js} +3 -3
- package/emissive-fragment-C5FtBs3y.js.map +1 -0
- package/{esm-shadow-view-DN9HIaM4.js → esm-shadow-view-Cl3rPGof.js} +2 -2
- package/{esm-shadow-view-DN9HIaM4.js.map → esm-shadow-view-Cl3rPGof.js.map} +1 -1
- package/{esm-shadow-view-Dk9NFtLq.js → esm-shadow-view-Gtd1LWRP.js} +2 -2
- package/{esm-shadow-view-Dk9NFtLq.js.map → esm-shadow-view-Gtd1LWRP.js.map} +1 -1
- package/{esm-shadow-view-DGKdF1NI.js → esm-shadow-view-c5YV4Eg9.js} +2 -2
- package/{esm-shadow-view-DGKdF1NI.js.map → esm-shadow-view-c5YV4Eg9.js.map} +1 -1
- package/{gaussian-splatting-pipeline-sh-DgJl7l56.js → gaussian-splatting-pipeline-sh-7J31V23x.js} +19 -19
- package/gaussian-splatting-pipeline-sh-7J31V23x.js.map +1 -0
- package/geometry-texture-output-dXk4E9uu.js +41 -0
- package/geometry-texture-output-dXk4E9uu.js.map +1 -0
- package/geometry-view-BsFJpBJa.js +404 -0
- package/geometry-view-BsFJpBJa.js.map +1 -0
- package/{gltf-animation-D7uyTyO3.js → gltf-animation-K_zZxj_d.js} +7 -7
- package/gltf-animation-K_zZxj_d.js.map +1 -0
- 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-CDbPclzZ.js} +53 -18
- package/gltf-ext-basisu-CDbPclzZ.js.map +1 -0
- package/{gltf-ext-node-visibility-MafA9ot2.js → gltf-ext-node-visibility-DXCJEYr6.js} +2 -2
- package/{gltf-ext-node-visibility-MafA9ot2.js.map → gltf-ext-node-visibility-DXCJEYr6.js.map} +1 -1
- package/{gltf-ext-quantization-CpZyLDIz.js → gltf-ext-quantization-CvHI_0Vg.js} +4 -3
- package/gltf-ext-quantization-CvHI_0Vg.js.map +1 -0
- package/{gltf-ext-uv-transform-CE_-T1Tr.js → gltf-ext-uv-transform-DgYazJBs.js} +2 -2
- package/{gltf-ext-uv-transform-CE_-T1Tr.js.map → gltf-ext-uv-transform-DgYazJBs.js.map} +1 -1
- package/{gltf-feature-animation-pointer-BjpwOOqo.js → gltf-feature-animation-pointer-D1RJRFBw.js} +9 -9
- package/gltf-feature-animation-pointer-D1RJRFBw.js.map +1 -0
- package/{gltf-feature-animations-CCizegp8.js → gltf-feature-animations-Cmc1uoIu.js} +2 -2
- package/{gltf-feature-animations-CCizegp8.js.map → gltf-feature-animations-Cmc1uoIu.js.map} +1 -1
- package/{gltf-feature-draco-yGSMGTE3.js → gltf-feature-draco-CKKzT5E3.js} +6 -5
- package/gltf-feature-draco-CKKzT5E3.js.map +1 -0
- package/{gltf-feature-gpu-instancing-2e_CFQnl.js → gltf-feature-gpu-instancing-n87SO6Vh.js} +7 -6
- package/gltf-feature-gpu-instancing-n87SO6Vh.js.map +1 -0
- package/{gltf-feature-lights-punctual-DDDg4j0U.js → gltf-feature-lights-punctual-Ckm3ciL8.js} +5 -5
- package/{gltf-feature-lights-punctual-DDDg4j0U.js.map → gltf-feature-lights-punctual-Ckm3ciL8.js.map} +1 -1
- package/{gltf-feature-meshopt-Des96YFI.js → gltf-feature-meshopt-DLC4SF1E.js} +7 -6
- package/gltf-feature-meshopt-DLC4SF1E.js.map +1 -0
- package/{gltf-feature-morph-CKCw6tkX.js → gltf-feature-morph-Cjtu7hYa.js} +4 -4
- package/gltf-feature-morph-Cjtu7hYa.js.map +1 -0
- package/gltf-feature-registry-C63Hjp9w.js +59 -0
- package/gltf-feature-registry-C63Hjp9w.js.map +1 -0
- package/{gltf-feature-skeleton-D8hWLqi2.js → gltf-feature-skeleton-DKbOGidp.js} +3 -3
- package/{gltf-feature-skeleton-D8hWLqi2.js.map → gltf-feature-skeleton-DKbOGidp.js.map} +1 -1
- package/{gltf-feature-variants-Ds6v9byg.js → gltf-feature-variants-Cmzu0O0e.js} +2 -2
- package/{gltf-feature-variants-Ds6v9byg.js.map → gltf-feature-variants-Cmzu0O0e.js.map} +1 -1
- package/{gltf-glb-parser-D6UZWFuC.js → gltf-glb-parser-Cj5MHS-v.js} +5 -4
- package/gltf-glb-parser-Cj5MHS-v.js.map +1 -0
- package/{gltf-interleave-DGnUlz28.js → gltf-interleave-gHf9_t0i.js} +14 -14
- package/gltf-interleave-gHf9_t0i.js.map +1 -0
- 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-edNcjwPf.js} +5 -5
- package/gltf-pbr-builder-ext-edNcjwPf.js.map +1 -0
- package/{gltf-variants-DFbr8EES.js → gltf-variants-CPxNdtP4.js} +4 -4
- package/{gltf-variants-DFbr8EES.js.map → gltf-variants-CPxNdtP4.js.map} +1 -1
- package/{gs-picking-pipeline-DzfMASL9.js → gs-picking-pipeline-DYaW_Lg3.js} +14 -14
- package/gs-picking-pipeline-DYaW_Lg3.js.map +1 -0
- package/havok-floating-origin-Dr-18Nds.js +198 -0
- package/havok-floating-origin-Dr-18Nds.js.map +1 -0
- package/index-CLElg2Bo.js +39209 -0
- package/index-CLElg2Bo.js.map +1 -0
- package/index-CYZDclhF.js +918 -0
- package/index-CYZDclhF.js.map +1 -0
- package/index-SMJ67XwT.js +3330 -0
- package/index-SMJ67XwT.js.map +1 -0
- package/index.d.ts +2508 -119
- package/index.js +444 -302
- package/{input-block-DgAJBzN_.js → input-block-DqEedWF2.js} +2 -2
- package/{input-block-DgAJBzN_.js.map → input-block-DqEedWF2.js.map} +1 -1
- package/{iridescence-fragment-Gymp7or5.js → iridescence-fragment-BHU59-gQ.js} +2 -2
- package/{iridescence-fragment-Gymp7or5.js.map → iridescence-fragment-BHU59-gQ.js.map} +1 -1
- package/{light-block-B11ew7FA.js → light-block-Bv37V8vl.js} +2 -2
- package/{light-block-B11ew7FA.js.map → light-block-Bv37V8vl.js.map} +1 -1
- package/{loop-block-Bb23EOMb.js → loop-block-qTg8vb99.js} +2 -2
- package/{loop-block-Bb23EOMb.js.map → loop-block-qTg8vb99.js.map} +1 -1
- package/{morph-fragment-DOVo70gP.js → morph-fragment-BRCUr2wQ.js} +2 -2
- package/{morph-fragment-DOVo70gP.js.map → morph-fragment-BRCUr2wQ.js.map} +1 -1
- package/{multilight-wgsl-BGyiIOp3.js → multilight-wgsl-DMeppAdZ.js} +4 -4
- package/{multilight-wgsl-BGyiIOp3.js.map → multilight-wgsl-DMeppAdZ.js.map} +1 -1
- package/{node-env-BPZXZzBf.js → node-env-Bc559GmY.js} +6 -5
- package/node-env-Bc559GmY.js.map +1 -0
- package/node-geometry-view-COmWsRXK.js +291 -0
- package/node-geometry-view-COmWsRXK.js.map +1 -0
- package/{node-registry-extra-compat-Dhrw8fDQ.js → node-registry-extra-compat-dWrv7gpS.js} +2 -2
- package/{node-registry-extra-compat-Dhrw8fDQ.js.map → node-registry-extra-compat-dWrv7gpS.js.map} +1 -1
- package/{node-registry-extra-math-CsAHvIZo.js → node-registry-extra-math-Bn854sX9.js} +2 -2
- package/{node-registry-extra-math-CsAHvIZo.js.map → node-registry-extra-math-Bn854sX9.js.map} +1 -1
- package/{node-renderable-DlLIdBmd.js → node-renderable-B5G8WcdH.js} +41 -22
- package/node-renderable-B5G8WcdH.js.map +1 -0
- package/{node-shadow-DKrcqmNg.js → node-shadow-CVIUlNf0.js} +7 -7
- package/node-shadow-CVIUlNf0.js.map +1 -0
- package/{normal-map-fragment-DpsIXrJf.js → normal-map-fragment-CQSxhjCy.js} +3 -3
- package/{normal-map-fragment-DpsIXrJf.js.map → normal-map-fragment-CQSxhjCy.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 -10
- package/{parse-camera-DM3oJJeT.js → parse-camera-pBRT_6i5.js} +2 -2
- package/{parse-camera-DM3oJJeT.js.map → parse-camera-pBRT_6i5.js.map} +1 -1
- package/pbr-fog-wgsl-BqdCid6r.js +8 -0
- package/pbr-fog-wgsl-BqdCid6r.js.map +1 -0
- package/pbr-geometry-view-NiZY_juX.js +491 -0
- package/pbr-geometry-view-NiZY_juX.js.map +1 -0
- package/{pbr-metallic-roughness-block-h_KAOZrW.js → pbr-metallic-roughness-block-JBSi-tQN.js} +2 -2
- package/{pbr-metallic-roughness-block-h_KAOZrW.js.map → pbr-metallic-roughness-block-JBSi-tQN.js.map} +1 -1
- package/{pbr-metallic-roughness-block-full-6vMm1Jk6.js → pbr-metallic-roughness-block-full-Ta9lR2cz.js} +2 -2
- package/{pbr-metallic-roughness-block-full-6vMm1Jk6.js.map → pbr-metallic-roughness-block-full-Ta9lR2cz.js.map} +1 -1
- package/{pbr-mr-helper-core-CIwm-T1G.js → pbr-mr-helper-core-BVWNR08D.js} +2 -2
- package/{pbr-mr-helper-core-CIwm-T1G.js.map → pbr-mr-helper-core-BVWNR08D.js.map} +1 -1
- package/{pbr-refraction-DGmMSa2v.js → pbr-refraction-C9FvFmAp.js} +2 -2
- package/{pbr-refraction-DGmMSa2v.js.map → pbr-refraction-C9FvFmAp.js.map} +1 -1
- package/{pbr-renderable-BJxUtPBb.js → pbr-renderable-DzUF2QIk.js} +118 -58
- package/pbr-renderable-DzUF2QIk.js.map +1 -0
- package/{pbr-shadow-fragment-LO9SlbJj.js → pbr-shadow-fragment-CnqnbGYS.js} +6 -1
- package/pbr-shadow-fragment-CnqnbGYS.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-3tU1kqea.js} +2 -2
- package/{pbr-tracking-B3alzn91.js.map → pbr-tracking-3tU1kqea.js.map} +1 -1
- package/pbr-transmission-ext-BcLjRxfB.js +190 -0
- package/pbr-transmission-ext-BcLjRxfB.js.map +1 -0
- package/recast-navigation.wasm-DG_0AFuk.js +8706 -0
- package/recast-navigation.wasm-DG_0AFuk.js.map +1 -0
- package/recast-navigation.wasm-compat-C-Bf2ylB.js +8692 -0
- package/recast-navigation.wasm-compat-C-Bf2ylB.js.map +1 -0
- package/{reflectance-fragment-BCrgPmrt.js → reflectance-fragment-Dbpgw3Jt.js} +2 -2
- package/{reflectance-fragment-BCrgPmrt.js.map → reflectance-fragment-Dbpgw3Jt.js.map} +1 -1
- package/{rgbd-decode-DCvzUYeI.js → rgbd-decode-DoyUquy3.js} +7 -6
- package/rgbd-decode-DoyUquy3.js.map +1 -0
- package/{scene-material-swap-C2ykv55W.js → scene-material-swap-nNUH4nGn.js} +11 -4
- package/scene-material-swap-nNUH4nGn.js.map +1 -0
- package/screenshot-readback-D0Sj9qq3.js +92 -0
- package/screenshot-readback-D0Sj9qq3.js.map +1 -0
- package/{mesh-features-BLENkYVt.js → shader-composer-BUD_pSX4.js} +7 -55
- package/shader-composer-BUD_pSX4.js.map +1 -0
- package/{shader-renderable-D-6796KR.js → shader-renderable-D7-RyVxa.js} +62 -27
- package/shader-renderable-D7-RyVxa.js.map +1 -0
- package/shader-thin-instance-DuBotxDO.js +150 -0
- package/shader-thin-instance-DuBotxDO.js.map +1 -0
- package/shadow-fragment-core-DHN2G6FI.js.map +1 -1
- package/{sheen-fragment-Dze2f7XJ.js → sheen-fragment-1MkEMcbc.js} +2 -2
- package/{sheen-fragment-Dze2f7XJ.js.map → sheen-fragment-1MkEMcbc.js.map} +1 -1
- package/{singlelight-directional-wgsl-CmUDZxwz.js → singlelight-directional-wgsl-BsV8G456.js} +2 -2
- package/{singlelight-directional-wgsl-CmUDZxwz.js.map → singlelight-directional-wgsl-BsV8G456.js.map} +1 -1
- package/{singlelight-hemispheric-wgsl-t-83IP_s.js → singlelight-hemispheric-wgsl-Bo0jKlW5.js} +2 -2
- package/{singlelight-hemispheric-wgsl-t-83IP_s.js.map → singlelight-hemispheric-wgsl-Bo0jKlW5.js.map} +1 -1
- package/{singlelight-point-wgsl-CLzULIYV.js → singlelight-point-wgsl-DV39UP5Y.js} +2 -2
- package/{singlelight-point-wgsl-CLzULIYV.js.map → singlelight-point-wgsl-DV39UP5Y.js.map} +1 -1
- package/{singlelight-spot-wgsl-DEEUrfVM.js → singlelight-spot-wgsl-yg3od6vL.js} +2 -2
- package/{singlelight-spot-wgsl-DEEUrfVM.js.map → singlelight-spot-wgsl-yg3od6vL.js.map} +1 -1
- package/{skeleton-fragment-B_XlFbtx.js → skeleton-fragment-DdxYG6kv.js} +2 -2
- package/{skeleton-fragment-B_XlFbtx.js.map → skeleton-fragment-DdxYG6kv.js.map} +1 -1
- package/{skybox-renderable-DDwzu-PT.js → skybox-renderable-CJD4XmX5.js} +8 -9
- package/skybox-renderable-CJD4XmX5.js.map +1 -0
- package/{splat-ply-compressed-BahdBG1r.js → splat-ply-compressed-DHjyiVmI.js} +9 -8
- package/splat-ply-compressed-DHjyiVmI.js.map +1 -0
- package/{standard-renderable-GjxL9xSf.js → standard-pipeline-XTbHL7MY.js} +12 -257
- package/standard-pipeline-XTbHL7MY.js.map +1 -0
- package/standard-renderable-CREWLNHI.js +191 -0
- package/standard-renderable-CREWLNHI.js.map +1 -0
- package/{std-ambient-fragment-BoUsD06w.js → std-ambient-fragment-Bjx3VFrr.js} +2 -2
- package/{std-ambient-fragment-BoUsD06w.js.map → std-ambient-fragment-Bjx3VFrr.js.map} +1 -1
- package/{std-cube-reflection-fragment-ulqc3bsP.js → std-cube-reflection-fragment-y9WWdXUt.js} +2 -2
- package/{std-cube-reflection-fragment-ulqc3bsP.js.map → std-cube-reflection-fragment-y9WWdXUt.js.map} +1 -1
- package/{std-emissive-fragment-DNGj1HdQ.js → std-emissive-fragment-C8Lnmojh.js} +2 -2
- package/{std-emissive-fragment-DNGj1HdQ.js.map → std-emissive-fragment-C8Lnmojh.js.map} +1 -1
- package/{std-lightmap-fragment-Bqj89aIe.js → std-lightmap-fragment-DFxGcoA5.js} +2 -2
- package/{std-lightmap-fragment-Bqj89aIe.js.map → std-lightmap-fragment-DFxGcoA5.js.map} +1 -1
- package/{std-opacity-fragment-KuPh5N2Z.js → std-opacity-fragment-EXzFWiSp.js} +2 -2
- package/{std-opacity-fragment-KuPh5N2Z.js.map → std-opacity-fragment-EXzFWiSp.js.map} +1 -1
- package/{std-reflection-fragment-BA5Ghn_M.js → std-reflection-fragment-BoJORqpG.js} +2 -2
- package/{std-reflection-fragment-BA5Ghn_M.js.map → std-reflection-fragment-BoJORqpG.js.map} +1 -1
- package/std-shadow-fragment-Bq-Wc8UJ.js +13 -0
- package/std-shadow-fragment-Bq-Wc8UJ.js.map +1 -0
- package/{std-specular-fragment-CE-6scqd.js → std-specular-fragment-CM5R5j2g.js} +2 -2
- package/{std-specular-fragment-CE-6scqd.js.map → std-specular-fragment-CM5R5j2g.js.map} +1 -1
- package/{std-tracking-CNKZ-hJN.js → std-tracking-Cif_wXeT.js} +2 -2
- package/{std-tracking-CNKZ-hJN.js.map → std-tracking-Cif_wXeT.js.map} +1 -1
- package/{subsurface-fragment-liM3y2-P.js → subsurface-fragment-BEaAXYXz.js} +2 -2
- package/{subsurface-fragment-liM3y2-P.js.map → subsurface-fragment-BEaAXYXz.js.map} +1 -1
- package/swapchain-overlay-UCLilhbq.js +37 -0
- package/swapchain-overlay-UCLilhbq.js.map +1 -0
- package/thin-instance-cull-binding-DWKUt5ZN.js +310 -0
- package/thin-instance-cull-binding-DWKUt5ZN.js.map +1 -0
- package/{thin-instance-gpu-C9Gv_Z1w.js → thin-instance-gpu-BDdRcNAh.js} +30 -5
- package/thin-instance-gpu-BDdRcNAh.js.map +1 -0
- package/{tracking-primitives-wgdBY85t.js → tracking-primitives-CglRNTlX.js} +2 -2
- package/{tracking-primitives-wgdBY85t.js.map → tracking-primitives-CglRNTlX.js.map} +1 -1
- package/{unlit-fragment-BIlhJpz6.js → unlit-fragment-kxfZWlnp.js} +2 -2
- package/{unlit-fragment-BIlhJpz6.js.map → unlit-fragment-kxfZWlnp.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/assets/splat-sort-worker-Crg3CaCc.js.map +0 -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/background-solid-skybox-DPGBpPbm.js.map +0 -1
- package/billboard-renderable-D8mlVGCd.js.map +0 -1
- package/create-skeleton-C9JdIJnb.js.map +0 -1
- package/cubemap-skybox-material-DvXMVc4k.js.map +0 -1
- package/emissive-fragment-BnNvbBCw.js.map +0 -1
- package/gaussian-splatting-pipeline-sh-DgJl7l56.js.map +0 -1
- package/gltf-animation-D7uyTyO3.js.map +0 -1
- package/gltf-ext-basisu-CPg5kPrx.js.map +0 -1
- package/gltf-ext-quantization-CpZyLDIz.js.map +0 -1
- package/gltf-feature-animation-pointer-BjpwOOqo.js.map +0 -1
- package/gltf-feature-draco-yGSMGTE3.js.map +0 -1
- package/gltf-feature-gpu-instancing-2e_CFQnl.js.map +0 -1
- package/gltf-feature-meshopt-Des96YFI.js.map +0 -1
- package/gltf-feature-morph-CKCw6tkX.js.map +0 -1
- package/gltf-glb-parser-D6UZWFuC.js.map +0 -1
- package/gltf-interleave-DGnUlz28.js.map +0 -1
- package/gltf-pbr-builder-ext-BFOxOCnQ.js.map +0 -1
- package/gs-picking-pipeline-DzfMASL9.js.map +0 -1
- package/index-C8HOR2sB.js +0 -19222
- package/index-C8HOR2sB.js.map +0 -1
- package/mesh-features-BLENkYVt.js.map +0 -1
- package/node-env-BPZXZzBf.js.map +0 -1
- package/node-registry-DwgC4yth.js +0 -190
- package/node-registry-DwgC4yth.js.map +0 -1
- package/node-renderable-DlLIdBmd.js.map +0 -1
- package/node-shadow-DKrcqmNg.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/rgbd-decode-DCvzUYeI.js.map +0 -1
- package/scene-material-swap-C2ykv55W.js.map +0 -1
- package/shader-renderable-D-6796KR.js.map +0 -1
- package/skybox-renderable-DDwzu-PT.js.map +0 -1
- package/splat-ply-compressed-BahdBG1r.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/swapchain-overlay-DcCSFDp7.js +0 -35
- package/swapchain-overlay-DcCSFDp7.js.map +0 -1
- package/thin-instance-gpu-C9Gv_Z1w.js.map +0 -1
|
@@ -1,581 +0,0 @@
|
|
|
1
|
-
import { aO as getOrCreateSampler, bq as createImageProcessingTask, br as biasedMipLevelCount, b2 as getBilinearSampler, bs as _vis, bt as recordMipmaps, bo as PBR2_HAS_REFRACTION, bu as PBR2_HAS_REFRACTION_MAP, aH as PBR_HAS_THICKNESS_MAP, bv as PBR2_LINEAR_IMAGE_PROCESSING, bw as PBR2_HAS_DISPERSION, aJ as PBR2_HAS_THICKNESS_GLTF_CHANNEL, bx as PBR2_HAS_VOLUME } from "./index-C8HOR2sB.js";
|
|
2
|
-
const _trilinearAnisotropicDesc = {
|
|
3
|
-
magFilter: "linear",
|
|
4
|
-
minFilter: "linear",
|
|
5
|
-
mipmapFilter: "linear",
|
|
6
|
-
addressModeU: "repeat",
|
|
7
|
-
addressModeV: "repeat",
|
|
8
|
-
addressModeW: "repeat",
|
|
9
|
-
maxAnisotropy: 4
|
|
10
|
-
};
|
|
11
|
-
function getTrilinearAnisotropicSampler(engine) {
|
|
12
|
-
return getOrCreateSampler(engine, _trilinearAnisotropicDesc);
|
|
13
|
-
}
|
|
14
|
-
const BLIT_SHADER = `@group(0)@binding(0)var t:texture_2d<f32>;@group(0)@binding(1)var s:sampler;struct V{@builtin(position)p:vec4f,@location(0)u:vec2f};@vertex fn vs(@builtin(vertex_index)i:u32)->V{var p=array<vec2f,3>(vec2f(-1,-1),vec2f(3,-1),vec2f(-1,3));var u=array<vec2f,3>(vec2f(0,1),vec2f(2,1),vec2f(0,-1));return V(vec4f(p[i],0,1),u[i]);}@fragment fn fs(v:V)->@location(0)vec4f{return textureSample(t,s,v.u);}`;
|
|
15
|
-
const BLIT_MSAA_SHADER = `@group(0)@binding(0)var t:texture_multisampled_2d<f32>;struct V{@builtin(position)p:vec4f,@location(0)u:vec2f};@vertex fn vs(@builtin(vertex_index)i:u32)->V{var p=array<vec2f,3>(vec2f(-1,-1),vec2f(3,-1),vec2f(-1,3));var u=array<vec2f,3>(vec2f(0,1),vec2f(2,1),vec2f(0,-1));return V(vec4f(p[i],0,1),u[i]);}fn l(p:vec2i)->vec4f{let n=textureNumSamples(t);var c=vec4f(0);for(var i=0u;i<n;i++){c+=textureLoad(t,p,i);}return c/f32(n);}@fragment fn fs(v:V)->@location(0)vec4f{let d=vec2i(textureDimensions(t));let q=clamp(v.u*vec2f(d)-.5,vec2f(0),vec2f(d-vec2i(1)));let p=vec2i(floor(q));let f=fract(q);let p1=min(p+vec2i(1),d-vec2i(1));return mix(mix(l(p),l(vec2i(p1.x,p.y)),f.x),mix(l(vec2i(p.x,p1.y)),l(p1),f.x),f.y);}`;
|
|
16
|
-
const REFRACTION_LOD_BIAS = 4;
|
|
17
|
-
let blitPipelines = null;
|
|
18
|
-
let blitShader = null;
|
|
19
|
-
let blitMsaaShader = null;
|
|
20
|
-
let blitBgl = null;
|
|
21
|
-
let blitMsaaBgl = null;
|
|
22
|
-
let blitDevice = null;
|
|
23
|
-
function enableSceneTransmission(scene, engine) {
|
|
24
|
-
markPbrMaterialsLinear(scene);
|
|
25
|
-
let lastRenderTask = null;
|
|
26
|
-
for (const task of scene._frameGraph._tasks) {
|
|
27
|
-
if ("_renderables" in task) {
|
|
28
|
-
const renderTask = task;
|
|
29
|
-
enableRenderTaskTransmission(renderTask, engine);
|
|
30
|
-
lastRenderTask = renderTask;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
if (lastRenderTask && !scene._frameGraph._tasks.some((task) => task.name === "transmission-image-processing")) {
|
|
34
|
-
scene._frameGraph._tasks.push(createImageProcessingTask({ name: "transmission-image-processing", source: lastRenderTask._config.rt }, engine, scene));
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
function enableRenderTaskTransmission(task, engine) {
|
|
38
|
-
var _a, _b;
|
|
39
|
-
if (task._executeWithTransmission) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
retargetRenderTaskToLinearOffscreen(task, engine);
|
|
43
|
-
let state = null;
|
|
44
|
-
const record = task.record.bind(task);
|
|
45
|
-
const execute = (_a = task.execute) == null ? void 0 : _a.bind(task);
|
|
46
|
-
const dispose = (_b = task.dispose) == null ? void 0 : _b.bind(task);
|
|
47
|
-
task.record = () => {
|
|
48
|
-
disposeRenderTaskTransmission(state);
|
|
49
|
-
state = createRenderTaskTransmission(task, engine);
|
|
50
|
-
task._targetSignature._transmissionTexture = state.texture;
|
|
51
|
-
record();
|
|
52
|
-
configureTransmissionSource(state, task, engine);
|
|
53
|
-
};
|
|
54
|
-
if (execute) {
|
|
55
|
-
task.execute = () => executeRenderTaskLinear(task.scene, execute);
|
|
56
|
-
}
|
|
57
|
-
task.dispose = () => {
|
|
58
|
-
disposeRenderTaskTransmission(state);
|
|
59
|
-
state = null;
|
|
60
|
-
dispose == null ? void 0 : dispose();
|
|
61
|
-
};
|
|
62
|
-
task._executeWithTransmission = (sampleCount) => executePassWithTransmission(task, engine, state, sampleCount);
|
|
63
|
-
}
|
|
64
|
-
function retargetRenderTaskToLinearOffscreen(task, engine) {
|
|
65
|
-
const desc = task._config.rt._descriptor;
|
|
66
|
-
if (desc.resolveToSwapchain) {
|
|
67
|
-
desc.resolveToSwapchain = false;
|
|
68
|
-
desc.colorFormat = "rgba16float";
|
|
69
|
-
desc.flipY = false;
|
|
70
|
-
task._opaqueBundles.length = 0;
|
|
71
|
-
task._lastVersion = -1;
|
|
72
|
-
} else if (!desc.colorFormat) {
|
|
73
|
-
desc.colorFormat = "rgba16float";
|
|
74
|
-
}
|
|
75
|
-
desc.sampleCount = engine.msaaSamples;
|
|
76
|
-
const sig = task._targetSignature;
|
|
77
|
-
sig._colorFormat = desc.colorFormat;
|
|
78
|
-
sig._depthStencilFormat = desc.depthStencilFormat;
|
|
79
|
-
sig._depthCompare = desc._depthCompare;
|
|
80
|
-
sig._sampleCount = desc.sampleCount;
|
|
81
|
-
sig._flipY = desc.flipY ?? true;
|
|
82
|
-
}
|
|
83
|
-
function executeRenderTaskLinear(scene, execute) {
|
|
84
|
-
const imageProcessing = scene.imageProcessing;
|
|
85
|
-
const toneMappingEnabled = imageProcessing.toneMappingEnabled;
|
|
86
|
-
const clearColor = scene.clearColor;
|
|
87
|
-
const linearClearColor = inverseImageProcessedColor(clearColor, imageProcessing.exposure, imageProcessing.contrast, toneMappingEnabled === true);
|
|
88
|
-
imageProcessing.toneMappingEnabled = -1;
|
|
89
|
-
scene.clearColor = linearClearColor;
|
|
90
|
-
try {
|
|
91
|
-
return execute();
|
|
92
|
-
} finally {
|
|
93
|
-
scene.clearColor = clearColor;
|
|
94
|
-
imageProcessing.toneMappingEnabled = toneMappingEnabled;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
function inverseImageProcessedColor(color, exposure, contrast, toneMapping) {
|
|
98
|
-
return {
|
|
99
|
-
r: inverseImageProcessedChannel(color.r, exposure, contrast, toneMapping),
|
|
100
|
-
g: inverseImageProcessedChannel(color.g, exposure, contrast, toneMapping),
|
|
101
|
-
b: inverseImageProcessedChannel(color.b, exposure, contrast, toneMapping),
|
|
102
|
-
a: color.a
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
function inverseImageProcessedChannel(value, exposure, contrast, toneMapping) {
|
|
106
|
-
let c = clamp01(value);
|
|
107
|
-
if (contrast < 1) {
|
|
108
|
-
c = contrast > 0 ? clamp01((c - 0.5 * (1 - contrast)) / contrast) : 0.5;
|
|
109
|
-
} else if (contrast > 1) {
|
|
110
|
-
const mixAmount = contrast - 1;
|
|
111
|
-
let lo = 0;
|
|
112
|
-
let hi = 1;
|
|
113
|
-
for (let i = 0; i < 16; i++) {
|
|
114
|
-
const mid = (lo + hi) * 0.5;
|
|
115
|
-
const high = mid * mid * (3 - 2 * mid);
|
|
116
|
-
const out = mid + (high - mid) * mixAmount;
|
|
117
|
-
if (out < c) {
|
|
118
|
-
lo = mid;
|
|
119
|
-
} else {
|
|
120
|
-
hi = mid;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
c = (lo + hi) * 0.5;
|
|
124
|
-
}
|
|
125
|
-
c = c ** 2.2;
|
|
126
|
-
if (toneMapping) {
|
|
127
|
-
c = -Math.log2(Math.max(1 - c, 1e-6)) / 1.5905790328979492;
|
|
128
|
-
}
|
|
129
|
-
return exposure > 0 ? c / exposure : c;
|
|
130
|
-
}
|
|
131
|
-
function clamp01(v) {
|
|
132
|
-
return Math.min(Math.max(v, 0), 1);
|
|
133
|
-
}
|
|
134
|
-
function markPbrMaterialsLinear(scene) {
|
|
135
|
-
for (const mesh of scene.meshes) {
|
|
136
|
-
const mat = mesh.material;
|
|
137
|
-
if (mat) {
|
|
138
|
-
mat._linearImageProcessing = true;
|
|
139
|
-
mat._renderFeatures = void 0;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
function createRenderTaskTransmission(task, engine) {
|
|
144
|
-
const rt = task._config.rt;
|
|
145
|
-
const width = 1024;
|
|
146
|
-
const height = 1024;
|
|
147
|
-
const format = "rgba16float";
|
|
148
|
-
const generateMipmaps = shouldGenerateMipmaps(task._config.transmission);
|
|
149
|
-
const texture = engine._device.createTexture({
|
|
150
|
-
label: task.name,
|
|
151
|
-
size: { width, height },
|
|
152
|
-
format,
|
|
153
|
-
mipLevelCount: generateMipmaps ? biasedMipLevelCount(width, height, REFRACTION_LOD_BIAS) : 1,
|
|
154
|
-
usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST
|
|
155
|
-
});
|
|
156
|
-
const tex = {
|
|
157
|
-
texture,
|
|
158
|
-
view: texture.createView(),
|
|
159
|
-
sampler: getTrilinearAnisotropicSampler(engine),
|
|
160
|
-
width,
|
|
161
|
-
height,
|
|
162
|
-
invertY: false
|
|
163
|
-
};
|
|
164
|
-
return {
|
|
165
|
-
texture: tex,
|
|
166
|
-
_baseView: texture.createView({ baseMipLevel: 0, mipLevelCount: 1 }),
|
|
167
|
-
_sourceWidth: rt._width,
|
|
168
|
-
_sourceHeight: rt._height,
|
|
169
|
-
_sourceTexture: null,
|
|
170
|
-
_blit: null,
|
|
171
|
-
_copyCount: normalizeCopyCount(task._config.transmission),
|
|
172
|
-
_generateMipmaps: generateMipmaps,
|
|
173
|
-
_copies: 0
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
function configureTransmissionSource(state, task, engine) {
|
|
177
|
-
const rt = task._config.rt;
|
|
178
|
-
state._sourceWidth = rt._width;
|
|
179
|
-
state._sourceHeight = rt._height;
|
|
180
|
-
state._sourceTexture = rt._colorTexture;
|
|
181
|
-
const sampleCount = task._targetSignature._sampleCount;
|
|
182
|
-
if (!state._sourceTexture) {
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
state._blit = shouldBlitTransmission(state, sampleCount) ? createTransmissionBlit(state, engine, state._sourceTexture, sampleCount > 1) : null;
|
|
186
|
-
}
|
|
187
|
-
function disposeRenderTaskTransmission(state) {
|
|
188
|
-
state == null ? void 0 : state.texture.texture.destroy();
|
|
189
|
-
}
|
|
190
|
-
function executePassWithTransmission(task, engine, state, sampleCount) {
|
|
191
|
-
state._copies = 0;
|
|
192
|
-
const transparent = task._transparentBindings;
|
|
193
|
-
let pass = beginTaskPass(task, null, sampleCount, false);
|
|
194
|
-
let draws = drawBaseTask(task, pass);
|
|
195
|
-
let lastPipeline = null;
|
|
196
|
-
for (let i = 0; i < transparent.length; i++) {
|
|
197
|
-
const binding = transparent[i];
|
|
198
|
-
const transmissive = binding.renderable._transmissive === true;
|
|
199
|
-
if (transmissive && canUpdateTransmission(state)) {
|
|
200
|
-
pass.end();
|
|
201
|
-
updateTransmissionTexture(state, engine);
|
|
202
|
-
pass = beginTaskPass(task, null, sampleCount, true);
|
|
203
|
-
setPassState(task, pass);
|
|
204
|
-
lastPipeline = null;
|
|
205
|
-
}
|
|
206
|
-
const mesh = binding.renderable.mesh;
|
|
207
|
-
if (mesh && mesh.visible === false) {
|
|
208
|
-
continue;
|
|
209
|
-
}
|
|
210
|
-
if (binding.pipeline !== lastPipeline) {
|
|
211
|
-
pass.setPipeline(binding.pipeline);
|
|
212
|
-
lastPipeline = binding.pipeline;
|
|
213
|
-
}
|
|
214
|
-
draws += binding.draw(pass, engine);
|
|
215
|
-
}
|
|
216
|
-
pass.end();
|
|
217
|
-
return draws;
|
|
218
|
-
}
|
|
219
|
-
function updateTransmissionTexture(state, engine) {
|
|
220
|
-
if (!state._sourceTexture) {
|
|
221
|
-
throw new Error("No transmission source");
|
|
222
|
-
}
|
|
223
|
-
if (state._blit) {
|
|
224
|
-
blitToTransmission(state, engine);
|
|
225
|
-
} else {
|
|
226
|
-
engine._currentEncoder.copyTextureToTexture(
|
|
227
|
-
{ texture: state._sourceTexture },
|
|
228
|
-
{ texture: state.texture.texture },
|
|
229
|
-
{ width: state.texture.width, height: state.texture.height }
|
|
230
|
-
);
|
|
231
|
-
}
|
|
232
|
-
if (state._generateMipmaps) {
|
|
233
|
-
recordMipmaps(engine, state.texture.texture, engine._currentEncoder);
|
|
234
|
-
}
|
|
235
|
-
state._copies++;
|
|
236
|
-
}
|
|
237
|
-
function getBlitPipeline(engine, format, multisampled) {
|
|
238
|
-
const device = engine._device;
|
|
239
|
-
if (device !== blitDevice) {
|
|
240
|
-
blitPipelines == null ? void 0 : blitPipelines.clear();
|
|
241
|
-
blitPipelines = null;
|
|
242
|
-
blitShader = null;
|
|
243
|
-
blitMsaaShader = null;
|
|
244
|
-
blitBgl = null;
|
|
245
|
-
blitMsaaBgl = null;
|
|
246
|
-
blitDevice = device;
|
|
247
|
-
}
|
|
248
|
-
if (multisampled) {
|
|
249
|
-
blitMsaaShader ?? (blitMsaaShader = device.createShaderModule({ code: BLIT_MSAA_SHADER }));
|
|
250
|
-
blitMsaaBgl ?? (blitMsaaBgl = device.createBindGroupLayout({
|
|
251
|
-
entries: [{ binding: 0, visibility: GPUShaderStage.FRAGMENT, texture: { sampleType: "unfilterable-float", multisampled: true } }]
|
|
252
|
-
}));
|
|
253
|
-
} else {
|
|
254
|
-
blitShader ?? (blitShader = device.createShaderModule({ code: BLIT_SHADER }));
|
|
255
|
-
blitBgl ?? (blitBgl = device.createBindGroupLayout({
|
|
256
|
-
entries: [
|
|
257
|
-
{ binding: 0, visibility: GPUShaderStage.FRAGMENT, texture: { sampleType: "float" } },
|
|
258
|
-
{ binding: 1, visibility: GPUShaderStage.FRAGMENT, sampler: {} }
|
|
259
|
-
]
|
|
260
|
-
}));
|
|
261
|
-
}
|
|
262
|
-
blitPipelines ?? (blitPipelines = /* @__PURE__ */ new Map());
|
|
263
|
-
const key = `${format}:${multisampled ? "msaa" : ""}`;
|
|
264
|
-
let pipeline = blitPipelines.get(key);
|
|
265
|
-
if (!pipeline) {
|
|
266
|
-
const bgl = multisampled ? blitMsaaBgl : blitBgl;
|
|
267
|
-
pipeline = device.createRenderPipeline({
|
|
268
|
-
label: "transmission-copy",
|
|
269
|
-
layout: device.createPipelineLayout({ bindGroupLayouts: [bgl] }),
|
|
270
|
-
vertex: { module: multisampled ? blitMsaaShader : blitShader, entryPoint: "vs" },
|
|
271
|
-
fragment: { module: multisampled ? blitMsaaShader : blitShader, entryPoint: "fs", targets: [{ format }] },
|
|
272
|
-
primitive: { topology: "triangle-list" }
|
|
273
|
-
});
|
|
274
|
-
blitPipelines.set(key, pipeline);
|
|
275
|
-
}
|
|
276
|
-
return pipeline;
|
|
277
|
-
}
|
|
278
|
-
function shouldBlitTransmission(state, sampleCount) {
|
|
279
|
-
return sampleCount > 1 || state._sourceWidth !== state.texture.width || state._sourceHeight !== state.texture.height;
|
|
280
|
-
}
|
|
281
|
-
function createTransmissionBlit(state, engine, source, multisampled) {
|
|
282
|
-
const device = engine._device;
|
|
283
|
-
const pipeline = getBlitPipeline(engine, state.texture.texture.format, multisampled);
|
|
284
|
-
const bindGroup = device.createBindGroup({
|
|
285
|
-
layout: multisampled ? blitMsaaBgl : blitBgl,
|
|
286
|
-
entries: multisampled ? [{ binding: 0, resource: source.createView() }] : [
|
|
287
|
-
{ binding: 0, resource: source.createView() },
|
|
288
|
-
{ binding: 1, resource: getBilinearSampler(engine) }
|
|
289
|
-
]
|
|
290
|
-
});
|
|
291
|
-
return { _pipeline: pipeline, _bindGroup: bindGroup };
|
|
292
|
-
}
|
|
293
|
-
function blitToTransmission(state, engine) {
|
|
294
|
-
const blit = state._blit;
|
|
295
|
-
const pass = engine._currentEncoder.beginRenderPass({
|
|
296
|
-
colorAttachments: [{ view: state._baseView, loadOp: "clear", storeOp: "store", clearValue: { r: 0, g: 0, b: 0, a: 0 } }]
|
|
297
|
-
});
|
|
298
|
-
pass.setPipeline(blit._pipeline);
|
|
299
|
-
pass.setBindGroup(0, blit._bindGroup);
|
|
300
|
-
pass.draw(3);
|
|
301
|
-
pass.end();
|
|
302
|
-
}
|
|
303
|
-
function canUpdateTransmission(state) {
|
|
304
|
-
return state._copyCount === 0 || state._copies < state._copyCount;
|
|
305
|
-
}
|
|
306
|
-
function beginTaskPass(task, resolveTarget, sampleCount, load) {
|
|
307
|
-
const att = task._colorAttachment;
|
|
308
|
-
const depthLoadOp = load || !task._config.clr ? "load" : "clear";
|
|
309
|
-
if (load) {
|
|
310
|
-
att.loadOp = "load";
|
|
311
|
-
}
|
|
312
|
-
const depthAttachment = task._renderPassDescriptor.depthStencilAttachment;
|
|
313
|
-
if (depthAttachment) {
|
|
314
|
-
depthAttachment.depthLoadOp = depthLoadOp;
|
|
315
|
-
if (depthAttachment.stencilLoadOp) {
|
|
316
|
-
depthAttachment.stencilLoadOp = depthLoadOp;
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
if (sampleCount > 1) {
|
|
320
|
-
att.resolveTarget = void 0;
|
|
321
|
-
} else {
|
|
322
|
-
att.resolveTarget = void 0;
|
|
323
|
-
}
|
|
324
|
-
return task.engine._currentEncoder.beginRenderPass(task._renderPassDescriptor);
|
|
325
|
-
}
|
|
326
|
-
function setPassState(task, pass) {
|
|
327
|
-
const cfg = task._config;
|
|
328
|
-
const rt = cfg.rt;
|
|
329
|
-
const scene = task.scene;
|
|
330
|
-
const camera = cfg.cam ?? scene.camera;
|
|
331
|
-
const v = camera == null ? void 0 : camera.viewport;
|
|
332
|
-
if (v) {
|
|
333
|
-
const rw = rt._width;
|
|
334
|
-
const rh = rt._height;
|
|
335
|
-
const x = Math.floor(v.x * rw);
|
|
336
|
-
const y = Math.floor((1 - v.y - v.height) * rh);
|
|
337
|
-
const w = Math.ceil((v.x + v.width) * rw) - x;
|
|
338
|
-
const h = Math.ceil((1 - v.y) * rh) - y;
|
|
339
|
-
pass.setViewport(x, y, w, h, 0, 1);
|
|
340
|
-
pass.setScissorRect(x, y, w, h);
|
|
341
|
-
}
|
|
342
|
-
pass.setBindGroup(0, task._sceneBG);
|
|
343
|
-
}
|
|
344
|
-
function drawBaseTask(task, pass) {
|
|
345
|
-
const eng = task.engine;
|
|
346
|
-
const rt = task._config.rt;
|
|
347
|
-
const scene = task.scene;
|
|
348
|
-
const opaqueBindings = task._opaqueBindings;
|
|
349
|
-
const opaqueBundles = task._opaqueBundles;
|
|
350
|
-
setPassState(task, pass);
|
|
351
|
-
if (task._lastVersion !== scene._renderableVersion || task._lastVis !== _vis || opaqueBundles.length === 0) {
|
|
352
|
-
const desc = rt._descriptor;
|
|
353
|
-
const be = eng._device.createRenderBundleEncoder({
|
|
354
|
-
colorFormats: desc.colorFormat ? [desc.colorFormat] : [],
|
|
355
|
-
depthStencilFormat: desc.depthStencilFormat,
|
|
356
|
-
sampleCount: desc.sampleCount ?? 1
|
|
357
|
-
});
|
|
358
|
-
be.setBindGroup(0, task._sceneBG);
|
|
359
|
-
drawList(be, opaqueBindings, eng);
|
|
360
|
-
opaqueBundles[0] = be.finish();
|
|
361
|
-
task._lastVersion = scene._renderableVersion;
|
|
362
|
-
task._lastVis = _vis;
|
|
363
|
-
}
|
|
364
|
-
let draws = opaqueBindings.length;
|
|
365
|
-
pass.executeBundles(opaqueBundles);
|
|
366
|
-
pass.setBindGroup(0, task._sceneBG);
|
|
367
|
-
draws += drawList(pass, task._directBindings, eng);
|
|
368
|
-
return draws;
|
|
369
|
-
}
|
|
370
|
-
function drawList(enc, list, engine) {
|
|
371
|
-
let lp = null;
|
|
372
|
-
let draws = 0;
|
|
373
|
-
for (const b of list) {
|
|
374
|
-
const mesh = b.renderable.mesh;
|
|
375
|
-
if (mesh && mesh.visible === false) {
|
|
376
|
-
continue;
|
|
377
|
-
}
|
|
378
|
-
if (b.pipeline !== lp) {
|
|
379
|
-
enc.setPipeline(b.pipeline);
|
|
380
|
-
lp = b.pipeline;
|
|
381
|
-
}
|
|
382
|
-
draws += b.draw(enc, engine);
|
|
383
|
-
}
|
|
384
|
-
return draws;
|
|
385
|
-
}
|
|
386
|
-
function normalizeCopyCount(cfg) {
|
|
387
|
-
const count = (cfg == null ? void 0 : cfg.copyCount) ?? 1;
|
|
388
|
-
return count === Infinity ? 0 : Math.max(0, count | 0);
|
|
389
|
-
}
|
|
390
|
-
function shouldGenerateMipmaps(cfg) {
|
|
391
|
-
return (cfg == null ? void 0 : cfg.generateMipmaps) !== false;
|
|
392
|
-
}
|
|
393
|
-
const LINEAR_IMAGE_PROCESSING_SLOTS = { NI: `if(scene.vImageInfos.w>=0.0){`, BC: `}` };
|
|
394
|
-
function makeRefractionMod(hasVolume, hasMap, hasThicknessMap, useGltfThicknessChannel, hasDispersion, dispersionSampleWgsl) {
|
|
395
|
-
const thicknessScaleLine = hasVolume || hasThicknessMap ? `let ts=max(length(mesh.world[0].xyz),max(length(mesh.world[1].xyz),length(mesh.world[2].xyz)));` : ``;
|
|
396
|
-
const thicknessLine = hasThicknessMap ? `let ths=textureSample(thicknessTexture_,thicknessSampler_,input.uv).${useGltfThicknessChannel ? "g" : "r"};
|
|
397
|
-
let th=(material.thicknessParams.x+ths*material.thicknessParams.y)*ts;` : hasVolume ? `let th=material.refractionParams.z*ts;` : `let th=material.refractionParams.z;`;
|
|
398
|
-
const textureLine = hasMap ? `let ri=material.refractionParams.x*textureSample(refractionMapTexture,refractionMapSampler,input.uv).r;` : `let ri=material.refractionParams.x;`;
|
|
399
|
-
const absorptionLine = hasVolume ? `let ab=exp(material.volumeParams.rgb*th);` : ``;
|
|
400
|
-
const refractionLine = hasVolume ? `let fr=er*surfaceAlbedo*(ri*ab)*(vec3<f32>(1.0)-colorSpecularEnvReflectance.rgb);` : `let fr=er*surfaceAlbedo*ri*(vec3<f32>(1.0)-colorSpecularEnvReflectance.rgb);`;
|
|
401
|
-
const sampleLines = hasDispersion && dispersionSampleWgsl ? dispersionSampleWgsl : `let rd=refract(-V,N,material.refractionParams.y);
|
|
402
|
-
let cp=scene.viewProjection*vec4<f32>(input.worldPos+rd*th,1.0);
|
|
403
|
-
let ruv=(cp.xy/cp.w)*vec2<f32>(0.5,-0.5)+vec2<f32>(0.5,0.5);
|
|
404
|
-
let er=textureSampleLevel(refractionTexture,refractionSampler_,ruv,lv).rgb*material.environmentIntensity;`;
|
|
405
|
-
return `{
|
|
406
|
-
${thicknessScaleLine}
|
|
407
|
-
${textureLine}
|
|
408
|
-
${thicknessLine}
|
|
409
|
-
let ro=1.0-ri;
|
|
410
|
-
let ra=mix(alphaG,0.0,clamp(material.refractionParams.w*3.0-2.0,0.0,1.0));
|
|
411
|
-
let lv=clamp(log2(f32(textureDimensions(refractionTexture).x)*ra)-4.0,0.0,f32(textureNumLevels(refractionTexture)-1));
|
|
412
|
-
${sampleLines}
|
|
413
|
-
${absorptionLine}
|
|
414
|
-
${refractionLine}
|
|
415
|
-
color=finalIrradiance*ro*ro+finalRadianceScaled+finalSpecularScaled+directDiffuse*ro*ro+fr+emissive;
|
|
416
|
-
}`;
|
|
417
|
-
}
|
|
418
|
-
function createRefractionRttFragment(hasVolume, hasMap, hasThicknessMap, useGltfThicknessChannel, linearImageProcessing, hasDispersion, dispersionSampleWgsl) {
|
|
419
|
-
const uboFields = [{ _name: "refractionParams", _type: "vec4<f32>" }];
|
|
420
|
-
if (hasVolume) {
|
|
421
|
-
uboFields.push({ _name: "volumeParams", _type: "vec4<f32>" });
|
|
422
|
-
}
|
|
423
|
-
if (hasThicknessMap) {
|
|
424
|
-
uboFields.push({ _name: "thicknessParams", _type: "vec4<f32>" });
|
|
425
|
-
}
|
|
426
|
-
const bindings = [
|
|
427
|
-
{ _name: "refractionTexture", _type: { _kind: "texture", _textureType: "texture_2d<f32>" }, _visibility: 2 },
|
|
428
|
-
{ _name: "refractionSampler_", _type: { _kind: "sampler", _samplerType: "sampler" }, _visibility: 2 }
|
|
429
|
-
];
|
|
430
|
-
if (hasMap) {
|
|
431
|
-
bindings.push(
|
|
432
|
-
{ _name: "refractionMapTexture", _type: { _kind: "texture", _textureType: "texture_2d<f32>" }, _visibility: 2 },
|
|
433
|
-
{ _name: "refractionMapSampler", _type: { _kind: "sampler", _samplerType: "sampler" }, _visibility: 2 }
|
|
434
|
-
);
|
|
435
|
-
}
|
|
436
|
-
if (hasThicknessMap) {
|
|
437
|
-
bindings.push(
|
|
438
|
-
{ _name: "thicknessTexture_", _type: { _kind: "texture", _textureType: "texture_2d<f32>" }, _visibility: 2 },
|
|
439
|
-
{ _name: "thicknessSampler_", _type: { _kind: "sampler", _samplerType: "sampler" }, _visibility: 2 }
|
|
440
|
-
);
|
|
441
|
-
}
|
|
442
|
-
return {
|
|
443
|
-
_id: "refraction",
|
|
444
|
-
_dependencies: ["ibl"],
|
|
445
|
-
_uboFields: uboFields,
|
|
446
|
-
_bindings: bindings,
|
|
447
|
-
_fragmentSlots: linearImageProcessing ? { AI: makeRefractionMod(hasVolume, hasMap, hasThicknessMap, useGltfThicknessChannel, hasDispersion, dispersionSampleWgsl), ...LINEAR_IMAGE_PROCESSING_SLOTS } : { AI: makeRefractionMod(hasVolume, hasMap, hasThicknessMap, useGltfThicknessChannel, hasDispersion, dispersionSampleWgsl) }
|
|
448
|
-
};
|
|
449
|
-
}
|
|
450
|
-
function writeRefractionUBO(data, mat, offsets) {
|
|
451
|
-
var _a, _b;
|
|
452
|
-
const ss = mat.subsurface;
|
|
453
|
-
const refr = ss == null ? void 0 : ss.refraction;
|
|
454
|
-
if (!refr) {
|
|
455
|
-
return;
|
|
456
|
-
}
|
|
457
|
-
const off = offsets.get("refractionParams");
|
|
458
|
-
if (off === void 0) {
|
|
459
|
-
return;
|
|
460
|
-
}
|
|
461
|
-
const o = off / 4;
|
|
462
|
-
data[o] = refr.intensity ?? 0;
|
|
463
|
-
const ior = refr.indexOfRefraction ?? 1.5;
|
|
464
|
-
const thick = ss.thickness;
|
|
465
|
-
data[o + 1] = 1 / (refr.useThicknessAsDepth && (thick == null ? void 0 : thick.max) ? ior : 1);
|
|
466
|
-
data[o + 2] = refr.useThicknessAsDepth ? (thick == null ? void 0 : thick.max) ?? 0 : 1;
|
|
467
|
-
data[o + 3] = 1 / ior;
|
|
468
|
-
const vOff = offsets.get("volumeParams");
|
|
469
|
-
if (vOff !== void 0) {
|
|
470
|
-
const vo = vOff / 4;
|
|
471
|
-
const tint = ((_a = ss.tint) == null ? void 0 : _a.color) ?? [1, 1, 1];
|
|
472
|
-
const dist = Math.max(((_b = ss.tint) == null ? void 0 : _b.atDistance) ?? 1, 1e-4);
|
|
473
|
-
data[vo] = Math.log(Math.max(tint[0], 1e-6)) / dist;
|
|
474
|
-
data[vo + 1] = Math.log(Math.max(tint[1], 1e-6)) / dist;
|
|
475
|
-
data[vo + 2] = Math.log(Math.max(tint[2], 1e-6)) / dist;
|
|
476
|
-
data[vo + 3] = refr.dispersion ?? 0;
|
|
477
|
-
}
|
|
478
|
-
const tOff = offsets.get("thicknessParams");
|
|
479
|
-
if (tOff !== void 0) {
|
|
480
|
-
const to = tOff / 4;
|
|
481
|
-
const min = (thick == null ? void 0 : thick.min) ?? 0;
|
|
482
|
-
const max = (thick == null ? void 0 : thick.max) ?? 1;
|
|
483
|
-
data[to] = min;
|
|
484
|
-
data[to + 1] = max - min;
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
function makeRefractionRttExt(dispersionSampleWgsl) {
|
|
488
|
-
return {
|
|
489
|
-
id: "refraction",
|
|
490
|
-
phase: "fragment",
|
|
491
|
-
detect(mat) {
|
|
492
|
-
var _a, _b, _c;
|
|
493
|
-
const m = mat;
|
|
494
|
-
const ss = m.subsurface;
|
|
495
|
-
const refr = ss == null ? void 0 : ss.refraction;
|
|
496
|
-
const linearImageProcessing = m._linearImageProcessing ? PBR2_LINEAR_IMAGE_PROCESSING : 0;
|
|
497
|
-
const intensity = m.transmissive ? (refr == null ? void 0 : refr.intensity) ?? 0 : 0;
|
|
498
|
-
if (intensity <= 0) {
|
|
499
|
-
return { f: 0, f2: linearImageProcessing };
|
|
500
|
-
}
|
|
501
|
-
let f = 0;
|
|
502
|
-
let f2 = linearImageProcessing | PBR2_HAS_REFRACTION;
|
|
503
|
-
if (refr == null ? void 0 : refr.texture) {
|
|
504
|
-
f2 |= PBR2_HAS_REFRACTION_MAP;
|
|
505
|
-
}
|
|
506
|
-
if ((_a = ss == null ? void 0 : ss.thickness) == null ? void 0 : _a.texture) {
|
|
507
|
-
f |= PBR_HAS_THICKNESS_MAP;
|
|
508
|
-
}
|
|
509
|
-
if ((_b = ss == null ? void 0 : ss.thickness) == null ? void 0 : _b.useGlTFChannel) {
|
|
510
|
-
f2 |= PBR2_HAS_THICKNESS_GLTF_CHANNEL;
|
|
511
|
-
}
|
|
512
|
-
if (((_c = ss == null ? void 0 : ss.tint) == null ? void 0 : _c.atDistance) !== void 0) {
|
|
513
|
-
f2 |= PBR2_HAS_VOLUME;
|
|
514
|
-
if (refr == null ? void 0 : refr.dispersion) {
|
|
515
|
-
f2 |= PBR2_HAS_DISPERSION;
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
return { f, f2 };
|
|
519
|
-
},
|
|
520
|
-
frag(ctx) {
|
|
521
|
-
const linearImageProcessing = (ctx._features2 & PBR2_LINEAR_IMAGE_PROCESSING) !== 0;
|
|
522
|
-
if (!(ctx._features2 & PBR2_HAS_REFRACTION)) {
|
|
523
|
-
return linearImageProcessing ? { _id: "linear", _fragmentSlots: LINEAR_IMAGE_PROCESSING_SLOTS } : null;
|
|
524
|
-
}
|
|
525
|
-
return createRefractionRttFragment(
|
|
526
|
-
(ctx._features2 & PBR2_HAS_VOLUME) !== 0,
|
|
527
|
-
(ctx._features2 & PBR2_HAS_REFRACTION_MAP) !== 0,
|
|
528
|
-
(ctx._features & PBR_HAS_THICKNESS_MAP) !== 0,
|
|
529
|
-
(ctx._features2 & PBR2_HAS_THICKNESS_GLTF_CHANNEL) !== 0,
|
|
530
|
-
linearImageProcessing,
|
|
531
|
-
(ctx._features2 & PBR2_HAS_DISPERSION) !== 0,
|
|
532
|
-
dispersionSampleWgsl
|
|
533
|
-
);
|
|
534
|
-
},
|
|
535
|
-
writeUbo(data, mat, offsets) {
|
|
536
|
-
writeRefractionUBO(data, mat, offsets);
|
|
537
|
-
},
|
|
538
|
-
bind(ctx, entries, b) {
|
|
539
|
-
var _a, _b, _c, _d;
|
|
540
|
-
if (!(ctx._features2 & PBR2_HAS_REFRACTION)) {
|
|
541
|
-
return b;
|
|
542
|
-
}
|
|
543
|
-
const texture = ctx._refractionTexture;
|
|
544
|
-
if (!texture) {
|
|
545
|
-
throw new Error("PBR transmission requires a frame-graph refraction texture.");
|
|
546
|
-
}
|
|
547
|
-
entries.push({ binding: b++, resource: texture.view });
|
|
548
|
-
entries.push({ binding: b++, resource: texture.sampler });
|
|
549
|
-
if ((ctx._features2 & PBR2_HAS_REFRACTION_MAP) !== 0) {
|
|
550
|
-
const map = (_b = (_a = ctx._material.subsurface) == null ? void 0 : _a.refraction) == null ? void 0 : _b.texture;
|
|
551
|
-
entries.push({ binding: b++, resource: map.view });
|
|
552
|
-
entries.push({ binding: b++, resource: getTrilinearAnisotropicSampler(ctx._engine) });
|
|
553
|
-
}
|
|
554
|
-
if ((ctx._features & PBR_HAS_THICKNESS_MAP) !== 0) {
|
|
555
|
-
const thickness = (_d = (_c = ctx._material.subsurface) == null ? void 0 : _c.thickness) == null ? void 0 : _d.texture;
|
|
556
|
-
entries.push({ binding: b++, resource: thickness.view });
|
|
557
|
-
entries.push({ binding: b++, resource: thickness.sampler });
|
|
558
|
-
}
|
|
559
|
-
return b;
|
|
560
|
-
},
|
|
561
|
-
textures(mat, out) {
|
|
562
|
-
var _a, _b, _c, _d;
|
|
563
|
-
const tex = (_b = (_a = mat.subsurface) == null ? void 0 : _a.refraction) == null ? void 0 : _b.texture;
|
|
564
|
-
if (tex) {
|
|
565
|
-
out.push(tex);
|
|
566
|
-
}
|
|
567
|
-
const thickness = (_d = (_c = mat.subsurface) == null ? void 0 : _c.thickness) == null ? void 0 : _d.texture;
|
|
568
|
-
if (thickness) {
|
|
569
|
-
out.push(thickness);
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
};
|
|
573
|
-
}
|
|
574
|
-
function registerPbrTransmission(scene, engine, register, dispersionSampleWgsl) {
|
|
575
|
-
enableSceneTransmission(scene, engine);
|
|
576
|
-
register(makeRefractionRttExt(dispersionSampleWgsl));
|
|
577
|
-
}
|
|
578
|
-
export {
|
|
579
|
-
registerPbrTransmission
|
|
580
|
-
};
|
|
581
|
-
//# sourceMappingURL=pbr-transmission-ext-BxW4CEGu.js.map
|