@arcgis/core 4.31.0-next.20240706 → 4.31.0-next.20240708
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{3edc527a24cb9a4868e5.js → 20d0390504e4cc9f93f4.js} +1 -1
- package/assets/esri/core/workers/chunks/{ef8ba10380053ea4c4dd.js → 34ea46659c8cebec3ffa.js} +1 -1
- package/assets/esri/core/workers/chunks/5089a12084a8a8fb93d8.js +1 -0
- package/assets/esri/core/workers/chunks/{5afc1562bb5c20127ef1.js → e840e54455eb500b501d.js} +18 -18
- package/chunks/ChapmanAtmosphere.glsl.js +1 -1
- package/chunks/ComponentShader.glsl.js +3 -3
- package/chunks/DefaultMaterial.glsl.js +1 -1
- package/chunks/EdgeShader.glsl.js +5 -6
- package/chunks/Heatmap.glsl.js +4 -4
- package/chunks/HighlightApply.glsl.js +172 -135
- package/chunks/LineCallout.glsl.js +4 -4
- package/chunks/MeasurementArrow.glsl.js +5 -5
- package/chunks/RealisticTree.glsl.js +2 -2
- package/chunks/Terrain.glsl.js +39 -39
- package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/Fog.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TransparencyMode.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/Laserline.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +11 -11
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Terrain.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js +9 -0
- package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/MainFramebuffer.js +5 -0
- package/views/3d/webgl-engine/lib/RenderContext.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Heatmap.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/HighlightApply.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/MeasurementArrow.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeShader.glsl.js +1 -1
- package/assets/esri/core/workers/chunks/9a9abefa8099aa1ebc3d.js +0 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/AlphaDiscard.glsl.js +0 -7
- package/views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlphaBlend.glsl.js +0 -7
- package/views/3d/webgl-engine/lib/MainColor.js +0 -5
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/DiscardByCoverage.glsl.js +0 -5
|
@@ -190,7 +190,7 @@ return scaleHeight * chapmanApproximation(radii[0] / scaleHeight, h, dot(normali
|
|
|
190
190
|
${t.reduced?u`cameraSpaceRay *= -textureBilinear(vuv0);`:u`cameraSpaceRay *= -linearDepthFromTexture(depthTexture, vuv0);`}
|
|
191
191
|
|
|
192
192
|
terrainDepth = max(0.0, length(cameraSpaceRay));
|
|
193
|
-
}else{
|
|
193
|
+
} else {
|
|
194
194
|
discard;
|
|
195
195
|
}
|
|
196
196
|
`:u`${t.reduced?"":u`
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{earth as e,mars as o,moon as r}from"../geometry/support/Ellipsoid.js";import{OverlayContent as a}from"../views/3d/terrain/OverlayContent.js";import{IntegratedMeshMode as i}from"../views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js";import{ComponentData as t,ComponentDataType as l}from"../views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js";import{VertexDiscardByOpacity as d}from"../views/3d/webgl-engine/collections/Component/Material/shader/VertexDiscardByOpacity.glsl.js";import{ForwardLinearDepth as n}from"../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js";import{ShaderOutput as s}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SlicePass as c}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{NormalType as m}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttribute as g}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexColor as u}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js";import{VertexNormal as v}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js";import{VertexPosition as h}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js";import{OutputDepth as p}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js";import{OutputHighlight as w}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{ReadLinearDepth as C}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl.js";import{ComputeMaterialColor as b}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeMaterialColor.glsl.js";import{ComputeNormalTexture as f}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import{ComputeShadingNormal as y}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeShadingNormal.glsl.js";import{EvaluateSceneLighting as x,addLightingGlobalFactor as
|
|
5
|
+
import{earth as e,mars as o,moon as r}from"../geometry/support/Ellipsoid.js";import{OverlayContent as a}from"../views/3d/terrain/OverlayContent.js";import{IntegratedMeshMode as i}from"../views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js";import{ComponentData as t,ComponentDataType as l}from"../views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js";import{VertexDiscardByOpacity as d}from"../views/3d/webgl-engine/collections/Component/Material/shader/VertexDiscardByOpacity.glsl.js";import{ForwardLinearDepth as n}from"../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js";import{ShaderOutput as s}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SlicePass as c}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{NormalType as m}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttribute as g}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexColor as u}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js";import{VertexNormal as v}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js";import{VertexPosition as h}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js";import{OutputDepth as p}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js";import{OutputHighlight as w}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{ReadLinearDepth as C}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl.js";import{ComputeMaterialColor as b}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeMaterialColor.glsl.js";import{ComputeNormalTexture as f}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import{ComputeShadingNormal as y}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeShadingNormal.glsl.js";import{EvaluateSceneLighting as x,addLightingGlobalFactor as j}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{addMainLightIntensity as L}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{multipassTerrainTest as O}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import{PBRMode as S,PhysicallyBasedRenderingParameters as M}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReadBaseColorTexture as N}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js";import{ReadShadowMapPass as T}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{OverlayIM as W,getIMColorTexture as A}from"../views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{alphaCutoff as P}from"../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff.js";import{DiscardOrAdjustAlphaDraw as B}from"../views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import{EllipsoidMode as D}from"../views/3d/webgl-engine/core/shaderLibrary/util/EllipsoidMode.js";import{glsl as R}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{ShaderBuilder as $}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DPassUniform as z}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{TransparencyPassType as E}from"../views/3d/webgl-engine/lib/TransparencyPassType.js";import{outputColorHighlightOID as I}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js";function V(V){const H=new $;H.include(h,V),H.include(v,V),H.include(u,V),H.include(g,V),H.include(n,V),H.include(t,V),H.include(B,V),H.include(c,V),H.include(N,V),H.include(d,V);const{vertex:_,fragment:G}=H;V.pbrMode!==S.Normal&&V.pbrMode!==S.Schematic||(H.include(M,V),V.hasNormalTexture&&H.include(f,V));const F=V.output===s.Shadow||V.output===s.ShadowHighlight||V.output===s.ShadowExcludeHighlight;F&&V.componentData===l.Varying?_.code.add(R`#define discardShadows(castShadows) { if(!castShadows) { gl_Position = vec4(1e38, 1e38, 1e38, 1.0); return; } }`):_.code.add(R`#define discardShadows(castShadows) {}`);const k=V.integratedMeshMode===i.ColorOverlay||V.integratedMeshMode===i.ColorOverlayWithWater,q=k&&V.output===s.Color&&V.pbrMode===S.WaterOnIntegratedMesh;k&&(H.include(x,V),H.include(W,V),V.spherical?_.code.add(R`
|
|
6
6
|
const float invEllipsoidRadius = ${R.float(1/(V.ellipsoidMode===D.Earth?e.radius:V.ellipsoidMode===D.Mars?o.radius:r.radius))};
|
|
7
7
|
vec2 projectOverlay(vec3 pos) {
|
|
8
8
|
return pos.xy / (1.0 + invEllipsoidRadius * pos.z);
|
|
@@ -58,7 +58,7 @@ return readShadowMap(vPositionWorldCameraRelative, linearDepth);
|
|
|
58
58
|
externalColorMixMode
|
|
59
59
|
);
|
|
60
60
|
${k?R`vec4 overlayColor = getOverlayColor(ovColorTex, vtcOverlay);`:""}
|
|
61
|
-
`),V.pbrMode===S.Normal||V.pbrMode===S.Schematic?(
|
|
61
|
+
`),V.pbrMode===S.Normal||V.pbrMode===S.Schematic?(L(G),G.code.add(R`
|
|
62
62
|
${V.pbrMode===S.Normal?R`
|
|
63
63
|
applyPBRFactors();
|
|
64
64
|
if (int(externalColorMixMode) == 3) {
|
|
@@ -82,7 +82,7 @@ vec3 shadingNormal = computeTextureNormal(tangentSpace, vuv0);`):G.code.add(R`ve
|
|
|
82
82
|
|
|
83
83
|
vec3 additionalLight = evaluateAdditionalLighting(ssao, positionWorld());
|
|
84
84
|
vec4 shadedColor = vec4(evaluateSceneLightingPBR(shadingNormal, materialColor.rgb, evaluateShadow(), ssao, additionalLight, viewDir, normalGround, mrr, emission, additionalIrradiance), materialColor.a);
|
|
85
|
-
`)):(V.receiveShadows?G.code.add(R`float shadow = evaluateShadow();`):V.spherical?(
|
|
85
|
+
`)):(V.receiveShadows?G.code.add(R`float shadow = evaluateShadow();`):V.spherical?(j(G),G.code.add(R`float additionalAmbientScale = additionalDirectedAmbientLight(positionWorld());
|
|
86
86
|
float shadow = lightingGlobalFactor * (1.0 - additionalAmbientScale);`)):G.code.add(R`float shadow = 0.0;`),q&&G.uniforms.add(new z("ovNormalTex",((e,o)=>o.overlay?.getTexture(a.WaterNormal)))),V.snowCover&&G.code.add(R`vec3 surfaceNormal = normalize(cross(dFdx(vPositionWorldCameraRelative), dFdy(vPositionWorldCameraRelative)));
|
|
87
87
|
float snow = smoothstep(0.5, 0.55, dot(surfaceNormal, normalize(positionWorld())));
|
|
88
88
|
materialColor.rgb = mix(materialColor.rgb, vec3(1), snow);`),G.code.add(R`
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{ForwardLinearDepth as e}from"../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js";import{Offset as r}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.js";import{ShaderOutput as o}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SliceDraw as i}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as a}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{InstancedDoublePrecision as l}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import{NormalAttribute as s,NormalType as t}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{PositionAttribute as n}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl.js";import{SymbolColor as d}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js";import{TextureCoordinateAttribute as c}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexColor as m}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js";import{VertexNormal as g}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js";import{VerticalOffset as v}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js";import{DefaultMaterialAuxiliaryPasses as b}from"../views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import{ComputeNormalTexture as u}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import{EvaluateAmbientOcclusion as p}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import{EvaluateSceneLighting as w,addAmbientBoostFactor as h,addLightingGlobalFactor as f}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{addMainLightIntensity as x}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{multipassTerrainTest as y}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import{Normals as C}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js";import{PhysicallyBasedRendering as L}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import{PhysicallyBasedRenderingParameters as j,PBRMode as P}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReadShadowMapPass as T,ReadShadowMapDraw as M}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{colorTextureUV as O,normalTextureUV as N,emissiveTextureUV as S,occlusionTextureUV as V,metallicRoughnessTextureUV as
|
|
5
|
+
import{ForwardLinearDepth as e}from"../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js";import{Offset as r}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.js";import{ShaderOutput as o}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SliceDraw as i}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as a}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{InstancedDoublePrecision as l}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import{NormalAttribute as s,NormalType as t}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{PositionAttribute as n}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl.js";import{SymbolColor as d}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js";import{TextureCoordinateAttribute as c}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexColor as m}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js";import{VertexNormal as g}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js";import{VerticalOffset as v}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js";import{DefaultMaterialAuxiliaryPasses as b}from"../views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import{ComputeNormalTexture as u}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import{EvaluateAmbientOcclusion as p}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import{EvaluateSceneLighting as w,addAmbientBoostFactor as h,addLightingGlobalFactor as f}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{addMainLightIntensity as x}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{multipassTerrainTest as y}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import{Normals as C}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js";import{PhysicallyBasedRendering as L}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import{PhysicallyBasedRenderingParameters as j,PBRMode as P}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReadShadowMapPass as T,ReadShadowMapDraw as M}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{colorTextureUV as O,normalTextureUV as N,emissiveTextureUV as S,occlusionTextureUV as V,metallicRoughnessTextureUV as A}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TextureTransformUV.glsl.js";import{VisualVariables as E}from"../views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js";import{alphaCutoff as $}from"../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff.js";import{DiscardOrAdjustAlphaPass as D}from"../views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import{MixExternalColor as U}from"../views/3d/webgl-engine/core/shaderLibrary/util/MixExternalColor.glsl.js";import{addProjViewLocalOrigin as B,addCameraPosition as I}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float3PassUniform as _}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{Float4PassUniform as F}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as R}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as z}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{ShaderBuilder as W}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DPassUniform as G}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{VertexAttribute as k}from"../views/3d/webgl-engine/lib/VertexAttribute.js";import{outputColorHighlightOID as H}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js";function q(q){const J=new W,{vertex:K,fragment:Q,varyings:X}=J;if(B(K,q),J.include(n),X.add("vpos","vec3"),J.include(E,q),J.include(l,q),J.include(v,q),J.include(O,q),q.output===o.Color){J.include(N,q),J.include(S,q),J.include(V,q),J.include(A,q),I(K,q),J.include(s,q),J.include(a,q);const o=q.normalType===t.Attribute||q.normalType===t.Compressed;o&&q.offsetBackfaces&&J.include(r),J.include(u,q),J.include(g,q),q.instancedColor&&J.attributes.add(k.INSTANCECOLOR,"vec4"),X.add("vPositionLocal","vec3"),J.include(c,q),J.include(e,q),J.include(d,q),J.include(m,q),K.uniforms.add(new F("externalColor",(e=>e.externalColor))),X.add("vcolorExt","vec4"),q.multipassEnabled&&X.add("depth","float"),K.code.add(z`
|
|
6
6
|
void main(void) {
|
|
7
7
|
forwardNormalizedVertexColor();
|
|
8
8
|
vcolorExt = externalColor;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{set as e}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as i}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{SliceDraw as o}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{multipassTerrainTest as s}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import{Float2PassUniform as n}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{Float4PassUniform as t}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as d}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as
|
|
5
|
+
import{set as e}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as i}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{SliceDraw as o}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{multipassTerrainTest as s}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import{Float2PassUniform as n}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{Float4PassUniform as t}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as d}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as l}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{ShaderBuilder as a}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Uniform as r}from"../views/3d/webgl-engine/core/shaderModules/Uniform.js";import{VertexAttribute as c}from"../views/3d/webgl-engine/lib/VertexAttribute.js";import{AdjustProjectedPosition as p}from"../views/3d/webgl-engine/shaders/sources/edgeRenderer/AdjustProjectedPosition.glsl.js";import{DiscardNonSilhouetteEdges as P}from"../views/3d/webgl-engine/shaders/sources/edgeRenderer/DiscardNonSilhouetteEdges.glsl.js";import{EdgeUtil as u,EdgeType as g}from"../views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js";import{LineAmplitude as f}from"../views/3d/webgl-engine/shaders/sources/edgeRenderer/LineAmplitude.glsl.js";import{LineOffset as v}from"../views/3d/webgl-engine/shaders/sources/edgeRenderer/LineOffset.glsl.js";import{UnpackAttributes as m}from"../views/3d/webgl-engine/shaders/sources/edgeRenderer/UnpackAttributes.glsl.js";function x(i){const r=new a,{vertex:x,fragment:L}=r;return i.legacy&&x.uniforms.add(new h("model"),new h("localView")),r.include(p,i),r.include(u,i),r.include(f,i),r.include(m,i),r.include(v,i),r.include(o,i),r.include(P,i),r.include(s,i),r.varyings.add("vColor","vec4"),r.varyings.add("vRadius","float"),r.varyings.add("vPosition","vec3"),r.varyings.add("vWorldPosition","vec3"),i.multipassEnabled&&r.varyings.add("vViewPos","vec3"),r.varyings.add("vLineLengthPixels","float"),r.varyings.add("vSizeFalloffFactor","float"),x.uniforms.add(new n("pixelToNDC",((i,o)=>e(w,2/o.camera.fullViewport[2],2/o.camera.fullViewport[3]))),new t("viewport",((e,i)=>i.camera.fullViewport)),new d("pixelRatio",((e,i)=>i.camera.pixelRatio))),r.attributes.add(c.POSITION0,"vec3"),r.attributes.add(c.POSITION1,"vec3"),r.attributes.add(c.VARIANTOFFSET,"float"),r.attributes.add(c.VARIANTSTROKE,"float"),r.attributes.add(c.VARIANTEXTENSION,"float"),x.code.add(l`
|
|
6
6
|
const float opaqueCutoff = 1.0 / 255.0;
|
|
7
7
|
|
|
8
8
|
void calculateGeometricOutputs(vec3 viewPosV0, vec3 viewPosV1, vec3 worldPosV0, vec3 worldPosV1, vec3 worldNormal, UnpackedAttributes unpackedAttributes) {
|
|
@@ -77,11 +77,11 @@ import{set as e}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as i}f
|
|
|
77
77
|
vLineLengthPixels = extendedLineLengthPixels;
|
|
78
78
|
|
|
79
79
|
// discard short edges below a certain length threshold
|
|
80
|
-
${i.type===
|
|
80
|
+
${i.type===g.Sketch?l`
|
|
81
81
|
if (lineLengthPixels <= 3.0) {
|
|
82
82
|
gl_Position = vec4(10.0, 10.0, 10.0, 1.0);
|
|
83
83
|
return;
|
|
84
|
-
}`:i.type===
|
|
84
|
+
}`:i.type===g.Mixed?l`
|
|
85
85
|
if (lineLengthPixels <= 3.0 && unpackedAttributes.type <= 0.0) {
|
|
86
86
|
gl_Position = vec4(10.0, 10.0, 10.0, 1.0);
|
|
87
87
|
return;
|
|
@@ -116,7 +116,7 @@ import{set as e}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as i}f
|
|
|
116
116
|
// Specific computation for different edge styles
|
|
117
117
|
calculateStyleOutputs(unpackedAttributes);
|
|
118
118
|
}
|
|
119
|
-
`),
|
|
119
|
+
`),L.code.add(l`
|
|
120
120
|
vec2 lineWithCapsDistance(float radius, vec2 position, float lineLength) {
|
|
121
121
|
float positionX = position.x - calculateLineOffset();
|
|
122
122
|
|
|
@@ -141,9 +141,8 @@ import{set as e}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as i}f
|
|
|
141
141
|
vec2 distance = lineWithCapsDistance(radius, vPosition.xy, vLineLengthPixels);
|
|
142
142
|
float coverage = clamp(0.5 - distance.x, 0.0, 1.0);
|
|
143
143
|
|
|
144
|
-
discardByCoverage(radius, coverage);
|
|
145
144
|
discardBySlice(vWorldPosition);
|
|
146
145
|
|
|
147
146
|
fragColor = vec4(vColor.rgb, vColor.a * coverage);
|
|
148
147
|
}
|
|
149
|
-
`),r}const
|
|
148
|
+
`),r}const w=i();class h extends r{constructor(e){super(e,"mat4")}}const L=Object.freeze(Object.defineProperty({__proto__:null,build:x},Symbol.toStringTag,{value:"Module"}));export{L as E,x as b};
|
package/chunks/Heatmap.glsl.js
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{
|
|
5
|
+
import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{alphaCutoff as r}from"../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff.js";import{FloatPassUniform as i}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as o}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{ShaderBuilder as s}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DPassUniform as t}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";function n(n){const a=new s;a.include(e);const{usesHalfFloat:d}=n;return a.fragment.uniforms.add(new t("densityMap",(e=>e.densityMap)),new t("tex",(e=>e.colorRamp)),new i("densityNormalizer",(e=>1/(e.maxDensity-e.minDensity))),new i("minDensity",(e=>e.minDensity)),new i("densityMultiplier",(e=>3/(e.searchRadius*e.searchRadius*Math.PI)))),d&&a.constants.add("compressionFactor","float",4),a.fragment.code.add(o`
|
|
6
6
|
void main() {
|
|
7
|
-
float density = texture(densityMap, uv).r * densityMultiplier${d?
|
|
7
|
+
float density = texture(densityMap, uv).r * densityMultiplier${d?o` * compressionFactor`:""};
|
|
8
8
|
float densityRatio = (density - minDensity) * densityNormalizer;
|
|
9
9
|
|
|
10
10
|
vec4 color = texture(tex, vec2(clamp(densityRatio, 0.0, 1.0), 0.5));
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
if (color.a < ${o.float(r)}) discard;
|
|
13
13
|
fragColor = color;
|
|
14
14
|
}
|
|
15
|
-
`),a}const a=Object.freeze(Object.defineProperty({__proto__:null,build:
|
|
15
|
+
`),a}const a=Object.freeze(Object.defineProperty({__proto__:null,build:n},Symbol.toStringTag,{value:"Module"}));export{a as H,n as b};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{alphaCutoff as e}from"../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff.js";import{Float2PassUniform as o}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{FloatPassUniform as l}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{Integer2PassUniform as t}from"../views/3d/webgl-engine/core/shaderModules/Integer2PassUniform.js";import{IntegerPassUniform as i}from"../views/3d/webgl-engine/core/shaderModules/IntegerPassUniform.js";import{glsl as n}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{ShaderBuilder as r}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DPassUniform as a}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{b as c,o as d}from"./HighlightDownsample.glsl.js";function u(){const u=new r,{vertex:f,fragment:s}=u,g=f.code,v=s.code;return f.uniforms.add(new a("coverageTex",(e=>e.coverageTexture)),new o("coverageRounding",(e=>e.coverageRounding)),new t("highlightRenderCellCount",(e=>[e.verticalCellCount+1,e.horizontalCellCount+1]))),u.varyings.add("uv","vec2"),u.varyings.add("uv2","vec2"),g.add(n`void main() {
|
|
6
6
|
int vid = gl_VertexID & 3;
|
|
7
7
|
int cellIndex = gl_InstanceID;
|
|
8
8
|
int renderCellCountHorizontal = highlightRenderCellCount[0];
|
|
@@ -25,137 +25,174 @@ vec2 pos = vec2(posX,posY);
|
|
|
25
25
|
gl_Position = vec4(pos, 0.0, 1.0);
|
|
26
26
|
uv = pos * 0.5 + vec2(0.5);
|
|
27
27
|
uv2 = uv0;
|
|
28
|
-
}`),
|
|
29
|
-
const float
|
|
30
|
-
const float
|
|
31
|
-
|
|
32
|
-
const float
|
|
33
|
-
const float
|
|
34
|
-
|
|
35
|
-
const float
|
|
36
|
-
const float
|
|
37
|
-
|
|
38
|
-
const float
|
|
39
|
-
float
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
float
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
float
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
if (
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
for
|
|
132
|
-
float
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
28
|
+
}`),s.uniforms.add(new a("highlightTexture",(e=>e.highlightTexture)),new a("coverageTex",(e=>e.coverageTexture)),new o("coverageRounding",(e=>e.coverageRounding)),new a("highlightOptionsTexture",(e=>e.highlightOptionsTexture)),new l("pixelRatio",(e=>e.pixelRatio)),new l("occludedIntensityFactor",(e=>e.occludedFactor)),new i("maxHighlightLevel",(e=>e.maxHighlightLevel))),s.constants.add("inner","float",c/d),v.add(n`
|
|
29
|
+
const float pascal9[5] = float[5](70.0, 56.0, 28.0, 8.0, 1.0);
|
|
30
|
+
const float denom9 = 256.0;
|
|
31
|
+
|
|
32
|
+
const float pascal11[6] = float[6](252.0, 210.0, 120.0, 45.0, 10.0, 1.0);
|
|
33
|
+
const float denom11 = 1024.0;
|
|
34
|
+
|
|
35
|
+
const float pascal13[7] = float[7](924.0, 792.0, 495.0, 220.0, 66.0, 12.0, 1.0);
|
|
36
|
+
const float denom13 = 4096.0;
|
|
37
|
+
|
|
38
|
+
const float pascal15[8] = float[8](3432.0, 3003.0, 2002.0, 1001.0, 364.0, 91.0, 14.0, 1.0);
|
|
39
|
+
const float denom15 = 16384.0;
|
|
40
|
+
|
|
41
|
+
const float pascal17[9] = float[9](12870.0, 11440.0, 8008.0, 4368.0, 1820.0, 560.0, 120.0, 16.0, 1.0);
|
|
42
|
+
const float denom17 = 65536.0;
|
|
43
|
+
|
|
44
|
+
const float pixelSampleScale = 1.0;
|
|
45
|
+
|
|
46
|
+
float colorWeight[16] = float[16](0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
|
|
47
|
+
float colorOcclusion[16] = float[16](0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
|
|
48
|
+
|
|
49
|
+
//Check bitmap for each highlight level (0..15) and update weight and curColorOcclusion-weight accodingly
|
|
50
|
+
void applyTexel(vec4 texel, float pf) {
|
|
51
|
+
if (texel != vec4(0.0)){
|
|
52
|
+
for (int colorIndex = 0; colorIndex <= maxHighlightLevel; ++colorIndex){
|
|
53
|
+
//Read appropriate channel from texture
|
|
54
|
+
int v = int(texel[colorIndex >> 2] * 255.0);
|
|
55
|
+
if (v != 0){
|
|
56
|
+
//Read relevant two bits
|
|
57
|
+
int vj = (v >> ((colorIndex&3)<<1)) & 3;
|
|
58
|
+
if ((vj & 1) == 1){
|
|
59
|
+
colorWeight[colorIndex] += pf;
|
|
60
|
+
if ((vj & 2) == 2){
|
|
61
|
+
colorOcclusion[colorIndex] += pf;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
void readAndApplyTexel(ivec2 iuv, int du, int dv, float pf) {
|
|
70
|
+
vec4 texel = texelFetch(highlightTexture, iuv + ivec2(du, dv), 0);
|
|
71
|
+
applyTexel(texel,pf);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
void readAndApply2TexelsU(ivec2 iuv, int du, int dv, float pf) {
|
|
75
|
+
vec4 texel1 = texelFetch(highlightTexture, iuv + ivec2(-du, dv), 0);
|
|
76
|
+
applyTexel(texel1,pf);
|
|
77
|
+
vec4 texel2 = texelFetch(highlightTexture, iuv + ivec2(+du, dv), 0);
|
|
78
|
+
applyTexel(texel2,pf);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
float getWeight(int pixelDistance) {
|
|
82
|
+
float scaledDistance = float(pixelDistance) * pixelSampleScale / pixelRatio;
|
|
83
|
+
float d0f = floor(scaledDistance);
|
|
84
|
+
int d0 = int(d0f);
|
|
85
|
+
if (d0 >= 8){
|
|
86
|
+
return 0.0;
|
|
87
|
+
}
|
|
88
|
+
float w0 = pascal17[d0];
|
|
89
|
+
float w1 = d0 > 8 ? 0.0 : pascal17[d0+1];
|
|
90
|
+
float f = d0f - d0f;
|
|
91
|
+
return mix(w0, w1, f);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
void main() {
|
|
95
|
+
vec2 highlightTextureSize = vec2(textureSize(highlightTexture,0));
|
|
96
|
+
|
|
97
|
+
ivec2 iuv = ivec2(uv * highlightTextureSize);
|
|
98
|
+
vec4 center = texelFetch(highlightTexture, iuv, 0);
|
|
99
|
+
|
|
100
|
+
vec4 accumulatedColor = vec4(0.0);
|
|
101
|
+
|
|
102
|
+
vec4 cov = texture(coverageTex, uv2 * coverageRounding);
|
|
103
|
+
|
|
104
|
+
bool potentialOutline = cov.g < 1.0;
|
|
105
|
+
if (potentialOutline) {
|
|
106
|
+
// Calculate outline share
|
|
107
|
+
|
|
108
|
+
int maxPixelDistance = clamp(int(8.0 * pixelRatio / pixelSampleScale),2,16);
|
|
109
|
+
|
|
110
|
+
// Calculate denominator for the filter so that the weights sum up to 1.0
|
|
111
|
+
int fs = maxPixelDistance;
|
|
112
|
+
float denom = 0.0;
|
|
113
|
+
for(int y = 0; y <= fs; y += 1) {
|
|
114
|
+
float w = getWeight(y);
|
|
115
|
+
denom += w * (y == 0 ? 1.0 : 2.0);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
for(int y = 0; y <= fs; y += 1) {
|
|
119
|
+
float yFactor = getWeight(y);
|
|
120
|
+
{
|
|
121
|
+
float xFactor = getWeight(0);
|
|
122
|
+
float pf = xFactor * yFactor / (denom*denom);
|
|
123
|
+
if (pf > 0.0) {
|
|
124
|
+
readAndApplyTexel(iuv, 0, +y, pf);
|
|
125
|
+
if (y!=0){
|
|
126
|
+
readAndApplyTexel(iuv, 0, -y, pf);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
for(int x = 1; x <= fs; x += 1) {
|
|
132
|
+
float xFactor = getWeight(x);
|
|
133
|
+
float pf = xFactor * yFactor / (denom*denom);
|
|
134
|
+
if (pf > 0.0) {
|
|
135
|
+
readAndApply2TexelsU(iuv, x, +y, pf);
|
|
136
|
+
if (y!=0){
|
|
137
|
+
readAndApply2TexelsU(iuv, x, -y, pf);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
} else {
|
|
143
|
+
applyTexel(center, 1.0);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
int frontColorIndex = 999;
|
|
147
|
+
int maxColorIndex = 0;
|
|
148
|
+
for (int i=0; i<maxHighlightLevel; ++i){
|
|
149
|
+
if (colorWeight[i] > 0.0){
|
|
150
|
+
frontColorIndex = min(frontColorIndex,i);
|
|
151
|
+
maxColorIndex = max(maxColorIndex,i);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (frontColorIndex == 999){
|
|
156
|
+
discard;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
for (int curColorIndex=maxColorIndex; curColorIndex>=frontColorIndex; --curColorIndex){
|
|
160
|
+
float curColorWeight = colorWeight[curColorIndex];
|
|
161
|
+
if (curColorWeight <= 0.01){
|
|
162
|
+
continue;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
int lic = (curColorIndex >> 2) & 3;
|
|
166
|
+
int llc = curColorIndex & 3;
|
|
167
|
+
int vc = (int(center[lic] * 255.0) >> (llc*2)) & 3;
|
|
168
|
+
bool centerFilled = (vc & 1) == 1;
|
|
169
|
+
bool centerOccluded = centerFilled && ((vc & 2) == 2);
|
|
170
|
+
|
|
171
|
+
float curColorOcclusion = colorOcclusion[curColorIndex];
|
|
172
|
+
bool occluded = centerFilled ? centerOccluded : curColorOcclusion > 0.5 * curColorWeight;
|
|
173
|
+
|
|
174
|
+
int colorChannel = centerFilled ? 0 : 1;
|
|
175
|
+
vec4 colorBase = texelFetch(highlightOptionsTexture,ivec2(curColorIndex,colorChannel),0);
|
|
176
|
+
float occlusionFactor = occluded ? occludedIntensityFactor : 1.0;
|
|
177
|
+
float outlineFactor = centerFilled ? 1.0 : smoothstep(0.0, 0.03, curColorWeight);
|
|
178
|
+
float intensity = colorBase.a * occlusionFactor * outlineFactor;
|
|
179
|
+
|
|
180
|
+
// Compose two RGBAs to be blended to the frame buffer
|
|
181
|
+
vec3 currentColor = colorBase.rgb;
|
|
182
|
+
float a0 = accumulatedColor.a;
|
|
183
|
+
float a1 = intensity;
|
|
184
|
+
float alpha = clamp(a0 + a1 - a0 * a1,0.0,1.0);
|
|
185
|
+
if (alpha > 0.001){
|
|
186
|
+
vec3 blendedColor = ((1.0 - a1) * a0 * accumulatedColor.rgb + a1 * currentColor) / alpha;
|
|
187
|
+
accumulatedColor = vec4(blendedColor, alpha);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
if (accumulatedColor.a < ${n.float(e)}){
|
|
192
|
+
discard;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// Blending equation: gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
|
|
196
|
+
// I.e., colours should not be premultiplied with alpha
|
|
197
|
+
fragColor = accumulatedColor;
|
|
198
|
+
}`),u}const f=Object.freeze(Object.defineProperty({__proto__:null,build:u},Symbol.toStringTag,{value:"Module"}));export{f as H,u as b};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{set as e}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as i}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{ZEROS as r}from"../core/libs/gl-matrix-2/factories/vec4f64.js";import{SliceDraw as o}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{AlignPixel as n}from"../views/3d/webgl-engine/core/shaderLibrary/hud/AlignPixel.glsl.js";import{HUD as t}from"../views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js";import{HUDVisibility as a}from"../views/3d/webgl-engine/core/shaderLibrary/hud/HUDVisibility.glsl.js";import{multipassGeometryTest as l}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassGeometryTest.glsl.js";import{
|
|
5
|
+
import{set as e}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as i}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{ZEROS as r}from"../core/libs/gl-matrix-2/factories/vec4f64.js";import{SliceDraw as o}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{AlignPixel as n}from"../views/3d/webgl-engine/core/shaderLibrary/hud/AlignPixel.glsl.js";import{HUD as t}from"../views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js";import{HUDVisibility as a}from"../views/3d/webgl-engine/core/shaderLibrary/hud/HUDVisibility.glsl.js";import{multipassGeometryTest as l}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassGeometryTest.glsl.js";import{alphaCutoff as d}from"../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff.js";import{addScreenSizePerspectiveAlignment as s}from"../views/3d/webgl-engine/core/shaderLibrary/util/ScreenSizePerspective.glsl.js";import{Float2PassUniform as c}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{Float4PassUniform as p}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as f}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as g}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{ShaderBuilder as v}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{VertexAttribute as S}from"../views/3d/webgl-engine/lib/VertexAttribute.js";function m(i){const r=new v,{vertex:m,fragment:u}=r;return m.include(n),r.include(t,i),r.include(o,i),r.attributes.add(S.UV0,"vec2"),m.uniforms.add(new p("viewport",((e,i)=>i.camera.fullViewport)),new f("lineSize",((e,i)=>e.size>0?Math.max(1,e.size)*i.camera.pixelRatio:0)),new c("pixelToNDC",((i,r)=>e(h,2/r.camera.fullViewport[2],2/r.camera.fullViewport[3]))),new f("borderSize",((e,i)=>null!=e.borderColor?i.camera.pixelRatio:0)),new c("screenOffset",((i,r)=>e(h,i.horizontalScreenOffset*r.camera.pixelRatio,0)))),r.varyings.add("coverageSampling","vec4"),r.varyings.add("lineSizes","vec2"),i.multipassEnabled&&r.varyings.add("depth","float"),i.occlusionTestEnabled&&r.include(a),i.hasScreenSizePerspective&&s(m),m.code.add(g`
|
|
6
6
|
void main(void) {
|
|
7
7
|
ProjectHUDAux projectAux;
|
|
8
8
|
vec4 endPoint = projectPositionHUD(projectAux);
|
|
@@ -87,7 +87,7 @@ import{set as e}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as i}f
|
|
|
87
87
|
|
|
88
88
|
gl_Position = projectedPosition;
|
|
89
89
|
}
|
|
90
|
-
`),
|
|
90
|
+
`),u.uniforms.add(new p("uColor",(e=>b(e.color))),new p("borderColor",(e=>b(e.borderColor)))),i.multipassEnabled&&(u.include(l,i),u.uniforms.add(new c("inverseViewport",((e,i)=>i.inverseViewport)))),u.code.add(g`
|
|
91
91
|
void main() {
|
|
92
92
|
${i.multipassEnabled?"if( geometryDepthTest(gl_FragCoord.xy * inverseViewport, depth) ){ discard; }":""}
|
|
93
93
|
|
|
@@ -105,7 +105,7 @@ import{set as e}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as i}f
|
|
|
105
105
|
float finalAlpha = mix(borderAlpha, 1.0, colorAlpha);
|
|
106
106
|
|
|
107
107
|
${i.depthHudEnabled?g`
|
|
108
|
-
if (finalAlpha <
|
|
108
|
+
if (finalAlpha < ${g.float(d)}) {
|
|
109
109
|
discard;
|
|
110
110
|
}
|
|
111
111
|
`:g`
|
|
@@ -113,4 +113,4 @@ import{set as e}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as i}f
|
|
|
113
113
|
fragColor = vec4(finalRgb, finalAlpha);
|
|
114
114
|
`}
|
|
115
115
|
}
|
|
116
|
-
`),r}function
|
|
116
|
+
`),r}function b(e){return null!=e?e:r}const h=i(),u=Object.freeze(Object.defineProperty({__proto__:null,build:m},Symbol.toStringTag,{value:"Module"}));export{u as L,m as b};
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{alphaCutoff as e}from"../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff.js";import{addProjViewLocalOrigin as o}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float4PassUniform as r}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as t}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as i}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{ShaderBuilder as d}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{VertexAttribute as n}from"../views/3d/webgl-engine/lib/VertexAttribute.js";function s(s){const a=new d,{vertex:l,fragment:v}=a;o(l,s),l.uniforms.add(new t("width",(e=>e.width))),a.attributes.add(n.POSITION,"vec3"),a.attributes.add(n.NORMAL,"vec3"),a.attributes.add(n.UV0,"vec2"),a.attributes.add(n.LENGTH,"float"),a.varyings.add("vtc","vec2"),a.varyings.add("vlength","float"),a.varyings.add("vradius","float"),l.code.add(i`void main(void) {
|
|
6
6
|
vec3 bitangent = normal;
|
|
7
7
|
vtc = uv0;
|
|
8
8
|
vlength = length;
|
|
9
9
|
vradius = 0.5 * width;
|
|
10
10
|
vec4 pos = view * vec4(position + vradius * bitangent * uv0.y, 1.0);
|
|
11
11
|
gl_Position = proj * pos;
|
|
12
|
-
}`),
|
|
13
|
-
const float INV_SQRT2 = ${
|
|
12
|
+
}`),v.uniforms.add(new t("outlineSize",(e=>e.outlineSize)),new r("outlineColor",(e=>e.outlineColor)),new t("stripeLength",(e=>e.stripeLength)),new r("stripeEvenColor",(e=>e.stripeEvenColor)),new r("stripeOddColor",(e=>e.stripeOddColor)));const c=1/Math.sqrt(2);return v.code.add(i`
|
|
13
|
+
const float INV_SQRT2 = ${i.float(c)};
|
|
14
14
|
|
|
15
15
|
vec4 arrowColor(vec2 tc, float len) {
|
|
16
16
|
float d = INV_SQRT2 * (tc.x - abs(tc.y));
|
|
@@ -29,9 +29,9 @@ gl_Position = proj * pos;
|
|
|
29
29
|
void main(void) {
|
|
30
30
|
vec2 ntc = vec2(vtc.x / vradius, vtc.y);
|
|
31
31
|
vec4 color = arrowColor(ntc, vlength / vradius);
|
|
32
|
-
if (color.a
|
|
32
|
+
if (color.a < ${i.float(e)}) {
|
|
33
33
|
discard;
|
|
34
34
|
}
|
|
35
35
|
fragColor = color;
|
|
36
36
|
}
|
|
37
|
-
`),
|
|
37
|
+
`),a}const a=Object.freeze(Object.defineProperty({__proto__:null,build:s},Symbol.toStringTag,{value:"Module"}));export{a as M,s as b};
|