@arcgis/core 4.31.0-next.20240708 → 4.31.0-next.20240709
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{0975e54c50383375cc09.js → 14cf7411e8318a1bccb9.js} +1 -1
- package/assets/esri/core/workers/chunks/{71852b8437ec66b9ef06.js → 2123ab24163a532ebc8d.js} +1 -1
- package/assets/esri/core/workers/chunks/{c91b3800cf3891bf2d59.js → 252ff37bf5e12dae0b18.js} +1 -1
- package/assets/esri/core/workers/chunks/2799007b5f3f4a2e364c.js +51 -0
- package/assets/esri/core/workers/chunks/{ff5e6d823d512f87a527.js → 2dddb8a989b9c96572fe.js} +1 -1
- package/assets/esri/core/workers/chunks/3375de864347a847393d.js +1042 -0
- package/assets/esri/core/workers/chunks/543f9db420c99d429637.js +1 -0
- package/assets/esri/core/workers/chunks/{812e18c65aa6e398c338.js → 5b6c89dc41067d81c952.js} +1 -1
- package/assets/esri/core/workers/chunks/{5089a12084a8a8fb93d8.js → 61e5179fb49866241128.js} +1 -1
- package/assets/esri/core/workers/chunks/632e3ba2b8a881df29a0.js +1 -0
- package/assets/esri/core/workers/chunks/{1cc4a89c96a36d6b3d52.js → 7767559d56d16b644655.js} +1 -1
- package/assets/esri/core/workers/chunks/{43e83f4d827f59ff556a.js → 8087288f00dfdcc479b9.js} +1 -1
- package/assets/esri/core/workers/chunks/{a5fbe1c95e49093e5af4.js → 8cce4b218568638e6e64.js} +1 -1
- package/assets/esri/core/workers/chunks/{c7e2a97cb7bcd153bcef.js → 8e326def543268f8a08e.js} +1 -1
- package/assets/esri/core/workers/chunks/92cb45b18e151db007dc.js +1 -0
- package/assets/esri/core/workers/chunks/b2e8cc76381077b78d4c.js +1 -0
- package/assets/esri/core/workers/chunks/b6a8132708afcd988fa9.js +1 -0
- package/assets/esri/core/workers/chunks/{b4d850e82a8ae902d684.js → c44cc686774ff53c0a94.js} +1 -1
- package/assets/esri/core/workers/chunks/c52701477405c1fb2072.js +1 -0
- package/assets/esri/core/workers/chunks/{9ed11b9202013ca001ee.js → cfc2a1858a8bbb284979.js} +2 -2
- package/assets/esri/core/workers/chunks/{9ed11b9202013ca001ee.js.LICENSE.txt → cfc2a1858a8bbb284979.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/d9863289c69d2550cd49.js +1 -0
- package/assets/esri/core/workers/chunks/e1f4df3a5b0b31521b3c.js +1 -0
- package/assets/esri/core/workers/chunks/{61505947371cebab9cbe.js → fdebfe55cd097714ec11.js} +1 -1
- package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +13 -18
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/AtmosphereCompositing.glsl.js +6 -9
- package/chunks/BlendLayers.glsl.js +1 -7
- package/chunks/BlendWeights.glsl.js +45 -51
- package/chunks/Blur.glsl.js +1 -3
- package/chunks/ChapmanAtmosphere.glsl.js +3 -8
- package/chunks/CheckerBoard.glsl.js +3 -9
- package/chunks/Clouds.glsl.js +21 -10
- package/chunks/CloudsComposition.glsl.js +3 -7
- package/chunks/ColorMaterial.glsl.js +3 -9
- package/chunks/ComponentShader.glsl.js +35 -50
- package/chunks/Compositing.glsl.js +5 -7
- package/chunks/DefaultMaterial.glsl.js +68 -73
- package/chunks/EdgeDetect.glsl.js +5 -10
- package/chunks/EdgeShader.glsl.js +37 -60
- package/chunks/Fog.glsl.js +4 -9
- package/chunks/HUDCompositing.glsl.js +1 -3
- package/chunks/HUDMaterial.glsl.js +8 -14
- package/chunks/Heatmap.glsl.js +4 -7
- package/chunks/HeatmapDensity.glsl.js +5 -11
- package/chunks/HighlightApply.glsl.js +133 -152
- package/chunks/HighlightDownsample.glsl.js +29 -32
- package/chunks/ImageMaterial.glsl.js +11 -21
- package/chunks/LaserlinePath.glsl.js +4 -9
- package/chunks/LineCallout.glsl.js +91 -108
- package/chunks/LineMarker.glsl.js +2 -8
- package/chunks/Magnifier.glsl.js +4 -9
- package/chunks/MeasurementArrow.glsl.js +9 -15
- package/chunks/NativeLine.glsl.js +8 -12
- package/chunks/NoiseTextureAtlas.glsl.js +89 -86
- package/chunks/OITCompositing.glsl.js +2 -3
- package/chunks/OverlayCompositing.glsl.js +2 -4
- package/chunks/Path.glsl.js +31 -55
- package/chunks/Pattern.glsl.js +16 -20
- package/chunks/PointRenderer.glsl.js +39 -48
- package/chunks/Precipitation.glsl.js +15 -27
- package/chunks/RasterColorizer.glsl.js +25 -33
- package/chunks/RealisticTree.glsl.js +53 -65
- package/chunks/SSAO.glsl.js +7 -10
- package/chunks/SSAOBlur.glsl.js +10 -14
- package/chunks/ShadedColorMaterial.glsl.js +12 -15
- package/chunks/ShadowCastAccumulate.glsl.js +2 -4
- package/chunks/ShadowCastVisualize.glsl.js +12 -19
- package/chunks/ShadowHighlight.glsl.js +46 -50
- package/chunks/SimpleAtmosphere.glsl.js +4 -13
- package/chunks/SlicePlaneMaterial.glsl.js +3 -7
- package/chunks/Stars.glsl.js +3 -7
- package/chunks/Terrain.glsl.js +20 -61
- package/chunks/TextureOnly.glsl.js +2 -4
- package/chunks/Viewshed.glsl.js +20 -38
- package/chunks/WaterSurface.glsl.js +34 -60
- package/core/workers/registry.js +1 -1
- package/interfaces.d.ts +34 -4
- package/layers/WCSLayer.js +1 -1
- package/layers/support/SubtypeSublayer.js +1 -1
- package/layers/support/rasterDatasets/WCSRaster.js +1 -1
- package/layers/support/rasterDatasets/multidimensionalUtils.js +1 -1
- package/layers/support/rasterDatasets/wcsCoverageParser.js +1 -1
- package/package.json +3 -3
- package/support/revision.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/ShaderBuilder2D.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapTechnique.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/transform/extentTransform/extentUtils.js +1 -1
- package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/StreamLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +5 -0
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +5 -0
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorkerHandle.js +5 -0
- package/views/3d/layers/graphics/pipeline/PBFPointFeaturesView.js +5 -0
- package/views/3d/layers/graphics/pipeline/TestSymbol.js +5 -0
- package/views/3d/layers/graphics/pipeline/Tile.js +5 -0
- package/views/3d/layers/graphics/pipeline/Tile3DFetcher.js +5 -0
- package/views/3d/layers/graphics/pipeline/Tile3DProcessor.js +5 -0
- package/views/3d/layers/i3s/PointRenderer.js +1 -1
- package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
- package/views/3d/layers/support/projectExtentUtils.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TileCompositor.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js +3 -5
- package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +29 -59
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUDOcclusionPass.glsl.js +6 -12
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceReflections.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/TextureTransformUV.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileComposite.glsl.js +2 -4
- package/views/3d/webgl-engine/core/shaderLibrary/util/LocalFromScreenSpace.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js +1 -1
- package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
- package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
- package/views/3d/webgl-engine/lib/DrapedHeatmapRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
- package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/DrawParameters.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/webgl/RenderingContext.js +1 -1
- package/views/webgl/enums.js +1 -1
- package/views/webgl/heatmapTextureUtils.js +1 -1
- package/views/webgl/testSVGPremultipliedAlpha.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileController.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/OrientedImageryViewer/constants.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/assets/esri/core/workers/chunks/0cb2eb96ffb1dbed00eb.js +0 -1
- package/assets/esri/core/workers/chunks/0d6ed27fc9948f4ea061.js +0 -1
- package/assets/esri/core/workers/chunks/225b947ba4b2fcfd5630.js +0 -1
- package/assets/esri/core/workers/chunks/7c7c3068da3bf7467685.js +0 -1
- package/assets/esri/core/workers/chunks/85e5cdd723f68dec8c25.js +0 -1
- package/assets/esri/core/workers/chunks/aed0db145187d9eb52f2.js +0 -51
- package/assets/esri/core/workers/chunks/cf9a32a03b3d3b66effb.js +0 -1
- package/assets/esri/core/workers/chunks/e840e54455eb500b501d.js +0 -1098
- package/assets/esri/core/workers/chunks/fec53ce15ae52f8cb802.js +0 -1
|
@@ -2,115 +2,98 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{set as e}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as i}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{ZEROS as r}from"../core/libs/gl-matrix-2/factories/vec4f64.js";import{SliceDraw as o}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{AlignPixel as n}from"../views/3d/webgl-engine/core/shaderLibrary/hud/AlignPixel.glsl.js";import{HUD as t}from"../views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js";import{HUDVisibility as a}from"../views/3d/webgl-engine/core/shaderLibrary/hud/HUDVisibility.glsl.js";import{multipassGeometryTest as l}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassGeometryTest.glsl.js";import{alphaCutoff as d}from"../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff.js";import{addScreenSizePerspectiveAlignment as s}from"../views/3d/webgl-engine/core/shaderLibrary/util/ScreenSizePerspective.glsl.js";import{Float2PassUniform as c}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{Float4PassUniform as p}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as f}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as g}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{ShaderBuilder as v}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{VertexAttribute as S}from"../views/3d/webgl-engine/lib/VertexAttribute.js";function m(i){const r=new v,{vertex:m,fragment:u}=r;return m.include(n),r.include(t,i),r.include(o,i),r.attributes.add(S.UV0,"vec2"),m.uniforms.add(new p("viewport",((e,i)=>i.camera.fullViewport)),new f("lineSize",((e,i)=>e.size>0?Math.max(1,e.size)*i.camera.pixelRatio:0)),new c("pixelToNDC",((i,r)=>e(h,2/r.camera.fullViewport[2],2/r.camera.fullViewport[3]))),new f("borderSize",((e,i)=>null!=e.borderColor?i.camera.pixelRatio:0)),new c("screenOffset",((i,r)=>e(h,i.horizontalScreenOffset*r.camera.pixelRatio,0)))),r.varyings.add("coverageSampling","vec4"),r.varyings.add("lineSizes","vec2"),i.multipassEnabled&&r.varyings.add("depth","float"),i.occlusionTestEnabled&&r.include(a),i.hasScreenSizePerspective&&s(m),m.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
5
|
+
import{set as e}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as i}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{ZEROS as r}from"../core/libs/gl-matrix-2/factories/vec4f64.js";import{SliceDraw as o}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{AlignPixel as n}from"../views/3d/webgl-engine/core/shaderLibrary/hud/AlignPixel.glsl.js";import{HUD as t}from"../views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js";import{HUDVisibility as a}from"../views/3d/webgl-engine/core/shaderLibrary/hud/HUDVisibility.glsl.js";import{multipassGeometryTest as l}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassGeometryTest.glsl.js";import{alphaCutoff as d}from"../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff.js";import{addScreenSizePerspectiveAlignment as s}from"../views/3d/webgl-engine/core/shaderLibrary/util/ScreenSizePerspective.glsl.js";import{Float2PassUniform as c}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{Float4PassUniform as p}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as f}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as g}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{ShaderBuilder as v}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{VertexAttribute as S}from"../views/3d/webgl-engine/lib/VertexAttribute.js";function m(i){const r=new v,{vertex:m,fragment:u}=r;return m.include(n),r.include(t,i),r.include(o,i),r.attributes.add(S.UV0,"vec2"),m.uniforms.add(new p("viewport",((e,i)=>i.camera.fullViewport)),new f("lineSize",((e,i)=>e.size>0?Math.max(1,e.size)*i.camera.pixelRatio:0)),new c("pixelToNDC",((i,r)=>e(h,2/r.camera.fullViewport[2],2/r.camera.fullViewport[3]))),new f("borderSize",((e,i)=>null!=e.borderColor?i.camera.pixelRatio:0)),new c("screenOffset",((i,r)=>e(h,i.horizontalScreenOffset*r.camera.pixelRatio,0)))),r.varyings.add("coverageSampling","vec4"),r.varyings.add("lineSizes","vec2"),i.multipassEnabled&&r.varyings.add("depth","float"),i.occlusionTestEnabled&&r.include(a),i.hasScreenSizePerspective&&s(m),m.main.add(g`
|
|
6
|
+
ProjectHUDAux projectAux;
|
|
7
|
+
vec4 endPoint = projectPositionHUD(projectAux);
|
|
8
|
+
|
|
9
|
+
vec3 vpos = projectAux.posModel;
|
|
10
|
+
if (rejectBySlice(vpos)) {
|
|
11
|
+
gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
15
14
|
${i.occlusionTestEnabled?g`
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
if (!testHUDVisibility(endPoint)) {
|
|
16
|
+
gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
|
|
17
|
+
return;
|
|
18
|
+
}`:""}
|
|
20
19
|
|
|
21
20
|
${i.hasScreenSizePerspective?g`
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
vec4 endAligned = alignToPixelOrigin(endPoint, viewport.zw);
|
|
21
|
+
vec3 perspectiveFactor = screenSizePerspectiveScaleFactor(projectAux.absCosAngle, projectAux.distanceToCamera, screenSizePerspectiveAlignment);
|
|
22
|
+
vec2 screenOffsetScaled = applyScreenSizePerspectiveScaleFactorVec2(screenOffset, perspectiveFactor);`:"vec2 screenOffsetScaled = screenOffset;"}
|
|
23
|
+
// Add view dependent polygon offset to get exact same original starting point. This is mostly used to get the
|
|
24
|
+
// correct depth value
|
|
25
|
+
vec3 posView = (view * vec4(position, 1.0)).xyz;
|
|
26
|
+
${i.multipassEnabled?g`depth = posView.z;`:""}
|
|
27
|
+
|
|
28
|
+
applyHUDViewDependentPolygonOffset(centerOffsetAndDistance.w, projectAux.absCosAngle, posView);
|
|
29
|
+
vec4 startPoint = proj * vec4(posView, 1.0);
|
|
30
|
+
// Apply screen offset to both start and end point
|
|
31
|
+
vec2 screenOffsetNorm = screenOffsetScaled * 2.0 / viewport.zw;
|
|
32
|
+
startPoint.xy += screenOffsetNorm * startPoint.w;
|
|
33
|
+
endPoint.xy += screenOffsetNorm * endPoint.w;
|
|
34
|
+
// Align start and end to pixel origin
|
|
35
|
+
vec4 startAligned = alignToPixelOrigin(startPoint, viewport.zw);
|
|
36
|
+
vec4 endAligned = alignToPixelOrigin(endPoint, viewport.zw);
|
|
39
37
|
${i.depthHudEnabled?i.depthHudAlignStartEnabled?g`endAligned = vec4(endAligned.xy / endAligned.w * startAligned.w, startAligned.zw);`:g`startAligned = vec4(startAligned.xy / startAligned.w * endAligned.w, endAligned.zw);`:""}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
${i.hasScreenSizePerspective?g`
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
float borderAlpha = uColor.a * borderColor.a * coverage.y;
|
|
103
|
-
float colorAlpha = uColor.a * coverage.x;
|
|
104
|
-
|
|
105
|
-
float finalAlpha = mix(borderAlpha, 1.0, colorAlpha);
|
|
106
|
-
|
|
107
|
-
${i.depthHudEnabled?g`
|
|
108
|
-
if (finalAlpha < ${g.float(d)}) {
|
|
109
|
-
discard;
|
|
110
|
-
}
|
|
111
|
-
`:g`
|
|
112
|
-
vec3 finalRgb = mix(borderColor.rgb * borderAlpha, uColor.rgb, colorAlpha);
|
|
113
|
-
fragColor = vec4(finalRgb, finalAlpha);
|
|
114
|
-
`}
|
|
115
|
-
}
|
|
116
|
-
`),r}function b(e){return null!=e?e:r}const h=i(),u=Object.freeze(Object.defineProperty({__proto__:null,build:m},Symbol.toStringTag,{value:"Module"}));export{u as L,m as b};
|
|
38
|
+
vec4 projectedPosition = mix(startAligned, endAligned, uv0.y);
|
|
39
|
+
// The direction of the line in screen space
|
|
40
|
+
vec2 screenSpaceDirection = normalize(endAligned.xy / endAligned.w - startAligned.xy / startAligned.w);
|
|
41
|
+
vec2 perpendicularScreenSpaceDirection = vec2(screenSpaceDirection.y, -screenSpaceDirection.x);
|
|
42
|
+
${i.hasScreenSizePerspective?g`float lineSizeScaled = applyScreenSizePerspectiveScaleFactorFloat(lineSize, perspectiveFactor);
|
|
43
|
+
float borderSizeScaled = applyScreenSizePerspectiveScaleFactorFloat(borderSize, perspectiveFactor);`:g`float lineSizeScaled = lineSize;
|
|
44
|
+
float borderSizeScaled = borderSize;`}
|
|
45
|
+
float halfPixelSize = lineSizeScaled * 0.5;
|
|
46
|
+
|
|
47
|
+
// Compute full ndc offset, adding 1px padding for doing anti-aliasing and the border size
|
|
48
|
+
float padding = 1.0 + borderSizeScaled;
|
|
49
|
+
vec2 ndcOffset = (-halfPixelSize - padding + uv0.x * (lineSizeScaled + padding + padding)) * pixelToNDC;
|
|
50
|
+
|
|
51
|
+
// Offset x/y from the center of the line in screen space
|
|
52
|
+
projectedPosition.xy += perpendicularScreenSpaceDirection * ndcOffset * projectedPosition.w;
|
|
53
|
+
|
|
54
|
+
// Compute a coverage varying which we can use in the fragment shader to determine
|
|
55
|
+
// how much a pixel is actually covered by the line (i.e. to anti alias the line).
|
|
56
|
+
// This works by computing two coordinates that can be linearly interpolated and then
|
|
57
|
+
// subtracted to find out how far away from the line edge we are.
|
|
58
|
+
float edgeDirection = (uv0.x * 2.0 - 1.0);
|
|
59
|
+
|
|
60
|
+
float halfBorderSize = 0.5 * borderSizeScaled;
|
|
61
|
+
float halfPixelSizeAndBorder = halfPixelSize + halfBorderSize;
|
|
62
|
+
float outerEdgeCoverageSampler = edgeDirection * (halfPixelSizeAndBorder + halfBorderSize + 1.0);
|
|
63
|
+
|
|
64
|
+
float isOneSided = float(lineSizeScaled < 2.0 && borderSize < 2.0);
|
|
65
|
+
|
|
66
|
+
coverageSampling = vec4(
|
|
67
|
+
// Edge coordinate
|
|
68
|
+
outerEdgeCoverageSampler,
|
|
69
|
+
|
|
70
|
+
// Border edge coordinate
|
|
71
|
+
outerEdgeCoverageSampler - halfPixelSizeAndBorder * isOneSided,
|
|
72
|
+
|
|
73
|
+
// Line offset
|
|
74
|
+
halfPixelSize - 0.5,
|
|
75
|
+
|
|
76
|
+
// Border offset
|
|
77
|
+
halfBorderSize - 0.5 + halfPixelSizeAndBorder * (1.0 - isOneSided)
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
lineSizes = vec2(lineSizeScaled, borderSizeScaled);
|
|
81
|
+
gl_Position = projectedPosition;`),u.uniforms.add(new p("uColor",(e=>b(e.color))),new p("borderColor",(e=>b(e.borderColor)))),i.multipassEnabled&&(u.include(l,i),u.uniforms.add(new c("inverseViewport",((e,i)=>i.inverseViewport)))),u.main.add(g`
|
|
82
|
+
${i.multipassEnabled?g`if( geometryDepthTest(gl_FragCoord.xy * inverseViewport, depth) ){ discard; }`:""}
|
|
83
|
+
|
|
84
|
+
// Mix between line and border coverage offsets depending on whether we need
|
|
85
|
+
// a border (based on the sidedness).
|
|
86
|
+
vec2 coverage = min(1.0 - clamp(abs(coverageSampling.xy) - coverageSampling.zw, 0.0, 1.0), lineSizes);
|
|
87
|
+
|
|
88
|
+
// Mix between border and line color based on the line coverage (conceptually the line blends on top of the
|
|
89
|
+
// border background).
|
|
90
|
+
//
|
|
91
|
+
// Anti-alias by blending final result using the full (including optional border) coverage and the color alpha
|
|
92
|
+
float borderAlpha = uColor.a * borderColor.a * coverage.y;
|
|
93
|
+
float colorAlpha = uColor.a * coverage.x;
|
|
94
|
+
|
|
95
|
+
float finalAlpha = mix(borderAlpha, 1.0, colorAlpha);
|
|
96
|
+
${i.depthHudEnabled?g`if (finalAlpha < ${g.float(d)}) {
|
|
97
|
+
discard;
|
|
98
|
+
}`:g`vec3 finalRgb = mix(borderColor.rgb * borderAlpha, uColor.rgb, colorAlpha);
|
|
99
|
+
fragColor = vec4(finalRgb, finalAlpha);`}`),r}function b(e){return null!=e?e:r}const h=i(),u=Object.freeze(Object.defineProperty({__proto__:null,build:m},Symbol.toStringTag,{value:"Module"}));export{u as L,m as b};
|
|
@@ -140,17 +140,11 @@ return clamp(0.5 - distance, 0.0, 1.0);
|
|
|
140
140
|
float distance = max(abs(samplePos.x) - halfMarkerSize, abs(samplePos.y) - halfTipLineWidth);
|
|
141
141
|
return clamp(0.5 - distance, 0.0, 1.0);
|
|
142
142
|
}
|
|
143
|
-
`)),j.output===o.Highlight&&L.include(t,j),C.
|
|
144
|
-
void main() {
|
|
143
|
+
`)),j.output===o.Highlight&&L.include(t,j),C.main.add(u`
|
|
145
144
|
discardBySlice(vpos);
|
|
146
145
|
${M?"terrainDepthTest(depth);":""}
|
|
147
146
|
|
|
148
147
|
vec4 finalColor = intrinsicColor * vColor;
|
|
149
|
-
|
|
150
148
|
${k?"vec2 samplePos = vUV;":"vec2 samplePos = vUV * gl_FragCoord.w;"}
|
|
151
|
-
|
|
152
149
|
${j.hasTip?"finalColor.a *= max(markerAlpha(samplePos), tipAlpha(samplePos));":"finalColor.a *= markerAlpha(samplePos);"}
|
|
153
|
-
|
|
154
|
-
outputColorHighlightOID(finalColor, vpos);
|
|
155
|
-
}
|
|
156
|
-
`),L}const L=Object.freeze(Object.defineProperty({__proto__:null,build:j},Symbol.toStringTag,{value:"Module"}));export{L,j as b};
|
|
150
|
+
outputColorHighlightOID(finalColor, vpos);`),L}const L=Object.freeze(Object.defineProperty({__proto__:null,build:j},Symbol.toStringTag,{value:"Module"}));export{L,j as b};
|
package/chunks/Magnifier.glsl.js
CHANGED
|
@@ -2,10 +2,8 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{screenPointObjectToArray as e,createScreenPointArray as r,createRenderScreenPointArray as
|
|
6
|
-
|
|
7
|
-
gl_Position = vec4(drawPosition.xy + vec2(position - 0.5) * drawPosition.zw, 0.0, 1.0);
|
|
8
|
-
}`),e.fragment.uniforms.add(new u("textureInput",(e=>e.input))),e.fragment.uniforms.add(new u("textureMask",(e=>e.mask))),e.fragment.uniforms.add(new u("textureOverlay",(e=>e.overlay))),e.fragment.uniforms.add(new n("maskEnabled",(e=>e.magnifier.maskEnabled))),e.fragment.uniforms.add(new n("overlayEnabled",(e=>e.magnifier.overlayEnabled))),e.fragment.code.add(l`const float barrelFactor = 1.1;
|
|
5
|
+
import{screenPointObjectToArray as e,createScreenPointArray as r,createRenderScreenPointArray as a}from"../core/screenUtils.js";import{s as t}from"./vec42.js";import{create as o}from"../core/libs/gl-matrix-2/factories/vec4f64.js";import{BooleanPassUniform as n}from"../views/3d/webgl-engine/core/shaderModules/BooleanPassUniform.js";import{Float4PassUniform as i}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{NoParameters as s,glsl as l}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{ShaderBuilder as d}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DPassUniform as m}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{VertexAttribute as u}from"../views/3d/webgl-engine/lib/VertexAttribute.js";class f extends s{constructor(){super(...arguments),this.mask=null,this.overlay=null,this.input=null,this.size=0}}function v(){const e=new d;return e.attributes.add(u.POSITION,"vec2"),e.vertex.uniforms.add(new i("drawPosition",((e,r)=>c(e,r)))),e.varyings.add("vUV","vec2"),e.vertex.main.add(l`vUV = position;
|
|
6
|
+
gl_Position = vec4(drawPosition.xy + vec2(position - 0.5) * drawPosition.zw, 0.0, 1.0);`),e.fragment.uniforms.add(new m("textureInput",(e=>e.input))),e.fragment.uniforms.add(new m("textureMask",(e=>e.mask))),e.fragment.uniforms.add(new m("textureOverlay",(e=>e.overlay))),e.fragment.uniforms.add(new n("maskEnabled",(e=>e.magnifier.maskEnabled))),e.fragment.uniforms.add(new n("overlayEnabled",(e=>e.magnifier.overlayEnabled))),e.fragment.code.add(l`const float barrelFactor = 1.1;
|
|
9
7
|
vec2 barrel(vec2 uv) {
|
|
10
8
|
vec2 uvn = uv * 2.0 - 1.0;
|
|
11
9
|
if (uvn.x == 0.0 && uvn.y == 0.0) {
|
|
@@ -14,10 +12,7 @@ return vec2(0.5, 0.5);
|
|
|
14
12
|
float theta = atan(uvn.y, uvn.x);
|
|
15
13
|
float r = pow(length(uvn), barrelFactor);
|
|
16
14
|
return r * vec2(cos(theta), sin(theta)) * 0.5 + 0.5;
|
|
17
|
-
}
|
|
18
|
-
void main() {
|
|
19
|
-
float mask = maskEnabled ? texture(textureMask, vUV).a : 1.0;
|
|
15
|
+
}`),e.fragment.main.add(l`float mask = maskEnabled ? texture(textureMask, vUV).a : 1.0;
|
|
20
16
|
vec4 inputColor = texture(textureInput, barrel(vUV)) * mask;
|
|
21
17
|
vec4 overlayColor = overlayEnabled ? texture(textureOverlay, vUV) : vec4(0);
|
|
22
|
-
fragColor = overlayColor + (1.0 - overlayColor.a) * inputColor;
|
|
23
|
-
}`),e}function c(r,o){const a=o.camera.pixelRatio,n=r.magnifier.offset.x*a,i=r.magnifier.offset.y*a;e(r.magnifier.position,g);const s=o.camera.screenToRender(g,b),l=Math.ceil(a*r.magnifier.size),{fullWidth:d,fullHeight:u}=o.camera;return t(p,(s[0]+n)/d*2-1,(s[1]-i)/u*2-1,l/d*2,l/u*2)}const g=r(),b=o(),p=a(),w=Object.freeze(Object.defineProperty({__proto__:null,MagnifierPassParameters:f,build:v},Symbol.toStringTag,{value:"Module"}));export{f as M,w as a,v as b};
|
|
18
|
+
fragColor = overlayColor + (1.0 - overlayColor.a) * inputColor;`),e}function c(r,a){const o=a.camera.pixelRatio,n=r.magnifier.offset.x*o,i=r.magnifier.offset.y*o;e(r.magnifier.position,g);const s=a.camera.screenToRender(g,b),l=Math.ceil(o*r.magnifier.size),{fullWidth:d,fullHeight:m}=a.camera;return t(p,(s[0]+n)/d*2-1,(s[1]-i)/m*2-1,l/d*2,l/m*2)}const g=r(),b=a(),p=o(),w=Object.freeze(Object.defineProperty({__proto__:null,MagnifierPassParameters:f,build:v},Symbol.toStringTag,{value:"Module"}));export{f as M,w as a,v as b};
|
|
@@ -2,15 +2,13 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{alphaCutoff as e}from"../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff.js";import{addProjViewLocalOrigin as
|
|
6
|
-
vec3 bitangent = normal;
|
|
5
|
+
import{alphaCutoff as e}from"../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff.js";import{addProjViewLocalOrigin as r}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float4PassUniform as t}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as o}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as i}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{ShaderBuilder as n}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{VertexAttribute as d}from"../views/3d/webgl-engine/lib/VertexAttribute.js";function s(s){const a=new n,{vertex:l,fragment:c}=a;r(l,s),l.uniforms.add(new o("width",(e=>e.width))),a.attributes.add(d.POSITION,"vec3"),a.attributes.add(d.NORMAL,"vec3"),a.attributes.add(d.UV0,"vec2"),a.attributes.add(d.LENGTH,"float"),a.varyings.add("vtc","vec2"),a.varyings.add("vlength","float"),a.varyings.add("vradius","float"),l.main.add(i`vec3 bitangent = normal;
|
|
7
6
|
vtc = uv0;
|
|
8
7
|
vlength = length;
|
|
9
8
|
vradius = 0.5 * width;
|
|
10
9
|
vec4 pos = view * vec4(position + vradius * bitangent * uv0.y, 1.0);
|
|
11
|
-
gl_Position = proj * pos;
|
|
12
|
-
|
|
13
|
-
const float INV_SQRT2 = ${i.float(c)};
|
|
10
|
+
gl_Position = proj * pos;`),c.uniforms.add(new o("outlineSize",(e=>e.outlineSize)),new t("outlineColor",(e=>e.outlineColor)),new o("stripeLength",(e=>e.stripeLength)),new t("stripeEvenColor",(e=>e.stripeEvenColor)),new t("stripeOddColor",(e=>e.stripeOddColor)));const v=1/Math.sqrt(2);return c.code.add(i`
|
|
11
|
+
const float INV_SQRT2 = ${i.float(v)};
|
|
14
12
|
|
|
15
13
|
vec4 arrowColor(vec2 tc, float len) {
|
|
16
14
|
float d = INV_SQRT2 * (tc.x - abs(tc.y));
|
|
@@ -24,14 +22,10 @@ gl_Position = proj * pos;
|
|
|
24
22
|
} else {
|
|
25
23
|
return fract(0.5 / stripeLength * tc.x * vradius) >= 0.5 ? stripeOddColor : stripeEvenColor;
|
|
26
24
|
}
|
|
25
|
+
}`),c.main.add(i`
|
|
26
|
+
vec2 ntc = vec2(vtc.x / vradius, vtc.y);
|
|
27
|
+
vec4 color = arrowColor(ntc, vlength / vradius);
|
|
28
|
+
if (color.a < ${i.float(e)}) {
|
|
29
|
+
discard;
|
|
27
30
|
}
|
|
28
|
-
|
|
29
|
-
void main(void) {
|
|
30
|
-
vec2 ntc = vec2(vtc.x / vradius, vtc.y);
|
|
31
|
-
vec4 color = arrowColor(ntc, vlength / vradius);
|
|
32
|
-
if (color.a < ${i.float(e)}) {
|
|
33
|
-
discard;
|
|
34
|
-
}
|
|
35
|
-
fragColor = color;
|
|
36
|
-
}
|
|
37
|
-
`),a}const a=Object.freeze(Object.defineProperty({__proto__:null,build:s},Symbol.toStringTag,{value:"Module"}));export{a as M,s as b};
|
|
31
|
+
fragColor = color;`),a}const a=Object.freeze(Object.defineProperty({__proto__:null,build:s},Symbol.toStringTag,{value:"Module"}));export{a as M,s as b};
|
|
@@ -2,23 +2,19 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{ShaderOutput as e}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SliceDraw as
|
|
6
|
-
vpos = position;
|
|
5
|
+
import{ShaderOutput as e}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 o}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{VertexColor as i}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js";import{OutputHighlight as t}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{alphaCutoff as s}from"../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff.js";import{addProjViewLocalOrigin as l}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float4PassUniform as a}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as n}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as d}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{ShaderBuilder as g}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{VertexAttribute as u}from"../views/3d/webgl-engine/lib/VertexAttribute.js";function c(c){const m=new g,{vertex:p,fragment:w}=m;return m.include(o,c),m.include(i,c),l(p,c),m.attributes.add(u.POSITION,"vec3"),m.varyings.add("vpos","vec3"),p.main.add(d`vpos = position;
|
|
7
6
|
forwardNormalizedVertexColor();
|
|
8
|
-
gl_Position = transformPosition(proj, view, vpos)
|
|
9
|
-
}`),u.output===e.Highlight&&m.include(t,u),m.include(o,u),w.uniforms.add(new d("alphaCoverage",((e,o)=>Math.min(1,e.width*o.camera.pixelRatio)))),u.hasVertexColors||w.uniforms.add(new a("constantColor",(e=>e.color))),w.code.add(n`
|
|
10
|
-
void main() {
|
|
7
|
+
gl_Position = transformPosition(proj, view, vpos);`),c.output===e.Highlight&&m.include(t,c),m.include(r,c),w.uniforms.add(new n("alphaCoverage",((e,r)=>Math.min(1,e.width*r.camera.pixelRatio)))),c.hasVertexColors||w.uniforms.add(new a("constantColor",(e=>e.color))),w.main.add(d`
|
|
11
8
|
discardBySlice(vpos);
|
|
12
9
|
|
|
13
|
-
vec4 color = ${
|
|
10
|
+
vec4 color = ${c.hasVertexColors?"vColor":"constantColor"};
|
|
14
11
|
|
|
15
|
-
${
|
|
12
|
+
${c.output===e.ObjectAndLayerIdColor?"color.a = 1.0;":""}
|
|
16
13
|
|
|
17
|
-
if (color.a < ${
|
|
14
|
+
if (color.a < ${d.float(s)}) {
|
|
18
15
|
discard;
|
|
19
16
|
}
|
|
20
17
|
|
|
21
|
-
${
|
|
22
|
-
${
|
|
23
|
-
}
|
|
24
|
-
`),m}const m=Object.freeze(Object.defineProperty({__proto__:null,build:u},Symbol.toStringTag,{value:"Module"}));export{m as N,u as b};
|
|
18
|
+
${c.output===e.Color?d`fragColor = highlightSlice(color, vpos);`:""}
|
|
19
|
+
${c.output===e.Highlight?d`outputHighlight();`:""}
|
|
20
|
+
`),m}const m=Object.freeze(Object.defineProperty({__proto__:null,build:c},Symbol.toStringTag,{value:"Module"}));export{m as N,c as b};
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{fromValues as e}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{NoiseTextureRenderMode as o}from"../views/3d/environment/NoiseTextureAtlasConfiguration.js";import{tileRows as t,weatherTileSize as
|
|
5
|
+
import{fromValues as e}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{NoiseTextureRenderMode as o}from"../views/3d/environment/NoiseTextureAtlasConfiguration.js";import{tileRows as t,weatherTileSize as a,weatherMapSize as r,tileSize as l,atlasSize as i}from"../views/3d/environment/NoiseTextureAtlasDimensions.js";import{ScreenSpacePass as f}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{Float2PassUniform as d}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{NoParameters as p,glsl as n}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{ShaderBuilder as c}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";class s extends p{constructor(){super(...arguments),this.weatherTile=e(0,0)}}function u(e){const p=new c;if(p.include(f,!1),p.fragment.code.add(n`float remap(float x, float low1, float high1, float low2, float high2) {
|
|
6
6
|
return low2 + (x - low1) * (high2 - low2) / (high1 - low1);
|
|
7
|
-
}`),e.mode===o.Full){const e=2,o=8;
|
|
7
|
+
}`),e.mode===o.Full){const e=2,o=8;p.fragment.code.add(n`float saturate(float x) {
|
|
8
8
|
return clamp(x, 0.0, 1.0);
|
|
9
|
-
}`),
|
|
9
|
+
}`),p.fragment.code.add(n`vec3 modulo(vec3 m, float n) {
|
|
10
10
|
return mod(mod(m, n) + n, n);
|
|
11
11
|
}
|
|
12
12
|
vec3 hash(vec3 p3, float frequency) {
|
|
@@ -14,9 +14,9 @@ p3 = modulo(p3, frequency);
|
|
|
14
14
|
p3 = fract(p3 * vec3(0.1031, 0.1030, 0.0973));
|
|
15
15
|
p3 += dot(p3, p3.yxz + 33.33);
|
|
16
16
|
return -1.0 + 2.0 * fract((p3.xxy + p3.yxx) * p3.zyx);
|
|
17
|
-
}`),
|
|
17
|
+
}`),p.fragment.code.add(n`vec3 fade(vec3 t) {
|
|
18
18
|
return (t * t * t) * (t * (t * 6.0 - 15.0) + 10.0);
|
|
19
|
-
}`),
|
|
19
|
+
}`),p.fragment.code.add(n`
|
|
20
20
|
float gradientNoise(vec3 p, float frequency) {
|
|
21
21
|
vec3 i = floor(p);
|
|
22
22
|
vec3 f = fract(p);
|
|
@@ -70,26 +70,26 @@ return (t * t * t) * (t * (t * 6.0 - 15.0) + 10.0);
|
|
|
70
70
|
|
|
71
71
|
vec3 get3Dfrom2D(vec2 uv) {
|
|
72
72
|
vec2 tile = floor(uv);
|
|
73
|
-
float z = floor(${
|
|
73
|
+
float z = floor(${n.float(t)} * tile.y + tile.x);
|
|
74
74
|
return vec3(fract(uv), z);
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
float getTextureForPointPerlinWorley(vec3 p) {
|
|
78
|
-
float perlinNoise = getPerlinNoise(p, ${
|
|
78
|
+
float perlinNoise = getPerlinNoise(p, ${n.float(o)});
|
|
79
79
|
|
|
80
|
-
float worley0 = worley(p, ${
|
|
81
|
-
float worley1 = worley(p, ${
|
|
82
|
-
float worley2 = worley(p, ${
|
|
80
|
+
float worley0 = worley(p, ${n.float(e)} * 2.0);
|
|
81
|
+
float worley1 = worley(p, ${n.float(e)} * 8.0);
|
|
82
|
+
float worley2 = worley(p, ${n.float(e)} * 14.0);
|
|
83
83
|
|
|
84
84
|
float worleyFBM = worley0 * 0.625 + worley1 * 0.25 + worley2 * 0.125;
|
|
85
85
|
return remap(perlinNoise, 0.0, 1.0, worleyFBM, 1.0);
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
float getTextureForPointWorley(vec3 p) {
|
|
89
|
-
float worley0 = worley(p, ${
|
|
90
|
-
float worley1 = worley(p, ${
|
|
91
|
-
float worley2 = worley(p, ${
|
|
92
|
-
float worley3 = worley(p, ${
|
|
89
|
+
float worley0 = worley(p, ${n.float(e)});
|
|
90
|
+
float worley1 = worley(p, ${n.float(e)} * 2.0);
|
|
91
|
+
float worley2 = worley(p, ${n.float(e)} * 4.0);
|
|
92
|
+
float worley3 = worley(p, ${n.float(e)} * 8.0);
|
|
93
93
|
|
|
94
94
|
float FBM0 = worley0 * 0.625 + worley1 * 0.25 + worley2 * 0.125;
|
|
95
95
|
float FBM1 = worley1 * 0.625 + worley2 * 0.25 + worley3 * 0.125;
|
|
@@ -97,20 +97,20 @@ return (t * t * t) * (t * (t * 6.0 - 15.0) + 10.0);
|
|
|
97
97
|
|
|
98
98
|
return FBM0 * 0.625 + FBM1 * 0.25 + FBM2 * 0.125;
|
|
99
99
|
}
|
|
100
|
-
`)}return
|
|
100
|
+
`)}return p.fragment.uniforms.add(new d("weatherTile",(e=>e.weatherTile))),p.fragment.code.add(n`
|
|
101
101
|
vec2 modulo(vec2 m, float n){
|
|
102
102
|
return mod(mod(m, n) + n, n);
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
vec2 hash(vec2 p){
|
|
106
106
|
// Get position of p in weather tile
|
|
107
|
-
p = modulo(p, ${
|
|
107
|
+
p = modulo(p, ${n.float(a)});
|
|
108
108
|
|
|
109
109
|
// Get global coordinates of p
|
|
110
|
-
p += weatherTile * ${
|
|
110
|
+
p += weatherTile * ${n.float(a)};
|
|
111
111
|
|
|
112
112
|
// Limit position to avoid numerical instability
|
|
113
|
-
p = modulo(p, ${
|
|
113
|
+
p = modulo(p, ${n.float(r)});
|
|
114
114
|
|
|
115
115
|
vec3 p3 = fract(vec3(p.xyx) * vec3(0.1031, 0.1030, 0.0973));
|
|
116
116
|
p3 += dot(p3, p3.yzx + 33.33);
|
|
@@ -147,92 +147,95 @@ return (t * t * t) * (t * (t * 6.0 - 15.0) + 10.0);
|
|
|
147
147
|
}
|
|
148
148
|
return 1.0 - clamp(d, 0.0, 1.0);
|
|
149
149
|
}
|
|
150
|
-
`),
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
if (mod(gl_FragCoord.y, paddedSize) == 0.5 || mod(gl_FragCoord.y, paddedSize) == paddedSize - 0.5) {
|
|
162
|
-
padCell = true;
|
|
163
|
-
}
|
|
150
|
+
`),e.mode===o.Full?p.fragment.main.add(n`
|
|
151
|
+
float padWidth = 1.0;
|
|
152
|
+
float paddedSize = ${n.float(l)} + 2.0 * padWidth;
|
|
153
|
+
float tileCount = ${n.float(t)} * ${n.float(t)};
|
|
154
|
+
vec2 tile = floor((gl_FragCoord.xy - 0.5) / paddedSize);
|
|
155
|
+
|
|
156
|
+
bool padCell = false;
|
|
157
|
+
if (mod(gl_FragCoord.x, paddedSize) == 0.5 || mod(gl_FragCoord.x, paddedSize) == paddedSize - 0.5) {
|
|
158
|
+
padCell = true;
|
|
159
|
+
}
|
|
164
160
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
bool endPadY = false;
|
|
161
|
+
if (mod(gl_FragCoord.y, paddedSize) == 0.5 || mod(gl_FragCoord.y, paddedSize) == paddedSize - 0.5) {
|
|
162
|
+
padCell = true;
|
|
163
|
+
}
|
|
169
164
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
165
|
+
bool startPadX = false;
|
|
166
|
+
bool startPadY = false;
|
|
167
|
+
bool endPadX = false;
|
|
168
|
+
bool endPadY = false;
|
|
173
169
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
170
|
+
if (gl_FragCoord.x == tile.x * paddedSize + 0.5) {
|
|
171
|
+
startPadX = true;
|
|
172
|
+
}
|
|
177
173
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
174
|
+
if (gl_FragCoord.y == tile.y * paddedSize + 0.5) {
|
|
175
|
+
startPadY = true;
|
|
176
|
+
}
|
|
181
177
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
178
|
+
if (gl_FragCoord.x == (tile.x + 1.0) * paddedSize - 0.5) {
|
|
179
|
+
endPadX = true;
|
|
180
|
+
}
|
|
185
181
|
|
|
186
|
-
|
|
187
|
-
|
|
182
|
+
if (gl_FragCoord.y == (tile.y + 1.0) * paddedSize - 0.5) {
|
|
183
|
+
endPadY = true;
|
|
184
|
+
}
|
|
188
185
|
|
|
189
|
-
|
|
190
|
-
|
|
186
|
+
vec2 padding = vec2(2.0 * padWidth) * tile;
|
|
187
|
+
vec2 uv;
|
|
191
188
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
}
|
|
189
|
+
if (padCell) {
|
|
190
|
+
vec2 pixel = gl_FragCoord.xy - padWidth - padding;
|
|
195
191
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
192
|
+
if (startPadX) {
|
|
193
|
+
pixel.x += ${n.float(l)};
|
|
194
|
+
}
|
|
199
195
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
196
|
+
if (startPadY) {
|
|
197
|
+
pixel.y += ${n.float(l)};
|
|
198
|
+
}
|
|
203
199
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
200
|
+
if (endPadX) {
|
|
201
|
+
pixel.x -= ${n.float(l)};
|
|
202
|
+
}
|
|
207
203
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
vec2 pixel = gl_FragCoord.xy - padWidth - padding;
|
|
211
|
-
uv = vec2(pixel.xy / ${p.float(l)});
|
|
204
|
+
if (endPadY) {
|
|
205
|
+
pixel.y -= ${n.float(l)};
|
|
212
206
|
}
|
|
213
207
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
208
|
+
uv = vec2(pixel.xy / ${n.float(l)});
|
|
209
|
+
} else {
|
|
210
|
+
vec2 pixel = gl_FragCoord.xy - padWidth - padding;
|
|
211
|
+
uv = vec2(pixel.xy / ${n.float(l)});
|
|
212
|
+
}
|
|
217
213
|
|
|
218
|
-
|
|
219
|
-
|
|
214
|
+
vec3 p_ = get3Dfrom2D(uv);
|
|
215
|
+
vec3 p = p_;
|
|
216
|
+
p.z /= (${n.float(t)} * ${n.float(t)});
|
|
220
217
|
|
|
221
|
-
|
|
218
|
+
float worleyPerlinNoise = getTextureForPointPerlinWorley(p);
|
|
219
|
+
float worleyNoise = getTextureForPointWorley(p);
|
|
222
220
|
|
|
223
|
-
|
|
224
|
-
p = p_;
|
|
225
|
-
p.z /= (${p.float(t)} * ${p.float(t)});
|
|
221
|
+
fragColor.r = saturate(remap(worleyPerlinNoise, worleyNoise, 1.0, 0.0, 1.0));
|
|
226
222
|
|
|
227
|
-
|
|
228
|
-
|
|
223
|
+
p_ = mod(p_ + 1.0, ${n.float(t)} * ${n.float(t)});
|
|
224
|
+
p = p_;
|
|
225
|
+
p.z /= (${n.float(t)} * ${n.float(t)});
|
|
229
226
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
227
|
+
worleyPerlinNoise = getTextureForPointPerlinWorley(p);
|
|
228
|
+
worleyNoise = getTextureForPointWorley(p);
|
|
229
|
+
|
|
230
|
+
fragColor.g = saturate(remap(worleyPerlinNoise, worleyNoise, 1.0, 0.0, 1.0));
|
|
231
|
+
|
|
232
|
+
vec2 mapUV = ${n.float(a)} * (gl_FragCoord.xy / ${n.float(i)});
|
|
233
233
|
float map = abs(gradientNoise(mapUV));
|
|
234
234
|
map = remap(map, 0.25 * (1.0 - worley(8.0 * mapUV)), 1.0, 0.0, 1.0);
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
235
|
+
fragColor.ba = vec2(0.0, map);
|
|
236
|
+
`):p.fragment.main.add(n`
|
|
237
|
+
vec2 mapUV = ${n.float(a)} * (gl_FragCoord.xy / ${n.float(i)});
|
|
238
|
+
float map = abs(gradientNoise(mapUV));
|
|
239
|
+
map = remap(map, 0.25 * (1.0 - worley(8.0 * mapUV)), 1.0, 0.0, 1.0);
|
|
240
|
+
fragColor = vec4(map);
|
|
241
|
+
`),p}const m=Object.freeze(Object.defineProperty({__proto__:null,NoiseTextureAtlasPassParameters:s,build:u},Symbol.toStringTag,{value:"Module"}));export{s as N,m as a,u as b};
|