python-cad-tools 0.1.0rc1__py3-none-any.whl
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.
- python_cad_tools/__init__.py +10 -0
- python_cad_tools/_locking.py +63 -0
- python_cad_tools/_project_loader.py +273 -0
- python_cad_tools/_project_state.py +65 -0
- python_cad_tools/_scaffold.py +66 -0
- python_cad_tools/_transaction.py +208 -0
- python_cad_tools/_viewer_static/app.webmanifest +18 -0
- python_cad_tools/_viewer_static/asset-manifest.json +1 -0
- python_cad_tools/_viewer_static/assets/animationGroup-Sd34ntWg.js +1 -0
- python_cad_tools/_viewer_static/assets/bakedVertexAnimation-Cd_pRdrn.js +316 -0
- python_cad_tools/_viewer_static/assets/basisTextureLoader-DWgvS_1G.js +1 -0
- python_cad_tools/_viewer_static/assets/brdfTextureTools-CWGiG1W2.js +2 -0
- python_cad_tools/_viewer_static/assets/bumpFragment-CWULheF1.js +127 -0
- python_cad_tools/_viewer_static/assets/bumpVertex-DqzFZayE.js +6 -0
- python_cad_tools/_viewer_static/assets/bumpVertexDeclaration-C5EFyTio.js +6 -0
- python_cad_tools/_viewer_static/assets/clipPlaneFragment-BXRtt4jj.js +46 -0
- python_cad_tools/_viewer_static/assets/clipPlaneVertex-B_VhD1oQ.js +37 -0
- python_cad_tools/_viewer_static/assets/cubemapToSphericalPolynomial-DRpaukza.js +1 -0
- python_cad_tools/_viewer_static/assets/dds-Dkb2Cx2N.js +1 -0
- python_cad_tools/_viewer_static/assets/dds.pure-DtvJsKvY.js +1 -0
- python_cad_tools/_viewer_static/assets/ddsTextureLoader-H78xux1g.js +1 -0
- python_cad_tools/_viewer_static/assets/default.fragment-oSQ-tWhe.js +469 -0
- python_cad_tools/_viewer_static/assets/default.vertex-DhFjw_Da.js +209 -0
- python_cad_tools/_viewer_static/assets/defaultUboDeclaration-BMDHNppx.js +5 -0
- python_cad_tools/_viewer_static/assets/dumpTools-BaNZPjUX.js +2 -0
- python_cad_tools/_viewer_static/assets/envTextureLoader-V0YnLcIM.js +1 -0
- python_cad_tools/_viewer_static/assets/exrTextureLoader-CjGyIK3x.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphApplyForceBlock-CW5nuobR.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphApplyImpulseBlock-LFqYIkhj.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphArrayIndexBlock-BMOHUbBm.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphBezierCurveEasingBlock-knmTiuEk.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphBinaryOperationBlock-DFLuCAKJ.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphBranchBlock-BJRHMXMo.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphCachedOperationBlock-Dng-6jE0.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphCancelDelayBlock-CgbK3CQZ.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphCodeExecutionBlock-8zMtq9tg.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphConditionalDataBlock-BiLr2rkI.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphConsoleLogBlock-J1vcCtNP.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphConstantBlock-CFb5nuaV.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphContextBlock-DAeGVzhC.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphCounterBlock-lZlAQiJd.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphDataSwitchBlock-BIzvmbVy.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphDebounceBlock-DvNuMVwy.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphDebugBlock-Dymd2VEE.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphDoNBlock-v68aoNLH.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphEasingBlock-CTnGv92q.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphFlipFlopBlock-DXsO0Chw.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphForLoopBlock-CPpe9T75.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphFunctionReferenceBlock-DjDev4Pq.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphGLTFDataProvider-GIYCz4AQ.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphGetAngularVelocityBlock-BStkOVeL.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphGetAssetBlock-Eiqoivbz.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphGetLinearVelocityBlock-B0cpV5ws.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphGetPhysicsMassPropertiesBlock-B-H64yaI.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphGetPropertyBlock-CUyOsPw0.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphGetSoundVolumeBlock-C0FjrsUz.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphGetVariableBlock-O4597zBl.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphIndexOfBlock-E00Z3KXM.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphInterpolationBlock-DnkA9MNH.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphIsKeyPressedBlock-DDfeuAyf.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphIsSoundPlayingBlock-DMXg8jdM.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphJsonPointerParserBlock-OmCorK0y.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphKeyDownEventBlock-RuVtj6g2.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphKeyUpEventBlock-DO4pAfHi.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphKeyboardEventBlock-Bx3pAzzh.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphMathBlocks-7W1XYOC8.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphMathCombineExtractBlocks-a4f0Kv6e.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphMatrixMathBlocks-C5Z-y1Au.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphMeshPickEventBlock-D4m-I4CS.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphMultiGateBlock-BISVSMw6.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphPauseAnimationBlock-BYP2Z-HG.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphPauseSoundBlock-Drh1EeW6.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphPhysicsCollisionEventBlock-BoziAQ75.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphPlayAnimationBlock-Clry-68M.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphPlaySoundBlock-LbBVxGBE.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphPointerDownEventBlock-DIVXCSHh.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphPointerMoveEventBlock-BNNOzY2W.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphPointerOutEventBlock-B8f2dOFT.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphPointerOverEventBlock-CQr8LCee.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphPointerUpEventBlock-DMg_iEHl.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphReceiveCustomEventBlock-B8GJm9Ai.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphSceneReadyEventBlock-Dcdb29K2.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphSceneTickEventBlock-BLE5p4mi.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphSendCustomEventBlock-BMzDItQ5.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphSequenceBlock-DRURovjn.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphSetAngularVelocityBlock-Ba8dhkLM.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphSetDelayBlock-CnQR--Gn.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphSetLinearVelocityBlock-Dm1r3vkh.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphSetPhysicsMotionTypeBlock-BNtMLimi.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphSetPropertyBlock-C-uv2jhP.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphSetSoundVolumeBlock-D9LDx3lg.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphSetVariableBlock-DszzRB5X.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphSoundEndedEventBlock-DeTDSudb.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphStopAnimationBlock-DWuwoFWr.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphStopSoundBlock-DEnj2cQw.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphSwitchBlock-zs8Fp9ky.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphThrottleBlock-BYAKUQXd.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphTransformCoordinatesSystemBlock-DYP54m5P.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphTypeToTypeBlocks-vFwn79bS.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphUnaryOperationBlock-CaRh4Ef0.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphVectorMathBlocks-BEIhMs-A.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphWaitAllBlock-DFbELP_j.js +1 -0
- python_cad_tools/_viewer_static/assets/flowGraphWhileLoopBlock-C1OKQ-_F.js +1 -0
- python_cad_tools/_viewer_static/assets/fogFragment-DtDlQBnz.js +25 -0
- python_cad_tools/_viewer_static/assets/gaussianSplatting-Cfigjb15.js +242 -0
- python_cad_tools/_viewer_static/assets/gaussianSplatting-DIn8R8oF.js +296 -0
- python_cad_tools/_viewer_static/assets/gaussianSplatting.fragment-BxeRJ2k-.js +38 -0
- python_cad_tools/_viewer_static/assets/gaussianSplatting.fragment-DNDmvRs-.js +37 -0
- python_cad_tools/_viewer_static/assets/gaussianSplatting.vertex-D92z5jYn.js +86 -0
- python_cad_tools/_viewer_static/assets/gaussianSplatting.vertex-DSWfFnKQ.js +86 -0
- python_cad_tools/_viewer_static/assets/gaussianSplattingVoxel.fragment-DBQE2gDk.js +12 -0
- python_cad_tools/_viewer_static/assets/gaussianSplattingVoxel.fragment-qwx5ntqJ.js +17 -0
- python_cad_tools/_viewer_static/assets/gaussianSplattingVoxel.vertex-CP2kd3jU.js +30 -0
- python_cad_tools/_viewer_static/assets/gaussianSplattingVoxel.vertex-Dr-fEg_W.js +19 -0
- python_cad_tools/_viewer_static/assets/geometry.fragment-CsJIm2H0.js +242 -0
- python_cad_tools/_viewer_static/assets/geometry.fragment-Dph3muZt.js +262 -0
- python_cad_tools/_viewer_static/assets/geometry.vertex-BXGMTA_J.js +212 -0
- python_cad_tools/_viewer_static/assets/geometry.vertex-Bm9Wg3Gi.js +214 -0
- python_cad_tools/_viewer_static/assets/glowBlurPostProcess.fragment-BJSwKIJD.js +7 -0
- python_cad_tools/_viewer_static/assets/glowMapGeneration.fragment-DcyS1cTF.js +63 -0
- python_cad_tools/_viewer_static/assets/glowMapGeneration.vertex-BGq1Fakj.js +75 -0
- python_cad_tools/_viewer_static/assets/glowMapMerge.fragment-DxcneU_F.js +25 -0
- python_cad_tools/_viewer_static/assets/glowMapMerge.vertex-DaJJKqMV.js +8 -0
- python_cad_tools/_viewer_static/assets/harmonicsFunctions-DzJcvNWG.js +16 -0
- python_cad_tools/_viewer_static/assets/hdrTextureLoader-BGQvgh0h.js +2 -0
- python_cad_tools/_viewer_static/assets/helperFunctions-Cugfp1Fz.js +87 -0
- python_cad_tools/_viewer_static/assets/iesTextureLoader-CO4G0p2M.js +2 -0
- python_cad_tools/_viewer_static/assets/index-B2zBEWsq.js +7007 -0
- python_cad_tools/_viewer_static/assets/index-DcTTrc-8.css +1 -0
- python_cad_tools/_viewer_static/assets/kernelBlur.fragment-B6CTXTxY.js +57 -0
- python_cad_tools/_viewer_static/assets/kernelBlur.fragment-BkKbudbW.js +57 -0
- python_cad_tools/_viewer_static/assets/kernelBlur.vertex-BYwFU5IS.js +11 -0
- python_cad_tools/_viewer_static/assets/kernelBlur.vertex-D371zUfT.js +11 -0
- python_cad_tools/_viewer_static/assets/kernelBlurVaryingDeclaration-CgBGaCHg.js +1 -0
- python_cad_tools/_viewer_static/assets/kernelBlurVaryingDeclaration-YS8JpqdO.js +1 -0
- python_cad_tools/_viewer_static/assets/ktxTextureLoader-ncMSJTjl.js +1 -0
- python_cad_tools/_viewer_static/assets/lightFragment-skHiFbKB.js +398 -0
- python_cad_tools/_viewer_static/assets/logDepthDeclaration-BR8XRz9F.js +4 -0
- python_cad_tools/_viewer_static/assets/logDepthVertex-UKrhEIvg.js +14 -0
- python_cad_tools/_viewer_static/assets/mainUVVaryingDeclaration-BxQWGFcG.js +4 -0
- python_cad_tools/_viewer_static/assets/mesh.vertexData.functions-ayNlGC5K.js +1 -0
- python_cad_tools/_viewer_static/assets/meshUboDeclaration-BnX046aQ.js +4 -0
- python_cad_tools/_viewer_static/assets/oitFragment-CTMCOfNP.js +605 -0
- python_cad_tools/_viewer_static/assets/openpbr.fragment-DPJPqi6p.js +1530 -0
- python_cad_tools/_viewer_static/assets/openpbr.fragment-Dv6qTVVi.js +1384 -0
- python_cad_tools/_viewer_static/assets/openpbr.vertex-Bn2wrdGL.js +364 -0
- python_cad_tools/_viewer_static/assets/openpbr.vertex-CHESW3gB.js +251 -0
- python_cad_tools/_viewer_static/assets/openpbrMaterial.pure-BdK7VgO_.js +3 -0
- python_cad_tools/_viewer_static/assets/openpbrMaterialLoadingAdapter-Bm_AHDUN.js +4 -0
- python_cad_tools/_viewer_static/assets/openpbrTransmissionLayerData-BDa9qEoN.js +339 -0
- python_cad_tools/_viewer_static/assets/openpbrTransmissionLayerData-Ba_ly4LE.js +343 -0
- python_cad_tools/_viewer_static/assets/openpbrUboDeclaration-BY2lSH2C.js +5 -0
- python_cad_tools/_viewer_static/assets/openpbrUboDeclaration-DajhikDS.js +6 -0
- python_cad_tools/_viewer_static/assets/packingFunctions-BHPwcGG2.js +4 -0
- python_cad_tools/_viewer_static/assets/packingFunctions-DTwzBRBx.js +4 -0
- python_cad_tools/_viewer_static/assets/pass.fragment-9oKU4pI3.js +4 -0
- python_cad_tools/_viewer_static/assets/passCube.fragment-CpAeiYx1.js +23 -0
- python_cad_tools/_viewer_static/assets/passCube.fragment-DHtSWVRF.js +23 -0
- python_cad_tools/_viewer_static/assets/pbr.fragment-cIhMKwLs.js +2560 -0
- python_cad_tools/_viewer_static/assets/pbr.vertex-BfdONsf2.js +255 -0
- python_cad_tools/_viewer_static/assets/pbrBRDFFunctions-B_ppOzPO.js +173 -0
- python_cad_tools/_viewer_static/assets/pbrDebug-DDdwL5_t.js +693 -0
- python_cad_tools/_viewer_static/assets/pbrIBLFunctions-b1zdpzOP.js +43 -0
- python_cad_tools/_viewer_static/assets/pbrMaterial.pure-BZA7yVhu.js +2 -0
- python_cad_tools/_viewer_static/assets/pbrMaterialLoadingAdapter-BRvKRnjl.js +1 -0
- python_cad_tools/_viewer_static/assets/pbrUboDeclaration-CMZp25k3.js +5 -0
- python_cad_tools/_viewer_static/assets/postprocess.vertex-DzdUpNbW.js +9 -0
- python_cad_tools/_viewer_static/assets/procedural.vertex-BnbuQ-1f.js +7 -0
- python_cad_tools/_viewer_static/assets/procedural.vertex-Dp-Ng7Pc.js +8 -0
- python_cad_tools/_viewer_static/assets/reflectionFunction-DBlr3oDs.js +83 -0
- python_cad_tools/_viewer_static/assets/rgbdDecode.fragment-CyvnZFOJ.js +5 -0
- python_cad_tools/_viewer_static/assets/rgbdEncode.fragment-Dz4zLnoD.js +5 -0
- python_cad_tools/_viewer_static/assets/rgbdEncode.fragment-iscgpA1_.js +5 -0
- python_cad_tools/_viewer_static/assets/sceneUboDeclaration-BzFIc4mb.js +11 -0
- python_cad_tools/_viewer_static/assets/textureProcessor.fragment-C9D0rd-M.js +151 -0
- python_cad_tools/_viewer_static/assets/textureProcessor.fragment-JMKyWZng.js +146 -0
- python_cad_tools/_viewer_static/assets/tgaTextureLoader-oxTElIQJ.js +1 -0
- python_cad_tools/_viewer_static/assets/vertexColorMixing-mdC9xZe1.js +418 -0
- python_cad_tools/_viewer_static/favicon.svg +10 -0
- python_cad_tools/_viewer_static/index.html +18 -0
- python_cad_tools/_viewer_static/sw.js +61 -0
- python_cad_tools/artifacts.py +546 -0
- python_cad_tools/build-info.json +1 -0
- python_cad_tools/build.py +270 -0
- python_cad_tools/cli.py +212 -0
- python_cad_tools/context.py +67 -0
- python_cad_tools/determinism.py +66 -0
- python_cad_tools/drawings/__init__.py +124 -0
- python_cad_tools/drawings/_catalog.py +79 -0
- python_cad_tools/drawings/_validation.py +238 -0
- python_cad_tools/elements.py +121 -0
- python_cad_tools/exceptions.py +45 -0
- python_cad_tools/exporters/__init__.py +8 -0
- python_cad_tools/exporters/base.py +24 -0
- python_cad_tools/exporters/drawings/__init__.py +5 -0
- python_cad_tools/exporters/drawings/annotations.py +444 -0
- python_cad_tools/exporters/drawings/dxf.py +110 -0
- python_cad_tools/exporters/drawings/model.py +70 -0
- python_cad_tools/exporters/drawings/pdf.py +119 -0
- python_cad_tools/exporters/drawings/primitives.py +93 -0
- python_cad_tools/exporters/drawings/projection.py +64 -0
- python_cad_tools/exporters/drawings/svg.py +135 -0
- python_cad_tools/exporters/glb.py +100 -0
- python_cad_tools/exporters/ifc.py +229 -0
- python_cad_tools/exporters/quantities.py +136 -0
- python_cad_tools/exporters/step.py +117 -0
- python_cad_tools/geometry.py +187 -0
- python_cad_tools/manifests.py +338 -0
- python_cad_tools/project_config.py +174 -0
- python_cad_tools/py.typed +1 -0
- python_cad_tools/runtime_sync.py +126 -0
- python_cad_tools/schemas/build-manifest-1.json +1 -0
- python_cad_tools/schemas/design-manifest-1.json +1 -0
- python_cad_tools/schemas/download-manifest-2.json +46 -0
- python_cad_tools/schemas/drawing-annotations-1.json +66 -0
- python_cad_tools/schemas/glb-manifest-1.json +1 -0
- python_cad_tools/schemas/ifc-validation-1.json +1 -0
- python_cad_tools/schemas/quantities-1.json +1 -0
- python_cad_tools/schemas/run-metadata-1.json +1 -0
- python_cad_tools/schemas/site-metadata-1.json +34 -0
- python_cad_tools/schemas/step-validation-1.json +1 -0
- python_cad_tools/site.py +676 -0
- python_cad_tools/templates/project/.gitignore +9 -0
- python_cad_tools/templates/project/README.md +38 -0
- python_cad_tools/templates/project/config.py +36 -0
- python_cad_tools/templates/project/drawing_annotations.py +117 -0
- python_cad_tools/templates/project/model.py +87 -0
- python_cad_tools/templates/project/pyproject.toml +27 -0
- python_cad_tools/units.py +207 -0
- python_cad_tools/validation.py +153 -0
- python_cad_tools-0.1.0rc1.dist-info/METADATA +149 -0
- python_cad_tools-0.1.0rc1.dist-info/RECORD +236 -0
- python_cad_tools-0.1.0rc1.dist-info/WHEEL +5 -0
- python_cad_tools-0.1.0rc1.dist-info/entry_points.txt +2 -0
- python_cad_tools-0.1.0rc1.dist-info/licenses/LICENSE +679 -0
- python_cad_tools-0.1.0rc1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import{S as e}from"./index-B2zBEWsq.js";import{c as n,a as f}from"./clipPlaneFragment-BXRtt4jj.js";import{b as t,a as o,c as s}from"./bumpFragment-CWULheF1.js";import{s as l,r as d}from"./reflectionFunction-DBlr3oDs.js";import{h as c}from"./helperFunctions-Cugfp1Fz.js";import{p as m,a as v}from"./pbrIBLFunctions-b1zdpzOP.js";import{s as u}from"./sceneUboDeclaration-BzFIc4mb.js";import{p as S}from"./pbrBRDFFunctions-B_ppOzPO.js";import{o as p,a as E,b as R,c as T,d as I}from"./openpbrTransmissionLayerData-Ba_ly4LE.js";const r="geometryPixelShader",a=`#ifdef BUMP
|
|
2
|
+
varying vWorldView0: vec4f;varying vWorldView1: vec4f;varying vWorldView2: vec4f;varying vWorldView3: vec4f;varying vNormalW: vec3f;
|
|
3
|
+
#else
|
|
4
|
+
varying vNormalV: vec3f;
|
|
5
|
+
#endif
|
|
6
|
+
varying vViewPos: vec4f;
|
|
7
|
+
#if defined(POSITION) || defined(BUMP) || defined(IRRADIANCE)
|
|
8
|
+
varying vPositionW: vec3f;
|
|
9
|
+
#endif
|
|
10
|
+
#if defined(VELOCITY) || defined(VELOCITY_LINEAR)
|
|
11
|
+
varying vCurrentPosition: vec4f;varying vPreviousPosition: vec4f;
|
|
12
|
+
#endif
|
|
13
|
+
#ifdef NEED_UV
|
|
14
|
+
varying vUV: vec2f;
|
|
15
|
+
#endif
|
|
16
|
+
#ifdef BUMP
|
|
17
|
+
uniform vBumpInfos: vec3f;uniform vTangentSpaceParams: vec2f;
|
|
18
|
+
#endif
|
|
19
|
+
#if defined(REFLECTIVITY)
|
|
20
|
+
#if defined(ORMTEXTURE) || defined(SPECULARGLOSSINESSTEXTURE) || defined(REFLECTIVITYTEXTURE)
|
|
21
|
+
var reflectivitySamplerSampler: sampler;var reflectivitySampler: texture_2d<f32>;varying vReflectivityUV: vec2f;
|
|
22
|
+
#else
|
|
23
|
+
#ifdef METALLIC_TEXTURE
|
|
24
|
+
var metallicSamplerSampler: sampler;var metallicSampler: texture_2d<f32>;varying vMetallicUV: vec2f;
|
|
25
|
+
#endif
|
|
26
|
+
#ifdef ROUGHNESS_TEXTURE
|
|
27
|
+
var roughnessSamplerSampler: sampler;var roughnessSampler: texture_2d<f32>;varying vRoughnessUV: vec2f;
|
|
28
|
+
#endif
|
|
29
|
+
#endif
|
|
30
|
+
#ifdef ALBEDOTEXTURE
|
|
31
|
+
varying vAlbedoUV: vec2f;var albedoSamplerSampler: sampler;var albedoSampler: texture_2d<f32>;
|
|
32
|
+
#endif
|
|
33
|
+
#ifdef REFLECTIVITYCOLOR
|
|
34
|
+
uniform reflectivityColor: vec3f;
|
|
35
|
+
#endif
|
|
36
|
+
#ifdef ALBEDOCOLOR
|
|
37
|
+
uniform albedoColor: vec3f;
|
|
38
|
+
#endif
|
|
39
|
+
#ifdef METALLIC
|
|
40
|
+
uniform metallic: f32;
|
|
41
|
+
#endif
|
|
42
|
+
#if defined(ROUGHNESS) || defined(GLOSSINESS)
|
|
43
|
+
uniform glossiness: f32;
|
|
44
|
+
#endif
|
|
45
|
+
#endif
|
|
46
|
+
#if defined(ALPHATEST) && defined(NEED_UV)
|
|
47
|
+
var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;
|
|
48
|
+
#endif
|
|
49
|
+
#include<clipPlaneFragmentDeclaration>
|
|
50
|
+
#include<bumpFragmentMainFunctions>
|
|
51
|
+
#include<bumpFragmentFunctions>
|
|
52
|
+
#include<helperFunctions>
|
|
53
|
+
#ifdef IRRADIANCE
|
|
54
|
+
#include<pbrFragmentReflectionDeclaration>
|
|
55
|
+
#ifdef REFLECTION
|
|
56
|
+
#ifdef USEIRRADIANCEMAP
|
|
57
|
+
#include<sceneUboDeclaration>
|
|
58
|
+
uniform reflectionMatrix: mat4x4f;uniform vReflectionInfos: vec2f;uniform vReflectionDominantDirection: vec3f;
|
|
59
|
+
#include<pbrBRDFFunctions>
|
|
60
|
+
#include<openpbrDielectricReflectance>
|
|
61
|
+
#include<pbrIBLFunctions>
|
|
62
|
+
#include<reflectionFunction>
|
|
63
|
+
#include<openpbrGeometryInfo>
|
|
64
|
+
#include<openpbrIblFunctions>
|
|
65
|
+
#elif defined(USESPHERICALFROMREFLECTIONMAP)
|
|
66
|
+
varying vEnvironmentIrradiance: vec3f;
|
|
67
|
+
#endif
|
|
68
|
+
#ifdef IBL_SHADOW_TEXTURE
|
|
69
|
+
var iblShadowSampler: texture_2d<f32>;var iblShadowSamplerSampler: sampler;uniform shadowTextureSize: vec2f;
|
|
70
|
+
#endif
|
|
71
|
+
#ifdef IRRADIANCE_SCATTER_MASK
|
|
72
|
+
uniform vSubsurfaceWeight: f32;
|
|
73
|
+
#include<samplerFragmentDeclaration>(_DEFINENAME_,SUBSURFACE_WEIGHT,_VARYINGNAME_,SubsurfaceWeight,_SAMPLERNAME_,subsurfaceWeight)
|
|
74
|
+
uniform vSubsurfaceScatterAnisotropy: f32;uniform vTransmissionWeight: f32;
|
|
75
|
+
#include<samplerFragmentDeclaration>(_DEFINENAME_,TRANSMISSION_WEIGHT,_VARYINGNAME_,TransmissionWeight,_SAMPLERNAME_,transmissionWeight)
|
|
76
|
+
uniform vTransmissionScatterAnisotropy: f32;
|
|
77
|
+
#endif
|
|
78
|
+
#endif
|
|
79
|
+
#endif
|
|
80
|
+
@fragment
|
|
81
|
+
fn main(input: FragmentInputs)->FragmentOutputs {
|
|
82
|
+
#include<clipPlaneFragment>
|
|
83
|
+
#ifdef ALPHATEST
|
|
84
|
+
if (textureSample(diffuseSampler,diffuseSamplerSampler,input.vUV).a<0.4) {discard;}
|
|
85
|
+
#endif
|
|
86
|
+
var normalOutput: vec3f;
|
|
87
|
+
#ifdef BUMP
|
|
88
|
+
var normalW: vec3f=normalize(input.vNormalW);
|
|
89
|
+
#include<bumpFragment>
|
|
90
|
+
#ifdef NORMAL_WORLDSPACE
|
|
91
|
+
normalOutput=normalW;
|
|
92
|
+
#else
|
|
93
|
+
normalOutput=normalize( (mat4x4f(input.vWorldView0,input.vWorldView1,input.vWorldView2,input.vWorldView3)* vec4f(normalW,0.0)).xyz);
|
|
94
|
+
#endif
|
|
95
|
+
#elif defined(HAS_NORMAL_ATTRIBUTE)
|
|
96
|
+
normalOutput=normalize(input.vNormalV);
|
|
97
|
+
#elif defined(POSITION)
|
|
98
|
+
normalOutput=normalize(-cross(dpdx(input.vPositionW),dpdy(input.vPositionW)));
|
|
99
|
+
#endif
|
|
100
|
+
#ifdef ENCODE_NORMAL
|
|
101
|
+
normalOutput=normalOutput*0.5+0.5;
|
|
102
|
+
#endif
|
|
103
|
+
var fragData: array<vec4<f32>,SCENE_MRT_COUNT>;
|
|
104
|
+
#ifdef DEPTH
|
|
105
|
+
fragData[DEPTH_INDEX]=vec4f(input.vViewPos.z/input.vViewPos.w,0.0,0.0,1.0);
|
|
106
|
+
#endif
|
|
107
|
+
#ifdef NORMAL
|
|
108
|
+
fragData[NORMAL_INDEX]=vec4f(normalOutput,1.0);
|
|
109
|
+
#endif
|
|
110
|
+
#ifdef SCREENSPACE_DEPTH
|
|
111
|
+
fragData[SCREENSPACE_DEPTH_INDEX]=vec4f(fragmentInputs.position.z,0.0,0.0,1.0);
|
|
112
|
+
#endif
|
|
113
|
+
#ifdef POSITION
|
|
114
|
+
fragData[POSITION_INDEX]= vec4f(input.vPositionW,1.0);
|
|
115
|
+
#endif
|
|
116
|
+
#ifdef VELOCITY
|
|
117
|
+
var a: vec2f=(input.vCurrentPosition.xy/input.vCurrentPosition.w)*0.5+0.5;var b: vec2f=(input.vPreviousPosition.xy/input.vPreviousPosition.w)*0.5+0.5;var velocity: vec2f=abs(a-b);velocity= vec2f(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;fragData[VELOCITY_INDEX]= vec4f(velocity,0.0,1.0);
|
|
118
|
+
#endif
|
|
119
|
+
#ifdef VELOCITY_LINEAR
|
|
120
|
+
var velocity : vec2f=vec2f(0.5)*((input.vPreviousPosition.xy /
|
|
121
|
+
input.vPreviousPosition.w) -
|
|
122
|
+
(input.vCurrentPosition.xy /
|
|
123
|
+
input.vCurrentPosition.w));fragData[VELOCITY_LINEAR_INDEX]=vec4f(velocity,0.0,1.0);
|
|
124
|
+
#endif
|
|
125
|
+
#ifdef REFLECTIVITY
|
|
126
|
+
var reflectivity: vec4f= vec4f(0.0,0.0,0.0,1.0);
|
|
127
|
+
#ifdef METALLICWORKFLOW
|
|
128
|
+
var metal: f32=1.0;var roughness: f32=1.0;
|
|
129
|
+
#ifdef ORMTEXTURE
|
|
130
|
+
metal*=textureSample(reflectivitySampler,reflectivitySamplerSampler,input.vReflectivityUV).b;roughness*=textureSample(reflectivitySampler,reflectivitySamplerSampler,input.vReflectivityUV).g;
|
|
131
|
+
#else
|
|
132
|
+
#ifdef METALLIC_TEXTURE
|
|
133
|
+
metal*=textureSample(metallicSampler,metallicSamplerSampler,input.vMetallicUV).r;
|
|
134
|
+
#endif
|
|
135
|
+
#ifdef ROUGHNESS_TEXTURE
|
|
136
|
+
roughness*=textureSample(roughnessSampler,roughnessSamplerSampler,input.vRoughnessUV).r;
|
|
137
|
+
#endif
|
|
138
|
+
#endif
|
|
139
|
+
#ifdef METALLIC
|
|
140
|
+
metal*=uniforms.metallic;
|
|
141
|
+
#endif
|
|
142
|
+
#ifdef ROUGHNESS
|
|
143
|
+
roughness*=(1.0-uniforms.glossiness);
|
|
144
|
+
#endif
|
|
145
|
+
reflectivity=vec4f(reflectivity.rgb,reflectivity.a-roughness);var color: vec3f= vec3f(1.0);
|
|
146
|
+
#ifdef ALBEDOTEXTURE
|
|
147
|
+
color=textureSample(albedoSampler,albedoSamplerSampler,input.vAlbedoUV).rgb;
|
|
148
|
+
#ifdef GAMMAALBEDO
|
|
149
|
+
color=toLinearSpaceVec4(color);
|
|
150
|
+
#endif
|
|
151
|
+
#endif
|
|
152
|
+
#ifdef ALBEDOCOLOR
|
|
153
|
+
color*=uniforms.albedoColor.xyz;
|
|
154
|
+
#endif
|
|
155
|
+
reflectivity=vec4f(mix( vec3f(0.04),color,metal),reflectivity.a);
|
|
156
|
+
#else
|
|
157
|
+
#if defined(SPECULARGLOSSINESSTEXTURE) || defined(REFLECTIVITYTEXTURE)
|
|
158
|
+
reflectivity=textureSample(reflectivitySampler,reflectivitySamplerSampler,input.vReflectivityUV);
|
|
159
|
+
#ifdef GAMMAREFLECTIVITYTEXTURE
|
|
160
|
+
reflectivity=vec4f(toLinearSpaceVec3(reflectivity.rgb),reflectivity.a);
|
|
161
|
+
#endif
|
|
162
|
+
#else
|
|
163
|
+
#ifdef REFLECTIVITYCOLOR
|
|
164
|
+
reflectivity=vec4f(toLinearSpaceVec3(uniforms.reflectivityColor.xyz),1.0);
|
|
165
|
+
#endif
|
|
166
|
+
#endif
|
|
167
|
+
#ifdef GLOSSINESSS
|
|
168
|
+
reflectivity=vec4f(reflectivity.rgb,reflectivity.a*glossiness);
|
|
169
|
+
#endif
|
|
170
|
+
#endif
|
|
171
|
+
fragData[REFLECTIVITY_INDEX]=reflectivity;
|
|
172
|
+
#endif
|
|
173
|
+
#ifdef IRRADIANCE
|
|
174
|
+
var irradiance: vec3f=vec3f(0.0);var irradiance_alpha: f32=1.0;
|
|
175
|
+
#ifdef REFLECTION
|
|
176
|
+
#ifdef IRRADIANCE_SCATTER_MASK
|
|
177
|
+
#ifndef BUMP
|
|
178
|
+
let uvOffset: vec2f=vec2f(0.0);
|
|
179
|
+
#endif
|
|
180
|
+
var vSubsurfaceColor: vec3f=vec3f(1.0);var vSubsurfaceRadius: f32=0.0;var vSubsurfaceRadiusScale: vec3f=vec3f(1.0);
|
|
181
|
+
#include<openpbrSubsurfaceLayerData>(uniforms.vSubsurfaceColor,vSubsurfaceColor,uniforms.vSubsurfaceRadius,vSubsurfaceRadius,uniforms.vSubsurfaceRadiusScale,vSubsurfaceRadiusScale)
|
|
182
|
+
var vTransmissionDepth: f32=1.0;var vTransmissionColor: vec3f=vec3f(1.0);var vTransmissionScatter: vec3f=vec3f(0.0);var vTransmissionDispersionScale: f32=0.0;var vTransmissionDispersionAbbeNumber: f32=0.0;
|
|
183
|
+
#include<openpbrTransmissionLayerData>(uniforms.vTransmissionDispersionScale,vTransmissionDispersionScale,uniforms.vTransmissionDispersionAbbeNumber,vTransmissionDispersionAbbeNumber,uniforms.vTransmissionColor,vTransmissionColor,uniforms.vTransmissionDepth,vTransmissionDepth,uniforms.vTransmissionScatter\\.,vTransmissionScatter.)
|
|
184
|
+
#endif
|
|
185
|
+
#ifdef IBL_SHADOW_TEXTURE
|
|
186
|
+
#ifdef COLORED_IBL_SHADOWS
|
|
187
|
+
let iblShadowValue: vec3f=textureSample(iblShadowSampler,iblShadowSamplerSampler,fragmentInputs.position.xy/uniforms.shadowTextureSize).rgb;
|
|
188
|
+
#else
|
|
189
|
+
let iblShadowValue: vec3f=vec3f(textureSample(iblShadowSampler,iblShadowSamplerSampler,fragmentInputs.position.xy/uniforms.shadowTextureSize).r);
|
|
190
|
+
#endif
|
|
191
|
+
#endif
|
|
192
|
+
#if defined(USEIRRADIANCEMAP)
|
|
193
|
+
#ifdef IRRADIANCE_SCATTER_MASK
|
|
194
|
+
let bendAmount: f32=subsurface_weight*-min(subsurface_scatter_anisotropy,0.0);let mixedBendAmount: f32=mix(bendAmount,-min(transmission_scatter_anisotropy,0.0),transmission_weight);let viewVector: vec3f=normalize(scene.vEyePosition.xyz-input.vPositionW);let bentNormal: vec3f=mix(normalOutput,viewVector,mixedBendAmount*dot(normalOutput,viewVector));
|
|
195
|
+
#else
|
|
196
|
+
let bentNormal: vec3f=normalOutput;
|
|
197
|
+
#endif
|
|
198
|
+
irradiance=sampleIrradiance(
|
|
199
|
+
bentNormal
|
|
200
|
+
#if defined(NORMAL) && defined(USESPHERICALINVERTEX)
|
|
201
|
+
,input.vEnvironmentIrradiance
|
|
202
|
+
#endif
|
|
203
|
+
#if (defined(USESPHERICALFROMREFLECTIONMAP) && (!defined(NORMAL) || !defined(USESPHERICALINVERTEX))) || (defined(USEIRRADIANCEMAP) && defined(REFLECTIONMAP_3D))
|
|
204
|
+
,uniforms.reflectionMatrix
|
|
205
|
+
#endif
|
|
206
|
+
#ifdef USEIRRADIANCEMAP
|
|
207
|
+
,irradianceSampler
|
|
208
|
+
,irradianceSamplerSampler
|
|
209
|
+
#ifdef USE_IRRADIANCE_DOMINANT_DIRECTION
|
|
210
|
+
,uniforms.vReflectionDominantDirection
|
|
211
|
+
#endif
|
|
212
|
+
#endif
|
|
213
|
+
#ifdef REALTIME_FILTERING
|
|
214
|
+
,uniforms.vReflectionFilteringInfo
|
|
215
|
+
#ifdef IBL_CDF_FILTERING
|
|
216
|
+
,icdfSampler
|
|
217
|
+
,icdfSamplerSampler
|
|
218
|
+
#endif
|
|
219
|
+
#endif
|
|
220
|
+
,uniforms.vReflectionInfos
|
|
221
|
+
,input.vViewPos.xyz
|
|
222
|
+
,1.0
|
|
223
|
+
,vec3f(1.0)
|
|
224
|
+
);
|
|
225
|
+
#elif defined(USESPHERICALFROMREFLECTIONMAP)
|
|
226
|
+
irradiance=input.vEnvironmentIrradiance;
|
|
227
|
+
#endif
|
|
228
|
+
#ifdef IBL_SHADOW_TEXTURE
|
|
229
|
+
irradiance*=iblShadowValue;
|
|
230
|
+
#endif
|
|
231
|
+
#ifdef IRRADIANCE_SCATTER_MASK
|
|
232
|
+
irradiance_alpha=min(subsurface_weight+transmission_weight,1.0);
|
|
233
|
+
#endif
|
|
234
|
+
#endif
|
|
235
|
+
fragData[IRRADIANCE_INDEX]=vec4f(irradiance,irradiance_alpha);
|
|
236
|
+
#endif
|
|
237
|
+
#if SCENE_MRT_COUNT>0
|
|
238
|
+
fragmentOutputs.fragData0=fragData[0];
|
|
239
|
+
#endif
|
|
240
|
+
#if SCENE_MRT_COUNT>1
|
|
241
|
+
fragmentOutputs.fragData1=fragData[1];
|
|
242
|
+
#endif
|
|
243
|
+
#if SCENE_MRT_COUNT>2
|
|
244
|
+
fragmentOutputs.fragData2=fragData[2];
|
|
245
|
+
#endif
|
|
246
|
+
#if SCENE_MRT_COUNT>3
|
|
247
|
+
fragmentOutputs.fragData3=fragData[3];
|
|
248
|
+
#endif
|
|
249
|
+
#if SCENE_MRT_COUNT>4
|
|
250
|
+
fragmentOutputs.fragData4=fragData[4];
|
|
251
|
+
#endif
|
|
252
|
+
#if SCENE_MRT_COUNT>5
|
|
253
|
+
fragmentOutputs.fragData5=fragData[5];
|
|
254
|
+
#endif
|
|
255
|
+
#if SCENE_MRT_COUNT>6
|
|
256
|
+
fragmentOutputs.fragData6=fragData[6];
|
|
257
|
+
#endif
|
|
258
|
+
#if SCENE_MRT_COUNT>7
|
|
259
|
+
fragmentOutputs.fragData7=fragData[7];
|
|
260
|
+
#endif
|
|
261
|
+
}
|
|
262
|
+
`;e.ShadersStoreWGSL[r]||(e.ShadersStoreWGSL[r]=a);const A=[n,t,l,o,c,m,u,S,p,v,d,E,R,f,s,T,I];for(const i of A)e.IncludesShadersStoreWGSL[i.name]||(e.IncludesShadersStoreWGSL[i.name]=i.shader);const P={name:r,shader:a};export{P as geometryPixelShaderWGSL};
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import{S as e}from"./index-B2zBEWsq.js";import{b as n,a as f,m as o,c as v,i as a,d as s,e as d,f as u,g as c,h as l}from"./bakedVertexAnimation-Cd_pRdrn.js";import{s as m}from"./sceneUboDeclaration-BzFIc4mb.js";import{c as p,a as x}from"./clipPlaneVertex-B_VhD1oQ.js";import{h as U}from"./harmonicsFunctions-DzJcvNWG.js";import{b as E}from"./bumpVertex-DqzFZayE.js";const r="geometryVertexShader",t=`#include<bonesDeclaration>
|
|
2
|
+
#include<bakedVertexAnimationDeclaration>
|
|
3
|
+
#include<morphTargetsVertexGlobalDeclaration>
|
|
4
|
+
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
|
|
5
|
+
#include<instancesDeclaration>
|
|
6
|
+
#include<sceneUboDeclaration>
|
|
7
|
+
#include<clipPlaneVertexDeclaration>
|
|
8
|
+
#ifdef IRRADIANCE
|
|
9
|
+
#ifdef REFLECTION
|
|
10
|
+
uniform reflectionMatrix: mat4x4f;uniform vReflectionInfos: vec2f;uniform vReflectionColor: vec3f;
|
|
11
|
+
#ifdef USESPHERICALFROMREFLECTIONMAP
|
|
12
|
+
varying vEnvironmentIrradiance: vec3f;
|
|
13
|
+
#ifdef SPHERICAL_HARMONICS
|
|
14
|
+
uniform vSphericalL00: vec3f;uniform vSphericalL1_1: vec3f;uniform vSphericalL10: vec3f;uniform vSphericalL11: vec3f;uniform vSphericalL2_2: vec3f;uniform vSphericalL2_1: vec3f;uniform vSphericalL20: vec3f;uniform vSphericalL21: vec3f;uniform vSphericalL22: vec3f;
|
|
15
|
+
#else
|
|
16
|
+
uniform vSphericalX: vec3f;uniform vSphericalY: vec3f;uniform vSphericalZ: vec3f;uniform vSphericalXX_ZZ: vec3f;uniform vSphericalYY_ZZ: vec3f;uniform vSphericalZZ: vec3f;uniform vSphericalXY: vec3f;uniform vSphericalYZ: vec3f;uniform vSphericalZX: vec3f;
|
|
17
|
+
#endif
|
|
18
|
+
#include<harmonicsFunctions>
|
|
19
|
+
#endif
|
|
20
|
+
#endif
|
|
21
|
+
#endif
|
|
22
|
+
attribute position : vec3<f32>;
|
|
23
|
+
#ifdef HAS_NORMAL_ATTRIBUTE
|
|
24
|
+
attribute normal: vec3f;
|
|
25
|
+
#endif
|
|
26
|
+
#ifdef NEED_UV
|
|
27
|
+
varying vUV: vec2f;
|
|
28
|
+
#ifdef ALPHATEST
|
|
29
|
+
uniform diffuseMatrix: mat4x4f;
|
|
30
|
+
#endif
|
|
31
|
+
#ifdef BUMP
|
|
32
|
+
uniform bumpMatrix: mat4x4f;varying vBumpUV: vec2f;
|
|
33
|
+
#endif
|
|
34
|
+
#ifdef REFLECTIVITY
|
|
35
|
+
uniform reflectivityMatrix: mat4x4f;uniform albedoMatrix: mat4x4f;varying vReflectivityUV: vec2f;varying vAlbedoUV: vec2f;
|
|
36
|
+
#endif
|
|
37
|
+
#ifdef METALLIC_TEXTURE
|
|
38
|
+
varying vMetallicUV: vec2f;uniform metallicMatrix: mat4x4f;
|
|
39
|
+
#endif
|
|
40
|
+
#ifdef ROUGHNESS_TEXTURE
|
|
41
|
+
varying vRoughnessUV: vec2f;uniform roughnessMatrix: mat4x4f;
|
|
42
|
+
#endif
|
|
43
|
+
#ifdef SUBSURFACE_WEIGHT
|
|
44
|
+
varying vSubsurfaceWeightUV: vec2f;uniform subsurfaceWeightMatrix: mat4x4f;
|
|
45
|
+
#endif
|
|
46
|
+
#ifdef TRANSMISSION_WEIGHT
|
|
47
|
+
varying vTransmissionWeightUV: vec2f;uniform transmissionWeightMatrix: mat4x4f;
|
|
48
|
+
#endif
|
|
49
|
+
#ifdef UV1
|
|
50
|
+
attribute uv: vec2f;
|
|
51
|
+
#endif
|
|
52
|
+
#ifdef UV2
|
|
53
|
+
attribute uv2: vec2f;
|
|
54
|
+
#endif
|
|
55
|
+
#endif
|
|
56
|
+
#ifdef BUMP
|
|
57
|
+
varying vWorldView0: vec4f;varying vWorldView1: vec4f;varying vWorldView2: vec4f;varying vWorldView3: vec4f;
|
|
58
|
+
#endif
|
|
59
|
+
#ifdef BUMP
|
|
60
|
+
varying vNormalW: vec3f;
|
|
61
|
+
#else
|
|
62
|
+
varying vNormalV: vec3f;
|
|
63
|
+
#endif
|
|
64
|
+
varying vViewPos: vec4f;
|
|
65
|
+
#if defined(POSITION) || defined(BUMP) || defined(IRRADIANCE)
|
|
66
|
+
varying vPositionW: vec3f;
|
|
67
|
+
#endif
|
|
68
|
+
#if defined(VELOCITY) || defined(VELOCITY_LINEAR)
|
|
69
|
+
uniform previousViewProjection: mat4x4f;varying vCurrentPosition: vec4f;varying vPreviousPosition: vec4f;
|
|
70
|
+
#endif
|
|
71
|
+
#define CUSTOM_VERTEX_DEFINITIONS
|
|
72
|
+
@vertex
|
|
73
|
+
fn main(input : VertexInputs)->FragmentInputs {var positionUpdated: vec3f=vertexInputs.position;
|
|
74
|
+
#ifdef HAS_NORMAL_ATTRIBUTE
|
|
75
|
+
var normalUpdated: vec3f=vertexInputs.normal;
|
|
76
|
+
#else
|
|
77
|
+
var normalUpdated: vec3f=vec3f(0.0,0.0,0.0);
|
|
78
|
+
#endif
|
|
79
|
+
#ifdef UV1
|
|
80
|
+
var uvUpdated: vec2f=vertexInputs.uv;
|
|
81
|
+
#endif
|
|
82
|
+
#ifdef UV2
|
|
83
|
+
var uv2Updated: vec2f=vertexInputs.uv2;
|
|
84
|
+
#endif
|
|
85
|
+
#include<morphTargetsVertexGlobal>
|
|
86
|
+
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
|
|
87
|
+
#include<instancesVertex>
|
|
88
|
+
#if (defined(VELOCITY) || defined(VELOCITY_LINEAR)) && !defined(BONES_VELOCITY_ENABLED)
|
|
89
|
+
vCurrentPosition=scene.viewProjection*finalWorld*vec4f(positionUpdated,1.0);vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld* vec4f(positionUpdated,1.0);
|
|
90
|
+
#endif
|
|
91
|
+
#include<bonesVertex>
|
|
92
|
+
#include<bakedVertexAnimation>
|
|
93
|
+
var worldPos: vec4f= vec4f(finalWorld* vec4f(positionUpdated,1.0));
|
|
94
|
+
#ifdef BUMP
|
|
95
|
+
let vWorldView=scene.view*finalWorld;vertexOutputs.vWorldView0=vWorldView[0];vertexOutputs.vWorldView1=vWorldView[1];vertexOutputs.vWorldView2=vWorldView[2];vertexOutputs.vWorldView3=vWorldView[3];let normalWorld: mat3x3f= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz);vertexOutputs.vNormalW=normalize(normalWorld*normalUpdated);
|
|
96
|
+
#else
|
|
97
|
+
#ifdef NORMAL_WORLDSPACE
|
|
98
|
+
vertexOutputs.vNormalV=normalize((finalWorld* vec4f(normalUpdated,0.0)).xyz);
|
|
99
|
+
#else
|
|
100
|
+
vertexOutputs.vNormalV=normalize(((scene.view*finalWorld)* vec4f(normalUpdated,0.0)).xyz);
|
|
101
|
+
#endif
|
|
102
|
+
#endif
|
|
103
|
+
vertexOutputs.vViewPos=scene.view*worldPos;
|
|
104
|
+
#if (defined(VELOCITY) || defined(VELOCITY_LINEAR)) && defined(BONES_VELOCITY_ENABLED)
|
|
105
|
+
vertexOutputs.vCurrentPosition=scene.viewProjection*finalWorld* vec4f(positionUpdated,1.0);
|
|
106
|
+
#if NUM_BONE_INFLUENCERS>0
|
|
107
|
+
var previousInfluence: mat4x4f;previousInfluence=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[0])]*vertexInputs.matricesWeights[0];
|
|
108
|
+
#if NUM_BONE_INFLUENCERS>1
|
|
109
|
+
previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[1])]*vertexInputs.matricesWeights[1];
|
|
110
|
+
#endif
|
|
111
|
+
#if NUM_BONE_INFLUENCERS>2
|
|
112
|
+
previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[2])]*vertexInputs.matricesWeights[2];
|
|
113
|
+
#endif
|
|
114
|
+
#if NUM_BONE_INFLUENCERS>3
|
|
115
|
+
previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[3])]*vertexInputs.matricesWeights[3];
|
|
116
|
+
#endif
|
|
117
|
+
#if NUM_BONE_INFLUENCERS>4
|
|
118
|
+
previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[0])]*vertexInputs.matricesWeightsExtra[0];
|
|
119
|
+
#endif
|
|
120
|
+
#if NUM_BONE_INFLUENCERS>5
|
|
121
|
+
previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[1])]*vertexInputs.matricesWeightsExtra[1];
|
|
122
|
+
#endif
|
|
123
|
+
#if NUM_BONE_INFLUENCERS>6
|
|
124
|
+
previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[2])]*vertexInputs.matricesWeightsExtra[2];
|
|
125
|
+
#endif
|
|
126
|
+
#if NUM_BONE_INFLUENCERS>7
|
|
127
|
+
previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[3])]*vertexInputs.matricesWeightsExtra[3];
|
|
128
|
+
#endif
|
|
129
|
+
vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld*previousInfluence* vec4f(positionUpdated,1.0);
|
|
130
|
+
#else
|
|
131
|
+
vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld* vec4f(positionUpdated,1.0);
|
|
132
|
+
#endif
|
|
133
|
+
#endif
|
|
134
|
+
#if defined(POSITION) || defined(BUMP) || defined(IRRADIANCE)
|
|
135
|
+
vertexOutputs.vPositionW=worldPos.xyz/worldPos.w;
|
|
136
|
+
#endif
|
|
137
|
+
vertexOutputs.position=scene.viewProjection*finalWorld* vec4f(positionUpdated,1.0);
|
|
138
|
+
#include<clipPlaneVertex>
|
|
139
|
+
#ifdef NEED_UV
|
|
140
|
+
#ifdef UV1
|
|
141
|
+
#if defined(ALPHATEST) && defined(ALPHATEST_UV1)
|
|
142
|
+
vertexOutputs.vUV=(uniforms.diffuseMatrix* vec4f(uvUpdated,1.0,0.0)).xy;
|
|
143
|
+
#else
|
|
144
|
+
vertexOutputs.vUV=uvUpdated;
|
|
145
|
+
#endif
|
|
146
|
+
#ifdef BUMP_UV1
|
|
147
|
+
vertexOutputs.vBumpUV=(uniforms.bumpMatrix* vec4f(uvUpdated,1.0,0.0)).xy;
|
|
148
|
+
#endif
|
|
149
|
+
#ifdef REFLECTIVITY_UV1
|
|
150
|
+
vertexOutputs.vReflectivityUV=(uniforms.reflectivityMatrix* vec4f(uvUpdated,1.0,0.0)).xy;
|
|
151
|
+
#else
|
|
152
|
+
#ifdef METALLIC_UV1
|
|
153
|
+
vertexOutputs.vMetallicUV=(uniforms.metallicMatrix* vec4f(uvUpdated,1.0,0.0)).xy;
|
|
154
|
+
#endif
|
|
155
|
+
#ifdef ROUGHNESS_UV1
|
|
156
|
+
vertexOutputs.vRoughnessUV=(uniforms.roughnessMatrix* vec4f(uvUpdated,1.0,0.0)).xy;
|
|
157
|
+
#endif
|
|
158
|
+
#endif
|
|
159
|
+
#ifdef ALBEDO_UV1
|
|
160
|
+
vertexOutputs.vAlbedoUV=(uniforms.albedoMatrix* vec4f(uvUpdated,1.0,0.0)).xy;
|
|
161
|
+
#endif
|
|
162
|
+
#ifdef SUBSURFACE_WEIGHT_UV1
|
|
163
|
+
vertexOutputs.vSubsurfaceWeightUV=(uniforms.subsurfaceWeightMatrix* vec4f(uvUpdated,1.0,0.0)).xy;
|
|
164
|
+
#endif
|
|
165
|
+
#ifdef TRANSMISSION_WEIGHT_UV1
|
|
166
|
+
vertexOutputs.vTransmissionWeightUV=(uniforms.transmissionWeightMatrix* vec4f(uvUpdated,1.0,0.0)).xy;
|
|
167
|
+
#endif
|
|
168
|
+
#endif
|
|
169
|
+
#ifdef UV2
|
|
170
|
+
#if defined(ALPHATEST) && defined(ALPHATEST_UV2)
|
|
171
|
+
vertexOutputs.vUV=(uniforms.diffuseMatrix* vec4f(uv2Updated,1.0,0.0)).xy;
|
|
172
|
+
#else
|
|
173
|
+
vertexOutputs.vUV=uv2Updated;
|
|
174
|
+
#endif
|
|
175
|
+
#ifdef BUMP_UV2
|
|
176
|
+
vertexOutputs.vBumpUV=(uniforms.bumpMatrix* vec4f(uv2Updated,1.0,0.0)).xy;
|
|
177
|
+
#endif
|
|
178
|
+
#ifdef REFLECTIVITY_UV2
|
|
179
|
+
vertexOutputs.vReflectivityUV=(uniforms.reflectivityMatrix* vec4f(uv2Updated,1.0,0.0)).xy;
|
|
180
|
+
#else
|
|
181
|
+
#ifdef METALLIC_UV2
|
|
182
|
+
vertexOutputs.vMetallicUV=(uniforms.metallicMatrix* vec4f(uv2Updated,1.0,0.0)).xy;
|
|
183
|
+
#endif
|
|
184
|
+
#ifdef ROUGHNESS_UV2
|
|
185
|
+
vertexOutputs.vRoughnessUV=(uniforms.roughnessMatrix* vec4f(uv2Updated,1.0,0.0)).xy;
|
|
186
|
+
#endif
|
|
187
|
+
#endif
|
|
188
|
+
#ifdef ALBEDO_UV2
|
|
189
|
+
vertexOutputs.vAlbedoUV=(uniforms.albedoMatrix* vec4f(uv2Updated,1.0,0.0)).xy;
|
|
190
|
+
#endif
|
|
191
|
+
#ifdef SUBSURFACE_WEIGHT_UV2
|
|
192
|
+
vertexOutputs.vSubsurfaceWeightUV=(uniforms.subsurfaceWeightMatrix* vec4f(uv2Updated,1.0,0.0)).xy;
|
|
193
|
+
#endif
|
|
194
|
+
#ifdef TRANSMISSION_WEIGHT_UV2
|
|
195
|
+
vertexOutputs.vTransmissionWeightUV=(uniforms.transmissionWeightMatrix* vec4f(uv2Updated,1.0,0.0)).xy;
|
|
196
|
+
#endif
|
|
197
|
+
#endif
|
|
198
|
+
#endif
|
|
199
|
+
#include<bumpVertex>
|
|
200
|
+
#ifdef IRRADIANCE
|
|
201
|
+
#ifdef REFLECTION
|
|
202
|
+
#ifdef USESPHERICALFROMREFLECTIONMAP
|
|
203
|
+
var reflectionVector: vec3f=(uniforms.reflectionMatrix*vec4f(normalUpdated,0.0)).xyz;
|
|
204
|
+
#ifdef REFLECTIONMAP_OPPOSITEZ
|
|
205
|
+
reflectionVector.z*=-1.0f;
|
|
206
|
+
#endif
|
|
207
|
+
vertexOutputs.vEnvironmentIrradiance=computeEnvironmentIrradiance(reflectionVector)*uniforms.vReflectionInfos.x;
|
|
208
|
+
#endif
|
|
209
|
+
#endif
|
|
210
|
+
#endif
|
|
211
|
+
}
|
|
212
|
+
`;e.ShadersStoreWGSL[r]||(e.ShadersStoreWGSL[r]=t);const I=[n,f,o,v,a,m,p,U,s,d,u,c,l,x,E];for(const i of I)e.IncludesShadersStoreWGSL[i.name]||(e.IncludesShadersStoreWGSL[i.name]=i.shader);const T={name:r,shader:t};export{T as geometryVertexShaderWGSL};
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import{S as e,aB as f,aC as c,aD as v,aE as s,aF as l,s as u,l as m,aG as U,aH as E,aI as p,aJ as V,aK as S,aL as I,q as h,aM as N}from"./index-B2zBEWsq.js";const n="geometryVertexDeclaration",t="uniform mat4 viewProjection;uniform mat4 view;";e.IncludesShadersStore[n]||(e.IncludesShadersStore[n]=t);const _={name:n,shader:t},r="geometryUboDeclaration",o=`#include<sceneUboDeclaration>
|
|
2
|
+
`;e.IncludesShadersStore[r]||(e.IncludesShadersStore[r]=o);const x={name:r,shader:o},a="geometryVertexShader",d=`precision highp float;
|
|
3
|
+
#include<bonesDeclaration>
|
|
4
|
+
#include<bakedVertexAnimationDeclaration>
|
|
5
|
+
#include<morphTargetsVertexGlobalDeclaration>
|
|
6
|
+
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
|
|
7
|
+
#include<instancesDeclaration>
|
|
8
|
+
#include<__decl__geometryVertex>
|
|
9
|
+
#include<clipPlaneVertexDeclaration>
|
|
10
|
+
#ifdef IRRADIANCE
|
|
11
|
+
#ifdef REFLECTION
|
|
12
|
+
uniform mat4 reflectionMatrix;uniform vec2 vReflectionInfos;uniform vec3 vReflectionColor;
|
|
13
|
+
#ifdef USESPHERICALFROMREFLECTIONMAP
|
|
14
|
+
varying vec3 vEnvironmentIrradiance;
|
|
15
|
+
#ifdef SPHERICAL_HARMONICS
|
|
16
|
+
uniform vec3 vSphericalL00;uniform vec3 vSphericalL1_1;uniform vec3 vSphericalL10;uniform vec3 vSphericalL11;uniform vec3 vSphericalL2_2;uniform vec3 vSphericalL2_1;uniform vec3 vSphericalL20;uniform vec3 vSphericalL21;uniform vec3 vSphericalL22;
|
|
17
|
+
#else
|
|
18
|
+
uniform vec3 vSphericalX;uniform vec3 vSphericalY;uniform vec3 vSphericalZ;uniform vec3 vSphericalXX_ZZ;uniform vec3 vSphericalYY_ZZ;uniform vec3 vSphericalZZ;uniform vec3 vSphericalXY;uniform vec3 vSphericalYZ;uniform vec3 vSphericalZX;
|
|
19
|
+
#endif
|
|
20
|
+
#include<harmonicsFunctions>
|
|
21
|
+
#endif
|
|
22
|
+
#endif
|
|
23
|
+
#endif
|
|
24
|
+
attribute vec3 position;
|
|
25
|
+
#ifdef HAS_NORMAL_ATTRIBUTE
|
|
26
|
+
attribute vec3 normal;
|
|
27
|
+
#endif
|
|
28
|
+
#ifdef NEED_UV
|
|
29
|
+
varying vec2 vUV;
|
|
30
|
+
#ifdef ALPHATEST
|
|
31
|
+
uniform mat4 diffuseMatrix;
|
|
32
|
+
#endif
|
|
33
|
+
#ifdef BUMP
|
|
34
|
+
uniform mat4 bumpMatrix;varying vec2 vBumpUV;
|
|
35
|
+
#endif
|
|
36
|
+
#ifdef REFLECTIVITY
|
|
37
|
+
uniform mat4 reflectivityMatrix;uniform mat4 albedoMatrix;varying vec2 vReflectivityUV;varying vec2 vAlbedoUV;
|
|
38
|
+
#endif
|
|
39
|
+
#ifdef METALLIC_TEXTURE
|
|
40
|
+
varying vec2 vMetallicUV;uniform mat4 metallicMatrix;
|
|
41
|
+
#endif
|
|
42
|
+
#ifdef ROUGHNESS_TEXTURE
|
|
43
|
+
varying vec2 vRoughnessUV;uniform mat4 roughnessMatrix;
|
|
44
|
+
#endif
|
|
45
|
+
#ifdef SUBSURFACE_WEIGHT
|
|
46
|
+
varying vec2 vSubsurfaceWeightUV;uniform mat4 subsurfaceWeightMatrix;
|
|
47
|
+
#endif
|
|
48
|
+
#ifdef TRANSMISSION_WEIGHT
|
|
49
|
+
varying vec2 vTransmissionWeightUV;uniform mat4 transmissionWeightMatrix;
|
|
50
|
+
#endif
|
|
51
|
+
#ifdef UV1
|
|
52
|
+
attribute vec2 uv;
|
|
53
|
+
#endif
|
|
54
|
+
#ifdef UV2
|
|
55
|
+
attribute vec2 uv2;
|
|
56
|
+
#endif
|
|
57
|
+
#endif
|
|
58
|
+
#ifdef BUMP
|
|
59
|
+
varying mat4 vWorldView;
|
|
60
|
+
#endif
|
|
61
|
+
#ifdef BUMP
|
|
62
|
+
varying vec3 vNormalW;
|
|
63
|
+
#else
|
|
64
|
+
varying vec3 vNormalV;
|
|
65
|
+
#endif
|
|
66
|
+
varying vec4 vViewPos;
|
|
67
|
+
#if defined(POSITION) || defined(BUMP) || defined(IRRADIANCE)
|
|
68
|
+
varying vec3 vPositionW;
|
|
69
|
+
#endif
|
|
70
|
+
#if defined(VELOCITY) || defined(VELOCITY_LINEAR)
|
|
71
|
+
uniform mat4 previousViewProjection;varying vec4 vCurrentPosition;varying vec4 vPreviousPosition;
|
|
72
|
+
#endif
|
|
73
|
+
#define CUSTOM_VERTEX_DEFINITIONS
|
|
74
|
+
void main(void)
|
|
75
|
+
{vec3 positionUpdated=position;
|
|
76
|
+
#ifdef HAS_NORMAL_ATTRIBUTE
|
|
77
|
+
vec3 normalUpdated=normal;
|
|
78
|
+
#else
|
|
79
|
+
vec3 normalUpdated=vec3(0.0,0.0,0.0);
|
|
80
|
+
#endif
|
|
81
|
+
#ifdef UV1
|
|
82
|
+
vec2 uvUpdated=uv;
|
|
83
|
+
#endif
|
|
84
|
+
#ifdef UV2
|
|
85
|
+
vec2 uv2Updated=uv2;
|
|
86
|
+
#endif
|
|
87
|
+
#include<morphTargetsVertexGlobal>
|
|
88
|
+
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
|
|
89
|
+
#include<instancesVertex>
|
|
90
|
+
#if (defined(VELOCITY) || defined(VELOCITY_LINEAR)) && !defined(BONES_VELOCITY_ENABLED)
|
|
91
|
+
vCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);vPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0);
|
|
92
|
+
#endif
|
|
93
|
+
#include<bonesVertex>
|
|
94
|
+
#include<bakedVertexAnimation>
|
|
95
|
+
vec4 worldPos=vec4(finalWorld*vec4(positionUpdated,1.0));
|
|
96
|
+
#ifdef BUMP
|
|
97
|
+
vWorldView=view*finalWorld;mat3 normalWorld=mat3(finalWorld);vNormalW=normalize(normalWorld*normalUpdated);
|
|
98
|
+
#else
|
|
99
|
+
#ifdef NORMAL_WORLDSPACE
|
|
100
|
+
vNormalV=normalize(vec3(finalWorld*vec4(normalUpdated,0.0)));
|
|
101
|
+
#else
|
|
102
|
+
vNormalV=normalize(vec3((view*finalWorld)*vec4(normalUpdated,0.0)));
|
|
103
|
+
#endif
|
|
104
|
+
#endif
|
|
105
|
+
vViewPos=view*worldPos;
|
|
106
|
+
#if (defined(VELOCITY) || defined(VELOCITY_LINEAR)) && defined(BONES_VELOCITY_ENABLED)
|
|
107
|
+
vCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);
|
|
108
|
+
#if NUM_BONE_INFLUENCERS>0
|
|
109
|
+
mat4 previousInfluence;previousInfluence=mPreviousBones[int(matricesIndices[0])]*matricesWeights[0];
|
|
110
|
+
#if NUM_BONE_INFLUENCERS>1
|
|
111
|
+
previousInfluence+=mPreviousBones[int(matricesIndices[1])]*matricesWeights[1];
|
|
112
|
+
#endif
|
|
113
|
+
#if NUM_BONE_INFLUENCERS>2
|
|
114
|
+
previousInfluence+=mPreviousBones[int(matricesIndices[2])]*matricesWeights[2];
|
|
115
|
+
#endif
|
|
116
|
+
#if NUM_BONE_INFLUENCERS>3
|
|
117
|
+
previousInfluence+=mPreviousBones[int(matricesIndices[3])]*matricesWeights[3];
|
|
118
|
+
#endif
|
|
119
|
+
#if NUM_BONE_INFLUENCERS>4
|
|
120
|
+
previousInfluence+=mPreviousBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];
|
|
121
|
+
#endif
|
|
122
|
+
#if NUM_BONE_INFLUENCERS>5
|
|
123
|
+
previousInfluence+=mPreviousBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];
|
|
124
|
+
#endif
|
|
125
|
+
#if NUM_BONE_INFLUENCERS>6
|
|
126
|
+
previousInfluence+=mPreviousBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];
|
|
127
|
+
#endif
|
|
128
|
+
#if NUM_BONE_INFLUENCERS>7
|
|
129
|
+
previousInfluence+=mPreviousBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];
|
|
130
|
+
#endif
|
|
131
|
+
vPreviousPosition=previousViewProjection*finalPreviousWorld*previousInfluence*vec4(positionUpdated,1.0);
|
|
132
|
+
#else
|
|
133
|
+
vPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0);
|
|
134
|
+
#endif
|
|
135
|
+
#endif
|
|
136
|
+
#if defined(POSITION) || defined(BUMP) || defined(IRRADIANCE)
|
|
137
|
+
vPositionW=worldPos.xyz/worldPos.w;
|
|
138
|
+
#endif
|
|
139
|
+
gl_Position=viewProjection*finalWorld*vec4(positionUpdated,1.0);
|
|
140
|
+
#include<clipPlaneVertex>
|
|
141
|
+
#ifdef NEED_UV
|
|
142
|
+
#ifdef UV1
|
|
143
|
+
#if defined(ALPHATEST) && defined(ALPHATEST_UV1)
|
|
144
|
+
vUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));
|
|
145
|
+
#else
|
|
146
|
+
vUV=uvUpdated;
|
|
147
|
+
#endif
|
|
148
|
+
#ifdef BUMP_UV1
|
|
149
|
+
vBumpUV=vec2(bumpMatrix*vec4(uvUpdated,1.0,0.0));
|
|
150
|
+
#endif
|
|
151
|
+
#ifdef REFLECTIVITY_UV1
|
|
152
|
+
vReflectivityUV=vec2(reflectivityMatrix*vec4(uvUpdated,1.0,0.0));
|
|
153
|
+
#else
|
|
154
|
+
#ifdef METALLIC_UV1
|
|
155
|
+
vMetallicUV=vec2(metallicMatrix*vec4(uvUpdated,1.0,0.0));
|
|
156
|
+
#endif
|
|
157
|
+
#ifdef ROUGHNESS_UV1
|
|
158
|
+
vRoughnessUV=vec2(roughnessMatrix*vec4(uvUpdated,1.0,0.0));
|
|
159
|
+
#endif
|
|
160
|
+
#endif
|
|
161
|
+
#ifdef ALBEDO_UV1
|
|
162
|
+
vAlbedoUV=vec2(albedoMatrix*vec4(uvUpdated,1.0,0.0));
|
|
163
|
+
#endif
|
|
164
|
+
#ifdef SUBSURFACE_COLOR_UV1
|
|
165
|
+
vSubsurfaceColorUV=vec2(subsurfaceColorMatrix*vec4(uvUpdated,1.0,0.0));
|
|
166
|
+
#endif
|
|
167
|
+
#ifdef SUBSURFACE_WEIGHT_UV1
|
|
168
|
+
vSubsurfaceWeightUV=vec2(subsurfaceWeightMatrix*vec4(uvUpdated,1.0,0.0));
|
|
169
|
+
#endif
|
|
170
|
+
#endif
|
|
171
|
+
#ifdef UV2
|
|
172
|
+
#if defined(ALPHATEST) && defined(ALPHATEST_UV2)
|
|
173
|
+
vUV=vec2(diffuseMatrix*vec4(uv2Updated,1.0,0.0));
|
|
174
|
+
#else
|
|
175
|
+
vUV=uv2Updated;
|
|
176
|
+
#endif
|
|
177
|
+
#ifdef BUMP_UV2
|
|
178
|
+
vBumpUV=vec2(bumpMatrix*vec4(uv2Updated,1.0,0.0));
|
|
179
|
+
#endif
|
|
180
|
+
#ifdef REFLECTIVITY_UV2
|
|
181
|
+
vReflectivityUV=vec2(reflectivityMatrix*vec4(uv2Updated,1.0,0.0));
|
|
182
|
+
#else
|
|
183
|
+
#ifdef METALLIC_UV2
|
|
184
|
+
vMetallicUV=vec2(metallicMatrix*vec4(uv2Updated,1.0,0.0));
|
|
185
|
+
#endif
|
|
186
|
+
#ifdef ROUGHNESS_UV2
|
|
187
|
+
vRoughnessUV=vec2(roughnessMatrix*vec4(uv2Updated,1.0,0.0));
|
|
188
|
+
#endif
|
|
189
|
+
#endif
|
|
190
|
+
#ifdef ALBEDO_UV2
|
|
191
|
+
vAlbedoUV=vec2(albedoMatrix*vec4(uv2Updated,1.0,0.0));
|
|
192
|
+
#endif
|
|
193
|
+
#ifdef SUBSURFACE_COLOR_UV2
|
|
194
|
+
vSubsurfaceColorUV=vec2(subsurfaceColorMatrix*vec4(uv2Updated,1.0,0.0));
|
|
195
|
+
#endif
|
|
196
|
+
#ifdef SUBSURFACE_WEIGHT_UV2
|
|
197
|
+
vSubsurfaceWeightUV=vec2(subsurfaceWeightMatrix*vec4(uv2Updated,1.0,0.0));
|
|
198
|
+
#endif
|
|
199
|
+
#endif
|
|
200
|
+
#endif
|
|
201
|
+
#include<bumpVertex>
|
|
202
|
+
#ifdef IRRADIANCE
|
|
203
|
+
#ifdef REFLECTION
|
|
204
|
+
#ifdef USESPHERICALFROMREFLECTIONMAP
|
|
205
|
+
vec3 reflectionVector=vec3(reflectionMatrix*vec4(normalUpdated,0.0)).xyz;
|
|
206
|
+
#ifdef REFLECTIONMAP_OPPOSITEZ
|
|
207
|
+
reflectionVector.z*=-1.0;
|
|
208
|
+
#endif
|
|
209
|
+
vEnvironmentIrradiance=computeEnvironmentIrradiance(reflectionVector)*vReflectionInfos.x;
|
|
210
|
+
#endif
|
|
211
|
+
#endif
|
|
212
|
+
#endif
|
|
213
|
+
}
|
|
214
|
+
`;e.ShadersStore[a]||(e.ShadersStore[a]=d);const P=[f,c,v,s,l,_,u,x,m,U,E,p,V,S,I,h,N];for(const i of P)e.IncludesShadersStore[i.name]||(e.IncludesShadersStore[i.name]=i.shader);const M={name:a,shader:d};export{M as geometryVertexShader};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{S as r}from"./index-B2zBEWsq.js";const e="glowBlurPostProcessPixelShader",t=`varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform screenSize: vec2f;uniform direction: vec2f;uniform blurWidth: f32;fn getLuminance(color: vec3f)->f32
|
|
2
|
+
{return dot(color, vec3f(0.2126,0.7152,0.0722));}
|
|
3
|
+
#define CUSTOM_FRAGMENT_DEFINITIONS
|
|
4
|
+
@fragment
|
|
5
|
+
fn main(input: FragmentInputs)->FragmentOutputs {var weights: array<f32 ,7>;weights[0]=0.05;weights[1]=0.1;weights[2]=0.2;weights[3]=0.3;weights[4]=0.2;weights[5]=0.1;weights[6]=0.05;var texelSize: vec2f= vec2f(1.0/uniforms.screenSize.x,1.0/uniforms.screenSize.y);var texelStep: vec2f=texelSize*uniforms.direction*uniforms.blurWidth;var start: vec2f=input.vUV-3.0*texelStep;var baseColor: vec4f= vec4f(0.,0.,0.,0.);var texelOffset: vec2f= vec2f(0.,0.);for (var i: i32=0; i<7; i++)
|
|
6
|
+
{var texel: vec4f=textureSample(textureSampler,textureSamplerSampler,start+texelOffset);baseColor=vec4f(baseColor.rgb,baseColor.a+texel.a*weights[i]);var luminance: f32=getLuminance(baseColor.rgb);var luminanceTexel: f32=getLuminance(texel.rgb);var choice: f32=step(luminanceTexel,luminance);baseColor=vec4f(choice*baseColor.rgb+(1.0-choice)*texel.rgb,baseColor.a);texelOffset+=texelStep;}
|
|
7
|
+
fragmentOutputs.color=baseColor;}`;r.ShadersStoreWGSL[e]||(r.ShadersStoreWGSL[e]=t);const o={name:e,shader:t};export{o as glowBlurPostProcessPixelShaderWGSL};
|