@arcgis/core 5.2.0-next.117 → 5.2.0-next.118
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/analysis/ElevationProfile/ElevationProfileLineQuery.d.ts +1 -1
- package/analysis/featureReferenceUtils.js +1 -1
- package/arcade.d.ts +1 -1
- package/arcade.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/03918a862455191a8910.js +1 -0
- package/assets/esri/core/workers/chunks/{9b9a60f1e0c48aa701f0.js → 066b7f6866d602f963e0.js} +1 -1
- package/assets/esri/core/workers/chunks/{4bfd63f3cf9208eb839b.js → 0dc317d022807af92e3f.js} +41 -41
- package/assets/esri/core/workers/chunks/{564fdf0d663b773806cc.js → 114bc14c49176f64a2c5.js} +1 -1
- package/assets/esri/core/workers/chunks/1630913399384030d0b9.js +1 -0
- package/assets/esri/core/workers/chunks/{db141122060d8d9b38da.js → 1742dbc6a827cfda471b.js} +1 -1
- package/assets/esri/core/workers/chunks/{045ff98313b06a2188b7.js → 1a39335aa2dce6d564d9.js} +1 -1
- package/assets/esri/core/workers/chunks/{caf38cf4d8542fb11c46.js → 20e4277a4a6c57957202.js} +1 -1
- package/assets/esri/core/workers/chunks/{729d458e9e28641227cd.js → 21c0743b2f612e7e7de3.js} +1 -1
- package/assets/esri/core/workers/chunks/{f42243c62dd0b6993816.js → 24014f3701c31ee74bc2.js} +1 -1
- package/assets/esri/core/workers/chunks/37cf4ca2083cd3b6002e.js +1 -0
- package/assets/esri/core/workers/chunks/{44d3fe10cb35d16f0b33.js → 4396ef5ab3eb9e9a7df2.js} +1 -1
- package/assets/esri/core/workers/chunks/{3b499cfc89c8f87cdb20.js → 4925d0b29a166cc8fee1.js} +1 -1
- package/assets/esri/core/workers/chunks/{56989b48c0a5d7fe85e6.js → 4c4ba466e23159991322.js} +1 -1
- package/assets/esri/core/workers/chunks/{b9023cc3298ee4fddea7.js → 54f3bc940cea15fce2c7.js} +1 -1
- package/assets/esri/core/workers/chunks/{7e42be27ead91a4cc0f1.js → 581285e4d7bbe1b7c27a.js} +1 -1
- package/assets/esri/core/workers/chunks/{05584d8828ae7bca0fc5.js → 64ee22134fda2f09c094.js} +1 -1
- package/assets/esri/core/workers/chunks/6efc5873747b9cd44fb9.js +1 -0
- package/assets/esri/core/workers/chunks/{0463c807b37f01bbc35c.js → 70347d25968975126fa7.js} +1 -1
- package/assets/esri/core/workers/chunks/{1eafb214519d8fc63ccb.js → 8465e2c7221125fd3cc4.js} +1 -1
- package/assets/esri/core/workers/chunks/862e1acd80c4e43831dc.js +1 -0
- package/assets/esri/core/workers/chunks/{fd808d38ae2d475ac442.js → 8675ab3c4dec2f13b9c6.js} +1 -1
- package/assets/esri/core/workers/chunks/{925a0b29d3ed7165b8dd.js → 8984d02c0ce828fd223a.js} +1 -1
- package/assets/esri/core/workers/chunks/{57328c206f1e699ac06f.js → 89edaa1ffa566908ebca.js} +1 -1
- package/assets/esri/core/workers/chunks/{bb4cbf6b7c35e8c78cc7.js → a917a1df8270860dc514.js} +1 -1
- package/assets/esri/core/workers/chunks/{996438b3afec92c5c68e.js → b0058619e0363002ad86.js} +1 -1
- package/assets/esri/core/workers/chunks/{9fb46ccd4be4c3b61c31.js → b5a102cf9f4377fb9842.js} +1 -1
- package/assets/esri/core/workers/chunks/b6409d89914030d5854a.js +1 -0
- package/assets/esri/core/workers/chunks/{2e0fd0536408053ac6f5.js → b961e0aaa6b3ea75315c.js} +1 -1
- package/assets/esri/core/workers/chunks/{fa869977ac2abb063925.js → b9c834e3c0701e9b14a2.js} +1 -1
- package/assets/esri/core/workers/chunks/{32dd990a3bd93cbad309.js → c0ec87800faf99cbd8bd.js} +1 -1
- package/assets/esri/core/workers/chunks/{20de0ea9fa08a6545978.js → cf1106eda10f3cccb1bd.js} +1 -1
- package/assets/esri/core/workers/chunks/{ed988360264574cd8f6b.js → cf7c06702babd6fa88b4.js} +1 -1
- package/assets/esri/core/workers/chunks/cfd8317ecd2e63af7c40.js +1 -0
- package/assets/esri/core/workers/chunks/d090baaa974e1e83fa44.js +1 -0
- package/assets/esri/core/workers/chunks/{c5ceceb0683671f92efa.js → da6583e8d88441a1c02a.js} +1 -1
- package/assets/esri/core/workers/chunks/{e1f2b07be33e33117313.js → dd02cc18ebebb90778c6.js} +1 -1
- package/assets/esri/core/workers/chunks/de8a3a0796bd115426c0.js +1 -0
- package/assets/esri/core/workers/chunks/{05b373a663cb5d4d722f.js → deb5b1d772ca407654d4.js} +1 -1
- package/assets/esri/core/workers/chunks/{10fa8fbade8ae084c307.js → e22a013ec38989caf9de.js} +1 -1
- package/assets/esri/core/workers/chunks/{c7e6b5594fed5bb16691.js → e4016ae9cb8f16e3efc3.js} +1 -1
- package/assets/esri/core/workers/chunks/e5f0c47957a4e9663720.js +1 -0
- package/assets/esri/core/workers/chunks/{a3f4818f4190fa92331d.js → edd36e98355f1655e5c8.js} +1 -1
- package/assets/esri/core/workers/chunks/ef6e52f9b656751eebaf.js +1 -0
- package/assets/esri/core/workers/chunks/f0709c48daca93e759c8.js +1 -0
- package/assets/esri/core/workers/chunks/f5423006fb07db7dd6ee.js +1 -0
- package/assets/esri/core/workers/chunks/{d926bffc3ff9f87e9081.js → f890359d972cce54459e.js} +1 -1
- package/assets/esri/core/workers/chunks/fb11ff3f2eae5f072560.js +1 -0
- package/assets/esri/core/workers/chunks/fdad31bbe8aee68a6eaf.js +1 -0
- package/assets/esri/core/workers/chunks/fe1787a8d499832996b3.js +1 -0
- package/chunks/CloudsComposition.glsl.js +2 -2
- package/chunks/ColorMaterial.glsl.js +3 -3
- package/chunks/Compositing.glsl.js +4 -4
- package/chunks/DeepSky.glsl.js +3 -3
- package/chunks/EdgeShader.glsl.js +6 -6
- package/chunks/FocusArea.glsl.js +1 -1
- package/chunks/GlobalIllumination.glsl.js +7 -7
- package/chunks/HUDMaterial.glsl.js +5 -5
- package/chunks/LaserlinePath.glsl.js +5 -5
- package/chunks/LineCallout.glsl.js +2 -2
- package/chunks/LineMarker.glsl.js +30 -30
- package/chunks/NavigationDepth.glsl.js +1 -1
- package/chunks/OccludedGeometryDepth.glsl.js +2 -2
- package/chunks/Path.glsl.js +12 -12
- package/chunks/PointRenderer.glsl.js +5 -5
- package/chunks/Precipitation.glsl.js +7 -7
- package/chunks/RibbonLine.glsl.js +50 -50
- package/chunks/SimpleAtmosphere.glsl.js +9 -9
- package/chunks/Stars.glsl.js +5 -5
- package/chunks/Terrain.glsl.js +18 -16
- package/chunks/Viewshed.glsl.js +3 -3
- package/chunks/VolumeMask.glsl.js +2 -2
- package/chunks/Water.glsl.js +20 -19
- package/config.js +1 -1
- package/core/NestedMap.js +1 -1
- package/kernel.js +1 -1
- package/layers/AnnotationFeatureLayer.d.ts +2 -1
- package/layers/AnnotationFeatureLayer.js +1 -1
- package/layers/CatalogLayer.d.ts +2 -1
- package/layers/CatalogLayer.js +1 -1
- package/layers/DimensionFeatureLayer.d.ts +2 -1
- package/layers/DimensionFeatureLayer.js +1 -1
- package/layers/FeatureLayer.d.ts +2 -30
- package/layers/FeatureLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/SubtypeGroupLayer.d.ts +2 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/mixins/FeatureLayerBase.js +1 -1
- package/layers/mixins/FeatureLayerReload.d.ts +26 -0
- package/layers/mixins/FeatureLayerReload.js +2 -0
- package/layers/mixins/PortalLayer.js +1 -1
- package/layers/support/TimeInfo.d.ts +2 -2
- package/layers/support/TimeInfo.js +1 -1
- package/layers/support/fieldUtils.js +1 -1
- package/package.json +2 -2
- package/support/revision.js +1 -1
- package/time/timeZoneUtils.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightEditTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
- package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
- package/views/3d/support/engineContent/line.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +9 -9
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +15 -15
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js +23 -23
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js +8 -8
- package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterColor.glsl.js +7 -7
- package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +7 -7
- package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js +2 -0
- package/views/3d/webgl-engine/effects/AmbientIllumination.js +1 -1
- package/views/3d/webgl-engine/effects/atmosphere/SimpleAtmosphere.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/clouds/CloudsComposition.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserlinePath.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/precipitation/Precipitation.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
- package/views/3d/webgl-engine/effects/stars/DeepSky.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/stars/Stars.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/LineMaterial.js +1 -1
- package/views/3d/webgl-engine/lib/Program.js +1 -1
- package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/AdjustProjectedPosition.glsl.js +4 -4
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeShader.glsl.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/Path.glsl.js +1 -1
- package/views/3d/webgl-engine/materials/PolygonOffset.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ViewingModeConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Compositing.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatPass.glsl.js +26 -26
- package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCalloutTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/LineTechniqueConfiguration.js +2 -0
- package/views/3d/webgl-engine/shaders/MeasurementArrowTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/NavigationDepth.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/OccludedGeometryDepth.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/PointRenderer.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ScreenSpacePassAtmosphere.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Viewshed.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/VolumeMask.glsl.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileLineQuery.d.ts +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/widgets/ValuePicker.d.ts +1 -1
- package/widgets/ValuePicker.js +1 -1
- package/widgets/VideoPlayer/VideoPlayerViewModel.d.ts +4 -2
- package/widgets/VideoPlayer/VideoPlayerViewModel.js +1 -1
- package/widgets/VideoPlayer.js +1 -1
- package/assets/esri/core/workers/chunks/0630e650abdfea1792e4.js +0 -1
- package/assets/esri/core/workers/chunks/0edebc6c516f0b9dac7b.js +0 -1
- package/assets/esri/core/workers/chunks/25c5e1b14b184b1228a3.js +0 -1
- package/assets/esri/core/workers/chunks/573e8fa0af8711ffec45.js +0 -1
- package/assets/esri/core/workers/chunks/5b9925f23d4b10a7087e.js +0 -1
- package/assets/esri/core/workers/chunks/66c46c5a7147550ea3ed.js +0 -1
- package/assets/esri/core/workers/chunks/6c7cb7974969e3167f2b.js +0 -1
- package/assets/esri/core/workers/chunks/7bbc3d22383388d11345.js +0 -1
- package/assets/esri/core/workers/chunks/7edf57e31ff07af9032b.js +0 -1
- package/assets/esri/core/workers/chunks/8bd187b48a4e4296e3d8.js +0 -1
- package/assets/esri/core/workers/chunks/9acaabe950319d031f2e.js +0 -1
- package/assets/esri/core/workers/chunks/ac02df176f9ea94278bb.js +0 -1
- package/assets/esri/core/workers/chunks/b4222152efaf73b37b53.js +0 -1
- package/assets/esri/core/workers/chunks/c0855be20ffcd52c7026.js +0 -1
- package/assets/esri/core/workers/chunks/e606be4ece4eac1e9bbe.js +0 -1
- package/assets/esri/core/workers/chunks/f05622413cadfd14553e.js +0 -1
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{markerTextureSize as e,markerSymbolSize as r,markerTipThicknessFactor as i}from"../views/3d/support/engineContent/marker.js";import{SliceDraw as t}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{RibbonVertexPosition as o}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js";import{OutputHighlight as a}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{MarkerSizing as s}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js";import{positionOutsideClipSpace as n}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PositionOutsideClipSpace.js";import{
|
|
2
|
+
import{markerTextureSize as e,markerSymbolSize as r,markerTipThicknessFactor as i}from"../views/3d/support/engineContent/marker.js";import{SliceDraw as t}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{RibbonVertexPosition as o}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js";import{OutputHighlight as a}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{MarkerSizing as s}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js";import{positionOutsideClipSpace as n}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PositionOutsideClipSpace.js";import{nearFar as l,viewport as c,viewNormal as p,inverseProjMatrix as d}from"../views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js";import{ColorConversion as v}from"../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import{NoPerspectiveWrite as m,NoPerspectiveRead as h}from"../views/3d/webgl-engine/core/shaderLibrary/util/NoPerspective.glsl.js";import{addProjViewLocalOrigin as u,addPixelRatio as f}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float4PassUniform as g}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatBindUniform as w}from"../views/3d/webgl-engine/core/shaderModules/FloatBindUniform.js";import{glsl as y,If as S}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DPassUniform as b}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{alphaCutoff as x}from"../views/3d/webgl-engine/shaders/alphaCutoff.glsl.js";import{outputColorHighlightOLID as z}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js";import{ShaderBuilder as P}from"../views/webgl/ShaderBuilder.js";function j(j){const L=new P,{draped:C,worldSpace:k,anchor:D,hasTip:V,hasScreenSizePerspective:$}=j,W=!C&&!k;L.attributes.add("position","vec3"),L.attributes.add(j.hasVVSize?"sizeFeatureAttribute":"size","float"),j.hasVVOpacity&&L.attributes.add("opacityFeatureAttribute","float"),L.attributes.add(j.hasVVColor?"colorFeatureAttribute":"color",j.hasVVColor?"float":"vec4"),L.vertex.inputs.add("position",()=>"position"),j.hasVVSize?L.vertex.inputs.add("sizeFeatureAttribute",()=>"sizeFeatureAttribute"):L.vertex.inputs.add("size",()=>"size"),j.hasVVOpacity&&L.vertex.inputs.add("opacityFeatureAttribute",()=>"opacityFeatureAttribute"),j.hasVVColor?L.vertex.inputs.add("colorFeatureAttribute",()=>"colorFeatureAttribute"):L.vertex.inputs.add("color",()=>"color"),L.include(o,j),L.include(s,j);const{vertex:A,fragment:M,varyings:O}=L;u(A,j),L.attributes.add("previousDelta","vec4"),L.attributes.add("uv0","vec2"),O.add("vColor","vec4"),O.add("vpos","vec3",{invariant:!0}),O.add("vUV","vec2"),O.add("vSize","float"),V&&O.add("vLineWidth","float"),A.uniforms.add(l,c).code.add(y`vec4 projectAndScale(vec4 pos) {
|
|
3
3
|
vec4 posNdc = proj * pos;
|
|
4
4
|
posNdc.xy *= viewport.zw / posNdc.w;
|
|
5
5
|
return posNdc;
|
|
6
|
-
}`),
|
|
6
|
+
}`),A.code.add(y`void clip(vec4 pos, inout vec4 prev) {
|
|
7
7
|
float vnp = nearFar[0] * 0.99;
|
|
8
8
|
if (prev.z > -nearFar[0]) {
|
|
9
9
|
float interpolation = (-vnp - pos.z) / (prev.z - pos.z);
|
|
10
10
|
prev = mix(pos, prev, interpolation);
|
|
11
11
|
}
|
|
12
|
-
}`),
|
|
12
|
+
}`),k?(L.attributes.add("normal","vec3"),A.constants.add("tiltThreshold","float",.7).uniforms.add(p).code.add(y`vec3 perpendicular(vec3 v) {
|
|
13
13
|
vec3 n = (viewNormal * vec4(normal.xyz, 1.0)).xyz;
|
|
14
14
|
vec3 n2 = cross(v, n);
|
|
15
15
|
vec3 forward = vec3(0.0, 0.0, 1.0);
|
|
16
16
|
float tiltDot = dot(forward, n);
|
|
17
17
|
return abs(tiltDot) < tiltThreshold ? n : n2;
|
|
18
|
-
}`)):
|
|
18
|
+
}`)):A.code.add(y`vec2 perpendicular(vec2 v) {
|
|
19
19
|
return vec2(v.y, -v.x);
|
|
20
|
-
}`);const
|
|
21
|
-
${
|
|
22
|
-
${
|
|
20
|
+
}`);const F=k?"vec3":"vec2";return A.code.add(y`
|
|
21
|
+
${F} normalizedSegment(${F} pos, ${F} prev) {
|
|
22
|
+
${F} segment = pos - prev;
|
|
23
23
|
float segmentLen = length(segment);
|
|
24
24
|
|
|
25
25
|
// normalize or zero if too short
|
|
26
|
-
return (segmentLen > 0.001) ? segment / segmentLen : ${
|
|
26
|
+
return (segmentLen > 0.001) ? segment / segmentLen : ${k?"vec3(0.0, 0.0, 0.0)":"vec2(0.0, 0.0)"};
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
${
|
|
30
|
-
${
|
|
29
|
+
${F} displace(${F} pos, ${F} prev, float displacementLen) {
|
|
30
|
+
${F} segment = normalizedSegment(pos, prev);
|
|
31
31
|
|
|
32
|
-
${
|
|
33
|
-
${
|
|
32
|
+
${F} displacementDirU = perpendicular(segment);
|
|
33
|
+
${F} displacementDirV = segment;
|
|
34
34
|
|
|
35
|
-
${1===
|
|
35
|
+
${1===D?"pos -= 0.5 * displacementLen * displacementDirV;":""}
|
|
36
36
|
|
|
37
37
|
return pos + displacementLen * (uv0.x * displacementDirU + uv0.y * displacementDirV);
|
|
38
38
|
}
|
|
39
|
-
`)
|
|
39
|
+
`),W&&(A.uniforms.add(d),A.code.add(y`vec3 inverseProject(vec4 posScreen) {
|
|
40
40
|
posScreen.xy = (posScreen.xy / viewport.zw) * posScreen.w;
|
|
41
41
|
return (inverseProjectionMatrix * posScreen).xyz;
|
|
42
|
-
}`),
|
|
42
|
+
}`),A.code.add(y`bool rayIntersectPlane(vec3 rayDir, vec3 planeOrigin, vec3 planeNormal, out vec3 intersection) {
|
|
43
43
|
float cos = dot(rayDir, planeNormal);
|
|
44
44
|
float t = dot(planeOrigin, planeNormal) / cos;
|
|
45
45
|
intersection = t * rayDir;
|
|
46
46
|
return abs(cos) > 0.001 && t > 0.0;
|
|
47
|
-
}`),
|
|
47
|
+
}`),A.uniforms.add(new w("perScreenPixelRatio",({camera:e})=>e.perScreenPixelRatio)),A.code.add(y`
|
|
48
48
|
vec4 toFront(vec4 displacedPosScreen, vec3 posLeft, vec3 posRight, vec3 prev, float lineWidth) {
|
|
49
49
|
// Project displaced position back to camera space
|
|
50
50
|
vec3 displacedPos = inverseProject(displacedPosScreen);
|
|
@@ -54,7 +54,7 @@ return abs(cos) > 0.001 && t > 0.0;
|
|
|
54
54
|
vec3 planeNormal = normalize(cross(posLeft - posRight, posLeft - prev));
|
|
55
55
|
vec3 planeOrigin = posLeft;
|
|
56
56
|
|
|
57
|
-
${
|
|
57
|
+
${S(j.hasCap,"if(prev.z > posLeft.z) {\n vec2 diff = posLeft.xy - posRight.xy;\n planeOrigin.xy += perpendicular(diff) / 2.0;\n }")};
|
|
58
58
|
|
|
59
59
|
// Move the plane towards the camera by a margin dependent on the line width (approximated in world space). This tolerance corrects for the
|
|
60
60
|
// non-planarity in most cases, but sharp joins can place the prev vertices at arbitrary positions so markers can still clip.
|
|
@@ -73,7 +73,7 @@ return abs(cos) > 0.001 && t > 0.0;
|
|
|
73
73
|
displacedPos *= minDepth / length(displacedPos);
|
|
74
74
|
return vec4(displacedPos.xyz, 1.0);
|
|
75
75
|
}
|
|
76
|
-
`)),
|
|
76
|
+
`)),f(A),L.include(m),A.main.add(y`
|
|
77
77
|
// Check for special value of uv0.y which is used by the Renderer when graphics
|
|
78
78
|
// are removed before the VBO is recompacted. If this is the case, then we just
|
|
79
79
|
// project outside of clip space.
|
|
@@ -85,24 +85,24 @@ return abs(cos) > 0.001 && t > 0.0;
|
|
|
85
85
|
vec4 pos = view * vec4(position, 1.0);
|
|
86
86
|
vec4 prev = view * vec4(position + previousDelta.xyz * previousDelta.w, 1.0);
|
|
87
87
|
|
|
88
|
-
float lineWidth = getLineWidth(${
|
|
88
|
+
float lineWidth = getLineWidth(${S($,"pos.xyz")});
|
|
89
89
|
float screenMarkerSize = getScreenMarkerSize(lineWidth);
|
|
90
90
|
|
|
91
91
|
clip(pos, prev);
|
|
92
92
|
|
|
93
|
-
${
|
|
93
|
+
${k?y`${S(j.hideOnShortSegments,y`
|
|
94
94
|
if (areWorldMarkersHidden(pos.xyz, prev.xyz)) {
|
|
95
95
|
gl_Position = ${n};
|
|
96
96
|
return;
|
|
97
97
|
}`)}
|
|
98
98
|
pos.xyz = displace(pos.xyz, prev.xyz, getWorldMarkerSize(pos.xyz));
|
|
99
|
-
vec4 displacedPosScreen = projectAndScale(pos);`:
|
|
99
|
+
vec4 displacedPosScreen = projectAndScale(pos);`:y`
|
|
100
100
|
vec4 posScreen = projectAndScale(pos);
|
|
101
101
|
vec4 prevScreen = projectAndScale(prev);
|
|
102
102
|
vec4 displacedPosScreen = posScreen;
|
|
103
103
|
|
|
104
104
|
displacedPosScreen.xy = displace(posScreen.xy, prevScreen.xy, screenMarkerSize);
|
|
105
|
-
${y
|
|
105
|
+
${S(W,y`
|
|
106
106
|
vec2 displacementDirU = perpendicular(normalizedSegment(posScreen.xy, prevScreen.xy));
|
|
107
107
|
|
|
108
108
|
// We need three points of the ribbon line in camera space to calculate the plane it lies in
|
|
@@ -117,8 +117,8 @@ return abs(cos) > 0.001 && t > 0.0;
|
|
|
117
117
|
|
|
118
118
|
// Convert texture coordinate into [0,1]
|
|
119
119
|
vUV = (uv0 + 1.0) / 2.0;
|
|
120
|
-
${
|
|
121
|
-
${
|
|
120
|
+
${S(!k,"vUV = noPerspectiveWrite(vUV, displacedPosScreen.w);")}
|
|
121
|
+
${S(V,"vLineWidth = noPerspectiveWrite(lineWidth, displacedPosScreen.w);")}
|
|
122
122
|
|
|
123
123
|
vSize = screenMarkerSize;
|
|
124
124
|
vColor = getColor();
|
|
@@ -127,13 +127,13 @@ return abs(cos) > 0.001 && t > 0.0;
|
|
|
127
127
|
vpos = pos.xyz;
|
|
128
128
|
|
|
129
129
|
gl_Position = displacedPosScreen;
|
|
130
|
-
}`),
|
|
130
|
+
}`),M.include(t,j),L.include(z,j),M.include(v),M.include(x),M.uniforms.add(new g("intrinsicColor",({color:e})=>e),new b("tex",({markerTexture:e})=>e)).constants.add("texelSize","float",1/e).code.add(y`float markerAlpha(vec2 samplePos) {
|
|
131
131
|
samplePos += vec2(0.5, -0.5) * texelSize;
|
|
132
132
|
float sdf = texture(tex, samplePos).r;
|
|
133
133
|
float pixelDistance = sdf * vSize;
|
|
134
134
|
pixelDistance -= 0.5;
|
|
135
135
|
return clamp(0.5 - pixelDistance, 0.0, 1.0);
|
|
136
|
-
}`),
|
|
136
|
+
}`),V&&(L.include(h),M.constants.add("relativeMarkerSize","float",r/e).constants.add("relativeTipLineWidth","float",i).code.add(y`
|
|
137
137
|
float tipAlpha(vec2 samplePos) {
|
|
138
138
|
// Convert coordinates s.t. they are in pixels and relative to the tip of an arrow marker
|
|
139
139
|
samplePos -= vec2(0.5, 0.5 + 0.5 * relativeMarkerSize);
|
|
@@ -142,18 +142,18 @@ return clamp(0.5 - pixelDistance, 0.0, 1.0);
|
|
|
142
142
|
float halfMarkerSize = 0.5 * relativeMarkerSize * vSize;
|
|
143
143
|
float halfTipLineWidth = 0.5 * max(1.0, relativeTipLineWidth * noPerspectiveRead(vLineWidth));
|
|
144
144
|
|
|
145
|
-
${
|
|
145
|
+
${S(k,"halfTipLineWidth *= fwidth(samplePos.y);")}
|
|
146
146
|
|
|
147
147
|
float distance = max(abs(samplePos.x) - halfMarkerSize, abs(samplePos.y) - halfTipLineWidth);
|
|
148
148
|
return clamp(0.5 - distance, 0.0, 1.0);
|
|
149
149
|
}
|
|
150
|
-
`)),L.include(a,j),L.include(
|
|
150
|
+
`)),L.include(a,j),L.include(h),M.main.add(y`
|
|
151
151
|
discardBySlice(vpos);
|
|
152
152
|
|
|
153
153
|
vec4 finalColor = intrinsicColor * vColor;
|
|
154
154
|
|
|
155
155
|
// Cancel out perspective correct interpolation if in screen space or draped
|
|
156
|
-
vec2 samplePos = ${
|
|
157
|
-
finalColor.a *= ${
|
|
156
|
+
vec2 samplePos = ${S(!k,"noPerspectiveRead(vUV)","vUV")};
|
|
157
|
+
finalColor.a *= ${V?"max(markerAlpha(samplePos), tipAlpha(samplePos))":"markerAlpha(samplePos)"};
|
|
158
158
|
if(finalColor.a < alphaCutoff) discard; // We also want to discard in the opaque color pass
|
|
159
159
|
outputColorHighlightOLID(applySlice(finalColor, vpos), finalColor.rgb);`),L}const L=Object.freeze(Object.defineProperty({__proto__:null,build:j},Symbol.toStringTag,{value:"Module"}));export{L,j as b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{ReadDepth as r}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl.js";import{
|
|
2
|
+
import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{ReadDepth as r}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl.js";import{nearFar as t}from"../views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js";import{BooleanPassUniform as i}from"../views/3d/webgl-engine/core/shaderModules/BooleanPassUniform.js";import{Float2PassUniform as o}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{glsl as n}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{IntegerPassUniform as s}from"../views/3d/webgl-engine/core/shaderModules/IntegerPassUniform.js";import{Texture2DPassUniform as a}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{NoParameters as d}from"../views/webgl/NoParameters.js";import{ShaderBuilder as l}from"../views/webgl/ShaderBuilder.js";class c extends d{constructor(){super(...arguments),this.depthTextureSize=[0,0],this.cellSize=1,this.reduced=!1}}function m(){const d=new l;return d.include(e),d.fragment.include(r),d.fragment.uniforms.add(new a("mainDepthTexture",e=>e.depthTexture),new o("screenSize",e=>e.depthTextureSize),new s("fullWidth",e=>e.cellSize),new i("reduced",e=>e.reduced),t),d.fragment.code.add(n`float normalizedDepthFromTexture(sampler2D depthTexture, ivec2 coords) {
|
|
3
3
|
if (reduced) {
|
|
4
4
|
return texelFetch(depthTexture, coords, 0).r;
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{translate as e}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as r}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{Transform as o}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{
|
|
2
|
+
import{translate as e}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as r}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{Transform as o}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{projMatrix as i}from"../views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js";import{glsl as t}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Matrix4DrawUniform as s}from"../views/3d/webgl-engine/core/shaderModules/Matrix4DrawUniform.js";import{Texture2DPassUniform as a}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{NoParameters as d}from"../views/webgl/NoParameters.js";import{ShaderBuilder as m}from"../views/webgl/ShaderBuilder.js";class n extends d{constructor(){super(...arguments),this.cullFace=0}}function l(){const r=new m,{attributes:d,vertex:n,fragment:l}=r;return r.include(o),d.add("position","vec3"),n.uniforms.add(i,new s("view",(r,o)=>e(c,o.camera.viewMatrix,r.origin))).main.add(t`gl_Position = transformPosition(proj, view, position);`),l.uniforms.add(new a("depthTexture",e=>e.depthTexture)).main.add(t`float depth = texelFetch(depthTexture, ivec2(gl_FragCoord.xy), 0).r;
|
|
3
3
|
if (gl_FragCoord.z <= depth) {
|
|
4
4
|
discard;
|
|
5
|
-
}`),r}const c=r(),g=Object.freeze(Object.defineProperty({__proto__:null,OccludedGeometryDepthPassParameters:
|
|
5
|
+
}`),r}const c=r(),g=Object.freeze(Object.defineProperty({__proto__:null,OccludedGeometryDepthPassParameters:n,build:l},Symbol.toStringTag,{value:"Module"}));export{n as O,g as a,l as b};
|
package/chunks/Path.glsl.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{Offset as e}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.js";import{isColor as o}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SliceDraw as r}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as i}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{PathVertexPosition as a}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{outputDepth as d}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js";import{OutputHighlight as l}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{EvaluateAmbientOcclusion as t}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import{EvaluateSceneLighting as n,addAmbientBoostFactor as s,addLightingGlobalFactor as c}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{mainLightIntensity as m}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{Normals as g}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js";import{NormalUtils as v}from"../views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js";import{PhysicallyBasedRenderingParameters as u}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReadShadowMapDrawFragment as p}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{viewNormal as b,nearFar as w}from"../views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js";import{ColorConversion as f}from"../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import{addProjViewLocalOrigin as h,addCameraPosition as y}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float3PassUniform as x}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{FloatPassUniform as j}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as L,If as V}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{SnowCover as P}from"../views/3d/webgl-engine/effects/snowcover/SnowCover.glsl.js";import{outputColorHighlightOLID as C}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js";import{ShaderBuilder as O}from"../views/webgl/ShaderBuilder.js";function S(S){const A=new O,{vertex:I,fragment:_,varyings:B}=A;h(I,S),B.add("vpos","vec3",{invariant:!0}),A.include(a,S);const{output:D,pbrMode:M,snowCover:N,offsetBackfaces:k}=S,E=11===D;switch((o(D)||E)&&(E?(A.varyings.add("objectAndLayerIdColorVarying","vec4"),A.vertex.code.add(L`void forwardObjectAndLayerIdColor() {
|
|
3
3
|
objectAndLayerIdColorVarying = getOlidColor();
|
|
4
4
|
}`),A.fragment.code.add(L`void outputObjectAndLayerIdColor() {
|
|
5
5
|
fragColor = objectAndLayerIdColorVarying;
|
|
6
|
-
}`)):(A.vertex.code.add(L`void forwardObjectAndLayerIdColor() {}`),A.fragment.code.add(L`void outputObjectAndLayerIdColor() {}`)),A.include(
|
|
6
|
+
}`)):(A.vertex.code.add(L`void forwardObjectAndLayerIdColor() {}`),A.fragment.code.add(L`void outputObjectAndLayerIdColor() {}`)),A.include(i),A.include(p,S),k&&(y(I,S),A.include(e)),B.add("vnormal","vec3"),B.add("vcolor","vec4"),I.main.add(L`
|
|
7
7
|
ExtrudedVertex extrudedVertex = evaluateVertex();
|
|
8
8
|
vpos = calculateVPos(extrudedVertex);
|
|
9
9
|
vnormal = normalize(localNormal(extrudedVertex));
|
|
10
10
|
gl_Position = transformPosition(proj, view, vpos);
|
|
11
|
-
${V(
|
|
11
|
+
${V(k,"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vnormal, cameraPosition);")}
|
|
12
12
|
|
|
13
13
|
forwardObjectAndLayerIdColor();
|
|
14
14
|
vcolor = getColor();
|
|
15
|
-
forwardLinearDepthToReadShadowMap();`)),D){case 0:case 1:case 2:A.include(
|
|
15
|
+
forwardLinearDepthToReadShadowMap();`)),D){case 0:case 1:case 2:A.include(u,S),_.include(n,S),_.include(t,S),A.include(g,S),_.include(v,S),_.include(r,S),A.include(C,S),y(_,S),s(_),c(_),_.uniforms.add(I.uniforms.get("localOrigin"),new x("ambient",e=>e.ambient),new x("diffuse",e=>e.diffuse),new j("opacity",e=>e.opacity)),_.include(f),_.include(P,S),_.uniforms.add(m).main.add(L`
|
|
16
16
|
discardBySlice(vpos);
|
|
17
17
|
|
|
18
18
|
vec3 viewDirection = normalize(vpos - cameraPosition);
|
|
@@ -35,20 +35,20 @@ fragColor = objectAndLayerIdColorVarying;
|
|
|
35
35
|
${V(2===M&&N,"applySnowToMRR(snow);")}
|
|
36
36
|
vec3 shadedColor = evaluateSceneLighting(normal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, upNormal);
|
|
37
37
|
vec4 finalColor = vec4(shadedColor, combinedOpacity);
|
|
38
|
-
outputColorHighlightOLID(applySlice(finalColor, vpos), albedo ${V(N,", snow")});`);break;case 3:A.include(
|
|
38
|
+
outputColorHighlightOLID(applySlice(finalColor, vpos), albedo ${V(N,", snow")});`);break;case 3:A.include(i),I.main.add(L`ExtrudedVertex extrudedVertex = evaluateVertex();
|
|
39
39
|
vpos = calculateVPos(extrudedVertex);
|
|
40
|
-
gl_Position = transformPosition(proj, view, vpos);`),A.fragment.include(
|
|
40
|
+
gl_Position = transformPosition(proj, view, vpos);`),A.fragment.include(r,S),_.main.add(L`discardBySlice(vpos);`);break;case 5:case 6:case 7:case 8:A.include(i),B.add("depth","float"),I.uniforms.add(w).main.add(L`ExtrudedVertex extrudedVertex = evaluateVertex();
|
|
41
41
|
vpos = calculateVPos(extrudedVertex);
|
|
42
|
-
gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth);`),_.include(
|
|
43
|
-
outputDepth(depth);`);break;case 11:A.fragment.include(
|
|
44
|
-
outputObjectAndLayerIdColor();`);break;case 4:A.include(
|
|
42
|
+
gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth);`),_.include(r,S),A.include(d,S),_.main.add(L`discardBySlice(vpos);
|
|
43
|
+
outputDepth(depth);`);break;case 11:A.fragment.include(r,S),_.main.add(L`discardBySlice(vpos);
|
|
44
|
+
outputObjectAndLayerIdColor();`);break;case 4:A.include(i),I.include(v,S),B.add("vnormal","vec3"),B.add("vcolor","vec4"),I.uniforms.add(b).main.add(L`ExtrudedVertex extrudedVertex = evaluateVertex();
|
|
45
45
|
vpos = calculateVPos(extrudedVertex);
|
|
46
46
|
vnormal = normalize((viewNormal * vec4(localNormal(extrudedVertex), 1.0)).xyz);
|
|
47
47
|
vcolor = getColor();
|
|
48
|
-
gl_Position = transformPosition(proj, view, vpos);`),A.fragment.include(
|
|
48
|
+
gl_Position = transformPosition(proj, view, vpos);`),A.fragment.include(r,S),_.uniforms.add(new j("opacity",e=>e.opacity)),_.main.add(L`discardBySlice(vpos);
|
|
49
49
|
vec3 normal = normalize(vnormal);
|
|
50
50
|
if (gl_FrontFacing == false) normal = -normal;
|
|
51
|
-
fragColor = vec4(vec3(0.5) + 0.5 * normal, vcolor.a * opacity);`);break;case 10:A.include(
|
|
51
|
+
fragColor = vec4(vec3(0.5) + 0.5 * normal, vcolor.a * opacity);`);break;case 10:A.include(i),I.include(v,S),B.add("vnormal","vec3"),I.main.add(L`ExtrudedVertex extrudedVertex = evaluateVertex();
|
|
52
52
|
vpos = calculateVPos(extrudedVertex);
|
|
53
|
-
gl_Position = transformPosition(proj, view, vpos);`),A.fragment.include(
|
|
53
|
+
gl_Position = transformPosition(proj, view, vpos);`),A.fragment.include(r,S),A.include(l,S),_.main.add(L`discardBySlice(vpos);
|
|
54
54
|
calculateOcclusionAndOutputHighlight();`)}return A}const A=Object.freeze(Object.defineProperty({__proto__:null,build:S},Symbol.toStringTag,{value:"Module"}));export{A as P,S as b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{numberMaxFloat32 as e}from"../core/mathUtils.js";import{multiply as i,fromTranslation as o}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as r}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as t}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as s}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as a}from"../core/libs/gl-matrix-2/math/vec3.js";import{create as n}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as c,positiveInfinity as l}from"../geometry/support/aaBoundingBox.js";import{isColor as p}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SlicePlaneParameters as m,RejectBySliceDraw as d}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{OutputHighlight as f}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{positionOutsideClipSpace as g}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PositionOutsideClipSpace.js";import{
|
|
2
|
+
import{numberMaxFloat32 as e}from"../core/mathUtils.js";import{multiply as i,fromTranslation as o}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as r}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as t}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as s}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as a}from"../core/libs/gl-matrix-2/math/vec3.js";import{create as n}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as c,positiveInfinity as l}from"../geometry/support/aaBoundingBox.js";import{isColor as p}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SlicePlaneParameters as m,RejectBySliceDraw as d}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{OutputHighlight as f}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{positionOutsideClipSpace as g}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PositionOutsideClipSpace.js";import{projMatrix as u}from"../views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js";import{Float2DrawUniform as S}from"../views/3d/webgl-engine/core/shaderModules/Float2DrawUniform.js";import{Float2PassUniform as x}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{Float3DrawUniform as h}from"../views/3d/webgl-engine/core/shaderModules/Float3DrawUniform.js";import{glsl as v,If as w}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Matrix4DrawUniform as z}from"../views/3d/webgl-engine/core/shaderModules/Matrix4DrawUniform.js";import{NoParameters as b}from"../views/webgl/NoParameters.js";import{ShaderBuilder as M}from"../views/webgl/ShaderBuilder.js";class P extends b{constructor(){super(...arguments),this.clipBox=c(l),this.useFixedSizes=!1,this.useRealWorldSymbolSizes=!1,this.scaleFactor=1,this.minSizePx=0,this.size=0,this.sizePx=0}get fixedSize(){return this.drawScreenSpace?this.sizePx:this.size}get screenMinSize(){return this.useFixedSizes?0:this.minSizePx}get drawScreenSpace(){return this.useFixedSizes&&!this.useRealWorldSymbolSizes}}class j extends m{constructor(e,i,o){super(e),this.origin=e,this.isLeaf=i,this.splatSize=o}}function y(r){const s=new M,n=p(r.output),{attributes:c,vertex:l,fragment:m}=s;return c.add("position","vec3"),c.add("color","vec3"),l.include(d,r),l.uniforms.add(new z("modelView",(e,r)=>i(R,r.camera.viewMatrix,o(R,e.origin))),u,new S("screenMinMaxSize",(e,i,o)=>t(_,o.useFixedSizes?0:o.minSizePx*i.camera.pixelRatio,O(e.isLeaf)*i.camera.pixelRatio)),r.useFixedSizes?new x("pointScale",(e,i)=>t(_,e.fixedSize*i.camera.pixelRatio,i.camera.fullHeight)):new S("pointScale",(e,i,o)=>t(_,e.splatSize*o.scaleFactor*i.camera.pixelRatio,i.camera.fullHeight/i.camera.pixelRatio))),r.clippingEnabled?l.uniforms.add(new h("clipMin",(e,i,o)=>a(B,o.clipBox[0]-e.origin[0],o.clipBox[1]-e.origin[1],o.clipBox[2]-e.origin[2])),new h("clipMax",(e,i,o)=>a(B,o.clipBox[3]-e.origin[0],o.clipBox[4]-e.origin[1],o.clipBox[5]-e.origin[2]))):(l.constants.add("clipMin","vec3",[-e,-e,-e]),l.constants.add("clipMax","vec3",[e,e,e])),n&&s.varyings.add("vColor","vec3"),l.main.add(v`
|
|
3
3
|
// Move clipped points outside of clipspace
|
|
4
4
|
if (position.x < clipMin.x || position.y < clipMin.y || position.z < clipMin.z ||
|
|
5
5
|
position.x > clipMax.x || position.y > clipMax.y || position.z > clipMax.z) {
|
|
@@ -19,7 +19,7 @@ import{numberMaxFloat32 as e}from"../core/mathUtils.js";import{multiply as i,fro
|
|
|
19
19
|
|
|
20
20
|
float pointSize = pointScale.x;
|
|
21
21
|
vec4 position = proj * camera;
|
|
22
|
-
${r.drawScreenSize?
|
|
22
|
+
${r.drawScreenSize?v`float clampedScreenSize = pointSize;`:v`float pointRadius = 0.5 * pointSize;
|
|
23
23
|
vec4 cameraOffset = camera + vec4(0.0, pointRadius, 0.0, 0.0);
|
|
24
24
|
vec4 positionOffset = proj * cameraOffset;
|
|
25
25
|
float radius = abs(positionOffset.y - position.y);
|
|
@@ -35,7 +35,7 @@ import{numberMaxFloat32 as e}from"../core/mathUtils.js";import{multiply as i,fro
|
|
|
35
35
|
|
|
36
36
|
gl_PointSize = clampedScreenSize;
|
|
37
37
|
gl_Position = position;
|
|
38
|
-
${n?
|
|
38
|
+
${n?v`vColor = color;`:""}`),s.include(f,r),n&&(s.outputs.add("fragColor","vec4",0),r.hasEmission&&s.outputs.add("fragEmission","vec4",1)),m.main.add(v`
|
|
39
39
|
vec2 vOffset = gl_PointCoord - vec2(0.5, 0.5);
|
|
40
40
|
float r2 = dot(vOffset, vOffset);
|
|
41
41
|
|
|
@@ -43,5 +43,5 @@ import{numberMaxFloat32 as e}from"../core/mathUtils.js";import{multiply as i,fro
|
|
|
43
43
|
discard;
|
|
44
44
|
}
|
|
45
45
|
calculateOcclusionAndOutputHighlight();
|
|
46
|
-
${
|
|
47
|
-
`),s}function O(e){return e?256:64}const
|
|
46
|
+
${w(n,`fragColor = vec4(vColor, 1.0);\n ${w(r.hasEmission,"fragEmission = vec4(vec3(0.0), 1.0);")}`)}
|
|
47
|
+
`),s}function O(e){return e?256:64}const R=r(),B=n(),_=s(),F=Object.freeze(Object.defineProperty({__proto__:null,PointRendererDrawParameters:j,PointRendererPassParameters:P,build:y,getMaxPointSizeScreenspace:O},Symbol.toStringTag,{value:"Module"}));export{P,j as a,F as b,y as c,O as g};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{floor as e,set as t,sub as o,scale as a,normalize as i,dot as r,lerp as n}from"../core/libs/gl-matrix-2/math/vec3.js";import{create as s,fromValues as d}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{
|
|
2
|
+
import{floor as e,set as t,sub as o,scale as a,normalize as i,dot as r,lerp as n}from"../core/libs/gl-matrix-2/math/vec3.js";import{create as s,fromValues as d}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{projMatrix as c,viewMatrix as m}from"../views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js";import{Float3BindUniform as l}from"../views/3d/webgl-engine/core/shaderModules/Float3BindUniform.js";import{Float3PassUniform as p}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{FloatPassUniform as v}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as f,If as u}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{ShaderBuilder as h}from"../views/webgl/ShaderBuilder.js";function g(e){const t=new h,{attributes:o,outputs:a,vertex:i,varyings:r,fragment:n}=t;o.add("position","vec3"),o.add("instanceFeatureAttribute","float"),a.add("fragColor","vec4",0),i.uniforms.add(new l("cameraPosition",e=>e.camera.eye),new p("offset",(e,t)=>w(e,t)),new v("width",e=>e.width),new v("time",e=>e.time),c,m),r.add("vUv","vec2"),i.code.add(f`vec3 hash31(float p){
|
|
3
3
|
vec3 p3 = fract(vec3(p) * vec3(0.1031, 0.1030, 0.0973));
|
|
4
4
|
p3 += dot(p3, p3.yzx + 33.33);
|
|
5
5
|
return fract((p3.xxy + p3.yzz) * p3.zyx);
|
|
@@ -12,7 +12,7 @@ return fract(p);
|
|
|
12
12
|
}
|
|
13
13
|
vec3 rotateVectorByQuaternion(vec3 v, vec4 q){
|
|
14
14
|
return 2.0 * cross(q.xyz, v * q.w + cross(q.xyz, v)) + v;
|
|
15
|
-
}`);const s=0===e.type;return i.main.add(
|
|
15
|
+
}`);const s=0===e.type;return i.main.add(f`
|
|
16
16
|
vUv = position.xz;
|
|
17
17
|
vec3 rand = hash31(instanceFeatureAttribute);
|
|
18
18
|
|
|
@@ -37,7 +37,7 @@ return 2.0 * cross(q.xyz, v * q.w + cross(q.xyz, v)) + v;
|
|
|
37
37
|
|
|
38
38
|
// Rain particles fall straight down and are randomly oriented
|
|
39
39
|
// Snow particles have random sinusoid trajectories and are rotated to face the camera
|
|
40
|
-
${s?
|
|
40
|
+
${s?f`
|
|
41
41
|
// Random rotation for particle
|
|
42
42
|
vec3 rotationAxis = up;
|
|
43
43
|
vec4 quat = vec4(rotationAxis * sin(angle), cos(angle));
|
|
@@ -51,7 +51,7 @@ return 2.0 * cross(q.xyz, v * q.w + cross(q.xyz, v)) + v;
|
|
|
51
51
|
|
|
52
52
|
vec4 pos = mat4(mat3(view)) * vec4(transformedPos + (mod(width * animatedPos - offset, width) - 0.5 * width), 1.0);
|
|
53
53
|
gl_Position = proj * pos;
|
|
54
|
-
`:
|
|
54
|
+
`:f`
|
|
55
55
|
vec3 rotationAxis = direction;
|
|
56
56
|
vec4 quat = vec4(rotationAxis * sin(angle), cos(angle));
|
|
57
57
|
|
|
@@ -61,9 +61,9 @@ return 2.0 * cross(q.xyz, v * q.w + cross(q.xyz, v)) + v;
|
|
|
61
61
|
vec4 pos = mat4(mat3(view)) * vec4((mod(width * animatedPos - offset, width) - 0.5 * width), 1.0);
|
|
62
62
|
gl_Position = proj * (0.5 * vec4(position.xzy, 0.0) + pos);
|
|
63
63
|
`}
|
|
64
|
-
`),n.uniforms.add(new
|
|
64
|
+
`),n.uniforms.add(new v("opacity",e=>e.opacity),new l("particleColor",t=>y(t,e))),n.main.add(f`
|
|
65
65
|
float d = length(vUv - vec2(0.5));
|
|
66
66
|
|
|
67
|
-
${
|
|
67
|
+
${u(s,"d = 0.35 * smoothstep(0.5, 0.0, d);","d = smoothstep(0.5, 0.1, d);")}
|
|
68
68
|
fragColor = opacity * vec4(particleColor * d, d);
|
|
69
|
-
`),e.hasEmissive&&(t.outputs.add("fragEmission","vec4",1),t.fragment.main.add("fragEmission = vec4(vec3(0.0), fragColor.a * 0.75);")),t}function
|
|
69
|
+
`),e.hasEmissive&&(t.outputs.add("fragEmission","vec4",1),t.fragment.main.add("fragEmission = vec4(vec3(0.0), fragColor.a * 0.75);")),t}function w(i,r){const n=r.camera.eye,s=.5*i.width,d=1/i.width,c=e(b,t(b,(n[0]+s)*d,(n[1]+s)*d,(n[2]+s)*d));return o(c,n,a(c,c,i.width))}function y(e,{type:t}){const o=0===t?j:P,s=a(b,o,z),d=e.camera.eye;i(x,d);const c=Math.max(0,r(x,e.lighting.mainLight.direction));return n(s,s,o,c)}const b=s(),x=s(),P=d(1,1,1),j=d(.85,.85,.85),z=.7,q=Object.freeze(Object.defineProperty({__proto__:null,build:g},Symbol.toStringTag,{value:"Module"}));export{q as P,g as b};
|