@babylonjs/lite 0.1.1
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/_math-factory-C-QqW-Wi.js +55 -0
- package/_math-factory-C-QqW-Wi.js.map +1 -0
- package/add-block-CikX5gWy.js +6 -0
- package/add-block-CikX5gWy.js.map +1 -0
- package/alpha-test-fragment-CUiHCw7W.js +22 -0
- package/alpha-test-fragment-CUiHCw7W.js.map +1 -0
- package/ambient-occlusion-block-DForhWL3.js +77 -0
- package/ambient-occlusion-block-DForhWL3.js.map +1 -0
- package/anisotropy-block-D5fXH_OY.js +12 -0
- package/anisotropy-block-D5fXH_OY.js.map +1 -0
- package/anisotropy-fragment-HgasXS7l.js +89 -0
- package/anisotropy-fragment-HgasXS7l.js.map +1 -0
- package/arc-tan2-block-d8sWt_x0.js +12 -0
- package/arc-tan2-block-d8sWt_x0.js.map +1 -0
- package/assets/splat-sort-worker-Crg3CaCc.js.map +1 -0
- package/background-dds-skybox-yHTqabU3.js +221 -0
- package/background-dds-skybox-yHTqabU3.js.map +1 -0
- package/background-ground-DIw6D3qf.js +235 -0
- package/background-ground-DIw6D3qf.js.map +1 -0
- package/background-hdr-skybox-c4uuTmkP.js +179 -0
- package/background-hdr-skybox-c4uuTmkP.js.map +1 -0
- package/background-solid-skybox-DPGBpPbm.js +235 -0
- package/background-solid-skybox-DPGBpPbm.js.map +1 -0
- package/bake-local-matrix-Dfpd3b06.js +28 -0
- package/bake-local-matrix-Dfpd3b06.js.map +1 -0
- package/billboard-renderable-D8mlVGCd.js +242 -0
- package/billboard-renderable-D8mlVGCd.js.map +1 -0
- package/biplanar-block-DZnKuV81.js +115 -0
- package/biplanar-block-DZnKuV81.js.map +1 -0
- package/bones-block-D6IhqUVV.js +31 -0
- package/bones-block-D6IhqUVV.js.map +1 -0
- package/clamp-block-BdII67hT.js +21 -0
- package/clamp-block-BdII67hT.js.map +1 -0
- package/clearcoat-block-BGML4npi.js +12 -0
- package/clearcoat-block-BGML4npi.js.map +1 -0
- package/clearcoat-fragment-LCiG98Rf.js +256 -0
- package/clearcoat-fragment-LCiG98Rf.js.map +1 -0
- package/clip-planes-block-BPfFJrbf.js +26 -0
- package/clip-planes-block-BPfFJrbf.js.map +1 -0
- package/cloud-block-BeVrangc.js +90 -0
- package/cloud-block-BeVrangc.js.map +1 -0
- package/color-converter-block-CvwKiW4k.js +123 -0
- package/color-converter-block-CvwKiW4k.js.map +1 -0
- package/color-merger-CCu21ZII.js +57 -0
- package/color-merger-CCu21ZII.js.map +1 -0
- package/color-splitter-CGn1G4ow.js +33 -0
- package/color-splitter-CGn1G4ow.js.map +1 -0
- package/conditional-block-Cd2pbejI.js +51 -0
- package/conditional-block-Cd2pbejI.js.map +1 -0
- package/create-skeleton-C9JdIJnb.js +44 -0
- package/create-skeleton-C9JdIJnb.js.map +1 -0
- package/cross-block-DCrLwCpt.js +12 -0
- package/cross-block-DCrLwCpt.js.map +1 -0
- package/cubemap-skybox-material-DvXMVc4k.js +79 -0
- package/cubemap-skybox-material-DvXMVc4k.js.map +1 -0
- package/curve-block-BlJpXVYv.js +89 -0
- package/curve-block-BlJpXVYv.js.map +1 -0
- package/debug-block-D2pg4Yf6.js +14 -0
- package/debug-block-D2pg4Yf6.js.map +1 -0
- package/derivative-block-B8KjtaWs.js +20 -0
- package/derivative-block-B8KjtaWs.js.map +1 -0
- package/desaturate-block-C1RghNSB.js +15 -0
- package/desaturate-block-C1RghNSB.js.map +1 -0
- package/discard-block-B2jKjaEL.js +21 -0
- package/discard-block-B2jKjaEL.js.map +1 -0
- package/distance-block-3NkgFZ3f.js +16 -0
- package/distance-block-3NkgFZ3f.js.map +1 -0
- package/divide-block-ZyepIg_-.js +6 -0
- package/divide-block-ZyepIg_-.js.map +1 -0
- package/dot-block-VlfAC6cD.js +16 -0
- package/dot-block-VlfAC6cD.js.map +1 -0
- package/elbow-block-NEOiIxzO.js +10 -0
- package/elbow-block-NEOiIxzO.js.map +1 -0
- package/emissive-fragment-BnNvbBCw.js +39 -0
- package/emissive-fragment-BnNvbBCw.js.map +1 -0
- package/esm-shadow-view-DGKdF1NI.js +18 -0
- package/esm-shadow-view-DGKdF1NI.js.map +1 -0
- package/esm-shadow-view-DN9HIaM4.js +15 -0
- package/esm-shadow-view-DN9HIaM4.js.map +1 -0
- package/esm-shadow-view-Dk9NFtLq.js +15 -0
- package/esm-shadow-view-Dk9NFtLq.js.map +1 -0
- package/fog-block-DJ9hEolm.js +41 -0
- package/fog-block-DJ9hEolm.js.map +1 -0
- package/frag-coord-block-DzXfFgfV.js +25 -0
- package/frag-coord-block-DzXfFgfV.js.map +1 -0
- package/frag-depth-block-UQbeKP2D.js +34 -0
- package/frag-depth-block-UQbeKP2D.js.map +1 -0
- package/fragment-output-BOphkIeh.js +26 -0
- package/fragment-output-BOphkIeh.js.map +1 -0
- package/fresnel-block-DefHWeO-.js +20 -0
- package/fresnel-block-DefHWeO-.js.map +1 -0
- package/front-facing-0d6aiyrv.js +11 -0
- package/front-facing-0d6aiyrv.js.map +1 -0
- package/gaussian-splatting-pipeline-sh-DgJl7l56.js +500 -0
- package/gaussian-splatting-pipeline-sh-DgJl7l56.js.map +1 -0
- package/gltf-animation-D7uyTyO3.js +245 -0
- package/gltf-animation-D7uyTyO3.js.map +1 -0
- package/gltf-ext-anisotropy-CknJiJK8.js +22 -0
- package/gltf-ext-anisotropy-CknJiJK8.js.map +1 -0
- package/gltf-ext-basisu-CPg5kPrx.js +452 -0
- package/gltf-ext-basisu-CPg5kPrx.js.map +1 -0
- package/gltf-ext-clearcoat-CLH2SVph.js +31 -0
- package/gltf-ext-clearcoat-CLH2SVph.js.map +1 -0
- package/gltf-ext-dielectric-qHzlnvdl.js +105 -0
- package/gltf-ext-dielectric-qHzlnvdl.js.map +1 -0
- package/gltf-ext-emissive-strength-nzGZXZVK.js +19 -0
- package/gltf-ext-emissive-strength-nzGZXZVK.js.map +1 -0
- package/gltf-ext-iridescence-C6bq7jiM.js +26 -0
- package/gltf-ext-iridescence-C6bq7jiM.js.map +1 -0
- package/gltf-ext-node-visibility-MafA9ot2.js +25 -0
- package/gltf-ext-node-visibility-MafA9ot2.js.map +1 -0
- package/gltf-ext-orm-CT18G_vQ.js +33 -0
- package/gltf-ext-orm-CT18G_vQ.js.map +1 -0
- package/gltf-ext-quantization-CpZyLDIz.js +94 -0
- package/gltf-ext-quantization-CpZyLDIz.js.map +1 -0
- package/gltf-ext-sheen-BgIxUzyZ.js +25 -0
- package/gltf-ext-sheen-BgIxUzyZ.js.map +1 -0
- package/gltf-ext-spec-gloss-D0LJLBUM.js +24 -0
- package/gltf-ext-spec-gloss-D0LJLBUM.js.map +1 -0
- package/gltf-ext-unlit-D2ANui0V.js +16 -0
- package/gltf-ext-unlit-D2ANui0V.js.map +1 -0
- package/gltf-ext-uv-transform-CE_-T1Tr.js +38 -0
- package/gltf-ext-uv-transform-CE_-T1Tr.js.map +1 -0
- package/gltf-feature-animation-pointer-BjpwOOqo.js +88 -0
- package/gltf-feature-animation-pointer-BjpwOOqo.js.map +1 -0
- package/gltf-feature-animations-CCizegp8.js +15 -0
- package/gltf-feature-animations-CCizegp8.js.map +1 -0
- package/gltf-feature-draco-yGSMGTE3.js +124 -0
- package/gltf-feature-draco-yGSMGTE3.js.map +1 -0
- package/gltf-feature-gpu-instancing-2e_CFQnl.js +151 -0
- package/gltf-feature-gpu-instancing-2e_CFQnl.js.map +1 -0
- package/gltf-feature-lights-punctual-DDDg4j0U.js +71 -0
- package/gltf-feature-lights-punctual-DDDg4j0U.js.map +1 -0
- package/gltf-feature-meshopt-Des96YFI.js +84 -0
- package/gltf-feature-meshopt-Des96YFI.js.map +1 -0
- package/gltf-feature-morph-CKCw6tkX.js +29 -0
- package/gltf-feature-morph-CKCw6tkX.js.map +1 -0
- package/gltf-feature-skeleton-D8hWLqi2.js +36 -0
- package/gltf-feature-skeleton-D8hWLqi2.js.map +1 -0
- package/gltf-feature-variants-Ds6v9byg.js +17 -0
- package/gltf-feature-variants-Ds6v9byg.js.map +1 -0
- package/gltf-feature-xmp-BUfq_IVG.js +15 -0
- package/gltf-feature-xmp-BUfq_IVG.js.map +1 -0
- package/gltf-glb-parser-D6UZWFuC.js +27 -0
- package/gltf-glb-parser-D6UZWFuC.js.map +1 -0
- package/gltf-interleave-DGnUlz28.js +241 -0
- package/gltf-interleave-DGnUlz28.js.map +1 -0
- package/gltf-pbr-builder-ext-BFOxOCnQ.js +85 -0
- package/gltf-pbr-builder-ext-BFOxOCnQ.js.map +1 -0
- package/gltf-variants-DFbr8EES.js +88 -0
- package/gltf-variants-DFbr8EES.js.map +1 -0
- package/gradient-block-DL_60sDc.js +50 -0
- package/gradient-block-DL_60sDc.js.map +1 -0
- package/gs-picking-pipeline-DzfMASL9.js +280 -0
- package/gs-picking-pipeline-DzfMASL9.js.map +1 -0
- package/height-to-normal-block-DhPHkDFg.js +65 -0
- package/height-to-normal-block-DhPHkDFg.js.map +1 -0
- package/ibl-fragment-DqQVi8k0.js +91 -0
- package/ibl-fragment-DqQVi8k0.js.map +1 -0
- package/ibl-skybox-wgsl-DCah0kWV.js +13 -0
- package/ibl-skybox-wgsl-DCah0kWV.js.map +1 -0
- package/image-processing-block-DwrhhmuF.js +40 -0
- package/image-processing-block-DwrhhmuF.js.map +1 -0
- package/image-source-BuMJgd9-.js +17 -0
- package/image-source-BuMJgd9-.js.map +1 -0
- package/index-C8HOR2sB.js +19222 -0
- package/index-C8HOR2sB.js.map +1 -0
- package/index.d.ts +4611 -0
- package/index.js +309 -0
- package/index.js.map +1 -0
- package/input-block-DgAJBzN_.js +109 -0
- package/input-block-DgAJBzN_.js.map +1 -0
- package/instances-block-BaSSiz8m.js +12 -0
- package/instances-block-BaSSiz8m.js.map +1 -0
- package/iridescence-block-B0pRFoOU.js +67 -0
- package/iridescence-block-B0pRFoOU.js.map +1 -0
- package/iridescence-fragment-Gymp7or5.js +243 -0
- package/iridescence-fragment-Gymp7or5.js.map +1 -0
- package/length-block-ChOkeiHR.js +11 -0
- package/length-block-ChOkeiHR.js.map +1 -0
- package/lerp-block-DjI2SfmI.js +18 -0
- package/lerp-block-DjI2SfmI.js.map +1 -0
- package/light-block-B11ew7FA.js +123 -0
- package/light-block-B11ew7FA.js.map +1 -0
- package/light-information-VJbW0jbs.js +19 -0
- package/light-information-VJbW0jbs.js.map +1 -0
- package/loop-block-Bb23EOMb.js +71 -0
- package/loop-block-Bb23EOMb.js.map +1 -0
- package/manifold-AS8POaOr.js +3022 -0
- package/manifold-AS8POaOr.js.map +1 -0
- package/manifold-RCa7RkKz.js +5 -0
- package/manifold-RCa7RkKz.js.map +1 -0
- package/matrix-blocks-acWn_V6g.js +51 -0
- package/matrix-blocks-acWn_V6g.js.map +1 -0
- package/max-block-CjFgljZ7.js +6 -0
- package/max-block-CjFgljZ7.js.map +1 -0
- package/mesh-attribute-exists-block-BfK8UiSL.js +44 -0
- package/mesh-attribute-exists-block-BfK8UiSL.js.map +1 -0
- package/mesh-features-BLENkYVt.js +341 -0
- package/mesh-features-BLENkYVt.js.map +1 -0
- package/min-block-CHtBngNl.js +6 -0
- package/min-block-CHtBngNl.js.map +1 -0
- package/mod-block-Ceizv8Y7.js +6 -0
- package/mod-block-Ceizv8Y7.js.map +1 -0
- package/morph-fragment-DOVo70gP.js +59 -0
- package/morph-fragment-DOVo70gP.js.map +1 -0
- package/morph-targets-55z342ZB.js +35 -0
- package/morph-targets-55z342ZB.js.map +1 -0
- package/multilight-wgsl-BGyiIOp3.js +112 -0
- package/multilight-wgsl-BGyiIOp3.js.map +1 -0
- package/multiply-block-DaXLJ7Ud.js +6 -0
- package/multiply-block-DaXLJ7Ud.js.map +1 -0
- package/negate-block-9CSLc5pM.js +6 -0
- package/negate-block-9CSLc5pM.js.map +1 -0
- package/nlerp-block-BNK1adIb.js +21 -0
- package/nlerp-block-BNK1adIb.js.map +1 -0
- package/node-env-BPZXZzBf.js +39 -0
- package/node-env-BPZXZzBf.js.map +1 -0
- package/node-registry-DwgC4yth.js +190 -0
- package/node-registry-DwgC4yth.js.map +1 -0
- package/node-registry-extra-advanced-2DJVt67-.js +45 -0
- package/node-registry-extra-advanced-2DJVt67-.js.map +1 -0
- package/node-registry-extra-compat-Dhrw8fDQ.js +41 -0
- package/node-registry-extra-compat-Dhrw8fDQ.js.map +1 -0
- package/node-registry-extra-math-CsAHvIZo.js +49 -0
- package/node-registry-extra-math-CsAHvIZo.js.map +1 -0
- package/node-registry-extra-procedural-5pLQ3Bhz.js +45 -0
- package/node-registry-extra-procedural-5pLQ3Bhz.js.map +1 -0
- package/node-renderable-DlLIdBmd.js +269 -0
- package/node-renderable-DlLIdBmd.js.map +1 -0
- package/node-shadow-DKrcqmNg.js +122 -0
- package/node-shadow-DKrcqmNg.js.map +1 -0
- package/node-snippet-DUMm9qEO.js +22 -0
- package/node-snippet-DUMm9qEO.js.map +1 -0
- package/normal-blend-block-BfH_nBoj.js +29 -0
- package/normal-blend-block-BfH_nBoj.js.map +1 -0
- package/normal-map-fragment-DpsIXrJf.js +38 -0
- package/normal-map-fragment-DpsIXrJf.js.map +1 -0
- package/normalize-block-F2bLNj9K.js +6 -0
- package/normalize-block-F2bLNj9K.js.map +1 -0
- package/oneminus-block-BP9x4Dc3.js +6 -0
- package/oneminus-block-BP9x4Dc3.js.map +1 -0
- package/opposite-block-Cnqmm-lH.js +6 -0
- package/opposite-block-Cnqmm-lH.js.map +1 -0
- package/package.json +26 -0
- package/panner-block-BwMQq-6Y.js +13 -0
- package/panner-block-BwMQq-6Y.js.map +1 -0
- package/parse-camera-DM3oJJeT.js +23 -0
- package/parse-camera-DM3oJJeT.js.map +1 -0
- package/pbr-aces-wgsl-HpiQHGN_.js +13 -0
- package/pbr-aces-wgsl-HpiQHGN_.js.map +1 -0
- package/pbr-metallic-roughness-block-full-6vMm1Jk6.js +763 -0
- package/pbr-metallic-roughness-block-full-6vMm1Jk6.js.map +1 -0
- package/pbr-metallic-roughness-block-h_KAOZrW.js +104 -0
- package/pbr-metallic-roughness-block-h_KAOZrW.js.map +1 -0
- package/pbr-mr-helper-core-CIwm-T1G.js +237 -0
- package/pbr-mr-helper-core-CIwm-T1G.js.map +1 -0
- package/pbr-refraction-DGmMSa2v.js +17 -0
- package/pbr-refraction-DGmMSa2v.js.map +1 -0
- package/pbr-renderable-BJxUtPBb.js +961 -0
- package/pbr-renderable-BJxUtPBb.js.map +1 -0
- package/pbr-shadow-fragment-LO9SlbJj.js +14 -0
- package/pbr-shadow-fragment-LO9SlbJj.js.map +1 -0
- package/pbr-template-ext-8q7BcTDf.js +88 -0
- package/pbr-template-ext-8q7BcTDf.js.map +1 -0
- package/pbr-tracking-B3alzn91.js +31 -0
- package/pbr-tracking-B3alzn91.js.map +1 -0
- package/pbr-transmission-ext-BxW4CEGu.js +581 -0
- package/pbr-transmission-ext-BxW4CEGu.js.map +1 -0
- package/perturb-normal-0Q8EM9ig.js +39 -0
- package/perturb-normal-0Q8EM9ig.js.map +1 -0
- package/posterize-block-DfdKsbEf.js +28 -0
- package/posterize-block-DfdKsbEf.js.map +1 -0
- package/pow-block-DI5ICzhc.js +13 -0
- package/pow-block-DI5ICzhc.js.map +1 -0
- package/random-number-block-2OyRYljF.js +15 -0
- package/random-number-block-2OyRYljF.js.map +1 -0
- package/reciprocal-block-Ck3CW-j-.js +14 -0
- package/reciprocal-block-Ck3CW-j-.js.map +1 -0
- package/reflect-block-CizpzrX4.js +12 -0
- package/reflect-block-CizpzrX4.js.map +1 -0
- package/reflectance-fragment-BCrgPmrt.js +143 -0
- package/reflectance-fragment-BCrgPmrt.js.map +1 -0
- package/reflection-block-DqcwyYqr.js +12 -0
- package/reflection-block-DqcwyYqr.js.map +1 -0
- package/reflection-texture-base-block-1xmJ0HDj.js +10 -0
- package/reflection-texture-base-block-1xmJ0HDj.js.map +1 -0
- package/reflection-texture-block-C3QtzoV8.js +60 -0
- package/reflection-texture-block-C3QtzoV8.js.map +1 -0
- package/refract-block-HHiAk-7U.js +13 -0
- package/refract-block-HHiAk-7U.js.map +1 -0
- package/refraction-block-U8y6XiXs.js +11 -0
- package/refraction-block-U8y6XiXs.js.map +1 -0
- package/refraction-dispersion-wgsl-DdQCyyO1.js +16 -0
- package/refraction-dispersion-wgsl-DdQCyyO1.js.map +1 -0
- package/remap-block-DxK1W1vp.js +27 -0
- package/remap-block-DxK1W1vp.js.map +1 -0
- package/replace-color-block-1m--hiru.js +17 -0
- package/replace-color-block-1m--hiru.js.map +1 -0
- package/rgbd-decode-DCvzUYeI.js +110 -0
- package/rgbd-decode-DCvzUYeI.js.map +1 -0
- package/rotate2d-block-nEe1N2MJ.js +15 -0
- package/rotate2d-block-nEe1N2MJ.js.map +1 -0
- package/scale-block-C5Z8159G.js +13 -0
- package/scale-block-C5Z8159G.js.map +1 -0
- package/scene-material-swap-C2ykv55W.js +34 -0
- package/scene-material-swap-C2ykv55W.js.map +1 -0
- package/screen-size-block-BVNnOvE8.js +21 -0
- package/screen-size-block-BVNnOvE8.js.map +1 -0
- package/screen-space-block-CwaxdfSe.js +28 -0
- package/screen-space-block-CwaxdfSe.js.map +1 -0
- package/shader-renderable-D-6796KR.js +531 -0
- package/shader-renderable-D-6796KR.js.map +1 -0
- package/shadow-fragment-core-DHN2G6FI.js +110 -0
- package/shadow-fragment-core-DHN2G6FI.js.map +1 -0
- package/shadow-map-CQNQC-Fw.js +13 -0
- package/shadow-map-CQNQC-Fw.js.map +1 -0
- package/sheen-block-BugfJqK3.js +12 -0
- package/sheen-block-BugfJqK3.js.map +1 -0
- package/sheen-fragment-Dze2f7XJ.js +215 -0
- package/sheen-fragment-Dze2f7XJ.js.map +1 -0
- package/simplex-perlin-3d-block-CcMtofzV.js +58 -0
- package/simplex-perlin-3d-block-CcMtofzV.js.map +1 -0
- package/singlelight-directional-wgsl-CmUDZxwz.js +39 -0
- package/singlelight-directional-wgsl-CmUDZxwz.js.map +1 -0
- package/singlelight-hemispheric-wgsl-t-83IP_s.js +40 -0
- package/singlelight-hemispheric-wgsl-t-83IP_s.js.map +1 -0
- package/singlelight-point-wgsl-CLzULIYV.js +45 -0
- package/singlelight-point-wgsl-CLzULIYV.js.map +1 -0
- package/singlelight-spot-wgsl-DEEUrfVM.js +47 -0
- package/singlelight-spot-wgsl-DEEUrfVM.js.map +1 -0
- package/skeleton-fragment-B_XlFbtx.js +71 -0
- package/skeleton-fragment-B_XlFbtx.js.map +1 -0
- package/skybox-renderable-DDwzu-PT.js +92 -0
- package/skybox-renderable-DDwzu-PT.js.map +1 -0
- package/skybox.vertex-DJgi072W.js +5 -0
- package/skybox.vertex-DJgi072W.js.map +1 -0
- package/smoothstep-block-Di4t37x-.js +15 -0
- package/smoothstep-block-Di4t37x-.js.map +1 -0
- package/splat-ply-compressed-BahdBG1r.js +394 -0
- package/splat-ply-compressed-BahdBG1r.js.map +1 -0
- package/standard-renderable-GjxL9xSf.js +636 -0
- package/standard-renderable-GjxL9xSf.js.map +1 -0
- package/std-ambient-fragment-BoUsD06w.js +37 -0
- package/std-ambient-fragment-BoUsD06w.js.map +1 -0
- package/std-cube-reflection-fragment-ulqc3bsP.js +31 -0
- package/std-cube-reflection-fragment-ulqc3bsP.js.map +1 -0
- package/std-emissive-fragment-DNGj1HdQ.js +40 -0
- package/std-emissive-fragment-DNGj1HdQ.js.map +1 -0
- package/std-lightmap-fragment-Bqj89aIe.js +37 -0
- package/std-lightmap-fragment-Bqj89aIe.js.map +1 -0
- package/std-opacity-fragment-KuPh5N2Z.js +37 -0
- package/std-opacity-fragment-KuPh5N2Z.js.map +1 -0
- package/std-reflection-fragment-BA5Ghn_M.js +57 -0
- package/std-reflection-fragment-BA5Ghn_M.js.map +1 -0
- package/std-shadow-fragment-FNQfrJuC.js +8 -0
- package/std-shadow-fragment-FNQfrJuC.js.map +1 -0
- package/std-specular-fragment-CE-6scqd.js +37 -0
- package/std-specular-fragment-CE-6scqd.js.map +1 -0
- package/std-tracking-CNKZ-hJN.js +15 -0
- package/std-tracking-CNKZ-hJN.js.map +1 -0
- package/step-block-BkywzTYm.js +13 -0
- package/step-block-BkywzTYm.js.map +1 -0
- package/storage-read-block-BdzhJfln.js +25 -0
- package/storage-read-block-BdzhJfln.js.map +1 -0
- package/storage-write-block-DjLKZ0Ro.js +11 -0
- package/storage-write-block-DjLKZ0Ro.js.map +1 -0
- package/subsurface-block-CBhxT9ui.js +12 -0
- package/subsurface-block-CBhxT9ui.js.map +1 -0
- package/subsurface-fragment-liM3y2-P.js +158 -0
- package/subsurface-fragment-liM3y2-P.js.map +1 -0
- package/subtract-block-NPfKvzQP.js +6 -0
- package/subtract-block-NPfKvzQP.js.map +1 -0
- package/swapchain-overlay-DcCSFDp7.js +35 -0
- package/swapchain-overlay-DcCSFDp7.js.map +1 -0
- package/tbn-block-ByOI6Y43.js +43 -0
- package/tbn-block-ByOI6Y43.js.map +1 -0
- package/teleport-in-block-BMa17cqq.js +10 -0
- package/teleport-in-block-BMa17cqq.js.map +1 -0
- package/teleport-out-block-5AkB25H6.js +19 -0
- package/teleport-out-block-5AkB25H6.js.map +1 -0
- package/texture-block-rr21KIL_.js +70 -0
- package/texture-block-rr21KIL_.js.map +1 -0
- package/thin-instance-fragment-hsv-RyDs.js +69 -0
- package/thin-instance-fragment-hsv-RyDs.js.map +1 -0
- package/thin-instance-gpu-C9Gv_Z1w.js +62 -0
- package/thin-instance-gpu-C9Gv_Z1w.js.map +1 -0
- package/tracking-primitives-wgdBY85t.js +82 -0
- package/tracking-primitives-wgdBY85t.js.map +1 -0
- package/transform-block-DbRph9JI.js +32 -0
- package/transform-block-DbRph9JI.js.map +1 -0
- package/trigonometry-block-BYQcTHiD.js +36 -0
- package/trigonometry-block-BYQcTHiD.js.map +1 -0
- package/triplanar-block-BZHkD9hX.js +148 -0
- package/triplanar-block-BZHkD9hX.js.map +1 -0
- package/twirl-block-78WtdiBd.js +39 -0
- package/twirl-block-78WtdiBd.js.map +1 -0
- package/unlit-fragment-BIlhJpz6.js +43 -0
- package/unlit-fragment-BIlhJpz6.js.map +1 -0
- package/uv-transform-fragment-hYujGpZg.js +47 -0
- package/uv-transform-fragment-hYujGpZg.js.map +1 -0
- package/vector-merger-CrW-ONB0.js +43 -0
- package/vector-merger-CrW-ONB0.js.map +1 -0
- package/vector-splitter-BoJuHrAU.js +34 -0
- package/vector-splitter-BoJuHrAU.js.map +1 -0
- package/vertex-output-Cvft64y0.js +14 -0
- package/vertex-output-Cvft64y0.js.map +1 -0
- package/view-direction-CWVucfnT.js +12 -0
- package/view-direction-CWVucfnT.js.map +1 -0
- package/voronoi-noise-block-iNQxa_Ls.js +43 -0
- package/voronoi-noise-block-iNQxa_Ls.js.map +1 -0
- package/wave-block-CY_mk1ec.js +41 -0
- package/wave-block-CY_mk1ec.js.map +1 -0
- package/wgsl-helpers-DyzNzCeE.js +48 -0
- package/wgsl-helpers-DyzNzCeE.js.map +1 -0
- package/worley-noise-3d-block-CyR2-k4s.js +58 -0
- package/worley-noise-3d-block-CyR2-k4s.js.map +1 -0
|
@@ -0,0 +1,636 @@
|
|
|
1
|
+
import { by as _getStdExts, bz as HAS_DIFFUSE_TEXTURE, bA as DIFFUSE_USES_UV2, ad as HAS_EMISSIVE_TEXTURE, ae as HAS_DEPTH_EMISSIVE_TEXTURE, ac as HAS_BUMP_TEXTURE, af as HAS_SPECULAR_TEXTURE, ag as SPECULAR_USES_UV2, ah as HAS_AMBIENT_TEXTURE, ai as AMBIENT_USES_UV2, aj as HAS_LIGHTMAP_TEXTURE, ak as LIGHTMAP_USES_UV2, al as HAS_OPACITY_TEXTURE, am as OPACITY_FROM_RGB, bB as DOUBLE_SIDED, an as HAS_REFLECTION_TEXTURE, ao as HAS_CUBE_REFLECTION, bC as DISABLE_LIGHTING, S as MATERIAL_ALPHA_BLEND, b9 as appendMeshLightUboFields, M as MAX_LIGHTS, ba as meshLightIndexWGSL, bD as clearSceneBGLCache, aY as createUniformBuffer, bE as _getStdExtsSorted, bF as NEEDS_UV, R as ESM_SHADOW_OUTPUT, D as targetSignatureKey, F as getSceneBindGroupLayout, b5 as REVERSE_DEPTH_COMPARE, bG as NO_COLOR_OUTPUT, bH as NEEDS_UV2, bm as clearSamplerCache, a as writeMeshLightSelection, aU as acquireTexture, b1 as releaseTexture } from "./index-C8HOR2sB.js";
|
|
2
|
+
import { c as WGSL_FOG } from "./wgsl-helpers-DyzNzCeE.js";
|
|
3
|
+
import { e as composeShader, f as MSH_RECEIVE_SHADOWS, _ as _computeMeshFeatures, g as MSH_HAS_THIN_INSTANCES, i as MSH_HAS_INSTANCE_COLOR } from "./mesh-features-BLENkYVt.js";
|
|
4
|
+
function collectStdBoundTextures(mat) {
|
|
5
|
+
var _a;
|
|
6
|
+
const t = [];
|
|
7
|
+
if (mat.diffuseTexture) {
|
|
8
|
+
t.push(mat.diffuseTexture);
|
|
9
|
+
}
|
|
10
|
+
for (const ext of _getStdExts().values()) {
|
|
11
|
+
(_a = ext._textures) == null ? void 0 : _a.call(ext, mat, t);
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
}
|
|
15
|
+
function _computeStandardMaterialFeatures(m) {
|
|
16
|
+
let f = 0;
|
|
17
|
+
if (m.diffuseTexture) {
|
|
18
|
+
f |= HAS_DIFFUSE_TEXTURE;
|
|
19
|
+
if (m.diffuseCoordIndex === 1) {
|
|
20
|
+
f |= DIFFUSE_USES_UV2;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
if (m.emissiveTexture) {
|
|
24
|
+
f |= HAS_EMISSIVE_TEXTURE;
|
|
25
|
+
if (m.emissiveTexture._sampleType === "depth") {
|
|
26
|
+
f |= HAS_DEPTH_EMISSIVE_TEXTURE;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (m.bumpTexture) {
|
|
30
|
+
f |= HAS_BUMP_TEXTURE;
|
|
31
|
+
}
|
|
32
|
+
if (m.specularTexture) {
|
|
33
|
+
f |= HAS_SPECULAR_TEXTURE;
|
|
34
|
+
if (m.specularCoordIndex === 1) {
|
|
35
|
+
f |= SPECULAR_USES_UV2;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (m.ambientTexture) {
|
|
39
|
+
f |= HAS_AMBIENT_TEXTURE;
|
|
40
|
+
if (m.ambientCoordIndex === 1) {
|
|
41
|
+
f |= AMBIENT_USES_UV2;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (m.lightmapTexture) {
|
|
45
|
+
f |= HAS_LIGHTMAP_TEXTURE;
|
|
46
|
+
if (m.lightmapCoordIndex === 1) {
|
|
47
|
+
f |= LIGHTMAP_USES_UV2;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (m.opacityTexture) {
|
|
51
|
+
f |= HAS_OPACITY_TEXTURE;
|
|
52
|
+
if (m.opacityFromRGB) {
|
|
53
|
+
f |= OPACITY_FROM_RGB;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if (!m.backFaceCulling) {
|
|
57
|
+
f |= DOUBLE_SIDED;
|
|
58
|
+
}
|
|
59
|
+
if (m.reflectionTexture) {
|
|
60
|
+
f |= HAS_REFLECTION_TEXTURE;
|
|
61
|
+
}
|
|
62
|
+
if (m.reflectionCubeTexture) {
|
|
63
|
+
f |= HAS_CUBE_REFLECTION;
|
|
64
|
+
}
|
|
65
|
+
if (m.disableLighting) {
|
|
66
|
+
f |= DISABLE_LIGHTING;
|
|
67
|
+
}
|
|
68
|
+
if (m.alpha < 1) {
|
|
69
|
+
f |= MATERIAL_ALPHA_BLEND;
|
|
70
|
+
}
|
|
71
|
+
return f;
|
|
72
|
+
}
|
|
73
|
+
function _standardFeatureKey(features, meshFeatures, variant = "") {
|
|
74
|
+
return variant ? `${features}:${meshFeatures}:${variant}` : `${features}:${meshFeatures}`;
|
|
75
|
+
}
|
|
76
|
+
function _standardShaderVariantKey(shadowLights) {
|
|
77
|
+
return shadowLights.length === 0 ? "" : shadowLights.map((sl) => `${sl.lightIndex}${sl.shadowType === "pcf" ? "p" : "e"}`).join(",");
|
|
78
|
+
}
|
|
79
|
+
const STAGE_VERTEX = 1;
|
|
80
|
+
const STAGE_FRAGMENT = 2;
|
|
81
|
+
const LIGHTING_FN = `
|
|
82
|
+
fn computeLighting(viewDir: vec3<f32>, N: vec3<f32>, L: LightEntry, g: f32, P: vec3<f32>) -> array<vec3<f32>, 2> {
|
|
83
|
+
var lv: vec3<f32>;
|
|
84
|
+
var a: f32 = 1.0;
|
|
85
|
+
let t = u32(L.vLightData.w);
|
|
86
|
+
if (t == 3u) {
|
|
87
|
+
let nl = 0.5 + 0.5 * dot(N, normalize(L.vLightData.xyz));
|
|
88
|
+
let diff = mix(L.vLightDirection.xyz, L.vLightDiffuse.rgb, nl);
|
|
89
|
+
let h = normalize(viewDir + normalize(L.vLightData.xyz));
|
|
90
|
+
var s = pow(max(0.0, dot(N, h)), max(1.0, g));
|
|
91
|
+
return array<vec3<f32>, 2>(diff, s * L.vLightSpecular.rgb);
|
|
92
|
+
}
|
|
93
|
+
if (t == 1u) {
|
|
94
|
+
lv = normalize(-L.vLightData.xyz);
|
|
95
|
+
} else {
|
|
96
|
+
let d = L.vLightData.xyz - P;
|
|
97
|
+
a = max(0.0, 1.0 - length(d) / L.vLightDiffuse.a);
|
|
98
|
+
lv = normalize(d);
|
|
99
|
+
if (t == 2u) {
|
|
100
|
+
let c = max(0.0, dot(L.vLightDirection.xyz, -lv));
|
|
101
|
+
if (c >= L.vLightDirection.w) { a *= max(0.0, pow(c, L.vLightSpecular.a)); } else { a = 0.0; }
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
let nl = max(0.0, dot(N, lv));
|
|
105
|
+
let diff = nl * L.vLightDiffuse.rgb * a;
|
|
106
|
+
let h = normalize(viewDir + lv);
|
|
107
|
+
var s = max(0.0, dot(N, h));
|
|
108
|
+
s = pow(s, max(1.0, g));
|
|
109
|
+
return array<vec3<f32>, 2>(diff, s * L.vLightSpecular.rgb * a);
|
|
110
|
+
}
|
|
111
|
+
`;
|
|
112
|
+
function createStandardTemplate(config, esmShadowDepthCode = "") {
|
|
113
|
+
const { _diffuse, _needsUV, _needsUV2, _diffuseUsesUV2, _disableLighting, _noColorOutput, _esmShadowOutput } = config;
|
|
114
|
+
const _baseVertexAttributes = [
|
|
115
|
+
{ _name: "position", _type: "vec3<f32>", _gpuFormat: "float32x3", _arrayStride: 12 },
|
|
116
|
+
{ _name: "normal", _type: "vec3<f32>", _gpuFormat: "float32x3", _arrayStride: 12 }
|
|
117
|
+
];
|
|
118
|
+
if (_needsUV) {
|
|
119
|
+
_baseVertexAttributes.push({ _name: "uv", _type: "vec2<f32>", _gpuFormat: "float32x2", _arrayStride: 8 });
|
|
120
|
+
}
|
|
121
|
+
if (_needsUV2) {
|
|
122
|
+
_baseVertexAttributes.push({ _name: "uv2", _type: "vec2<f32>", _gpuFormat: "float32x2", _arrayStride: 8 });
|
|
123
|
+
}
|
|
124
|
+
const _baseVaryings = [
|
|
125
|
+
{ _name: "vp", _type: "vec3<f32>" },
|
|
126
|
+
{ _name: "vn", _type: "vec3<f32>" },
|
|
127
|
+
{ _name: "vf", _type: "vec3<f32>" }
|
|
128
|
+
];
|
|
129
|
+
if (_needsUV) {
|
|
130
|
+
_baseVaryings.push({ _name: "vu", _type: "vec2<f32>" });
|
|
131
|
+
}
|
|
132
|
+
if (_needsUV2) {
|
|
133
|
+
_baseVaryings.push({ _name: "vv", _type: "vec2<f32>" });
|
|
134
|
+
}
|
|
135
|
+
const _baseMeshUboFields = [{ _name: "world", _type: "mat4x4<f32>" }];
|
|
136
|
+
appendMeshLightUboFields(_baseMeshUboFields);
|
|
137
|
+
const _baseBindings = [{ _name: "mat", _type: { _kind: "uniform-buffer" }, _visibility: STAGE_FRAGMENT }];
|
|
138
|
+
if (_diffuse) {
|
|
139
|
+
_baseBindings.push(
|
|
140
|
+
{ _name: "dT", _type: { _kind: "texture", _textureType: "texture_2d<f32>" }, _visibility: STAGE_FRAGMENT },
|
|
141
|
+
{ _name: "dS", _type: { _kind: "sampler", _samplerType: "sampler" }, _visibility: STAGE_FRAGMENT }
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
if (_needsUV) {
|
|
145
|
+
_baseBindings.push({ _name: "up", _type: { _kind: "uniform-buffer" }, _visibility: STAGE_VERTEX });
|
|
146
|
+
}
|
|
147
|
+
if (_esmShadowOutput) {
|
|
148
|
+
_baseBindings.push({ _name: "shadowParams", _type: { _kind: "uniform-buffer" }, _visibility: STAGE_FRAGMENT });
|
|
149
|
+
}
|
|
150
|
+
const uvPassthrough = _needsUV ? `out.vu = uv * up.u.xy + up.u.zw;` : "";
|
|
151
|
+
const uv2Passthrough = _needsUV2 ? `out.vv = uv2;` : "";
|
|
152
|
+
const vertexUboStructs = _needsUV ? `struct upUniforms { u: vec4<f32>, }` : "";
|
|
153
|
+
const _vertexTemplate = `/*SU*/
|
|
154
|
+
/*MU*/
|
|
155
|
+
@group(1) @binding(0) var<uniform> mesh: MeshUniforms;
|
|
156
|
+
${vertexUboStructs}
|
|
157
|
+
/*VH*/
|
|
158
|
+
/*VD*/
|
|
159
|
+
/*VO*/
|
|
160
|
+
@vertex fn main(
|
|
161
|
+
/*VP*/
|
|
162
|
+
) -> VertexOutput {
|
|
163
|
+
var out: VertexOutput;
|
|
164
|
+
/*VR*/
|
|
165
|
+
var finalWorld = mesh.world;
|
|
166
|
+
/*VW*/
|
|
167
|
+
let worldPos4 = finalWorld * vec4<f32>(position, 1.0);
|
|
168
|
+
out.vp = worldPos4.xyz;
|
|
169
|
+
let normalWorld = mat3x3<f32>(finalWorld[0].xyz, finalWorld[1].xyz, finalWorld[2].xyz);
|
|
170
|
+
out.vn = normalize(normalWorld * normal);
|
|
171
|
+
out.clipPos = scene.viewProjection * worldPos4;
|
|
172
|
+
out.vf = (scene.view * worldPos4).xyz;
|
|
173
|
+
${uvPassthrough}
|
|
174
|
+
${uv2Passthrough}
|
|
175
|
+
/*VB*/
|
|
176
|
+
return out;
|
|
177
|
+
}`;
|
|
178
|
+
const lightsStructs = `
|
|
179
|
+
struct LightEntry { vLightData: vec4<f32>, vLightDiffuse: vec4<f32>, vLightSpecular: vec4<f32>, vLightDirection: vec4<f32> };
|
|
180
|
+
struct lightsUniforms { count: u32, _p0: u32, _p1: u32, _p2: u32, lights: array<LightEntry, ${MAX_LIGHTS}> };
|
|
181
|
+
@group(0) @binding(1) var<uniform> lights: lightsUniforms;
|
|
182
|
+
`;
|
|
183
|
+
const materialStruct = `
|
|
184
|
+
struct matUniforms {
|
|
185
|
+
dc: vec4<f32>,
|
|
186
|
+
sc: vec4<f32>,
|
|
187
|
+
ec: vec3<f32>,
|
|
188
|
+
bs: f32,
|
|
189
|
+
ac: vec3<f32>,
|
|
190
|
+
tl: f32,
|
|
191
|
+
ambTexLvl: f32,
|
|
192
|
+
lmLvl: f32,
|
|
193
|
+
opLvl: f32,
|
|
194
|
+
aCut: f32,
|
|
195
|
+
rLvl: f32,
|
|
196
|
+
rCm: f32,
|
|
197
|
+
_0: f32,
|
|
198
|
+
_1: f32,
|
|
199
|
+
};
|
|
200
|
+
`;
|
|
201
|
+
const helpers = _disableLighting ? WGSL_FOG : WGSL_FOG + LIGHTING_FN;
|
|
202
|
+
const doubleSidedEntry = `@fragment fn main(input: FragmentInput)${_noColorOutput ? "" : " -> @location(0) vec4<f32>"} {`;
|
|
203
|
+
const viewDirCode = !_disableLighting ? `let viewDirectionW = normalize(scene.vEyePosition.xyz - input.vp);` : "";
|
|
204
|
+
const normalCode = _disableLighting ? "" : `var normalW = normalize(input.vn);`;
|
|
205
|
+
const opacityCode = `var alpha = mat.dc.a;`;
|
|
206
|
+
const baseColorCode = _diffuse ? `let _ds = textureSample(dT, dS, ${_diffuseUsesUV2 ? "input.vv" : "input.vu"});
|
|
207
|
+
if (_ds.a < mat.aCut) { discard; }
|
|
208
|
+
var baseColor = _ds.rgb * mat.tl;` : `var baseColor = vec3<f32>(1.0, 1.0, 1.0);`;
|
|
209
|
+
const diffuseColorCode = `let diffuseColor = mat.dc.rgb;`;
|
|
210
|
+
const emissiveCode = `var emissiveContrib = mat.ec;`;
|
|
211
|
+
const specularColorCode = !_disableLighting ? `var specularColor = mat.sc.rgb;` : "";
|
|
212
|
+
let lightingBlock;
|
|
213
|
+
if (!_disableLighting) {
|
|
214
|
+
lightingBlock = `var glossiness = mat.sc.a;
|
|
215
|
+
var diffuseBase = vec3<f32>(0.0);
|
|
216
|
+
var specularBase = vec3<f32>(0.0);
|
|
217
|
+
var shadowFactors = array<f32, ${MAX_LIGHTS}>(${new Array(MAX_LIGHTS).fill("1.0").join(", ")});
|
|
218
|
+
var baseAmbientColor = vec3<f32>(1.0, 1.0, 1.0);
|
|
219
|
+
var reflectionColor = vec3<f32>(0.0);
|
|
220
|
+
let lc = min(mesh.lc, ${MAX_LIGHTS}u);
|
|
221
|
+
/*AD*/
|
|
222
|
+
for (var li = 0u; li < lc; li++) {
|
|
223
|
+
let lightIndex = mli(li);
|
|
224
|
+
let r = computeLighting(viewDirectionW, normalW, lights.lights[lightIndex], glossiness, input.vp);
|
|
225
|
+
let sf = shadowFactors[lightIndex];
|
|
226
|
+
diffuseBase += r[0] * sf;
|
|
227
|
+
specularBase += r[1] * sf;
|
|
228
|
+
}
|
|
229
|
+
let finalDiffuse = clamp(diffuseBase * diffuseColor + emissiveContrib + mat.ac, vec3<f32>(0.0), vec3<f32>(1.0)) * baseColor;
|
|
230
|
+
let finalSpecular = specularBase * specularColor;
|
|
231
|
+
var color = vec4<f32>(finalDiffuse * baseAmbientColor + finalSpecular + reflectionColor, alpha);`;
|
|
232
|
+
} else {
|
|
233
|
+
lightingBlock = `var color = vec4<f32>(clamp(emissiveContrib * diffuseColor, vec3<f32>(0.0), vec3<f32>(1.0)) * baseColor, alpha);`;
|
|
234
|
+
}
|
|
235
|
+
const _fragmentTemplate = `/*SU*/
|
|
236
|
+
${lightsStructs}
|
|
237
|
+
${materialStruct}
|
|
238
|
+
${_esmShadowOutput ? "struct shadowParamsUniforms { biasAndScale: vec4<f32>, depthValues: vec4<f32>, }" : ""}
|
|
239
|
+
/*MU*/
|
|
240
|
+
@group(1) @binding(0) var<uniform> mesh: MeshUniforms;
|
|
241
|
+
${!_disableLighting ? meshLightIndexWGSL("mesh") : ""}
|
|
242
|
+
${helpers}
|
|
243
|
+
/*HF*/
|
|
244
|
+
/*FB*/
|
|
245
|
+
/*FI*/
|
|
246
|
+
${doubleSidedEntry}
|
|
247
|
+
/*SV*/
|
|
248
|
+
${viewDirCode}
|
|
249
|
+
${normalCode}
|
|
250
|
+
/*AC*/
|
|
251
|
+
${opacityCode}
|
|
252
|
+
${baseColorCode}
|
|
253
|
+
${diffuseColorCode}
|
|
254
|
+
${emissiveCode}
|
|
255
|
+
${specularColorCode}
|
|
256
|
+
/*AT*/
|
|
257
|
+
${_noColorOutput ? "return;" : _esmShadowOutput ? esmShadowDepthCode : ""}
|
|
258
|
+
${lightingBlock}
|
|
259
|
+
/*BC*/
|
|
260
|
+
color = vec4<f32>(max(color.rgb, vec3<f32>(0.0)), color.a);
|
|
261
|
+
if (scene.vFogInfos.x > 0.0) {
|
|
262
|
+
let fog = calcFogFactor(input.vf);
|
|
263
|
+
color = vec4<f32>(mix(scene.vFogColor.rgb, color.rgb, fog), color.a);
|
|
264
|
+
}
|
|
265
|
+
/*BA*/
|
|
266
|
+
${_noColorOutput ? "" : "return color;"}
|
|
267
|
+
}`;
|
|
268
|
+
return {
|
|
269
|
+
_vertexTemplate,
|
|
270
|
+
_fragmentTemplate,
|
|
271
|
+
_baseMeshUboFields,
|
|
272
|
+
_baseVertexAttributes,
|
|
273
|
+
_baseVaryings,
|
|
274
|
+
_baseBindings
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
function composeStandardShader(features, _meshFeatures = 0, fragments = [], esmShadowDepthCode = "") {
|
|
278
|
+
const has = (bit) => (features & bit) !== 0;
|
|
279
|
+
const template = createStandardTemplate(
|
|
280
|
+
{
|
|
281
|
+
_diffuse: has(HAS_DIFFUSE_TEXTURE),
|
|
282
|
+
_needsUV: has(NEEDS_UV),
|
|
283
|
+
_needsUV2: has(NEEDS_UV2),
|
|
284
|
+
_diffuseUsesUV2: has(DIFFUSE_USES_UV2),
|
|
285
|
+
_disableLighting: has(DISABLE_LIGHTING),
|
|
286
|
+
_noColorOutput: has(NO_COLOR_OUTPUT),
|
|
287
|
+
_esmShadowOutput: has(ESM_SHADOW_OUTPUT)
|
|
288
|
+
},
|
|
289
|
+
esmShadowDepthCode
|
|
290
|
+
);
|
|
291
|
+
return composeShader(template, fragments);
|
|
292
|
+
}
|
|
293
|
+
const _bindingsCache = /* @__PURE__ */ new Map();
|
|
294
|
+
let _composedCache = null;
|
|
295
|
+
let _cachedDevice = null;
|
|
296
|
+
function getComposedCache() {
|
|
297
|
+
if (!_composedCache) {
|
|
298
|
+
_composedCache = /* @__PURE__ */ new Map();
|
|
299
|
+
}
|
|
300
|
+
return _composedCache;
|
|
301
|
+
}
|
|
302
|
+
function ensureDevice(engine) {
|
|
303
|
+
if (_cachedDevice !== engine._device) {
|
|
304
|
+
_bindingsCache.clear();
|
|
305
|
+
_composedCache == null ? void 0 : _composedCache.clear();
|
|
306
|
+
clearSceneBGLCache();
|
|
307
|
+
_cachedDevice = engine._device;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
function clearStandardPipelineCache() {
|
|
311
|
+
_bindingsCache.clear();
|
|
312
|
+
_composedCache == null ? void 0 : _composedCache.clear();
|
|
313
|
+
clearSceneBGLCache();
|
|
314
|
+
_cachedDevice = null;
|
|
315
|
+
}
|
|
316
|
+
function getOrCreateStandardBindings(engine, features, meshFeatures, fragments = [], shaderKey = "", esmShadowDepthCode = "") {
|
|
317
|
+
ensureDevice(engine);
|
|
318
|
+
const key = _standardFeatureKey(features, meshFeatures, shaderKey);
|
|
319
|
+
const cached = _bindingsCache.get(key);
|
|
320
|
+
if (cached) {
|
|
321
|
+
return cached;
|
|
322
|
+
}
|
|
323
|
+
const cc = getComposedCache();
|
|
324
|
+
let composed = cc.get(key);
|
|
325
|
+
if (!composed) {
|
|
326
|
+
composed = composeStandardShader(features, meshFeatures, fragments, esmShadowDepthCode);
|
|
327
|
+
cc.set(key, composed);
|
|
328
|
+
}
|
|
329
|
+
const device = engine._device;
|
|
330
|
+
const meshBGL = device.createBindGroupLayout(composed._meshBGLDescriptor);
|
|
331
|
+
let shadowBGL = null;
|
|
332
|
+
const hasShadow = (meshFeatures & MSH_RECEIVE_SHADOWS) !== 0;
|
|
333
|
+
if (hasShadow && composed._shadowBGLDescriptor) {
|
|
334
|
+
shadowBGL = device.createBindGroupLayout(composed._shadowBGLDescriptor);
|
|
335
|
+
}
|
|
336
|
+
const bindings = {
|
|
337
|
+
_features: features,
|
|
338
|
+
_meshFeatures: meshFeatures,
|
|
339
|
+
_meshBGL: meshBGL,
|
|
340
|
+
_shadowBGL: shadowBGL,
|
|
341
|
+
_composed: composed,
|
|
342
|
+
_pipelines: /* @__PURE__ */ new Map()
|
|
343
|
+
};
|
|
344
|
+
_bindingsCache.set(key, bindings);
|
|
345
|
+
return bindings;
|
|
346
|
+
}
|
|
347
|
+
function getOrCreateStandardPipeline(engine, sig, bindings) {
|
|
348
|
+
ensureDevice(engine);
|
|
349
|
+
const key = targetSignatureKey(sig);
|
|
350
|
+
const cached = bindings._pipelines.get(key);
|
|
351
|
+
if (cached) {
|
|
352
|
+
return cached;
|
|
353
|
+
}
|
|
354
|
+
const device = engine._device;
|
|
355
|
+
const composed = bindings._composed;
|
|
356
|
+
const features = bindings._features;
|
|
357
|
+
const sceneBGL = getSceneBindGroupLayout(engine);
|
|
358
|
+
const bgls = bindings._shadowBGL ? [sceneBGL, bindings._meshBGL, bindings._shadowBGL] : [sceneBGL, bindings._meshBGL];
|
|
359
|
+
const vertModule = device.createShaderModule({ code: composed._vertexWGSL });
|
|
360
|
+
const noColorOutput = (features & NO_COLOR_OUTPUT) !== 0;
|
|
361
|
+
const esmShadowOutput = (features & ESM_SHADOW_OUTPUT) !== 0;
|
|
362
|
+
const fragModule = !sig._colorFormat && !noColorOutput ? null : device.createShaderModule({ code: composed._fragmentWGSL });
|
|
363
|
+
const needsBlend = !esmShadowOutput && ((features & HAS_OPACITY_TEXTURE) !== 0 || (features & MATERIAL_ALPHA_BLEND) !== 0);
|
|
364
|
+
const colorTarget = noColorOutput ? null : needsBlend ? {
|
|
365
|
+
format: sig._colorFormat,
|
|
366
|
+
blend: {
|
|
367
|
+
color: { srcFactor: "src-alpha", dstFactor: "one-minus-src-alpha" },
|
|
368
|
+
alpha: { srcFactor: "one", dstFactor: "one-minus-src-alpha" }
|
|
369
|
+
}
|
|
370
|
+
} : { format: sig._colorFormat };
|
|
371
|
+
const pipeline = device.createRenderPipeline({
|
|
372
|
+
layout: device.createPipelineLayout({ bindGroupLayouts: bgls }),
|
|
373
|
+
vertex: { module: vertModule, entryPoint: "main", buffers: composed._vertexBufferLayouts },
|
|
374
|
+
...fragModule ? { fragment: { module: fragModule, entryPoint: "main", targets: colorTarget ? [colorTarget] : [] } } : {},
|
|
375
|
+
...sig._depthStencilFormat ? {
|
|
376
|
+
depthStencil: {
|
|
377
|
+
format: sig._depthStencilFormat,
|
|
378
|
+
depthCompare: sig._depthCompare ?? REVERSE_DEPTH_COMPARE,
|
|
379
|
+
depthWriteEnabled: noColorOutput || esmShadowOutput || !needsBlend
|
|
380
|
+
}
|
|
381
|
+
} : {},
|
|
382
|
+
multisample: { count: sig._sampleCount },
|
|
383
|
+
primitive: { topology: "triangle-list", cullMode: features & DOUBLE_SIDED ? "none" : "back", frontFace: sig._flipY ? "cw" : "ccw" }
|
|
384
|
+
});
|
|
385
|
+
bindings._pipelines.set(key, pipeline);
|
|
386
|
+
return pipeline;
|
|
387
|
+
}
|
|
388
|
+
function createStandardMeshBindGroup(engine, bindings, meshUBO, materialUBO, material) {
|
|
389
|
+
var _a;
|
|
390
|
+
const device = engine._device;
|
|
391
|
+
const features = bindings._features;
|
|
392
|
+
const needsUV = (features & NEEDS_UV) !== 0;
|
|
393
|
+
const hasDiffuseTex = (features & HAS_DIFFUSE_TEXTURE) !== 0;
|
|
394
|
+
const esmShadowOutput = (features & ESM_SHADOW_OUTPUT) !== 0;
|
|
395
|
+
let nextBinding = 0;
|
|
396
|
+
const entries = [
|
|
397
|
+
{ binding: nextBinding++, resource: { buffer: meshUBO } },
|
|
398
|
+
{ binding: nextBinding++, resource: { buffer: materialUBO } }
|
|
399
|
+
];
|
|
400
|
+
if (hasDiffuseTex) {
|
|
401
|
+
const tex = material.diffuseTexture;
|
|
402
|
+
entries.push({ binding: nextBinding++, resource: tex.texture.createView() }, { binding: nextBinding++, resource: tex.sampler });
|
|
403
|
+
}
|
|
404
|
+
if (needsUV) {
|
|
405
|
+
const uvData = new Float32Array(4);
|
|
406
|
+
const scaleX = material.uvScale[0];
|
|
407
|
+
let scaleY = material.uvScale[1];
|
|
408
|
+
let offsetY = 0;
|
|
409
|
+
if ((_a = material.diffuseTexture) == null ? void 0 : _a.invertY) {
|
|
410
|
+
offsetY = scaleY;
|
|
411
|
+
scaleY = -scaleY;
|
|
412
|
+
}
|
|
413
|
+
uvData[0] = scaleX;
|
|
414
|
+
uvData[1] = scaleY;
|
|
415
|
+
uvData[2] = 0;
|
|
416
|
+
uvData[3] = offsetY;
|
|
417
|
+
entries.push({ binding: nextBinding++, resource: { buffer: createUniformBuffer(engine, uvData) } });
|
|
418
|
+
}
|
|
419
|
+
if (esmShadowOutput) {
|
|
420
|
+
entries.push({
|
|
421
|
+
binding: nextBinding++,
|
|
422
|
+
resource: { buffer: material._esmShadowParamsUBO }
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
const sortedExts = _getStdExtsSorted();
|
|
426
|
+
for (const ext of sortedExts) {
|
|
427
|
+
if (features & ext._feature && ext._bind) {
|
|
428
|
+
nextBinding = ext._bind(material, entries, nextBinding);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
return device.createBindGroup({ layout: bindings._meshBGL, entries });
|
|
432
|
+
}
|
|
433
|
+
function writeStdMaterialData(data, mat, textureLevel) {
|
|
434
|
+
const { diffuseColor: dc, specularColor: sc, emissiveColor: ec, ambientColor: ac } = mat;
|
|
435
|
+
data[0] = dc[0];
|
|
436
|
+
data[1] = dc[1];
|
|
437
|
+
data[2] = dc[2];
|
|
438
|
+
data[3] = mat.alpha;
|
|
439
|
+
data[4] = sc[0];
|
|
440
|
+
data[5] = sc[1];
|
|
441
|
+
data[6] = sc[2];
|
|
442
|
+
data[7] = mat.specularPower;
|
|
443
|
+
data[8] = ec[0];
|
|
444
|
+
data[9] = ec[1];
|
|
445
|
+
data[10] = ec[2];
|
|
446
|
+
data[11] = 1 / mat.bumpLevel;
|
|
447
|
+
data[12] = ac[0];
|
|
448
|
+
data[13] = ac[1];
|
|
449
|
+
data[14] = ac[2];
|
|
450
|
+
data[15] = textureLevel;
|
|
451
|
+
data[16] = mat.ambientTexLevel;
|
|
452
|
+
data[17] = mat.lightmapLevel;
|
|
453
|
+
data[18] = mat.opacityLevel;
|
|
454
|
+
data[19] = mat.alphaCutOff;
|
|
455
|
+
data[20] = mat.reflectionLevel;
|
|
456
|
+
data[21] = mat.reflectionCoordMode;
|
|
457
|
+
}
|
|
458
|
+
const _stdMatScratch = new Float32Array(24);
|
|
459
|
+
function buildStandardMeshRenderables(scene, meshes, factories) {
|
|
460
|
+
const engine = scene.engine;
|
|
461
|
+
const device = engine._device;
|
|
462
|
+
const { tiSync, tiFragment, shadowFragment } = factories;
|
|
463
|
+
const shadowLights = [];
|
|
464
|
+
for (let i = 0; i < scene.lights.length; i++) {
|
|
465
|
+
const sg = scene.lights[i].shadowGenerator;
|
|
466
|
+
if (sg) {
|
|
467
|
+
shadowLights.push({ lightIndex: i, shadowType: sg._shadowType, gen: sg });
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
const hasSomeShadows = shadowLights.length > 0;
|
|
471
|
+
const shadowBGCache = /* @__PURE__ */ new Map();
|
|
472
|
+
const rebuildSingle = (s, mesh, materialOverride) => {
|
|
473
|
+
const mat = materialOverride ?? mesh.material;
|
|
474
|
+
const renderFeatures = mat._renderFeatures ?? (mat._renderFeatures = { features: _computeStandardMaterialFeatures(mat) });
|
|
475
|
+
const isOverride = materialOverride != null;
|
|
476
|
+
const features = renderFeatures.features;
|
|
477
|
+
const shadowOutput = (features & (NO_COLOR_OUTPUT | ESM_SHADOW_OUTPUT)) !== 0;
|
|
478
|
+
const receiveShadows = !shadowOutput && mesh.receiveShadows && hasSomeShadows;
|
|
479
|
+
const meshFeatures = _computeMeshFeatures(mesh, receiveShadows);
|
|
480
|
+
const frags = [];
|
|
481
|
+
for (const ext of _getStdExts().values()) {
|
|
482
|
+
if (features & ext._feature) {
|
|
483
|
+
const f = ext._frag(features);
|
|
484
|
+
if (f) {
|
|
485
|
+
frags.push(f);
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
let shaderKey = "";
|
|
490
|
+
if (meshFeatures & MSH_RECEIVE_SHADOWS && shadowFragment) {
|
|
491
|
+
const slots = shadowLights.map((sl) => ({ lightIndex: sl.lightIndex, shadowType: sl.shadowType }));
|
|
492
|
+
shaderKey = _standardShaderVariantKey(slots);
|
|
493
|
+
frags.push(shadowFragment(slots));
|
|
494
|
+
}
|
|
495
|
+
if (meshFeatures & MSH_HAS_THIN_INSTANCES && tiFragment) {
|
|
496
|
+
const hasColor = !!(meshFeatures & MSH_HAS_INSTANCE_COLOR);
|
|
497
|
+
const tiFrag = tiFragment(hasColor);
|
|
498
|
+
if (hasColor) {
|
|
499
|
+
const { _fragmentSlots, ...rest } = tiFrag;
|
|
500
|
+
frags.push({
|
|
501
|
+
...rest,
|
|
502
|
+
_fragmentSlots: {
|
|
503
|
+
BC: `color = vec4<f32>(color.rgb * input.vInstanceColor.rgb, color.a * input.vInstanceColor.a);`
|
|
504
|
+
}
|
|
505
|
+
});
|
|
506
|
+
} else {
|
|
507
|
+
frags.push(tiFrag);
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
const esmShadowDepthCode = (features & ESM_SHADOW_OUTPUT) !== 0 ? mat._esmShadowDepthCode : "";
|
|
511
|
+
const bindings = getOrCreateStandardBindings(engine, features, meshFeatures, frags, shaderKey, esmShadowDepthCode);
|
|
512
|
+
const meshShadowGens = receiveShadows ? shadowLights.map((sl) => sl.gen) : [];
|
|
513
|
+
const meshUboData = new Float32Array(bindings._composed._meshUboSpec._totalBytes / 4);
|
|
514
|
+
meshUboData.set(mesh.worldMatrix, 0);
|
|
515
|
+
writeMeshLightSelection(mesh, s.lights, meshUboData);
|
|
516
|
+
const meshUBO = createUniformBuffer(engine, meshUboData);
|
|
517
|
+
const textureLevel = (features & NEEDS_UV) !== 0 ? 1 : 0;
|
|
518
|
+
const matData = new Float32Array(24);
|
|
519
|
+
writeStdMaterialData(matData, mat, textureLevel);
|
|
520
|
+
const materialUBO = createUniformBuffer(engine, matData);
|
|
521
|
+
const meshBindGroup = createStandardMeshBindGroup(engine, bindings, meshUBO, materialUBO, mat);
|
|
522
|
+
let shadowBindGroup = null;
|
|
523
|
+
if (meshShadowGens.length > 0 && bindings._shadowBGL) {
|
|
524
|
+
let cached = shadowBGCache.get(bindings._shadowBGL);
|
|
525
|
+
if (!cached) {
|
|
526
|
+
const entries = [];
|
|
527
|
+
let b = 0;
|
|
528
|
+
for (const sg of meshShadowGens) {
|
|
529
|
+
entries.push({ binding: b++, resource: sg._depthTexture.createView() });
|
|
530
|
+
entries.push({ binding: b++, resource: sg._depthSampler });
|
|
531
|
+
entries.push({ binding: b++, resource: { buffer: sg._shadowUBO } });
|
|
532
|
+
}
|
|
533
|
+
cached = device.createBindGroup({ layout: bindings._shadowBGL, entries });
|
|
534
|
+
shadowBGCache.set(bindings._shadowBGL, cached);
|
|
535
|
+
}
|
|
536
|
+
shadowBindGroup = cached;
|
|
537
|
+
}
|
|
538
|
+
const needsUV = (features & NEEDS_UV) !== 0;
|
|
539
|
+
const needsUV2 = (features & NEEDS_UV2) !== 0;
|
|
540
|
+
const hasThinInstances = (meshFeatures & MSH_HAS_THIN_INSTANCES) !== 0;
|
|
541
|
+
const hasInstanceColor = (meshFeatures & MSH_HAS_INSTANCE_COLOR) !== 0;
|
|
542
|
+
const isTransparent = !shadowOutput && ((features & HAS_OPACITY_TEXTURE) !== 0 || mat.alpha < 1);
|
|
543
|
+
const boundTextures = collectStdBoundTextures(mat);
|
|
544
|
+
for (const t of boundTextures) {
|
|
545
|
+
acquireTexture(t);
|
|
546
|
+
}
|
|
547
|
+
s._meshDisposables.set(mesh, [
|
|
548
|
+
() => {
|
|
549
|
+
for (const t of boundTextures) {
|
|
550
|
+
releaseTexture(t);
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
]);
|
|
554
|
+
let _lastWorldVersion = mesh.worldMatrixVersion;
|
|
555
|
+
let _lastLightsCount = s.lights.length;
|
|
556
|
+
const sortCenter = [mesh.worldMatrix[12], mesh.worldMatrix[13], mesh.worldMatrix[14]];
|
|
557
|
+
const update = () => {
|
|
558
|
+
const worldVersion = mesh.worldMatrixVersion;
|
|
559
|
+
if (worldVersion !== _lastWorldVersion || s.lights.length !== _lastLightsCount) {
|
|
560
|
+
sortCenter[0] = mesh.worldMatrix[12];
|
|
561
|
+
sortCenter[1] = mesh.worldMatrix[13];
|
|
562
|
+
sortCenter[2] = mesh.worldMatrix[14];
|
|
563
|
+
meshUboData.set(mesh.worldMatrix, 0);
|
|
564
|
+
writeMeshLightSelection(mesh, s.lights, meshUboData);
|
|
565
|
+
device.queue.writeBuffer(meshUBO, 0, meshUboData);
|
|
566
|
+
_lastWorldVersion = worldVersion;
|
|
567
|
+
_lastLightsCount = s.lights.length;
|
|
568
|
+
}
|
|
569
|
+
const uboVersion = mat._uboVersion;
|
|
570
|
+
if (uboVersion !== _lastUboVersion) {
|
|
571
|
+
_lastUboVersion = uboVersion;
|
|
572
|
+
_stdMatScratch.fill(0);
|
|
573
|
+
writeStdMaterialData(_stdMatScratch, mat, textureLevel);
|
|
574
|
+
device.queue.writeBuffer(materialUBO, 0, _stdMatScratch.buffer, 0, 96);
|
|
575
|
+
}
|
|
576
|
+
};
|
|
577
|
+
const draw = (pass) => {
|
|
578
|
+
var _a, _b, _c, _d;
|
|
579
|
+
if (!isOverride && mesh.material !== mat) {
|
|
580
|
+
return 0;
|
|
581
|
+
}
|
|
582
|
+
const g = mesh._gpu;
|
|
583
|
+
let slot = 0;
|
|
584
|
+
const vb = g._vbLayout;
|
|
585
|
+
pass.setVertexBuffer(slot++, g.positionBuffer, (_a = vb == null ? void 0 : vb._p) == null ? void 0 : _a._offset);
|
|
586
|
+
pass.setVertexBuffer(slot++, g.normalBuffer, (_b = vb == null ? void 0 : vb._n) == null ? void 0 : _b._offset);
|
|
587
|
+
if (needsUV) {
|
|
588
|
+
pass.setVertexBuffer(slot++, g.uvBuffer, (_c = vb == null ? void 0 : vb._u) == null ? void 0 : _c._offset);
|
|
589
|
+
}
|
|
590
|
+
if (needsUV2 && g.uv2Buffer) {
|
|
591
|
+
pass.setVertexBuffer(slot++, g.uv2Buffer, (_d = vb == null ? void 0 : vb._u2) == null ? void 0 : _d._offset);
|
|
592
|
+
}
|
|
593
|
+
const ti = hasThinInstances ? mesh.thinInstances : null;
|
|
594
|
+
if (ti && tiSync) {
|
|
595
|
+
slot = tiSync(engine, ti, pass, slot, hasInstanceColor);
|
|
596
|
+
}
|
|
597
|
+
pass.setIndexBuffer(g.indexBuffer, g.indexFormat);
|
|
598
|
+
pass.setBindGroup(1, meshBindGroup);
|
|
599
|
+
if (receiveShadows && shadowBindGroup) {
|
|
600
|
+
pass.setBindGroup(2, shadowBindGroup);
|
|
601
|
+
}
|
|
602
|
+
if (ti && ti.count > 0) {
|
|
603
|
+
pass.drawIndexed(g.indexCount, ti.count);
|
|
604
|
+
} else {
|
|
605
|
+
pass.drawIndexed(g.indexCount);
|
|
606
|
+
}
|
|
607
|
+
return 1;
|
|
608
|
+
};
|
|
609
|
+
const r = {
|
|
610
|
+
order: mesh.renderOrder ?? (isTransparent ? 200 : 100),
|
|
611
|
+
isTransparent,
|
|
612
|
+
mesh,
|
|
613
|
+
bind(eng, sig) {
|
|
614
|
+
return {
|
|
615
|
+
renderable: r,
|
|
616
|
+
pipeline: getOrCreateStandardPipeline(eng, sig, bindings),
|
|
617
|
+
update,
|
|
618
|
+
draw
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
};
|
|
622
|
+
r._worldCenter = sortCenter;
|
|
623
|
+
let _lastUboVersion = mat._uboVersion;
|
|
624
|
+
return r;
|
|
625
|
+
};
|
|
626
|
+
const renderables = meshes.map((m) => rebuildSingle(scene, m));
|
|
627
|
+
scene._disposables.push(
|
|
628
|
+
() => clearStandardPipelineCache(),
|
|
629
|
+
() => clearSamplerCache(engine)
|
|
630
|
+
);
|
|
631
|
+
return { renderables, rebuildSingle };
|
|
632
|
+
}
|
|
633
|
+
export {
|
|
634
|
+
buildStandardMeshRenderables
|
|
635
|
+
};
|
|
636
|
+
//# sourceMappingURL=standard-renderable-GjxL9xSf.js.map
|