@arcgis/core 4.34.0-next.30 → 4.34.0-next.31

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 (81) hide show
  1. package/WebScene.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/0ca8d6516323fc28dd58.js +1 -0
  4. package/assets/esri/core/workers/chunks/{031c4b4bf78079d0002d.js → 36024406932b0a44a74a.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{4e267a813e8b10d10b3b.js → 37bfc1a771792b6697fd.js} +121 -140
  6. package/assets/esri/core/workers/chunks/42c5d957813080143e5a.js +1 -0
  7. package/assets/esri/core/workers/chunks/6269c4bbf0f224a954e9.js +1 -0
  8. package/assets/esri/core/workers/chunks/871da12fb3029177df6f.js +1 -0
  9. package/assets/esri/core/workers/chunks/8abcf9d3343dd8d45103.js +1 -0
  10. package/assets/esri/core/workers/chunks/ac88e0aabbd6c1f1ec98.js +1 -0
  11. package/assets/esri/core/workers/chunks/{e7209654ecdfde926272.js → eec36628e638e244f452.js} +1 -1
  12. package/chunks/ComponentShader.glsl.js +34 -33
  13. package/chunks/DefaultMaterial.glsl.js +25 -25
  14. package/chunks/Path.glsl.js +20 -24
  15. package/chunks/RealisticTree.glsl.js +18 -20
  16. package/chunks/Terrain.glsl.js +32 -33
  17. package/chunks/WaterSurface.glsl.js +16 -16
  18. package/config.js +1 -1
  19. package/core/workers/registry.js +1 -1
  20. package/interfaces.d.ts +22 -25
  21. package/kernel.js +1 -1
  22. package/layers/MapImageLayer.js +1 -1
  23. package/package.json +1 -1
  24. package/portal/schemas/definitions.js +1 -1
  25. package/support/revision.js +1 -1
  26. package/views/2d/layers/support/MediaLayerInteraction.js +1 -1
  27. package/views/3d/environment/Precipitation.js +1 -1
  28. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  29. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  30. package/views/3d/layers/FlowSubView3D.js +1 -1
  31. package/views/3d/layers/MapImageLayerView3D.js +1 -1
  32. package/views/3d/layers/MediaLayerView3D.js +1 -1
  33. package/views/3d/layers/support/MediaLayerInteraction.js +1 -1
  34. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  35. package/views/3d/support/engineContent/line.js +1 -1
  36. package/views/3d/support/flow/FlowSubViewExtent3D.js +1 -1
  37. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  38. package/views/3d/support/flow/FlowWorker.js +5 -0
  39. package/views/3d/support/flow/FlowWorkerHandle.js +5 -0
  40. package/views/3d/support/flow/geometryUtils.js +1 -1
  41. package/views/3d/support/flow/loadUtils.js +1 -1
  42. package/views/3d/support/hitTest.js +1 -1
  43. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  44. package/views/3d/webgl-engine/core/material/RenderTexture.js +1 -1
  45. package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +3 -5
  46. package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepthToReadShadowMap.glsl.js +7 -0
  47. package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js +11 -0
  48. package/views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js +1 -1
  49. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +1 -1
  50. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +6 -2
  51. package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
  52. package/views/3d/webgl-engine/lib/TextureUpdater.js +1 -1
  53. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  54. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  55. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  56. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  57. package/views/3d/webgl-engine/shaders/Path.glsl.js +1 -1
  58. package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
  59. package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
  60. package/views/3d/webgl-engine/shaders/WaterSurface.glsl.js +1 -1
  61. package/views/SceneView.js +1 -1
  62. package/views/View.js +1 -1
  63. package/views/draw/support/Box.js +1 -1
  64. package/views/draw/support/Reshape.js +1 -1
  65. package/views/webgl/RenderingContext.js +1 -1
  66. package/views/webgl/Util.js +1 -1
  67. package/views/webgl/checkWebGLError.js +1 -1
  68. package/views/webgl/testFloatBufferBlend.js +1 -1
  69. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  70. package/widgets/Editor/workflowUtils.js +1 -1
  71. package/widgets/ElevationProfile/ElevationProfileInteraction.js +1 -1
  72. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  73. package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
  74. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  75. package/widgets/Sketch/SketchViewModel.js +1 -1
  76. package/widgets/UtilityNetworkTrace.js +1 -1
  77. package/assets/esri/core/workers/chunks/278df50f2c557be81808.js +0 -1
  78. package/assets/esri/core/workers/chunks/2931fd6bb123200622c2.js +0 -1
  79. package/assets/esri/core/workers/chunks/4cf2894bda9e38af8790.js +0 -1
  80. package/assets/esri/core/workers/chunks/6a0777cf1270fcab4574.js +0 -1
  81. package/assets/esri/core/workers/chunks/9723512bc9db4a301c72.js +0 -1
@@ -2,7 +2,7 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/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{isColorOrColorEmission 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{InstanceColor as l}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/InstanceColor.glsl.js";import{InstancedDoublePrecision as s}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import{MaskedColorDefinition as n,CreateMaskedFromNaNColor as t}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/MaskedColor.glsl.js";import{NormalAttribute as d}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{SymbolColor as m}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 g}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 w}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js";import{DefaultMaterialAuxiliaryPasses as u}from"../views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import{ComputeNormalTexture as b}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 h,addAmbientBoostFactor as f,addLightingGlobalFactor as y}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{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}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReadShadowMapPass as P,ReadShadowMapDraw as M}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{terrainDepthTest as N}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import{colorTextureUV as S,normalTextureUV as T,emissiveTextureUV as O,occlusionTextureUV as V,metallicRoughnessTextureUV as $}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TextureTransformUV.glsl.js";import{VisualVariables as A}from"../views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js";import{DiscardOrAdjustAlphaPass as D}from"../views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import{MixExternalColor as E}from"../views/3d/webgl-engine/core/shaderLibrary/util/MixExternalColor.glsl.js";import{addProjViewLocalOrigin as U,addCameraPosition as B}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float3PassUniform as F}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{Float4PassUniform as I}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as k}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{If as _,glsl as R}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DPassUniform as z}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{SnowCover as G}from"../views/3d/webgl-engine/effects/weather/SnowCover.glsl.js";import{colorMixModes as W}from"../views/3d/webgl-engine/materials/internal/MaterialUtil.js";import{outputColorHighlightOID as H}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js";import{ShaderBuilder as q}from"../views/webgl/ShaderBuilder.js";import{alphaCutoff as J}from"../webscene/support/AlphaCutoff.js";function K(K){const Q=new q,{attributes:X,vertex:Y,fragment:Z,varyings:ee}=Q,{output:re,normalType:oe,offsetBackfaces:ie,spherical:ae,receiveShadows:le,snowCover:se,pbrMode:ne,textureAlphaPremultiplied:te,instancedDoublePrecision:de,hasVertexColors:me,hasVertexTangents:ce,hasColorTexture:ge,hasNormalTexture:ve,hasNormalTextureTransform:we,hasColorTextureTransform:ue,hasBloom:be}=K;if(U(Y,K),X.add("position","vec3"),ee.add("vpos","vec3",{invariant:!0}),Q.include(A,K),Q.include(s,K),Q.include(w,K),Q.include(S,K),!o(re))return Q.include(u,K),Q;Q.include(T,K),Q.include(O,K),Q.include(V,K),Q.include($,K),B(Y,K),Q.include(d,K),Q.include(a,K);const pe=0===oe||1===oe;return pe&&ie&&Q.include(r),Q.include(b,K),Q.include(v,K),Q.include(l,K),ee.add("vPositionLocal","vec3"),Q.include(c,K),Q.include(e,K),Q.include(m,K),Q.include(g,K),Y.uniforms.add(new I("externalColor",e=>e.externalColor,{supportsNaN:!0})),ee.add("vcolorExt","vec4"),Q.include(N,K),Y.include(n),Y.include(t),Y.main.add(R`
5
+ import{Offset as e}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.js";import{isColorOrColorEmission as r}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SliceDraw as o}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as i}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{InstanceColor as a}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/InstanceColor.glsl.js";import{InstancedDoublePrecision as s}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import{MaskedColorDefinition as l,CreateMaskedFromNaNColor as n}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/MaskedColor.glsl.js";import{NormalAttribute as t}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{SymbolColor as d}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 c}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 u}from"../views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import{ComputeNormalTexture as w}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 p,addAmbientBoostFactor as h,addLightingGlobalFactor as f}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{addMainLightIntensity as y}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{Normals as x}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 L}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReadShadowMapPass as j,ReadShadowMapDraw as P}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{terrainDepthTest as M}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import{colorTextureUV as N,normalTextureUV as T,emissiveTextureUV as O,occlusionTextureUV as S,metallicRoughnessTextureUV as V}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TextureTransformUV.glsl.js";import{VisualVariables as $}from"../views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js";import{DiscardOrAdjustAlphaPass as A}from"../views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import{MixExternalColor as D}from"../views/3d/webgl-engine/core/shaderLibrary/util/MixExternalColor.glsl.js";import{addProjViewLocalOrigin as E,addCameraPosition as U}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 I}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as k}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{If as _,glsl as F}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DPassUniform as R}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{SnowCover as z}from"../views/3d/webgl-engine/effects/weather/SnowCover.glsl.js";import{colorMixModes as W}from"../views/3d/webgl-engine/materials/internal/MaterialUtil.js";import{outputColorHighlightOID as G}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js";import{ShaderBuilder as H}from"../views/webgl/ShaderBuilder.js";import{alphaCutoff as q}from"../webscene/support/AlphaCutoff.js";function J(J){const K=new H,{attributes:Q,vertex:X,fragment:Y,varyings:Z}=K,{output:ee,normalType:re,offsetBackfaces:oe,spherical:ie,snowCover:ae,pbrMode:se,textureAlphaPremultiplied:le,instancedDoublePrecision:ne,hasVertexColors:te,hasVertexTangents:de,hasColorTexture:me,hasNormalTexture:ce,hasNormalTextureTransform:ge,hasColorTextureTransform:ve,hasBloom:ue}=J;if(E(X,J),Q.add("position","vec3"),Z.add("vpos","vec3",{invariant:!0}),K.include($,J),K.include(s,J),K.include(v,J),K.include(N,J),!r(ee))return K.include(u,J),K;K.include(T,J),K.include(O,J),K.include(S,J),K.include(V,J),U(X,J),K.include(t,J),K.include(i,J);const we=0===re||1===re;return we&&oe&&K.include(e),K.include(w,J),K.include(g,J),K.include(a,J),Z.add("vPositionLocal","vec3"),K.include(m,J),K.include(d,J),K.include(c,J),X.uniforms.add(new I("externalColor",e=>e.externalColor,{supportsNaN:!0})),Z.add("vcolorExt","vec4"),K.include(M,J),X.include(l),X.include(n),K.include(ne?j:P,J),X.main.add(F`
6
6
  forwardNormalizedVertexColor();
