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,86 @@
|
|
|
1
|
+
import{S as e,s as t,m as r,l as n,n as l,o as s,p as f,q as c,r as p,t as d}from"./index-B2zBEWsq.js";import{g as S,a as u,b as m}from"./gaussianSplatting-Cfigjb15.js";const a="gaussianSplattingVertexShader",i=`#include<__decl__gaussianSplattingVertex>
|
|
2
|
+
#ifdef LOGARITHMICDEPTH
|
|
3
|
+
#extension GL_EXT_frag_depth : enable
|
|
4
|
+
#endif
|
|
5
|
+
#include<clipPlaneVertexDeclaration>
|
|
6
|
+
#include<fogVertexDeclaration>
|
|
7
|
+
#include<logDepthDeclaration>
|
|
8
|
+
#include<helperFunctions>
|
|
9
|
+
uniform vec2 invViewport;uniform vec2 dataTextureSize;uniform vec2 focal;uniform float kernelSize;uniform float minPixelSize;uniform vec3 eyePosition;uniform float alpha;
|
|
10
|
+
#if IS_COMPOUND
|
|
11
|
+
uniform mat4 partWorld[MAX_PART_COUNT];uniform float partVisibility[MAX_PART_COUNT];
|
|
12
|
+
#endif
|
|
13
|
+
uniform sampler2D covariancesATexture;uniform sampler2D covariancesBTexture;uniform sampler2D centersTexture;uniform sampler2D colorsTexture;
|
|
14
|
+
#ifdef USE_SOG
|
|
15
|
+
uniform sampler2D sogQuatsTexture;uniform vec3 sogMeansMin;uniform vec3 sogMeansMax;
|
|
16
|
+
#ifdef USE_SOG_V2
|
|
17
|
+
uniform sampler2D sogCodebookTexture;
|
|
18
|
+
#else
|
|
19
|
+
uniform vec3 sogScalesMin;uniform vec3 sogScalesMax;uniform vec4 sogSh0Min;uniform vec4 sogSh0Max;uniform float sogShnMin;uniform float sogShnMax;
|
|
20
|
+
#endif
|
|
21
|
+
#if SH_DEGREE>0
|
|
22
|
+
uniform sampler2D sogShNCentroidsTexture;uniform sampler2D sogShNLabelsTexture;uniform float sogShCoeffCount;
|
|
23
|
+
#endif
|
|
24
|
+
#endif
|
|
25
|
+
#if SH_DEGREE>0 && !defined(USE_SOG)
|
|
26
|
+
uniform highp usampler2D shTexture0;
|
|
27
|
+
#endif
|
|
28
|
+
#if SH_DEGREE>1 && !defined(USE_SOG)
|
|
29
|
+
uniform highp usampler2D shTexture1;
|
|
30
|
+
#endif
|
|
31
|
+
#if SH_DEGREE>2 && !defined(USE_SOG)
|
|
32
|
+
uniform highp usampler2D shTexture2;
|
|
33
|
+
#endif
|
|
34
|
+
#if SH_DEGREE>3 && !defined(USE_SOG)
|
|
35
|
+
uniform highp usampler2D shTexture3;uniform highp usampler2D shTexture4;
|
|
36
|
+
#endif
|
|
37
|
+
#if IS_COMPOUND
|
|
38
|
+
uniform sampler2D partIndicesTexture;
|
|
39
|
+
#endif
|
|
40
|
+
varying vec4 vColor;varying vec2 vPosition;
|
|
41
|
+
#define CUSTOM_VERTEX_DEFINITIONS
|
|
42
|
+
#include<gaussianSplatting>
|
|
43
|
+
void main () {
|
|
44
|
+
#define CUSTOM_VERTEX_MAIN_BEGIN
|
|
45
|
+
float splatIndex=getSplatIndex(int(position.z+0.5));Splat splat=readSplat(splatIndex);vec3 covA=splat.covA.xyz;vec3 covB=vec3(splat.covA.w,splat.covB.xy);
|
|
46
|
+
#if IS_COMPOUND
|
|
47
|
+
mat4 splatWorld=getPartWorld(splat.partIndex);
|
|
48
|
+
#else
|
|
49
|
+
mat4 splatWorld=world;
|
|
50
|
+
#endif
|
|
51
|
+
vec4 worldPos=splatWorld*vec4(splat.center.xyz,1.0);vColor=splat.color;vPosition=position.xy;
|
|
52
|
+
#if SH_DEGREE>0
|
|
53
|
+
mat3 worldRot=mat3(splatWorld);mat3 normWorldRot=inverseMat3(worldRot);vec3 eyeToSplatLocalSpace=normalize(normWorldRot*(worldPos.xyz-eyePosition));
|
|
54
|
+
#if defined(GS_DBG_ENABLED) && IS_COMPOUND
|
|
55
|
+
{vec4 _row3=texelFetch(dbgPartData,ivec2(int(splat.partIndex),3),0);
|
|
56
|
+
#if SH_DEGREE>3
|
|
57
|
+
float _so4=texelFetch(dbgPartData,ivec2(int(splat.partIndex),4),0).x;
|
|
58
|
+
#else
|
|
59
|
+
float _so4=1.0;
|
|
60
|
+
#endif
|
|
61
|
+
vColor.xyz=_row3.x*splat.color.xyz+computeSHWeighted(splat,eyeToSplatLocalSpace,_row3.y,_row3.z,_row3.w,_so4);}
|
|
62
|
+
#elif defined(GS_DBG_ENABLED) && GS_DBG_SH_DC==0
|
|
63
|
+
vColor.xyz=computeSH(splat,eyeToSplatLocalSpace);
|
|
64
|
+
#else
|
|
65
|
+
vColor.xyz=splat.color.xyz+computeSH(splat,eyeToSplatLocalSpace);
|
|
66
|
+
#endif
|
|
67
|
+
#else
|
|
68
|
+
#if defined(GS_DBG_ENABLED) && IS_COMPOUND
|
|
69
|
+
{float _shDc=texelFetch(dbgPartData,ivec2(int(splat.partIndex),3),0).x;vColor.xyz=_shDc*splat.color.xyz;}
|
|
70
|
+
#elif defined(GS_DBG_ENABLED) && GS_DBG_SH_DC==0
|
|
71
|
+
vColor.xyz=vec3(0.0);
|
|
72
|
+
#endif
|
|
73
|
+
#endif
|
|
74
|
+
vColor.w*=alpha;
|
|
75
|
+
#if IS_COMPOUND
|
|
76
|
+
vColor.w*=partVisibility[splat.partIndex];
|
|
77
|
+
#endif
|
|
78
|
+
vec2 scale=vec2(1.,1.);
|
|
79
|
+
#define CUSTOM_VERTEX_UPDATE
|
|
80
|
+
gl_Position=gaussianSplatting(position.xy,worldPos.xyz,scale,covA,covB,splatWorld,view,projection);
|
|
81
|
+
#include<clipPlaneVertex>
|
|
82
|
+
#include<fogVertex>
|
|
83
|
+
#include<logDepthVertex>
|
|
84
|
+
#define CUSTOM_VERTEX_MAIN_END
|
|
85
|
+
}
|
|
86
|
+
`;e.ShadersStore[a]||(e.ShadersStore[a]=i);const _=[S,t,r,u,n,l,s,f,m,c,p,d];for(const o of _)e.IncludesShadersStore[o.name]||(e.IncludesShadersStore[o.name]=o.shader);const g={name:a,shader:i};export{g as gaussianSplattingVertexShader};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import{S as e}from"./index-B2zBEWsq.js";import{s as a}from"./sceneUboDeclaration-BzFIc4mb.js";import{m as i}from"./meshUboDeclaration-BnX046aQ.js";import{h as n}from"./helperFunctions-Cugfp1Fz.js";import{c as s,a as l}from"./clipPlaneVertex-B_VhD1oQ.js";import{f,a as u,l as p}from"./logDepthVertex-UKrhEIvg.js";import{l as c}from"./logDepthDeclaration-BR8XRz9F.js";import{g as d}from"./gaussianSplatting-DIn8R8oF.js";const r="gaussianSplattingVertexShader",o=`#include<sceneUboDeclaration>
|
|
2
|
+
#include<meshUboDeclaration>
|
|
3
|
+
#include<helperFunctions>
|
|
4
|
+
#include<clipPlaneVertexDeclaration>
|
|
5
|
+
#include<fogVertexDeclaration>
|
|
6
|
+
#include<logDepthDeclaration>
|
|
7
|
+
attribute splatIndex0: vec4f;attribute splatIndex1: vec4f;attribute splatIndex2: vec4f;attribute splatIndex3: vec4f;attribute position: vec3f;uniform invViewport: vec2f;uniform dataTextureSize: vec2f;uniform focal: vec2f;uniform kernelSize: f32;uniform minPixelSize: f32;uniform eyePosition: vec3f;uniform alpha: f32;
|
|
8
|
+
#if IS_COMPOUND
|
|
9
|
+
uniform partWorld: array<mat4x4<f32>,MAX_PART_COUNT>;uniform partVisibility: array<f32,MAX_PART_COUNT>;
|
|
10
|
+
#endif
|
|
11
|
+
var covariancesATexture: texture_2d<f32>;var covariancesBTexture: texture_2d<f32>;var centersTexture: texture_2d<f32>;var colorsTexture: texture_2d<f32>;
|
|
12
|
+
#ifdef USE_SOG
|
|
13
|
+
var sogQuatsTexture: texture_2d<f32>;uniform sogMeansMin: vec3f;uniform sogMeansMax: vec3f;
|
|
14
|
+
#ifdef USE_SOG_V2
|
|
15
|
+
var sogCodebookTexture: texture_2d<f32>;
|
|
16
|
+
#else
|
|
17
|
+
uniform sogScalesMin: vec3f;uniform sogScalesMax: vec3f;uniform sogSh0Min: vec4f;uniform sogSh0Max: vec4f;uniform sogShnMin: f32;uniform sogShnMax: f32;
|
|
18
|
+
#endif
|
|
19
|
+
#if SH_DEGREE>0
|
|
20
|
+
var sogShNCentroidsTexture: texture_2d<f32>;var sogShNLabelsTexture: texture_2d<f32>;uniform sogShCoeffCount: f32;
|
|
21
|
+
#endif
|
|
22
|
+
#endif
|
|
23
|
+
#if SH_DEGREE>0 && !defined(USE_SOG)
|
|
24
|
+
var shTexture0: texture_2d<u32>;
|
|
25
|
+
#endif
|
|
26
|
+
#if SH_DEGREE>1 && !defined(USE_SOG)
|
|
27
|
+
var shTexture1: texture_2d<u32>;
|
|
28
|
+
#endif
|
|
29
|
+
#if SH_DEGREE>2 && !defined(USE_SOG)
|
|
30
|
+
var shTexture2: texture_2d<u32>;
|
|
31
|
+
#endif
|
|
32
|
+
#if SH_DEGREE>3 && !defined(USE_SOG)
|
|
33
|
+
var shTexture3: texture_2d<u32>;var shTexture4: texture_2d<u32>;
|
|
34
|
+
#endif
|
|
35
|
+
#if IS_COMPOUND
|
|
36
|
+
var partIndicesTexture: texture_2d<f32>;
|
|
37
|
+
#endif
|
|
38
|
+
varying vColor: vec4f;varying vPosition: vec2f;
|
|
39
|
+
#define CUSTOM_VERTEX_DEFINITIONS
|
|
40
|
+
#include<gaussianSplatting>
|
|
41
|
+
@vertex
|
|
42
|
+
fn main(input : VertexInputs)->FragmentInputs {
|
|
43
|
+
#define CUSTOM_VERTEX_MAIN_BEGIN
|
|
44
|
+
let splatIndex: f32=getSplatIndex(i32(vertexInputs.position.z+0.5),vertexInputs.splatIndex0,vertexInputs.splatIndex1,vertexInputs.splatIndex2,vertexInputs.splatIndex3);var splat: Splat=readSplat(splatIndex,uniforms.dataTextureSize);var covA: vec3f=splat.covA.xyz;var covB: vec3f=vec3f(splat.covA.w,splat.covB.xy);
|
|
45
|
+
#if IS_COMPOUND
|
|
46
|
+
let splatWorld: mat4x4f=getPartWorld(splat.partIndex);
|
|
47
|
+
#else
|
|
48
|
+
let splatWorld: mat4x4f=mesh.world;
|
|
49
|
+
#endif
|
|
50
|
+
let worldPos: vec4f=splatWorld*vec4f(splat.center.xyz,1.0);vertexOutputs.vPosition=vertexInputs.position.xy;
|
|
51
|
+
#if SH_DEGREE>0
|
|
52
|
+
let worldRot: mat3x3f= mat3x3f(splatWorld[0].xyz,splatWorld[1].xyz,splatWorld[2].xyz);let normWorldRot: mat3x3f=inverseMat3(worldRot);var eyeToSplatLocalSpace: vec3f=normalize(normWorldRot*(worldPos.xyz-uniforms.eyePosition.xyz));
|
|
53
|
+
#if defined(GS_DBG_ENABLED) && IS_COMPOUND
|
|
54
|
+
{let _row3=textureLoad(dbgPartData,vec2i(i32(splat.partIndex),3),0);
|
|
55
|
+
#if SH_DEGREE>3
|
|
56
|
+
let _so4=textureLoad(dbgPartData,vec2i(i32(splat.partIndex),4),0).x;
|
|
57
|
+
#else
|
|
58
|
+
let _so4: f32=1.0;
|
|
59
|
+
#endif
|
|
60
|
+
vertexOutputs.vColor=vec4f(_row3.x*splat.color.xyz+computeSHWeighted(splat,eyeToSplatLocalSpace,_row3.y,_row3.z,_row3.w,_so4),splat.color.w*uniforms.alpha);}
|
|
61
|
+
#elif defined(GS_DBG_ENABLED) && GS_DBG_SH_DC==0
|
|
62
|
+
vertexOutputs.vColor=vec4f(computeSH(splat,eyeToSplatLocalSpace),splat.color.w*uniforms.alpha);
|
|
63
|
+
#else
|
|
64
|
+
vertexOutputs.vColor=vec4f(splat.color.xyz+computeSH(splat,eyeToSplatLocalSpace),splat.color.w*uniforms.alpha);
|
|
65
|
+
#endif
|
|
66
|
+
#else
|
|
67
|
+
#if defined(GS_DBG_ENABLED) && IS_COMPOUND
|
|
68
|
+
{let _shDc=textureLoad(dbgPartData,vec2i(i32(splat.partIndex),3),0).x;vertexOutputs.vColor=vec4f(_shDc*splat.color.xyz,splat.color.w*uniforms.alpha);}
|
|
69
|
+
#elif defined(GS_DBG_ENABLED) && GS_DBG_SH_DC==0
|
|
70
|
+
vertexOutputs.vColor=vec4f(0.0,0.0,0.0,splat.color.w*uniforms.alpha);
|
|
71
|
+
#else
|
|
72
|
+
vertexOutputs.vColor=vec4f(splat.color.xyz,splat.color.w*uniforms.alpha);
|
|
73
|
+
#endif
|
|
74
|
+
#endif
|
|
75
|
+
#if IS_COMPOUND
|
|
76
|
+
vertexOutputs.vColor.w*=uniforms.partVisibility[splat.partIndex];
|
|
77
|
+
#endif
|
|
78
|
+
var scale: vec2f=vec2f(1.,1.);
|
|
79
|
+
#define CUSTOM_VERTEX_UPDATE
|
|
80
|
+
vertexOutputs.position=gaussianSplatting(vertexInputs.position.xy,worldPos.xyz,scale,covA,covB,splatWorld,scene.view,scene.projection,uniforms.focal,uniforms.invViewport,uniforms.kernelSize,uniforms.minPixelSize);
|
|
81
|
+
#include<clipPlaneVertex>
|
|
82
|
+
#include<fogVertex>
|
|
83
|
+
#include<logDepthVertex>
|
|
84
|
+
#define CUSTOM_VERTEX_MAIN_END
|
|
85
|
+
}
|
|
86
|
+
`;e.ShadersStoreWGSL[r]||(e.ShadersStoreWGSL[r]=o);const x=[a,i,n,s,f,c,d,l,u,p];for(const t of x)e.IncludesShadersStoreWGSL[t.name]||(e.IncludesShadersStoreWGSL[t.name]=t.shader);const G={name:r,shader:o};export{G as gaussianSplattingVertexShaderWGSL};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{S as o}from"./index-B2zBEWsq.js";const e="gaussianSplattingVoxelPixelShader",t=`var voxel_storage: texture_storage_3d<r8unorm,write>;varying vNormalizedPosition: vec3f;varying vNormalizedCenterPosition: vec3f;varying vAlpha: f32;varying vPatchPosition: vec2f;fn gsVoxelPrngCanonical1d(co: f32)->f32 {return fract(sin(co*91.3458)*47453.5453);}
|
|
2
|
+
fn gsVoxelPrngCanonical2d(co: vec2f)->f32 {return fract(sin(dot(co,vec2f(12.9898,78.233)))*43758.5453);}
|
|
3
|
+
fn gsVoxelPrngCanonical3d(co: vec3f)->f32 {return gsVoxelPrngCanonical2d(vec2f(co.x,co.y)+gsVoxelPrngCanonical1d(co.z));}
|
|
4
|
+
@fragment
|
|
5
|
+
fn main(input: FragmentInputs)->FragmentOutputs {let normPos: vec3f=input.vNormalizedPosition;let stepSize: f32=1.0/f32(textureDimensions(voxel_storage).x);let diff: vec3f=abs(input.vNormalizedCenterPosition-normPos);let distToCenter: f32=max(max(diff.x,diff.y),diff.z);let gaussian: f32=exp(-dot(input.vPatchPosition,input.vPatchPosition));let shadowingOpacity: f32=clamp(
|
|
6
|
+
select(gaussian,1.0,distToCenter<stepSize)*input.vAlpha,
|
|
7
|
+
0.0,1.0
|
|
8
|
+
);if (shadowingOpacity<1.0 && shadowingOpacity<gsVoxelPrngCanonical3d(normPos/stepSize)) {discard;}
|
|
9
|
+
let size: vec3f=vec3f(textureDimensions(voxel_storage));textureStore(voxel_storage,
|
|
10
|
+
vec3<i32>(i32(normPos.x*size.x),i32(normPos.y*size.y),i32(normPos.z*size.z)),
|
|
11
|
+
vec4f(1.0,1.0,1.0,1.0));fragmentOutputs.color=vec4f(0.0,0.0,0.0,0.0);}
|
|
12
|
+
`;o.ShadersStoreWGSL[e]||(o.ShadersStoreWGSL[e]=t);const i={name:e,shader:t};export{i as gaussianSplattingVoxelPixelShaderWGSL};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import{S as e}from"./index-B2zBEWsq.js";const a="gaussianSplattingVoxelPixelShader",n=`precision highp float;layout(location=0) out highp float glFragData[MAX_DRAW_BUFFERS];varying vec3 vNormalizedPosition;varying vec3 vNormalizedCenterPosition;varying float vAlpha;varying vec2 vPatchPosition;uniform float nearPlane;uniform float farPlane;uniform float stepSize;float max3(vec3 v) { return max(max(v.x,v.y),v.z); }
|
|
2
|
+
float prngCanonical1d(float co)
|
|
3
|
+
{return fract(sin(co*91.3458)*47453.5453);}
|
|
4
|
+
float prngCanonical2d(vec2 co)
|
|
5
|
+
{return fract(sin(dot(vec2(co.x,co.y),vec2(12.9898,78.233)))*43758.5453);}
|
|
6
|
+
float prngCanonical3d(vec3 co)
|
|
7
|
+
{return prngCanonical2d(vec2(co.x,co.y)+prngCanonical1d(co.z));}
|
|
8
|
+
void main(void) {vec3 normPos=vNormalizedPosition.xyz;if (normPos.z<nearPlane || normPos.z>farPlane) {discard;}
|
|
9
|
+
float distToCenter=max3(abs(vNormalizedCenterPosition-normPos));float shadowingOpacity=clamp((distToCenter<stepSize ? 1.0 : exp(-dot(vPatchPosition,vPatchPosition)))*vAlpha,0.0,1.0);if (shadowingOpacity<1.0 && shadowingOpacity<prngCanonical3d(normPos/stepSize)) {discard;}
|
|
10
|
+
glFragData[0]=normPos.z<nearPlane+stepSize ? 1.0 : 0.0;glFragData[1]=normPos.z>=nearPlane+stepSize && normPos.z<nearPlane+2.0*stepSize ? 1.0 : 0.0;glFragData[2]=normPos.z>=nearPlane+2.0*stepSize && normPos.z<nearPlane+3.0*stepSize ? 1.0 : 0.0;glFragData[3]=normPos.z>=nearPlane+3.0*stepSize && normPos.z<nearPlane+4.0*stepSize ? 1.0 : 0.0;
|
|
11
|
+
#if MAX_DRAW_BUFFERS>4
|
|
12
|
+
glFragData[4]=normPos.z>=nearPlane+4.0*stepSize && normPos.z<nearPlane+5.0*stepSize ? 1.0 : 0.0;glFragData[5]=normPos.z>=nearPlane+5.0*stepSize && normPos.z<nearPlane+6.0*stepSize ? 1.0 : 0.0;
|
|
13
|
+
#if MAX_DRAW_BUFFERS>6
|
|
14
|
+
glFragData[6]=normPos.z>=nearPlane+6.0*stepSize && normPos.z<nearPlane+7.0*stepSize ? 1.0 : 0.0;glFragData[7]=normPos.z>=nearPlane+7.0*stepSize && normPos.z<nearPlane+8.0*stepSize ? 1.0 : 0.0;
|
|
15
|
+
#endif
|
|
16
|
+
#endif
|
|
17
|
+
}`;e.ShadersStore[a]||(e.ShadersStore[a]=n);const r={name:a,shader:n};export{r as gaussianSplattingVoxelPixelShader};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import{S as t}from"./index-B2zBEWsq.js";import{s as i}from"./sceneUboDeclaration-BzFIc4mb.js";import{m as o}from"./meshUboDeclaration-BnX046aQ.js";import{g as s}from"./gaussianSplatting-DIn8R8oF.js";const r="gaussianSplattingVoxelVertexShader",a=`#include<sceneUboDeclaration>
|
|
2
|
+
#include<meshUboDeclaration>
|
|
3
|
+
attribute splatIndex0: vec4f;attribute splatIndex1: vec4f;attribute splatIndex2: vec4f;attribute splatIndex3: vec4f;attribute position: vec3f;uniform dataTextureSize: vec2f;uniform alpha: f32;uniform invWorldScale: mat4x4f;uniform viewMatrix: mat4x4f;
|
|
4
|
+
#if IS_COMPOUND
|
|
5
|
+
uniform partWorld: array<mat4x4<f32>,MAX_PART_COUNT>;uniform partVisibility: array<f32,MAX_PART_COUNT>;
|
|
6
|
+
#endif
|
|
7
|
+
var rotationsATexture: texture_2d<f32>;var rotationsBTexture: texture_2d<f32>;var rotationScaleTexture: texture_2d<f32>;var centersTexture: texture_2d<f32>;var colorsTexture: texture_2d<f32>;
|
|
8
|
+
#if IS_COMPOUND
|
|
9
|
+
var partIndicesTexture: texture_2d<f32>;
|
|
10
|
+
#endif
|
|
11
|
+
varying vNormalizedPosition: vec3f;varying vNormalizedCenterPosition: vec3f;varying vAlpha: f32;varying vPatchPosition: vec2f;
|
|
12
|
+
#include<gaussianSplatting>
|
|
13
|
+
@vertex
|
|
14
|
+
fn main(input: VertexInputs)->FragmentInputs {let splatIndex: f32=getSplatIndex(
|
|
15
|
+
i32(vertexInputs.position.z+0.5),
|
|
16
|
+
vertexInputs.splatIndex0,vertexInputs.splatIndex1,
|
|
17
|
+
vertexInputs.splatIndex2,vertexInputs.splatIndex3
|
|
18
|
+
);var splat: Splat=readSplat(splatIndex,uniforms.dataTextureSize);
|
|
19
|
+
#if IS_COMPOUND
|
|
20
|
+
if (uniforms.partVisibility[splat.partIndex]==0.0) {vertexOutputs.position=vec4f(2.0,2.0,2.0,1.0);return vertexOutputs;}
|
|
21
|
+
let splatWorld: mat4x4f=getPartWorld(splat.partIndex);
|
|
22
|
+
#else
|
|
23
|
+
let splatWorld: mat4x4f=mesh.world;
|
|
24
|
+
#endif
|
|
25
|
+
let quadPos: vec2f=vertexInputs.position.xy;let worldPos: vec4f=computeVoxelSplatWorldPos(splat.rotationA,splat.rotationB,splat.rotationScale,splat.center.xyz,splatWorld,uniforms.viewMatrix,uniforms.invWorldScale,quadPos);vertexOutputs.vNormalizedPosition=(uniforms.invWorldScale*worldPos).xyz*0.5+0.5;let clipPos: vec4f=uniforms.viewMatrix*uniforms.invWorldScale*worldPos;vertexOutputs.position=vec4f(clipPos.x,clipPos.y,clipPos.z*0.5+0.5,1.0);vertexOutputs.vNormalizedCenterPosition=(uniforms.invWorldScale*splatWorld*vec4f(splat.center.xyz,1.0)).xyz*0.5+0.5;vertexOutputs.vAlpha=splat.color.w*uniforms.alpha;
|
|
26
|
+
#if IS_COMPOUND
|
|
27
|
+
vertexOutputs.vAlpha*=uniforms.partVisibility[splat.partIndex];
|
|
28
|
+
#endif
|
|
29
|
+
vertexOutputs.vPatchPosition=quadPos;}
|
|
30
|
+
`;t.ShadersStoreWGSL[r]||(t.ShadersStoreWGSL[r]=a);const n=[i,o,s];for(const e of n)t.IncludesShadersStoreWGSL[e.name]||(t.IncludesShadersStoreWGSL[e.name]=e.shader);const f={name:r,shader:a};export{f as gaussianSplattingVoxelVertexShaderWGSL};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import{S as a,s as o,m as r}from"./index-B2zBEWsq.js";import{g as n,a as l,b as s}from"./gaussianSplatting-Cfigjb15.js";const e="gaussianSplattingVoxelVertexShader",i=`#include<__decl__gaussianSplattingVertex>
|
|
2
|
+
uniform vec2 dataTextureSize;uniform float alpha;uniform mat4 invWorldScale;uniform mat4 viewMatrix;uniform sampler2D rotationsATexture;uniform sampler2D rotationsBTexture;uniform sampler2D rotationScaleTexture;uniform sampler2D centersTexture;uniform sampler2D colorsTexture;
|
|
3
|
+
#if IS_COMPOUND
|
|
4
|
+
uniform mat4 partWorld[MAX_PART_COUNT];uniform float partVisibility[MAX_PART_COUNT];uniform sampler2D partIndicesTexture;
|
|
5
|
+
#endif
|
|
6
|
+
varying vec3 vNormalizedPosition;varying vec3 vNormalizedCenterPosition;varying float vAlpha;varying vec2 vPatchPosition;
|
|
7
|
+
#include<gaussianSplatting>
|
|
8
|
+
void main(void) {float splatIndex=getSplatIndex(int(position.z+0.5));Splat splat=readSplat(splatIndex);
|
|
9
|
+
#if IS_COMPOUND
|
|
10
|
+
if (partVisibility[splat.partIndex]==0.0) {gl_Position=vec4(2.0,2.0,2.0,1.0);return;}
|
|
11
|
+
mat4 splatWorld=getPartWorld(splat.partIndex);
|
|
12
|
+
#else
|
|
13
|
+
mat4 splatWorld=world;
|
|
14
|
+
#endif
|
|
15
|
+
vec4 worldPos=computeVoxelSplatWorldPos(splat.rotationA,splat.rotationB,splat.rotationScale,splat.center.xyz,splatWorld,viewMatrix,invWorldScale,position.xy);gl_Position=viewMatrix*invWorldScale*worldPos;vNormalizedPosition=gl_Position.xyz*0.5+0.5;vec4 viewCenterPos=viewMatrix*invWorldScale*splatWorld*vec4(splat.center.xyz,1.0);vNormalizedCenterPosition=viewCenterPos.xyz*0.5+0.5;vAlpha=splat.color.w*alpha;
|
|
16
|
+
#if IS_COMPOUND
|
|
17
|
+
vAlpha*=partVisibility[splat.partIndex];
|
|
18
|
+
#endif
|
|
19
|
+
vPatchPosition=position.xy;}`;a.ShadersStore[e]||(a.ShadersStore[e]=i);const p=[n,o,r,l,s];for(const t of p)a.IncludesShadersStore[t.name]||(a.IncludesShadersStore[t.name]=t.shader);const m={name:e,shader:i};export{m as gaussianSplattingVoxelVertexShader};
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import{S as e,ah as o,am as t,an as d,ao as l,p as c,ap as s,s as E,aq as v,ar as m,as as u,al as S,at as I}from"./index-B2zBEWsq.js";import{s as R,o as T,a as A,b as p,c as D,d as _}from"./openpbrTransmissionLayerData-BDa9qEoN.js";const n="mrtFragmentDeclaration",a=`#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
|
|
2
|
+
layout(location=0) out vec4 glFragData[{X}];
|
|
3
|
+
#endif
|
|
4
|
+
`;e.IncludesShadersStore[n]||(e.IncludesShadersStore[n]=a);const g={name:n,shader:a},r="geometryPixelShader",f=`#extension GL_EXT_draw_buffers : require
|
|
5
|
+
#if defined(BUMP) || !defined(NORMAL)
|
|
6
|
+
#extension GL_OES_standard_derivatives : enable
|
|
7
|
+
#endif
|
|
8
|
+
precision highp float;
|
|
9
|
+
#ifdef BUMP
|
|
10
|
+
varying mat4 vWorldView;varying vec3 vNormalW;
|
|
11
|
+
#else
|
|
12
|
+
varying vec3 vNormalV;
|
|
13
|
+
#endif
|
|
14
|
+
varying vec4 vViewPos;
|
|
15
|
+
#if defined(POSITION) || defined(BUMP) || defined(IRRADIANCE)
|
|
16
|
+
varying vec3 vPositionW;
|
|
17
|
+
#endif
|
|
18
|
+
#if defined(VELOCITY) || defined(VELOCITY_LINEAR)
|
|
19
|
+
varying vec4 vCurrentPosition;varying vec4 vPreviousPosition;
|
|
20
|
+
#endif
|
|
21
|
+
#ifdef NEED_UV
|
|
22
|
+
varying vec2 vUV;
|
|
23
|
+
#endif
|
|
24
|
+
#ifdef BUMP
|
|
25
|
+
uniform vec3 vBumpInfos;uniform vec2 vTangentSpaceParams;
|
|
26
|
+
#endif
|
|
27
|
+
#if defined(REFLECTIVITY)
|
|
28
|
+
#if defined(ORMTEXTURE) || defined(SPECULARGLOSSINESSTEXTURE) || defined(REFLECTIVITYTEXTURE)
|
|
29
|
+
uniform sampler2D reflectivitySampler;varying vec2 vReflectivityUV;
|
|
30
|
+
#else
|
|
31
|
+
#ifdef METALLIC_TEXTURE
|
|
32
|
+
uniform sampler2D metallicSampler;varying vec2 vMetallicUV;
|
|
33
|
+
#endif
|
|
34
|
+
#ifdef ROUGHNESS_TEXTURE
|
|
35
|
+
uniform sampler2D roughnessSampler;varying vec2 vRoughnessUV;
|
|
36
|
+
#endif
|
|
37
|
+
#endif
|
|
38
|
+
#ifdef ALBEDOTEXTURE
|
|
39
|
+
varying vec2 vAlbedoUV;uniform sampler2D albedoSampler;
|
|
40
|
+
#endif
|
|
41
|
+
#ifdef REFLECTIVITYCOLOR
|
|
42
|
+
uniform vec3 reflectivityColor;
|
|
43
|
+
#endif
|
|
44
|
+
#ifdef ALBEDOCOLOR
|
|
45
|
+
uniform vec3 albedoColor;
|
|
46
|
+
#endif
|
|
47
|
+
#ifdef METALLIC
|
|
48
|
+
uniform float metallic;
|
|
49
|
+
#endif
|
|
50
|
+
#if defined(ROUGHNESS) || defined(GLOSSINESS)
|
|
51
|
+
uniform float glossiness;
|
|
52
|
+
#endif
|
|
53
|
+
#endif
|
|
54
|
+
#if defined(ALPHATEST) && defined(NEED_UV)
|
|
55
|
+
uniform sampler2D diffuseSampler;
|
|
56
|
+
#endif
|
|
57
|
+
#include<clipPlaneFragmentDeclaration>
|
|
58
|
+
#include<mrtFragmentDeclaration>[SCENE_MRT_COUNT]
|
|
59
|
+
#include<bumpFragmentMainFunctions>
|
|
60
|
+
#include<bumpFragmentFunctions>
|
|
61
|
+
#include<helperFunctions>
|
|
62
|
+
#ifdef IRRADIANCE
|
|
63
|
+
#include<pbrFragmentReflectionDeclaration>
|
|
64
|
+
#ifdef REFLECTION
|
|
65
|
+
#ifdef USEIRRADIANCEMAP
|
|
66
|
+
#include<__decl__sceneFragment>
|
|
67
|
+
uniform mat4 reflectionMatrix;uniform vec2 vReflectionInfos;uniform vec3 vReflectionDominantDirection;
|
|
68
|
+
#include<pbrBRDFFunctions>
|
|
69
|
+
#include<openpbrDielectricReflectance>
|
|
70
|
+
#include<pbrIBLFunctions>
|
|
71
|
+
#include<reflectionFunction>
|
|
72
|
+
#include<openpbrGeometryInfo>
|
|
73
|
+
#include<openpbrIblFunctions>
|
|
74
|
+
#elif defined(USESPHERICALFROMREFLECTIONMAP)
|
|
75
|
+
varying vec3 vEnvironmentIrradiance;
|
|
76
|
+
#endif
|
|
77
|
+
#ifdef IBL_SHADOW_TEXTURE
|
|
78
|
+
uniform sampler2D iblShadowSampler;uniform vec2 shadowTextureSize;
|
|
79
|
+
#endif
|
|
80
|
+
#ifdef IRRADIANCE_SCATTER_MASK
|
|
81
|
+
uniform float vSubsurfaceWeight;
|
|
82
|
+
#include<samplerFragmentDeclaration>(_DEFINENAME_,SUBSURFACE_WEIGHT,_VARYINGNAME_,SubsurfaceWeight,_SAMPLERNAME_,subsurfaceWeight)
|
|
83
|
+
uniform float vSubsurfaceScatterAnisotropy;uniform float vTransmissionWeight;
|
|
84
|
+
#include<samplerFragmentDeclaration>(_DEFINENAME_,TRANSMISSION_WEIGHT,_VARYINGNAME_,TransmissionWeight,_SAMPLERNAME_,transmissionWeight)
|
|
85
|
+
uniform float vTransmissionScatterAnisotropy;
|
|
86
|
+
#endif
|
|
87
|
+
#endif
|
|
88
|
+
#endif
|
|
89
|
+
void main() {
|
|
90
|
+
#include<clipPlaneFragment>
|
|
91
|
+
#ifdef ALPHATEST
|
|
92
|
+
if (texture2D(diffuseSampler,vUV).a<0.4)
|
|
93
|
+
discard;
|
|
94
|
+
#endif
|
|
95
|
+
vec3 normalOutput;
|
|
96
|
+
#ifdef BUMP
|
|
97
|
+
vec3 normalW=normalize(vNormalW);
|
|
98
|
+
#include<bumpFragment>
|
|
99
|
+
#ifdef NORMAL_WORLDSPACE
|
|
100
|
+
normalOutput=normalW;
|
|
101
|
+
#else
|
|
102
|
+
normalOutput=normalize(vec3(vWorldView*vec4(normalW,0.0)));
|
|
103
|
+
#endif
|
|
104
|
+
#elif defined(HAS_NORMAL_ATTRIBUTE)
|
|
105
|
+
normalOutput=normalize(vNormalV);
|
|
106
|
+
#elif defined(POSITION)
|
|
107
|
+
normalOutput=normalize(-cross(dFdx(vPositionW),dFdy(vPositionW)));
|
|
108
|
+
#endif
|
|
109
|
+
#ifdef ENCODE_NORMAL
|
|
110
|
+
normalOutput=normalOutput*0.5+0.5;
|
|
111
|
+
#endif
|
|
112
|
+
#ifdef DEPTH
|
|
113
|
+
gl_FragData[DEPTH_INDEX]=vec4(vViewPos.z/vViewPos.w,0.0,0.0,1.0);
|
|
114
|
+
#endif
|
|
115
|
+
#ifdef NORMAL
|
|
116
|
+
gl_FragData[NORMAL_INDEX]=vec4(normalOutput,1.0);
|
|
117
|
+
#endif
|
|
118
|
+
#ifdef SCREENSPACE_DEPTH
|
|
119
|
+
gl_FragData[SCREENSPACE_DEPTH_INDEX]=vec4(gl_FragCoord.z,0.0,0.0,1.0);
|
|
120
|
+
#endif
|
|
121
|
+
#ifdef POSITION
|
|
122
|
+
gl_FragData[POSITION_INDEX]=vec4(vPositionW,1.0);
|
|
123
|
+
#endif
|
|
124
|
+
#ifdef VELOCITY
|
|
125
|
+
vec2 a=(vCurrentPosition.xy/vCurrentPosition.w)*0.5+0.5;vec2 b=(vPreviousPosition.xy/vPreviousPosition.w)*0.5+0.5;vec2 velocity=abs(a-b);velocity=vec2(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;gl_FragData[VELOCITY_INDEX]=vec4(velocity,0.0,1.0);
|
|
126
|
+
#endif
|
|
127
|
+
#ifdef VELOCITY_LINEAR
|
|
128
|
+
vec2 velocity=vec2(0.5)*((vPreviousPosition.xy/vPreviousPosition.w) -
|
|
129
|
+
(vCurrentPosition.xy/vCurrentPosition.w));gl_FragData[VELOCITY_LINEAR_INDEX]=vec4(velocity,0.0,1.0);
|
|
130
|
+
#endif
|
|
131
|
+
#ifdef REFLECTIVITY
|
|
132
|
+
vec4 reflectivity=vec4(0.0,0.0,0.0,1.0);
|
|
133
|
+
#ifdef METALLICWORKFLOW
|
|
134
|
+
float metal=1.0;float roughness=1.0;
|
|
135
|
+
#ifdef ORMTEXTURE
|
|
136
|
+
metal*=texture2D(reflectivitySampler,vReflectivityUV).b;roughness*=texture2D(reflectivitySampler,vReflectivityUV).g;
|
|
137
|
+
#else
|
|
138
|
+
#ifdef METALLIC_TEXTURE
|
|
139
|
+
metal*=texture2D(metallicSampler,vMetallicUV).r;
|
|
140
|
+
#endif
|
|
141
|
+
#ifdef ROUGHNESS_TEXTURE
|
|
142
|
+
roughness*=texture2D(roughnessSampler,vRoughnessUV).r;
|
|
143
|
+
#endif
|
|
144
|
+
#endif
|
|
145
|
+
#ifdef METALLIC
|
|
146
|
+
metal*=metallic;
|
|
147
|
+
#endif
|
|
148
|
+
#ifdef ROUGHNESS
|
|
149
|
+
roughness*=(1.0-glossiness);
|
|
150
|
+
#endif
|
|
151
|
+
reflectivity.a-=roughness;vec3 color=vec3(1.0);
|
|
152
|
+
#ifdef ALBEDOTEXTURE
|
|
153
|
+
color=texture2D(albedoSampler,vAlbedoUV).rgb;
|
|
154
|
+
#ifdef GAMMAALBEDO
|
|
155
|
+
color=toLinearSpace(color);
|
|
156
|
+
#endif
|
|
157
|
+
#endif
|
|
158
|
+
#ifdef ALBEDOCOLOR
|
|
159
|
+
color*=albedoColor.xyz;
|
|
160
|
+
#endif
|
|
161
|
+
reflectivity.rgb=mix(vec3(0.04),color,metal);
|
|
162
|
+
#else
|
|
163
|
+
#if defined(SPECULARGLOSSINESSTEXTURE) || defined(REFLECTIVITYTEXTURE)
|
|
164
|
+
reflectivity=texture2D(reflectivitySampler,vReflectivityUV);
|
|
165
|
+
#ifdef GAMMAREFLECTIVITYTEXTURE
|
|
166
|
+
reflectivity.rgb=toLinearSpace(reflectivity.rgb);
|
|
167
|
+
#endif
|
|
168
|
+
#else
|
|
169
|
+
#ifdef REFLECTIVITYCOLOR
|
|
170
|
+
reflectivity.rgb=toLinearSpace(reflectivityColor.xyz);reflectivity.a=1.0;
|
|
171
|
+
#endif
|
|
172
|
+
#endif
|
|
173
|
+
#ifdef GLOSSINESSS
|
|
174
|
+
reflectivity.a*=glossiness;
|
|
175
|
+
#endif
|
|
176
|
+
#endif
|
|
177
|
+
gl_FragData[REFLECTIVITY_INDEX]=reflectivity;
|
|
178
|
+
#endif
|
|
179
|
+
#ifdef IRRADIANCE
|
|
180
|
+
vec3 irradiance=vec3(0.0);float irradiance_alpha=1.0;
|
|
181
|
+
#ifdef REFLECTION
|
|
182
|
+
#ifdef IRRADIANCE_SCATTER_MASK
|
|
183
|
+
#ifndef BUMP
|
|
184
|
+
vec2 uvOffset=vec2(0.0);
|
|
185
|
+
#endif
|
|
186
|
+
vec3 vSubsurfaceColor=vec3(1.0);float vSubsurfaceRadius=0.0;vec3 vSubsurfaceRadiusScale=vec3(1.0);
|
|
187
|
+
#include<openpbrSubsurfaceLayerData>
|
|
188
|
+
float vTransmissionDepth=1.0;vec3 vTransmissionColor=vec3(1.0);vec3 vTransmissionScatter=vec3(0.0);float vTransmissionDispersionScale=0.0;float vTransmissionDispersionAbbeNumber=0.0;
|
|
189
|
+
#include<openpbrTransmissionLayerData>
|
|
190
|
+
#endif
|
|
191
|
+
#ifdef IBL_SHADOW_TEXTURE
|
|
192
|
+
#ifdef COLORED_IBL_SHADOWS
|
|
193
|
+
vec3 iblShadowValue=texture(iblShadowSampler,gl_FragCoord.xy/shadowTextureSize).rgb;
|
|
194
|
+
#else
|
|
195
|
+
vec3 iblShadowValue=vec3(texture(iblShadowSampler,gl_FragCoord.xy/shadowTextureSize).r);
|
|
196
|
+
#endif
|
|
197
|
+
#endif
|
|
198
|
+
#if defined(USEIRRADIANCEMAP)
|
|
199
|
+
#ifdef IRRADIANCE_SCATTER_MASK
|
|
200
|
+
float bendAmount=subsurface_weight*-min(subsurface_scatter_anisotropy,0.0);bendAmount=mix(bendAmount,-min(transmission_scatter_anisotropy,0.0),transmission_weight);vec3 viewVector=normalize(vEyePosition.xyz-vPositionW.xyz);vec3 bentNormal=mix(normalOutput,viewVector,bendAmount*dot(normalOutput,viewVector));
|
|
201
|
+
#else
|
|
202
|
+
vec3 bentNormal=normalOutput;
|
|
203
|
+
#endif
|
|
204
|
+
irradiance=sampleIrradiance(
|
|
205
|
+
bentNormal
|
|
206
|
+
#if defined(NORMAL) && defined(USESPHERICALINVERTEX)
|
|
207
|
+
,vEnvironmentIrradiance
|
|
208
|
+
#endif
|
|
209
|
+
#if (defined(USESPHERICALFROMREFLECTIONMAP) && (!defined(NORMAL) || !defined(USESPHERICALINVERTEX))) || (defined(USEIRRADIANCEMAP) && defined(REFLECTIONMAP_3D))
|
|
210
|
+
,reflectionMatrix
|
|
211
|
+
#endif
|
|
212
|
+
#ifdef USEIRRADIANCEMAP
|
|
213
|
+
,irradianceSampler
|
|
214
|
+
#ifdef USE_IRRADIANCE_DOMINANT_DIRECTION
|
|
215
|
+
,vReflectionDominantDirection
|
|
216
|
+
#endif
|
|
217
|
+
#endif
|
|
218
|
+
#ifdef REALTIME_FILTERING
|
|
219
|
+
,vReflectionFilteringInfo
|
|
220
|
+
#ifdef IBL_CDF_FILTERING
|
|
221
|
+
,icdfSampler
|
|
222
|
+
#endif
|
|
223
|
+
#endif
|
|
224
|
+
,vReflectionInfos
|
|
225
|
+
,vViewPos.xyz
|
|
226
|
+
,1.0
|
|
227
|
+
,vec3(1.0)
|
|
228
|
+
);
|
|
229
|
+
#elif defined(USESPHERICALFROMREFLECTIONMAP)
|
|
230
|
+
irradiance=vEnvironmentIrradiance;
|
|
231
|
+
#endif
|
|
232
|
+
#ifdef IBL_SHADOW_TEXTURE
|
|
233
|
+
irradiance*=iblShadowValue;
|
|
234
|
+
#endif
|
|
235
|
+
#ifdef IRRADIANCE_SCATTER_MASK
|
|
236
|
+
irradiance_alpha=min(subsurface_weight+transmission_weight,1.0);
|
|
237
|
+
#endif
|
|
238
|
+
#endif
|
|
239
|
+
gl_FragData[IRRADIANCE_INDEX]=vec4(irradiance,irradiance_alpha);
|
|
240
|
+
#endif
|
|
241
|
+
}
|
|
242
|
+
`;e.ShadersStore[r]||(e.ShadersStore[r]=f);const L=[o,g,t,d,l,c,s,R,E,v,T,m,u,A,p,S,I,D,_];for(const i of L)e.IncludesShadersStore[i.name]||(e.IncludesShadersStore[i.name]=i.shader);const C={name:r,shader:f};export{C as geometryPixelShader};
|