@arcgis/core 4.25.0-next.20220721 → 4.25.0-next.20220722

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.
Files changed (101) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{791220164501a791b2cd.js → 0896986aa60516f716f1.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{59e18862b803fdc41786.js → 0c145b87c24bf6c7d572.js} +1 -1
  4. package/assets/esri/core/workers/chunks/2504c43fac77ecd9ec2a.js +1 -0
  5. package/assets/esri/core/workers/chunks/{39de883f236e2a8d9024.js → 30d7796ee6f7e4a6a3e1.js} +2 -2
  6. package/assets/esri/core/workers/chunks/{39de883f236e2a8d9024.js.LICENSE.txt → 30d7796ee6f7e4a6a3e1.js.LICENSE.txt} +0 -0
  7. package/assets/esri/core/workers/chunks/3281656a9bd3627e41ff.js +1 -0
  8. package/assets/esri/core/workers/chunks/374ee2b2cad26f7ad572.js +1 -0
  9. package/assets/esri/core/workers/chunks/4d14be8c7e8adaa91876.js +1011 -0
  10. package/assets/esri/core/workers/chunks/{c22d7622294fe4aefe0b.js → 4f2d2cc71f5ff5ac2a60.js} +1 -1
  11. package/assets/esri/core/workers/chunks/8b1d5b7e9de73bc9da3a.js +1 -0
  12. package/assets/esri/core/workers/chunks/9dc4db35c387e11e9beb.js +1 -0
  13. package/assets/esri/core/workers/chunks/{42987dcfda665c860151.js → a23376df9696ebe5b5cd.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{e4ad2cf5d6bded02e392.js → ed763fc352d0b55e5867.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{a05f6afcf56245824853.js → f1fdb335c5f9ec8b27cb.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{9493a8e5d6001b6bf275.js → f59f82a43437a51c934c.js} +1 -1
  17. package/assets/esri/widgets/support/t9n/DatePicker.json +1 -1
  18. package/assets/esri/widgets/support/t9n/DatePicker_en.json +1 -1
  19. package/assets/esri/widgets/support/t9n/TimePicker.json +1 -1
  20. package/assets/esri/widgets/support/t9n/TimePicker_en.json +1 -1
  21. package/chunks/DefaultMaterial.glsl.js +42 -37
  22. package/chunks/RealisticTree.glsl.js +25 -25
  23. package/geometry/support/MeshMaterial.js +1 -1
  24. package/geometry/support/MeshMaterialMetallicRoughness.js +1 -1
  25. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  26. package/layers/mixins/ArcGISImageService.js +1 -1
  27. package/package.json +2 -2
  28. package/support/revision.js +1 -1
  29. package/views/2d/engine/webgl/util/Matcher.js +1 -1
  30. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  31. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  32. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  33. package/views/3d/environment/PanoramicAtmosphere.js +1 -1
  34. package/views/3d/environment/SimpleAtmosphere.js +1 -1
  35. package/views/3d/environment/resources/MarsAtmosphereTexture.js +1 -1
  36. package/views/3d/environment/resources/SimpleAtmosphereTexture.js +1 -1
  37. package/views/3d/glTF/LoaderResult.js +1 -1
  38. package/views/3d/glTF/internal/Resource.js +1 -1
  39. package/views/3d/glTF/internal/TextureTransformUtils.js +5 -0
  40. package/views/3d/glTF/loader.js +1 -1
  41. package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
  42. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  43. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  44. package/views/3d/layers/I3SMeshView3D.js +1 -1
  45. package/views/3d/layers/I3SMeshViewLabeler.js +1 -1
  46. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  47. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  48. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  49. package/views/3d/layers/SceneLayerView3D.js +1 -1
  50. package/views/3d/layers/TileLayerView3D.js +1 -1
  51. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  52. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  53. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  54. package/views/3d/layers/i3s/I3SElevationProvider.js +1 -1
  55. package/views/3d/layers/i3s/I3SQueryEngine.js +1 -1
  56. package/views/3d/layers/support/FeatureTileTree3DDebugger.js +1 -1
  57. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  58. package/views/3d/support/CombinedElevationProvider.js +1 -1
  59. package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
  60. package/views/3d/terrain/OverlayManager.js +1 -1
  61. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  62. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  63. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +22 -22
  64. package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js +19 -10
  65. package/views/3d/webgl-engine/core/shaderLibrary/shading/TextureTransformUV.glsl.js +15 -0
  66. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  67. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  68. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  69. package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
  70. package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
  71. package/views/input/recognizers/DoubleTapDrag.js +1 -1
  72. package/views/input/recognizers/Drag.js +1 -1
  73. package/views/input/recognizers/ImmediateDoubleClick.js +1 -1
  74. package/views/input/recognizers/PointerClickHoldAndDrag.js +1 -1
  75. package/views/input/recognizers/SingleAndDoubleClick.js +1 -1
  76. package/views/input/recognizers/VerticalTwoFingerDrag.js +1 -1
  77. package/views/input/recognizers/support.js +1 -1
  78. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  79. package/views/overlay/ViewOverlay.js +1 -1
  80. package/widgets/AreaMeasurement3D.js +1 -1
  81. package/widgets/BuildingExplorer/BuildingExplorerViewModel.js +1 -1
  82. package/widgets/BuildingExplorer.js +1 -1
  83. package/widgets/CoordinateConversion/support/Format.js +1 -1
  84. package/widgets/Daylight.js +1 -1
  85. package/widgets/DirectLineMeasurement3D.js +1 -1
  86. package/widgets/ElevationProfile.js +1 -1
  87. package/widgets/LineOfSight.js +1 -1
  88. package/widgets/ShadowCast.js +1 -1
  89. package/widgets/Slice.js +1 -1
  90. package/widgets/Slider.js +1 -1
  91. package/widgets/TimeSlider.js +1 -1
  92. package/widgets/Weather.js +1 -1
  93. package/widgets/Zoom.js +1 -1
  94. package/widgets/support/DatePicker.js +1 -1
  95. package/widgets/support/TimePicker.js +1 -1
  96. package/assets/esri/core/workers/chunks/0b269862733afe740a63.js +0 -1
  97. package/assets/esri/core/workers/chunks/290cd411d0d18b1d0efd.js +0 -1
  98. package/assets/esri/core/workers/chunks/85a2cf095f002b2c486f.js +0 -1
  99. package/assets/esri/core/workers/chunks/b312dd3027492007d75e.js +0 -1
  100. package/assets/esri/core/workers/chunks/bf348f6f52701fa6016e.js +0 -987
  101. package/assets/esri/core/workers/chunks/c79d4cb3332550fb0df5.js +0 -1
@@ -2,74 +2,79 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as e}from"../core/maybe.js";import{I as r}from"./mat4f64.js";import{ForwardLinearDepth as o}from"../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js";import{Offset as a}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.js";import{ShaderOutput as i}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SliceDraw as t}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as l}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{InstancedDoublePrecision as s}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import{NormalAttribute as n,NormalAttributeType as d}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{PositionAttribute as c}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl.js";import{SymbolColor as g}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js";import{TextureCoordinateAttribute as m}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexColor as p}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{VerticalOffset as u}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 h}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import{EvaluateAmbientOcclusion as f}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import{EvaluateSceneLighting as w}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{multipassTerrainTest as x}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import{Normals as y}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js";import{PhysicallyBasedRendering as C}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import{PhysicallyBasedRenderingParameters as j,PBRMode as M}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReadShadowMapPass as L,ReadShadowMapDraw as T}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{VisualVariables as P}from"../views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js";import{symbolAlphaCutoff as O}from"../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff.js";import{DiscardOrAdjustAlphaPass as A}from"../views/3d/webgl-engine/core/shaderLibrary/util/AlphaDiscard.glsl.js";import{MixExternalColor as S}from"../views/3d/webgl-engine/core/shaderLibrary/util/MixExternalColor.glsl.js";import{addProjViewLocalOrigin as $,addCameraPosition as N}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float3PassUniform as E}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{Float4PassUniform as _}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 F}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{Matrix4PassUniform as V}from"../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform.js";import{ShaderBuilder as B}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DPassUniform as I}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{TransparencyPassType as z}from"../views/3d/webgl-engine/lib/TransparencyPassType.js";import{VertexAttribute as G}from"../views/3d/webgl-engine/lib/VertexAttribute.js";import{ambientBoost as R}from"../views/3d/webgl-engine/lighting/SceneLighting.js";function U(U){const k=new B,W=k.vertex.code,q=k.fragment.code;return $(k,U),k.include(c),k.varyings.add("vpos","vec3"),k.include(P,U),k.include(s,U),k.include(u,U),U.output!==i.Color&&U.output!==i.Alpha||(N(k.vertex,U),k.include(n,U),k.include(l,U),U.normalType===d.Attribute&&U.offsetBackfaces&&k.include(a),k.include(h,U),k.include(v,U),U.instancedColor&&k.attributes.add(G.INSTANCECOLOR,"vec4"),k.varyings.add("localvpos","vec3"),k.include(m,U),k.include(o,U),k.include(g,U),k.include(p,U),k.vertex.uniforms.add(new _("externalColor",(e=>e.externalColor))),k.varyings.add("vcolorExt","vec4"),U.hasMultipassTerrain&&k.varyings.add("depth","float"),U.hasModelTransformation&&k.vertex.uniforms.add(new V("model",(o=>e(o.modelTransformation)?o.modelTransformation:r))),W.add(F`
5
+ import{isSome as e}from"../core/maybe.js";import{I as r}from"./mat4f64.js";import{ForwardLinearDepth as o}from"../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js";import{Offset as a}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.js";import{ShaderOutput as i}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SliceDraw as l}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as t}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{InstancedDoublePrecision as s}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import{NormalAttribute as n,NormalAttributeType as d}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{PositionAttribute as c}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl.js";import{SymbolColor as m}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.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 p}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 h}from"../views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import{ComputeNormalTexture as f}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import{EvaluateAmbientOcclusion as b}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import{EvaluateSceneLighting as w}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{multipassTerrainTest as x}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import{Normals as y}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js";import{PhysicallyBasedRendering as C}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import{PhysicallyBasedRenderingParameters as T,PBRMode as j}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReadShadowMapPass as M,ReadShadowMapDraw as L}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{colorTextureUV as O,normalTextureUV as P,emissiveTextureUV as $,occlusionTextureUV as A,metallicRoughnessTextureUV as N}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TextureTransformUV.glsl.js";import{VisualVariables as S}from"../views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js";import{symbolAlphaCutoff as E}from"../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff.js";import{DiscardOrAdjustAlphaPass as V}from"../views/3d/webgl-engine/core/shaderLibrary/util/AlphaDiscard.glsl.js";import{MixExternalColor as _}from"../views/3d/webgl-engine/core/shaderLibrary/util/MixExternalColor.glsl.js";import{addProjViewLocalOrigin as D,addCameraPosition as F}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float3PassUniform as B}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{Float4PassUniform as U}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as I}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as R}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{Matrix4PassUniform as z}from"../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform.js";import{ShaderBuilder as G}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DPassUniform as k}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{TransparencyPassType as W}from"../views/3d/webgl-engine/lib/TransparencyPassType.js";import{VertexAttribute as q}from"../views/3d/webgl-engine/lib/VertexAttribute.js";import{ambientBoost as H}from"../views/3d/webgl-engine/lighting/SceneLighting.js";function J(J){const K=new G,Q=K.vertex.code,X=K.fragment.code;return D(K,J),K.include(c),K.varyings.add("vpos","vec3"),K.include(S,J),K.include(s,J),K.include(v,J),J.hasColorTextureTransform&&K.include(O),J.output!==i.Color&&J.output!==i.Alpha||(J.hasNormalTextureTransform&&K.include(P),J.hasEmissionTextureTransform&&K.include($),J.hasOcclusionTextureTransform&&K.include(A),J.hasMetallicRoughnessTextureTransform&&K.include(N),F(K.vertex,J),K.include(n,J),K.include(t,J),J.normalType===d.Attribute&&J.offsetBackfaces&&K.include(a),K.include(f,J),K.include(p,J),J.instancedColor&&K.attributes.add(q.INSTANCECOLOR,"vec4"),K.varyings.add("localvpos","vec3"),K.include(g,J),K.include(o,J),K.include(m,J),K.include(u,J),K.vertex.uniforms.add(new U("externalColor",(e=>e.externalColor))),K.varyings.add("vcolorExt","vec4"),J.hasMultipassTerrain&&K.varyings.add("depth","float"),J.hasModelTransformation&&K.vertex.uniforms.add(new z("model",(o=>e(o.modelTransformation)?o.modelTransformation:r))),Q.add(R`
6
6
  void main(void) {
7
7
  forwardNormalizedVertexColor();
8
8
  vcolorExt = externalColor;
9
- ${U.instancedColor?"vcolorExt *= instanceColor;":""}
9
+ ${J.instancedColor?"vcolorExt *= instanceColor;":""}
10
10
  vcolorExt *= vvColor();
11
11
  vcolorExt *= getSymbolColor();
12
12
  forwardColorMixMode();
13
13
 
14
- if (vcolorExt.a < ${F.float(O)}) {
14
+ if (vcolorExt.a < ${R.float(E)}) {
15
15
  gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
16
16
  } else {
17
17
  vpos = calculateVPos();
18
18
  localvpos = vpos - view[3].xyz;
19
19
  vpos = subtractOrigin(vpos);
20
- ${U.normalType===d.Attribute?F`vNormalWorld = dpNormal(vvLocalNormal(normalModel()));`:""}
20
+ ${J.normalType===d.Attribute?R`vNormalWorld = dpNormal(vvLocalNormal(normalModel()));`:""}
21
21
  vpos = addVerticalOffset(vpos, localOrigin);
22
- ${U.hasVertexTangents?"vTangent = dpTransformVertexTangent(tangent);":""}
23
- gl_Position = transformPosition(proj, view, ${U.hasModelTransformation?"model,":""} vpos);
24
- ${U.normalType===d.Attribute&&U.offsetBackfaces?"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);":""}
22
+ ${J.hasVertexTangents?"vTangent = dpTransformVertexTangent(tangent);":""}
23
+ gl_Position = transformPosition(proj, view, ${J.hasModelTransformation?"model,":""} vpos);
24
+ ${J.normalType===d.Attribute&&J.offsetBackfaces?"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);":""}
25
25
  }
26
26
 
27
- ${U.hasMultipassTerrain?"depth = (view * vec4(vpos, 1.0)).z;":""}
27
+ ${J.hasMultipassTerrain?"depth = (view * vec4(vpos, 1.0)).z;":""}
28
28
  forwardLinearDepth();
29
29
  forwardTextureCoordinates();
30
+ ${J.hasColorTextureTransform?R`forwardColorUV();`:""}
31
+ ${J.hasNormalTextureTransform?R`forwardNormalUV();`:""}
32
+ ${J.hasEmissionTextureTransform?R`forwardEmissiveUV();`:""}
33
+ ${J.hasOcclusionTextureTransform?R`forwardOcclusionUV();`:""}
34
+ ${J.hasMetallicRoughnessTextureTransform?R`forwardMetallicRoughnessUV();`:""}
30
35
  }
31
- `)),U.output===i.Alpha&&(k.include(t,U),k.include(A,U),k.include(x,U),k.fragment.uniforms.add([new D("opacity",(e=>e.opacity)),new D("layerOpacity",(e=>e.layerOpacity))]),U.hasColorTexture&&k.fragment.uniforms.add(new I("tex",(e=>e.texture))),k.fragment.include(S),q.add(F`
36
+ `)),J.output===i.Alpha&&(K.include(l,J),K.include(V,J),K.include(x,J),K.fragment.uniforms.add([new I("opacity",(e=>e.opacity)),new I("layerOpacity",(e=>e.layerOpacity))]),J.hasColorTexture&&K.fragment.uniforms.add(new k("tex",(e=>e.texture))),K.fragment.include(_),X.add(R`
32
37
  void main() {
33
38
  discardBySlice(vpos);
34
- ${U.hasMultipassTerrain?"terrainDepthTest(gl_FragCoord, depth);":""}
35
- ${U.hasColorTexture?F`
36
- vec4 texColor = texture2D(tex, vuv0);
37
- ${U.textureAlphaPremultiplied?"texColor.rgb /= texColor.a;":""}
38
- discardOrAdjustAlpha(texColor);`:F`vec4 texColor = vec4(1.0);`}
39
- ${U.hasVertexColors?F`float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:F`float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}
39
+ ${J.hasMultipassTerrain?"terrainDepthTest(gl_FragCoord, depth);":""}
40
+ ${J.hasColorTexture?R`
41
+ vec4 texColor = texture2D(tex, ${J.hasColorTextureTransform?R`colorUV`:R`vuv0`});
42
+ ${J.textureAlphaPremultiplied?"texColor.rgb /= texColor.a;":""}
43
+ discardOrAdjustAlpha(texColor);`:R`vec4 texColor = vec4(1.0);`}
44
+ ${J.hasVertexColors?R`float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:R`float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}
40
45
  gl_FragColor = vec4(opacity_);
41
46
  }
42
- `)),U.output===i.Color&&(k.include(t,U),k.include(w,U),k.include(f,U),k.include(A,U),k.include(U.instancedDoublePrecision?L:T,U),k.include(x,U),N(k.fragment,U),k.fragment.uniforms.add([k.vertex.uniforms.get("localOrigin"),new E("ambient",(e=>e.ambient)),new E("diffuse",(e=>e.diffuse)),new D("opacity",(e=>e.opacity)),new D("layerOpacity",(e=>e.layerOpacity)),new D("lightingGlobalFactor",((e,r)=>r.lighting.globalFactor)),new E("lightingMainIntensity",((e,r)=>r.lighting.mainLight.intensity))]),k.fragment.constants.add("ambientBoostFactor","float",R),U.hasColorTexture&&k.fragment.uniforms.add(new I("tex",(e=>e.texture))),k.include(j,U),k.include(C,U),k.fragment.include(S),k.include(y,U),q.add(F`
47
+ `)),J.output===i.Color&&(K.include(l,J),K.include(w,J),K.include(b,J),K.include(V,J),K.include(J.instancedDoublePrecision?M:L,J),K.include(x,J),F(K.fragment,J),K.fragment.uniforms.add([K.vertex.uniforms.get("localOrigin"),new B("ambient",(e=>e.ambient)),new B("diffuse",(e=>e.diffuse)),new I("opacity",(e=>e.opacity)),new I("layerOpacity",(e=>e.layerOpacity)),new I("lightingGlobalFactor",((e,r)=>r.lighting.globalFactor)),new B("lightingMainIntensity",((e,r)=>r.lighting.mainLight.intensity))]),K.fragment.constants.add("ambientBoostFactor","float",H),J.hasColorTexture&&K.fragment.uniforms.add(new k("tex",(e=>e.texture))),K.include(T,J),K.include(C,J),K.fragment.include(_),K.include(y,J),X.add(R`
43
48
  void main() {
44
49
  discardBySlice(vpos);
45
- ${U.hasMultipassTerrain?"terrainDepthTest(gl_FragCoord, depth);":""}
46
- ${U.hasColorTexture?F`
47
- vec4 texColor = texture2D(tex, vuv0);
48
- ${U.textureAlphaPremultiplied?"texColor.rgb /= texColor.a;":""}
49
- discardOrAdjustAlpha(texColor);`:F`vec4 texColor = vec4(1.0);`}
50
+ ${J.hasMultipassTerrain?"terrainDepthTest(gl_FragCoord, depth);":""}
51
+ ${J.hasColorTexture?R`
52
+ vec4 texColor = texture2D(tex, ${J.hasColorTextureTransform?R`colorUV`:R`vuv0`});
53
+ ${J.textureAlphaPremultiplied?"texColor.rgb /= texColor.a;":""}
54
+ discardOrAdjustAlpha(texColor);`:R`vec4 texColor = vec4(1.0);`}
50
55
  shadingParams.viewDirection = normalize(vpos - cameraPosition);
51
- ${U.normalType===d.ScreenDerivative?F`
52
- vec3 normal = screenDerivativeNormal(localvpos);`:F`
56
+ ${J.normalType===d.ScreenDerivative?R`
57
+ vec3 normal = screenDerivativeNormal(localvpos);`:R`
53
58
  shadingParams.normalView = vNormalWorld;
54
59
  vec3 normal = shadingNormal(shadingParams);`}
55
- ${U.pbrMode===M.Normal?"applyPBRFactors();":""}
60
+ ${J.pbrMode===j.Normal?"applyPBRFactors();":""}
56
61
  float ssao = evaluateAmbientOcclusionInverse();
57
62
  ssao *= getBakedOcclusion();
58
63
 
59
64
  float additionalAmbientScale = additionalDirectedAmbientLight(vpos + localOrigin);
60
- ${U.receiveShadows?"float shadow = readShadowMap(vpos, linearDepth);":U.spherical?"float shadow = lightingGlobalFactor * (1.0 - additionalAmbientScale);":"float shadow = 0.0;"}
65
+ ${J.receiveShadows?"float shadow = readShadowMap(vpos, linearDepth);":J.spherical?"float shadow = lightingGlobalFactor * (1.0 - additionalAmbientScale);":"float shadow = 0.0;"}
61
66
  vec3 matColor = max(ambient, diffuse);
62
- ${U.hasVertexColors?F`
67
+ ${J.hasVertexColors?R`
63
68
  vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
64
- float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:F`
69
+ float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:R`
65
70
  vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
66
71
  float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}
67
- ${U.hasNormalTexture?F`
68
- mat3 tangentSpace = ${U.hasVertexTangents?"computeTangentSpace(normal);":"computeTangentSpace(normal, vpos, vuv0);"}
69
- vec3 shadingNormal = computeTextureNormal(tangentSpace, vuv0);`:F`vec3 shadingNormal = normal;`}
70
- vec3 normalGround = ${U.spherical?F`normalize(vpos + localOrigin);`:F`vec3(0.0, 0.0, 1.0);`}
72
+ ${J.hasNormalTexture?R`
73
+ mat3 tangentSpace = ${J.hasVertexTangents?"computeTangentSpace(normal);":"computeTangentSpace(normal, vpos, vuv0);"}
74
+ vec3 shadingNormal = computeTextureNormal(tangentSpace, vuv0);`:R`vec3 shadingNormal = normal;`}
75
+ vec3 normalGround = ${J.spherical?R`normalize(vpos + localOrigin);`:R`vec3(0.0, 0.0, 1.0);`}
71
76
 
72
- ${U.snowCover?F`
77
+ ${J.snowCover?R`
73
78
  float snow = smoothstep(0.5, 0.55, dot(normal, normalGround));
74
79
  albedo = mix(albedo, vec3(1), snow);
75
80
  shadingNormal = mix(shadingNormal, normal, snow);
@@ -77,14 +82,14 @@ import{isSome as e}from"../core/maybe.js";import{I as r}from"./mat4f64.js";impor
77
82
 
78
83
  vec3 additionalLight = ssao * lightingMainIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
79
84
 
80
- ${U.pbrMode===M.Normal||U.pbrMode===M.Schematic?F`
85
+ ${J.pbrMode===j.Normal||J.pbrMode===j.Schematic?R`
81
86
  float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * lightingMainIntensity[2];
82
- ${U.snowCover?F`
87
+ ${J.snowCover?R`
83
88
  mrr = mix(mrr, vec3(0.0, 1.0, 0.04), snow);
84
89
  emission = mix(emission, vec3(0.0), snow);`:""}
85
90
 
86
- vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:F`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
91
+ vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:R`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
87
92
  gl_FragColor = highlightSlice(vec4(shadedColor, opacity_), vpos);
88
- ${U.transparencyPassType===z.Color?F`gl_FragColor = premultiplyAlpha(gl_FragColor);`:""}
93
+ ${J.transparencyPassType===W.Color?R`gl_FragColor = premultiplyAlpha(gl_FragColor);`:""}
89
94
  }
90
- `)),k.include(b,U),k}const k=Object.freeze(Object.defineProperty({__proto__:null,build:U},Symbol.toStringTag,{value:"Module"}));export{k as D,U as b};
95
+ `)),K.include(h,J),K}const K=Object.freeze(Object.defineProperty({__proto__:null,build:J},Symbol.toStringTag,{value:"Module"}));export{K as D,J 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.25/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 t}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import{NormalAttribute as l}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{PositionAttribute as s}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl.js";import{SymbolColor as n}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js";import{TextureCoordinateAttribute as d}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexColor as c}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js";import{VerticalOffset as g}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js";import{DefaultMaterialAuxiliaryPasses as m}from"../views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import{EvaluateAmbientOcclusion as v}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import{EvaluateSceneLighting as p}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{multipassTerrainTest as b}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import{PhysicallyBasedRendering as u}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import{PhysicallyBasedRenderingParameters as h,PBRMode as w}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReadShadowMapPass as f,ReadShadowMapDraw as y}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{VisualVariables as x}from"../views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js";import{symbolAlphaCutoff as C}from"../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff.js";import{DiscardOrAdjustAlphaPass as L}from"../views/3d/webgl-engine/core/shaderLibrary/util/AlphaDiscard.glsl.js";import{MixExternalColor as M}from"../views/3d/webgl-engine/core/shaderLibrary/util/MixExternalColor.glsl.js";import{addProjViewLocalOrigin as j,addCameraPosition as O}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float3PassUniform as P}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{Float4PassUniform as A}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 S}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{ShaderBuilder as E}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DPassUniform as _}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{TransparencyPassType as T}from"../views/3d/webgl-engine/lib/TransparencyPassType.js";import{VertexAttribute as $}from"../views/3d/webgl-engine/lib/VertexAttribute.js";import{ambientBoost as N}from"../views/3d/webgl-engine/lighting/SceneLighting.js";function D(D){const B=new E,V=B.vertex.code,I=B.fragment.code;return j(B,D),B.include(s),B.varyings.add("vpos","vec3"),B.include(x,D),B.include(t,D),B.include(g,D),D.output!==o.Color&&D.output!==o.Alpha||(O(B.vertex,D),B.include(l,D),B.include(a,D),D.offsetBackfaces&&B.include(r),D.instancedColor&&B.attributes.add($.INSTANCECOLOR,"vec4"),B.varyings.add("vNormalWorld","vec3"),B.varyings.add("localvpos","vec3"),D.hasMultipassTerrain&&B.varyings.add("depth","float"),B.include(d,D),B.include(e,D),B.include(n,D),B.include(c,D),B.vertex.uniforms.add(new A("externalColor",(e=>e.externalColor))),B.varyings.add("vcolorExt","vec4"),V.add(S`
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 t}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import{NormalAttribute as l}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{PositionAttribute as s}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl.js";import{SymbolColor as n}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js";import{TextureCoordinateAttribute as d}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexColor as c}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js";import{VerticalOffset as g}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js";import{DefaultMaterialAuxiliaryPasses as m}from"../views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import{EvaluateAmbientOcclusion as v}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import{EvaluateSceneLighting as p}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{multipassTerrainTest as b}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import{PhysicallyBasedRendering as u}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import{PhysicallyBasedRenderingParameters as h,PBRMode as f}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReadShadowMapPass as w,ReadShadowMapDraw as x}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{VisualVariables as y}from"../views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js";import{symbolAlphaCutoff as C}from"../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff.js";import{DiscardOrAdjustAlphaPass as L}from"../views/3d/webgl-engine/core/shaderLibrary/util/AlphaDiscard.glsl.js";import{MixExternalColor as M}from"../views/3d/webgl-engine/core/shaderLibrary/util/MixExternalColor.glsl.js";import{addProjViewLocalOrigin as j,addCameraPosition as O}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float3PassUniform as P}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{Float4PassUniform as A}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 T}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 E}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{TransparencyPassType as _}from"../views/3d/webgl-engine/lib/TransparencyPassType.js";import{VertexAttribute as $}from"../views/3d/webgl-engine/lib/VertexAttribute.js";import{ambientBoost as N}from"../views/3d/webgl-engine/lighting/SceneLighting.js";function D(D){const V=new S,B=V.vertex.code,I=V.fragment.code;return j(V,D),V.include(s),V.varyings.add("vpos","vec3"),V.include(y,D),V.include(t,D),V.include(g,D),D.output!==o.Color&&D.output!==o.Alpha||(O(V.vertex,D),V.include(l,D),V.include(a,D),D.offsetBackfaces&&V.include(r),D.instancedColor&&V.attributes.add($.INSTANCECOLOR,"vec4"),V.varyings.add("vNormalWorld","vec3"),V.varyings.add("localvpos","vec3"),D.hasMultipassTerrain&&V.varyings.add("depth","float"),V.include(d,D),V.include(e,D),V.include(n,D),V.include(c,D),V.vertex.uniforms.add(new A("externalColor",(e=>e.externalColor))),V.varyings.add("vcolorExt","vec4"),B.add(T`
6
6
  void main(void) {
7
7
  forwardNormalizedVertexColor();
8
8
  vcolorExt = externalColor;
@@ -11,7 +11,7 @@ import{ForwardLinearDepth as e}from"../views/3d/webgl-engine/core/shaderLibrary/
11
11
  vcolorExt *= getSymbolColor();
12
12
  forwardColorMixMode();
13
13
 
14
- if (vcolorExt.a < ${S.float(C)}) {
14
+ if (vcolorExt.a < ${T.float(C)}) {
15
15
  gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
16
16
  } else {
17
17
  vpos = calculateVPos();
@@ -22,32 +22,32 @@ import{ForwardLinearDepth as e}from"../views/3d/webgl-engine/core/shaderLibrary/
22
22
  gl_Position = transformPosition(proj, view, vpos);
23
23
  ${D.offsetBackfaces?"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);":""}
24
24
  }
25
- ${D.hasMultipassTerrain?S`depth = (view * vec4(vpos, 1.0)).z;`:""}
25
+ ${D.hasMultipassTerrain?T`depth = (view * vec4(vpos, 1.0)).z;`:""}
26
26
  forwardLinearDepth();
27
27
  forwardTextureCoordinates();
28
28
  }
29
- `)),D.output===o.Alpha&&(B.include(i,D),B.include(L,D),B.include(b,D),B.fragment.uniforms.add([new F("opacity",(e=>e.opacity)),new F("layerOpacity",(e=>e.layerOpacity))]),D.hasColorTexture&&B.fragment.uniforms.add(new _("tex",(e=>e.texture))),B.fragment.include(M),I.add(S`
29
+ `)),D.output===o.Alpha&&(V.include(i,D),V.include(L,D),V.include(b,D),V.fragment.uniforms.add([new F("opacity",(e=>e.opacity)),new F("layerOpacity",(e=>e.layerOpacity))]),D.hasColorTexture&&V.fragment.uniforms.add(new E("tex",(e=>e.texture))),V.fragment.include(M),I.add(T`
30
30
  void main() {
31
31
  discardBySlice(vpos);
32
- ${D.hasMultipassTerrain?S`terrainDepthTest(gl_FragCoord, depth);`:""}
33
- ${D.hasColorTexture?S`
34
- vec4 texColor = texture2D(tex, vuv0);
32
+ ${D.hasMultipassTerrain?T`terrainDepthTest(gl_FragCoord, depth);`:""}
33
+ ${D.hasColorTexture?T`
34
+ vec4 texColor = texture2D(tex, ${D.hasColorTextureTransform?T`colorUV`:T`vuv0`});
35
35
  ${D.textureAlphaPremultiplied?"texColor.rgb /= texColor.a;":""}
36
- discardOrAdjustAlpha(texColor);`:S`vec4 texColor = vec4(1.0);`}
37
- ${D.hasVertexColors?S`float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:S`float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}
36
+ discardOrAdjustAlpha(texColor);`:T`vec4 texColor = vec4(1.0);`}
37
+ ${D.hasVertexColors?T`float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:T`float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}
38
38
 
39
39
  gl_FragColor = vec4(opacity_);
40
40
  }
41
- `)),D.output===o.Color&&(B.include(i,D),B.include(p,D),B.include(v,D),B.include(L,D),B.include(D.instancedDoublePrecision?f:y,D),B.include(b,D),O(B.fragment,D),B.fragment.uniforms.add([B.vertex.uniforms.get("localOrigin"),B.vertex.uniforms.get("view"),new P("ambient",(e=>e.ambient)),new P("diffuse",(e=>e.diffuse)),new F("opacity",(e=>e.opacity)),new F("layerOpacity",(e=>e.layerOpacity)),new F("lightingGlobalFactor",((e,r)=>r.lighting.globalFactor)),new P("lightingMainIntensity",((e,r)=>r.lighting.mainLight.intensity))]),B.fragment.constants.add("ambientBoostFactor","float",N),D.hasColorTexture&&B.fragment.uniforms.add(new _("tex",(e=>e.texture))),B.include(h,D),B.include(u,D),B.fragment.include(M),B.extensions.add("GL_OES_standard_derivatives"),I.add(S`
41
+ `)),D.output===o.Color&&(V.include(i,D),V.include(p,D),V.include(v,D),V.include(L,D),V.include(D.instancedDoublePrecision?w:x,D),V.include(b,D),O(V.fragment,D),V.fragment.uniforms.add([V.vertex.uniforms.get("localOrigin"),V.vertex.uniforms.get("view"),new P("ambient",(e=>e.ambient)),new P("diffuse",(e=>e.diffuse)),new F("opacity",(e=>e.opacity)),new F("layerOpacity",(e=>e.layerOpacity)),new F("lightingGlobalFactor",((e,r)=>r.lighting.globalFactor)),new P("lightingMainIntensity",((e,r)=>r.lighting.mainLight.intensity))]),V.fragment.constants.add("ambientBoostFactor","float",N),D.hasColorTexture&&V.fragment.uniforms.add(new E("tex",(e=>e.texture))),V.include(h,D),V.include(u,D),V.fragment.include(M),V.extensions.add("GL_OES_standard_derivatives"),I.add(T`
42
42
  void main() {
43
43
  discardBySlice(vpos);
44
- ${D.hasMultipassTerrain?S`terrainDepthTest(gl_FragCoord, depth);`:""}
45
- ${D.hasColorTexture?S`
46
- vec4 texColor = texture2D(tex, vuv0);
44
+ ${D.hasMultipassTerrain?T`terrainDepthTest(gl_FragCoord, depth);`:""}
45
+ ${D.hasColorTexture?T`
46
+ vec4 texColor = texture2D(tex, ${D.hasColorTextureTransform?T`colorUV`:T`vuv0`});
47
47
  ${D.textureAlphaPremultiplied?"texColor.rgb /= texColor.a;":""}
48
- discardOrAdjustAlpha(texColor);`:S`vec4 texColor = vec4(1.0);`}
48
+ discardOrAdjustAlpha(texColor);`:T`vec4 texColor = vec4(1.0);`}
49
49
  vec3 viewDirection = normalize(vpos - cameraPosition);
50
- ${D.pbrMode===w.Normal?"applyPBRFactors();":""}
50
+ ${D.pbrMode===f.Normal?"applyPBRFactors();":""}
51
51
  float ssao = evaluateAmbientOcclusionInverse();
52
52
  ssao *= getBakedOcclusion();
53
53
 
@@ -55,13 +55,13 @@ import{ForwardLinearDepth as e}from"../views/3d/webgl-engine/core/shaderLibrary/
55
55
  vec3 additionalLight = ssao * lightingMainIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
56
56
  ${D.receiveShadows?"float shadow = readShadowMap(vpos, linearDepth);":D.spherical?"float shadow = lightingGlobalFactor * (1.0 - additionalAmbientScale);":"float shadow = 0.0;"}
57
57
  vec3 matColor = max(ambient, diffuse);
58
- ${D.hasVertexColors?S`
58
+ ${D.hasVertexColors?T`
59
59
  vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
60
- float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:S`
60
+ float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:T`
61
61
  vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
62
62
  float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}
63
- ${D.snowCover?S`albedo = mix(albedo, vec3(1), 0.9);`:S``}
64
- ${S`
63
+ ${D.snowCover?T`albedo = mix(albedo, vec3(1), 0.9);`:T``}
64
+ ${T`
65
65
  vec3 shadingNormal = normalize(vNormalWorld);
66
66
  albedo *= 1.2;
67
67
  vec3 viewForward = vec3(view[0][2], view[1][2], view[2][2]);
@@ -70,15 +70,15 @@ import{ForwardLinearDepth as e}from"../views/3d/webgl-engine/core/shaderLibrary/
70
70
  float treeRadialFalloff = vColor.r;
71
71
  float backLightFactor = 0.5 * treeRadialFalloff * alignmentLightView * transmittance * (1.0 - shadow);
72
72
  additionalLight += backLightFactor * lightingMainIntensity;`}
73
- ${D.pbrMode===w.Normal||D.pbrMode===w.Schematic?D.spherical?S`vec3 normalGround = normalize(vpos + localOrigin);`:S`vec3 normalGround = vec3(0.0, 0.0, 1.0);`:S``}
74
- ${D.pbrMode===w.Normal||D.pbrMode===w.Schematic?S`
73
+ ${D.pbrMode===f.Normal||D.pbrMode===f.Schematic?D.spherical?T`vec3 normalGround = normalize(vpos + localOrigin);`:T`vec3 normalGround = vec3(0.0, 0.0, 1.0);`:T``}
74
+ ${D.pbrMode===f.Normal||D.pbrMode===f.Schematic?T`
75
75
  float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * lightingMainIntensity[2];
76
- ${D.snowCover?S`
76
+ ${D.snowCover?T`
77
77
  mrr = vec3(0.0, 1.0, 0.04);
78
78
  emission = vec3(0.0);`:""}
79
79
 
80
- vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:S`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
80
+ vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:T`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
81
81
  gl_FragColor = highlightSlice(vec4(shadedColor, opacity_), vpos);
82
- ${D.transparencyPassType===T.Color?S`gl_FragColor = premultiplyAlpha(gl_FragColor);`:S``}
82
+ ${D.transparencyPassType===_.Color?T`gl_FragColor = premultiplyAlpha(gl_FragColor);`:T``}
83
83
  }
84
- `)),B.include(m,D),B}const B=Object.freeze(Object.defineProperty({__proto__:null,build:D},Symbol.toStringTag,{value:"Module"}));export{B as R,D as b};
84
+ `)),V.include(m,D),V}const V=Object.freeze(Object.defineProperty({__proto__:null,build:D},Symbol.toStringTag,{value:"Module"}));export{V as R,D as b};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as o}from"../../chunks/tslib.es6.js";import e from"../../Color.js";import{JSONSupport as t}from"../../core/JSONSupport.js";import{isSome as r}from"../../core/maybe.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import s from"./MeshTexture.js";var p;let n=p=class extends t{constructor(o){super(o),this.color=null,this.colorTexture=null,this.normalTexture=null,this.alphaMode="auto",this.alphaCutoff=.5,this.doubleSided=!0}clone(){return this.cloneWithDeduplication(null,new Map)}cloneWithDeduplication(o,e){const t=r(o)?o.get(this):null;if(t)return t;const l=new p(this.clonePropertiesWithDeduplication(e));return r(o)&&o.set(this,l),l}clonePropertiesWithDeduplication(o){return{color:r(this.color)?this.color.clone():null,colorTexture:r(this.colorTexture)?this.colorTexture.cloneWithDeduplication(o):null,normalTexture:r(this.normalTexture)?this.normalTexture.cloneWithDeduplication(o):null,alphaMode:this.alphaMode,alphaCutoff:this.alphaCutoff,doubleSided:this.doubleSided}}};o([l({type:e,json:{write:!0}})],n.prototype,"color",void 0),o([l({type:s,json:{write:!0}})],n.prototype,"colorTexture",void 0),o([l({type:s,json:{write:!0}})],n.prototype,"normalTexture",void 0),o([l({nonNullable:!0,json:{write:!0}})],n.prototype,"alphaMode",void 0),o([l({nonNullable:!0,json:{write:!0}})],n.prototype,"alphaCutoff",void 0),o([l({nonNullable:!0,json:{write:!0}})],n.prototype,"doubleSided",void 0),n=p=o([i("esri.geometry.support.MeshMaterial")],n);const u=n;export{u as default};
5
+ import{_ as o}from"../../chunks/tslib.es6.js";import r from"../../Color.js";import{JSONSupport as e}from"../../core/JSONSupport.js";import{isSome as t}from"../../core/maybe.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import i from"./MeshTexture.js";var n;let u=n=class extends e{constructor(o){super(o),this.color=null,this.colorTexture=null,this.normalTexture=null,this.alphaMode="auto",this.alphaCutoff=.5,this.doubleSided=!0}clone(){return this.cloneWithDeduplication(null,new Map)}cloneWithDeduplication(o,r){const e=t(o)?o.get(this):null;if(e)return e;const l=new n(this.clonePropertiesWithDeduplication(r));return t(o)&&o.set(this,l),l}clonePropertiesWithDeduplication(o){return{color:t(this.color)?this.color.clone():null,colorTexture:t(this.colorTexture)?this.colorTexture.cloneWithDeduplication(o):null,normalTexture:t(this.normalTexture)?this.normalTexture.cloneWithDeduplication(o):null,alphaMode:this.alphaMode,alphaCutoff:this.alphaCutoff,doubleSided:this.doubleSided,colorTextureTransform:t(this.colorTextureTransform)?this.colorTextureTransform:null,normalTextureTransform:t(this.normalTextureTransform)?this.normalTextureTransform:null}}};o([l({type:r,json:{write:!0}})],u.prototype,"color",void 0),o([l({type:i,json:{write:!0}})],u.prototype,"colorTexture",void 0),o([l({type:i,json:{write:!0}})],u.prototype,"normalTexture",void 0),o([l({nonNullable:!0,json:{write:!0}})],u.prototype,"alphaMode",void 0),o([l({nonNullable:!0,json:{write:!0}})],u.prototype,"alphaCutoff",void 0),o([l({nonNullable:!0,json:{write:!0}})],u.prototype,"doubleSided",void 0),o([l()],u.prototype,"colorTextureTransform",void 0),o([l()],u.prototype,"normalTextureTransform",void 0),u=n=o([s("esri.geometry.support.MeshMaterial")],u);const a=u;export{a as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Color.js";import{isSome as o}from"../../core/maybe.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import r from"./MeshMaterial.js";import l from"./MeshTexture.js";var n;let u=n=class extends r{constructor(e){super(e),this.emissiveColor=null,this.emissiveTexture=null,this.occlusionTexture=null,this.metallic=1,this.roughness=1,this.metallicRoughnessTexture=null}clone(){return this.cloneWithDeduplication(null,new Map)}cloneWithDeduplication(e,t){const s=o(e)?e.get(this):null;if(s)return s;const i=new n(this.clonePropertiesWithDeduplication(t));return o(e)&&e.set(this,i),i}clonePropertiesWithDeduplication(e){return{...super.clonePropertiesWithDeduplication(e),emissiveColor:o(this.emissiveColor)?this.emissiveColor.clone():null,emissiveTexture:o(this.emissiveTexture)?this.emissiveTexture.cloneWithDeduplication(e):null,occlusionTexture:o(this.occlusionTexture)?this.occlusionTexture.cloneWithDeduplication(e):null,metallic:this.metallic,roughness:this.roughness,metallicRoughnessTexture:o(this.metallicRoughnessTexture)?this.metallicRoughnessTexture.cloneWithDeduplication(e):null}}};e([s({type:t,json:{write:!0}})],u.prototype,"emissiveColor",void 0),e([s({type:l,json:{write:!0}})],u.prototype,"emissiveTexture",void 0),e([s({type:l,json:{write:!0}})],u.prototype,"occlusionTexture",void 0),e([s({type:Number,nonNullable:!0,json:{write:!0},range:{min:0,max:1}})],u.prototype,"metallic",void 0),e([s({type:Number,nonNullable:!0,json:{write:!0},range:{min:0,max:1}})],u.prototype,"roughness",void 0),e([s({type:l,json:{write:!0}})],u.prototype,"metallicRoughnessTexture",void 0),u=n=e([i("esri.geometry.support.MeshMaterialMetallicRoughness")],u);const c=u;export{c as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import s from"../../Color.js";import{isSome as o}from"../../core/maybe.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import i from"./MeshMaterial.js";import l from"./MeshTexture.js";var n;let u=n=class extends i{constructor(e){super(e),this.emissiveColor=null,this.emissiveTexture=null,this.occlusionTexture=null,this.metallic=1,this.roughness=1,this.metallicRoughnessTexture=null}clone(){return this.cloneWithDeduplication(null,new Map)}cloneWithDeduplication(e,s){const t=o(e)?e.get(this):null;if(t)return t;const r=new n(this.clonePropertiesWithDeduplication(s));return o(e)&&e.set(this,r),r}clonePropertiesWithDeduplication(e){return{...super.clonePropertiesWithDeduplication(e),emissiveColor:o(this.emissiveColor)?this.emissiveColor.clone():null,emissiveTexture:o(this.emissiveTexture)?this.emissiveTexture.cloneWithDeduplication(e):null,occlusionTexture:o(this.occlusionTexture)?this.occlusionTexture.cloneWithDeduplication(e):null,metallic:this.metallic,roughness:this.roughness,metallicRoughnessTexture:o(this.metallicRoughnessTexture)?this.metallicRoughnessTexture.cloneWithDeduplication(e):null,occlusionTextureTransform:o(this.occlusionTextureTransform)?this.occlusionTextureTransform:null,emissiveTextureTransform:o(this.emissiveTextureTransform)?this.emissiveTextureTransform:null,metallicRoughnessTextureTransform:o(this.metallicRoughnessTextureTransform)?this.metallicRoughnessTextureTransform:null}}};e([t({type:s,json:{write:!0}})],u.prototype,"emissiveColor",void 0),e([t({type:l,json:{write:!0}})],u.prototype,"emissiveTexture",void 0),e([t({type:l,json:{write:!0}})],u.prototype,"occlusionTexture",void 0),e([t({type:Number,nonNullable:!0,json:{write:!0},range:{min:0,max:1}})],u.prototype,"metallic",void 0),e([t({type:Number,nonNullable:!0,json:{write:!0},range:{min:0,max:1}})],u.prototype,"roughness",void 0),e([t({type:l,json:{write:!0}})],u.prototype,"metallicRoughnessTexture",void 0),e([t()],u.prototype,"occlusionTextureTransform",void 0),e([t()],u.prototype,"emissiveTextureTransform",void 0),e([t()],u.prototype,"metallicRoughnessTextureTransform",void 0),u=n=e([r("esri.geometry.support.MeshMaterialMetallicRoughness")],u);const c=u;export{c as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../Color.js";import e from"../../../request.js";import{getOrCreateMapValue as r}from"../../../core/MapUtils.js";import{hasScaling as o}from"../../../core/mathUtils.js";import{isSome as n,unwrap as s,applySome as i,isNone as a}from"../../../core/maybe.js";import{b as c}from"../../../chunks/mat3.js";import{c as l}from"../../../chunks/mat3f64.js";import{f as u}from"../../../chunks/vec3f64.js";import{f}from"../../../chunks/vec4f64.js";import m from"../MeshComponent.js";import p from"../MeshMaterialMetallicRoughness.js";import d from"../MeshTexture.js";import{MeshVertexAttributes as g}from"../MeshVertexAttributes.js";import{BufferViewVec4f as h,BufferViewVec4u8 as x,BufferViewVec4u16 as v,BufferViewVec3u8 as w,BufferViewVec3f as b,BufferViewVec3u16 as j,BufferViewVec3f64 as y,BufferViewVec2f as A}from"../buffer/BufferView.js";import{t as M,a as C,n as T,s as E,b as R}from"../../../chunks/vec32.js";import{t as k,n as B,s as F,a as $}from"../../../chunks/vec42.js";import{createBuffer as I}from"../buffer/utils.js";import{georeferenceByTransform as L}from"./georeference.js";import{DefaultLoadingContext as S}from"../../../views/3d/glTF/DefaultLoadingContext.js";import{load as N}from"../../../views/3d/glTF/loader.js";import{triangleFanToTriangles as O,triangleStripToTriangles as _,trianglesToTriangles as D}from"../../../views/3d/glTF/internal/indexUtils.js";import{generateIndexArray as G}from"../../../views/3d/webgl-engine/lib/geometryDataUtils.js";import{COLOR_GAMMA as P}from"../../../views/3d/webgl-engine/materials/DefaultMaterial_COLOR_GAMMA.js";import{PrimitiveType as U,TextureWrapMode as V}from"../../../views/webgl/enums.js";import{f as q,c as z}from"../../../chunks/vec33.js";import{f as K,c as Q}from"../../../chunks/vec43.js";import{n as H,f as J}from"../../../chunks/vec22.js";async function W(t,e,r){const o=new S(X(r)),s=(await N(o,e,r,!0)).model,i=s.lods.shift(),a=new Map,c=new Map;s.textures.forEach(((t,e)=>a.set(e,et(t)))),s.materials.forEach(((t,e)=>c.set(e,rt(t,a))));const l=tt(i);for(const n of l.parts)ot(l,n,c);const{position:u,normal:f,tangent:m,color:p,texCoord0:d}=l.vertexAttributes,h={position:u.typedBuffer,normal:n(f)?f.typedBuffer:null,tangent:n(m)?m.typedBuffer:null,uv:n(d)?d.typedBuffer:null,color:n(p)?p.typedBuffer:null},x=L(h,t,r);return{transform:x.transform,components:l.components,spatialReference:t.spatialReference,vertexAttributes:new g({position:x.vertexAttributes.position,normal:x.vertexAttributes.normal,tangent:x.vertexAttributes.tangent,color:h.color,uv:h.uv})}}function X(t){return t?.resolveFile?{busy:!1,request:async(r,o,s)=>{const i=t.resolveFile(r),a="image"===o?"image":"binary"===o?"array-buffer":"json";return(await e(i,{responseType:a,signal:n(s)?s.signal:null})).data}}:null}function Y(t,e){if(a(t))return"-";const o=t.typedBuffer;return`${r(e,o.buffer,(()=>e.size))}/${o.byteOffset}/${o.byteLength}`}function Z(t){return n(t)?t.toString():"-"}function tt(t){let e=0;const has={color:!1,tangent:!1,normal:!1,texCoord0:!1},o=new Map,n=new Map,s=[];for(const i of t.parts){const{attributes:{position:t,normal:a,color:c,tangent:l,texCoord0:u}}=i,f=`\n ${Y(t,o)}/\n ${Y(a,o)}/\n ${Y(c,o)}/\n ${Y(l,o)}/\n ${Y(u,o)}/\n ${Z(i.transform)}\n `;let m=!1;const p=r(n,f,(()=>(m=!0,{start:e,length:t.count})));m&&(e+=t.count),a&&(has.normal=!0),c&&(has.color=!0),l&&(has.tangent=!0),u&&(has.texCoord0=!0),s.push({gltf:i,writeVertices:m,region:p})}return{vertexAttributes:{position:I(y,e),normal:has.normal?I(b,e):null,tangent:has.tangent?I(h,e):null,color:has.color?I(x,e):null,texCoord0:has.texCoord0?I(A,e):null},parts:s,components:[]}}function et(t){return new d({data:t.data,wrap:at(t.parameters.wrap)})}function rt(e,r){const o=new t(ut(e.color,e.opacity)),n=e.emissiveFactor?new t(ft(e.emissiveFactor)):null;return new p({color:o,colorTexture:s(i(e.textureColor,(t=>r.get(t)))),normalTexture:s(i(e.textureNormal,(t=>r.get(t)))),emissiveColor:n,emissiveTexture:s(i(e.textureEmissive,(t=>r.get(t)))),occlusionTexture:s(i(e.textureOcclusion,(t=>r.get(t)))),alphaMode:it(e.alphaMode),alphaCutoff:e.alphaCutoff,doubleSided:e.doubleSided,metallic:e.metallicFactor,roughness:e.roughnessFactor,metallicRoughnessTexture:s(i(e.textureMetallicRoughness,(t=>r.get(t))))})}function ot(t,e,r){e.writeVertices&&nt(t,e);const o=e.gltf,n=st(o.indices||o.attributes.position.count,o.primitiveType),s=e.region.start;if(s)for(let i=0;i<n.length;i++)n[i]+=s;t.components.push(new m({faces:n,material:r.get(o.material),trustSourceNormals:!0}))}function nt(t,e){const{position:r,normal:s,tangent:i,color:a,texCoord0:u}=t.vertexAttributes,f=e.region.start,{attributes:m,transform:p}=e.gltf,d=m.position.count;if(M(r.slice(f,d),m.position,p),n(m.normal)&&n(s)){const t=c(l(),p),e=s.slice(f,d);C(e,m.normal,t),o(t)&&T(e,e)}else n(s)&&q(s,0,0,1,{dstIndex:f,count:d});if(n(m.tangent)&&n(i)){const t=c(l(),p),e=i.slice(f,d);k(e,m.tangent,t),o(t)&&B(e,e)}else n(i)&&K(i,0,0,1,1,{dstIndex:f,count:d});if(n(m.texCoord0)&&n(u)?H(u.slice(f,d),m.texCoord0):n(u)&&J(u,0,0,{dstIndex:f,count:d}),n(m.color)&&n(a)){const t=m.color,e=a.slice(f,d);if(4===t.elementCount)t instanceof h?F(e,t,255):t instanceof x?Q(e,t):t instanceof v&&$(e,t,8);else{K(e,255,255,255,255);const r=w.fromTypedArray(e.typedBuffer,e.typedBufferStride);t instanceof b?E(r,t,255):t instanceof w?z(r,t):t instanceof j&&R(r,t,8)}}else n(a)&&K(a.slice(f,d),255,255,255,255)}function st(t,e){switch(e){case U.TRIANGLES:return D(t,G);case U.TRIANGLE_STRIP:return _(t);case U.TRIANGLE_FAN:return O(t)}}function it(t){switch(t){case"OPAQUE":return"opaque";case"MASK":return"mask";case"BLEND":return"blend"}}function at(t){return{horizontal:ct(t.s),vertical:ct(t.t)}}function ct(t){switch(t){case V.CLAMP_TO_EDGE:return"clamp";case V.MIRRORED_REPEAT:return"mirror";case V.REPEAT:return"repeat"}}function lt(t){return t**(1/P)*255}function ut(t,e){return f(lt(t[0]),lt(t[1]),lt(t[2]),e)}function ft(t){return u(lt(t[0]),lt(t[1]),lt(t[2]))}export{W as loadGLTFMesh};
5
+ import e from"../../../Color.js";import t from"../../../request.js";import{getOrCreateMapValue as r}from"../../../core/MapUtils.js";import{hasScaling as o}from"../../../core/mathUtils.js";import{isSome as n,unwrap as s,applySome as i,isNone as a}from"../../../core/maybe.js";import{b as u}from"../../../chunks/mat3.js";import{c}from"../../../chunks/mat3f64.js";import{f as l}from"../../../chunks/vec3f64.js";import{f}from"../../../chunks/vec4f64.js";import m from"../MeshComponent.js";import p from"../MeshMaterialMetallicRoughness.js";import g from"../MeshTexture.js";import{MeshVertexAttributes as d}from"../MeshVertexAttributes.js";import{BufferViewVec4f as x,BufferViewVec4u8 as T,BufferViewVec4u16 as h,BufferViewVec3u8 as v,BufferViewVec3f as w,BufferViewVec3u16 as b,BufferViewVec3f64 as j,BufferViewVec2f as y}from"../buffer/BufferView.js";import{t as A,a as M,n as C,s as R,b as E}from"../../../chunks/vec32.js";import{t as k,n as B,s as F,a as $}from"../../../chunks/vec42.js";import{createBuffer as I}from"../buffer/utils.js";import{georeferenceByTransform as L}from"./georeference.js";import{DefaultLoadingContext as S}from"../../../views/3d/glTF/DefaultLoadingContext.js";import{load as N}from"../../../views/3d/glTF/loader.js";import{triangleFanToTriangles as O,triangleStripToTriangles as _,trianglesToTriangles as D}from"../../../views/3d/glTF/internal/indexUtils.js";import{generateIndexArray as G}from"../../../views/3d/webgl-engine/lib/geometryDataUtils.js";import{COLOR_GAMMA as P}from"../../../views/3d/webgl-engine/materials/DefaultMaterial_COLOR_GAMMA.js";import{PrimitiveType as U,TextureWrapMode as V}from"../../../views/webgl/enums.js";import{f as q,c as z}from"../../../chunks/vec33.js";import{f as K,c as Q}from"../../../chunks/vec43.js";import{n as H,f as J}from"../../../chunks/vec22.js";async function W(e,t,r){const o=new S(X(r)),s=(await N(o,t,r,!0)).model,i=s.lods.shift(),a=new Map,u=new Map;s.textures.forEach(((e,t)=>a.set(t,te(e)))),s.materials.forEach(((e,t)=>u.set(t,re(e,a))));const c=ee(i);for(const n of c.parts)oe(c,n,u);const{position:l,normal:f,tangent:m,color:p,texCoord0:g}=c.vertexAttributes,x={position:l.typedBuffer,normal:n(f)?f.typedBuffer:null,tangent:n(m)?m.typedBuffer:null,uv:n(g)?g.typedBuffer:null,color:n(p)?p.typedBuffer:null},T=L(x,e,r);return{transform:T.transform,components:c.components,spatialReference:e.spatialReference,vertexAttributes:new d({position:T.vertexAttributes.position,normal:T.vertexAttributes.normal,tangent:T.vertexAttributes.tangent,color:x.color,uv:x.uv})}}function X(e){return e?.resolveFile?{busy:!1,request:async(r,o,s)=>{const i=e.resolveFile(r),a="image"===o?"image":"binary"===o?"array-buffer":"json";return(await t(i,{responseType:a,signal:n(s)?s.signal:null})).data}}:null}function Y(e,t){if(a(e))return"-";const o=e.typedBuffer;return`${r(t,o.buffer,(()=>t.size))}/${o.byteOffset}/${o.byteLength}`}function Z(e){return n(e)?e.toString():"-"}function ee(e){let t=0;const has={color:!1,tangent:!1,normal:!1,texCoord0:!1},o=new Map,n=new Map,s=[];for(const i of e.parts){const{attributes:{position:e,normal:a,color:u,tangent:c,texCoord0:l}}=i,f=`\n ${Y(e,o)}/\n ${Y(a,o)}/\n ${Y(u,o)}/\n ${Y(c,o)}/\n ${Y(l,o)}/\n ${Z(i.transform)}\n `;let m=!1;const p=r(n,f,(()=>(m=!0,{start:t,length:e.count})));m&&(t+=e.count),a&&(has.normal=!0),u&&(has.color=!0),c&&(has.tangent=!0),l&&(has.texCoord0=!0),s.push({gltf:i,writeVertices:m,region:p})}return{vertexAttributes:{position:I(j,t),normal:has.normal?I(w,t):null,tangent:has.tangent?I(x,t):null,color:has.color?I(T,t):null,texCoord0:has.texCoord0?I(y,t):null},parts:s,components:[]}}function te(e){return new g({data:e.data,wrap:ae(e.parameters.wrap)})}function re(t,r){const o=new e(le(t.color,t.opacity)),n=t.emissiveFactor?new e(fe(t.emissiveFactor)):null;return new p({color:o,colorTexture:s(i(t.textureColor,(e=>r.get(e)))),normalTexture:s(i(t.textureNormal,(e=>r.get(e)))),emissiveColor:n,emissiveTexture:s(i(t.textureEmissive,(e=>r.get(e)))),occlusionTexture:s(i(t.textureOcclusion,(e=>r.get(e)))),alphaMode:ie(t.alphaMode),alphaCutoff:t.alphaCutoff,doubleSided:t.doubleSided,metallic:t.metallicFactor,roughness:t.roughnessFactor,metallicRoughnessTexture:s(i(t.textureMetallicRoughness,(e=>r.get(e)))),colorTextureTransform:t.colorTextureTransform,normalTextureTransform:t.normalTextureTransform,occlusionTextureTransform:t.occlusionTextureTransform,emissiveTextureTransform:t.emissiveTextureTransform,metallicRoughnessTextureTransform:t.metallicRoughnessTextureTransform})}function oe(e,t,r){t.writeVertices&&ne(e,t);const o=t.gltf,n=se(o.indices||o.attributes.position.count,o.primitiveType),s=t.region.start;if(s)for(let i=0;i<n.length;i++)n[i]+=s;e.components.push(new m({faces:n,material:r.get(o.material),trustSourceNormals:!0}))}function ne(e,t){const{position:r,normal:s,tangent:i,color:a,texCoord0:l}=e.vertexAttributes,f=t.region.start,{attributes:m,transform:p}=t.gltf,g=m.position.count;if(A(r.slice(f,g),m.position,p),n(m.normal)&&n(s)){const e=u(c(),p),t=s.slice(f,g);M(t,m.normal,e),o(e)&&C(t,t)}else n(s)&&q(s,0,0,1,{dstIndex:f,count:g});if(n(m.tangent)&&n(i)){const e=u(c(),p),t=i.slice(f,g);k(t,m.tangent,e),o(e)&&B(t,t)}else n(i)&&K(i,0,0,1,1,{dstIndex:f,count:g});if(n(m.texCoord0)&&n(l)?H(l.slice(f,g),m.texCoord0):n(l)&&J(l,0,0,{dstIndex:f,count:g}),n(m.color)&&n(a)){const e=m.color,t=a.slice(f,g);if(4===e.elementCount)e instanceof x?F(t,e,255):e instanceof T?Q(t,e):e instanceof h&&$(t,e,8);else{K(t,255,255,255,255);const r=v.fromTypedArray(t.typedBuffer,t.typedBufferStride);e instanceof w?R(r,e,255):e instanceof v?z(r,e):e instanceof b&&E(r,e,8)}}else n(a)&&K(a.slice(f,g),255,255,255,255)}function se(e,t){switch(t){case U.TRIANGLES:return D(e,G);case U.TRIANGLE_STRIP:return _(e);case U.TRIANGLE_FAN:return O(e)}}function ie(e){switch(e){case"OPAQUE":return"opaque";case"MASK":return"mask";case"BLEND":return"blend"}}function ae(e){return{horizontal:ue(e.s),vertical:ue(e.t)}}function ue(e){switch(e){case V.CLAMP_TO_EDGE:return"clamp";case V.MIRRORED_REPEAT:return"mirror";case V.REPEAT:return"repeat"}}function ce(e){return e**(1/P)*255}function le(e,t){return f(ce(e[0]),ce(e[1]),ce(e[2]),t)}function fe(e){return l(ce(e[0]),ce(e[1]),ce(e[2]))}export{W as loadGLTFMesh};