7
7
 
8
8
  MaskedColor maskedColorExt =
@@ -14,14 +14,13 @@ import{ForwardLinearDepth as e}from"../views/3d/webgl-engine/core/shaderLibrary/
14
14
  vpos = getVertexInLocalOriginSpace();
15
15
  vPositionLocal = vpos - view[3].xyz;
16
16
  vpos = subtractOrigin(vpos);
17
- ${_(pe,"vNormalWorld = dpNormal(vvLocalNormal(normalModel()));")}
17
+ ${_(we,"vNormalWorld = dpNormal(vvLocalNormal(normalModel()));")}
18
18
  vpos = addVerticalOffset(vpos, localOrigin);
19
- ${_(ce,"vTangent = dpTransformVertexTangent(tangent);")}
19
+ ${_(de,"vTangent = dpTransformVertexTangent(tangent);")}
20
20
  gl_Position = transformPosition(proj, view, vpos);
21
- ${_(pe&&ie,"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);")}
21
+ ${_(we&&oe,"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);")}
22
22
 
23
23
  forwardViewPosDepth((view * vec4(vpos, 1.0)).xyz);
24
- forwardLinearDepth();
25
24
  forwardTextureCoordinates();
26
25
  forwardColorUV();
27
26
  forwardNormalUV();
@@ -29,35 +28,36 @@ import{ForwardLinearDepth as e}from"../views/3d/webgl-engine/core/shaderLibrary/
29
28
  forwardOcclusionUV();
30
29
  forwardMetallicRoughnessUV();
31
30
 
