@arcgis/core 5.2.0-next.116 → 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/{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,9 +1,9 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{FoamColor as e}from"./FoamRendering.glsl.js";import{Gamma as o}from"./Gamma.glsl.js";import{PhysicallyBasedRenderingWater as t}from"./PhysicallyBasedRendering.glsl.js";import{distanceFadeStart as r,distanceFadeEnd as i}from"./ScreenSpaceConstants.js";import{ScreenSpaceRayMarching as n}from"./ScreenSpaceRayMarching.glsl.js";import{
|
|
2
|
+
import{FoamColor as e}from"./FoamRendering.glsl.js";import{Gamma as o}from"./Gamma.glsl.js";import{PhysicallyBasedRenderingWater as t}from"./PhysicallyBasedRendering.glsl.js";import{distanceFadeStart as r,distanceFadeEnd as i}from"./ScreenSpaceConstants.js";import{ScreenSpaceRayMarching as n}from"./ScreenSpaceRayMarching.glsl.js";import{viewMatrix as a}from"../util/cameraUniforms.js";import{CloudsParallaxShading as l}from"../util/CloudsParallaxShading.glsl.js";import{FloatBindUniform as d}from"../../shaderModules/FloatBindUniform.js";import{glsl as c}from"../../shaderModules/glsl.js";import{Texture2DBindUniform as s}from"../../shaderModules/Texture2DBindUniform.js";import{ToneMapping as f}from"../../../shaders/ToneMapping.glsl.js";function m(m,v){const u=m.fragment;u.include(t,v),u.include(o),u.include(e),v.cloudReflections&&m.include(l),v.screenSpaceReflections&&m.include(n,v),u.include(f,v),u.constants.add("fresnelSky","vec3",[.02,1,15]),u.constants.add("fresnelMaterial","vec2",[.02,.1]),u.constants.add("roughness","float",.015),u.constants.add("foamIntensityExternal","float",1.7),u.constants.add("ssrIntensity","float",.65),u.constants.add("ssrHeightFadeStart","float",r),u.constants.add("ssrHeightFadeEnd","float",i),u.constants.add("waterDiffusion","float",.92),u.constants.add("waterSeaColorMod","float",.8),u.constants.add("correctionViewingPowerFactor","float",.4),u.constants.add("skyZenitColor","vec3",[.52,.68,.9]),u.constants.add("skyColor","vec3",[.67,.79,.9]),u.constants.add("cloudFresnelModifier","vec2",[1.2,.01]),u.code.add(c`PBRShadingWater shadingInfo;
|
|
3
3
|
vec3 getSkyGradientColor(in float cosTheta, in vec3 horizon, in vec3 zenit) {
|
|
4
4
|
float exponent = pow((1.0 - cosTheta), fresnelSky[2]);
|
|
5
5
|
return mix(zenit, horizon, exponent);
|
|
6
|
-
}`),u.uniforms.add(new
|
|
6
|
+
}`),u.uniforms.add(new d("lightingSpecularStrength",e=>e.lighting.mainLight.specularStrength),new d("lightingEnvironmentStrength",e=>e.lighting.mainLight.environmentStrength)),u.code.add(c`vec3 getWaterColor(in vec3 n, in vec3 v, in vec3 l, vec3 color, in vec3 lightIntensity, in vec3 localUp, in float shadow, float foamIntensity, vec3 viewPosition, vec3 position) {
|
|
7
7
|
float reflectionHit = 0.0;
|
|
8
8
|
float reflectionHitDiffused = 0.0;
|
|
9
9
|
vec3 seaWaterColor = linearizeGamma(color);
|
|
@@ -37,10 +37,10 @@ foam = foamIntensity2FoamColor(foamIntensityExternal, foamIntensity, skyZenitCol
|
|
|
37
37
|
}
|
|
38
38
|
float correctionViewingFactor = pow(max(dot(v, localUp), 0.0), correctionViewingPowerFactor);
|
|
39
39
|
vec3 normalCorrectedClouds = mix(localUp, n, correctionViewingFactor);
|
|
40
|
-
vec3 reflectedWorld = normalize(reflect(-v, normalCorrectedClouds));`),v.cloudReflections&&u.uniforms.add(new
|
|
40
|
+
vec3 reflectedWorld = normalize(reflect(-v, normalCorrectedClouds));`),v.cloudReflections&&u.uniforms.add(new d("cloudsOpacity",e=>e.clouds.opacity)).code.add(c`vec4 cloudsColor = renderClouds(reflectedWorld, position);
|
|
41
41
|
cloudsColor.a = 1.0 - cloudsColor.a;
|
|
42
42
|
cloudsColor = pow(cloudsColor, vec4(GAMMA));
|
|
43
|
-
cloudsColor *= clamp(fresnelModifier.y * cloudFresnelModifier[0] - cloudFresnelModifier[1], 0.0, 1.0) * cloudsOpacity;`),v.screenSpaceReflections?u.uniforms.add(
|
|
43
|
+
cloudsColor *= clamp(fresnelModifier.y * cloudFresnelModifier[0] - cloudFresnelModifier[1], 0.0, 1.0) * cloudsOpacity;`),v.screenSpaceReflections?u.uniforms.add(a,new s("lastFrameColorTexture",e=>e.reprojection.lastFrameColor?.getTexture()),new d("fadeFactorSSR",e=>e.screenSpaceReflections.fadeFactor)).code.add(c`vec3 viewDir = normalize(viewPosition);
|
|
44
44
|
vec4 viewNormalVectorCoordinate = view * vec4(n, 0.0);
|
|
45
45
|
vec3 viewNormal = normalize(viewNormalVectorCoordinate.xyz);
|
|
46
46
|
vec4 viewUp = view * vec4(localUp, 0.0);
|
|
@@ -60,7 +60,7 @@ reflectionHitDiffused * fresnelModifier.y * ssrIntensity;
|
|
|
60
60
|
}
|
|
61
61
|
float seaColorMod = mix(waterSeaColorMod, waterSeaColorMod * 0.5, reflectionHitDiffused);
|
|
62
62
|
vec3 waterRenderedColor = tonemapACES((1.0 - reflectionHitDiffused) * reflSky + reflectedColor +
|
|
63
|
-
reflSea * seaColorMod + specular + foam);`):u.code.add(
|
|
64
|
-
}`):u.code.add(
|
|
65
|
-
}`):u.code.add(
|
|
63
|
+
reflSea * seaColorMod + specular + foam);`):u.code.add(c`vec3 waterRenderedColor = tonemapACES(reflSky + reflSea * waterSeaColorMod + specular + foam);`),v.cloudReflections?v.screenSpaceReflections?u.code.add(c`return waterRenderedColor * (1.0 - (1.0 - reflectionHit) * cloudsColor.a) + (1.0 - reflectionHit) * cloudsColor.xyz;
|
|
64
|
+
}`):u.code.add(c`return waterRenderedColor * (1.0 - cloudsColor.a) + cloudsColor.xyz;
|
|
65
|
+
}`):u.code.add(c`return waterRenderedColor;
|
|
66
66
|
}`)}export{m as WaterColor};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{fromValues as o}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{earth as t}from"../../../../../../geometry/support/Ellipsoid.js";import{cloudsHeight as a}from"../../../../environment/weather.js";import{mainLightDirection as
|
|
2
|
+
import{fromValues as o}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{earth as t}from"../../../../../../geometry/support/Ellipsoid.js";import{cloudsHeight as a}from"../../../../environment/weather.js";import{EvaluateAmbientLighting as r}from"../shading/EvaluateAmbientLighting.glsl.js";import{mainLightDirection as e,mainLightIntensity as i}from"../shading/MainLighting.glsl.js";import{LookupCloudsFromTextureArray as c}from"./LookupCloudsFromTextureArray.glsl.js";import{BooleanBindUniform as n}from"../../shaderModules/BooleanBindUniform.js";import{Float3BindUniform as d}from"../../shaderModules/Float3BindUniform.js";import{FloatBindUniform as l}from"../../shaderModules/FloatBindUniform.js";import{glsl as s}from"../../shaderModules/glsl.js";import{Matrix4BindUniform as u}from"../../shaderModules/Matrix4BindUniform.js";import{Texture2DArrayBindUniform as m}from"../../shaderModules/Texture2DArrayBindUniform.js";function h(t){const a=t.fragment;a.constants.add("radiusCloudsSquared","float",C).code.add(s`vec3 intersectWithCloudLayer(vec3 dir, vec3 cameraPosition, vec3 spherePos) {
|
|
3
3
|
float B = 2.0 * dot(cameraPosition, dir);
|
|
4
4
|
float C = dot(cameraPosition, cameraPosition) - radiusCloudsSquared;
|
|
5
5
|
float det = B * B - 4.0 * C;
|
|
6
6
|
float pointIntDist = max(0.0, 0.5 *(-B + sqrt(det)));
|
|
7
7
|
return (cameraPosition + dir * pointIntDist) - spherePos;
|
|
8
|
-
}`),a.uniforms.add(new
|
|
8
|
+
}`),a.uniforms.add(new l("radiusCurvatureCorrection",({clouds:o})=>o.parallax.radiusCurvatureCorrection)).code.add(s`vec3 correctForPlanetCurvature(vec3 dir) {
|
|
9
9
|
dir.z = dir.z * (1.0 - radiusCurvatureCorrection) + radiusCurvatureCorrection;
|
|
10
10
|
return dir;
|
|
11
|
-
}`),a.code.add(
|
|
11
|
+
}`),a.code.add(s`vec3 rotateDirectionToAnchorPoint(mat4 rotMat, vec3 inVec) {
|
|
12
12
|
return (rotMat * vec4(inVec, 0.0)).xyz;
|
|
13
|
-
}`),a.constants.add("RIM_COLOR","vec3",o(.28,.175,.035)),a.constants.add("sunsetTransitionFactor","float",.3),a.constants.add("rimScattering","float",140),a.constants.add("backlightFactor","float",.2),a.constants.add("backlightScattering","float",10),a.constants.add("backlightTransition","float",.3),a.uniforms.add(
|
|
13
|
+
}`),a.include(r,{pbrMode:0}),a.constants.add("RIM_COLOR","vec3",o(.28,.175,.035)),a.constants.add("sunsetTransitionFactor","float",.3),a.constants.add("rimScattering","float",140),a.constants.add("backlightFactor","float",.2),a.constants.add("backlightScattering","float",10),a.constants.add("backlightTransition","float",.3),a.uniforms.add(e,i).code.add(s`vec3 calculateCloudColor(vec3 cameraPosition, vec3 worldSpaceRay, vec4 clouds) {
|
|
14
14
|
float upDotLight = dot(cameraPosition, mainLightDirection);
|
|
15
15
|
float dirDotLight = max(dot(worldSpaceRay, mainLightDirection), 0.0);
|
|
16
16
|
float sunsetTransition = clamp(pow(max(upDotLight, 0.0), sunsetTransitionFactor), 0.0, 1.0);
|
|
@@ -22,12 +22,12 @@ float rimLightIntensity = 0.5 + 0.5 * pow(max(upDotLight, 0.0), 0.35);
|
|
|
22
22
|
vec3 directSunScattering = RIM_COLOR * rimLightIntensity * (pow(dirDotLight, rimScattering)) * scatteringMod;
|
|
23
23
|
float additionalLight = backlightFactor * pow(dirDotLight, backlightScattering) * (1. - pow(sunsetTransition, backlightTransition)) ;
|
|
24
24
|
return vec3(baseCloudColor * (1.0 + additionalLight) + directSunScattering);
|
|
25
|
-
}`),t.include(
|
|
25
|
+
}`),t.include(c),a.uniforms.add(new n("readChannelsRG",o=>0===o.clouds.readChannels),new m("cubeMap",o=>o.clouds.data?.cubeMap?.colorTexture)).code.add(s`vec4 sampleCloud(vec3 rayDir, bool readOtherChannel) {
|
|
26
26
|
vec4 s = lookupCloudsFromTextureArray(cubeMap, rayDir);
|
|
27
27
|
bool readRG = readChannelsRG ^^ readOtherChannel;
|
|
28
28
|
s = readRG ? vec4(vec3(s.r), s.g) : vec4(vec3(s.b), s.a);
|
|
29
29
|
return length(s) == 0.0 ? vec4(s.rgb, 1.0) : s;
|
|
30
|
-
}`),a.uniforms.add(new
|
|
30
|
+
}`),a.uniforms.add(new d("anchorPoint",o=>o.clouds.parallax.anchorPoint),new d("anchorPointNew",o=>o.clouds.parallaxNew.anchorPoint),new u("rotationClouds",o=>o.clouds.parallax.transform),new u("rotationCloudsNew",o=>o.clouds.parallaxNew.transform),new l("cloudsOpacity",o=>o.clouds.opacity),new l("fadeFactor",o=>o.clouds.fadeFactor),new n("crossFade",o=>3===o.clouds.fadeState)).code.add(s`vec4 renderClouds(vec3 worldRay, vec3 cameraPosition) {
|
|
31
31
|
vec3 intersectionPoint = intersectWithCloudLayer(worldRay, cameraPosition, anchorPoint);
|
|
32
32
|
vec3 worldRayRotated = rotateDirectionToAnchorPoint(rotationClouds, normalize(intersectionPoint));
|
|
33
33
|
vec3 worldRayRotatedCorrected = correctForPlanetCurvature(worldRayRotated);
|
|
@@ -46,4 +46,4 @@ float totalTransmittance = length(cloudColor.rgb) == 0.0 ?
|
|
|
46
46
|
1.0 :
|
|
47
47
|
clamp(cloudColor.a * cloudsOpacity + (1.0 - cloudsOpacity), 0.0 , 1.0);
|
|
48
48
|
return vec4(cloudColor.rgb, totalTransmittance);
|
|
49
|
-
}`)}const C=(t.radius+a)**2;export{
|
|
49
|
+
}`)}const C=(t.radius+a)**2;export{h as CloudsParallaxShading};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{translate as r}from"../../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as i}from"../../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as e}from"../../../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as o,create as a}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Float3BindUniform as n}from"../../shaderModules/Float3BindUniform.js";import{Float3DrawUniform as
|
|
2
|
+
import{translate as r}from"../../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as i}from"../../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as e}from"../../../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as o,create as a}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projMatrix as s}from"./cameraUniforms.js";import{Float3BindUniform as n}from"../../shaderModules/Float3BindUniform.js";import{Float3DrawUniform as t}from"../../shaderModules/Float3DrawUniform.js";import{FloatBindUniform as m}from"../../shaderModules/FloatBindUniform.js";import{Matrix4BindUniform as c}from"../../shaderModules/Matrix4BindUniform.js";import{Matrix4DrawUniform as f}from"../../shaderModules/Matrix4DrawUniform.js";function d(r,i){i.instancedDoublePrecision?r.constants.add("cameraPosition","vec3",o):r.uniforms.add(new t("cameraPosition",(r,i)=>e(p,i.camera.viewInverseTransposeMatrix[3]-r.origin[0],i.camera.viewInverseTransposeMatrix[7]-r.origin[1],i.camera.viewInverseTransposeMatrix[11]-r.origin[2])))}function l(i,o){if(!o.instancedDoublePrecision)return void i.uniforms.add(s,new f("view",(i,e)=>r(v,e.camera.viewMatrix,i.origin)),new t("localOrigin",r=>r.origin));const a=({camera:r})=>e(p,r.viewInverseTransposeMatrix[3],r.viewInverseTransposeMatrix[7],r.viewInverseTransposeMatrix[11]);i.uniforms.add(s,new c("view",i=>r(v,i.camera.viewMatrix,a(i))),new n("localOrigin",r=>a(r)))}const v=i(),p=a();function w(r){r.uniforms.add(new m("pixelRatio",r=>r.camera.pixelRatio/r.overlayStretch))}export{d as addCameraPosition,w as addPixelRatio,l as addProjViewLocalOrigin};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{set as e}from"../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{Float2BindUniform as i}from"../../shaderModules/Float2BindUniform.js";import{Float4BindUniform as a}from"../../shaderModules/Float4BindUniform.js";import{FloatBindUniform as o}from"../../shaderModules/FloatBindUniform.js";import{Matrix4BindUniform as t}from"../../shaderModules/Matrix4BindUniform.js";const n=new t("view",({camera:e})=>e.viewMatrix),m=new t("inverseViewMatrix",({camera:e})=>e.inverseViewMatrix),s=new t("proj",({camera:e})=>e.projectionMatrix),l=new t("inverseProjectionMatrix",({camera:e})=>e.inverseProjectionMatrix),c=new t("viewNormal",({camera:e})=>e.viewInverseTransposeMatrix),w=new i("nearFar",({camera:e})=>e.nearFar),f=new a("viewport",({camera:e})=>e.fullViewport),p=new o("pixelRatio",({camera:e})=>e.pixelRatio),d=new i("inverseScreenSize",({camera:r})=>e(v,1/r.fullWidth,1/r.fullHeight)),v=r();export{l as inverseProjMatrix,d as inverseScreenSize,m as inverseViewMatrix,w as nearFar,p as pixelRatio,s as projMatrix,n as viewMatrix,c as viewNormal,f as viewport};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as r,subclass as t}from"../../../../core/accessorSupport/decorators.js";import{InternalRenderCategory as s}from"../../webgl.js";import i from"../../webgl/RenderNode.js";import{distanceFadeEnd as o}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";let a=class extends i{constructor(){super(...arguments),this.consumes={required:["normals"]},this.produces="disabled"}get enabled(){return!this.destroying&&!this.destroyed&&this.produces===s.AMBIENT_ILLUMINATION}get _belowMaxElevation(){return(this.view.state.camera.relativeElevation??1/0)<o}get _useGlobalIllumination(){return this._belowMaxElevation&&this.view.stage.renderer.isFeatureEnabled(11)}get _useSSAO(){return this._belowMaxElevation&&this.view.stage.renderer.isFeatureEnabled(3)}_enable(){this.produces=s.AMBIENT_ILLUMINATION,this.requestRender(1)}_disable(){this.produces="disabled",this.requestRender(1)}};e([r()],a.prototype,"consumes",void 0),e([r()],a.prototype,"produces",void 0),a=e([t("esri.views.3d.webgl-engine.effects.AmbientIllumination")],a);export{a as AmbientIllumination};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../core/shaderLibrary/Transform.glsl.js";import"../../core/shaderLibrary/shading/MainLighting.glsl.js";import"../../core/
|
|
2
|
+
import"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../core/shaderLibrary/Transform.glsl.js";import"../../core/shaderLibrary/shading/MainLighting.glsl.js";import"../../core/shaderLibrary/util/cameraUniforms.js";import"../../core/shaderModules/Float2PassUniform.js";import"../../core/shaderModules/Float3BindUniform.js";import"../../core/shaderModules/Float3PassUniform.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"../../../../webgl/NoParameters.js";import"../../../../webgl/ShaderBuilder.js";export{b as SilhouetteCircle,S as SimpleAtmospherePassParameters,c as build}from"../../../../../chunks/SimpleAtmosphere.glsl.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../../core/shaderLibrary/shading/
|
|
2
|
+
import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderLibrary/shading/PiUtils.glsl.js";import"../../core/shaderLibrary/util/CloudsParallaxShading.glsl.js";import"../../core/shaderLibrary/util/ColorConversion.glsl.js";import"../../core/shaderModules/Float3BindUniform.js";import"../../core/shaderModules/FloatBindUniform.js";import"../../core/shaderModules/glsl.js";import"../../shaders/ScreenSpacePassAtmosphere.glsl.js";import"../../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../../chunks/CloudsComposition.glsl.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/output/ReadDepthLastFrame.glsl.js";import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderLibrary/shading/MainLighting.glsl.js";import"../../core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js";import"../../core/shaderLibrary/util/CameraSpace.glsl.js";import"../../core/shaderModules/FloatBindUniform.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Matrix4BindUniform.js";import"../../core/shaderModules/Texture2DBindUniform.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"./GlobalIlluminationColorQuantization.glsl.js";import"../../shaders/floatBlendScale.glsl.js";import"../../../../webgl/enums.js";import"../../../../webgl/NoParameters.js";import"../../../../webgl/ShaderBuilder.js";export{G as GlobalIlluminationPassParameters,c as build,e as defaultColorBleedWeight,d as defaultRayMarchMaxReach,f as defaultRayMarchMaxReachEmissionWeight,b as defaultRayMarchMaxSteps,g as defaultRayMarchMinReach,h as defaultRayMarchMinReachEmissionWeight,i as defaultRayMarchWorldReach}from"../../../../../chunks/GlobalIllumination.glsl.js";
|
|
2
|
+
import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/output/ReadDepthLastFrame.glsl.js";import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderLibrary/shading/MainLighting.glsl.js";import"../../core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js";import"../../core/shaderLibrary/util/CameraSpace.glsl.js";import"../../core/shaderLibrary/util/cameraUniforms.js";import"../../core/shaderModules/FloatBindUniform.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Matrix4BindUniform.js";import"../../core/shaderModules/Texture2DBindUniform.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"./GlobalIlluminationColorQuantization.glsl.js";import"../../shaders/floatBlendScale.glsl.js";import"../../../../webgl/enums.js";import"../../../../webgl/NoParameters.js";import"../../../../webgl/ShaderBuilder.js";export{G as GlobalIlluminationPassParameters,c as build,e as defaultColorBleedWeight,d as defaultRayMarchMaxReach,f as defaultRayMarchMaxReachEmissionWeight,b as defaultRayMarchMaxSteps,g as defaultRayMarchMinReach,h as defaultRayMarchMinReachEmissionWeight,i as defaultRayMarchWorldReach}from"../../../../../chunks/GlobalIllumination.glsl.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{releaseMaybe as t}from"../../../../../core/maybe.js";import{watch as s,syncAndInitial as
|
|
2
|
+
import{__decorate as e}from"tslib";import{releaseMaybe as t}from"../../../../../core/maybe.js";import{watch as s,syncAndInitial as a}from"../../../../../core/reactiveUtils.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{set as i}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{UNIT_W as l,ZEROS as o}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as u}from"../../../webgl.js";import{AmbientIllumination as n}from"../AmbientIllumination.js";import{G as m}from"../../../../../chunks/GlobalIllumination.glsl.js";import{G as h}from"../../../../../chunks/GlobalIlluminationBlur.glsl.js";import{GlobalIlluminationBlurTechnique as c}from"./GlobalIlluminationBlurTechnique.js";import{GlobalIlluminationTechnique as p}from"./GlobalIlluminationTechnique.js";import{GlobalIlluminationTechniqueConfiguration as _}from"./GlobalIlluminationTechniqueConfiguration.js";import{G as d}from"../../../../../chunks/GlobalIlluminationUpscale.glsl.js";import{GlobalIlluminationUpscaleTechnique as f}from"./GlobalIlluminationUpscaleTechnique.js";import{DepthStencilAttachment as b,ColorAttachment1 as g}from"../../../../webgl/enums.js";const w=1,P=100;let x=class extends n{constructor(e){super(e),this._passParameters=new m,this._drawParameters=new h,this._drawParametersUpscale=new d,this._maxFrames=256,this._lowQualityResolutionScale=.35,this._configuration=new _,this._lastOutput=null,this._isGlobalIlluminationUpdate=!1,this._resetBuffer=!1}initialize(){this.addHandles(s(()=>this._mode,e=>{0===e?this._disable():this._enable()},a))}destroy(){this._lastOutput=t(this._lastOutput)}_disable(){super._disable(),this._resetAccumulation(),this._passParameters.temporalSampleFrame=0}get hasHighQuality(){return 2===this._mode}resetAccumulation(){this._isGlobalIlluminationUpdate||!(this._passParameters.accumulatedFrames>P)&&this._configuration.hasEmission||this._resetAccumulation()}precompile(){this.techniques.getCompiled(f)}render(e){if(this._passParameters.accumulatedFrames>=this._maxFrames)return this._lastOutput?.retain(),this._lastOutput;const t=e.find(({name:e})=>"normals"===e),s=t?.getTexture(),a=t?.getTexture(b),r=this._mode;if(!s||!a)return this._emptyOutput;if(0===r)return this._resetBuffer=!1,this._emptyOutput;if(!this._canRender)return this._resetBuffer=!1,this._requestRender(),this._emptyOutput;const l=this.bindParameters;this._configuration.hasEmission=!!l.reprojection.lastFrameEmission;const o=this.techniques.getCompiled(p,this._configuration),n=this.techniques.getCompiled(c),m=1===r,h=m?this._lowQualityResolutionScale:1,_=m?this.techniques.getCompiled(f):null;if(!o||!n||m&&!_)return this._requestRender(),this._emptyOutput;const d=this.renderingContext,{camera:P}=l;this._passParameters.normalTexture=s,this._passParameters.depthTexture=a,this._passParameters.projScale=1/P.computeScreenPixelSizeAtDist(1),this._passParameters.scaleGlobalIllumination=h;const{fullWidth:x,fullHeight:I}=P,T=Math.max(1,Math.floor(x*h)),q=Math.max(1,Math.floor(I*h)),F=this.fboCache.acquire(T,q,"global illumination input").acquireColor(g,2);d.bindFramebuffer(F.fbo),d.setViewport(0,0,T,q),d.bindTechnique(o,l,this._passParameters,this._drawParameters),d.screen.draw();const O=F.obtainAttachment(g),C=Math.max(1,Math.round(T/w)),j=Math.max(1,Math.round(q/w)),G=this.fboCache.acquire(C,j,"global illumination blur horizontal");d.bindFramebuffer(G.fbo),this._drawParameters.texture=F.getTexture(),this._drawParameters.weightTexture=O.attachment,i(this._drawParameters.blurSize,0,w/q),d.bindTechnique(n,l,this._passParameters,this._drawParameters),d.setViewport(0,0,C,j),d.screen.draw(),F.release();const S=m?"global illumination blur vertical":u.AMBIENT_ILLUMINATION,y=this.fboCache.acquire(C,j,S);d.bindFramebuffer(y.fbo),d.setViewport(0,0,C,j),d.setClearColor(1,1,1,0),d.clear(16384),this._drawParameters.texture=G.getTexture(),this._drawParameters.weightTexture=O.attachment,i(this._drawParameters.blurSize,w/C,0),d.bindTechnique(n,l,this._passParameters,this._drawParameters),d.setViewport(0,0,C,j),d.screen.draw(),G.release(),y.attachColor(O,g),O.release();let M=y;return _&&(M=this.fboCache.acquire(x,I,u.AMBIENT_ILLUMINATION).acquireColor(g,2),d.bindFramebuffer(M.fbo),d.setViewport(0,0,x,I),d.setClearColor(1,1,1,0),d.clear(16384),this._drawParametersUpscale.colorTexture=y.getTexture(),this._drawParametersUpscale.weightTexture=y.getTexture(g),d.bindTechnique(_,l,this._passParameters,this._drawParametersUpscale),d.screen.draw(),y.release()),d.setViewport4fv(P.fullViewport),this._passParameters.temporalSampleFrame=(this._passParameters.temporalSampleFrame+1)%64,++this._passParameters.accumulatedFrames,this._storeOutput(M),this._passParameters.accumulatedFrames<this._maxFrames&&this._requestRender(),M}_requestRender(){this._isGlobalIlluminationUpdate=!0,this.requestRender(1),this._isGlobalIlluminationUpdate=!1}_storeOutput(e){this._lastOutput!==e&&(this._lastOutput=t(this._lastOutput),this._lastOutput=e,this._lastOutput.retain())}get _emptyOutput(){const e=this.renderingContext,{fullWidth:t,fullHeight:s}=this.bindParameters.camera,a=this.fboCache.acquire(t,s,u.AMBIENT_ILLUMINATION).acquireColor(g,2);return e.bindFramebuffer(a.fbo),e.setViewport(0,0,t,s),e.clearBuffer(0,l),e.clearBuffer(1,o),a}get _canRender(){const{reprojection:e,hasEmission:t,globalIllumination:s}=this.bindParameters;return!(!e.lastFrameColor||t&&!e.lastFrameEmission||!e.lastFrameDepth||!s||this._resetBuffer)}get _mode(){return this._useGlobalIllumination?this.view.stage.renderer.isFeatureEnabled(10)?2:1:0}_resetAccumulation(){this._passParameters.accumulatedFrames=0,this._lastOutput=t(this._lastOutput)}get test(){const e=this;return{passParameters:this._passParameters,configuration:this._configuration,get maxFrames(){return e._maxFrames},set maxFrames(t){e._maxFrames=t},get lowQualityResolutionScale(){return e._lowQualityResolutionScale},set lowQualityResolutionScale(t){e._lowQualityResolutionScale=t},get mode(){return e._mode}}}};x=e([r("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIllumination")],x);export{x as GlobalIllumination,w as blurSizePixels};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../../../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../../../../../core/libs/gl-matrix-2/math/vec2.js";import"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../core/shaderLibrary/Laserline.glsl.js";import"../../core/shaderLibrary/util/blendEmission.glsl.js";import"../../core/
|
|
2
|
+
import"../../../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../../../../../core/libs/gl-matrix-2/math/vec2.js";import"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../core/shaderLibrary/Laserline.glsl.js";import"../../core/shaderLibrary/util/blendEmission.glsl.js";import"../../core/shaderLibrary/util/cameraUniforms.js";import"../../core/shaderModules/Float2BindUniform.js";import"../../core/shaderModules/FloatBindUniform.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Matrix4PassUniform.js";import"../../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../../chunks/LaserlinePath.glsl.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../../../../../core/libs/gl-matrix-2/math/vec3.js";import"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../core/
|
|
2
|
+
import"../../../../../core/libs/gl-matrix-2/math/vec3.js";import"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../core/shaderLibrary/util/cameraUniforms.js";import"../../core/shaderModules/Float3BindUniform.js";import"../../core/shaderModules/Float3PassUniform.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../../chunks/Precipitation.glsl.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{clamp as r}from"../../../../../core/mathUtils.js";import{disposeMaybe as t}from"../../../../../core/maybe.js";import{watch as s,syncAndInitial as i}from"../../../../../core/reactiveUtils.js";import{Milliseconds as a}from"../../../../../core/time.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{set as
|
|
2
|
+
import{__decorate as e}from"tslib";import{clamp as r}from"../../../../../core/mathUtils.js";import{disposeMaybe as t}from"../../../../../core/maybe.js";import{watch as s,syncAndInitial as i}from"../../../../../core/reactiveUtils.js";import{Milliseconds as a}from"../../../../../core/time.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{set as m}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{InternalRenderCategory as n}from"../../../webgl.js";import{distanceFadeEnd as h,distanceFadeStart as p}from"../../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{AmbientIllumination as c}from"../AmbientIllumination.js";import{g as l}from"../../../../../chunks/SSAO.glsl.js";import{SSAOBlurTechnique as u}from"./SSAOBlurTechnique.js";import{noiseData as d}from"./SSAONoiseData.js";import{SSAOPassParameters as f,BlurDrawParameters as b}from"./SSAOParameters.js";import{SSAOTechnique as w}from"./SSAOTechnique.js";import{DepthStencilAttachment as _}from"../../../../webgl/enums.js";import T from"../../../../webgl/Texture.js";import{TextureDescriptor as S}from"../../../../webgl/TextureDescriptor.js";const P=2;let x=class extends c{constructor(e){super(e),this._enableTime=a(0),this._passParameters=new f,this._drawParameters=new b}initialize(){const e=Uint8Array.from(atob(d),e=>e.charCodeAt(0)),r=new S(32);r.wrapMode=33071,r.pixelFormat=6407,r.wrapMode=10497,r.hasMipmap=!0,this._passParameters.noiseTexture=new T(this.renderingContext,r,e),this.addHandles(s(()=>this._useSSAO,e=>{this._enableTime=a(0),e?this._enable():this._disable()},i))}destroy(){this._passParameters.noiseTexture=t(this._passParameters.noiseTexture)}render(e){const t=e.find(({name:e})=>"normals"===e),s=t?.getTexture(),i=t?.getTexture(_);if(!s||!i)return;const o=this.techniques.getCompiled(w),c=this.techniques.getCompiled(u);if(!o||!c)return this._enableTime=a(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=a(performance.now()));const d=this.renderingContext,f=this.view.qualitySettings.fadeDuration,b=this.bindParameters,T=b.camera,S=T.relativeElevation,x=r((h-S)/(h-p),0,1),j=f>0?Math.min(f,performance.now()-this._enableTime)/f:1,q=j*x;this._passParameters.normalTexture=s,this._passParameters.depthTexture=i,this._passParameters.projScale=1/T.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*g/l(T)**6*q;const A=T.fullViewport[2],C=T.fullViewport[3],v=this.fboCache.acquire(A,C,"ssao input",2);d.bindFramebuffer(v.fbo),d.setViewport(0,0,A,C),d.bindTechnique(o,b,this._passParameters,this._drawParameters),d.screen.draw();const M=Math.round(A/P),O=Math.round(C/P),V=this.fboCache.acquire(M,O,"ssao blur",0);d.bindFramebuffer(V.fbo),this._drawParameters.colorTexture=v.getTexture(),m(this._drawParameters.blurSize,0,P/C),d.bindTechnique(c,b,this._passParameters,this._drawParameters),d.setViewport(0,0,M,O),d.screen.draw(),v.release();const y=this.fboCache.acquire(M,O,n.AMBIENT_ILLUMINATION,0);return d.bindFramebuffer(y.fbo),d.setViewport(0,0,A,C),d.setClearColor(1,1,1,0),d.clear(16384),this._drawParameters.colorTexture=V.getTexture(),m(this._drawParameters.blurSize,P/A,0),d.bindTechnique(c,b,this._passParameters,this._drawParameters),d.setViewport(0,0,M,O),d.screen.draw(),d.setViewport4fv(T.fullViewport),V.release(),j<1&&this.requestRender(2),y}};x=e([o("esri.views.3d.webgl-engine.effects.ssao.SSAO")],x);const g=.5;export{x as SSAO,P as blurSizePixels};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"
|
|
2
|
+
import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderLibrary/util/cameraUniforms.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Matrix4PassUniform.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"../../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../../chunks/DeepSky.glsl.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../../../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../../core/
|
|
2
|
+
import"../../../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../../core/shaderLibrary/util/cameraUniforms.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Matrix4PassUniform.js";import"../../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../../chunks/Stars.glsl.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{VisualVariablesParameters as t}from"../../layers/support/FastSymbolUpdates.js";import{computeAttachmentOriginLines as s}from"./geometryDataUtils.js";import{Material as i}from"./Material.js";class r extends t{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1,this.worldSized=!1}}class e extends i{constructor(){super(...arguments),this.primitiveVertexCount=1}updateConfiguration(t){super.updateConfiguration(t),this._configuration.draped=18===t.slot,this._configuration.worldSized=this._configuration.draped&&this.parameters.worldSized,this._configuration.emissionSource=this.emissions?1:0,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.hasOccludees=t.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded}computeAttachmentOrigin(t,i,r){return s(t,i,r,this._isClosed(r))}_isClosed(t){return(this.parameters.isClosed??!1)&&t>2}}export{e as LineMaterial,r as LineMaterialParameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../../../../core/has.js";import t from"../../../../core/Logger.js";import{debugFlags as r}from"../../support/debugFlags.js";import{webglDebugEnabled as e}from"../../../webgl/checkWebGLError.js";class i{constructor(r,i,s){this._context=r,this.locations=s,this._textures=new Map,this.source=e()?i:null,i.attributeNames.forEach(r=>{s.has(r)||t.getLogger("esri.views.3d.webgl-engine.lib.Program").error(`Missing VertexAttributeLocation for ${r} used in shader`)}),this._glProgram=r.programCache.get(i.generate("vertex",!0),i.generate("fragment",!0),s),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bind=i.generateBind(this),this.bindPass=i.generateBindPass(this),this.bindDraw=i.generateBindDraw(this)}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(t,r){this._glProgram.setUniform1i(t,r?1:0)}setUniform1i(t,r){this._glProgram.setUniform1i(t,r)}setUniform1f(t,r,e){this._glProgram.setUniform1f(t,r,e)}setUniform2fv(t,r,e){this._glProgram.setUniform2fv(t,r,e)}setUniform3fv(t,r,e){this._glProgram.setUniform3fv(t,r,e)}setUniform4fv(t,r,e){this._glProgram.setUniform4fv(t,r,e)}setUniformMatrix3fv(t,r,e){this._glProgram.setUniformMatrix3fv(t,r,!1,e)}setUniformMatrix4fv(t,r,e){this._glProgram.setUniformMatrix4fv(t,r,!1,e)}setUniformMatrices4fv(t,r,e){this._glProgram.setUniformMatrices4fv(t,r,!1,e)}setUniform1fv(t,r,e){this._glProgram.setUniform1fv(t,r,e)}setUniform1iv(t,r){this._glProgram.setUniform1iv(t,r)}setUniform2iv(t,r){this._glProgram.setUniform2iv(t,r)}setUniform3iv(t,r){this._glProgram.setUniform3iv(t,r)}setUniform4iv(t,r){this._glProgram.setUniform4iv(t,r)}assertCompatibleVertexAttributeLocations(t,e){if(r.ENABLE_OPTIMIZATIONS)return;let i=t.locations;if(e){const t=new Map(i);e.forEach((r,e)=>t.set(e,i.size+r)),i=t}i.size!==this.locations.size&&console.error(`VertexAttributeLocations are incompatible: ${i}
|
|
2
|
+
import"../../../../core/has.js";import t from"../../../../core/Logger.js";import{debugFlags as r}from"../../support/debugFlags.js";import{webglDebugEnabled as e}from"../../../webgl/checkWebGLError.js";class i{constructor(r,i,s){this._context=r,this.locations=s,this._textures=new Map,this.source=e()?i:null,i.attributeNames.forEach(r=>{s.has(r)||t.getLogger("esri.views.3d.webgl-engine.lib.Program").error(`Missing VertexAttributeLocation for ${r} used in shader`)}),this._glProgram=r.programCache.get(i.generate("vertex",!0),i.generate("fragment",!0),s),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bind=i.generateBind(this),this.bindPass=i.generateBindPass(this),this.bindDraw=i.generateBindDraw(this)}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(t,r){this._glProgram.setUniform1i(t,r?1:0)}setUniform1i(t,r){this._glProgram.setUniform1i(t,r)}setUniform1f(t,r,e){this._glProgram.setUniform1f(t,r,e)}setUniform2fv(t,r,e){this._glProgram.setUniform2fv(t,r,e)}setUniform3fv(t,r,e){this._glProgram.setUniform3fv(t,r,e)}setUniform4fv(t,r,e){this._glProgram.setUniform4fv(t,r,e)}setUniformMatrix3fv(t,r,e){this._glProgram.setUniformMatrix3fv(t,r,!1,e)}setUniformMatrix4fv(t,r,e){this._glProgram.setUniformMatrix4fv(t,r,!1,e)}setUniformMatrices4fv(t,r,e){this._glProgram.setUniformMatrices4fv(t,r,!1,e)}setUniform1fv(t,r,e){this._glProgram.setUniform1fv(t,r,e)}setUniform1iv(t,r){this._glProgram.setUniform1iv(t,r)}setUniform2iv(t,r){this._glProgram.setUniform2iv(t,r)}setUniform3iv(t,r){this._glProgram.setUniform3iv(t,r)}setUniform4iv(t,r){this._glProgram.setUniform4iv(t,r)}assertCompatibleVertexAttributeLocations(t,e){if(r.ENABLE_OPTIMIZATIONS)return;let i=t.locations;if(e){const t=new Map(i);e.forEach((r,e)=>t.set(e,i.size+r)),i=t}i.size!==this.locations.size&&console.error(`VertexAttributeLocations are incompatible: ${Array.from(i.keys())} vs ${Array.from(this.locations.keys())}`),this.locations.forEach((t,r)=>{i.get(r)!==t&&console.error(`VertexAttributeLocations are incompatible: Program has ${r} at position ${t}, VAO has it at position ${i.get(r)}.`)})}stop(){this._textures.clear()}bindTexture(t,r,i){if(!r?.glName){const i=`Texture sampler ${t} in ${this._context.debugBoundTechnique} has no given Texture in ${(new Error).stack}`;e()&&console.error(i),r=this._context.emptyTexture}const s=this._ensureTextureUnit(t,r);this._context.useProgram(this);const o=s.unit;this.setUniform1i(t,o),this._context.bindTexture(r,o,!1,i)}_ensureTextureUnit(t,r){let e=this._textures.get(t);return null==e?(e={texture:r,unit:this._textures.size},this._textures.set(t,e)):e.texture=r,e}}export{i as Program};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import has from"../../../../core/has.js";import{NestedMap as e}from"../../../../core/NestedMap.js";function t(t){const i=new e;if(i.set(2,4,!0),i.set(2,0,!0),i.set(2,2,!0),i.set(2,1,!0),i.set(2,8,!0),"high"
|
|
2
|
+
import has from"../../../../core/has.js";import{NestedMap as e}from"../../../../core/NestedMap.js";function t(t){const i=new e;if(i.set(2,4,!0),i.set(2,0,!0),i.set(2,2,!0),i.set(2,1,!0),i.set(2,8,!0),"high"===t){const e=has("disable-feature:global-illumination")?3:11;i.set(0,e,!0),i.set(1,e,!0),i.set(2,e,!0),11===e&&i.set(2,10,!0)}else i.set(2,3,!0);if("low"!==t&&(i.set(2,5,!0),i.set(2,6,!0)),"medium"===t)for(const e of s)i.set(0,e,!0),i.set(1,e,!0),i.set(2,e,!0);else if("high"===t)for(const e of o)i.set(0,e,!0),i.set(1,e,!0),i.set(2,e,!0);return i}const s=[9,7],o=[...s,0,2,4];export{t as setupFeatureDefaults};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{fromValues as o}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{
|
|
2
|
+
import{fromValues as o}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{projMatrix as r}from"../../core/shaderLibrary/util/cameraUniforms.js";import{IsNaN as e}from"../../core/shaderLibrary/util/IsNaN.glsl.js";import{Float2BindUniform as a}from"../../core/shaderModules/Float2BindUniform.js";import{glsl as s}from"../../core/shaderModules/glsl.js";import{Matrix3PassUniform as t}from"../../core/shaderModules/Matrix3PassUniform.js";import{Matrix4BindUniform as l}from"../../core/shaderModules/Matrix4BindUniform.js";const i=o(.5,-4e-4);function c(o,c){const m=o.vertex;m.include(e),m.constants.add("depthBias","vec2",i),m.uniforms.add(new a("inverseViewport",o=>o.inverseViewport)),c.legacy?(m.uniforms.add(r),m.code.add(s`vec2 calculateProjectedBiasXY(vec4 projPos, vec3 globalNormal) {
|
|
3
3
|
float offsetXY = depthBias.x;
|
|
4
4
|
vec4 projNormal = proj * localView * vec4(globalNormal, 0.0);
|
|
5
5
|
return offsetXY * projPos.w * 2.0 * inverseViewport * normalize(projNormal.xyz).xy;
|
|
6
|
-
}`)):(
|
|
6
|
+
}`)):(m.uniforms.add(new t("transformNormalViewFromGlobal",o=>o.transformNormalViewFromGlobal),new l("transformProjFromView",o=>o.camera.projectionMatrix)),m.code.add(s`vec2 calculateProjectedBiasXY(vec4 projPos, vec3 globalNormal) {
|
|
7
7
|
float offsetXY = depthBias.x;
|
|
8
8
|
vec4 projNormal = transformProjFromView * vec4(transformNormalViewFromGlobal * globalNormal, 0.0);
|
|
9
9
|
return offsetXY * projPos.w * 2.0 * inverseViewport * normalize(projNormal.xyz).xy;
|
|
10
|
-
}`)),
|
|
10
|
+
}`)),m.code.add(s`float _calculateProjectedBiasZ(vec4 projPos) {
|
|
11
11
|
float offsetZ = depthBias.y;
|
|
12
12
|
return sqrt(max(projPos.z,0.0)) * offsetZ;
|
|
13
13
|
}
|
|
@@ -18,4 +18,4 @@ projPos.xy += offsetXY;
|
|
|
18
18
|
}
|
|
19
19
|
projPos.z += _calculateProjectedBiasZ(projPos);
|
|
20
20
|
return projPos;
|
|
21
|
-
}`)}export{
|
|
21
|
+
}`)}export{c as AdjustProjectedPosition};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../../../../../core/libs/gl-matrix-2/math/vec2.js";import"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../core/shaderLibrary/Slice.glsl.js";import"../../core/
|
|
2
|
+
import"../../../../../core/libs/gl-matrix-2/math/vec2.js";import"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../core/shaderLibrary/Slice.glsl.js";import"../../core/shaderLibrary/util/cameraUniforms.js";import"../../core/shaderModules/Float2BindUniform.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"./AdjustProjectedPosition.glsl.js";import"./DiscardNonSilhouetteEdges.glsl.js";import"./EdgeUtil.glsl.js";import"./LineAmplitude.glsl.js";import"./LineOffset.glsl.js";import"./UnpackAttributes.glsl.js";import"../../../../webgl/ShaderBuilder.js";import"../../../../webgl/Uniform.js";export{b as build}from"../../../../../chunks/EdgeShader.glsl.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{safeToString as e}from"../../../../core/string.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import i from"../lib/GLMaterial.js";import{LineMaterial as s
|
|
2
|
+
import{safeToString as e}from"../../../../core/string.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import i from"../lib/GLMaterial.js";import{LineMaterial as s,LineMaterialParameters as n}from"../lib/LineMaterial.js";import{writeBufferVec2 as a,writePosition as o,writeNormal as c,writeBufferVec3 as l,writeBufferFloat as u}from"./internal/bufferWriterUtils.js";import{LineCalloutTechnique as h,layout as f,baseLayout as p}from"../shaders/LineCalloutTechnique.js";import{LineCalloutTechniqueConfiguration as d}from"../shaders/LineCalloutTechniqueConfiguration.js";import{alphaCutoff as g}from"../../../../webscene/support/AlphaCutoff.js";class m extends s{constructor(e,t){super(e,$),this.intersectRayDraped=void 0,this.intersectScreenPolygonDraped=void 0,this.produces=new Map([[15,e=>r(e)],[16,e=>r(e)]]),this._configuration=new d(t),this._uniqueMaterialIdentifier=S(this.parameters)}passParameters(){return this.parameters}updateConfiguration(e){super.updateConfiguration(e),this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hudDepth=16===e.slot,this._configuration.hudDepthAlignStart=!!this.parameters.hudDepthAlignStart,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane}get visible(){return this.parameters.color[3]>=g||(this.parameters.borderColor?.[3]??0)>=g}intersectRay(){}intersectScreenPolygon(){return null}createGLMaterial(e){return new O(e)}createBufferWriter(){return new b}validateParameters(e){this._uniqueMaterialIdentifier=S(e)}get uniqueMaterialIdentifier(){return this._uniqueMaterialIdentifier}}function S({renderOccluded:t,isDecoration:r,horizontalScreenOffset:i,color:s,size:n,shaderPolygonOffset:a,hudDepthAlignStart:o,centerOffsetUnits:c,hasSlicePlane:l,screenSizePerspective:u,verticalOffset:h,borderColor:f}){return e`${t}:${r}:${i}:[${s}]:${n}:${a}:${o}:${c}:${l}:${null!=u}:{${h?.screenLength}:${h?.minWorldLength}:${h?.maxWorldLength}}:[${f}]`}class O extends i{beginSlot(e){return this.getTechnique(h,e)}}class $ extends n{constructor(){super(...arguments),this.horizontalScreenOffset=0,this.color=t(0,0,0,1),this.size=1,this.shaderPolygonOffset=1e-5,this.hudDepthAlignStart=!1,this.centerOffsetUnits="world",this.hasSlicePlane=!1}}class b{constructor(){this.layout=f,this.baseInstanceLayout=p}elementCount(e){return e.get("position").indices.length}elementCountBaseInstance(e){return e.get("uv0").indices.length}writeBaseInstance(e,t){const{uv0:r}=t;a(e.get("uv0"),r,0)}write(e,t,r,i){if(null==i)return;const{buffer:s,offset:n}=i;o(r.get("position"),e,s.position,n),c(r.get("normal"),t,s.normal,n),l(r.get("centerOffset"),s.centerOffset,n),u(r.get("groundDistance"),s.groundDistance,n)}}export{m as LineCalloutMaterial,$ as Parameters,S as uniqueMaterialIdentifier};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{set as e,equals as t,transformMat4 as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isColor as s,isDepth as a,isColorHighlightOLIDOrDepth as
|
|
2
|
+
import{set as e,equals as t,transformMat4 as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isColor as s,isDepth as a,isColorHighlightOLIDOrDepth as n}from"../core/shaderLibrary/ShaderOutput.js";import o from"../lib/GLMaterial.js";import{LineMaterial as h}from"../lib/LineMaterial.js";import{VisualVariablePassParameters as l}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as c}from"./internal/bufferWriterUtils.js";import{getLayout as m,LineMarkerTechnique as p}from"../shaders/LineMarkerTechnique.js";import{LineMarkerTechniqueConfiguration as u}from"../shaders/LineMarkerTechniqueConfiguration.js";import{alphaCutoff as d}from"../../../../webscene/support/AlphaCutoff.js";class f extends h{constructor(e,t){super(e,_),this.produces=new Map([[2,e=>10===e||s(e)&&8===this.parameters.renderOccluded],[3,e=>a(e)],[10,e=>n(e)&&8===this.parameters.renderOccluded],[11,e=>n(e)&&8===this.parameters.renderOccluded],[4,e=>s(e)],[18,e=>s(e)||10===e]]),this.intersectRayDraped=void 0,this.intersectScreenPolygonDraped=void 0,this._configuration=new u(t)}updateConfiguration(e){super.updateConfiguration(e),this._configuration.hideOnShortSegments=this.parameters.hideOnShortSegments,this._configuration.hasCap=0!==this.parameters.cap,this._configuration.anchor=this.parameters.anchor,this._configuration.hasTip=this.parameters.hasTip,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.worldSpace=this.parameters.worldSpace&&!this._configuration.draped,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective&&!this._configuration.worldSized}get visible(){return this.parameters.color[3]>=d}get emissions(){return this.parameters.emissiveStrength>0?8!==this.parameters.renderOccluded?2:1:0}intersectRay(){}intersectScreenPolygon(){return null}createBufferWriter(){return new v(m(this.parameters),this.parameters)}createGLMaterial(e){return new g(e)}}class g extends o{dispose(){super.dispose(),this._markerTextures?.release(this._markerPrimitive),this._markerPrimitive=null}beginSlot(e){const t=this._material.parameters.markerPrimitive;return t!==this._markerPrimitive&&(this._material.setParameters({markerTexture:this._markerTextures.swap(t,this._markerPrimitive)}),this._markerPrimitive=t),this.getTechnique(p,e)}}class _ extends l{constructor(){super(...arguments),this.width=0,this.color=[1,1,1,1],this.markerPrimitive="arrow",this.markerScale=1,this.placement="end",this.cap=0,this.anchor=0,this.hasTip=!1,this.worldSpace=!1,this.worldSized=!1,this.hideOnShortSegments=!1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.stipplePattern=null,this.markerTexture=null}}class v{constructor(e,t){this.layout=e,this._parameters=t}elementCount(){return"begin-end"===this._parameters.placement?12:6}write(i,s,a,n){if(null==n)return;const{buffer:o,offset:h}=n,l=a.get("position").data,m=l.length/3;let p=[1,0,0];const u=a.get("normal");this._parameters.worldSpace&&null!=u&&(p=u.data);let d=1,f=0;this._parameters.vvSize?f=a.get("sizeFeatureAttribute").data[0]:a.has("size")&&(d=a.get("size").data[0]);let g=[1,1,1,1],_=0;this._parameters.vvColor?_=a.get("colorFeatureAttribute").data[0]:a.has("color")&&(g=a.get("color").data);let v=0;this._parameters.vvOpacity&&(v=a.get("opacityFeatureAttribute").data[0]);const w=new Float32Array(o.buffer),P=new Float16Array(o.buffer),k=new Uint8Array(o.buffer);let T=h*(this.layout.stride/4);const y=w.BYTES_PER_ELEMENT/P.BYTES_PER_ELEMENT,M=4/y,j=(e,t,r,i)=>{w[T++]=e[0],w[T++]=e[1],w[T++]=e[2],c(t,e,P,T*y),T+=M;let s=T*y;if(P[s++]=r[0],P[s++]=r[1],T=Math.ceil(s/y),this._parameters.vvColor)w[T++]=_;else{const e=Math.min(4*i,g.length-4),t=4*T++;k[t]=255*g[e],k[t+1]=255*g[e+1],k[t+2]=255*g[e+2],k[t+3]=255*g[e+3]}this._parameters.vvOpacity&&(w[T++]=v),s=T*y,this._parameters.vvSize?(w[T++]=f,s+=2):P[s++]=d,this._parameters.worldSpace&&(P[s++]=p[0],P[s++]=p[1],P[s++]=p[2]),T=Math.ceil(s/y)},x=(s,a)=>{const n=e(S,l[3*s],l[3*s+1],l[3*s+2]),o=b;let h=s+a;do{e(o,l[3*h],l[3*h+1],l[3*h+2]),h+=a}while(t(n,o)&&h>=0&&h<m);i&&(r(n,n,i),r(o,o,i)),j(n,o,[-1,-1],s),j(n,o,[1,-1],s),j(n,o,[1,1],s),j(n,o,[-1,-1],s),j(n,o,[1,1],s),j(n,o,[-1,1],s)},E=this._parameters.placement;"begin"!==E&&"begin-end"!==E||x(0,1),"end"!==E&&"begin-end"!==E||x(m-1,-1)}}const S=i(),b=i();export{f as LineMarkerMaterial,_ as Parameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{set as t,normalize as e,subtract as r,cross as s,distance as o,transformMat4 as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as
|
|
2
|
+
import{set as t,normalize as e,subtract as r,cross as s,distance as o,transformMat4 as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as c}from"../core/shaderLibrary/ShaderOutput.js";import l from"../lib/GLMaterial.js";import{LineMaterial as u,LineMaterialParameters as p}from"../lib/LineMaterial.js";import{MeasurementArrowTechnique as f,layout as h}from"../shaders/MeasurementArrowTechnique.js";import{MeasurementArrowTechniqueConfiguration as m}from"../shaders/MeasurementArrowTechniqueConfiguration.js";import{alphaCutoff as d}from"../../../../webscene/support/AlphaCutoff.js";class g extends u{constructor(t,e){super(t,b),this.intersectRayDraped=void 0,this.intersectScreenPolygonDraped=void 0,this.produces=new Map([[2,t=>!this._transparent&&c(t)],[8,t=>this._transparent&&c(t)]]),this._configuration=new m(e)}updateConfiguration(t){super.updateConfiguration(t),this._configuration.enableOITOffset=t.enableOITOffset,this._configuration.transparent=this._transparent,this._configuration.writeDepth=2===t.slot}get visible(){const{outlineColor:t,stripeEvenColor:e,stripeOddColor:r}=this.parameters;return t[3]>=d||e[3]>=d||r[3]>=d}intersectRay(){}intersectScreenPolygon(){return null}createGLMaterial(t){return new C(t)}createBufferWriter(){return new _}get _transparent(){const{parameters:t}=this;return t.outlineColor[3]<1||t.stripeEvenColor[3]<1||t.stripeOddColor[3]<1}}class C extends l{beginSlot(t){return this.getTechnique(f,t)}}class b extends p{constructor(){super(...arguments),this.width=32,this.outlineSize=.2,this.outlineColor=a(1,.5,0,1),this.stripeEvenColor=a(1,1,1,1),this.stripeOddColor=a(1,.5,0,1),this.stripeLength=1}}const w=n(),v=n(),j=n(),M=n(),O=n();class _{constructor(){this.layout=h}elementCount(t){return 2*(t.get("position").indices.length/2+1)}write(n,a,c,l){if(null==l)return;const{buffer:u,offset:p}=l,{data:f,indices:h}=c.get("position"),m=c.get("normal").data,d=f.length/3;h&&h.length!==2*(d-1)&&console.warn("MeasurementArrowMaterial does not support indices");const g=w,C=v,b=j,_=M,x=O,y=u.position,L=u.normal,S=u.uv0;let T=0;for(let w=0;w<d;++w){const c=3*w;if(t(g,f[c],f[c+1],f[c+2]),w<d-1){const o=3*(w+1);t(C,f[o],f[o+1],f[o+2]),t(x,m[o],m[o+1],m[o+2]),e(x,x),r(b,C,g),e(b,b),s(_,x,b),e(_,_)}const l=o(g,C);n&&a&&(i(g,g,n),i(C,C,n),i(_,_,a));const u=p+2*w,h=u+1;y.setVec(u,g),y.setVec(h,g),L.setVec(u,_),L.setVec(h,_),S.set(u,0,T),S.set(u,1,-1),S.set(h,0,T),S.set(h,1,1),w<d-1&&(T+=l)}const A=u.length;for(let t=0;t<2*d;++t)A.set(p+t,T)}}export{g as MeasurementArrowMaterial,b as Parameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Logger.js";import{clamp as r}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as t,createScreenPointArray as o}from"../../../../core/screenUtils.js";import{copy as i,set as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as a,subtract as c,dot as l,scale as f,add as m,copy as u,length as p,distance as g}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as d}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{distance2 as j,fromPoints as b,closestLineSegmentPoint as y,projectPoint as v,create as x}from"../../../../geometry/support/lineSegment.js";import{fromPoints as L,signedDistance as S,getNormal as
|
|
2
|
+
import e from"../../../../core/Logger.js";import{clamp as r}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as t,createScreenPointArray as o}from"../../../../core/screenUtils.js";import{copy as i,set as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as a,subtract as c,dot as l,scale as f,add as m,copy as u,length as p,distance as g}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as d}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{distance2 as j,fromPoints as b,closestLineSegmentPoint as y,projectPoint as v,create as x}from"../../../../geometry/support/lineSegment.js";import{fromPoints as L,signedDistance as S,getNormal as w,create as M}from"../../../../geometry/support/plane.js";import{isColorHighlightOrOLID as P}from"../core/shaderLibrary/ShaderOutput.js";import T from"../lib/GLMaterial.js";import{LineMaterial as C,LineMaterialParameters as R}from"../lib/LineMaterial.js";import{projectWorldLineSegmentToRenderScreen as V,screenPolygonIntersectsBufferedSegment as A}from"../lib/screenPolygonOverlapUtils.js";import{Hit as N,DrapedHit as U}from"../lib/screenPolygonTriangleIntersections.js";import{isTranslationMatrix as _}from"../lib/Util.js";import{DefaultBufferWriter as D}from"./DefaultBufferWriter.js";import{PositionColorLayout as E,PositionLayout as q}from"./DefaultLayouts.js";import{NativeLineTechnique as B}from"../shaders/NativeLineTechnique.js";import{NativeLineTechniqueConfiguration as X}from"../shaders/NativeLineTechniqueConfiguration.js";import{alphaCutoff as F}from"../../../../webscene/support/AlphaCutoff.js";class G extends C{constructor(e){super(e,k),this._configuration=new X(!0),this.produces=new Map([[2,e=>P(e)]])}updateConfiguration(e){super.updateConfiguration(e),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.transparent=this.parameters.color[3]<1||this.parameters.width<1}get visible(){return this.parameters.color[3]>=F}intersectRay(r,t,o,s,n,h){const{options:d,camera:v,rayBegin:x,rayEnd:M}=o;if(!d.selectionMode||!r.visible||!v)return;if(!_(t))return void e.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix");const P=r.attributes.get("position").data,T=oe;i(T,o.point);const C=ge*v.pixelRatio;a(ce[0],T[0]-C,T[1]+C,0),a(ce[1],T[0]+C,T[1]+C,0),a(ce[2],T[0]+C,T[1]-C,0),a(ce[3],T[0]-C,T[1]-C,0);for(let e=0;e<4;e++)if(!v.unprojectFromRenderScreen(ce[e],le[e]))return;L(v.eye,le[0],le[1],fe),L(v.eye,le[1],le[2],me),L(v.eye,le[2],le[3],ue),L(v.eye,le[3],le[0],pe);let R=Number.MAX_VALUE,V=0;for(const e of O(H,J,P,t)){if(S(fe,H)<0&&S(fe,J)<0||S(me,H)<0&&S(me,J)<0||S(ue,H)<0&&S(ue,J)<0||S(pe,H)<0&&S(pe,J)<0)continue;const r=v.projectToRenderScreen(H,Y),t=v.projectToRenderScreen(J,Z);if(null==r||null==t)continue;if(r[2]<0&&t[2]>0){c(K,H,J);const e=v.frustum,t=-S(e[4],H)/l(K,w(e[4]));if(f(K,K,t),m(H,H,K),!v.projectToRenderScreen(H,r))continue}else if(r[2]>0&&t[2]<0){c(K,J,H);const e=v.frustum,r=-S(e[4],J)/l(K,w(e[4]));if(f(K,K,r),m(J,J,K),!v.projectToRenderScreen(J,t))continue}else if(r[2]<0&&t[2]<0)continue;r[2]=0,t[2]=0;const o=j(b(r,t,re),T);o<R&&(R=o,u($,H),u(ee,J),V=e)}if(R<C*C){let e=Number.MAX_VALUE;if(y(b($,ee,re),b(x,M,te),Q)){c(Q,Q,x);const r=p(Q);f(Q,Q,1/r),e=r/g(x,M)}h(e,e,Q,V)}}intersectScreenPolygon(r,t,o,i){const{options:s,camera:n,screenPolygonPrimitiveProcessor:a}=o;if(!s.selectionMode||!r.visible)return null;if(!_(t))return e.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix"),null;const c=r.attributes.get("position").data,l=new N(4);for(const e of O(H,J,c,t))for(const[r,t]of a.processLineSegment(he,H,J))V(n,r,t,Y,Z)&&(n.renderToScreen(Y,ie),n.renderToScreen(Z,se),A(i,ie,se,ge)&&(v(b(r,t,te),n.eye,oe),l.updateIfCloserFromValues(g(n.eye,oe),e,oe,null)));return l}intersectRayDraped(e,t,o,i,s,n){if(!t.options.selectionMode)return;const a=o[0],c=o[1],l=W(e,n);let f=Number.MAX_VALUE,m=0;for(const u of z(ne,ae,e)){const e=a-ne[0],t=c-ne[1],o=ae[0]-ne[0],i=ae[1]-ne[1],s=r((o*e+i*t)/(o*o+i*i),0,1),n=o*s-e,l=i*s-t,p=n*n+l*l;p<f&&(f=p,m=u)}f<l*l&&i(s.distance,s.renderDistance,s.normal,m)}intersectScreenPolygonDraped(e,r,t,o,i){if(!t.options.selectionMode)return null;const s=W(e,i);for(const n of z(ne,ae,e,r))if(A(o,ne,ae,s))return new U(n);return null}createGLMaterial(e){return new I(e)}createBufferWriter(){const e=this.parameters.hasVertexColors?E:q;return new D(e)}}class I extends T{beginSlot(e){return this.getTechnique(B,e)}}function*O(e,r,t,o){for(let i=0;i<t.length-5;i+=3)e[0]=t[i]+o[12],e[1]=t[i+1]+o[13],e[2]=t[i+2]+o[14],r[0]=t[i+3]+o[12],r[1]=t[i+4]+o[13],r[2]=t[i+5]+o[14],yield i/3}function W(e,r){const t=e.attributes.get("size");return(((t?t.data[0]:0)+1)/2+4)*r}function*z(e,r,t,o){const n=t.attributes.get("position").data,a=o?.[0]??0,c=o?.[1]??0;s(e,n[0]+a,n[1]+c);for(let l=3;l<n.length-2;l+=3){const t=l%n.length;s(r,n[t]+a,n[t+1]+c),yield l/3,i(e,r)}}class k extends R{constructor(){super(...arguments),this.color=d,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.width=1}}const H=h(),J=h(),K=h(),Q=h(),Y=t(),Z=t(),$=h(),ee=h(),re=x(),te=x(),oe=h(),ie=o(),se=o(),ne=n(),ae=n(),ce=[t(),t(),t(),t()],le=[h(),h(),h(),h()],fe=M(),me=M(),ue=M(),pe=M(),ge=2,he=[h(),h()];export{G as NativeLineMaterial,k as Parameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../core/shaderLibrary/
|
|
2
|
+
import"../core/shaderLibrary/Offset.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import"../core/shaderLibrary/output/OutputDepth.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/Normals.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/util/cameraUniforms.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../effects/snowcover/SnowCover.glsl.js";import"../shaders/OutputColorHighlightOLID.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/Path.glsl.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{isOITColorAlpha as t}from"../core/shaderLibrary/ShaderOutput.js";const n=2,o=1,r=
|
|
2
|
+
import{isOITColorAlpha as t}from"../core/shaderLibrary/ShaderOutput.js";const n=2,o=1,r=p(-1),f=p(1),u={factor:0,units:-10},s=r,c=new Array;c[0]=null,c[1]=f,c[2]=r,c[3]=p(-2),c[4]=p(-3);const e=c.map(t=>i(s,t));function a({output:n,enableOITOffset:o,polygonOffset:r}){return t(n)&&o?e[r]:c[r]}function i(t,n){return n?{factor:t.factor+n.factor,units:t.units+n.units}:t}function p(t){return{factor:o*t,units:n*t}}function l(t){const n=a(t)??{factor:0,units:0};return{factor:n.factor+r.factor*t.polygonOffsetIndex,units:n.units+r.units*t.polygonOffsetIndex}}c[1]=f;export{l as getRibbonLineLayerPolygonOffset,u as lineMarkerPolygonOffset,a as polygonOffset};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as i,createScreenPointArray as r}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as s,Seconds as n}from"../../../../core/time.js";import{copy as a,set as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as c,subtract as p,dot as u,scale as m,add as h,copy as f,length as d,distance as g,lerp as b,transformMat4 as _,normalize as S}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as y}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromPoints as E,distance2 as w,closestLineSegmentPoint as v,projectPoint as x,projectPointFraction as T,create as z}from"../../../../geometry/support/lineSegment.js";import{fromPoints as j,signedDistance as L,getNormal as A,create as C}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as M,BufferViewFloat as V,BufferViewVec4Unorm8 as O,BufferViewVec4f16 as F,BufferViewUint32 as R}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as B,isColor as I,isDepth as U,isColorHighlightOLIDOrDepth as N,is2DGeometryOutput as k}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as W}from"../effects/geometry/olidUtils.js";import D from"../lib/GLMaterial.js";import{LineMaterial as Y}from"../lib/LineMaterial.js";import{projectWorldLineSegmentToRenderScreen as J,screenPolygonIntersectsBufferedSegment as q}from"../lib/screenPolygonOverlapUtils.js";import{Hit as G,DrapedHit as X}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as H}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as K,assert as Q}from"../lib/Util.js";import{isImagePattern as Z}from"./lineStippleUtils.js";import{VisualVariablePassParameters as $}from"./VisualVariablePassParameters.js";import{writeColor as ee}from"./internal/bufferWriterUtils.js";import{n as te}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as ie,getTextureBufferLayout as re}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as se}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as ne}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as ae}from"../../../../webscene/support/AlphaCutoff.js";class oe extends Y{constructor(e,t){super(e,ce),this.produces=new Map([[2,e=>B(e)||I(e)&&8===this.parameters.renderOccluded],[3,e=>U(e)],[10,e=>N(e)&&8===this.parameters.renderOccluded],[11,e=>N(e)&&8===this.parameters.renderOccluded],[4,e=>I(e)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[8,e=>I(e)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[18,e=>k(e)]]),this._configuration=new ne(t)}updateConfiguration(e){super.updateConfiguration(e);const t=18===e.slot,i=null!=this.parameters.stipplePattern&&null!=this.parameters.stippleTexture&&10!==e.output,r=i&&this.parameters.isImagePattern(),s=t&&(this.parameters.worldSized||r);this._configuration.draped=t,this._configuration.shadingEnabled=this.parameters.shadingEnabled,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=i,this._configuration.stippleOffColorEnabled=i&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=i&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=ge(this.parameters.join,i),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&de(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=e.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.pbrMode=this.parameters.shadingEnabled?2:0,this._configuration.emissionSource=this.emissions?1:0,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!s,this._configuration.worldSized=s,this._configuration.imagePattern=r,I(e.output)&&this.parameters.shadingEnabled?(this._configuration.receiveAmbientOcclusion=null!=e.ssao,this._configuration.receiveGlobalIllumination=e.globalIlluminationEnabled):this._configuration.receiveAmbientOcclusion=this._configuration.receiveGlobalIllumination=!1}get visible(){return this.parameters.color[3]>=ae||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>ae}get emissions(){return this.parameters.emissiveStrength>0?8!==this.parameters.renderOccluded?2:1:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped({attributes:e},i,r,s,n,a){if(!i.options.selectionMode)return;const o=this._getLineSize(e,!0),l=r[0],c=r[1],p=he(o,a,this.parameters.worldSized);let u=Number.MAX_VALUE,m=0;for(const h of fe(Pe,ye,this.parameters,e)){const e=l-Pe[0],i=c-Pe[1],r=ye[0]-Pe[0],s=ye[1]-Pe[1],n=t((r*e+s*i)/(r*r+s*s),0,1),a=r*n-e,o=s*n-i,p=a*a+o*o;p<u&&(u=p,m=h)}u<p*p&&s(n.distance,n.renderDistance,n.normal,m)}intersectRay(t,i,r,s,n,o){const{options:l,camera:b,rayBegin:_,rayEnd:S}=r;if(!l.selectionMode||!t.visible||!b)return;if(!K(i))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const P=t.attributes,y=P.get("position").data,x=this._getLineSize(P),T=ze;a(T,r.point);const z=x*b.pixelRatio,C=Ye*b.pixelRatio,M=z/2+C;c(Ie[0],T[0]-M,T[1]+M,0),c(Ie[1],T[0]+M,T[1]+M,0),c(Ie[2],T[0]+M,T[1]-M,0),c(Ie[3],T[0]-M,T[1]-M,0);for(let e=0;e<4;e++)if(!b.unprojectFromRenderScreen(Ie[e],Ue[e]))return;j(b.eye,Ue[0],Ue[1],Ne),j(b.eye,Ue[1],Ue[2],ke),j(b.eye,Ue[2],Ue[3],We),j(b.eye,Ue[3],Ue[0],De);let V=Number.MAX_VALUE,O=0;for(const e of this._forEachTransformedLineSegment(_e,Se,y,i,me(this.parameters,P))){if(L(Ne,_e)<0&&L(Ne,Se)<0||L(ke,_e)<0&&L(ke,Se)<0||L(We,_e)<0&&L(We,Se)<0||L(De,_e)<0&&L(De,Se)<0)continue;const t=b.projectToRenderScreen(_e,je),i=b.projectToRenderScreen(Se,Le);if(null==t||null==i)continue;if(t[2]<0&&i[2]>0){p(xe,_e,Se);const e=b.frustum,i=-L(e[4],_e)/u(xe,A(e[4]));if(m(xe,xe,i),h(_e,_e,xe),!b.projectToRenderScreen(_e,t))continue}else if(t[2]>0&&i[2]<0){p(xe,Se,_e);const e=b.frustum,t=-L(e[4],Se)/u(xe,A(e[4]));if(m(xe,xe,t),h(Se,Se,xe),!b.projectToRenderScreen(Se,i))continue}else if(t[2]<0&&i[2]<0)continue;t[2]=0,i[2]=0;const r=E(t,i,Oe),s=w(r,T);if(!(s>=V)){if(this.parameters.screenSizePerspective){const e=this.computeScreenSizePerspectiveWidth(r,_e,Se,T,b,x,C);if(s>=e*e)continue}V=s,f(Me,_e),f(Ve,Se),O=e}}if(V<M*M){let e=Number.MAX_VALUE;if(v(E(Me,Ve,Oe),E(_,S,Fe),Te)){p(Te,Te,_);const t=d(Te);m(Te,Te,1/t),e=t/g(_,S)}o(e,e,Te,O)}}intersectScreenPolygon(t,i,r,s){const{options:n,camera:a,screenPolygonPrimitiveProcessor:o}=r;if(!n.selectionMode||!t.visible)return null;if(!K(i))return e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix"),null;const l=t.attributes,c=l.get("position").data,p=this._getLineSize(l),u=Ye,m=u*a.pixelRatio,h=new G(4);for(const e of this._forEachTransformedLineSegment(_e,Se,c,i,me(this.parameters,l)))for(const[t,i]of o.processLineSegment(Je,_e,Se)){if(!J(a,t,i,je,Le))continue;const r=E(je,Le,Oe);let n=p/2+u;this.parameters.screenSizePerspective&&(b(ze,je,Le,.5),n=Math.max(n,this.computeScreenSizePerspectiveWidth(r,t,i,ze,a,p,m)/a.pixelRatio)),a.renderToScreen(je,Ae),a.renderToScreen(Le,Ce),q(s,Ae,Ce,n)&&(x(E(t,i,Fe),a.eye,Ee),h.updateIfCloserFromValues(g(a.eye,Ee),e,Ee,null))}return h}intersectScreenPolygonDraped({attributes:e},t,i,r,s){if(!i.options.selectionMode)return null;const n=he(this._getLineSize(e,!0),s,this.parameters.worldSized);for(const a of fe(Pe,ye,this.parameters,e,t))if(q(r,Pe,ye,n))return new X(a);return null}createBufferWriter(){return new pe(ie(this.parameters),re(this.parameters),this.parameters)}createGLMaterial(e){return new le(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return!!this.parameters.hasAnimation&&(this.setParameters({timeElapsed:s(e.time)},!1),0!==e.dt)}computeScreenSizePerspectiveWidth(e,t,i,r,s,n,a){const o=T(e,r);b(Ee,t,i,o),_(we,Ee,s.viewMatrix);const l=d(we),c=this.computeCameraAbsCosAngle(Ee,s,this._configuration.spherical);be.update(c,l,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize);return be.apply(n)*s.pixelRatio/2+a}computeCameraAbsCosAngle(e,t,i){return i?S(Te,e):c(Te,0,0,1),p(ve,e,t.eye),S(ve,ve),Math.abs(u(Te,ve))}_getLineSize(e,i=!1){let r=this.parameters.width;if(this.parameters.vvSize){const s=e.get("sizeFeatureAttribute").data[0];Number.isNaN(s)?i&&(r*=this.parameters.vvSize.fallback[0]):r*=t(this.parameters.vvSize.offset[0]+s*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else e.has("size")&&(r*=e.get("size").data[0]);return r}*_forEachTransformedLineSegment(e,t,i,r,s){const n=s?i.length-2:i.length-5;for(let a=0;a<n;a+=3){e[0]=i[a]+r[12],e[1]=i[a+1]+r[13],e[2]=i[a+2]+r[14];const s=(a+3)%i.length;t[0]=i[s]+r[12],t[1]=i[s+1]+r[13],t[2]=i[s+2]+r[14],yield a/3}}}class le extends D{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(se,e)}}class ce extends ${constructor(){super(...arguments),this._width=0,this.color=y,this.join="miter",this.cap=0,this.miterLimit=5,this.shadingEnabled=!1,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=n(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=n(0),this.endTime=n(1/0),this.worldSized=!1}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}isImagePattern(){return Z(this.stipplePattern)&&null!=this.stippleTexture}}class pe{constructor(e,t,i){this.layout=e,this.textureBufferLayout=t,this._parameters=i,this.numJoinSubdivisions=ge(this._parameters.join,null!=this._parameters.stipplePattern)}_isClosed(e){return me(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){return e.get("position").data.length/3+(this._isClosed(e)?3:2)}elementCount(e){const t=2,i=e.get("position").indices.length/2+1,r=this._isClosed(e);let s=r?2:2*t;return s+=((r?i:i-1)-(r?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,i,r,s,n){null!=n&&this._writeTextureBuffer(e,i,n),null!=r&&this._writeVertexBuffer(e,i,r,s)}_writeTextureBuffer(e,t,i){const r=t.get("position"),s=r.data.length/3,n=this._isClosed(t),{buffer:a,offset:o}=i,l=a.getField("position",M),c=a.getField("u0",V),p=a.getField("sizeFeatureAttribute",V),u=a.getField("size",V),m=a.getField("colorFeatureAttribute",V),h=a.getField("color",O),d=a.getField("olidColor",O),b=a.getField("timeStamps",F),_=a.getField("opacityFeatureAttribute",V),S=t.get("sizeFeatureAttribute")?.data,P=t.get("size")?.data,y=t.get("colorFeatureAttribute")?.data,E=t.get("color")?.data,w=t.get("opacityFeatureAttribute")?.data,v=t.get("distanceToStart")?.data,x=t.get("timeStamps");Q(null!==l,"Expected valid position field in texture buffer"),Q(null!==c,"Expected valid u0 field in texture buffer");let T=0;for(let j=0;j<s;++j){this._getTransformedPosition(Be,r.data,j,e),j>0&&(null!=v?T=v[j]??T:T+=g(Re,Be));const t=o+j+1;if(l.setVec(t,Be),c.set(t,T),f(Re,Be),p&&p.set(t,1===S?.length?S[0]:S?.[j]??0),u&&u.set(t,1===P?.length?P[0]:P?.[j]??1),m&&m.set(t,1===y?.length?y[0]:y?.[j]??0),h)if(null!=E){const e=Math.min(4*j,E.length-4);h.setValues(t,E[e],E[e+1],E[e+2],E[e+3])}else h.setValues(t,1,1,1,1);_&&_.set(t,1===w?.length?w[0]:w?.[j]??0)}if(null!=b&&null!=x){Q(4===x.size);const e=x.data;for(let t=0;t<s;++t){const i=4*t,r=o+t+1;b.set(r,0,e[i]),b.set(r,1,e[i+1]),b.set(r,2,e[i+2]),b.set(r,3,e[i+3])}}if(n){const e=o,t=o+1,i=o+2,r=o+s,n=r+1,p=r+2;a.copyItem(r,e),a.copyItem(t,n),a.copyItem(i,p),l.getVec(r,Re),l.getVec(t,Be);const u=v?.[s]??T+g(Re,Be);c.set(n,u)}else{const e=o,t=o+1,i=o+s,r=i+1;a.copyItem(t,e),a.copyItem(i,r)}const z=t.get("olidColor");W()&&null!=z&&null!=d&&ee(z,4,d,o)}_writeVertexBuffer(e,t,i,r){const{buffer:s,offset:n}=i,{layout:a}=this,o=t.get("position"),l=o.indices,c=o.data.length/3,p=this._isClosed(t),u=c+(p?3:2);l&&l.length!==2*(c-1)&&console.warn("RibbonLineMaterial does not support indices");const m=s.getField("textureElementIndex",R);Q(null!=m,"Missing texture buffer index field"),Q(null!=r,"Using a texture layout, but the texture range for this instance was not provided");const h=r.from;Q(r.numElements===u,"Expected number of elements in TextureBuffer to equal number of points");const f=new Float32Array(s.buffer),d=new Float16Array(s.buffer),g=new Uint32Array(s.buffer),b=a.stride/4;let _=n*b;const S=_,P=f.BYTES_PER_ELEMENT/d.BYTES_PER_ELEMENT,y=(e,t,i)=>{const r=i+1;g[_]=h+r,_++;let s=_*P;d[s++]=e,d[s++]=t,_=Math.ceil(s/P)};_+=b;let E=0,w=0;p?(E=0,w=c):(y(1,-4,0),y(1,4,0),E=1,w=c-1);for(let v=E;v<w;v++){y(0,-1,v),y(0,1,v);const e=this.numJoinSubdivisions;for(let t=0;t<e;++t){const i=(t+1)/(e+1);y(i,-1,v),y(i,1,v)}y(1,-2,v),y(1,2,v)}p?(y(0,-1,w),y(0,1,w)):(y(0,-5,w),y(0,5,w)),ue(f,S+b,f,S,b);_=ue(f,_-b,f,_,b),this._parameters.wireframe&&this._addWireframeVertices(s,S,_,b)}_getTransformedPosition(e,t,i,r){const s=3*i;c(e,t[s+0],t[s+1],t[s+2]),r&&_(e,e,r)}_addWireframeVertices(e,t,i,r){const s=new Uint8Array(e.buffer,i*Float32Array.BYTES_PER_ELEMENT),n=new Uint8Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,(i-t)*Float32Array.BYTES_PER_ELEMENT),a=r*Float32Array.BYTES_PER_ELEMENT;let o=0;const l=e=>o=ue(n,e,s,o,a);for(let c=0;c<=n.length-4*a;c+=2*a)l(c),l(c+2*a),l(c+1*a),l(c+2*a),l(c+1*a),l(c+3*a)}}function ue(e,t,i,r,s){for(let n=0;n<s;n++)i[r++]=e[t++];return r}function me(e,t){if(!e.isClosed)return!1;return t.get("position").indices.length>2}function he(e,t,i){return i?e/2+Ye*t:(e/2+Ye)*t}function*fe(e,t,i,r,s){const n=r.get("position").data,l=me(i,r)?n.length-2:n.length-5,c=s?.[0]??0,p=s?.[1]??0;o(e,n[0]+c,n[1]+p);for(let u=3;u<l+3;u+=3){const i=u%n.length;o(t,n[i]+c,n[i+1]+p),yield u/3,a(e,t)}}function de(e){return 1===e.anchor&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}function ge(e,t){const i=t?1:0;switch(e){case"miter":case"bevel":return i;case"round":return te+i}}const be=new H,_e=P(),Se=P(),Pe=l(),ye=l(),Ee=P(),we=P(),ve=P(),xe=P(),Te=P(),ze=P(),je=i(),Le=i(),Ae=r(),Ce=r(),Me=P(),Ve=P(),Oe=z(),Fe=z(),Re=P(),Be=P(),Ie=[i(),i(),i(),i()],Ue=[P(),P(),P(),P()],Ne=C(),ke=C(),We=C(),De=C(),Ye=4,Je=[P(),P()];export{ce as Parameters,oe as RibbonLineMaterial};
|
|
2
|
+
import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as i,createScreenPointArray as r}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as s,Seconds as n}from"../../../../core/time.js";import{copy as a,set as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as c,subtract as p,dot as u,scale as m,add as h,copy as f,length as d,distance as g,lerp as b,transformMat4 as _,normalize as S}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as y}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromPoints as E,distance2 as w,closestLineSegmentPoint as v,projectPoint as x,projectPointFraction as T,create as j}from"../../../../geometry/support/lineSegment.js";import{fromPoints as z,signedDistance as L,getNormal as A,create as C}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as M,BufferViewFloat as F,BufferViewVec4Unorm8 as R,BufferViewVec4f16 as O,BufferViewUint32 as B}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as I,isColor as U,isDepth as V,isColorHighlightOLIDOrDepth as N,is2DGeometryOutput as k}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as W}from"../effects/geometry/olidUtils.js";import D from"../lib/GLMaterial.js";import{LineMaterial as Y}from"../lib/LineMaterial.js";import{projectWorldLineSegmentToRenderScreen as J,screenPolygonIntersectsBufferedSegment as q}from"../lib/screenPolygonOverlapUtils.js";import{Hit as G,DrapedHit as X}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as H}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as K,assert as Q}from"../lib/Util.js";import{isImagePattern as Z}from"./lineStippleUtils.js";import{VisualVariablePassParameters as $}from"./VisualVariablePassParameters.js";import{writeColor as ee}from"./internal/bufferWriterUtils.js";import{n as te}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as ie,getTextureBufferLayout as re}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as se}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as ne}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as ae}from"../../../../webscene/support/AlphaCutoff.js";class oe extends Y{constructor(e,t){super(e,ce),this.produces=new Map([[2,e=>I(e)||U(e)&&8===this.parameters.renderOccluded],[3,e=>V(e)],[10,e=>N(e)&&8===this.parameters.renderOccluded],[11,e=>N(e)&&8===this.parameters.renderOccluded],[4,e=>U(e)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[8,e=>U(e)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[18,e=>k(e)]]),this._configuration=new ne(t)}updateConfiguration(e){super.updateConfiguration(e);const{draped:t}=this._configuration,i=null!=this.parameters.stipplePattern&&null!=this.parameters.stippleTexture&&10!==e.output,r=i&&this.parameters.isImagePattern(),s=t&&(this.parameters.worldSized||r);this._configuration.shadingEnabled=this.parameters.shadingEnabled,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=i,this._configuration.stippleOffColorEnabled=i&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=i&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=ge(this.parameters.join,i),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&de(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.pbrMode=this.parameters.shadingEnabled?2:0,this._configuration.emissionSource=this.emissions?1:0,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!s,this._configuration.worldSized=s,this._configuration.imagePattern=r,U(e.output)&&this.parameters.shadingEnabled?(this._configuration.receiveAmbientOcclusion=null!=e.ssao,this._configuration.receiveGlobalIllumination=e.globalIlluminationEnabled):this._configuration.receiveAmbientOcclusion=this._configuration.receiveGlobalIllumination=!1}get visible(){return this.parameters.color[3]>=ae||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>ae}get emissions(){return this.parameters.emissiveStrength>0?8!==this.parameters.renderOccluded?2:1:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped({attributes:e},i,r,s,n,a){if(!i.options.selectionMode)return;const o=this._getLineSize(e,!0),l=r[0],c=r[1],p=he(o,a,this.parameters.worldSized);let u=Number.MAX_VALUE,m=0;for(const h of fe(Pe,ye,this.parameters,e)){const e=l-Pe[0],i=c-Pe[1],r=ye[0]-Pe[0],s=ye[1]-Pe[1],n=t((r*e+s*i)/(r*r+s*s),0,1),a=r*n-e,o=s*n-i,p=a*a+o*o;p<u&&(u=p,m=h)}u<p*p&&s(n.distance,n.renderDistance,n.normal,m)}intersectRay(t,i,r,s,n,o){const{options:l,camera:b,rayBegin:_,rayEnd:S}=r;if(!l.selectionMode||!t.visible||!b)return;if(!K(i))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const P=t.attributes,y=P.get("position").data,x=this._getLineSize(P),T=je;a(T,r.point);const j=x*b.pixelRatio,C=Ye*b.pixelRatio,M=j/2+C;c(Ue[0],T[0]-M,T[1]+M,0),c(Ue[1],T[0]+M,T[1]+M,0),c(Ue[2],T[0]+M,T[1]-M,0),c(Ue[3],T[0]-M,T[1]-M,0);for(let e=0;e<4;e++)if(!b.unprojectFromRenderScreen(Ue[e],Ve[e]))return;z(b.eye,Ve[0],Ve[1],Ne),z(b.eye,Ve[1],Ve[2],ke),z(b.eye,Ve[2],Ve[3],We),z(b.eye,Ve[3],Ve[0],De);let F=Number.MAX_VALUE,R=0;for(const e of this._forEachTransformedLineSegment(_e,Se,y,i,me(this.parameters,P))){if(L(Ne,_e)<0&&L(Ne,Se)<0||L(ke,_e)<0&&L(ke,Se)<0||L(We,_e)<0&&L(We,Se)<0||L(De,_e)<0&&L(De,Se)<0)continue;const t=b.projectToRenderScreen(_e,ze),i=b.projectToRenderScreen(Se,Le);if(null==t||null==i)continue;if(t[2]<0&&i[2]>0){p(xe,_e,Se);const e=b.frustum,i=-L(e[4],_e)/u(xe,A(e[4]));if(m(xe,xe,i),h(_e,_e,xe),!b.projectToRenderScreen(_e,t))continue}else if(t[2]>0&&i[2]<0){p(xe,Se,_e);const e=b.frustum,t=-L(e[4],Se)/u(xe,A(e[4]));if(m(xe,xe,t),h(Se,Se,xe),!b.projectToRenderScreen(Se,i))continue}else if(t[2]<0&&i[2]<0)continue;t[2]=0,i[2]=0;const r=E(t,i,Re),s=w(r,T);if(!(s>=F)){if(this.parameters.screenSizePerspective){const e=this.computeScreenSizePerspectiveWidth(r,_e,Se,T,b,x,C);if(s>=e*e)continue}F=s,f(Me,_e),f(Fe,Se),R=e}}if(F<M*M){let e=Number.MAX_VALUE;if(v(E(Me,Fe,Re),E(_,S,Oe),Te)){p(Te,Te,_);const t=d(Te);m(Te,Te,1/t),e=t/g(_,S)}o(e,e,Te,R)}}intersectScreenPolygon(t,i,r,s){const{options:n,camera:a,screenPolygonPrimitiveProcessor:o}=r;if(!n.selectionMode||!t.visible)return null;if(!K(i))return e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix"),null;const l=t.attributes,c=l.get("position").data,p=this._getLineSize(l),u=Ye,m=u*a.pixelRatio,h=new G(4);for(const e of this._forEachTransformedLineSegment(_e,Se,c,i,me(this.parameters,l)))for(const[t,i]of o.processLineSegment(Je,_e,Se)){if(!J(a,t,i,ze,Le))continue;const r=E(ze,Le,Re);let n=p/2+u;this.parameters.screenSizePerspective&&(b(je,ze,Le,.5),n=Math.max(n,this.computeScreenSizePerspectiveWidth(r,t,i,je,a,p,m)/a.pixelRatio)),a.renderToScreen(ze,Ae),a.renderToScreen(Le,Ce),q(s,Ae,Ce,n)&&(x(E(t,i,Oe),a.eye,Ee),h.updateIfCloserFromValues(g(a.eye,Ee),e,Ee,null))}return h}intersectScreenPolygonDraped({attributes:e},t,i,r,s){if(!i.options.selectionMode)return null;const n=he(this._getLineSize(e,!0),s,this.parameters.worldSized);for(const a of fe(Pe,ye,this.parameters,e,t))if(q(r,Pe,ye,n))return new X(a);return null}createBufferWriter(){return new pe(ie(this.parameters),re(this.parameters),this.parameters)}createGLMaterial(e){return new le(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return!!this.parameters.hasAnimation&&(this.setParameters({timeElapsed:s(e.time)},!1),0!==e.dt)}computeScreenSizePerspectiveWidth(e,t,i,r,s,n,a){const o=T(e,r);b(Ee,t,i,o),_(we,Ee,s.viewMatrix);const l=d(we),c=this.computeCameraAbsCosAngle(Ee,s,this._configuration.spherical);be.update(c,l,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize);return be.apply(n)*s.pixelRatio/2+a}computeCameraAbsCosAngle(e,t,i){return i?S(Te,e):c(Te,0,0,1),p(ve,e,t.eye),S(ve,ve),Math.abs(u(Te,ve))}_getLineSize(e,i=!1){let r=this.parameters.width;if(this.parameters.vvSize){const s=e.get("sizeFeatureAttribute").data[0];Number.isNaN(s)?i&&(r*=this.parameters.vvSize.fallback[0]):r*=t(this.parameters.vvSize.offset[0]+s*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else e.has("size")&&(r*=e.get("size").data[0]);return r}*_forEachTransformedLineSegment(e,t,i,r,s){const n=s?i.length-2:i.length-5;for(let a=0;a<n;a+=3){e[0]=i[a]+r[12],e[1]=i[a+1]+r[13],e[2]=i[a+2]+r[14];const s=(a+3)%i.length;t[0]=i[s]+r[12],t[1]=i[s+1]+r[13],t[2]=i[s+2]+r[14],yield a/3}}}class le extends D{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(se,e)}}class ce extends ${constructor(){super(...arguments),this._width=0,this.color=y,this.join="miter",this.cap=0,this.miterLimit=5,this.shadingEnabled=!1,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=n(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=n(0),this.endTime=n(1/0),this.worldSized=!1}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}isImagePattern(){return Z(this.stipplePattern)&&null!=this.stippleTexture}}class pe{constructor(e,t,i){this.layout=e,this.textureBufferLayout=t,this._parameters=i,this.numJoinSubdivisions=ge(this._parameters.join,null!=this._parameters.stipplePattern)}_isClosed(e){return me(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){return e.get("position").data.length/3+(this._isClosed(e)?3:2)}elementCount(e){const t=2,i=e.get("position").indices.length/2+1,r=this._isClosed(e);let s=r?2:2*t;return s+=((r?i:i-1)-(r?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,i,r,s,n){null!=n&&this._writeTextureBuffer(e,i,n),null!=r&&this._writeVertexBuffer(e,i,r,s)}_writeTextureBuffer(e,t,i){const r=t.get("position"),s=r.data.length/3,n=this._isClosed(t),{buffer:a,offset:o}=i,l=a.getField("position",M),c=a.getField("u0",F),p=a.getField("sizeFeatureAttribute",F),u=a.getField("size",F),m=a.getField("colorFeatureAttribute",F),h=a.getField("color",R),d=a.getField("olidColor",R),b=a.getField("timeStamps",O),_=a.getField("opacityFeatureAttribute",F),S=t.get("sizeFeatureAttribute")?.data,P=t.get("size")?.data,y=t.get("colorFeatureAttribute")?.data,E=t.get("color")?.data,w=t.get("opacityFeatureAttribute")?.data,v=t.get("distanceToStart")?.data,x=t.get("timeStamps");Q(null!==l,"Expected valid position field in texture buffer"),Q(null!==c,"Expected valid u0 field in texture buffer");let T=0;for(let z=0;z<s;++z){this._getTransformedPosition(Ie,r.data,z,e),z>0&&(null!=v?T=v[z]??T:T+=g(Be,Ie));const t=o+z+1;if(l.setVec(t,Ie),c.set(t,T),f(Be,Ie),p&&p.set(t,1===S?.length?S[0]:S?.[z]??0),u&&u.set(t,1===P?.length?P[0]:P?.[z]??1),m&&m.set(t,1===y?.length?y[0]:y?.[z]??0),h)if(null!=E){const e=Math.min(4*z,E.length-4);h.setValues(t,E[e],E[e+1],E[e+2],E[e+3])}else h.setValues(t,1,1,1,1);_&&_.set(t,1===w?.length?w[0]:w?.[z]??0)}if(null!=b&&null!=x){Q(4===x.size);const e=x.data;for(let t=0;t<s;++t){const i=4*t,r=o+t+1;b.set(r,0,e[i]),b.set(r,1,e[i+1]),b.set(r,2,e[i+2]),b.set(r,3,e[i+3])}}if(n){const e=o,t=o+1,i=o+2,r=o+s,n=r+1,p=r+2;a.copyItem(r,e),a.copyItem(t,n),a.copyItem(i,p),l.getVec(r,Be),l.getVec(t,Ie);const u=v?.[s]??T+g(Be,Ie);c.set(n,u)}else{const e=o,t=o+1,i=o+s,r=i+1;a.copyItem(t,e),a.copyItem(i,r)}const j=t.get("olidColor");W()&&null!=j&&null!=d&&ee(j,4,d,o)}_writeVertexBuffer(e,t,i,r){const{buffer:s,offset:n}=i,{layout:a}=this,o=t.get("position"),l=o.indices,c=o.data.length/3,p=this._isClosed(t),u=c+(p?3:2);l&&l.length!==2*(c-1)&&console.warn("RibbonLineMaterial does not support indices");const m=s.getField("textureElementIndex",B);Q(null!=m,"Missing texture buffer index field"),Q(null!=r,"Using a texture layout, but the texture range for this instance was not provided");const h=r.from;Q(r.numElements===u,"Expected number of elements in TextureBuffer to equal number of points");const f=new Float32Array(s.buffer),d=new Float16Array(s.buffer),g=new Uint32Array(s.buffer),b=a.stride/4;let _=n*b;const S=_,P=f.BYTES_PER_ELEMENT/d.BYTES_PER_ELEMENT,y=(e,t,i)=>{const r=i+1;g[_]=h+r,_++;let s=_*P;d[s++]=e,d[s++]=t,_=Math.ceil(s/P)};_+=b;let E=0,w=0;p?(E=0,w=c):(y(1,-4,0),y(1,4,0),E=1,w=c-1);for(let v=E;v<w;v++){y(0,-1,v),y(0,1,v);const e=this.numJoinSubdivisions;for(let t=0;t<e;++t){const i=(t+1)/(e+1);y(i,-1,v),y(i,1,v)}y(1,-2,v),y(1,2,v)}p?(y(0,-1,w),y(0,1,w)):(y(0,-5,w),y(0,5,w)),ue(f,S+b,f,S,b);_=ue(f,_-b,f,_,b),this._parameters.wireframe&&this._addWireframeVertices(s,S,_,b)}_getTransformedPosition(e,t,i,r){const s=3*i;c(e,t[s+0],t[s+1],t[s+2]),r&&_(e,e,r)}_addWireframeVertices(e,t,i,r){const s=new Uint8Array(e.buffer,i*Float32Array.BYTES_PER_ELEMENT),n=new Uint8Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,(i-t)*Float32Array.BYTES_PER_ELEMENT),a=r*Float32Array.BYTES_PER_ELEMENT;let o=0;const l=e=>o=ue(n,e,s,o,a);for(let c=0;c<=n.length-4*a;c+=2*a)l(c),l(c+2*a),l(c+1*a),l(c+2*a),l(c+1*a),l(c+3*a)}}function ue(e,t,i,r,s){for(let n=0;n<s;n++)i[r++]=e[t++];return r}function me(e,t){if(!e.isClosed)return!1;return t.get("position").indices.length>2}function he(e,t,i){return i?e/2+Ye*t:(e/2+Ye)*t}function*fe(e,t,i,r,s){const n=r.get("position").data,l=me(i,r)?n.length-2:n.length-5,c=s?.[0]??0,p=s?.[1]??0;o(e,n[0]+c,n[1]+p);for(let u=3;u<l+3;u+=3){const i=u%n.length;o(t,n[i]+c,n[i+1]+p),yield u/3,a(e,t)}}function de(e){return 1===e.anchor&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}function ge(e,t){const i=t?1:0;switch(e){case"miter":case"bevel":return i;case"round":return te+i}}const be=new H,_e=P(),Se=P(),Pe=l(),ye=l(),Ee=P(),we=P(),ve=P(),xe=P(),Te=P(),je=P(),ze=i(),Le=i(),Ae=r(),Ce=r(),Me=P(),Fe=P(),Re=j(),Oe=j(),Be=P(),Ie=P(),Ue=[i(),i(),i(),i()],Ve=[P(),P(),P(),P()],Ne=C(),ke=C(),We=C(),De=C(),Ye=4,Je=[P(),P()];export{ce as Parameters,oe as RibbonLineMaterial};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{ShaderTechniqueConfiguration as e}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";class r extends e{constructor(e){super(),this.spherical=e}}export{r as ViewingModeConfiguration};
|
|
2
|
+
import{ShaderTechniqueConfiguration as e}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";class r extends e{constructor(e){super(),this.spherical=e,this.draped=!1}}export{r as ViewingModeConfiguration};
|