@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 @@
|
|
|
1
|
+
{"version":3,"file":"derivative-block-B8KjtaWs.js","sources":["../src/material/node/blocks/derivative-block.ts"],"sourcesContent":["import type { BlockEmitter } from \"../node-types.js\";\n\nconst OUTPUT_FN: Record<string, string> = {\n dx: \"dpdx\",\n dy: \"dpdy\",\n};\n\nexport const emitter: BlockEmitter = {\n className: \"DerivativeBlock\",\n stage: \"fragment\",\n emit(block, outputName, stage, state, ctx) {\n const fn = OUTPUT_FN[outputName];\n if (!fn) {\n throw new Error(`NodeMaterial: DerivativeBlock output \"${outputName}\" is not supported`);\n }\n const input = ctx.resolve(block, \"input\", stage, state);\n return { expr: `${fn}(${input.expr})`, type: input.type };\n },\n};\n"],"names":[],"mappings":"AAEA,MAAM,YAAoC;AAAA,EACtC,IAAI;AAAA,EACJ,IAAI;AACR;AAEO,MAAM,UAAwB;AAAA,EACjC,WAAW;AAAA,EACX,OAAO;AAAA,EACP,KAAK,OAAO,YAAY,OAAO,OAAO,KAAK;AACvC,UAAM,KAAK,UAAU,UAAU;AAC/B,QAAI,CAAC,IAAI;AACL,YAAM,IAAI,MAAM,yCAAyC,UAAU,oBAAoB;AAAA,IAC3F;AACA,UAAM,QAAQ,IAAI,QAAQ,OAAO,SAAS,OAAO,KAAK;AACtD,WAAO,EAAE,MAAM,GAAG,EAAE,IAAI,MAAM,IAAI,KAAK,MAAM,MAAM,KAAA;AAAA,EACvD;AACJ;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const emitter = {
|
|
2
|
+
className: "DesaturateBlock",
|
|
3
|
+
emit(block, _outputName, stage, state, ctx) {
|
|
4
|
+
const color = ctx.cast(ctx.resolve(block, "color", stage, state), "vec3f").expr;
|
|
5
|
+
const level = ctx.cast(ctx.resolve(block, "level", stage, state), "f32").expr;
|
|
6
|
+
const minColor = `min(min((${color}).x, (${color}).y), (${color}).z)`;
|
|
7
|
+
const maxColor = `max(max((${color}).x, (${color}).y), (${color}).z)`;
|
|
8
|
+
const merge = `(0.5 * (${minColor} + ${maxColor}))`;
|
|
9
|
+
return { expr: `mix(${color}, vec3<f32>(${merge}), ${level})`, type: "vec3f" };
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
emitter
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=desaturate-block-C1RghNSB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"desaturate-block-C1RghNSB.js","sources":["../src/material/node/blocks/desaturate-block.ts"],"sourcesContent":["import type { BlockEmitter } from \"../node-types.js\";\n\nexport const emitter: BlockEmitter = {\n className: \"DesaturateBlock\",\n emit(block, _outputName, stage, state, ctx) {\n const color = ctx.cast(ctx.resolve(block, \"color\", stage, state), \"vec3f\").expr;\n const level = ctx.cast(ctx.resolve(block, \"level\", stage, state), \"f32\").expr;\n const minColor = `min(min((${color}).x, (${color}).y), (${color}).z)`;\n const maxColor = `max(max((${color}).x, (${color}).y), (${color}).z)`;\n const merge = `(0.5 * (${minColor} + ${maxColor}))`;\n return { expr: `mix(${color}, vec3<f32>(${merge}), ${level})`, type: \"vec3f\" };\n },\n};\n"],"names":[],"mappings":"AAEO,MAAM,UAAwB;AAAA,EACjC,WAAW;AAAA,EACX,KAAK,OAAO,aAAa,OAAO,OAAO,KAAK;AACxC,UAAM,QAAQ,IAAI,KAAK,IAAI,QAAQ,OAAO,SAAS,OAAO,KAAK,GAAG,OAAO,EAAE;AAC3E,UAAM,QAAQ,IAAI,KAAK,IAAI,QAAQ,OAAO,SAAS,OAAO,KAAK,GAAG,KAAK,EAAE;AACzE,UAAM,WAAW,YAAY,KAAK,SAAS,KAAK,UAAU,KAAK;AAC/D,UAAM,WAAW,YAAY,KAAK,SAAS,KAAK,UAAU,KAAK;AAC/D,UAAM,QAAQ,WAAW,QAAQ,MAAM,QAAQ;AAC/C,WAAO,EAAE,MAAM,OAAO,KAAK,eAAe,KAAK,MAAM,KAAK,KAAK,MAAM,QAAA;AAAA,EACzE;AACJ;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const emitter = {
|
|
2
|
+
className: "DiscardBlock",
|
|
3
|
+
stage: "fragment",
|
|
4
|
+
sideEffect: true,
|
|
5
|
+
emit(block, _outputName, stage, state, ctx) {
|
|
6
|
+
const memoKey = `_discard_${block.id}_emit`;
|
|
7
|
+
if (!state.fragment.memo.has(memoKey)) {
|
|
8
|
+
const valueIn = block.inputs.get("value");
|
|
9
|
+
const cutoffIn = block.inputs.get("cutoff");
|
|
10
|
+
const value = (valueIn == null ? void 0 : valueIn.source) ? ctx.cast(ctx.resolve(block, "value", stage, state), "f32") : { expr: "0.0" };
|
|
11
|
+
const cutoff = (cutoffIn == null ? void 0 : cutoffIn.source) ? ctx.cast(ctx.resolve(block, "cutoff", stage, state), "f32") : { expr: "0.0" };
|
|
12
|
+
state.fragment.body.push(`if (${value.expr} < ${cutoff.expr}) { discard; }`);
|
|
13
|
+
state.fragment.memo.set(memoKey, { expr: "0.0", type: "f32" });
|
|
14
|
+
}
|
|
15
|
+
return { expr: "0.0", type: "f32" };
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
emitter
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=discard-block-B2jKjaEL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discard-block-B2jKjaEL.js","sources":["../src/material/node/blocks/discard-block.ts"],"sourcesContent":["/** DiscardBlock — fragment-stage discard.\n *\n * Inputs: `value` (scalar), `cutoff` (scalar).\n * Semantics (BJS): if `value < cutoff` then `discard`.\n *\n * The block has no output expression — it pushes a guarded `discard;` statement\n * into the fragment body during traversal. Because the pipeline walks from\n * FragmentOutputBlock back through its inputs, DiscardBlock only executes when\n * it is reachable from the final output via some consumer. In practice BJS\n * attaches it to FragmentOutputBlock via a dedicated connection or wires it\n * upstream of the colour flow; we support the latter shape here — any block\n * whose output reaches FragmentOutputBlock will cause the discard to be\n * emitted. To guarantee emission even when not directly in the colour path,\n * we wire DiscardBlock into the emit loop via the has-side-effects list\n * maintained by node-emitter.ts.\n */\n\nimport type { BlockEmitter } from \"../node-types.js\";\n\nexport const emitter: BlockEmitter = {\n className: \"DiscardBlock\",\n stage: \"fragment\",\n sideEffect: true,\n emit(block, _outputName, stage, state, ctx) {\n const memoKey = `_discard_${block.id}_emit`;\n if (!state.fragment.memo.has(memoKey)) {\n const valueIn = block.inputs.get(\"value\");\n const cutoffIn = block.inputs.get(\"cutoff\");\n const value = valueIn?.source ? ctx.cast(ctx.resolve(block, \"value\", stage, state), \"f32\") : { expr: \"0.0\", type: \"f32\" as const };\n const cutoff = cutoffIn?.source ? ctx.cast(ctx.resolve(block, \"cutoff\", stage, state), \"f32\") : { expr: \"0.0\", type: \"f32\" as const };\n state.fragment.body.push(`if (${value.expr} < ${cutoff.expr}) { discard; }`);\n state.fragment.memo.set(memoKey, { expr: \"0.0\", type: \"f32\" });\n }\n return { expr: \"0.0\", type: \"f32\" };\n },\n};\n"],"names":[],"mappings":"AAmBO,MAAM,UAAwB;AAAA,EACjC,WAAW;AAAA,EACX,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,KAAK,OAAO,aAAa,OAAO,OAAO,KAAK;AACxC,UAAM,UAAU,YAAY,MAAM,EAAE;AACpC,QAAI,CAAC,MAAM,SAAS,KAAK,IAAI,OAAO,GAAG;AACnC,YAAM,UAAU,MAAM,OAAO,IAAI,OAAO;AACxC,YAAM,WAAW,MAAM,OAAO,IAAI,QAAQ;AAC1C,YAAM,SAAQ,mCAAS,UAAS,IAAI,KAAK,IAAI,QAAQ,OAAO,SAAS,OAAO,KAAK,GAAG,KAAK,IAAI,EAAE,MAAM,MAA4B;AACjI,YAAM,UAAS,qCAAU,UAAS,IAAI,KAAK,IAAI,QAAQ,OAAO,UAAU,OAAO,KAAK,GAAG,KAAK,IAAI,EAAE,MAAM,MAA4B;AACpI,YAAM,SAAS,KAAK,KAAK,OAAO,MAAM,IAAI,MAAM,OAAO,IAAI,gBAAgB;AAC3E,YAAM,SAAS,KAAK,IAAI,SAAS,EAAE,MAAM,OAAO,MAAM,OAAO;AAAA,IACjE;AACA,WAAO,EAAE,MAAM,OAAO,MAAM,MAAA;AAAA,EAChC;AACJ;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { w as widerType } from "./_math-factory-C-QqW-Wi.js";
|
|
2
|
+
const emitter = {
|
|
3
|
+
className: "DistanceBlock",
|
|
4
|
+
emit(block, _outputName, stage, state, ctx) {
|
|
5
|
+
const left = ctx.resolve(block, "left", stage, state);
|
|
6
|
+
const right = ctx.resolve(block, "right", stage, state);
|
|
7
|
+
const type = widerType(left.type, right.type);
|
|
8
|
+
const lc = ctx.cast(left, type).expr;
|
|
9
|
+
const rc = ctx.cast(right, type).expr;
|
|
10
|
+
return { expr: `length(${lc} - ${rc})`, type: "f32" };
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
emitter
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=distance-block-3NkgFZ3f.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"distance-block-3NkgFZ3f.js","sources":["../src/material/node/blocks/distance-block.ts"],"sourcesContent":["import type { BlockEmitter } from \"../node-types.js\";\nimport { widerType } from \"./_math-factory.js\";\n\nexport const emitter: BlockEmitter = {\n className: \"DistanceBlock\",\n emit(block, _outputName, stage, state, ctx) {\n const left = ctx.resolve(block, \"left\", stage, state);\n const right = ctx.resolve(block, \"right\", stage, state);\n const type = widerType(left.type, right.type);\n const lc = ctx.cast(left, type).expr;\n const rc = ctx.cast(right, type).expr;\n return { expr: `length(${lc} - ${rc})`, type: \"f32\" };\n },\n};\n"],"names":[],"mappings":";AAGO,MAAM,UAAwB;AAAA,EACjC,WAAW;AAAA,EACX,KAAK,OAAO,aAAa,OAAO,OAAO,KAAK;AACxC,UAAM,OAAO,IAAI,QAAQ,OAAO,QAAQ,OAAO,KAAK;AACpD,UAAM,QAAQ,IAAI,QAAQ,OAAO,SAAS,OAAO,KAAK;AACtD,UAAM,OAAO,UAAU,KAAK,MAAM,MAAM,IAAI;AAC5C,UAAM,KAAK,IAAI,KAAK,MAAM,IAAI,EAAE;AAChC,UAAM,KAAK,IAAI,KAAK,OAAO,IAAI,EAAE;AACjC,WAAO,EAAE,MAAM,UAAU,EAAE,MAAM,EAAE,KAAK,MAAM,MAAA;AAAA,EAClD;AACJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"divide-block-ZyepIg_-.js","sources":["../src/material/node/blocks/divide-block.ts"],"sourcesContent":["import { binaryEmitter } from \"./_math-factory.js\";\n\nexport const emitter = binaryEmitter(\"DivideBlock\", (l, r) => `${l} / ${r}`);\n"],"names":[],"mappings":";AAEO,MAAM,UAAU,cAAc,eAAe,CAAC,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,EAAE;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { w as widerType } from "./_math-factory-C-QqW-Wi.js";
|
|
2
|
+
const emitter = {
|
|
3
|
+
className: "DotBlock",
|
|
4
|
+
emit(block, _outputName, stage, state, ctx) {
|
|
5
|
+
const l = ctx.resolve(block, "left", stage, state);
|
|
6
|
+
const r = ctx.resolve(block, "right", stage, state);
|
|
7
|
+
const t = widerType(l.type, r.type);
|
|
8
|
+
const lc = ctx.cast(l, t).expr;
|
|
9
|
+
const rc = ctx.cast(r, t).expr;
|
|
10
|
+
return { expr: `dot(${lc}, ${rc})`, type: "f32" };
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
emitter
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=dot-block-VlfAC6cD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dot-block-VlfAC6cD.js","sources":["../src/material/node/blocks/dot-block.ts"],"sourcesContent":["import type { BlockEmitter } from \"../node-types.js\";\nimport { widerType } from \"./_math-factory.js\";\n\nexport const emitter: BlockEmitter = {\n className: \"DotBlock\",\n emit(block, _outputName, stage, state, ctx) {\n const l = ctx.resolve(block, \"left\", stage, state);\n const r = ctx.resolve(block, \"right\", stage, state);\n const t = widerType(l.type, r.type);\n const lc = ctx.cast(l, t).expr;\n const rc = ctx.cast(r, t).expr;\n return { expr: `dot(${lc}, ${rc})`, type: \"f32\" };\n },\n};\n"],"names":[],"mappings":";AAGO,MAAM,UAAwB;AAAA,EACjC,WAAW;AAAA,EACX,KAAK,OAAO,aAAa,OAAO,OAAO,KAAK;AACxC,UAAM,IAAI,IAAI,QAAQ,OAAO,QAAQ,OAAO,KAAK;AACjD,UAAM,IAAI,IAAI,QAAQ,OAAO,SAAS,OAAO,KAAK;AAClD,UAAM,IAAI,UAAU,EAAE,MAAM,EAAE,IAAI;AAClC,UAAM,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE;AAC1B,UAAM,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE;AAC1B,WAAO,EAAE,MAAM,OAAO,EAAE,KAAK,EAAE,KAAK,MAAM,MAAA;AAAA,EAC9C;AACJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elbow-block-NEOiIxzO.js","sources":["../src/material/node/blocks/elbow-block.ts"],"sourcesContent":["import type { BlockEmitter } from \"../node-types.js\";\n\nexport const emitter: BlockEmitter = {\n className: \"ElbowBlock\",\n emit(block, _outputName, stage, state, ctx) {\n return ctx.resolve(block, \"input\", stage, state);\n },\n};\n"],"names":[],"mappings":"AAEO,MAAM,UAAwB;AAAA,EACjC,WAAW;AAAA,EACX,KAAK,OAAO,aAAa,OAAO,OAAO,KAAK;AACxC,WAAO,IAAI,QAAQ,OAAO,SAAS,OAAO,KAAK;AAAA,EACnD;AACJ;"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { aK as PBR_HAS_EMISSIVE_COLOR, aL as PBR_HAS_EMISSIVE } from "./index-C8HOR2sB.js";
|
|
2
|
+
function createEmissiveColorFragment(hasEmissiveTexture) {
|
|
3
|
+
return {
|
|
4
|
+
_id: "emissive-color",
|
|
5
|
+
_uboFields: [
|
|
6
|
+
{ _name: "emissiveColor", _type: "vec3<f32>" },
|
|
7
|
+
{ _name: "_emissiveColorPad", _type: "f32" }
|
|
8
|
+
],
|
|
9
|
+
_fragmentSlots: {
|
|
10
|
+
AT: hasEmissiveTexture ? `let emissive = material.emissiveColor * textureSample(emissiveTexture, emissiveSampler, input.uv).rgb;` : `let emissive = material.emissiveColor;`
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function writeEmissiveUBO(data, material, offsets) {
|
|
15
|
+
if (!material.emissiveColor || !offsets.has("emissiveColor")) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const off = offsets.get("emissiveColor") / 4;
|
|
19
|
+
data[off] = material.emissiveColor[0];
|
|
20
|
+
data[off + 1] = material.emissiveColor[1];
|
|
21
|
+
data[off + 2] = material.emissiveColor[2];
|
|
22
|
+
}
|
|
23
|
+
const pbrExt = {
|
|
24
|
+
id: "emissive-color",
|
|
25
|
+
phase: "fragment",
|
|
26
|
+
frag(ctx) {
|
|
27
|
+
if (!(ctx._features & PBR_HAS_EMISSIVE_COLOR)) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
return createEmissiveColorFragment((ctx._features & PBR_HAS_EMISSIVE) !== 0);
|
|
31
|
+
},
|
|
32
|
+
writeUbo: writeEmissiveUBO
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
createEmissiveColorFragment,
|
|
36
|
+
pbrExt,
|
|
37
|
+
writeEmissiveUBO
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=emissive-fragment-BnNvbBCw.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emissive-fragment-BnNvbBCw.js","sources":["../src/material/pbr/fragments/emissive-fragment.ts"],"sourcesContent":["/**\n * Emissive Color Fragment\n *\n * Adds an emissiveColor vec3 uniform to MeshUniforms and uses it\n * in the fragment shader's emissive computation.\n *\n * Zero bytes in bundles for scenes that don't use emissive color.\n */\n\nimport type { ShaderFragment } from \"../../../shader/fragment-types.js\";\nimport type { PbrMaterialProps } from \"../pbr-material.js\";\nimport type { PbrExt } from \"../pbr-flags.js\";\nimport { PBR_HAS_EMISSIVE_COLOR, PBR_HAS_EMISSIVE } from \"../pbr-flag-bits.js\";\n\n/**\n * Create an emissive-color fragment.\n * @param hasEmissiveTexture - Whether the material also has an emissive texture.\n */\nexport function createEmissiveColorFragment(hasEmissiveTexture: boolean): ShaderFragment {\n return {\n _id: \"emissive-color\",\n\n _uboFields: [\n { _name: \"emissiveColor\", _type: \"vec3<f32>\" },\n { _name: \"_emissiveColorPad\", _type: \"f32\" },\n ],\n\n _fragmentSlots: {\n AT: hasEmissiveTexture\n ? `let emissive = material.emissiveColor * textureSample(emissiveTexture, emissiveSampler, input.uv).rgb;`\n : `let emissive = material.emissiveColor;`,\n },\n };\n}\n\n/** Write the emissive-color material-UBO slice. */\nexport function writeEmissiveUBO(data: Float32Array, material: PbrMaterialProps, offsets: ReadonlyMap<string, number>): void {\n if (!material.emissiveColor || !offsets.has(\"emissiveColor\")) {\n return;\n }\n const off = offsets.get(\"emissiveColor\")! / 4;\n data[off] = material.emissiveColor[0]!;\n data[off + 1] = material.emissiveColor[1]!;\n data[off + 2] = material.emissiveColor[2]!;\n}\n\nexport const pbrExt: PbrExt = {\n id: \"emissive-color\",\n phase: \"fragment\",\n frag(ctx) {\n if (!(ctx._features & PBR_HAS_EMISSIVE_COLOR)) {\n return null;\n }\n return createEmissiveColorFragment((ctx._features & PBR_HAS_EMISSIVE) !== 0);\n },\n writeUbo: writeEmissiveUBO as PbrExt[\"writeUbo\"],\n};\n"],"names":[],"mappings":";AAkBO,SAAS,4BAA4B,oBAA6C;AACrF,SAAO;AAAA,IACH,KAAK;AAAA,IAEL,YAAY;AAAA,MACR,EAAE,OAAO,iBAAiB,OAAO,YAAA;AAAA,MACjC,EAAE,OAAO,qBAAqB,OAAO,MAAA;AAAA,IAAM;AAAA,IAG/C,gBAAgB;AAAA,MACZ,IAAI,qBACE,2GACA;AAAA,IAAA;AAAA,EACV;AAER;AAGO,SAAS,iBAAiB,MAAoB,UAA4B,SAA4C;AACzH,MAAI,CAAC,SAAS,iBAAiB,CAAC,QAAQ,IAAI,eAAe,GAAG;AAC1D;AAAA,EACJ;AACA,QAAM,MAAM,QAAQ,IAAI,eAAe,IAAK;AAC5C,OAAK,GAAG,IAAI,SAAS,cAAc,CAAC;AACpC,OAAK,MAAM,CAAC,IAAI,SAAS,cAAc,CAAC;AACxC,OAAK,MAAM,CAAC,IAAI,SAAS,cAAc,CAAC;AAC5C;AAEO,MAAM,SAAiB;AAAA,EAC1B,IAAI;AAAA,EACJ,OAAO;AAAA,EACP,KAAK,KAAK;AACN,QAAI,EAAE,IAAI,YAAY,yBAAyB;AAC3C,aAAO;AAAA,IACX;AACA,WAAO,6BAA6B,IAAI,YAAY,sBAAsB,CAAC;AAAA,EAC/E;AAAA,EACA,UAAU;AACd;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Q as createMaterialView, U as PBR2_ESM_SHADOW_OUTPUT, V as PBR_HAS_ALPHA_BLEND } from "./index-C8HOR2sB.js";
|
|
2
|
+
const PBR_ESM_SHADOW_DEPTH_CODE = `let depthMetricSM = (input.clipPos.z + shadowParams.depthValues.x) / shadowParams.depthValues.y + shadowParams.biasAndScale.x;
|
|
3
|
+
let depthSM = clamp(exp(-min(87.0, shadowParams.biasAndScale.z * depthMetricSM)), 0.0, 1.0);
|
|
4
|
+
return vec4<f32>(depthSM, 1.0, 1.0, 1.0);`;
|
|
5
|
+
function createPbrEsmShadowMaterialView(source, shadowParamsUBO) {
|
|
6
|
+
const features = source._renderFeatures ?? { features: 0, features2: 0 };
|
|
7
|
+
const view = createMaterialView(source, {
|
|
8
|
+
features: features.features & ~PBR_HAS_ALPHA_BLEND,
|
|
9
|
+
features2: (features.features2 ?? 0) | PBR2_ESM_SHADOW_OUTPUT
|
|
10
|
+
});
|
|
11
|
+
Object.defineProperty(view, "_esmShadowParamsUBO", { value: shadowParamsUBO, enumerable: false });
|
|
12
|
+
Object.defineProperty(view, "_esmShadowDepthCode", { value: PBR_ESM_SHADOW_DEPTH_CODE, enumerable: false });
|
|
13
|
+
return view;
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
createPbrEsmShadowMaterialView
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=esm-shadow-view-DGKdF1NI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"esm-shadow-view-DGKdF1NI.js","sources":["../src/material/pbr/esm-shadow-view.ts"],"sourcesContent":["/** PBR material view helper that writes ESM shadow color. */\n\nimport { createMaterialView } from \"../material-view.js\";\nimport type { MaterialView } from \"../material.js\";\nimport { PBR_HAS_ALPHA_BLEND, PBR2_ESM_SHADOW_OUTPUT } from \"./pbr-flags.js\";\nimport type { PbrMaterialProps } from \"./pbr-material.js\";\n\nexport interface PbrEsmShadowMaterialView extends MaterialView {\n /** @internal */\n readonly _esmShadowParamsUBO: GPUBuffer;\n /** @internal */\n readonly _esmShadowDepthCode: string;\n}\n\nconst PBR_ESM_SHADOW_DEPTH_CODE = `let depthMetricSM = (input.clipPos.z + shadowParams.depthValues.x) / shadowParams.depthValues.y + shadowParams.biasAndScale.x;\nlet depthSM = clamp(exp(-min(87.0, shadowParams.biasAndScale.z * depthMetricSM)), 0.0, 1.0);\nreturn vec4<f32>(depthSM, 1.0, 1.0, 1.0);`;\n\nexport function createPbrEsmShadowMaterialView(source: PbrMaterialProps, shadowParamsUBO: GPUBuffer): PbrEsmShadowMaterialView {\n const features = source._renderFeatures ?? { features: 0, features2: 0 };\n const view = createMaterialView(source, {\n features: features.features & ~PBR_HAS_ALPHA_BLEND,\n features2: (features.features2 ?? 0) | PBR2_ESM_SHADOW_OUTPUT,\n }) as PbrEsmShadowMaterialView;\n Object.defineProperty(view, \"_esmShadowParamsUBO\", { value: shadowParamsUBO, enumerable: false });\n Object.defineProperty(view, \"_esmShadowDepthCode\", { value: PBR_ESM_SHADOW_DEPTH_CODE, enumerable: false });\n return view;\n}\n"],"names":[],"mappings":";AAcA,MAAM,4BAA4B;AAAA;AAAA;AAI3B,SAAS,+BAA+B,QAA0B,iBAAsD;AAC3H,QAAM,WAAW,OAAO,mBAAmB,EAAE,UAAU,GAAG,WAAW,EAAA;AACrE,QAAM,OAAO,mBAAmB,QAAQ;AAAA,IACpC,UAAU,SAAS,WAAW,CAAC;AAAA,IAC/B,YAAY,SAAS,aAAa,KAAK;AAAA,EAAA,CAC1C;AACD,SAAO,eAAe,MAAM,uBAAuB,EAAE,OAAO,iBAAiB,YAAY,OAAO;AAChG,SAAO,eAAe,MAAM,uBAAuB,EAAE,OAAO,2BAA2B,YAAY,OAAO;AAC1G,SAAO;AACX;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Q as createMaterialView, N as NODE_ESM_SHADOW_OUTPUT } from "./index-C8HOR2sB.js";
|
|
2
|
+
const NODE_ESM_SHADOW_DEPTH_CODE = `let depthMetricSM = (in.position.z + nmeShadowParams.depthValues.x) / nmeShadowParams.depthValues.y + nmeShadowParams.biasAndScale.x;
|
|
3
|
+
let depthSM = clamp(exp(-min(87.0, nmeShadowParams.biasAndScale.z * depthMetricSM)), 0.0, 1.0);
|
|
4
|
+
return vec4<f32>(depthSM, 1.0, 1.0, 1.0);`;
|
|
5
|
+
function createNodeEsmShadowMaterialView(source, shadowParamsUBO) {
|
|
6
|
+
const features = source._renderFeatures ?? { features: 0 };
|
|
7
|
+
const view = createMaterialView(source, { features: features.features | NODE_ESM_SHADOW_OUTPUT });
|
|
8
|
+
Object.defineProperty(view, "_esmShadowParamsUBO", { value: shadowParamsUBO, enumerable: false });
|
|
9
|
+
Object.defineProperty(view, "_esmShadowDepthCode", { value: NODE_ESM_SHADOW_DEPTH_CODE, enumerable: false });
|
|
10
|
+
return view;
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
createNodeEsmShadowMaterialView
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=esm-shadow-view-DN9HIaM4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"esm-shadow-view-DN9HIaM4.js","sources":["../src/material/node/esm-shadow-view.ts"],"sourcesContent":["/** NodeMaterial view helper that writes ESM shadow color. */\n\nimport { createMaterialView } from \"../material-view.js\";\nimport type { MaterialView } from \"../material.js\";\nimport { NODE_ESM_SHADOW_OUTPUT } from \"./node-flags.js\";\nimport type { NodeMaterial } from \"./node-material.js\";\n\nexport interface NodeEsmShadowMaterialView extends MaterialView {\n /** @internal */\n readonly _esmShadowParamsUBO: GPUBuffer;\n /** @internal */\n readonly _esmShadowDepthCode: string;\n}\n\nconst NODE_ESM_SHADOW_DEPTH_CODE = `let depthMetricSM = (in.position.z + nmeShadowParams.depthValues.x) / nmeShadowParams.depthValues.y + nmeShadowParams.biasAndScale.x;\nlet depthSM = clamp(exp(-min(87.0, nmeShadowParams.biasAndScale.z * depthMetricSM)), 0.0, 1.0);\nreturn vec4<f32>(depthSM, 1.0, 1.0, 1.0);`;\n\nexport function createNodeEsmShadowMaterialView(source: NodeMaterial, shadowParamsUBO: GPUBuffer): NodeEsmShadowMaterialView {\n const features = source._renderFeatures ?? { features: 0 };\n const view = createMaterialView(source, { features: features.features | NODE_ESM_SHADOW_OUTPUT }) as NodeEsmShadowMaterialView;\n Object.defineProperty(view, \"_esmShadowParamsUBO\", { value: shadowParamsUBO, enumerable: false });\n Object.defineProperty(view, \"_esmShadowDepthCode\", { value: NODE_ESM_SHADOW_DEPTH_CODE, enumerable: false });\n return view;\n}\n"],"names":[],"mappings":";AAcA,MAAM,6BAA6B;AAAA;AAAA;AAI5B,SAAS,gCAAgC,QAAsB,iBAAuD;AACzH,QAAM,WAAW,OAAO,mBAAmB,EAAE,UAAU,EAAA;AACvD,QAAM,OAAO,mBAAmB,QAAQ,EAAE,UAAU,SAAS,WAAW,wBAAwB;AAChG,SAAO,eAAe,MAAM,uBAAuB,EAAE,OAAO,iBAAiB,YAAY,OAAO;AAChG,SAAO,eAAe,MAAM,uBAAuB,EAAE,OAAO,4BAA4B,YAAY,OAAO;AAC3G,SAAO;AACX;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Q as createMaterialView, R as ESM_SHADOW_OUTPUT, S as MATERIAL_ALPHA_BLEND } from "./index-C8HOR2sB.js";
|
|
2
|
+
const STANDARD_ESM_SHADOW_DEPTH_CODE = `let depthMetricSM = (input.clipPos.z + shadowParams.depthValues.x) / shadowParams.depthValues.y + shadowParams.biasAndScale.x;
|
|
3
|
+
let depthSM = clamp(exp(-min(87.0, shadowParams.biasAndScale.z * depthMetricSM)), 0.0, 1.0);
|
|
4
|
+
return vec4<f32>(depthSM, 1.0, 1.0, 1.0);`;
|
|
5
|
+
function createStandardEsmShadowMaterialView(source, shadowParamsUBO) {
|
|
6
|
+
const features = source._renderFeatures ?? { features: 0 };
|
|
7
|
+
const view = createMaterialView(source, { features: features.features & ~MATERIAL_ALPHA_BLEND | ESM_SHADOW_OUTPUT });
|
|
8
|
+
Object.defineProperty(view, "_esmShadowParamsUBO", { value: shadowParamsUBO, enumerable: false });
|
|
9
|
+
Object.defineProperty(view, "_esmShadowDepthCode", { value: STANDARD_ESM_SHADOW_DEPTH_CODE, enumerable: false });
|
|
10
|
+
return view;
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
createStandardEsmShadowMaterialView
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=esm-shadow-view-Dk9NFtLq.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"esm-shadow-view-Dk9NFtLq.js","sources":["../src/material/standard/esm-shadow-view.ts"],"sourcesContent":["/** Standard material view helper that writes ESM shadow color. */\n\nimport { createMaterialView } from \"../material-view.js\";\nimport type { MaterialView } from \"../material.js\";\nimport { ESM_SHADOW_OUTPUT, MATERIAL_ALPHA_BLEND } from \"./standard-flags.js\";\nimport type { StandardMaterialProps } from \"./standard-material.js\";\n\nexport interface StandardEsmShadowMaterialView extends MaterialView {\n /** @internal */\n readonly _esmShadowParamsUBO: GPUBuffer;\n /** @internal */\n readonly _esmShadowDepthCode: string;\n}\n\nconst STANDARD_ESM_SHADOW_DEPTH_CODE = `let depthMetricSM = (input.clipPos.z + shadowParams.depthValues.x) / shadowParams.depthValues.y + shadowParams.biasAndScale.x;\nlet depthSM = clamp(exp(-min(87.0, shadowParams.biasAndScale.z * depthMetricSM)), 0.0, 1.0);\nreturn vec4<f32>(depthSM, 1.0, 1.0, 1.0);`;\n\nexport function createStandardEsmShadowMaterialView(source: StandardMaterialProps, shadowParamsUBO: GPUBuffer): StandardEsmShadowMaterialView {\n const features = source._renderFeatures ?? { features: 0 };\n const view = createMaterialView(source, { features: (features.features & ~MATERIAL_ALPHA_BLEND) | ESM_SHADOW_OUTPUT }) as StandardEsmShadowMaterialView;\n Object.defineProperty(view, \"_esmShadowParamsUBO\", { value: shadowParamsUBO, enumerable: false });\n Object.defineProperty(view, \"_esmShadowDepthCode\", { value: STANDARD_ESM_SHADOW_DEPTH_CODE, enumerable: false });\n return view;\n}\n"],"names":[],"mappings":";AAcA,MAAM,iCAAiC;AAAA;AAAA;AAIhC,SAAS,oCAAoC,QAA+B,iBAA2D;AAC1I,QAAM,WAAW,OAAO,mBAAmB,EAAE,UAAU,EAAA;AACvD,QAAM,OAAO,mBAAmB,QAAQ,EAAE,UAAW,SAAS,WAAW,CAAC,uBAAwB,mBAAmB;AACrH,SAAO,eAAe,MAAM,uBAAuB,EAAE,OAAO,iBAAiB,YAAY,OAAO;AAChG,SAAO,eAAe,MAAM,uBAAuB,EAAE,OAAO,gCAAgC,YAAY,OAAO;AAC/G,SAAO;AACX;"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const FOG_HELPER_KEY = "nme_fog";
|
|
2
|
+
const FOG_HELPER_WGSL = `
|
|
3
|
+
fn nme_fogFactor(worldPos: vec3<f32>, cameraPos: vec3<f32>, fogParams: vec4<f32>) -> f32 {
|
|
4
|
+
let dist = distance(worldPos, cameraPos);
|
|
5
|
+
let mode = fogParams.x;
|
|
6
|
+
let density = fogParams.y;
|
|
7
|
+
let fstart = fogParams.z;
|
|
8
|
+
let fend = fogParams.w;
|
|
9
|
+
// mode: 1=EXP, 2=EXP2, 3=LINEAR
|
|
10
|
+
if (mode < 1.5) {
|
|
11
|
+
return clamp(exp(-dist * density), 0.0, 1.0);
|
|
12
|
+
}
|
|
13
|
+
if (mode < 2.5) {
|
|
14
|
+
let d = dist * density;
|
|
15
|
+
return clamp(exp(-d * d), 0.0, 1.0);
|
|
16
|
+
}
|
|
17
|
+
return clamp((fend - dist) / (fend - fstart), 0.0, 1.0);
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
const emitter = {
|
|
21
|
+
className: "FogBlock",
|
|
22
|
+
stage: "fragment",
|
|
23
|
+
emit(block, _outputName, stage, state, ctx) {
|
|
24
|
+
state.fragment.helpers.set(FOG_HELPER_KEY, FOG_HELPER_WGSL);
|
|
25
|
+
const wp = ctx.cast(ctx.resolve(block, "worldPosition", stage, state), "vec3f").expr;
|
|
26
|
+
const input = ctx.resolve(block, "input", stage, state);
|
|
27
|
+
const fogColor = ctx.cast(ctx.resolve(block, "fogColor", stage, state), "vec3f").expr;
|
|
28
|
+
const inType = input.type === "vec4f" ? "vec4f" : "vec3f";
|
|
29
|
+
const inVec3 = ctx.cast(input, "vec3f").expr;
|
|
30
|
+
const factor = `nme_fogFactor(${wp}, _NME_CAMERA_POS_, _NME_FOG_PARAMS_)`;
|
|
31
|
+
const mixed = `mix(${fogColor}, ${inVec3}, ${factor})`;
|
|
32
|
+
if (inType === "vec4f") {
|
|
33
|
+
return { expr: `vec4<f32>(${mixed}, (${input.expr}).w)`, type: "vec4f" };
|
|
34
|
+
}
|
|
35
|
+
return { expr: mixed, type: "vec3f" };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
emitter
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=fog-block-DJ9hEolm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fog-block-DJ9hEolm.js","sources":["../src/material/node/blocks/fog-block.ts"],"sourcesContent":["/** FogBlock — standard Babylon fog blend.\n *\n * Inputs: worldPosition, view (optional), input (color to blend), fogColor.\n * Outputs: output (vec3 or vec4 matching `input`).\n *\n * Scene-provided sentinels: `_NME_FOG_PARAMS_` (vec4: mode, density, start, end)\n * and `_NME_CAMERA_POS_`. The pipeline builder wires these to the scene UBOs.\n */\n\nimport type { BlockEmitter } from \"../node-types.js\";\n\nconst FOG_HELPER_KEY = \"nme_fog\";\nconst FOG_HELPER_WGSL = `\nfn nme_fogFactor(worldPos: vec3<f32>, cameraPos: vec3<f32>, fogParams: vec4<f32>) -> f32 {\n let dist = distance(worldPos, cameraPos);\n let mode = fogParams.x;\n let density = fogParams.y;\n let fstart = fogParams.z;\n let fend = fogParams.w;\n // mode: 1=EXP, 2=EXP2, 3=LINEAR\n if (mode < 1.5) {\n return clamp(exp(-dist * density), 0.0, 1.0);\n }\n if (mode < 2.5) {\n let d = dist * density;\n return clamp(exp(-d * d), 0.0, 1.0);\n }\n return clamp((fend - dist) / (fend - fstart), 0.0, 1.0);\n}\n`;\n\nexport const emitter: BlockEmitter = {\n className: \"FogBlock\",\n stage: \"fragment\",\n emit(block, _outputName, stage, state, ctx) {\n state.fragment.helpers.set(FOG_HELPER_KEY, FOG_HELPER_WGSL);\n const wp = ctx.cast(ctx.resolve(block, \"worldPosition\", stage, state), \"vec3f\").expr;\n const input = ctx.resolve(block, \"input\", stage, state);\n const fogColor = ctx.cast(ctx.resolve(block, \"fogColor\", stage, state), \"vec3f\").expr;\n const inType = input.type === \"vec4f\" ? \"vec4f\" : \"vec3f\";\n const inVec3 = ctx.cast(input, \"vec3f\").expr;\n const factor = `nme_fogFactor(${wp}, _NME_CAMERA_POS_, _NME_FOG_PARAMS_)`;\n const mixed = `mix(${fogColor}, ${inVec3}, ${factor})`;\n if (inType === \"vec4f\") {\n return { expr: `vec4<f32>(${mixed}, (${input.expr}).w)`, type: \"vec4f\" };\n }\n return { expr: mixed, type: \"vec3f\" };\n },\n};\n"],"names":[],"mappings":"AAWA,MAAM,iBAAiB;AACvB,MAAM,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBjB,MAAM,UAAwB;AAAA,EACjC,WAAW;AAAA,EACX,OAAO;AAAA,EACP,KAAK,OAAO,aAAa,OAAO,OAAO,KAAK;AACxC,UAAM,SAAS,QAAQ,IAAI,gBAAgB,eAAe;AAC1D,UAAM,KAAK,IAAI,KAAK,IAAI,QAAQ,OAAO,iBAAiB,OAAO,KAAK,GAAG,OAAO,EAAE;AAChF,UAAM,QAAQ,IAAI,QAAQ,OAAO,SAAS,OAAO,KAAK;AACtD,UAAM,WAAW,IAAI,KAAK,IAAI,QAAQ,OAAO,YAAY,OAAO,KAAK,GAAG,OAAO,EAAE;AACjF,UAAM,SAAS,MAAM,SAAS,UAAU,UAAU;AAClD,UAAM,SAAS,IAAI,KAAK,OAAO,OAAO,EAAE;AACxC,UAAM,SAAS,iBAAiB,EAAE;AAClC,UAAM,QAAQ,OAAO,QAAQ,KAAK,MAAM,KAAK,MAAM;AACnD,QAAI,WAAW,SAAS;AACpB,aAAO,EAAE,MAAM,aAAa,KAAK,MAAM,MAAM,IAAI,QAAQ,MAAM,QAAA;AAAA,IACnE;AACA,WAAO,EAAE,MAAM,OAAO,MAAM,QAAA;AAAA,EAChC;AACJ;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const OUTPUTS = {
|
|
2
|
+
xyzw: { swizzle: "", type: "vec4f" },
|
|
3
|
+
xyz: { swizzle: ".xyz", type: "vec3f" },
|
|
4
|
+
xy: { swizzle: ".xy", type: "vec2f" },
|
|
5
|
+
x: { swizzle: ".x", type: "f32" },
|
|
6
|
+
y: { swizzle: ".y", type: "f32" },
|
|
7
|
+
z: { swizzle: ".z", type: "f32" },
|
|
8
|
+
w: { swizzle: ".w", type: "f32" }
|
|
9
|
+
};
|
|
10
|
+
const emitter = {
|
|
11
|
+
className: "FragCoordBlock",
|
|
12
|
+
stage: "fragment",
|
|
13
|
+
emit(_block, outputName, _stage, state) {
|
|
14
|
+
state.usesScreenSize = true;
|
|
15
|
+
const out = OUTPUTS[outputName];
|
|
16
|
+
if (!out) {
|
|
17
|
+
throw new Error(`NodeMaterial: FragCoordBlock has no output "${outputName}"`);
|
|
18
|
+
}
|
|
19
|
+
return { expr: `vec4<f32>(_NME_FRAG_COORD_.x, _NME_SCREEN_SIZE_.y - _NME_FRAG_COORD_.y, 1.0 - _NME_FRAG_COORD_.z, _NME_FRAG_COORD_.w)${out.swizzle}`, type: out.type };
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
emitter
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=frag-coord-block-DzXfFgfV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frag-coord-block-DzXfFgfV.js","sources":["../src/material/node/blocks/frag-coord-block.ts"],"sourcesContent":["/** FragCoordBlock — exposes fragment pixel coordinates (`fragmentInputs.position` in BJS WGSL). */\n\nimport type { BlockEmitter, NodeValueType } from \"../node-types.js\";\n\nconst OUTPUTS: Record<string, { readonly swizzle: string; readonly type: NodeValueType }> = {\n xyzw: { swizzle: \"\", type: \"vec4f\" },\n xyz: { swizzle: \".xyz\", type: \"vec3f\" },\n xy: { swizzle: \".xy\", type: \"vec2f\" },\n x: { swizzle: \".x\", type: \"f32\" },\n y: { swizzle: \".y\", type: \"f32\" },\n z: { swizzle: \".z\", type: \"f32\" },\n w: { swizzle: \".w\", type: \"f32\" },\n};\n\nexport const emitter: BlockEmitter = {\n className: \"FragCoordBlock\",\n stage: \"fragment\",\n emit(_block, outputName, _stage, state) {\n // Babylon.js keeps NME FragCoord aligned with the historical WebGL\n // gl_FragCoord convention (bottom-left origin). WebGPU's fragment\n // position is top-left origin, so flip only the y component here.\n state.usesScreenSize = true;\n const out = OUTPUTS[outputName];\n if (!out) {\n throw new Error(`NodeMaterial: FragCoordBlock has no output \"${outputName}\"`);\n }\n return { expr: `vec4<f32>(_NME_FRAG_COORD_.x, _NME_SCREEN_SIZE_.y - _NME_FRAG_COORD_.y, 1.0 - _NME_FRAG_COORD_.z, _NME_FRAG_COORD_.w)${out.swizzle}`, type: out.type };\n },\n};\n"],"names":[],"mappings":"AAIA,MAAM,UAAsF;AAAA,EACxF,MAAM,EAAE,SAAS,IAAI,MAAM,QAAA;AAAA,EAC3B,KAAK,EAAE,SAAS,QAAQ,MAAM,QAAA;AAAA,EAC9B,IAAI,EAAE,SAAS,OAAO,MAAM,QAAA;AAAA,EAC5B,GAAG,EAAE,SAAS,MAAM,MAAM,MAAA;AAAA,EAC1B,GAAG,EAAE,SAAS,MAAM,MAAM,MAAA;AAAA,EAC1B,GAAG,EAAE,SAAS,MAAM,MAAM,MAAA;AAAA,EAC1B,GAAG,EAAE,SAAS,MAAM,MAAM,MAAA;AAC9B;AAEO,MAAM,UAAwB;AAAA,EACjC,WAAW;AAAA,EACX,OAAO;AAAA,EACP,KAAK,QAAQ,YAAY,QAAQ,OAAO;AAIpC,UAAM,iBAAiB;AACvB,UAAM,MAAM,QAAQ,UAAU;AAC9B,QAAI,CAAC,KAAK;AACN,YAAM,IAAI,MAAM,+CAA+C,UAAU,GAAG;AAAA,IAChF;AACA,WAAO,EAAE,MAAM,wHAAwH,IAAI,OAAO,IAAI,MAAM,IAAI,KAAA;AAAA,EACpK;AACJ;"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const emitter = {
|
|
2
|
+
className: "FragDepthBlock",
|
|
3
|
+
stage: "fragment",
|
|
4
|
+
sideEffect: true,
|
|
5
|
+
emit(block, _outputName, stage, state, ctx) {
|
|
6
|
+
var _a, _b;
|
|
7
|
+
const memoKey = `${block.id}|fragDepth`;
|
|
8
|
+
const existing = state.fragment.memo.get(memoKey);
|
|
9
|
+
if (existing) {
|
|
10
|
+
return existing;
|
|
11
|
+
}
|
|
12
|
+
state.usesFragDepth = true;
|
|
13
|
+
const depthConn = block.inputs.get("depth");
|
|
14
|
+
if (depthConn == null ? void 0 : depthConn.source) {
|
|
15
|
+
const depth = ctx.cast(ctx.resolve(block, "depth", stage, state), "f32");
|
|
16
|
+
state.fragment.body.push(`_NME_FRAG_DEPTH_ = 1.0 - (${depth.expr});`);
|
|
17
|
+
} else if (((_a = block.inputs.get("worldPos")) == null ? void 0 : _a.source) && ((_b = block.inputs.get("viewProjection")) == null ? void 0 : _b.source)) {
|
|
18
|
+
const worldPos = ctx.cast(ctx.resolve(block, "worldPos", stage, state), "vec4f");
|
|
19
|
+
const viewProjection = ctx.cast(ctx.resolve(block, "viewProjection", stage, state), "mat4f");
|
|
20
|
+
const p = ctx.temp(state, "fragDepthP");
|
|
21
|
+
state.fragment.body.push(`let ${p} = ${viewProjection.expr} * ${worldPos.expr};`);
|
|
22
|
+
state.fragment.body.push(`_NME_FRAG_DEPTH_ = ${p}.z / ${p}.w;`);
|
|
23
|
+
} else {
|
|
24
|
+
throw new Error("NodeMaterial: FragDepthBlock requires `depth` or both `worldPos` and `viewProjection` inputs");
|
|
25
|
+
}
|
|
26
|
+
const result = { expr: "_NME_FRAG_DEPTH_", type: "f32" };
|
|
27
|
+
state.fragment.memo.set(memoKey, result);
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
emitter
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=frag-depth-block-UQbeKP2D.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frag-depth-block-UQbeKP2D.js","sources":["../src/material/node/blocks/frag-depth-block.ts"],"sourcesContent":["/** FragDepthBlock — writes `@builtin(frag_depth)` from a depth scalar or worldPos/viewProjection pair. */\n\nimport type { BlockEmitter } from \"../node-types.js\";\n\nexport const emitter: BlockEmitter = {\n className: \"FragDepthBlock\",\n stage: \"fragment\",\n sideEffect: true,\n emit(block, _outputName, stage, state, ctx) {\n const memoKey = `${block.id}|fragDepth`;\n const existing = state.fragment.memo.get(memoKey);\n if (existing) {\n return existing;\n }\n state.usesFragDepth = true;\n const depthConn = block.inputs.get(\"depth\");\n if (depthConn?.source) {\n const depth = ctx.cast(ctx.resolve(block, \"depth\", stage, state), \"f32\");\n state.fragment.body.push(`_NME_FRAG_DEPTH_ = 1.0 - (${depth.expr});`);\n } else if (block.inputs.get(\"worldPos\")?.source && block.inputs.get(\"viewProjection\")?.source) {\n const worldPos = ctx.cast(ctx.resolve(block, \"worldPos\", stage, state), \"vec4f\");\n const viewProjection = ctx.cast(ctx.resolve(block, \"viewProjection\", stage, state), \"mat4f\");\n const p = ctx.temp(state, \"fragDepthP\");\n state.fragment.body.push(`let ${p} = ${viewProjection.expr} * ${worldPos.expr};`);\n state.fragment.body.push(`_NME_FRAG_DEPTH_ = ${p}.z / ${p}.w;`);\n } else {\n throw new Error(\"NodeMaterial: FragDepthBlock requires `depth` or both `worldPos` and `viewProjection` inputs\");\n }\n const result = { expr: \"_NME_FRAG_DEPTH_\", type: \"f32\" as const };\n state.fragment.memo.set(memoKey, result);\n return result;\n },\n};\n"],"names":[],"mappings":"AAIO,MAAM,UAAwB;AAAA,EACjC,WAAW;AAAA,EACX,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,KAAK,OAAO,aAAa,OAAO,OAAO,KAAK;AAJzC;AAKC,UAAM,UAAU,GAAG,MAAM,EAAE;AAC3B,UAAM,WAAW,MAAM,SAAS,KAAK,IAAI,OAAO;AAChD,QAAI,UAAU;AACV,aAAO;AAAA,IACX;AACA,UAAM,gBAAgB;AACtB,UAAM,YAAY,MAAM,OAAO,IAAI,OAAO;AAC1C,QAAI,uCAAW,QAAQ;AACnB,YAAM,QAAQ,IAAI,KAAK,IAAI,QAAQ,OAAO,SAAS,OAAO,KAAK,GAAG,KAAK;AACvE,YAAM,SAAS,KAAK,KAAK,6BAA6B,MAAM,IAAI,IAAI;AAAA,IACxE,aAAW,WAAM,OAAO,IAAI,UAAU,MAA3B,mBAA8B,aAAU,WAAM,OAAO,IAAI,gBAAgB,MAAjC,mBAAoC,SAAQ;AAC3F,YAAM,WAAW,IAAI,KAAK,IAAI,QAAQ,OAAO,YAAY,OAAO,KAAK,GAAG,OAAO;AAC/E,YAAM,iBAAiB,IAAI,KAAK,IAAI,QAAQ,OAAO,kBAAkB,OAAO,KAAK,GAAG,OAAO;AAC3F,YAAM,IAAI,IAAI,KAAK,OAAO,YAAY;AACtC,YAAM,SAAS,KAAK,KAAK,OAAO,CAAC,MAAM,eAAe,IAAI,MAAM,SAAS,IAAI,GAAG;AAChF,YAAM,SAAS,KAAK,KAAK,sBAAsB,CAAC,QAAQ,CAAC,KAAK;AAAA,IAClE,OAAO;AACH,YAAM,IAAI,MAAM,8FAA8F;AAAA,IAClH;AACA,UAAM,SAAS,EAAE,MAAM,oBAAoB,MAAM,MAAA;AACjD,UAAM,SAAS,KAAK,IAAI,SAAS,MAAM;AACvC,WAAO;AAAA,EACX;AACJ;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const emitter = {
|
|
2
|
+
className: "FragmentOutputBlock",
|
|
3
|
+
stage: "fragment",
|
|
4
|
+
emit(block, _outputName, stage, state, ctx) {
|
|
5
|
+
const rgbaConn = block.inputs.get("rgba");
|
|
6
|
+
let finalVec4;
|
|
7
|
+
if (rgbaConn && rgbaConn.source) {
|
|
8
|
+
const v = ctx.resolve(block, "rgba", stage, state);
|
|
9
|
+
finalVec4 = ctx.cast(v, "vec4f");
|
|
10
|
+
} else {
|
|
11
|
+
const rgbConn = block.inputs.get("rgb");
|
|
12
|
+
const aConn = block.inputs.get("a");
|
|
13
|
+
const rgb = rgbConn && rgbConn.source ? ctx.cast(ctx.resolve(block, "rgb", stage, state), "vec3f") : { expr: "vec3<f32>(0.0, 0.0, 0.0)" };
|
|
14
|
+
const a = aConn && aConn.source ? ctx.cast(ctx.resolve(block, "a", stage, state), "f32") : { expr: "1.0" };
|
|
15
|
+
finalVec4 = { expr: `vec4<f32>(${rgb.expr}, ${a.expr})`, type: "vec4f" };
|
|
16
|
+
}
|
|
17
|
+
const t = ctx.temp(state, "frag");
|
|
18
|
+
state.fragment.body.push(`let ${t} = ${finalVec4.expr};`);
|
|
19
|
+
state.fragment.body.push(`_NME_FRAG_OUTPUT_ = ${t};`);
|
|
20
|
+
return { expr: t, type: "vec4f" };
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
emitter
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=fragment-output-BOphkIeh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fragment-output-BOphkIeh.js","sources":["../src/material/node/blocks/fragment-output.ts"],"sourcesContent":["/** FragmentOutputBlock emitter.\n *\n * The fragment root. Reads the `rgba` (or `rgb` + `a`) input, casts to vec4,\n * and writes it to the fragment main body via an SSA temp so the pipeline\n * scaffold can emit `return finalColor;`.\n */\n\nimport type { BlockEmitter } from \"../node-types.js\";\n\nexport const emitter: BlockEmitter = {\n className: \"FragmentOutputBlock\",\n stage: \"fragment\",\n emit(block, _outputName, stage, state, ctx) {\n // rgba takes precedence; otherwise combine rgb + a.\n const rgbaConn = block.inputs.get(\"rgba\");\n let finalVec4;\n if (rgbaConn && rgbaConn.source) {\n const v = ctx.resolve(block, \"rgba\", stage, state);\n finalVec4 = ctx.cast(v, \"vec4f\");\n } else {\n const rgbConn = block.inputs.get(\"rgb\");\n const aConn = block.inputs.get(\"a\");\n const rgb = rgbConn && rgbConn.source ? ctx.cast(ctx.resolve(block, \"rgb\", stage, state), \"vec3f\") : { expr: \"vec3<f32>(0.0, 0.0, 0.0)\", type: \"vec3f\" as const };\n const a = aConn && aConn.source ? ctx.cast(ctx.resolve(block, \"a\", stage, state), \"f32\") : { expr: \"1.0\", type: \"f32\" as const };\n finalVec4 = { expr: `vec4<f32>(${rgb.expr}, ${a.expr})`, type: \"vec4f\" as const };\n }\n const t = ctx.temp(state, \"frag\");\n state.fragment.body.push(`let ${t} = ${finalVec4.expr};`);\n state.fragment.body.push(`_NME_FRAG_OUTPUT_ = ${t};`);\n return { expr: t, type: \"vec4f\" };\n },\n};\n"],"names":[],"mappings":"AASO,MAAM,UAAwB;AAAA,EACjC,WAAW;AAAA,EACX,OAAO;AAAA,EACP,KAAK,OAAO,aAAa,OAAO,OAAO,KAAK;AAExC,UAAM,WAAW,MAAM,OAAO,IAAI,MAAM;AACxC,QAAI;AACJ,QAAI,YAAY,SAAS,QAAQ;AAC7B,YAAM,IAAI,IAAI,QAAQ,OAAO,QAAQ,OAAO,KAAK;AACjD,kBAAY,IAAI,KAAK,GAAG,OAAO;AAAA,IACnC,OAAO;AACH,YAAM,UAAU,MAAM,OAAO,IAAI,KAAK;AACtC,YAAM,QAAQ,MAAM,OAAO,IAAI,GAAG;AAClC,YAAM,MAAM,WAAW,QAAQ,SAAS,IAAI,KAAK,IAAI,QAAQ,OAAO,OAAO,OAAO,KAAK,GAAG,OAAO,IAAI,EAAE,MAAM,2BAAmD;AAChK,YAAM,IAAI,SAAS,MAAM,SAAS,IAAI,KAAK,IAAI,QAAQ,OAAO,KAAK,OAAO,KAAK,GAAG,KAAK,IAAI,EAAE,MAAM,MAA4B;AAC/H,kBAAY,EAAE,MAAM,aAAa,IAAI,IAAI,KAAK,EAAE,IAAI,KAAK,MAAM,QAAA;AAAA,IACnE;AACA,UAAM,IAAI,IAAI,KAAK,OAAO,MAAM;AAChC,UAAM,SAAS,KAAK,KAAK,OAAO,CAAC,MAAM,UAAU,IAAI,GAAG;AACxD,UAAM,SAAS,KAAK,KAAK,uBAAuB,CAAC,GAAG;AACpD,WAAO,EAAE,MAAM,GAAG,MAAM,QAAA;AAAA,EAC5B;AACJ;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const HELPER = `fn nme_computeFresnelTerm(viewDirection: vec3<f32>, worldNormal: vec3<f32>, bias: f32, power: f32) -> f32 {
|
|
2
|
+
let fresnelTerm = pow(bias + abs(dot(viewDirection, worldNormal)), power);
|
|
3
|
+
return clamp(fresnelTerm, 0.0, 1.0);
|
|
4
|
+
}`;
|
|
5
|
+
const emitter = {
|
|
6
|
+
className: "FresnelBlock",
|
|
7
|
+
emit(block, _outputName, stage, state, ctx) {
|
|
8
|
+
const worldNormal = ctx.cast(ctx.resolve(block, "worldNormal", stage, state), "vec3f").expr;
|
|
9
|
+
const viewDirection = ctx.cast(ctx.resolve(block, "viewDirection", stage, state), "vec3f").expr;
|
|
10
|
+
const bias = ctx.cast(ctx.resolve(block, "bias", stage, state), "f32").expr;
|
|
11
|
+
const power = ctx.cast(ctx.resolve(block, "power", stage, state), "f32").expr;
|
|
12
|
+
const stageState = stage === "vertex" ? state.vertex : state.fragment;
|
|
13
|
+
stageState.helpers.set("nme_computeFresnelTerm", HELPER);
|
|
14
|
+
return { expr: `nme_computeFresnelTerm(${viewDirection}, ${worldNormal}, ${bias}, ${power})`, type: "f32" };
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
emitter
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=fresnel-block-DefHWeO-.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fresnel-block-DefHWeO-.js","sources":["../src/material/node/blocks/fresnel-block.ts"],"sourcesContent":["import type { BlockEmitter } from \"../node-types.js\";\n\nconst HELPER = `fn nme_computeFresnelTerm(viewDirection: vec3<f32>, worldNormal: vec3<f32>, bias: f32, power: f32) -> f32 {\n let fresnelTerm = pow(bias + abs(dot(viewDirection, worldNormal)), power);\n return clamp(fresnelTerm, 0.0, 1.0);\n}`;\n\nexport const emitter: BlockEmitter = {\n className: \"FresnelBlock\",\n emit(block, _outputName, stage, state, ctx) {\n const worldNormal = ctx.cast(ctx.resolve(block, \"worldNormal\", stage, state), \"vec3f\").expr;\n const viewDirection = ctx.cast(ctx.resolve(block, \"viewDirection\", stage, state), \"vec3f\").expr;\n const bias = ctx.cast(ctx.resolve(block, \"bias\", stage, state), \"f32\").expr;\n const power = ctx.cast(ctx.resolve(block, \"power\", stage, state), \"f32\").expr;\n const stageState = stage === \"vertex\" ? state.vertex : state.fragment;\n stageState.helpers.set(\"nme_computeFresnelTerm\", HELPER);\n return { expr: `nme_computeFresnelTerm(${viewDirection}, ${worldNormal}, ${bias}, ${power})`, type: \"f32\" };\n },\n};\n"],"names":[],"mappings":"AAEA,MAAM,SAAS;AAAA;AAAA;AAAA;AAKR,MAAM,UAAwB;AAAA,EACjC,WAAW;AAAA,EACX,KAAK,OAAO,aAAa,OAAO,OAAO,KAAK;AACxC,UAAM,cAAc,IAAI,KAAK,IAAI,QAAQ,OAAO,eAAe,OAAO,KAAK,GAAG,OAAO,EAAE;AACvF,UAAM,gBAAgB,IAAI,KAAK,IAAI,QAAQ,OAAO,iBAAiB,OAAO,KAAK,GAAG,OAAO,EAAE;AAC3F,UAAM,OAAO,IAAI,KAAK,IAAI,QAAQ,OAAO,QAAQ,OAAO,KAAK,GAAG,KAAK,EAAE;AACvE,UAAM,QAAQ,IAAI,KAAK,IAAI,QAAQ,OAAO,SAAS,OAAO,KAAK,GAAG,KAAK,EAAE;AACzE,UAAM,aAAa,UAAU,WAAW,MAAM,SAAS,MAAM;AAC7D,eAAW,QAAQ,IAAI,0BAA0B,MAAM;AACvD,WAAO,EAAE,MAAM,0BAA0B,aAAa,KAAK,WAAW,KAAK,IAAI,KAAK,KAAK,KAAK,MAAM,MAAA;AAAA,EACxG;AACJ;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const emitter = {
|
|
2
|
+
className: "FrontFacingBlock",
|
|
3
|
+
stage: "fragment",
|
|
4
|
+
emit(_block, _outputName, _stage, _state, _ctx) {
|
|
5
|
+
return { expr: "select(0.0, 1.0, _NME_FRONT_FACING_)", type: "f32" };
|
|
6
|
+
}
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
emitter
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=front-facing-0d6aiyrv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"front-facing-0d6aiyrv.js","sources":["../src/material/node/blocks/front-facing.ts"],"sourcesContent":["/** FrontFacingBlock — 1.0 if the fragment is front-facing, else 0.0. */\n\nimport type { BlockEmitter } from \"../node-types.js\";\n\nexport const emitter: BlockEmitter = {\n className: \"FrontFacingBlock\",\n stage: \"fragment\",\n emit(_block, _outputName, _stage, _state, _ctx) {\n // WGSL: `select(0.0, 1.0, frontFacing)` where `frontFacing` is a @builtin(front_facing) bool.\n // The pipeline builder wires this builtin into the fragment entry-point.\n return { expr: \"select(0.0, 1.0, _NME_FRONT_FACING_)\", type: \"f32\" };\n },\n};\n"],"names":[],"mappings":"AAIO,MAAM,UAAwB;AAAA,EACjC,WAAW;AAAA,EACX,OAAO;AAAA,EACP,KAAK,QAAQ,aAAa,QAAQ,QAAQ,MAAM;AAG5C,WAAO,EAAE,MAAM,wCAAwC,MAAM,MAAA;AAAA,EACjE;AACJ;"}
|