32
- if (opacityMixMode != ${R.int(W.ignore)} && vcolorExt.a < ${R.float(J)}) {
31
+ if (opacityMixMode != ${F.int(W.ignore)} && vcolorExt.a < ${F.float(q)}) {
33
32
  gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
34
33
  }
35
- `),Q.include(h,K),Z.include(p,K),Q.include(D,K),Q.include(de?P:M,K),Z.include(i,K),Q.include(H,K),B(Z,K),Z.uniforms.add(Y.uniforms.get("localOrigin"),new F("ambient",e=>e.ambient),new F("diffuse",e=>e.diffuse),new k("opacity",e=>e.opacity),new k("layerOpacity",e=>e.layerOpacity)),ge&&Z.uniforms.add(new z("tex",e=>e.texture)),Q.include(j,K),Z.include(L,K),Z.include(E),Q.include(C,K),Z.include(G,K),f(Z),y(Z),x(Z),Z.main.add(R`
34
+ forwardLinearDepthToReadShadowMap();
35
+ `),K.include(p,J),Y.include(b,J),K.include(A,J),Y.include(o,J),K.include(G,J),U(Y,J),Y.uniforms.add(X.uniforms.get("localOrigin"),new B("ambient",e=>e.ambient),new B("diffuse",e=>e.diffuse),new k("opacity",e=>e.opacity),new k("layerOpacity",e=>e.layerOpacity)),me&&Y.uniforms.add(new R("tex",e=>e.texture)),K.include(L,J),Y.include(C,J),Y.include(D),K.include(x,J),Y.include(z,J),h(Y),f(Y),y(Y),Y.main.add(F`
36
36
  discardBySlice(vpos);
37
37
  discardByTerrainDepth();
38
- ${ge?R`
39
- vec4 texColor = texture(tex, ${ue?"colorUV":"vuv0"});
40
- ${_(te,"texColor.rgb /= texColor.a;")}
41
- discardOrAdjustAlpha(texColor);`:R`vec4 texColor = vec4(1.0);`}
38
+ ${me?F`
39
+ vec4 texColor = texture(tex, ${ve?"colorUV":"vuv0"});
40
+ ${_(le,"texColor.rgb /= texColor.a;")}
41
+ discardOrAdjustAlpha(texColor);`:F`vec4 texColor = vec4(1.0);`}
42
42
  shadingParams.viewDirection = normalize(vpos - cameraPosition);
43
- ${2===oe?R`vec3 normal = screenDerivativeNormal(vPositionLocal);`:R`shadingParams.normalView = vNormalWorld;
43
+ ${2===re?F`vec3 normal = screenDerivativeNormal(vPositionLocal);`:F`shadingParams.normalView = vNormalWorld;
44
44
  vec3 normal = shadingNormal(shadingParams);`}
45
45
  applyPBRFactors();
46
46
  float ssao = evaluateAmbientOcclusionInverse() * getBakedOcclusion();
47
47
 
48
48
  vec3 posWorld = vpos + localOrigin;
49
49
 
50
- float additionalAmbientScale = additionalDirectedAmbientLight(posWorld);
51
- float shadow = ${le?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":_(ae,"lightingGlobalFactor * (1.0 - additionalAmbientScale)","0.0")};
50
+ float additionalAmbientScale = additionalDirectedAmbientLight(posWorld);
51
+ float shadow = readShadow(additionalAmbientScale, vpos);
52
52
 
53
53
  vec3 matColor = max(ambient, diffuse);
54
- vec3 albedo = mixExternalColor(${_(me,"vColor.rgb *")} matColor, texColor.rgb, vcolorExt.rgb, colorMixMode);
55
- float opacity_ = layerOpacity * mixExternalOpacity(${_(me,"vColor.a * ")} opacity, texColor.a, vcolorExt.a, opacityMixMode);
54
+ vec3 albedo = mixExternalColor(${_(te,"vColor.rgb *")} matColor, texColor.rgb, vcolorExt.rgb, colorMixMode);
55
+ float opacity_ = layerOpacity * mixExternalOpacity(${_(te,"vColor.a * ")} opacity, texColor.a, vcolorExt.a, opacityMixMode);
56
56
 
57
- ${ve?`mat3 tangentSpace = computeTangentSpace(${ce?"normal":"normal, vpos, vuv0"});\n vec3 shadingNormal = computeTextureNormal(tangentSpace, ${we?"normalUV":"vuv0"});`:"vec3 shadingNormal = normal;"}
58
- vec3 normalGround = ${ae?"normalize(posWorld);":"vec3(0.0, 0.0, 1.0);"}
57
+ ${ce?`mat3 tangentSpace = computeTangentSpace(${de?"normal":"normal, vpos, vuv0"});\n vec3 shadingNormal = computeTextureNormal(tangentSpace, ${ge?"normalUV":"vuv0"});`:"vec3 shadingNormal = normal;"}
58
+ vec3 normalGround = ${ie?"normalize(posWorld);":"vec3(0.0, 0.0, 1.0);"}
59
59
 
60
- ${_(se,R`
60
+ ${_(ae,F`
61
61
  float snow = getSnow(normal, normalGround);
62
62
  albedo = mix(albedo, vec3(1), snow);
63
63
  shadingNormal = mix(shadingNormal, normal, snow);
@@ -65,11 +65,11 @@ import{ForwardLinearDepth as e}from"../views/3d/webgl-engine/core/shaderLibrary/
65
65
 
66
66
  vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
67
67
 
68
- ${1===ne||2===ne?R`
68
+ ${1===se||2===se?F`
69
69
  float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
70
- vec4 emission = ${be?"vec4(0.0)":"getEmissions(albedo)"};
71
- ${_(se,"mrr = applySnowToMRR(mrr, snow);\n emission = snowCoverForEmissions(emission, snow);")}
72
- 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);`}
70
+ vec4 emission = ${ue?"vec4(0.0)":"getEmissions(albedo)"};
71
+ ${_(ae,"mrr = applySnowToMRR(mrr, snow);\n emission = snowCoverForEmissions(emission, snow);")}
72
+ 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);`}
73
73
  vec4 finalColor = vec4(shadedColor, opacity_);
74
- outputColorHighlightOID(finalColor, vpos, albedo ${_(se,", snow")});
75
- `),Q}const Q=Object.freeze(Object.defineProperty({__proto__:null,build:K},Symbol.toStringTag,{value:"Module"}));export{Q as D,K as b};
74
+ outputColorHighlightOID(finalColor, vpos, albedo ${_(ae,", snow")});
75
+ `),K}const K=Object.freeze(Object.defineProperty({__proto__:null,build:J},Symbol.toStringTag,{value:"Module"}));export{K as D,J as b};
@@ -2,17 +2,13 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{ForwardLinearDepth as e,addNearFar as i}from"../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js";import{isColorOrColorEmission as o}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SliceDraw as a}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as r}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{ObjectAndLayerIdColor as n}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import{PathVertexPosition as s}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{OutputDepth as l}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js";import{OutputHighlight as d}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{EvaluateAmbientOcclusion as t}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import{EvaluateSceneLighting as c,addAmbientBoostFactor as m,addLightingGlobalFactor as g}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{addMainLightIntensity as v}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{Normals as p}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js";import{NormalUtils as w}from"../views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js";import{PhysicallyBasedRenderingParameters as b}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReadShadowMapDraw as h}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{terrainDepthTest as u}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import{ColorConversion as f}from"../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import{addProjViewLocalOrigin as y,addViewNormal as j,addCameraPosition as L}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{FloatPassUniform as S}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as O,If as C}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{SnowCover as A}from"../views/3d/webgl-engine/effects/weather/SnowCover.glsl.js";import{outputColorHighlightOID as D}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js";import{ShaderBuilder as B}from"../views/webgl/ShaderBuilder.js";function F(F){const I=new B,{vertex:_,fragment:x,varyings:M}=I;y(_,F),M.add("vpos","vec3",{invariant:!0}),I.include(s,F);const{output:V,spherical:$,pbrMode:z,receiveShadows:G,hasBloom:N,snowCover:T}=F,k=o(V);switch((k||9===V)&&(I.include(r,F),I.include(h,F),I.include(e,F),I.include(n,F),I.include(u,F),M.add("vnormal","vec3"),M.add("vcolor","vec4"),_.main.add(O`
6
- vpos = calculateVPos();
7
- vnormal = normalize(localNormal());
8
- forwardViewPosDepth((view * vec4(vpos, 1.0)).xyz);
9
-
10
- gl_Position = transformPosition(proj, view, vpos);
11
-
12
- ${k?"forwardLinearDepth();":""}
13
- forwardObjectAndLayerIdColor();
14
-
15
- vcolor = getColor();`)),V){case 1:case 0:I.include(b,F),I.include(c,F),x.include(t,F),I.include(h,F),I.include(p,F),x.include(a,F),I.include(D,F),L(x,F),m(x),g(x),x.uniforms.add(_.uniforms.get("localOrigin"),new P("ambient",e=>e.ambient),new P("diffuse",e=>e.diffuse),new S("opacity",e=>e.opacity)),x.include(f),x.include(A,F),v(x),x.main.add(O`
5
+ import{addNearFar as e}from"../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js";import{isColorOrColorEmission as i}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SliceDraw as o}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{ObjectAndLayerIdColor as r}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import{PathVertexPosition as n}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{OutputDepth as s}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js";import{OutputHighlight as l}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{EvaluateAmbientOcclusion as d}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import{EvaluateSceneLighting as t,addAmbientBoostFactor as c,addLightingGlobalFactor as m}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{addMainLightIntensity as g}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{Normals as v}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js";import{NormalUtils as p}from"../views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js";import{PhysicallyBasedRenderingParameters as w}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReadShadowMapDraw as h}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{terrainDepthTest as u}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import{ColorConversion as b}from"../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import{addProjViewLocalOrigin as f,addViewNormal as y,addCameraPosition as j}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float3PassUniform as L}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{FloatPassUniform as P}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as S,If as O}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{SnowCover as C}from"../views/3d/webgl-engine/effects/weather/SnowCover.glsl.js";import{outputColorHighlightOID as A}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js";import{ShaderBuilder as D}from"../views/webgl/ShaderBuilder.js";function B(B){const I=new D,{vertex:F,fragment:M,varyings:_}=I;f(F,B),_.add("vpos","vec3",{invariant:!0}),I.include(n,B);const{output:V,spherical:x,pbrMode:z,hasBloom:T,snowCover:$}=B;switch((i(V)||9===V)&&(I.include(a,B),I.include(h,B),I.include(r,B),I.include(u,B),_.add("vnormal","vec3"),_.add("vcolor","vec4"),F.main.add(S`vpos = calculateVPos();
6
+ vnormal = normalize(localNormal());
7
+ forwardViewPosDepth((view * vec4(vpos, 1.0)).xyz);
8
+ gl_Position = transformPosition(proj, view, vpos);
9
+ forwardObjectAndLayerIdColor();
10
+ vcolor = getColor();
11
+ forwardLinearDepthToReadShadowMap();`)),V){case 1:case 0:I.include(w,B),I.include(t,B),M.include(d,B),I.include(v,B),M.include(o,B),I.include(A,B),j(M,B),c(M),m(M),M.uniforms.add(F.uniforms.get("localOrigin"),new L("ambient",e=>e.ambient),new L("diffuse",e=>e.diffuse),new P("opacity",e=>e.opacity)),M.include(b),M.include(C,B),g(M),M.main.add(S`
16
12
  discardBySlice(vpos);
17
13
  discardByTerrainDepth();
18
14
 
@@ -22,32 +18,32 @@ import{ForwardLinearDepth as e,addNearFar as i}from"../views/3d/webgl-engine/cor
22
18
  float ssao = evaluateAmbientOcclusionInverse();
23
19
 
24
20
  vec3 posWorld = vpos + localOrigin;
25
- vec3 normalGround = ${$?"normalize(posWorld);":"vec3(0.0, 0.0, 1.0);"}
21
+ vec3 normalGround = ${x?"normalize(posWorld);":"vec3(0.0, 0.0, 1.0);"}
26
22
 
27
23
  vec3 albedo = vcolor.rgb * max(ambient, diffuse); // combine the old material parameters into a single one
28
24
  float combinedOpacity = vcolor.a * opacity;
29
25
 
30
- ${C(T,O`float snow = getSnow(normal, normalGround);
26
+ ${O($,S`float snow = getSnow(normal, normalGround);
31
27
  albedo = mix(albedo, vec3(1), snow);
32
28
  ssao = mix(ssao, 1.0, snow);`)}
33
29
 
34
30
  float additionalAmbientScale = additionalDirectedAmbientLight(posWorld);
35
31
  vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
36
- float shadow = ${G?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth));":$?"lightingGlobalFactor * (1.0 - additionalAmbientScale);":"0.0;"}
32
+ float shadow = readShadow(additionalAmbientScale, vpos);
37
33
 
38
- ${C(2===z,`float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];\n vec4 emission = ${N?"vec4(0.0)":"getEmissions(albedo)"};\n ${C(T,"mrr = applySnowToMRR(mrr, snow);\n emission = snowCoverForEmissions(emission, snow);")}`)}
34
+ ${O(2===z,`float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];\n vec4 emission = ${T?"vec4(0.0)":"getEmissions(albedo)"};\n ${O($,"mrr = applySnowToMRR(mrr, snow);\n emission = snowCoverForEmissions(emission, snow);")}`)}
39
35
 
40
36
  vec3 shadedColor = ${2===z?"evaluateSceneLightingPBR(normal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);":"evaluateSceneLighting(normal, albedo, shadow, 1.0 - ssao, additionalLight);"}
41
37
  vec4 finalColor = vec4(shadedColor, combinedOpacity);
42
- outputColorHighlightOID(finalColor, vpos, albedo ${C(T,", snow")});`);break;case 2:I.include(r,F),_.main.add(O`vpos = calculateVPos();
43
- gl_Position = transformPosition(proj, view, vpos);`),I.fragment.include(a,F),x.main.add(O`discardBySlice(vpos);`);break;case 4:case 5:case 6:case 7:I.include(r,F),i(I),M.add("depth","float"),_.main.add(O`vpos = calculateVPos();
44
- gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth);`),I.fragment.include(a,F),I.include(l,F),x.main.add(O`discardBySlice(vpos);
45
- outputDepth(depth);`);break;case 9:I.fragment.include(a,F),x.main.add(O`discardBySlice(vpos);
46
- outputObjectAndLayerIdColor();`);break;case 3:I.include(r,F),I.include(w,F),j(_),M.add("vnormal","vec3"),_.main.add(O`vpos = calculateVPos();
38
+ outputColorHighlightOID(finalColor, vpos, albedo ${O($,", snow")});`);break;case 2:I.include(a,B),F.main.add(S`vpos = calculateVPos();
39
+ gl_Position = transformPosition(proj, view, vpos);`),I.fragment.include(o,B),M.main.add(S`discardBySlice(vpos);`);break;case 4:case 5:case 6:case 7:I.include(a,B),e(I),_.add("depth","float"),F.main.add(S`vpos = calculateVPos();
40
+ gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth);`),I.fragment.include(o,B),I.include(s,B),M.main.add(S`discardBySlice(vpos);
41
+ outputDepth(depth);`);break;case 9:I.fragment.include(o,B),M.main.add(S`discardBySlice(vpos);
42
+ outputObjectAndLayerIdColor();`);break;case 3:I.include(a,B),I.include(p,B),y(F),_.add("vnormal","vec3"),F.main.add(S`vpos = calculateVPos();
47
43
  vnormal = normalize((viewNormal * vec4(localNormal(), 1.0)).xyz);
