@babylonjs/lite 0.2.0 → 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-Bvh5TymE.js → _mat4-storage-f64-CjDoht2w.js} +3 -2
- package/_mat4-storage-f64-CjDoht2w.js.map +1 -0
- package/{alpha-test-fragment-BCChpzaV.js → alpha-test-fragment-B7DjSnF7.js} +2 -2
- package/{alpha-test-fragment-BCChpzaV.js.map → alpha-test-fragment-B7DjSnF7.js.map} +1 -1
- package/assets/splat-sort-worker-DT3eybMZ.js.map +1 -0
- package/{background-dds-skybox-ZjrSIxrT.js → background-dds-skybox-BEX309u3.js} +13 -13
- package/background-dds-skybox-BEX309u3.js.map +1 -0
- package/{background-ground-B2Mie-MI.js → background-ground-BU0HOcM4.js} +19 -19
- package/background-ground-BU0HOcM4.js.map +1 -0
- package/{background-hdr-skybox-DDRJYuT2.js → background-hdr-skybox--RRRic_K.js} +10 -10
- package/background-hdr-skybox--RRRic_K.js.map +1 -0
- package/{background-solid-skybox-fjXlnWaD.js → background-solid-skybox-BrH2fXSu.js} +11 -12
- package/background-solid-skybox-BrH2fXSu.js.map +1 -0
- package/{billboard-renderable-DKmlOgbM.js → billboard-renderable-BHWryAeC.js} +46 -10
- package/billboard-renderable-BHWryAeC.js.map +1 -0
- package/{clamp-block-CxRBPlUq.js → clamp-block-DqbwnQGW.js} +2 -2
- package/{clamp-block-CxRBPlUq.js.map → clamp-block-DqbwnQGW.js.map} +1 -1
- package/{clearcoat-fragment-KbZAa0TA.js → clearcoat-fragment-D6FSCie1.js} +2 -2
- package/{clearcoat-fragment-KbZAa0TA.js.map → clearcoat-fragment-D6FSCie1.js.map} +1 -1
- package/{create-skeleton-BBI5urcj.js → create-skeleton-D_uplboC.js} +9 -9
- package/create-skeleton-D_uplboC.js.map +1 -0
- package/{cubemap-skybox-material-DvW81drX.js → cubemap-skybox-material-DQcMMdf-.js} +6 -7
- package/cubemap-skybox-material-DQcMMdf-.js.map +1 -0
- package/{curve-block-Dh_xdUj-.js → curve-block-21rT0JjG.js} +2 -2
- package/{curve-block-Dh_xdUj-.js.map → curve-block-21rT0JjG.js.map} +1 -1
- package/{emissive-fragment-DD8cvHyx.js → emissive-fragment-C5FtBs3y.js} +3 -3
- package/emissive-fragment-C5FtBs3y.js.map +1 -0
- package/{esm-shadow-view-DYAc62Kl.js → esm-shadow-view-Cl3rPGof.js} +2 -2
- package/{esm-shadow-view-DYAc62Kl.js.map → esm-shadow-view-Cl3rPGof.js.map} +1 -1
- package/{esm-shadow-view-DHVS9r7H.js → esm-shadow-view-Gtd1LWRP.js} +2 -2
- package/{esm-shadow-view-DHVS9r7H.js.map → esm-shadow-view-Gtd1LWRP.js.map} +1 -1
- package/{esm-shadow-view-15S4JK6p.js → esm-shadow-view-c5YV4Eg9.js} +2 -2
- package/{esm-shadow-view-15S4JK6p.js.map → esm-shadow-view-c5YV4Eg9.js.map} +1 -1
- package/{gaussian-splatting-pipeline-sh-BvkUhA9V.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-KnPzeOIY.js → gltf-animation-K_zZxj_d.js} +6 -6
- package/gltf-animation-K_zZxj_d.js.map +1 -0
- package/{gltf-ext-basisu-kmth3UWX.js → gltf-ext-basisu-CDbPclzZ.js} +48 -16
- package/gltf-ext-basisu-CDbPclzZ.js.map +1 -0
- package/{gltf-ext-node-visibility-BjRRd6si.js → gltf-ext-node-visibility-DXCJEYr6.js} +2 -2
- package/{gltf-ext-node-visibility-BjRRd6si.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-MHmR-YyM.js → gltf-ext-uv-transform-DgYazJBs.js} +2 -2
- package/{gltf-ext-uv-transform-MHmR-YyM.js.map → gltf-ext-uv-transform-DgYazJBs.js.map} +1 -1
- package/{gltf-feature-animation-pointer-rFqLfbO_.js → gltf-feature-animation-pointer-D1RJRFBw.js} +9 -9
- package/gltf-feature-animation-pointer-D1RJRFBw.js.map +1 -0
- package/{gltf-feature-animations-DikONdzi.js → gltf-feature-animations-Cmc1uoIu.js} +2 -2
- package/{gltf-feature-animations-DikONdzi.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-Cj1XjmM6.js → gltf-feature-gpu-instancing-n87SO6Vh.js} +4 -4
- package/gltf-feature-gpu-instancing-n87SO6Vh.js.map +1 -0
- package/{gltf-feature-lights-punctual-C-0SlGmD.js → gltf-feature-lights-punctual-Ckm3ciL8.js} +5 -5
- package/{gltf-feature-lights-punctual-C-0SlGmD.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-BAcY14XU.js → gltf-feature-morph-Cjtu7hYa.js} +4 -4
- package/gltf-feature-morph-Cjtu7hYa.js.map +1 -0
- package/{gltf-feature-registry-97sY_x5O.js → gltf-feature-registry-C63Hjp9w.js} +15 -15
- package/{gltf-feature-registry-97sY_x5O.js.map → gltf-feature-registry-C63Hjp9w.js.map} +1 -1
- package/{gltf-feature-skeleton-lVjkDfIU.js → gltf-feature-skeleton-DKbOGidp.js} +3 -3
- package/{gltf-feature-skeleton-lVjkDfIU.js.map → gltf-feature-skeleton-DKbOGidp.js.map} +1 -1
- package/{gltf-feature-variants-BphF4JmV.js → gltf-feature-variants-Cmzu0O0e.js} +2 -2
- package/{gltf-feature-variants-BphF4JmV.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-C9eBqH_F.js → gltf-interleave-gHf9_t0i.js} +14 -14
- package/gltf-interleave-gHf9_t0i.js.map +1 -0
- package/{gltf-pbr-builder-ext-DPC0zg_u.js → gltf-pbr-builder-ext-edNcjwPf.js} +5 -5
- package/gltf-pbr-builder-ext-edNcjwPf.js.map +1 -0
- package/{gltf-variants-CnBEZr0o.js → gltf-variants-CPxNdtP4.js} +4 -4
- package/{gltf-variants-CnBEZr0o.js.map → gltf-variants-CPxNdtP4.js.map} +1 -1
- package/{gs-picking-pipeline-Bx8LTav6.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 +2007 -105
- package/index.js +446 -322
- package/{input-block-Coi_aZwl.js → input-block-DqEedWF2.js} +2 -2
- package/{input-block-Coi_aZwl.js.map → input-block-DqEedWF2.js.map} +1 -1
- package/{iridescence-fragment-DwZcCTdD.js → iridescence-fragment-BHU59-gQ.js} +2 -2
- package/{iridescence-fragment-DwZcCTdD.js.map → iridescence-fragment-BHU59-gQ.js.map} +1 -1
- package/{light-block-Np_h5gPI.js → light-block-Bv37V8vl.js} +2 -2
- package/{light-block-Np_h5gPI.js.map → light-block-Bv37V8vl.js.map} +1 -1
- package/{loop-block-BFkLFYGm.js → loop-block-qTg8vb99.js} +2 -2
- package/{loop-block-BFkLFYGm.js.map → loop-block-qTg8vb99.js.map} +1 -1
- package/{morph-fragment-DqH-w61u.js → morph-fragment-BRCUr2wQ.js} +2 -2
- package/{morph-fragment-DqH-w61u.js.map → morph-fragment-BRCUr2wQ.js.map} +1 -1
- package/{multilight-wgsl-B9Mf9d-q.js → multilight-wgsl-DMeppAdZ.js} +2 -2
- package/{multilight-wgsl-B9Mf9d-q.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-Ch7ApZHF.js → node-registry-extra-compat-dWrv7gpS.js} +2 -2
- package/{node-registry-extra-compat-Ch7ApZHF.js.map → node-registry-extra-compat-dWrv7gpS.js.map} +1 -1
- package/{node-registry-extra-math-6ezzTkPj.js → node-registry-extra-math-Bn854sX9.js} +2 -2
- package/{node-registry-extra-math-6ezzTkPj.js.map → node-registry-extra-math-Bn854sX9.js.map} +1 -1
- package/{node-renderable-CS0CmsSp.js → node-renderable-B5G8WcdH.js} +15 -13
- package/node-renderable-B5G8WcdH.js.map +1 -0
- package/{node-shadow-CpnrdvtJ.js → node-shadow-CVIUlNf0.js} +7 -7
- package/node-shadow-CVIUlNf0.js.map +1 -0
- package/{normal-map-fragment-DradEMl-.js → normal-map-fragment-CQSxhjCy.js} +2 -2
- package/{normal-map-fragment-DradEMl-.js.map → normal-map-fragment-CQSxhjCy.js.map} +1 -1
- package/package.json +3 -10
- package/{parse-camera-CgV4bWc0.js → parse-camera-pBRT_6i5.js} +2 -2
- package/{parse-camera-CgV4bWc0.js.map → parse-camera-pBRT_6i5.js.map} +1 -1
- package/pbr-geometry-view-NiZY_juX.js +491 -0
- package/pbr-geometry-view-NiZY_juX.js.map +1 -0
- package/{pbr-metallic-roughness-block-BFwZj2Nw.js → pbr-metallic-roughness-block-JBSi-tQN.js} +2 -2
- package/{pbr-metallic-roughness-block-BFwZj2Nw.js.map → pbr-metallic-roughness-block-JBSi-tQN.js.map} +1 -1
- package/{pbr-metallic-roughness-block-full-5t0HT3xl.js → pbr-metallic-roughness-block-full-Ta9lR2cz.js} +2 -2
- package/{pbr-metallic-roughness-block-full-5t0HT3xl.js.map → pbr-metallic-roughness-block-full-Ta9lR2cz.js.map} +1 -1
- package/{pbr-mr-helper-core-R5tOZ8Ap.js → pbr-mr-helper-core-BVWNR08D.js} +2 -2
- package/{pbr-mr-helper-core-R5tOZ8Ap.js.map → pbr-mr-helper-core-BVWNR08D.js.map} +1 -1
- package/{pbr-refraction-Dd11HnaI.js → pbr-refraction-C9FvFmAp.js} +2 -2
- package/{pbr-refraction-Dd11HnaI.js.map → pbr-refraction-C9FvFmAp.js.map} +1 -1
- package/{pbr-renderable-BHAdF5Vw.js → pbr-renderable-DzUF2QIk.js} +60 -42
- package/pbr-renderable-DzUF2QIk.js.map +1 -0
- package/{pbr-shadow-fragment-BxUrFJYZ.js → pbr-shadow-fragment-CnqnbGYS.js} +2 -2
- package/{pbr-shadow-fragment-BxUrFJYZ.js.map → pbr-shadow-fragment-CnqnbGYS.js.map} +1 -1
- package/{pbr-tracking-D6i3yPb7.js → pbr-tracking-3tU1kqea.js} +2 -2
- package/{pbr-tracking-D6i3yPb7.js.map → pbr-tracking-3tU1kqea.js.map} +1 -1
- package/{pbr-transmission-ext-Dll8EYwE.js → pbr-transmission-ext-BcLjRxfB.js} +2 -2
- package/{pbr-transmission-ext-Dll8EYwE.js.map → pbr-transmission-ext-BcLjRxfB.js.map} +1 -1
- 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-ejMJ4O1o.js → reflectance-fragment-Dbpgw3Jt.js} +2 -2
- package/{reflectance-fragment-ejMJ4O1o.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-BAJpbMog.js → shader-composer-BUD_pSX4.js} +3 -54
- package/shader-composer-BUD_pSX4.js.map +1 -0
- package/{shader-renderable-BMf_vvO0.js → shader-renderable-D7-RyVxa.js} +25 -19
- package/shader-renderable-D7-RyVxa.js.map +1 -0
- package/{shader-thin-instance-5_WUfi3m.js → shader-thin-instance-DuBotxDO.js} +4 -4
- package/shader-thin-instance-DuBotxDO.js.map +1 -0
- package/{sheen-fragment-CS6z29Fs.js → sheen-fragment-1MkEMcbc.js} +2 -2
- package/{sheen-fragment-CS6z29Fs.js.map → sheen-fragment-1MkEMcbc.js.map} +1 -1
- package/{singlelight-directional-wgsl-4MIgZMeC.js → singlelight-directional-wgsl-BsV8G456.js} +2 -2
- package/{singlelight-directional-wgsl-4MIgZMeC.js.map → singlelight-directional-wgsl-BsV8G456.js.map} +1 -1
- package/{singlelight-hemispheric-wgsl-CK-GUYWe.js → singlelight-hemispheric-wgsl-Bo0jKlW5.js} +2 -2
- package/{singlelight-hemispheric-wgsl-CK-GUYWe.js.map → singlelight-hemispheric-wgsl-Bo0jKlW5.js.map} +1 -1
- package/{singlelight-point-wgsl-CYtzqCbP.js → singlelight-point-wgsl-DV39UP5Y.js} +2 -2
- package/{singlelight-point-wgsl-CYtzqCbP.js.map → singlelight-point-wgsl-DV39UP5Y.js.map} +1 -1
- package/{singlelight-spot-wgsl-DVbaVufF.js → singlelight-spot-wgsl-yg3od6vL.js} +2 -2
- package/{singlelight-spot-wgsl-DVbaVufF.js.map → singlelight-spot-wgsl-yg3od6vL.js.map} +1 -1
- package/{skeleton-fragment-BOVmc8YS.js → skeleton-fragment-DdxYG6kv.js} +2 -2
- package/{skeleton-fragment-BOVmc8YS.js.map → skeleton-fragment-DdxYG6kv.js.map} +1 -1
- package/{skybox-renderable-DDcCPSly.js → skybox-renderable-CJD4XmX5.js} +7 -8
- 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-D1bhoF0K.js → standard-pipeline-XTbHL7MY.js} +11 -202
- 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-C6WNm8dQ.js → std-ambient-fragment-Bjx3VFrr.js} +2 -2
- package/{std-ambient-fragment-C6WNm8dQ.js.map → std-ambient-fragment-Bjx3VFrr.js.map} +1 -1
- package/{std-cube-reflection-fragment-Bqutpy2q.js → std-cube-reflection-fragment-y9WWdXUt.js} +2 -2
- package/{std-cube-reflection-fragment-Bqutpy2q.js.map → std-cube-reflection-fragment-y9WWdXUt.js.map} +1 -1
- package/{std-emissive-fragment-B-A83rqX.js → std-emissive-fragment-C8Lnmojh.js} +2 -2
- package/{std-emissive-fragment-B-A83rqX.js.map → std-emissive-fragment-C8Lnmojh.js.map} +1 -1
- package/{std-lightmap-fragment-Df7KJezh.js → std-lightmap-fragment-DFxGcoA5.js} +2 -2
- package/{std-lightmap-fragment-Df7KJezh.js.map → std-lightmap-fragment-DFxGcoA5.js.map} +1 -1
- package/{std-opacity-fragment-D9et2jip.js → std-opacity-fragment-EXzFWiSp.js} +2 -2
- package/{std-opacity-fragment-D9et2jip.js.map → std-opacity-fragment-EXzFWiSp.js.map} +1 -1
- package/{std-reflection-fragment-DBJeT-yg.js → std-reflection-fragment-BoJORqpG.js} +2 -2
- package/{std-reflection-fragment-DBJeT-yg.js.map → std-reflection-fragment-BoJORqpG.js.map} +1 -1
- package/{std-shadow-fragment-C6fD8rW-.js → std-shadow-fragment-Bq-Wc8UJ.js} +2 -2
- package/{std-shadow-fragment-C6fD8rW-.js.map → std-shadow-fragment-Bq-Wc8UJ.js.map} +1 -1
- package/{std-specular-fragment-C2ZOss-t.js → std-specular-fragment-CM5R5j2g.js} +2 -2
- package/{std-specular-fragment-C2ZOss-t.js.map → std-specular-fragment-CM5R5j2g.js.map} +1 -1
- package/{std-tracking-C4L4nQGc.js → std-tracking-Cif_wXeT.js} +2 -2
- package/{std-tracking-C4L4nQGc.js.map → std-tracking-Cif_wXeT.js.map} +1 -1
- package/{subsurface-fragment-C1H4ytqK.js → subsurface-fragment-BEaAXYXz.js} +2 -2
- package/{subsurface-fragment-C1H4ytqK.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-CCxrPNO6.js → thin-instance-cull-binding-DWKUt5ZN.js} +12 -12
- package/thin-instance-cull-binding-DWKUt5ZN.js.map +1 -0
- package/{thin-instance-gpu-E8DBd8XL.js → thin-instance-gpu-BDdRcNAh.js} +15 -7
- package/thin-instance-gpu-BDdRcNAh.js.map +1 -0
- package/{tracking-primitives-w4BVV9p9.js → tracking-primitives-CglRNTlX.js} +2 -2
- package/{tracking-primitives-w4BVV9p9.js.map → tracking-primitives-CglRNTlX.js.map} +1 -1
- package/{unlit-fragment-DU9_mhzZ.js → unlit-fragment-kxfZWlnp.js} +2 -2
- package/{unlit-fragment-DU9_mhzZ.js.map → unlit-fragment-kxfZWlnp.js.map} +1 -1
- package/_mat4-storage-f64-Bvh5TymE.js.map +0 -1
- package/assets/splat-sort-worker-Crg3CaCc.js.map +0 -1
- package/background-dds-skybox-ZjrSIxrT.js.map +0 -1
- package/background-ground-B2Mie-MI.js.map +0 -1
- package/background-hdr-skybox-DDRJYuT2.js.map +0 -1
- package/background-solid-skybox-fjXlnWaD.js.map +0 -1
- package/billboard-renderable-DKmlOgbM.js.map +0 -1
- package/create-skeleton-BBI5urcj.js.map +0 -1
- package/cubemap-skybox-material-DvW81drX.js.map +0 -1
- package/emissive-fragment-DD8cvHyx.js.map +0 -1
- package/gaussian-splatting-pipeline-sh-BvkUhA9V.js.map +0 -1
- package/gltf-animation-KnPzeOIY.js.map +0 -1
- package/gltf-ext-basisu-kmth3UWX.js.map +0 -1
- package/gltf-ext-quantization-CpZyLDIz.js.map +0 -1
- package/gltf-feature-animation-pointer-rFqLfbO_.js.map +0 -1
- package/gltf-feature-draco-yGSMGTE3.js.map +0 -1
- package/gltf-feature-gpu-instancing-Cj1XjmM6.js.map +0 -1
- package/gltf-feature-meshopt-Des96YFI.js.map +0 -1
- package/gltf-feature-morph-BAcY14XU.js.map +0 -1
- package/gltf-glb-parser-D6UZWFuC.js.map +0 -1
- package/gltf-interleave-C9eBqH_F.js.map +0 -1
- package/gltf-pbr-builder-ext-DPC0zg_u.js.map +0 -1
- package/gs-picking-pipeline-Bx8LTav6.js.map +0 -1
- package/index-B7Qhw0xL.js +0 -21232
- package/index-B7Qhw0xL.js.map +0 -1
- package/mesh-features-BAJpbMog.js.map +0 -1
- package/no-color-view-DsyLSL-W.js +0 -8
- package/no-color-view-DsyLSL-W.js.map +0 -1
- package/node-env-BPZXZzBf.js.map +0 -1
- package/node-registry-Bd-AlrgC.js +0 -190
- package/node-registry-Bd-AlrgC.js.map +0 -1
- package/node-renderable-CS0CmsSp.js.map +0 -1
- package/node-shadow-CpnrdvtJ.js.map +0 -1
- package/pbr-renderable-BHAdF5Vw.js.map +0 -1
- package/rgbd-decode-DCvzUYeI.js.map +0 -1
- package/scene-material-swap-C2ykv55W.js.map +0 -1
- package/shader-renderable-BMf_vvO0.js.map +0 -1
- package/shader-thin-instance-5_WUfi3m.js.map +0 -1
- package/skybox-renderable-DDcCPSly.js.map +0 -1
- package/splat-ply-compressed-BahdBG1r.js.map +0 -1
- package/standard-renderable-D1bhoF0K.js.map +0 -1
- package/swapchain-overlay-DcCSFDp7.js +0 -35
- package/swapchain-overlay-DcCSFDp7.js.map +0 -1
- package/thin-instance-cull-binding-CCxrPNO6.js.map +0 -1
- package/thin-instance-gpu-E8DBd8XL.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-shadow-CVIUlNf0.js","sources":["../src/material/node/node-shadow.ts"],"sourcesContent":["/** Node Material — shadow emission (dynamically imported).\n *\n * This module is imported ONLY when `parseNodeMaterialFromSnippet` receives\n * `shadowGenerators`. Scenes without shadows never bundle it, keeping the\n * shadow WGSL (PCF/ESM helper fns + binding wiring) off the critical path.\n *\n * Emits three things per shadow light (texture + sampler + shadowInfo UBO)\n * plus the vertex-stage varying computations and the fragment-stage\n * `nme_computeShadowFactors(input)` dispatcher consumed by the LightBlock.\n */\n\nimport { SS } from \"../../engine/gpu-flags.js\";\nimport { MAX_LIGHTS } from \"../../light/types.js\";\nimport type { Varying } from \"../../shader/fragment-types.js\";\n\nconst SHADOW_FACTORS_TYPE = `array<f32, ${MAX_LIGHTS}>`;\nconst SHADOW_FACTORS_ONE = `${SHADOW_FACTORS_TYPE}(${new Array(MAX_LIGHTS).fill(\"1.0\").join(\", \")})`;\n\n/** @internal */\nexport interface ShadowBinding {\n /** @internal */\n readonly _lightIndex: number;\n /** @internal */\n readonly _texBinding: number;\n /** @internal */\n readonly _sampBinding: number;\n /** @internal */\n readonly _uboBinding: number;\n /** @internal */\n readonly _shadowType: \"esm\" | \"pcf\";\n}\n\nexport interface ShadowEmit {\n /** @internal One per shadow-casting light (3 binding slots each). */\n readonly _bindings: readonly ShadowBinding[];\n /** @internal Module-scope WGSL: struct + binding decls + compute fns. */\n readonly _wgslDecls: string;\n /** @internal `nme_computeShadowFactors(input) -> array<f32, MAX_LIGHTS>` called from light blocks. */\n readonly _fragmentHelper: string;\n /** @internal Injected into vs_main body: populates vPosFromLight_i + vDepthMetric_i varyings. */\n readonly _vertexInject: string;\n /** @internal GPU BGL entries for group 1 (append to meshBglEntries). */\n readonly _bglEntries: readonly GPUBindGroupLayoutEntry[];\n /** @internal Total bindings consumed (= shadowLights.length * 3). */\n readonly _bindingCount: number;\n}\n\n/** Emit shadow WGSL + bindings for a NodeMaterial.\n * Mutates `varyings` (pushes vPosFromLight_i + vDepthMetric_i per light) so\n * buildVertexOut picks them up.\n */\nexport function emitShadow(shadowLights: readonly { lightIndex: number; shadowType: \"esm\" | \"pcf\" }[], startBinding: number, varyings: Varying[]): ShadowEmit {\n const _bindings: ShadowBinding[] = [];\n const wgslDecls: string[] = [];\n const _bglEntries: GPUBindGroupLayoutEntry[] = [];\n for (const sl of shadowLights) {\n const suf = `_${sl.lightIndex}`;\n if (!varyings.some((v) => v._name === `vPosFromLight${suf}`)) {\n varyings.push({ _name: `vPosFromLight${suf}`, _type: \"vec4<f32>\" });\n }\n if (!varyings.some((v) => v._name === `vDepthMetric${suf}`)) {\n varyings.push({ _name: `vDepthMetric${suf}`, _type: \"f32\" });\n }\n }\n const vertLines: string[] = [`let _shadowWp4 = meshU.world * vec4<f32>(in.position, 1.0);`];\n const dispatchLines: string[] = [`var _sf = ${SHADOW_FACTORS_ONE};`];\n let nextBinding = startBinding;\n for (const sl of shadowLights) {\n const suf = `_${sl.lightIndex}`;\n const _lightIndex = sl.lightIndex;\n const _texBinding = nextBinding++;\n const _sampBinding = nextBinding++;\n const _uboBinding = nextBinding++;\n const _shadowType = sl.shadowType;\n _bindings.push({ _lightIndex, _texBinding, _sampBinding, _uboBinding, _shadowType });\n wgslDecls.push(\n `struct shadowInfo${suf}Uniforms { lightMatrix: mat4x4<f32>, depthValues: vec4<f32>, shadowsInfo: vec4<f32> };`,\n `@group(1) @binding(${_uboBinding}) var<uniform> shadowInfo${suf}: shadowInfo${suf}Uniforms;`\n );\n if (sl.shadowType === \"pcf\") {\n wgslDecls.push(\n `@group(1) @binding(${_texBinding}) var shadowTex${suf}: texture_depth_2d;`,\n `@group(1) @binding(${_sampBinding}) var shadowComp${suf}: sampler_comparison;`,\n `fn computeShadowPCF${suf}(posFromLight: vec4<f32>, depthMetric: f32, darkness: f32, mapSz: f32, invMapSz: f32) -> f32 {\n let clipSpace = posFromLight.xyz / posFromLight.w;\n let uv = vec2<f32>(0.5 * clipSpace.x + 0.5, 0.5 - 0.5 * clipSpace.y);\n if (depthMetric < 0.0 || depthMetric > 1.0 || uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) { return 1.0; }\n let depthRef = clamp(clipSpace.z, 0.0, 1.0);\n var tc = uv * mapSz + 0.5;\n let st = fract(tc);\n let base = (floor(tc) - 0.5) * invMapSz;\n let uvw0 = 4.0 - 3.0 * st;\n let uvw1 = vec2<f32>(7.0);\n let uvw2 = 1.0 + 3.0 * st;\n let u = vec3<f32>((3.0 - 2.0 * st.x) / uvw0.x - 2.0, (3.0 + st.x) / uvw1.x, st.x / uvw2.x + 2.0) * invMapSz;\n let v = vec3<f32>((3.0 - 2.0 * st.y) / uvw0.y - 2.0, (3.0 + st.y) / uvw1.y, st.y / uvw2.y + 2.0) * invMapSz;\n var sh = 0.0;\n sh += uvw0.x * uvw0.y * textureSampleCompareLevel(shadowTex${suf}, shadowComp${suf}, base + vec2<f32>(u[0], v[0]), depthRef);\n sh += uvw1.x * uvw0.y * textureSampleCompareLevel(shadowTex${suf}, shadowComp${suf}, base + vec2<f32>(u[1], v[0]), depthRef);\n sh += uvw2.x * uvw0.y * textureSampleCompareLevel(shadowTex${suf}, shadowComp${suf}, base + vec2<f32>(u[2], v[0]), depthRef);\n sh += uvw0.x * uvw1.y * textureSampleCompareLevel(shadowTex${suf}, shadowComp${suf}, base + vec2<f32>(u[0], v[1]), depthRef);\n sh += uvw1.x * uvw1.y * textureSampleCompareLevel(shadowTex${suf}, shadowComp${suf}, base + vec2<f32>(u[1], v[1]), depthRef);\n sh += uvw2.x * uvw1.y * textureSampleCompareLevel(shadowTex${suf}, shadowComp${suf}, base + vec2<f32>(u[2], v[1]), depthRef);\n sh += uvw0.x * uvw2.y * textureSampleCompareLevel(shadowTex${suf}, shadowComp${suf}, base + vec2<f32>(u[0], v[2]), depthRef);\n sh += uvw1.x * uvw2.y * textureSampleCompareLevel(shadowTex${suf}, shadowComp${suf}, base + vec2<f32>(u[1], v[2]), depthRef);\n sh += uvw2.x * uvw2.y * textureSampleCompareLevel(shadowTex${suf}, shadowComp${suf}, base + vec2<f32>(u[2], v[2]), depthRef);\n sh /= 144.0;\n return mix(darkness, 1.0, sh);\n}`\n );\n dispatchLines.push(\n `_sf[${sl.lightIndex}] = computeShadowPCF${suf}(input.vPosFromLight${suf}, input.vDepthMetric${suf}, shadowInfo${suf}.shadowsInfo.x, shadowInfo${suf}.shadowsInfo.y, shadowInfo${suf}.shadowsInfo.z);`\n );\n _bglEntries.push(\n { binding: _texBinding, visibility: SS.FRAGMENT, texture: { sampleType: \"depth\", viewDimension: \"2d\" } },\n { binding: _sampBinding, visibility: SS.FRAGMENT, sampler: { type: \"comparison\" } }\n );\n } else {\n wgslDecls.push(\n `@group(1) @binding(${_texBinding}) var shadowTex${suf}: texture_2d<f32>;`,\n `@group(1) @binding(${_sampBinding}) var shadowSamp${suf}: sampler;`,\n `fn computeFallOff${suf}(value: f32, clipSpace: vec2<f32>, frustumEdgeFalloff: f32) -> f32 {\n let mask = smoothstep(1.0 - frustumEdgeFalloff, 1.00000012, clamp(dot(clipSpace, clipSpace), 0.0, 1.0));\n return mix(value, 1.0, mask);\n}\nfn computeShadowESM${suf}(posFromLight: vec4<f32>, depthMetric: f32, darkness: f32, depthScale: f32, frustumEdgeFalloff: f32) -> f32 {\n let clipSpace = posFromLight.xyz / posFromLight.w;\n let uv = vec2<f32>(0.5 * clipSpace.x + 0.5, 0.5 - 0.5 * clipSpace.y);\n if (depthMetric < 0.0 || depthMetric > 1.0 || uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) { return 1.0; }\n let shadowPixelDepth = clamp(depthMetric, 0.0, 1.0);\n let shadowMapSample = textureSampleLevel(shadowTex${suf}, shadowSamp${suf}, uv, 0.0).x;\n let esm = 1.0 - clamp(exp(min(87.0, depthScale * shadowPixelDepth)) * shadowMapSample, 0.0, 1.0 - darkness);\n return computeFallOff${suf}(esm, clipSpace.xy, frustumEdgeFalloff);\n}`\n );\n dispatchLines.push(\n `_sf[${sl.lightIndex}] = computeShadowESM${suf}(input.vPosFromLight${suf}, input.vDepthMetric${suf}, shadowInfo${suf}.shadowsInfo.x, shadowInfo${suf}.shadowsInfo.z, shadowInfo${suf}.shadowsInfo.w);`\n );\n _bglEntries.push(\n { binding: _texBinding, visibility: SS.FRAGMENT, texture: { sampleType: \"float\", viewDimension: \"2d\" } },\n { binding: _sampBinding, visibility: SS.FRAGMENT, sampler: { type: \"filtering\" } }\n );\n }\n vertLines.push(\n `out.vPosFromLight${suf} = shadowInfo${suf}.lightMatrix * _shadowWp4;`,\n `out.vDepthMetric${suf} = (out.vPosFromLight${suf}.z + shadowInfo${suf}.depthValues.x) / shadowInfo${suf}.depthValues.y;`\n );\n _bglEntries.push({\n binding: _uboBinding,\n visibility: SS.VERTEX | SS.FRAGMENT,\n buffer: { type: \"uniform\", minBindingSize: 96 },\n });\n }\n dispatchLines.push(`for (var _i = 0u; _i < ${MAX_LIGHTS}u; _i++) { _sf[_i] = mix(1.0, _sf[_i], meshU.receivesShadow.x); }`);\n dispatchLines.push(`return _sf;`);\n return {\n _bindings,\n _wgslDecls: wgslDecls.join(\"\\n\"),\n _fragmentHelper: `fn nme_computeShadowFactors(input: VertexOut) -> ${SHADOW_FACTORS_TYPE} {\\n ${dispatchLines.join(\"\\n \")}\\n}`,\n _vertexInject: vertLines.join(\"\\n \"),\n _bglEntries,\n _bindingCount: shadowLights.length * 3,\n };\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ad as HAS_BUMP_TEXTURE } from "./index-CLElg2Bo.js";
|
|
2
2
|
import { W as WGSL_PERTURB_NORMAL } from "./wgsl-helpers-D8sl1VVA.js";
|
|
3
3
|
const STAGE_FRAGMENT = 2;
|
|
4
4
|
function createNormalMapFragment() {
|
|
@@ -35,4 +35,4 @@ export {
|
|
|
35
35
|
bumpStdExt,
|
|
36
36
|
createNormalMapFragment
|
|
37
37
|
};
|
|
38
|
-
//# sourceMappingURL=normal-map-fragment-
|
|
38
|
+
//# sourceMappingURL=normal-map-fragment-CQSxhjCy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normal-map-fragment-
|
|
1
|
+
{"version":3,"file":"normal-map-fragment-CQSxhjCy.js","sources":["../src/material/standard/fragments/normal-map-fragment.ts"],"sourcesContent":["/**\n * Normal Map Fragment (Cotangent Frame)\n *\n * Shared cotangent-frame bump mapping for Standard materials.\n * Uses screen-space derivatives to construct the TBN frame without\n * requiring explicit tangent vertex attributes.\n */\n\nimport type { ShaderFragment } from \"../../../shader/fragment-types.js\";\nimport type { StandardMaterialProps } from \"../standard-material.js\";\nimport type { Texture2D } from \"../../../texture/texture-2d.js\";\nimport type { StdExt } from \"../standard-flags.js\";\nimport { HAS_BUMP_TEXTURE } from \"../standard-flags.js\";\nimport { WGSL_PERTURB_NORMAL } from \"../../../shader/wgsl-helpers.js\";\n\nconst STAGE_FRAGMENT = 0x2;\n\n/**\n * Create a bump/normal map fragment for Standard material.\n * @param bumpLevel - The bump level (1.0 = default). bumpScale = 1/bumpLevel.\n */\nexport function createNormalMapFragment(): ShaderFragment {\n return {\n _id: \"normal-map\",\n\n _bindings: [\n { _name: \"bT\", _type: { _kind: \"texture\", _textureType: \"texture_2d<f32>\" }, _visibility: STAGE_FRAGMENT },\n { _name: \"bS\", _type: { _kind: \"sampler\", _samplerType: \"sampler\" }, _visibility: STAGE_FRAGMENT },\n ],\n\n _helperFunctions: WGSL_PERTURB_NORMAL,\n\n _fragmentSlots: {\n AC: `normalW = perturbNormal(input.vn, input.vp, input.vu, mat.bs);`,\n },\n };\n}\n\nexport const bumpStdExt: StdExt = {\n _id: \"normal-map\",\n _phase: \"mesh\",\n _feature: HAS_BUMP_TEXTURE,\n _frag: createNormalMapFragment,\n _bind(mat: StandardMaterialProps, entries: GPUBindGroupEntry[], b: number): number {\n const tex = mat.bumpTexture!;\n entries.push({ binding: b++, resource: tex.texture.createView() });\n entries.push({ binding: b++, resource: tex.sampler });\n return b;\n },\n _textures(mat: StandardMaterialProps, out: Texture2D[]): void {\n if (mat.bumpTexture) {\n out.push(mat.bumpTexture);\n }\n },\n};\n"],"names":[],"mappings":";;AAeA,MAAM,iBAAiB;AAMhB,SAAS,0BAA0C;AACtD,SAAO;AAAA,IACH,KAAK;AAAA,IAEL,WAAW;AAAA,MACP,EAAE,OAAO,MAAM,OAAO,EAAE,OAAO,WAAW,cAAc,kBAAA,GAAqB,aAAa,eAAA;AAAA,MAC1F,EAAE,OAAO,MAAM,OAAO,EAAE,OAAO,WAAW,cAAc,aAAa,aAAa,eAAA;AAAA,IAAe;AAAA,IAGrG,kBAAkB;AAAA,IAElB,gBAAgB;AAAA,MACZ,IAAI;AAAA,IAAA;AAAA,EACR;AAER;AAEO,MAAM,aAAqB;AAAA,EAC9B,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,OAAO;AAAA,EACP,MAAM,KAA4B,SAA8B,GAAmB;AAC/E,UAAM,MAAM,IAAI;AAChB,YAAQ,KAAK,EAAE,SAAS,KAAK,UAAU,IAAI,QAAQ,WAAA,GAAc;AACjE,YAAQ,KAAK,EAAE,SAAS,KAAK,UAAU,IAAI,SAAS;AACpD,WAAO;AAAA,EACX;AAAA,EACA,UAAU,KAA4B,KAAwB;AAC1D,QAAI,IAAI,aAAa;AACjB,UAAI,KAAK,IAAI,WAAW;AAAA,IAC5B;AAAA,EACJ;AACJ;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@babylonjs/lite",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -12,15 +12,8 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"sideEffects": false,
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"draco3d": "^1.5.7",
|
|
17
|
-
"manifold-3d": "3.4.0",
|
|
18
|
-
"@recast-navigation/core": "0.43.0",
|
|
19
|
-
"@recast-navigation/generators": "0.43.0",
|
|
20
|
-
"@recast-navigation/wasm": "0.43.0"
|
|
21
|
-
},
|
|
22
15
|
"babylonLiteRelease": {
|
|
23
|
-
"azureBuildId": "
|
|
24
|
-
"sourceVersion": "
|
|
16
|
+
"azureBuildId": "54704",
|
|
17
|
+
"sourceVersion": "a56d95c4709f0ccdb2aa992304f3343a9e23fde3"
|
|
25
18
|
}
|
|
26
19
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { l as createFreeCamera } from "./index-CLElg2Bo.js";
|
|
2
2
|
function parseBabylonCamera(cd) {
|
|
3
3
|
var _a, _b;
|
|
4
4
|
const p = cd.position;
|
|
@@ -20,4 +20,4 @@ function parseBabylonCamera(cd) {
|
|
|
20
20
|
export {
|
|
21
21
|
parseBabylonCamera
|
|
22
22
|
};
|
|
23
|
-
//# sourceMappingURL=parse-camera-
|
|
23
|
+
//# sourceMappingURL=parse-camera-pBRT_6i5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-camera-
|
|
1
|
+
{"version":3,"file":"parse-camera-pBRT_6i5.js","sources":["../src/loader-babylon/parse-camera.ts"],"sourcesContent":["/** Parse a FreeCamera from .babylon camera data. Dynamically imported by load-babylon.ts. */\nimport { createFreeCamera } from \"../camera/free-camera.js\";\nimport type { FreeCamera } from \"../camera/free-camera.js\";\n\nexport function parseBabylonCamera(cd: { position: number[]; rotation?: number[]; fov?: number; minZ?: number; maxZ?: number }): FreeCamera {\n const p = cd.position;\n const pitch = cd.rotation?.[0] ?? 0;\n const yaw = cd.rotation?.[1] ?? 0;\n const cp = Math.cos(pitch);\n const cam = createFreeCamera({ x: p[0]!, y: p[1]!, z: p[2]! }, { x: p[0]! + cp * Math.sin(yaw), y: p[1]! - Math.sin(pitch), z: p[2]! + cp * Math.cos(yaw) });\n if (cd.fov != null) {\n cam.fov = cd.fov;\n }\n if (cd.minZ != null) {\n cam.nearPlane = cd.minZ;\n }\n if (cd.maxZ != null) {\n cam.farPlane = cd.maxZ;\n }\n return cam;\n}\n"],"names":[],"mappings":";AAIO,SAAS,mBAAmB,IAAyG;;AACxI,QAAM,IAAI,GAAG;AACb,QAAM,UAAQ,QAAG,aAAH,mBAAc,OAAM;AAClC,QAAM,QAAM,QAAG,aAAH,mBAAc,OAAM;AAChC,QAAM,KAAK,KAAK,IAAI,KAAK;AACzB,QAAM,MAAM,iBAAiB,EAAE,GAAG,EAAE,CAAC,GAAI,GAAG,EAAE,CAAC,GAAI,GAAG,EAAE,CAAC,EAAA,GAAM,EAAE,GAAG,EAAE,CAAC,IAAK,KAAK,KAAK,IAAI,GAAG,GAAG,GAAG,EAAE,CAAC,IAAK,KAAK,IAAI,KAAK,GAAG,GAAG,EAAE,CAAC,IAAK,KAAK,KAAK,IAAI,GAAG,GAAG;AAC3J,MAAI,GAAG,OAAO,MAAM;AAChB,QAAI,MAAM,GAAG;AAAA,EACjB;AACA,MAAI,GAAG,QAAQ,MAAM;AACjB,QAAI,YAAY,GAAG;AAAA,EACvB;AACA,MAAI,GAAG,QAAQ,MAAM;AACjB,QAAI,WAAW,GAAG;AAAA,EACtB;AACA,SAAO;AACX;"}
|
|
@@ -0,0 +1,491 @@
|
|
|
1
|
+
import { c1 as _registerPbrExt, c2 as PBR2_GEOMETRY_OUTPUT, G as GeometryTextureType, V as PBR_HAS_ALPHA_BLEND, c3 as PBR_HAS_ENV, c4 as _computePbrMaterialFeatures, b as writeMeshLightSelection, at as _computeMeshFeatures, a as F32, p as packMat4IntoF32, av as createUniformBuffer, c5 as collectPbrBoundTextures, ax as acquireTexture, ay as releaseTexture, z as getSceneBindGroupLayout, x as targetSignatureKey, bI as REVERSE_DEPTH_COMPARE, c6 as PBR_HAS_NORMAL_MAP, c7 as MSH_HAS_TANGENTS, aM as PBR2_HAS_UV2, c8 as MSH_HAS_UV2, c9 as MSH_HAS_VERTEX_COLOR, aD as MSH_HAS_THIN_INSTANCES, aB as MSH_HAS_INSTANCE_COLOR, ca as PBR_HAS_DOUBLE_SIDED, O as createMaterialView } from "./index-CLElg2Bo.js";
|
|
2
|
+
import { c as createPbrMeshBindGroup, _ as _writeMaterialData } from "./pbr-renderable-DzUF2QIk.js";
|
|
3
|
+
const STAGE_FRAGMENT = 2;
|
|
4
|
+
const STAGE_VERTEX = 1;
|
|
5
|
+
function needsGpUbo(attachments) {
|
|
6
|
+
for (const t of attachments) {
|
|
7
|
+
if (t === GeometryTextureType.NORMALIZED_VIEW_DEPTH || t === GeometryTextureType.LINEAR_VELOCITY) {
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
function needsVelocity(attachments) {
|
|
14
|
+
return attachments.includes(GeometryTextureType.LINEAR_VELOCITY);
|
|
15
|
+
}
|
|
16
|
+
function needsLocalPos(attachments) {
|
|
17
|
+
return attachments.includes(GeometryTextureType.LOCAL_POSITION);
|
|
18
|
+
}
|
|
19
|
+
function createPbrGeometryParamsFragment(needsParamsUbo, needsVelocityVaryings, needsLocalPosVarying) {
|
|
20
|
+
const bindings = needsParamsUbo ? [{ _name: "gp", _type: { _kind: "uniform-buffer" }, _visibility: STAGE_FRAGMENT | STAGE_VERTEX }] : [];
|
|
21
|
+
const helpers = needsParamsUbo ? `struct gpUniforms { previousViewProjection: mat4x4<f32>, cameraNearFar: vec4<f32>, };` : "";
|
|
22
|
+
const varyings = [];
|
|
23
|
+
if (needsVelocityVaryings) {
|
|
24
|
+
varyings.push({ _name: "vCurrentClip", _type: "vec4<f32>" }, { _name: "vPreviousClip", _type: "vec4<f32>" });
|
|
25
|
+
}
|
|
26
|
+
if (needsLocalPosVarying) {
|
|
27
|
+
varyings.push({ _name: "vLocalPos", _type: "vec3<f32>" });
|
|
28
|
+
}
|
|
29
|
+
const vbParts = [];
|
|
30
|
+
if (needsVelocityVaryings) {
|
|
31
|
+
vbParts.push(`out.vCurrentClip = scene.viewProjection * vec4<f32>(out.worldPos, 1.0);`);
|
|
32
|
+
vbParts.push(`out.vPreviousClip = gp.previousViewProjection * vec4<f32>(out.worldPos, 1.0);`);
|
|
33
|
+
}
|
|
34
|
+
if (needsLocalPosVarying) {
|
|
35
|
+
vbParts.push(`out.vLocalPos = position;`);
|
|
36
|
+
}
|
|
37
|
+
const slots = vbParts.length > 0 ? { VB: vbParts.join("\n") } : {};
|
|
38
|
+
return {
|
|
39
|
+
_id: "pbr-geometry-params",
|
|
40
|
+
_bindings: bindings,
|
|
41
|
+
_helperFunctions: helpers,
|
|
42
|
+
_vertexHelperFunctions: helpers,
|
|
43
|
+
_varyings: varyings,
|
|
44
|
+
_vertexSlots: slots
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
let _pbrGeomExtRegistered = false;
|
|
48
|
+
function _ensurePbrGeometryExt(getAttachments) {
|
|
49
|
+
if (_pbrGeomExtRegistered) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
_pbrGeomExtRegistered = true;
|
|
53
|
+
const ext = {
|
|
54
|
+
id: "pbr-geometry-params",
|
|
55
|
+
// Fragment-phase so bind entry is appended after all other PBR exts.
|
|
56
|
+
phase: "fragment",
|
|
57
|
+
frag(ctx) {
|
|
58
|
+
if ((ctx._features2 & PBR2_GEOMETRY_OUTPUT) === 0) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
const att = getAttachments() ?? [];
|
|
62
|
+
const wantsGp = needsGpUbo(att);
|
|
63
|
+
const wantsVelocity = needsVelocity(att);
|
|
64
|
+
const wantsLocalPos = needsLocalPos(att);
|
|
65
|
+
if (!wantsGp && !wantsVelocity && !wantsLocalPos) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
return createPbrGeometryParamsFragment(wantsGp, wantsVelocity, wantsLocalPos);
|
|
69
|
+
},
|
|
70
|
+
bind(ctx, entries, b) {
|
|
71
|
+
if ((ctx._features2 & PBR2_GEOMETRY_OUTPUT) === 0) {
|
|
72
|
+
return b;
|
|
73
|
+
}
|
|
74
|
+
const view = ctx._material;
|
|
75
|
+
if (view._gpUBO) {
|
|
76
|
+
entries.push({ binding: b++, resource: { buffer: view._gpUBO } });
|
|
77
|
+
}
|
|
78
|
+
return b;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
_registerPbrExt(ext);
|
|
82
|
+
}
|
|
83
|
+
function attachmentExpr(type, wg, hasIbl) {
|
|
84
|
+
switch (type) {
|
|
85
|
+
case GeometryTextureType.IRRADIANCE:
|
|
86
|
+
return hasIbl ? `vec4<f32>(directDiffuse + finalIrradiance, ${wg})` : `vec4<f32>(directDiffuse, ${wg})`;
|
|
87
|
+
case GeometryTextureType.WORLD_POSITION:
|
|
88
|
+
return `vec4<f32>(input.worldPos, ${wg})`;
|
|
89
|
+
case GeometryTextureType.LOCAL_POSITION:
|
|
90
|
+
return `vec4<f32>(input.vLocalPos, ${wg})`;
|
|
91
|
+
case GeometryTextureType.REFLECTIVITY:
|
|
92
|
+
return `vec4<f32>(colorF0, 1.0 - roughness) * ${wg}`;
|
|
93
|
+
case GeometryTextureType.VIEW_DEPTH:
|
|
94
|
+
return `vec4<f32>((scene.view * vec4<f32>(input.worldPos, 1.0)).z, 0.0, 0.0, ${wg})`;
|
|
95
|
+
case GeometryTextureType.NORMALIZED_VIEW_DEPTH:
|
|
96
|
+
return `vec4<f32>(((scene.view * vec4<f32>(input.worldPos, 1.0)).z - gp.cameraNearFar.x) / (gp.cameraNearFar.y - gp.cameraNearFar.x), 0.0, 0.0, ${wg})`;
|
|
97
|
+
case GeometryTextureType.SCREENSPACE_DEPTH:
|
|
98
|
+
return `vec4<f32>(input.clipPos.z, 0.0, 0.0, ${wg})`;
|
|
99
|
+
case GeometryTextureType.VIEW_NORMAL:
|
|
100
|
+
return `vec4<f32>(normalize((scene.view * vec4<f32>(N, 0.0)).xyz), ${wg})`;
|
|
101
|
+
case GeometryTextureType.WORLD_NORMAL:
|
|
102
|
+
return `vec4<f32>(N * 0.5 + vec3<f32>(0.5), ${wg})`;
|
|
103
|
+
case GeometryTextureType.ALBEDO:
|
|
104
|
+
return `vec4<f32>(surfaceAlbedo, ${wg})`;
|
|
105
|
+
case GeometryTextureType.LINEAR_VELOCITY: {
|
|
106
|
+
const cur = `(input.vCurrentClip.xy / input.vCurrentClip.w)`;
|
|
107
|
+
const prev = `(input.vPreviousClip.xy / input.vPreviousClip.w)`;
|
|
108
|
+
return `vec4<f32>(0.5 * (${prev} - ${cur}), 0.0, ${wg})`;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
function composePbrGeometryShader(composePbr, features, features2, meshFeatures, sceneFeatures, lightMode, singleLightType, esmShadowDepthCode, vbStrides, vbKey, attachments, emitColor) {
|
|
113
|
+
const geomFeatures = features & ~PBR_HAS_ALPHA_BLEND;
|
|
114
|
+
const geomFeatures2 = features2 | PBR2_GEOMETRY_OUTPUT;
|
|
115
|
+
const base = composePbr(
|
|
116
|
+
geomFeatures,
|
|
117
|
+
geomFeatures2,
|
|
118
|
+
meshFeatures,
|
|
119
|
+
sceneFeatures,
|
|
120
|
+
lightMode,
|
|
121
|
+
singleLightType,
|
|
122
|
+
esmShadowDepthCode,
|
|
123
|
+
vbStrides,
|
|
124
|
+
`${vbKey}:geom:${attachments.join(",")}:${emitColor ? "c" : ""}`
|
|
125
|
+
);
|
|
126
|
+
const hasIbl = (sceneFeatures & PBR_HAS_ENV) !== 0;
|
|
127
|
+
const fragmentSignatureFrom = "-> @location(0) vec4<f32>";
|
|
128
|
+
const fragmentSignatureTo = "-> FragmentOutput";
|
|
129
|
+
if (!base._fragmentWGSL.includes(fragmentSignatureFrom)) {
|
|
130
|
+
throw new Error("composePbrGeometryShader: PBR fragment signature mismatch — _noColorOutput/_esmShadowOutput should be off");
|
|
131
|
+
}
|
|
132
|
+
let frag = base._fragmentWGSL.replace(fragmentSignatureFrom, fragmentSignatureTo);
|
|
133
|
+
const colorSlot = attachments.length;
|
|
134
|
+
const extraColorLine = emitColor ? `
|
|
135
|
+
@location(${colorSlot}) color: vec4<f32>,` : "";
|
|
136
|
+
const outputStruct = `struct FragmentOutput {
|
|
137
|
+
${attachments.map((_, i) => `@location(${i}) f${i}: vec4<f32>,`).join("\n")}${extraColorLine}
|
|
138
|
+
};
|
|
139
|
+
`;
|
|
140
|
+
frag = frag.replace("@fragment fn main", `${outputStruct}@fragment fn main`);
|
|
141
|
+
const wg = `select(0.0, 1.0, alpha > 0.4)`;
|
|
142
|
+
const writes = attachments.map((type, i) => `out.f${i} = ${attachmentExpr(type, wg, hasIbl)};`).join("\n");
|
|
143
|
+
const extraColorWrite = emitColor ? `
|
|
144
|
+
out.color = vec4<f32>(color, alpha * material.materialAlpha);` : "";
|
|
145
|
+
const replacement = `var out: FragmentOutput;
|
|
146
|
+
${writes}${extraColorWrite}
|
|
147
|
+
return out;`;
|
|
148
|
+
const returnPattern = "return vec4<f32>(color,alpha*material.materialAlpha);";
|
|
149
|
+
if (!frag.includes(returnPattern)) {
|
|
150
|
+
throw new Error("composePbrGeometryShader: alpha-block return statement not found — template changed?");
|
|
151
|
+
}
|
|
152
|
+
frag = frag.replace(returnPattern, replacement);
|
|
153
|
+
return { ...base, _fragmentWGSL: frag };
|
|
154
|
+
}
|
|
155
|
+
const pbrGeometryGroupBuilder = (async () => {
|
|
156
|
+
throw new Error("pbr-geometry view does not support scene group building");
|
|
157
|
+
});
|
|
158
|
+
pbrGeometryGroupBuilder._rebuildSingle = (scene, mesh, materialOverride) => {
|
|
159
|
+
const view = materialOverride ?? mesh.material;
|
|
160
|
+
return buildPbrGeometryRenderable(scene, mesh, view);
|
|
161
|
+
};
|
|
162
|
+
pbrGeometryGroupBuilder._materialFamily = "pbr";
|
|
163
|
+
function _variantKey(meshFeatures, lightMode, singleLightType) {
|
|
164
|
+
return `${meshFeatures}:${lightMode}:${singleLightType}`;
|
|
165
|
+
}
|
|
166
|
+
function buildPbrGeometryRenderable(scene, mesh, view) {
|
|
167
|
+
var _a, _b;
|
|
168
|
+
const engine = scene.surface.engine;
|
|
169
|
+
const device = engine._device;
|
|
170
|
+
const ctx = scene._pbrGeomContext;
|
|
171
|
+
if (!ctx) {
|
|
172
|
+
throw new Error("buildPbrGeometryRenderable: scene has no PBR context. Ensure regular PBR meshes have been built before recording the geometry task.");
|
|
173
|
+
}
|
|
174
|
+
const source = view.source;
|
|
175
|
+
if (!source._renderFeatures) {
|
|
176
|
+
source._renderFeatures = _computePbrMaterialFeatures(source);
|
|
177
|
+
}
|
|
178
|
+
const lr = writeMeshLightSelection(mesh, scene.lights);
|
|
179
|
+
const lightCount = lr > 0 ? 1 : -lr;
|
|
180
|
+
const hasSomeShadows = ctx._shadowLights.length > 0;
|
|
181
|
+
const receiveShadows = mesh.receiveShadows && hasSomeShadows;
|
|
182
|
+
const lightMode = lightCount === 0 ? 0 : lightCount === 1 && !receiveShadows ? 1 : 2;
|
|
183
|
+
const singleLightType = lightMode === 1 ? _getPackedSingleLightType(scene.lights, lr - 1) : "";
|
|
184
|
+
const meshFeatures = _computeMeshFeatures(mesh, receiveShadows);
|
|
185
|
+
const variantKey = _variantKey(meshFeatures, lightMode, singleLightType);
|
|
186
|
+
const res = _ensureViewResources(view, engine, ctx, meshFeatures, lightMode, singleLightType, variantKey);
|
|
187
|
+
const features = res._features;
|
|
188
|
+
const features2 = res._features2;
|
|
189
|
+
const composed = res._composed;
|
|
190
|
+
const meshUboData = new F32(composed._meshUboSpec._totalBytes / 4);
|
|
191
|
+
const _packMeshWorld = ((_a = engine._makePackMeshWorld) == null ? void 0 : _a.call(engine, scene)) ?? packMat4IntoF32;
|
|
192
|
+
_packMeshWorld(meshUboData, mesh.worldMatrix, 0, 0);
|
|
193
|
+
writeMeshLightSelection(mesh, scene.lights, meshUboData);
|
|
194
|
+
const meshUBO = createUniformBuffer(engine, meshUboData);
|
|
195
|
+
const materialSpec = composed._materialUboSpec;
|
|
196
|
+
const matInitData = new F32(materialSpec._totalBytes / 4);
|
|
197
|
+
_writePbrMaterialData(matInitData, source, materialSpec);
|
|
198
|
+
const materialUBO = createUniformBuffer(engine, matInitData);
|
|
199
|
+
const prev = _setActivePbrGeometryAttachments(view._geometryAttachments);
|
|
200
|
+
let materialBindGroupStatic;
|
|
201
|
+
try {
|
|
202
|
+
materialBindGroupStatic = createPbrMeshBindGroup(engine, _wrapBindings(res), composed, meshUBO, materialUBO, view, ctx._envTextures, mesh);
|
|
203
|
+
} finally {
|
|
204
|
+
_setActivePbrGeometryAttachments(prev);
|
|
205
|
+
}
|
|
206
|
+
let shadowBindGroup = null;
|
|
207
|
+
if (receiveShadows && res._shadowBGL) {
|
|
208
|
+
const entries = [];
|
|
209
|
+
let b = 0;
|
|
210
|
+
for (const sl of ctx._shadowLights) {
|
|
211
|
+
const sg = sl.gen;
|
|
212
|
+
entries.push({ binding: b++, resource: sg._depthTexture.createView() });
|
|
213
|
+
entries.push({ binding: b++, resource: sg._depthSampler });
|
|
214
|
+
entries.push({ binding: b++, resource: { buffer: sg._shadowUBO } });
|
|
215
|
+
}
|
|
216
|
+
shadowBindGroup = device.createBindGroup({ layout: res._shadowBGL, entries });
|
|
217
|
+
}
|
|
218
|
+
const boundTextures = collectPbrBoundTextures(source);
|
|
219
|
+
for (const t of boundTextures) {
|
|
220
|
+
acquireTexture(t);
|
|
221
|
+
}
|
|
222
|
+
const prevDisposables = scene._meshDisposables.get(mesh) ?? [];
|
|
223
|
+
scene._meshDisposables.set(mesh, [
|
|
224
|
+
...prevDisposables,
|
|
225
|
+
() => {
|
|
226
|
+
meshUBO.destroy();
|
|
227
|
+
materialUBO.destroy();
|
|
228
|
+
},
|
|
229
|
+
() => {
|
|
230
|
+
for (const t of boundTextures) {
|
|
231
|
+
releaseTexture(t);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
]);
|
|
235
|
+
const hasNormalMap = (features & PBR_HAS_NORMAL_MAP) !== 0 && (meshFeatures & MSH_HAS_TANGENTS) !== 0;
|
|
236
|
+
const hasUV2 = (features2 & PBR2_HAS_UV2) !== 0 && (meshFeatures & MSH_HAS_UV2) !== 0;
|
|
237
|
+
const hasVertexColor = (meshFeatures & MSH_HAS_VERTEX_COLOR) !== 0;
|
|
238
|
+
const hasTI = (meshFeatures & MSH_HAS_THIN_INSTANCES) !== 0;
|
|
239
|
+
const hasTIColor = (meshFeatures & MSH_HAS_INSTANCE_COLOR) !== 0;
|
|
240
|
+
const syncThinInstanceBuffers = ctx._syncThinInstanceBuffers;
|
|
241
|
+
const isAlphaBlend = res._alphaBlend;
|
|
242
|
+
const sortCenter = [mesh.worldMatrix[12], mesh.worldMatrix[13], mesh.worldMatrix[14]];
|
|
243
|
+
let _lastWorldVersion = mesh.worldMatrixVersion;
|
|
244
|
+
let _lastLightsCount = scene.lights.length;
|
|
245
|
+
let _lastUboVersion = source._uboVersion;
|
|
246
|
+
const matScratch = new F32(materialSpec._totalBytes / 4);
|
|
247
|
+
const _baseUpdate = () => {
|
|
248
|
+
if (mesh.worldMatrixVersion !== _lastWorldVersion || scene.lights.length !== _lastLightsCount) {
|
|
249
|
+
sortCenter[0] = mesh.worldMatrix[12];
|
|
250
|
+
sortCenter[1] = mesh.worldMatrix[13];
|
|
251
|
+
sortCenter[2] = mesh.worldMatrix[14];
|
|
252
|
+
_packMeshWorld(meshUboData, mesh.worldMatrix, 0, 0);
|
|
253
|
+
writeMeshLightSelection(mesh, scene.lights, meshUboData);
|
|
254
|
+
device.queue.writeBuffer(meshUBO, 0, meshUboData);
|
|
255
|
+
_lastWorldVersion = mesh.worldMatrixVersion;
|
|
256
|
+
_lastLightsCount = scene.lights.length;
|
|
257
|
+
}
|
|
258
|
+
if (source._uboVersion !== _lastUboVersion) {
|
|
259
|
+
_lastUboVersion = source._uboVersion;
|
|
260
|
+
matScratch.fill(0);
|
|
261
|
+
_writePbrMaterialData(matScratch, source, materialSpec);
|
|
262
|
+
device.queue.writeBuffer(materialUBO, 0, matScratch.buffer, 0, matScratch.byteLength);
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
const _invalidate = () => {
|
|
266
|
+
_lastWorldVersion = -1;
|
|
267
|
+
};
|
|
268
|
+
const update = ((_b = engine._wrapRenderableForFO) == null ? void 0 : _b.call(engine, _baseUpdate, scene, _invalidate)) ?? _baseUpdate;
|
|
269
|
+
const draw = (pass) => {
|
|
270
|
+
var _a2, _b2, _c, _d, _e, _f;
|
|
271
|
+
if (mesh.visible === false) {
|
|
272
|
+
return 0;
|
|
273
|
+
}
|
|
274
|
+
const gpu = mesh._gpu;
|
|
275
|
+
pass.setBindGroup(1, materialBindGroupStatic);
|
|
276
|
+
if (shadowBindGroup) {
|
|
277
|
+
pass.setBindGroup(2, shadowBindGroup);
|
|
278
|
+
}
|
|
279
|
+
let slot = 0;
|
|
280
|
+
const vb = gpu._vbLayout;
|
|
281
|
+
pass.setVertexBuffer(slot++, gpu.positionBuffer, (_a2 = vb == null ? void 0 : vb._p) == null ? void 0 : _a2._offset);
|
|
282
|
+
pass.setVertexBuffer(slot++, gpu.normalBuffer, (_b2 = vb == null ? void 0 : vb._n) == null ? void 0 : _b2._offset);
|
|
283
|
+
if (hasNormalMap && gpu.tangentBuffer) {
|
|
284
|
+
pass.setVertexBuffer(slot++, gpu.tangentBuffer, (_c = vb == null ? void 0 : vb._t) == null ? void 0 : _c._offset);
|
|
285
|
+
}
|
|
286
|
+
pass.setVertexBuffer(slot++, gpu.uvBuffer, (_d = vb == null ? void 0 : vb._u) == null ? void 0 : _d._offset);
|
|
287
|
+
if (hasUV2 && gpu.uv2Buffer) {
|
|
288
|
+
pass.setVertexBuffer(slot++, gpu.uv2Buffer, (_e = vb == null ? void 0 : vb._u2) == null ? void 0 : _e._offset);
|
|
289
|
+
}
|
|
290
|
+
if (hasVertexColor && gpu.colorBuffer) {
|
|
291
|
+
pass.setVertexBuffer(slot++, gpu.colorBuffer, (_f = vb == null ? void 0 : vb._c) == null ? void 0 : _f._offset);
|
|
292
|
+
}
|
|
293
|
+
const skin = mesh.skeleton ?? mesh.vat;
|
|
294
|
+
if (skin) {
|
|
295
|
+
pass.setVertexBuffer(slot++, skin.jointsBuffer);
|
|
296
|
+
pass.setVertexBuffer(slot++, skin.weightsBuffer);
|
|
297
|
+
if (skin.joints1Buffer && skin.weights1Buffer) {
|
|
298
|
+
pass.setVertexBuffer(slot++, skin.joints1Buffer);
|
|
299
|
+
pass.setVertexBuffer(slot++, skin.weights1Buffer);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
const ti = hasTI ? mesh.thinInstances : null;
|
|
303
|
+
if (ti && syncThinInstanceBuffers) {
|
|
304
|
+
slot = syncThinInstanceBuffers(engine, ti, pass, slot, hasTIColor);
|
|
305
|
+
}
|
|
306
|
+
pass.setIndexBuffer(gpu.indexBuffer, gpu.indexFormat);
|
|
307
|
+
if (ti && ti.count > 0) {
|
|
308
|
+
pass.drawIndexed(gpu.indexCount, ti.count);
|
|
309
|
+
} else {
|
|
310
|
+
pass.drawIndexed(gpu.indexCount);
|
|
311
|
+
}
|
|
312
|
+
return 1;
|
|
313
|
+
};
|
|
314
|
+
const r = {
|
|
315
|
+
order: mesh.renderOrder ?? (isAlphaBlend ? 200 : 100),
|
|
316
|
+
isTransparent: isAlphaBlend,
|
|
317
|
+
mesh,
|
|
318
|
+
bind(eng, sig) {
|
|
319
|
+
return {
|
|
320
|
+
renderable: r,
|
|
321
|
+
pipeline: _getOrCreateGeometryPipeline(eng, sig, view, res),
|
|
322
|
+
update,
|
|
323
|
+
draw
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
r._worldCenter = sortCenter;
|
|
328
|
+
return r;
|
|
329
|
+
}
|
|
330
|
+
function _ensureViewResources(view, engine, ctx, meshFeatures, lightMode, singleLightType, variantKey) {
|
|
331
|
+
var _a, _b;
|
|
332
|
+
let cache = view._geometry;
|
|
333
|
+
if (!cache) {
|
|
334
|
+
cache = /* @__PURE__ */ new Map();
|
|
335
|
+
Object.defineProperty(view, "_geometry", { value: cache, enumerable: false, configurable: true });
|
|
336
|
+
}
|
|
337
|
+
const cached = cache.get(variantKey);
|
|
338
|
+
if (cached) {
|
|
339
|
+
return cached;
|
|
340
|
+
}
|
|
341
|
+
_ensurePbrGeometryExt(() => view._geometryAttachments);
|
|
342
|
+
const features = view._renderFeatures.features;
|
|
343
|
+
const features2 = view._renderFeatures.features2 ?? 0;
|
|
344
|
+
const sceneFeatures = ctx._sceneFeatures;
|
|
345
|
+
const source = view.source;
|
|
346
|
+
const vbLayout = source._vbLayout;
|
|
347
|
+
const vbKey = "";
|
|
348
|
+
const prev = _setActivePbrGeometryAttachments(view._geometryAttachments);
|
|
349
|
+
let composed;
|
|
350
|
+
try {
|
|
351
|
+
composed = composePbrGeometryShader(
|
|
352
|
+
ctx._composePbr,
|
|
353
|
+
features,
|
|
354
|
+
features2,
|
|
355
|
+
meshFeatures,
|
|
356
|
+
sceneFeatures,
|
|
357
|
+
lightMode,
|
|
358
|
+
singleLightType,
|
|
359
|
+
"",
|
|
360
|
+
vbLayout,
|
|
361
|
+
vbKey,
|
|
362
|
+
view._geometryAttachments,
|
|
363
|
+
view._emitColor
|
|
364
|
+
);
|
|
365
|
+
} finally {
|
|
366
|
+
_setActivePbrGeometryAttachments(prev);
|
|
367
|
+
}
|
|
368
|
+
const device = engine._device;
|
|
369
|
+
const meshBGL = device.createBindGroupLayout(composed._meshBGLDescriptor);
|
|
370
|
+
const shadowBGL = composed._shadowBGLDescriptor ? device.createBindGroupLayout(composed._shadowBGLDescriptor) : null;
|
|
371
|
+
const sceneBGL = ((_a = engine._getSceneBGL) == null ? void 0 : _a.call(engine)) ?? _getSceneBindGroupLayoutLocal(engine);
|
|
372
|
+
const bgls = shadowBGL ? [sceneBGL, meshBGL, shadowBGL] : [sceneBGL, meshBGL];
|
|
373
|
+
const pipelineLayout = device.createPipelineLayout({ bindGroupLayouts: bgls });
|
|
374
|
+
const vertModule = device.createShaderModule({ code: composed._vertexWGSL });
|
|
375
|
+
const fragModule = device.createShaderModule({ code: composed._fragmentWGSL });
|
|
376
|
+
const sourceFeatures = ((_b = source._renderFeatures) == null ? void 0 : _b.features) ?? 0;
|
|
377
|
+
const alphaBlend = (sourceFeatures & PBR_HAS_ALPHA_BLEND) !== 0;
|
|
378
|
+
const res = {
|
|
379
|
+
_composed: composed,
|
|
380
|
+
_features: features,
|
|
381
|
+
_features2: features2,
|
|
382
|
+
_meshFeatures: meshFeatures,
|
|
383
|
+
_sceneFeatures: sceneFeatures,
|
|
384
|
+
_meshBGL: meshBGL,
|
|
385
|
+
_shadowBGL: shadowBGL,
|
|
386
|
+
_pipelineLayout: pipelineLayout,
|
|
387
|
+
_vertModule: vertModule,
|
|
388
|
+
_fragModule: fragModule,
|
|
389
|
+
_pipelines: /* @__PURE__ */ new Map(),
|
|
390
|
+
_alphaBlend: alphaBlend
|
|
391
|
+
};
|
|
392
|
+
cache.set(variantKey, res);
|
|
393
|
+
return res;
|
|
394
|
+
}
|
|
395
|
+
function _wrapBindings(res) {
|
|
396
|
+
return {
|
|
397
|
+
_features: res._features,
|
|
398
|
+
_features2: res._features2,
|
|
399
|
+
_meshFeatures: res._meshFeatures,
|
|
400
|
+
_meshBGL: res._meshBGL,
|
|
401
|
+
_shadowBGL: res._shadowBGL,
|
|
402
|
+
_composed: res._composed,
|
|
403
|
+
_pipelines: res._pipelines
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
function _getSceneBindGroupLayoutLocal(engine, _composed) {
|
|
407
|
+
return getSceneBindGroupLayout(engine);
|
|
408
|
+
}
|
|
409
|
+
function _getOrCreateGeometryPipeline(engine, sig, view, res) {
|
|
410
|
+
var _a;
|
|
411
|
+
const key = targetSignatureKey(sig);
|
|
412
|
+
const cached = res._pipelines.get(key);
|
|
413
|
+
if (cached) {
|
|
414
|
+
return cached;
|
|
415
|
+
}
|
|
416
|
+
const device = engine._device;
|
|
417
|
+
const formats = sig._colorFormats ?? (sig._colorFormat ? [sig._colorFormat] : []);
|
|
418
|
+
if (formats.length === 0) {
|
|
419
|
+
throw new Error("pbr-geometry: render target has no color attachments");
|
|
420
|
+
}
|
|
421
|
+
const alphaBlend = res._alphaBlend;
|
|
422
|
+
const blendState = alphaBlend ? {
|
|
423
|
+
color: { srcFactor: "src-alpha", dstFactor: "one-minus-src-alpha", operation: "add" },
|
|
424
|
+
alpha: { srcFactor: "src-alpha", dstFactor: "one-minus-src-alpha", operation: "add" }
|
|
425
|
+
} : void 0;
|
|
426
|
+
const colorTargets = formats.map((fmt) => blendState ? { format: fmt, blend: blendState } : { format: fmt });
|
|
427
|
+
const sourceFeatures = ((_a = view.source._renderFeatures) == null ? void 0 : _a.features) ?? 0;
|
|
428
|
+
const hasDoubleSided = (sourceFeatures & PBR_HAS_DOUBLE_SIDED) !== 0;
|
|
429
|
+
const cullMode = hasDoubleSided ? "none" : view._reverseCulling ? "front" : "back";
|
|
430
|
+
const pipeline = device.createRenderPipeline({
|
|
431
|
+
layout: res._pipelineLayout,
|
|
432
|
+
vertex: { module: res._vertModule, entryPoint: "main", buffers: res._composed._vertexBufferLayouts },
|
|
433
|
+
fragment: { module: res._fragModule, entryPoint: "main", targets: colorTargets },
|
|
434
|
+
depthStencil: sig._depthStencilFormat ? {
|
|
435
|
+
format: sig._depthStencilFormat,
|
|
436
|
+
depthCompare: sig._depthCompare ?? REVERSE_DEPTH_COMPARE,
|
|
437
|
+
// Disable depth-write for alpha-blended meshes so background
|
|
438
|
+
// depth survives partially-transparent pixels. Matches the
|
|
439
|
+
// Standard geometry-renderable behaviour.
|
|
440
|
+
depthWriteEnabled: !alphaBlend
|
|
441
|
+
} : void 0,
|
|
442
|
+
multisample: { count: sig._sampleCount },
|
|
443
|
+
primitive: { topology: "triangle-list", cullMode, frontFace: "ccw" }
|
|
444
|
+
});
|
|
445
|
+
res._pipelines.set(key, pipeline);
|
|
446
|
+
return pipeline;
|
|
447
|
+
}
|
|
448
|
+
function _getPackedSingleLightType(lights, packedIndex) {
|
|
449
|
+
let packed = 0;
|
|
450
|
+
for (const light of lights) {
|
|
451
|
+
if (!light._writeLightUbo) {
|
|
452
|
+
continue;
|
|
453
|
+
}
|
|
454
|
+
if (packed === packedIndex) {
|
|
455
|
+
const t = light.lightType;
|
|
456
|
+
return t === "hemispheric" || t === "directional" || t === "spot" ? t : "point";
|
|
457
|
+
}
|
|
458
|
+
packed++;
|
|
459
|
+
}
|
|
460
|
+
return "point";
|
|
461
|
+
}
|
|
462
|
+
function _writePbrMaterialData(data, mat, spec) {
|
|
463
|
+
_writeMaterialData(data, mat, spec);
|
|
464
|
+
}
|
|
465
|
+
let _activeAttachments;
|
|
466
|
+
function _setActivePbrGeometryAttachments(att) {
|
|
467
|
+
const prev = _activeAttachments;
|
|
468
|
+
_activeAttachments = att;
|
|
469
|
+
return prev;
|
|
470
|
+
}
|
|
471
|
+
function createPbrGeometryMaterialView(source, config) {
|
|
472
|
+
var _a, _b;
|
|
473
|
+
_ensurePbrGeometryExt(() => _activeAttachments);
|
|
474
|
+
const baseFeatures = ((_a = source._renderFeatures) == null ? void 0 : _a.features) ?? 0;
|
|
475
|
+
const baseFeatures2 = ((_b = source._renderFeatures) == null ? void 0 : _b.features2) ?? 0;
|
|
476
|
+
const view = createMaterialView(source, {
|
|
477
|
+
features: baseFeatures & ~PBR_HAS_ALPHA_BLEND,
|
|
478
|
+
features2: baseFeatures2 | PBR2_GEOMETRY_OUTPUT
|
|
479
|
+
});
|
|
480
|
+
Object.defineProperty(view, "_geometryAttachments", { value: config.attachments, enumerable: false });
|
|
481
|
+
Object.defineProperty(view, "_emitColor", { value: config.emitColor, enumerable: false });
|
|
482
|
+
Object.defineProperty(view, "_gpUBO", { value: config.gpUBO ?? null, enumerable: false });
|
|
483
|
+
Object.defineProperty(view, "_reverseCulling", { value: config.reverseCulling ?? false, enumerable: false });
|
|
484
|
+
Object.defineProperty(view, "_buildGroup", { value: pbrGeometryGroupBuilder, enumerable: false });
|
|
485
|
+
return view;
|
|
486
|
+
}
|
|
487
|
+
export {
|
|
488
|
+
_setActivePbrGeometryAttachments,
|
|
489
|
+
createPbrGeometryMaterialView
|
|
490
|
+
};
|
|
491
|
+
//# sourceMappingURL=pbr-geometry-view-NiZY_juX.js.map
|