48
- gl_Position = transformPosition(proj, view, vpos);`),I.fragment.include(a,F),x.main.add(O`discardBySlice(vpos);
44
+ gl_Position = transformPosition(proj, view, vpos);`),I.fragment.include(o,B),M.main.add(S`discardBySlice(vpos);
49
45
  vec3 normal = normalize(vnormal);
50
46
  if (gl_FrontFacing == false) normal = -normal;
51
- fragColor = vec4(vec3(0.5) + 0.5 * normal, 1.0);`);break;case 8:I.include(r,F),I.include(w,F),M.add("vnormal","vec3"),_.main.add(O`vpos = calculateVPos();
52
- gl_Position = transformPosition(proj, view, vpos);`),I.fragment.include(a,F),I.include(d,F),x.main.add(O`discardBySlice(vpos);
53
- calculateOcclusionAndOutputHighlight();`)}return I}const I=Object.freeze(Object.defineProperty({__proto__:null,build:F},Symbol.toStringTag,{value:"Module"}));export{I as P,F as b};
47
+ fragColor = vec4(vec3(0.5) + 0.5 * normal, 1.0);`);break;case 8:I.include(a,B),I.include(p,B),_.add("vnormal","vec3"),F.main.add(S`vpos = calculateVPos();
48
+ gl_Position = transformPosition(proj, view, vpos);`),I.fragment.include(o,B),I.include(l,B),M.main.add(S`discardBySlice(vpos);
49
+ calculateOcclusionAndOutputHighlight();`)}return I}const I=Object.freeze(Object.defineProperty({__proto__:null,build:B},Symbol.toStringTag,{value:"Module"}));export{I as P,B 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.34/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 o}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.js";import{isColorOrColorEmission as r}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{InstanceColor as l}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/InstanceColor.glsl.js";import{InstancedDoublePrecision as t}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import{MaskedColorDefinition as s,CreateMaskedFromNaNColor as n}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/MaskedColor.glsl.js";import{NormalAttribute as d}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{SymbolColor as c}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 m}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.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{EvaluateAmbientOcclusion as p}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import{EvaluateSceneLighting as w,addAmbientBoostFactor as u,addLightingGlobalFactor as h}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{addMainLightDirection as f,addMainLightIntensity as y}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{PhysicallyBasedRendering as x}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import{PhysicallyBasedRenderingParameters as C}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReadShadowMapPass as L,ReadShadowMapDraw as j}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{terrainDepthTest as M}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import{VisualVariables as O}from"../views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js";import{DiscardOrAdjustAlphaPass as P}from"../views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import{MixExternalColor as S}from"../views/3d/webgl-engine/core/shaderLibrary/util/MixExternalColor.glsl.js";import{addProjViewLocalOrigin as A,addCameraPosition as E}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float3PassUniform as F}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{Float4PassUniform as D}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as $}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as N,If as V}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DPassUniform as I}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{colorMixModes as k}from"../views/3d/webgl-engine/materials/internal/MaterialUtil.js";import{outputColorHighlightOID as B}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js";import{ShaderBuilder as T}from"../views/webgl/ShaderBuilder.js";import{alphaCutoff as R}from"../webscene/support/AlphaCutoff.js";function _(_){const z=new T,{attributes:U,vertex:G,fragment:W,varyings:H}=z,{output:q,offsetBackfaces:J,pbrMode:K,snowCover:Q,spherical:X,hasBloom:Y}=_,Z=1===K||2===K;if(A(G,_),U.add("position","vec3"),H.add("vpos","vec3",{invariant:!0}),z.include(O,_),z.include(t,_),z.include(v,_),z.include(M,_),!r(q))return z.include(b,_),z;E(z.vertex,_),z.include(d,_),z.include(a,_),J&&z.include(o),H.add("vNormalWorld","vec3"),H.add("localvpos","vec3",{invariant:!0}),z.include(g,_),z.include(e,_),z.include(c,_),z.include(l,_),z.include(m,_),G.include(s),G.include(n),G.uniforms.add(new D("externalColor",e=>e.externalColor,{supportsNaN:!0})),H.add("vcolorExt","vec4"),G.main.add(N`
5
+ import{Offset as e}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.js";import{isColorOrColorEmission as o}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SliceDraw as r}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as i}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{InstanceColor as a}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/InstanceColor.glsl.js";import{InstancedDoublePrecision as l}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import{MaskedColorDefinition as t,CreateMaskedFromNaNColor as s}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/MaskedColor.glsl.js";import{NormalAttribute as n}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.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 g}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js";import{VerticalOffset as m}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js";import{DefaultMaterialAuxiliaryPasses as v}from"../views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import{EvaluateAmbientOcclusion as b}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import{EvaluateSceneLighting as p,addAmbientBoostFactor as w,addLightingGlobalFactor as u}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{addMainLightDirection as f,addMainLightIntensity as h}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{PhysicallyBasedRendering as y}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import{PhysicallyBasedRenderingParameters as x}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReadShadowMapPass as C,ReadShadowMapDraw as L}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{terrainDepthTest as j}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import{VisualVariables as M}from"../views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js";import{DiscardOrAdjustAlphaPass as O}from"../views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import{MixExternalColor as P}from"../views/3d/webgl-engine/core/shaderLibrary/util/MixExternalColor.glsl.js";import{addProjViewLocalOrigin as S,addCameraPosition as A}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 N}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as $}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as D,If as F}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DPassUniform as V}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{colorMixModes as I}from"../views/3d/webgl-engine/materials/internal/MaterialUtil.js";import{outputColorHighlightOID as T}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js";import{ShaderBuilder as k}from"../views/webgl/ShaderBuilder.js";import{alphaCutoff as B}from"../webscene/support/AlphaCutoff.js";function R(R){const _=new k,{attributes:z,vertex:U,fragment:W,varyings:G}=_,{output:H,offsetBackfaces:q,pbrMode:J,snowCover:K,spherical:Q,hasBloom:X}=R,Y=1===J||2===J;if(S(U,R),z.add("position","vec3"),G.add("vpos","vec3",{invariant:!0}),_.include(M,R),_.include(l,R),_.include(m,R),_.include(j,R),!o(H))return _.include(v,R),_;A(_.vertex,R),_.include(n,R),_.include(i,R),q&&_.include(e),G.add("vNormalWorld","vec3"),G.add("localvpos","vec3",{invariant:!0}),_.include(c,R),_.include(d,R),_.include(a,R),_.include(g,R),U.include(t),U.include(s),U.uniforms.add(new N("externalColor",e=>e.externalColor,{supportsNaN:!0})),G.add("vcolorExt","vec4"),_.include(R.instancedDoublePrecision?C:L,R),U.main.add(D`
6
6
  forwardNormalizedVertexColor();
7
7
 
8
8
  MaskedColor maskedColorExt =
@@ -11,7 +11,7 @@ import{ForwardLinearDepth as e}from"../views/3d/webgl-engine/core/shaderLibrary/
11
11
  vcolorExt = maskedColorExt.color;
12
12
  forwardColorMixMode(maskedColorExt.mask);
13
13
 
14
- bool alphaCut = opacityMixMode != ${N.int(k.ignore)} && vcolorExt.a < ${N.float(R)};
14
+ bool alphaCut = opacityMixMode != ${D.int(I.ignore)} && vcolorExt.a < ${D.float(B)};
15
15
  vpos = getVertexInLocalOriginSpace();
16
16
  localvpos = vpos - view[3].xyz;
17
17
  vpos = subtractOrigin(vpos);
@@ -20,17 +20,15 @@ import{ForwardLinearDepth as e}from"../views/3d/webgl-engine/core/shaderLibrary/
20
20
  vec4 basePosition = transformPosition(proj, view, vpos);
21
21
 
22
22
  forwardViewPosDepth((view * vec4(vpos, 1.0)).xyz);
23
- forwardLinearDepth();
24
-
25
23
  forwardTextureCoordinates();
26
-
24
+ forwardLinearDepthToReadShadowMap();
27
25
  gl_Position = alphaCut ? vec4(1e38, 1e38, 1e38, 1.0) :
28
- ${V(J,"offsetBackfacingClipPosition(basePosition, vpos, vNormalWorld, cameraPosition);","basePosition;")}
29
- `);const{hasColorTexture:ee,hasColorTextureTransform:oe,receiveShadows:re}=_;return z.include(w,_),W.include(p,_),z.include(P,_),z.include(_.instancedDoublePrecision?L:j,_),W.include(i,_),z.include(B,_),E(W,_),f(W),u(W),h(W),W.uniforms.add(G.uniforms.get("localOrigin"),G.uniforms.get("view"),new F("ambient",e=>e.ambient),new F("diffuse",e=>e.diffuse),new $("opacity",e=>e.opacity),new $("layerOpacity",e=>e.layerOpacity)),ee&&W.uniforms.add(new I("tex",e=>e.texture)),z.include(C,_),W.include(x,_),W.include(S),y(W),W.main.add(N`
26
+ ${F(q,"offsetBackfacingClipPosition(basePosition, vpos, vNormalWorld, cameraPosition);","basePosition;")}
27
+ `);const{hasColorTexture:Z,hasColorTextureTransform:ee}=R;return _.include(p,R),W.include(b,R),_.include(O,R),W.include(r,R),_.include(T,R),A(W,R),f(W),w(W),u(W),W.uniforms.add(U.uniforms.get("localOrigin"),U.uniforms.get("view"),new E("ambient",e=>e.ambient),new E("diffuse",e=>e.diffuse),new $("opacity",e=>e.opacity),new $("layerOpacity",e=>e.layerOpacity)),Z&&W.uniforms.add(new V("tex",e=>e.texture)),_.include(x,R),W.include(y,R),W.include(P),h(W),W.main.add(D`
30
28
  discardBySlice(vpos);
31
29
  discardByTerrainDepth();
32
- vec4 texColor = ${ee?`texture(tex, ${oe?"colorUV":"vuv0"})`:" vec4(1.0)"};
33
- ${V(ee,`${V(_.textureAlphaPremultiplied,"texColor.rgb /= texColor.a;")}\n discardOrAdjustAlpha(texColor);`)}
30
+ vec4 texColor = ${Z?`texture(tex, ${ee?"colorUV":"vuv0"})`:" vec4(1.0)"};
31
+ ${F(Z,`${F(R.textureAlphaPremultiplied,"texColor.rgb /= texColor.a;")}\n discardOrAdjustAlpha(texColor);`)}
34
32
  vec3 viewDirection = normalize(vpos - cameraPosition);
35
33
  applyPBRFactors();
36
34
  float ssao = evaluateAmbientOcclusionInverse();
@@ -38,14 +36,14 @@ import{ForwardLinearDepth as e}from"../views/3d/webgl-engine/core/shaderLibrary/
38
36
 
39
37
  float additionalAmbientScale = additionalDirectedAmbientLight(vpos + localOrigin);
40
38
  vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
41
- float shadow = ${re?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":X?"lightingGlobalFactor * (1.0 - additionalAmbientScale)":"0.0"};
39
+ float shadow = readShadow(additionalAmbientScale, vpos);
42
40
  vec3 matColor = max(ambient, diffuse);
43
- ${_.hasVertexColors?N`vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, colorMixMode);
44
- float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, opacityMixMode);`:N`vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, colorMixMode);
41
+ ${R.hasVertexColors?D`vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, colorMixMode);
42
+ float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, opacityMixMode);`:D`vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, colorMixMode);
45
43
  float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, opacityMixMode);`}
46
44
 
47
- ${V(Q,"albedo = mix(albedo, vec3(1), 0.9);")}
48
- ${N`vec3 shadingNormal = normalize(vNormalWorld);
45
+ ${F(K,"albedo = mix(albedo, vec3(1), 0.9);")}
46
+ ${D`vec3 shadingNormal = normalize(vNormalWorld);
49
47
  albedo *= 1.2;
50
48
  vec3 viewForward = vec3(view[0][2], view[1][2], view[2][2]);
51
49
  float alignmentLightView = clamp(dot(viewForward, -mainLightDirection), 0.0, 1.0);
@@ -53,10 +51,10 @@ import{ForwardLinearDepth as e}from"../views/3d/webgl-engine/core/shaderLibrary/
53
51
  float treeRadialFalloff = vColor.r;
54
52
  float backLightFactor = 0.5 * treeRadialFalloff * alignmentLightView * transmittance * (1.0 - shadow);
55
53
  additionalLight += backLightFactor * mainLightIntensity;`}
56
- ${V(Z,`vec3 normalGround = ${X?"normalize(vpos + localOrigin)":"vec3(0.0, 0.0, 1.0)"};`)}
57
- ${Z?N`float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
58
- ${V(Q,N`mrr = applySnowToMRR(mrr, 1.0)`)}
59
- vec4 emission = ${Q||Y?"vec4(0.0)":"getEmissions(albedo)"};
60
- vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:N`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
54
+ ${F(Y,`vec3 normalGround = ${Q?"normalize(vpos + localOrigin)":"vec3(0.0, 0.0, 1.0)"};`)}
55
+ ${Y?D`float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
56
+ ${F(K,D`mrr = applySnowToMRR(mrr, 1.0)`)}
57
+ vec4 emission = ${K||X?"vec4(0.0)":"getEmissions(albedo)"};
58
+ vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:D`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
61
59
  vec4 finalColor = vec4(shadedColor, opacity_);
62
- outputColorHighlightOID(finalColor, vpos, albedo ${V(Q,", 1.0")});`),z}const z=Object.freeze(Object.defineProperty({__proto__:null,build:_},Symbol.toStringTag,{value:"Module"}));export{z as R,_ as b};
60
+ outputColorHighlightOID(finalColor, vpos, albedo ${F(K,", 1.0")});`),_}const _=Object.freeze(Object.defineProperty({__proto__:null,build:R},Symbol.toStringTag,{value:"Module"}));export{_ as R,R as b};
@@ -2,53 +2,52 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{translate as e}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as r}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{n as o,i as a}from"./vec32.js";import{create as i}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{addLinearDepth as l,addNearFar as t,ForwardLinearDepth as n}from"../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js";import{SliceDraw as s}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as c}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{NormalAttribute as d}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttribute as v}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexTangent as m}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTangent.glsl.js";import{OutputDepth as g}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js";import{OutputHighlight as p}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{OutputHighlightOverlay as f}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlightOverlay.js";import{EvaluateAmbientOcclusion as u}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import{EvaluateSceneLighting as w,addAmbientBoostFactor as b,addLightingGlobalFactor as h}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{addMainLightDirection as C,addMainLightIntensity as y}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{NormalUtils as x}from"../views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js";import{ReadShadowMapDraw as O}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{OverlayTerrain as j}from"../views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{OverlayTerrainPassParameters as L,TerrainTexture as S}from"../views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js";import{addProjViewLocalOrigin as z,addViewNormal as T,addCameraPosition as P}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float3BindUniform as $}from"../views/3d/webgl-engine/core/shaderModules/Float3BindUniform.js";import{If as M,glsl as N}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Matrix4DrawUniform as A}from"../views/3d/webgl-engine/core/shaderModules/Matrix4DrawUniform.js";import{Texture2DBindUniform as D}from"../views/3d/webgl-engine/core/shaderModules/Texture2DBindUniform.js";import{ShaderBuilder as F}from"../views/webgl/ShaderBuilder.js";import{alphaCutoff as _}from"../webscene/support/AlphaCutoff.js";class V extends L{}function W(r){const i=new F,{attributes:L,vertex:V,fragment:W,varyings:k}=i;L.add("position","vec3"),i.include(d,r),i.include(v,r);const H=()=>{i.include(x,r),V.code.add(N`vec3 getNormal() {
5
+ import{translate as e}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as r}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{n as o,i as a}from"./vec32.js";import{create as i}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{addLinearDepth as l}from"../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js";import{addNearFar as t}from"../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js";import{SliceDraw as n}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as s}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{NormalAttribute as c}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttribute as d}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexTangent as v}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTangent.glsl.js";import{OutputDepth as m}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js";import{OutputHighlight as g}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{OutputHighlightOverlay as p}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlightOverlay.js";import{EvaluateAmbientOcclusion as f}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import{EvaluateSceneLighting as u,addAmbientBoostFactor as w,addLightingGlobalFactor as b}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{addMainLightDirection as h,addMainLightIntensity as C}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{NormalUtils as y}from"../views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js";import{ReadShadowMapDraw as x}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{OverlayTerrain as j}from"../views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{OverlayTerrainPassParameters as L,TerrainTexture as O}from"../views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js";import{addProjViewLocalOrigin as S,addViewNormal as z,addCameraPosition as T}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float3BindUniform as M}from"../views/3d/webgl-engine/core/shaderModules/Float3BindUniform.js";import{If as P,glsl as $}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Matrix4DrawUniform as N}from"../views/3d/webgl-engine/core/shaderModules/Matrix4DrawUniform.js";import{Texture2DBindUniform as D}from"../views/3d/webgl-engine/core/shaderModules/Texture2DBindUniform.js";import{ShaderBuilder as A}from"../views/webgl/ShaderBuilder.js";import{alphaCutoff as F}from"../webscene/support/AlphaCutoff.js";class _ extends L{}function V(r){const i=new A,{attributes:L,vertex:_,fragment:V,varyings:B}=i;L.add("position","vec3"),i.include(c,r),i.include(d,r);const k=()=>{i.include(y,r),_.code.add($`vec3 getNormal() {
6
6
  float z = 1.0 - abs(normalCompressed.x) - abs(normalCompressed.y);
7
7
  vec3 n = vec3(normalCompressed + vec2(normalCompressed.x >= 0.0 ? 1.0 : -1.0,
8
8
  normalCompressed.y >= 0.0 ? 1.0 : -1.0) * min(z, 0.0), z);
9
9
  return normalize(n);
10
- }`)};z(V,r),i.include(c,r);const{output:E,pbrMode:G,overlayMode:q,tileBorders:I,spherical:R,transparencyMode:J,screenSizePerspective:K,overlayEnabled:Q,receiveShadows:X}=r,Y=2===J||3===J,Z=Q&&Y;switch(E){case 1:case 0:{i.include(S,r),i.include(w,r),Q&&(r.pbrMode=5===G?6:3,i.include(j,r),r.pbrMode=G);const l=2===q;l&&i.include(m,r),k.add("vnormal","vec3"),k.add("vpos","vec3",{invariant:!0}),k.add("vup","vec3"),H(),K&&T(V),X&&i.include(n,r),K&&(k.add("screenSizeDistanceToCamera","float"),k.add("screenSizeCosAngle","float")),V.main.add(N`
10
+ }`)};S(_,r),i.include(s,r);const{output:H,pbrMode:E,overlayMode:q,tileBorders:I,spherical:R,transparencyMode:G,screenSizePerspective:J,overlayEnabled:K}=r,Q=2===G||3===G,X=K&&Q;switch(H){case 1:case 0:{i.include(O,r),i.include(u,r),K&&(r.pbrMode=5===E?6:3,i.include(j,r),r.pbrMode=E);const l=2===q;l&&i.include(v,r),B.add("vnormal","vec3"),B.add("vpos","vec3",{invariant:!0}),B.add("vup","vec3"),k(),J&&z(_),J&&(B.add("screenSizeDistanceToCamera","float"),B.add("screenSizeCosAngle","float")),_.main.add($`
11
11
  vpos = position;
12
12
  vec3 positionWorld = position + localOrigin;
13
13
  gl_Position = transformPosition(proj, view, vpos);
14
14
  vnormal = getNormal();
15
15
  vup = getLocalUp(position, localOrigin);
16
- ${M(l,N`forwardVertexTangent(vnormal);`)}
16
+ ${P(l,$`forwardVertexTangent(vnormal);`)}
17
17
 
18
18
  forwardTextureCoordinatesWithTransform(uv0);
19
- ${M(Q,"setOverlayVTC(uv0);")}
20
- ${M(I,"forwardTextureCoordinates();")}
21
- ${M(K,N`vec3 viewPos = (view * vec4(vpos, 1.0)).xyz;
19
+ ${P(K,"setOverlayVTC(uv0);")}
20
+ ${P(I,"forwardTextureCoordinates();")}
21
+ ${P(J,$`vec3 viewPos = (view * vec4(vpos, 1.0)).xyz;
22
22
  screenSizeDistanceToCamera = length(viewPos);
23
23
  vec3 viewSpaceNormal = (viewNormal * vec4(normalize(positionWorld), 1.0)).xyz;
24
24
  screenSizeCosAngle = abs(viewSpaceNormal.z);`)}
25
- ${M(X,"forwardLinearDepth();")}`),W.include(s,r),i.include(w,r),W.include(u,r),i.include(O,r),P(W,r),b(W),h(W),W.uniforms.add(V.uniforms.get("localOrigin"),new $("viewDirection",({camera:e})=>o(B,a(B,e.viewMatrix[12],e.viewMatrix[13],e.viewMatrix[14])))),l&&W.uniforms.add(new D("ovWaterTex",e=>e.overlay?.getTexture(3)),new A("view",({origin:r},{camera:o})=>e(U,o.viewMatrix,r)));const t=.2;W.code.add(N`float lum(vec3 c) {
25
+ forwardLinearDepthToReadShadowMap();`),i.include(x,r),V.include(n,r),i.include(u,r),V.include(f,r),T(V,r),w(V),b(V),V.uniforms.add(_.uniforms.get("localOrigin"),new M("viewDirection",({camera:e})=>o(U,a(U,e.viewMatrix[12],e.viewMatrix[13],e.viewMatrix[14])))),l&&V.uniforms.add(new D("ovWaterTex",e=>e.overlay?.getTexture(3)),new N("view",({origin:r},{camera:o})=>e(W,o.viewMatrix,r)));const t=.2;V.code.add($`float lum(vec3 c) {
26
26
  return (min(min(c.r, c.g), c.b) + max(max(c.r, c.g), c.b)) * 0.5;
27
- }`),C(W),y(W),W.main.add(N`
27
+ }`),h(V),C(V),V.main.add($`
28
28
  vec3 normal = normalize(vnormal);
29
29
  float vndl = dot(normal, mainLightDirection);
30
30
 
31
31
  float additionalAmbientScale = smoothstep(0.0, 1.0, clamp(vndl*2.5, 0.0, 1.0));
32
- float shadow = ${X?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":R?"lightingGlobalFactor * (1.0 - additionalAmbientScale)":"0.0"};
33
-
32
+ float shadow = readShadow(additionalAmbientScale, vpos);
34
33
  float ssao = evaluateAmbientOcclusionInverse();
35
34
  vec4 tileColor = getTileColor();
36
35
 
37
- ${M(Q,N`vec4 overlayColorOpaque = getOverlayColor(ovColorTex, vtcOverlay);
36
+ ${P(K,$`vec4 overlayColorOpaque = getOverlayColor(ovColorTex, vtcOverlay);
38
37
  vec4 overlayColor = overlayOpacity * overlayColorOpaque;
39
- ${M(Y,`if (overlayColor.a < ${N.float(_)}) { discard; }`)}
38
+ ${P(Q,`if (overlayColor.a < ${$.float(F)}) { discard; }`)}
40
39
  vec4 groundColor = tileColor;
41
40
  tileColor = tileColor * (1.0 - overlayColor.a) + overlayColor;`)}
42
41
 
43
42
  // If combined alpha is 0 we can discard pixel. The performance impact by having a discard here
44
43
  // is neglectable because terrain typically renders first into the framebuffer.
45
- if(tileColor.a < ${N.float(_)}) {
44
+ if(tileColor.a < ${$.float(F)}) {
46
45
  discard;
47
46
  }
48
47
 
49
48
  bool sliced = rejectBySlice(vpos);
50
49
  if (sliced) {
51
- tileColor *= ${N.float(t)};
50
+ tileColor *= ${$.float(t)};
52
51
  }
53
52
 
54
53
  vec3 albedo = tileColor.rgb;
@@ -57,8 +56,8 @@ return (min(min(c.r, c.g), c.b) + max(max(c.r, c.g), c.b)) * 0.5;
57
56
 
58
57
  vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
59
58
 
60
- ${5===G||6===G?N`fragColor = vec4(evaluatePBRSimplifiedLighting(normal, albedo, shadow, 1.0 - ssao, additionalLight, normalize(vpos - cameraPosition), vup), tileColor.a);`:N`fragColor = vec4(evaluateSceneLighting(normal, albedo, shadow, 1.0 - ssao, additionalLight), tileColor.a);`}
61
- ${M(l,N`vec4 overlayWaterMask = getOverlayColor(ovWaterTex, vtcOverlay);
59
+ ${5===E||6===E?$`fragColor = vec4(evaluatePBRSimplifiedLighting(normal, albedo, shadow, 1.0 - ssao, additionalLight, normalize(vpos - cameraPosition), vup), tileColor.a);`:$`fragColor = vec4(evaluateSceneLighting(normal, albedo, shadow, 1.0 - ssao, additionalLight), tileColor.a);`}
60
+ ${P(l,$`vec4 overlayWaterMask = getOverlayColor(ovWaterTex, vtcOverlay);
62
61
  float waterNormalLength = length(overlayWaterMask);
63
62
  if (waterNormalLength > 0.95) {
64
63
  mat3 tbnMatrix = mat3(tbnTangent, tbnBiTangent, vnormal);
@@ -66,11 +65,11 @@ return (min(min(c.r, c.g), c.b) + max(max(c.r, c.g), c.b)) * 0.5;
66
65
  vec4 viewPosition = view*vec4(vpos, 1.0);
67
66
  vec4 waterColorLinear = getOverlayWaterColor(overlayWaterMask, waterOverlayColor, -normalize(vpos - cameraPosition), shadow, vnormal, tbnMatrix, viewPosition.xyz, vpos + localOrigin);
68
67
  vec4 waterColorNonLinear = delinearizeGamma(vec4(waterColorLinear.xyz, 1.0));
69
- float opacity = sliced ? ${N.float(t)} : 1.0;
68
+ float opacity = sliced ? ${$.float(t)} : 1.0;
70
69
  // un-gamma the ground color to mix in linear space
71
70
  fragColor = mix(groundColor, waterColorNonLinear, waterColorLinear.w) * opacity;
72
71
  }`)}
73
- ${M(K,N`float perspectiveScale = screenSizePerspectiveScaleFloat(1.0, screenSizeCosAngle, screenSizeDistanceToCamera, vec4(0.0));
72
+ ${P(J,$`float perspectiveScale = screenSizePerspectiveScaleFloat(1.0, screenSizeCosAngle, screenSizeDistanceToCamera, vec4(0.0));
74
73
  if (perspectiveScale <= 0.25) {
75
74
  fragColor = mix(fragColor, vec4(1.0, 0.0, 0.0, 1.0), perspectiveScale * 4.0);
76
75
  } else if (perspectiveScale <= 0.5) {
@@ -80,34 +79,34 @@ return (min(min(c.r, c.g), c.b) + max(max(c.r, c.g), c.b)) * 0.5;
80
79
  } else {
81
80
  fragColor = mix(fragColor, vec4(1.0, 0.0, 1.0, 1.0), (perspectiveScale - 0.5) * 2.0);
82
81
  }`)}
83
- ${M(r.visualizeNormals,R?N`
82
+ ${P(r.visualizeNormals,R?$`
84
83
  vec3 localUp = normalize(vpos + localOrigin);
85
84
  vec3 right = normalize(cross(vec3(0.0, 0.0, 1.0), localUp));
86
85
  vec3 forward = normalize(cross(localUp, right));
87
86
  mat3 tbn = mat3(right, forward, localUp);
88
87
  vec3 tNormal = normalize(normal * tbn);
89
- fragColor = vec4(vec3(0.5) + 0.5 * tNormal, 0.0);`:N`
88
+ fragColor = vec4(vec3(0.5) + 0.5 * tNormal, 0.0);`:$`
90
89
  vec3 tNormal = normalize(normal);
91
90
  fragColor = vec4(vec3(0.5) + 0.5 * tNormal, 0.0);`)}
92
- ${M(I,N`vec2 dVuv = fwidth(vuv0);
91
+ ${P(I,$`vec2 dVuv = fwidth(vuv0);
93
92
  vec2 edgeFactors = smoothstep(vec2(0.0), 1.5 * dVuv, min(vuv0, 1.0 - vuv0));
94
93
  float edgeFactor = 1.0 - min(edgeFactors.x, edgeFactors.y);
95
94
  fragColor = mix(fragColor, vec4(1.0, 0.0, 0.0, 1.0), edgeFactor);`)}
96
- fragColor = applySlice(fragColor, vpos);`)}break;case 2:Z&&i.include(j,r),V.main.add(N`
97
- ${M(Z,"setOverlayVTC(uv0);")}
98
- gl_Position = transformPosition(proj, view, position);`),W.main.add(`${M(Z,`if (getCombinedOverlayColor().a < ${N.float(_)}) discard;`)}`);break;case 4:case 5:case 6:case 7:i.include(g,r),l(i),t(i),V.main.add(N`gl_Position = transformPositionWithDepth(proj, view, position, nearFar, linearDepth);`),W.main.add(N`outputDepth(linearDepth);`);break;case 3:Z&&i.include(j,r),k.add("vnormal","vec3"),T(V),H(),V.main.add(N`
99
- ${M(Z,"setOverlayVTC(uv0);")}
95
+ fragColor = applySlice(fragColor, vpos);`)}break;case 2:X&&i.include(j,r),_.main.add($`
96
+ ${P(X,"setOverlayVTC(uv0);")}
97
+ gl_Position = transformPosition(proj, view, position);`),V.main.add(`${P(X,`if (getCombinedOverlayColor().a < ${$.float(F)}) discard;`)}`);break;case 4:case 5:case 6:case 7:i.include(m,r),l(i),t(i),_.main.add($`gl_Position = transformPositionWithDepth(proj, view, position, nearFar, linearDepth);`),V.main.add($`outputDepth(linearDepth);`);break;case 3:X&&i.include(j,r),B.add("vnormal","vec3"),z(_),k(),_.main.add($`
98
+ ${P(X,"setOverlayVTC(uv0);")}
100
99
  gl_Position = transformPosition(proj, view, position);
101
- vnormal = normalize((viewNormal * vec4(getNormal(), 1.0)).xyz);`),W.main.add(N`
102
- ${M(Z,`if (getCombinedOverlayColor().a < ${N.float(_)}) discard;`)}
100
+ vnormal = normalize((viewNormal * vec4(getNormal(), 1.0)).xyz);`),V.main.add($`
101
+ ${P(X,`if (getCombinedOverlayColor().a < ${$.float(F)}) discard;`)}
103
102
  vec3 normal = normalize(vnormal);
104
103
  if (gl_FrontFacing == false) {
105
104
  normal = -normal;
106
105
  }
107
- fragColor = vec4(vec3(0.5) + 0.5 * normal, 1.0);`);break;case 8:Q&&(i.include(j,r),i.include(f,r)),V.main.add(N`
108
- ${M(Q,"setOverlayVTC(uv0);")}
109
- gl_Position = transformPosition(proj, view, position);`),i.include(p,r),W.main.add(N`
110
- ${M(Q,N`
106
+ fragColor = vec4(vec3(0.5) + 0.5 * normal, 1.0);`);break;case 8:K&&(i.include(j,r),i.include(p,r)),_.main.add($`
107
+ ${P(K,"setOverlayVTC(uv0);")}
108
+ gl_Position = transformPosition(proj, view, position);`),i.include(g,r),V.main.add($`
109
+ ${P(K,$`
111
110
  calculateOcclusionAndOutputHighlight(getAllOverlayHighlightValuesEncoded());`,"calculateOcclusionAndOutputHighlight();")}
112
- `)}if(9===E)if(Q)r.pbrMode=0,i.include(j,r),r.pbrMode=G,V.main.add(N`gl_Position = transformPosition(proj, view, position);
113
- setOverlayVTC(uv0);`),W.main.add(N`fragColor = getOverlayColorTexel();`);else{const e=0===J;V.main.add(N`${M(e,"gl_Position = transformPosition(proj, view, position);")}`),W.main.add(N`fragColor = vec4(0.0);`)}return i}const U=r(),B=i(),k=Object.freeze(Object.defineProperty({__proto__:null,TerrainPassParameters:V,build:W},Symbol.toStringTag,{value:"Module"}));export{V as T,k as a,W as b};
111
+ `)}if(9===H)if(K)r.pbrMode=0,i.include(j,r),r.pbrMode=E,_.main.add($`gl_Position = transformPosition(proj, view, position);
112
+ setOverlayVTC(uv0);`),V.main.add($`fragColor = getOverlayColorTexel();`);else{const e=0===G;_.main.add($`${P(e,"gl_Position = transformPosition(proj, view, position);")}`),V.main.add($`fragColor = vec4(0.0);`)}return i}const W=r(),U=i(),B=Object.freeze(Object.defineProperty({__proto__:null,TerrainPassParameters:_,build:V},Symbol.toStringTag,{value:"Module"}));export{_ as T,B as a,V as b};