@arcgis/core 5.2.0-next.64 → 5.2.0-next.65

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 (90) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{bb95922cd4631d6f17fb.js → 04ac5ac6f592d8c34bbd.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{0977f4d77c36175c2895.js → 3ddd717ea12d9823eee2.js} +1 -1
  4. package/assets/esri/core/workers/chunks/5adf16c034a590b5e9f5.js +1 -0
  5. package/assets/esri/core/workers/chunks/{57824ecc10b25e3ad794.js → 903e1cd8b76eff19ebdf.js} +1 -1
  6. package/assets/esri/core/workers/chunks/93c0a620a147cbf4a0ba.js +1 -0
  7. package/assets/esri/core/workers/chunks/9be6827e5756031a56c1.js +1 -0
  8. package/assets/esri/core/workers/chunks/a52c88e2d837b525ff6c.js +1 -0
  9. package/assets/esri/core/workers/chunks/{771ead806efbe9c91fdc.js → a5fdb02b1714e93fa69e.js} +1 -1
  10. package/assets/esri/core/workers/chunks/b4e5ee81b9eb171499a6.js +1 -0
  11. package/assets/esri/core/workers/chunks/bece22668622a9a6bfe2.js +1 -0
  12. package/assets/esri/core/workers/chunks/c02ae1d40c1fe95ae6c5.js +1 -0
  13. package/assets/esri/core/workers/chunks/d51c41c1944df0cbab3e.js +1 -0
  14. package/assets/esri/core/workers/chunks/d583bcea4d1a21da9147.js +1 -0
  15. package/assets/esri/core/workers/chunks/{ef27bf1d7941ae265ca4.js → d7267f429a051943187b.js} +1 -1
  16. package/assets/esri/core/workers/chunks/d9c78c2db04a06ee83ed.js +1 -0
  17. package/assets/esri/core/workers/chunks/{c1e45e24f5ef719a714c.js → dc7e4f7879debf557e46.js} +143 -95
  18. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  19. package/chunks/Component.glsl.js +60 -62
  20. package/chunks/DefaultMaterial.glsl.js +27 -28
  21. package/chunks/GaussianSplat.glsl.js +7 -7
  22. package/chunks/GaussianSplatShadow.glsl.js +9 -9
  23. package/chunks/GlobalIllumination.glsl.js +35 -15
  24. package/chunks/Path.glsl.js +7 -6
  25. package/chunks/RealisticTree.glsl.js +22 -24
  26. package/chunks/SSAO.glsl.js +1 -1
  27. package/chunks/Terrain.glsl.js +3 -2
  28. package/chunks/Water.glsl.js +20 -11
  29. package/chunks/_commonjsHelpers.js +1 -1
  30. package/chunks/bundle2.js +1 -1
  31. package/config.js +1 -1
  32. package/kernel.js +1 -1
  33. package/layers/graphics/sources/ParquetSource.js +1 -1
  34. package/layers/graphics/sources/parquet/FileProvider.js +1 -1
  35. package/layers/graphics/sources/parquet/ParquetFileInfo.js +1 -1
  36. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  37. package/layers/raster/datasets/EphemeralBlockCache.js +1 -1
  38. package/layers/raster/datasets/RawBlockCache.js +1 -1
  39. package/layers/support/KMLSublayer.js +1 -1
  40. package/layers/video/VideoController.js +1 -1
  41. package/libs/parquet/parquet.js +1 -1
  42. package/package.json +1 -1
  43. package/rest/support/Query.js +1 -1
  44. package/support/revision.js +1 -1
  45. package/symbols/LabelSymbol3D.js +1 -1
  46. package/symbols/LineSymbol3D.js +1 -1
  47. package/symbols/MeshSymbol3D.js +1 -1
  48. package/symbols/PointSymbol3D.js +1 -1
  49. package/symbols/PolygonSymbol3D.js +1 -1
  50. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
  51. package/views/3d/interactive/editingTools/transform/TransformTool3D.js +1 -1
  52. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  53. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  54. package/views/3d/state/controllers/RotateController.js +1 -1
  55. package/views/3d/state/utils/navigationUtils.js +1 -1
  56. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  57. package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
  58. package/views/3d/terrain/OverlayRenderer.js +1 -1
  59. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +24 -16
  60. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialExternalColor.glsl.js +25 -0
  61. package/views/3d/webgl-engine/lib/GaussianSplatRenderUtils.js +2 -0
  62. package/views/3d/webgl-engine/lib/GaussianSplatRenderer.js +1 -1
  63. package/views/3d/webgl-engine/lib/GaussianSplatShadows.js +1 -1
  64. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  65. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  66. package/views/3d/webgl-engine/shaders/GaussianSplatPassParameters.js +2 -0
  67. package/views/3d/webgl-engine/shaders/GaussianSplatShadow.glsl.js +1 -1
  68. package/views/3d/webgl-engine/shaders/GaussianSplatShadowTechnique.js +1 -1
  69. package/views/3d/webgl-engine/shaders/GaussianSplatTechnique.js +1 -1
  70. package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
  71. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  72. package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
  73. package/widgets/BatchAttributeForm/expressions/ExpressionsModel.js +1 -1
  74. package/widgets/LayerList/ListItem.js +1 -1
  75. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  76. package/widgets/OrientedImageryViewer/services/SuperimposeService.js +1 -1
  77. package/widgets/OrientedImageryViewer/services/TransformationService.js +1 -1
  78. package/widgets/OrientedImageryViewer/support/superimposeUtils.js +1 -1
  79. package/widgets/OrientedImageryViewer.js +1 -1
  80. package/widgets/TableList/ListItem.js +1 -1
  81. package/assets/esri/core/workers/chunks/43b39abd49c4a8ce891f.js +0 -1
  82. package/assets/esri/core/workers/chunks/5dbd8ca7e7b8eb9a0bf7.js +0 -1
  83. package/assets/esri/core/workers/chunks/6123894e2ae9233cdf89.js +0 -1
  84. package/assets/esri/core/workers/chunks/6b536d03b4bef408035b.js +0 -1
  85. package/assets/esri/core/workers/chunks/6c98a64d92c9bca78203.js +0 -1
  86. package/assets/esri/core/workers/chunks/78b80da3bbc1b608fe83.js +0 -1
  87. package/assets/esri/core/workers/chunks/7d85048c6cd6ad84faf9.js +0 -1
  88. package/assets/esri/core/workers/chunks/9008090a5d8431ddfa22.js +0 -1
  89. package/assets/esri/core/workers/chunks/a2d8bc0efddd2e13b1ad.js +0 -1
  90. package/assets/esri/core/workers/chunks/c97451f75c23be979476.js +0 -1
@@ -1,41 +1,26 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{ComponentData as e}from"../views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js";import{ForwardLinearDepthToWriteShadowMap as a}from"../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js";import{isColor as o,isShadow as r}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SlicePass as l}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{TextureCoordinateAttribute as t}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexColor as i}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js";import{VertexNormal as n}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js";import{VertexPosition as s}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js";import{outputDepth as d}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js";import{OutputHighlight as v}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{OutputHighlightOverlay as c}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlightOverlay.js";import{ReadDepth as g}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl.js";import{computeFragmentNormals as m}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeFragmentNormals.glsl.js";import{ComputeMaterialColor as u}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeMaterialColor.glsl.js";import{ComputeNormalTextureDraw as p}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import{EvaluateSceneLighting as y,addLightingGlobalFactor as h}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{addMainLightIntensity as f,addMainLightDirection as w}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{PhysicallyBasedRenderingParameters as b}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReadBaseColorTexture as C}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js";import{ReadShadowMapPassFragment as U}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{OverlayIM as x}from"../views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{DiscardOrAdjustAlphaDraw as O}from"../views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import{BooleanDrawUniform as L}from"../views/3d/webgl-engine/core/shaderModules/BooleanDrawUniform.js";import{FloatDrawUniform as S}from"../views/3d/webgl-engine/core/shaderModules/FloatDrawUniform.js";import{If as M,glsl as V}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DBindUniform as j}from"../views/3d/webgl-engine/core/shaderModules/Texture2DBindUniform.js";import{SnowCover as N}from"../views/3d/webgl-engine/effects/snowcover/SnowCover.glsl.js";import{alphaCutoff as T}from"../views/3d/webgl-engine/shaders/alphaCutoff.glsl.js";import{outputColorHighlightOLID as W}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js";import{getPlanetRadius as D,sphereDepthInterpolate as R}from"../views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js";import{ShaderBuilder as $}from"../views/webgl/ShaderBuilder.js";function P(P){const A=new $,{vertex:F,fragment:z}=A;A.include(s,P),A.include(n,P),A.include(i,P),A.include(t,P),A.include(e,P),A.include(O,P),z.include(l,P),A.include(C,P);const{output:B,pbrMode:I,hasNormalTexture:E,snowCover:_,receiveShadows:H,shadeNormals:G,spherical:k,sphericalSR:q,overlayEnabled:J,componentDataType:K,vertexDiscardMode:Q,renderOccluded:X,isGroundSlice:Y}=P,Z=o(B),ee=1===I||2===I;ee&&(A.include(b,P),E&&A.include(p,P));const ae=r(B),oe=11===B,re=10===B,le=ae&&1===K,te=D(P),ie=J&&k,ne=1===q;J&&(z.include(y,P),A.include(x,P),ie?(A.varyings.add("vPositionForDraping","vec3"),z.uniforms.add(new L("useENUForGlobalOverlayUV",e=>e.useENUForGlobalOverlayUV),new S("overlayMapScaleU",e=>e.toMapSpace[2]),new S("overlayReferenceU",e=>e.toMapSpace[0])),z.constants.add("overlayWorldWidth","float",ne?2*Math.PI*te:360),ne?(z.constants.add("pRadius","float",te),z.constants.add("halfSemiMajorAxis","float",.5*te)):z.constants.add("rad2deg1","float",180/Math.PI),z.constants.add("invRadius","float",1/te).code.add(V`
2
+ import{ComponentData as e}from"../views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js";import{ForwardLinearDepthToWriteShadowMap as o}from"../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js";import{isColor as r,isShadow as a}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SlicePass as l}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{TextureCoordinateAttribute as t}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexColor as i}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js";import{VertexNormal as n}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js";import{VertexPosition as s}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js";import{outputDepth as d}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js";import{OutputHighlight as c}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{OutputHighlightOverlay as v}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlightOverlay.js";import{ReadDepth as g}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl.js";import{computeFragmentNormals as m}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeFragmentNormals.glsl.js";import{ComputeMaterialColor as u}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeMaterialColor.glsl.js";import{ComputeNormalTextureDraw as p}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import{EvaluateSceneLighting as h,addLightingGlobalFactor as w}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{addMainLightIntensity as f,addMainLightDirection as y}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{PhysicallyBasedRenderingParameters as C}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReadBaseColorTexture as b}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js";import{ReadShadowMapPassFragment as x}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{OverlayIM as O}from"../views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{DiscardOrAdjustAlphaDraw as L}from"../views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import{BooleanDrawUniform as S}from"../views/3d/webgl-engine/core/shaderModules/BooleanDrawUniform.js";import{FloatDrawUniform as M}from"../views/3d/webgl-engine/core/shaderModules/FloatDrawUniform.js";import{If as U,glsl as j}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DBindUniform as N}from"../views/3d/webgl-engine/core/shaderModules/Texture2DBindUniform.js";import{SnowCover as V}from"../views/3d/webgl-engine/effects/snowcover/SnowCover.glsl.js";import{alphaCutoff as T}from"../views/3d/webgl-engine/shaders/alphaCutoff.glsl.js";import{outputColorHighlightOLID as W}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js";import{getPlanetRadius as $,sphereDepthInterpolate as D}from"../views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js";import{ShaderBuilder as P}from"../views/webgl/ShaderBuilder.js";function R(R){const A=new P,{vertex:F,fragment:z}=A;A.include(s,R),A.include(n,R),A.include(i,R),A.include(t,R),A.include(e,R),A.include(L,R),z.include(l,R),A.include(b,R);const{output:B,pbrMode:E,hasNormalTexture:I,snowCover:_,receiveShadows:H,shadeNormals:G,spherical:k,sphericalSR:q,overlayEnabled:J,componentDataType:K,vertexDiscardMode:Q,renderOccluded:X,isGroundSlice:Y}=R,Z=r(B),ee=1===E||2===E;ee&&(A.include(C,R),I&&A.include(p,R));const oe=a(B),re=11===B,ae=10===B,le=4===B,te=oe&&1===K,ie=$(R),ne=J&&k,se=1===q;(Z||le)&&(A.include(u,R),z.include(T)),J&&(z.include(h,R),A.include(O,R),ne?(A.varyings.add("vPositionForDraping","vec3"),z.uniforms.add(new S("useENUForGlobalOverlayUV",e=>e.useENUForGlobalOverlayUV),new M("overlayMapScaleU",e=>e.toMapSpace[2]),new M("overlayReferenceU",e=>e.toMapSpace[0])),z.constants.add("overlayWorldWidth","float",se?2*Math.PI*ie:360),se?(z.constants.add("pRadius","float",ie),z.constants.add("halfSemiMajorAxis","float",.5*ie)):z.constants.add("rad2deg1","float",180/Math.PI),z.constants.add("invRadius","float",1/ie).code.add(j`
3
3
  vec2 projectOverlay(vec3 pos) { return pos.xy / (1.0 + invRadius * pos.z); }
4
4
 
5
- float selectOverlayU(float overlayU0, float overlayU1, float scaleU, float offsetU) {
6
- float overlayU0Norm = overlayU0 * scaleU + offsetU;
7
- bool valid0 = overlayU0Norm >= 0.0 && overlayU0Norm <= 1.0;
8
-
9
- return valid0 ? overlayU0Norm : overlayU1 * scaleU + offsetU;
10
- }
11
-
12
- vec2 selectOverlayUV(vec2 overlayUV0, float scaleU, float offsetU, float wrapOffsetU) {
13
- float overlayU = selectOverlayU(overlayUV0.x, overlayUV0.x + wrapOffsetU, scaleU, offsetU);
14
- return vec2(overlayU, overlayUV0.y);
5
+ vec2 selectOverlayUVNorm(vec2 normUV, float offsetUNorm) {
6
+ float offsetU = normUV.x < 0.0 ? offsetUNorm : normUV.x > 1.0 ? -offsetUNorm : 0.0;
7
+ return normUV + vec2(offsetU, 0.0);
15
8
  }
16
9
 
17
10
  vec4 selectOverlayUVs(vec2 overlayUV0, float wrapOffsetU) {
18
- vec2 overlayUVInner = selectOverlayUV(overlayUV0, overlayTexScale.x, overlayTexOffset.x, wrapOffsetU);
19
- vec2 overlayUVOuter = selectOverlayUV(overlayUV0, overlayTexScale.z, overlayTexOffset.z, wrapOffsetU);
11
+ vec4 overlayUVNorm = overlayUV0.xyxy * overlayTexScale + overlayTexOffset;
20
12
  return vec4(
21
- overlayUVInner.x,
22
- overlayUVInner.y * overlayTexScale.y + overlayTexOffset.y,
23
- overlayUVOuter.x,
24
- overlayUVOuter.y * overlayTexScale.w + overlayTexOffset.w
13
+ selectOverlayUVNorm(overlayUVNorm.xy, wrapOffsetU * overlayTexScale.x),
14
+ selectOverlayUVNorm(overlayUVNorm.zw, wrapOffsetU * overlayTexScale.z)
25
15
  );
26
16
  }
27
17
 
28
- float overlayMapWrapOffsetU(float overlayU) {
29
- return overlayU < 0.0 ? overlayWorldWidth : -overlayWorldWidth;
30
- }
31
-
32
18
  vec4 selectLocalOverlayUVs(vec2 overlayUV0) {
33
- float overlayMapU = overlayReferenceU + overlayMapScaleU * overlayUV0.x;
34
- return selectOverlayUVs(overlayUV0, overlayMapWrapOffsetU(overlayMapU) / overlayMapScaleU);
19
+ return selectOverlayUVs(overlayUV0, overlayWorldWidth / overlayMapScaleU);
35
20
  }
36
21
 
37
22
  vec4 selectMapOverlayUVs(vec2 overlayUV0) {
38
- return selectOverlayUVs(overlayUV0, overlayMapWrapOffsetU(overlayUV0.x));
23
+ return selectOverlayUVs(overlayUV0, overlayWorldWidth);
39
24
  }
40
25
 
41
26
  vec2 overlayMapUVFromWorldPosition() {
@@ -46,12 +31,12 @@ import{ComponentData as e}from"../views/3d/webgl-engine/collections/Component/Ma
46
31
  float sinLat = wPos.z / oRadius;
47
32
  vec2 posMap;
48
33
 
49
- ${M(ne,V`
34
+ ${U(se,j`
50
35
  posMap = vec2(
51
36
  oLonRad * pRadius,
52
37
  halfSemiMajorAxis * log((1.0 + sinLat) / (1.0 - sinLat))
53
38
  );
54
- `,V`
39
+ `,j`
55
40
  float oLatRad = asin(clamp(sinLat,-1.0,1.0));
56
41
  posMap = vec2(rad2deg1 * oLonRad, rad2deg1 * oLatRad);
57
42
  `)}
@@ -64,12 +49,12 @@ import{ComponentData as e}from"../views/3d/webgl-engine/collections/Component/Ma
64
49
  ? selectLocalOverlayUVs(projectOverlay(vPositionForDraping))
65
50
  : selectMapOverlayUVs(overlayMapUVFromWorldPosition());
66
51
  }
67
- `)):F.code.add("vec2 projectOverlay(vec3 pos) { return pos.xy; }"));const se=J&&Z&&4===I;se&&(A.varyings.add("tbnTangent","vec3"),A.varyings.add("tbnBiTangent","vec3"),A.varyings.add("groundNormal","vec3"));const de=0===Q,ve=2===Q;if(A.include(U,P),A.include(a,P),F.include(T),F.main.add(V`
52
+ `)):F.code.add("vec2 projectOverlay(vec3 pos) { return pos.xy; }"));const de=J&&Z&&4===E;de&&(A.varyings.add("tbnTangent","vec3"),A.varyings.add("tbnBiTangent","vec3"),A.varyings.add("groundNormal","vec3"));const ce=0===Q,ve=2===Q;if(A.include(x,R),A.include(o,R),F.include(T),F.main.add(j`
68
53
  bool castShadows;
69
54
  vec4 externalColor = forwardExternalColor(castShadows);
70
- ${M(le,"if(!castShadows) { gl_Position = vec4(vec3(1e38), 1.0); return; }")}
71
- ${M(!de,`if (externalColor.a ${ve?">":"<="} opacityCutoff) {\n gl_Position = vec4(vec3(1e38), 1.0); return;\n }`)}
72
- ${M(oe,"externalColor.a = 1.0;")}
55
+ ${U(te,"if(!castShadows) { gl_Position = vec4(vec3(1e38), 1.0); return; }")}
56
+ ${U(!ce,`if (externalColor.a ${ve?">":"<="} opacityCutoff) {\n gl_Position = vec4(vec3(1e38), 1.0); return;\n }`)}
57
+ ${U(re,"externalColor.a = 1.0;")}
73
58
 
74
59
  forwardPosition(readElevationOffset());
75
60
  forwardNormal();
@@ -79,26 +64,26 @@ import{ComponentData as e}from"../views/3d/webgl-engine/collections/Component/Ma
79
64
  forwardLinearDepthToWriteShadowMap();
80
65
  forwardEmissiveStrength();
81
66
  forwardObjectAndLayerIdColor();
82
- ${M(se,k?V`
67
+ ${U(de,k?j`
83
68
  groundNormal = normalize(positionWorld());
84
69
  tbnTangent = normalize(cross(vec3(0.0, 0.0, 1.0), groundNormal));
85
- tbnBiTangent = normalize(cross(groundNormal, tbnTangent));`:V`
70
+ tbnBiTangent = normalize(cross(groundNormal, tbnTangent));`:j`
86
71
  groundNormal = vec3(0.0, 0.0, 1.0);
87
72
  tbnTangent = vec3(1.0, 0.0, 0.0);
88
73
  tbnBiTangent = vec3(0.0, 1.0, 0.0);`)}
89
- ${M(J,M(k,"vPositionForDraping = positionForDraping();\n vtcOverlay = vec4(0.0);","setOverlayVTC(projectOverlay(positionForDraping()));"))}
74
+ ${U(J,U(k,"vPositionForDraping = positionForDraping();\n vtcOverlay = vec4(0.0);","setOverlayVTC(projectOverlay(positionForDraping()));"))}
90
75
 
91
76
  if (externalColor.a < alphaCutoff) {
92
77
  // Discard this vertex
93
78
  gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
94
79
  return;
95
80
  }
96
- `),Z)return A.include(u,P),A.include(m,P),A.include(W,P),z.include(y,P),z.include(N,P),z.include(T),z.code.add(V`
81
+ `),Z)return A.include(m,R),A.include(W,R),z.include(h,R),z.include(V,R),z.code.add(j`
97
82
  float evaluateShadow() {
98
83
  return ${H?"readShadowMap(vPositionWorldCameraRelative, linearDepth)":"0.0"};
99
84
  }
100
- `).main.add(V`
101
- ${M(!Y,"discardBySlice(vPositionWorldCameraRelative);")}
85
+ `).main.add(j`
86
+ ${U(!Y,"discardBySlice(vPositionWorldCameraRelative);")}
102
87
 
103
88
  vec4 textureColor = readBaseColorTexture();
104
89
  discardOrAdjustAlpha(textureColor);
@@ -106,15 +91,15 @@ import{ComponentData as e}from"../views/3d/webgl-engine/collections/Component/Ma
106
91
  // When rendering the occluded overlay, we still need to read the base color texture because we need to use the
107
92
  // same discard logic. However after that to render only the draped overlay, we simply set the base texture color
108
93
  // to zero.
109
- ${M(X,V`textureColor = vec4(0);`)}
94
+ ${U(X,j`textureColor = vec4(0);`)}
110
95
 
111
- ${M(J,V`
112
- vec4 overlayUVs = ${ie?"componentOverlayUVs()":"vtcOverlay"};
96
+ ${U(J,j`
97
+ vec4 overlayUVs = ${ne?"componentOverlayUVs()":"vtcOverlay"};
113
98
 
114
99
  vec4 overlayColor = getOverlayColor(ovColorTex, overlayUVs);
115
100
 
116
101
  /* Early discard to only emit when we have overlay */
117
- ${M(X,V`if (overlayColor.a < alphaCutoff) { discard; }`)}
102
+ ${U(X,j`if (overlayColor.a < alphaCutoff) { discard; }`)}
118
103
  `)}
119
104
 
120
105
  vec4 externalColor;
@@ -122,47 +107,47 @@ import{ComponentData as e}from"../views/3d/webgl-engine/collections/Component/Ma
122
107
  readExternalColor(externalColor, externalColorMixMode);
123
108
 
124
109
  vec4 materialColor = computeMaterialColor(textureColor, externalColor, externalColorMixMode);
125
- `),ee?(f(z),k&&h(z),z.main.add(V`
110
+ `),ee?(f(z),k&&w(z),z.main.add(j`
126
111
  applyPBRFactors();
127
- ${M(1===I,V`if (externalColorMixMode == 3) {
112
+ ${U(1===E,j`if (externalColorMixMode == 3) {
128
113
  mrr = vec3(0.0, 0.6, 0.2);
129
114
  }`)}
130
115
  float additionalIrradiance = 0.02 * mainLightIntensity[2];
131
- ${M(E,"mat3 tangentSpace = computeTangentSpace(fragmentFaceNormal, vPositionWorldCameraRelative, vuv0);")}
132
- vec3 shadingNormal = ${E?"computeTextureNormal(tangentSpace, vuv0)":"fragmentShadingNormal"};
133
- vec3 groundNormal = ${k?V`normalize(positionWorld())`:V`vec3(0.0, 0.0, 1.0)`};
116
+ ${U(I,"mat3 tangentSpace = computeTangentSpace(fragmentFaceNormal, vPositionWorldCameraRelative, vuv0);")}
117
+ vec3 shadingNormal = ${I?"computeTextureNormal(tangentSpace, vuv0)":"fragmentShadingNormal"};
118
+ vec3 groundNormal = ${k?j`normalize(positionWorld())`:j`vec3(0.0, 0.0, 1.0)`};
134
119
 
135
120
  vec3 viewDir = normalize(vPositionWorldCameraRelative);
136
121
  float ssao = 1.0 - occlusion * evaluateAmbientOcclusionInverse();
137
- ${M(_,V`float snow = getSnow(fragmentFaceNormal, normalize(positionWorld()));
122
+ ${U(_,j`float snow = getSnow(fragmentFaceNormal, normalize(positionWorld()));
138
123
  materialColor.rgb = mix(materialColor.rgb, vec3(1.1), snow);
139
124
  ssao = mix(ssao, 0.5 * ssao, snow);
140
125
  shadingNormal = mix(shadingNormal, fragmentFaceNormal, snow);`)}
141
- ${M(J,"materialColor = materialColor * (1.0 - overlayColor.a) + overlayColor;")}
126
+ ${U(J,"materialColor = materialColor * (1.0 - overlayColor.a) + overlayColor;")}
142
127
 
143
128
  vec3 additionalLight = evaluateAdditionalLighting(ssao, positionWorld());
144
- ${M(k,"float additionalAmbientScale = additionalDirectedAmbientLight(positionWorld());")}
145
- ${k?V`float shadow = max(lightingGlobalFactor * (1.0 - additionalAmbientScale), evaluateShadow());`:"float shadow = evaluateShadow();"}
129
+ ${U(k,"float additionalAmbientScale = additionalDirectedAmbientLight(positionWorld());")}
130
+ ${k?j`float shadow = max(lightingGlobalFactor * (1.0 - additionalAmbientScale), evaluateShadow());`:"float shadow = evaluateShadow();"}
146
131
  vec4 shadedColor = vec4(evaluateSceneLightingPBR(shadingNormal, materialColor.rgb, shadow, ssao, additionalLight, viewDir, groundNormal, mrr, additionalIrradiance), materialColor.a);
147
- `)):(w(z),k&&h(z),se&&z.uniforms.add(new j("ovNormalTex",e=>e.overlay?.getTexture(3))),z.main.add(V`
148
- ${M(k,"float additionalAmbientScale = additionalDirectedAmbientLight(positionWorld());")}
132
+ `)):(y(z),k&&w(z),de&&z.uniforms.add(new N("ovNormalTex",e=>e.overlay?.getTexture(3))),z.main.add(j`
133
+ ${U(k,"float additionalAmbientScale = additionalDirectedAmbientLight(positionWorld());")}
149
134
  float shadow = ${H?k?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), evaluateShadow())":"evaluateShadow()":k?"lightingGlobalFactor * (1.0 - additionalAmbientScale)":"0.0"};
150
135
 
151
- ${M(H&&1!==G,V`
136
+ ${U(H&&1!==G,j`
152
137
  float dotFL = dot(fragmentFaceNormal, mainLightDirection);
153
138
  if( dotFL <= 0.0) shadow = 1.0;
154
139
  `)}
155
- ${M(_,V`float snow = getSnow(fragmentFaceNormal, normalize(positionWorld()));
140
+ ${U(_,j`float snow = getSnow(fragmentFaceNormal, normalize(positionWorld()));
156
141
  materialColor.rgb = mix(materialColor.rgb, vec3(1), snow);`)}
157
142
 
158
143
  // At global scale we create some additional ambient light based on the main light to simulate global illumination
159
144
  float ssao = evaluateAmbientOcclusion();
160
145
  vec3 additionalLight = evaluateAdditionalLighting(ssao, positionWorld());
161
146
 
162
- ${M(J,"materialColor = materialColor * (1.0 - overlayColor.a) + overlayColor;")}
147
+ ${U(J,"materialColor = materialColor * (1.0 - overlayColor.a) + overlayColor;")}
163
148
 
164
149
  vec4 shadedColor = vec4(evaluateSceneLighting(fragmentShadingNormal, materialColor.rgb, shadow, ssao, additionalLight), materialColor.a);
165
- ${M(se,V`vec4 overlayWaterMask = getOverlayColor(ovNormalTex, overlayUVs);
150
+ ${U(de,j`vec4 overlayWaterMask = getOverlayColor(ovNormalTex, overlayUVs);
166
151
  float waterNormalLength = length(overlayWaterMask);
167
152
  if (waterNormalLength > 0.95) {
168
153
  mat3 tbnMatrix = mat3(tbnTangent, tbnBiTangent, groundNormal);
@@ -171,15 +156,28 @@ import{ComponentData as e}from"../views/3d/webgl-engine/collections/Component/Ma
171
156
  // un-gamma the ground color to mix in linear space
172
157
  shadedColor = mix(shadedColor, waterColorNonLinear, waterColorLinear.w);
173
158
  }`)}
174
- `)),z.main.add(`\n ${M(Y,"if(rejectBySlice(vPositionWorldCameraRelative)) shadedColor.a *= groundSliceOpacity;")}\n\n outputColorHighlightOLID(applySlice(shadedColor, vPositionWorldCameraRelative), materialColor.rgb ${M(_,", snow")});\n `),P.sphereDepthInterpolate&&(A.include(R,P),A.fragment.include(g),z.main.add(V`vec3 worldRay = normalize(vPositionWorldCameraRelative);
159
+ `)),z.main.add(`\n ${U(Y,"if(rejectBySlice(vPositionWorldCameraRelative)) shadedColor.a *= groundSliceOpacity;")}\n\n outputColorHighlightOLID(applySlice(shadedColor, vPositionWorldCameraRelative), materialColor.rgb ${U(_,", snow")});\n `),R.sphereDepthInterpolate&&(A.include(D,R),A.fragment.include(g),z.main.add(j`vec3 worldRay = normalize(vPositionWorldCameraRelative);
175
160
  vec3 viewRay = normalize(vPosition_view);
176
- gl_FragDepth = delinearizeDepth(sphereDepthInterpolate(worldRay, viewRay, linearizeDepth(gl_FragCoord.z)));`)),A;const ce=4===B,ge=ae||8===B;return ge&&A.include(d,P),ce&&A.include(m,P),J&&A.include(c,P),A.include(v,P),z.main.add(V`
177
- ${M(!Y,"discardBySlice(vPositionWorldCameraRelative);")}
161
+ gl_FragDepth = delinearizeDepth(sphereDepthInterpolate(worldRay, viewRay, linearizeDepth(gl_FragCoord.z)));`)),A;const ge=oe||8===B;return ge&&A.include(d,R),le&&A.include(m,R),J&&A.include(v,R),A.include(c,R),z.main.add(j`
162
+ ${U(!Y,"discardBySlice(vPositionWorldCameraRelative);")}
178
163
 
179
164
  vec4 textureColor = readBaseColorTexture();
180
165
  discardOrAdjustAlpha(textureColor);
181
166
 
182
- ${M(ge,"outputDepth(linearDepth);")}
183
- ${M(ce,V`fragColor = vec4(vec3(0.5) + 0.5 * fragmentFaceNormalView, 1.0);`)}
184
- ${M(oe,J?ie?"fragColor = getOverlayColorTexel(componentOverlayUVs());":"fragColor = getOverlayColorTexel();":"outputObjectAndLayerIdColor();")}
185
- ${M(re,M(J,ie?V`calculateOcclusionAndOutputHighlight(getAllOverlayHighlightValuesEncoded(componentOverlayUVs()));`:V`calculateOcclusionAndOutputHighlight(getAllOverlayHighlightValuesEncoded());`,V`calculateOcclusionAndOutputHighlight();`))}`),A}const A=Object.freeze(Object.defineProperty({__proto__:null,build:P},Symbol.toStringTag,{value:"Module"}));export{A as C,P as b};
167
+ ${U(ge,"outputDepth(linearDepth);")}
168
+ ${U(le,j`
169
+ vec4 externalColor;
170
+ int externalColorMixMode;
171
+ readExternalColor(externalColor, externalColorMixMode);
172
+
173
+ vec4 materialColor = computeMaterialColor(textureColor, externalColor, externalColorMixMode);
174
+ ${U(Y,j`
175
+ if (rejectBySlice(vPositionWorldCameraRelative)) {
176
+ materialColor.a *= groundSliceOpacity;
177
+ }
178
+ `)}
179
+
180
+ fragColor = vec4(vec3(0.5) + 0.5 * fragmentFaceNormalView, materialColor.a);
181
+ `)}
182
+ ${U(re,J?ne?"fragColor = getOverlayColorTexel(componentOverlayUVs());":"fragColor = getOverlayColorTexel();":"outputObjectAndLayerIdColor();")}
183
+ ${U(ae,U(J,ne?j`calculateOcclusionAndOutputHighlight(getAllOverlayHighlightValuesEncoded(componentOverlayUVs()));`:j`calculateOcclusionAndOutputHighlight(getAllOverlayHighlightValuesEncoded());`,j`calculateOcclusionAndOutputHighlight();`))}`),A}const A=Object.freeze(Object.defineProperty({__proto__:null,build:R},Symbol.toStringTag,{value:"Module"}));export{A as C,R as b};
@@ -1,21 +1,15 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{Offset as e}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.js";import{isColor 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 l}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 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 c}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexColor as m}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js";import{VertexNormal as g}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js";import{VerticalOffset as u}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{ComputeNormalTexturePass as p}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,addAmbientBoostFactor as f,addLightingGlobalFactor as h}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{ReadShadowMapPassFragment as j,ReadShadowMapDrawFragment as P}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{colorTextureUV as M,normalTextureUV as N,emissiveTextureUV as S,occlusionTextureUV as O,metallicRoughnessTextureUV as T}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TextureTransformUV.glsl.js";import{VisualVariables as V}from"../views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js";import{DiscardOrAdjustAlphaPass as $}from"../views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import{MixExternalColor as A}from"../views/3d/webgl-engine/core/shaderLibrary/util/MixExternalColor.glsl.js";import{addProjViewLocalOrigin as D,addCameraPosition as U}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float3PassUniform as I}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{Float4PassUniform as E}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 B,glsl as _}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 F}from"../views/3d/webgl-engine/effects/snowcover/SnowCover.glsl.js";import{colorMixModes as W}from"../views/3d/webgl-engine/materials/internal/MaterialUtil.js";import{outputColorHighlightOLID as z}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js";import{ShaderBuilder as G}from"../views/webgl/ShaderBuilder.js";import{alphaCutoff as H}from"../webscene/support/AlphaCutoff.js";function q(q){const J=new G,{attributes:K,vertex:Q,fragment:X,varyings:Y}=J,{output:Z,normalType:ee,offsetBackfaces:re,spherical:oe,snowCover:ie,pbrMode:ae,textureAlphaPremultiplied:le,instancedDoublePrecision:se,hasVertexColors:ne,hasVertexTangents:te,hasColorTexture:de,hasNormalTexture:ce,hasNormalTextureTransform:me,hasColorTextureTransform:ge}=q;if(D(Q,q),K.add("position","vec3"),Q.inputs.add("position",()=>"position"),Y.add("vpos","vec3",{invariant:!0}),J.include(V,q),J.include(l,q),J.include(u,q),J.include(M,q),!r(Z))return J.include(v,q),J;J.include(N,q),J.include(S,q),J.include(O,q),J.include(T,q),U(Q,q),J.include(t,q),J.include(i);const ue=0===ee||1===ee;return ue&&re&&J.include(e),J.include(p,q),J.include(g,q),J.include(a,q),Y.add("vPositionLocal","vec3"),J.include(c,q),J.include(d,q),J.include(m,q),Q.uniforms.add(new E("externalColor",e=>e.externalColor,{supportsNaN:!0})),Y.add("vcolorExt","vec4"),Q.include(s),Q.include(n),J.include(se?j:P,q),Q.main.add(_`
3
- forwardVertexColor();
4
-
5
- MaskedColor maskedColor =
6
- applySymbolColor(applyVVColor(applyInstanceColor(createMaskedFromNaNColor(externalColor))));
7
-
8
- vcolorExt = maskedColor.color;
9
- forwardColorMixMode(maskedColor.mask);
2
+ import{Offset as e}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.js";import{isColor 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{InstancedDoublePrecision as a}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{TextureCoordinateAttribute as s}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexNormal as n}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js";import{VerticalOffset as t}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js";import{DefaultMaterialAuxiliaryPasses as d}from"../views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import{DefaultMaterialExternalColor as g}from"../views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialExternalColor.glsl.js";import{ComputeNormalTexturePass as c}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import{EvaluateAmbientOcclusion as m}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import{EvaluateSceneLighting as u,addAmbientBoostFactor as v,addLightingGlobalFactor as b}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{addMainLightIntensity as w}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{Normals as h}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js";import{PhysicallyBasedRendering as p}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import{PhysicallyBasedRenderingParameters as f}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReadShadowMapPassFragment as y,ReadShadowMapDrawFragment as x}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{colorTextureUV as L,normalTextureUV as j,emissiveTextureUV as C,occlusionTextureUV as P,metallicRoughnessTextureUV as S}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TextureTransformUV.glsl.js";import{VisualVariables as T}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{addProjViewLocalOrigin as N,addCameraPosition as V}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float3PassUniform as A}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{If as M,glsl as D}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DPassUniform as $}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{SnowCover as B}from"../views/3d/webgl-engine/effects/snowcover/SnowCover.glsl.js";import{outputColorHighlightOLID as I}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js";import{ShaderBuilder as U}from"../views/webgl/ShaderBuilder.js";function _(_){const R=new U,{attributes:E,vertex:W,fragment:F,varyings:z}=R,{output:G,normalType:k,offsetBackfaces:H,spherical:q,snowCover:J,pbrMode:K,textureAlphaPremultiplied:Q,instancedDoublePrecision:X,hasVertexColors:Y,hasVertexTangents:Z,hasColorTexture:ee,hasNormalTexture:re,hasNormalTextureTransform:oe,hasColorTextureTransform:ie}=_;if(N(W,_),E.add("position","vec3"),W.inputs.add("position",()=>"position"),z.add("vpos","vec3",{invariant:!0}),R.include(T,_),R.include(a,_),R.include(t,_),R.include(L,_),!r(G))return R.include(d,_),R;R.include(j,_),R.include(C,_),R.include(P,_),R.include(S,_),V(W,_),R.include(l,_),R.include(i);const ae=0===k||1===k;return ae&&H&&R.include(e),R.include(c,_),R.include(n,_),z.add("vPositionLocal","vec3"),R.include(s,_),R.include(g,_),R.include(X?y:x,_),W.main.add(D`
3
+ forwardDefaultMaterialExternalColor();
10
4
 
11
5
  vpos = getVertexInLocalOriginSpace();
12
6
  vPositionLocal = vpos - view[3].xyz;
13
7
  vpos = subtractOrigin(vpos);
14
- ${B(ue,"vNormalWorld = dpNormal(vvLocalNormal(normalModel()));")}
8
+ ${M(ae,"vNormalWorld = dpNormal(vvLocalNormal(normalModel()));")}
15
9
  vpos = addVerticalOffset(vpos, localOrigin);
16
- ${B(te,"vTangent = dpTransformVertexTangent(tangent);")}
10
+ ${M(Z,"vTangent = dpTransformVertexTangent(tangent);")}
17
11
  gl_Position = transformPosition(proj, view, vpos);
18
- ${B(ue&&re,"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);")}
12
+ ${M(ae&&H,"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);")}
19
13
 
20
14
  forwardTextureCoordinates();
21
15
  forwardColorUV();
@@ -24,18 +18,18 @@ import{Offset as e}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.
24
18
  forwardOcclusionUV();
25
19
  forwardMetallicRoughnessUV();
26
20
 
27
- if (opacityMixMode != ${_.int(W.ignore)} && vcolorExt.a < ${_.float(H)}) {
21
+ if (shouldCullByOpacity()) {
28
22
  gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
29
23
  }
30
24
  forwardLinearDepthToReadShadowMap();
31
- `),X.include(w,q),X.include(b,q),J.include($,q),X.include(o,q),J.include(z,q),U(X,q),X.uniforms.add(Q.uniforms.get("localOrigin"),new I("ambient",e=>e.ambient),new I("diffuse",e=>e.diffuse),new k("opacity",e=>e.opacity),new k("layerOpacity",e=>e.layerOpacity)),de&&X.uniforms.add(new R("tex",e=>e.texture)),J.include(L,q),X.include(C,q),X.include(A),J.include(x,q),X.include(F,q),f(X),h(X),y(X),X.main.add(_`
25
+ `),F.include(u,_),F.include(m,_),R.include(O,_),F.include(o,_),R.include(I,_),V(F,_),F.uniforms.add(W.uniforms.get("localOrigin"),new A("ambient",e=>e.ambient),new A("diffuse",e=>e.diffuse)),ee&&F.uniforms.add(new $("tex",e=>e.texture)),R.include(f,_),F.include(p,_),R.include(h,_),F.include(B,_),v(F),b(F),w(F),F.main.add(D`
32
26
  discardBySlice(vpos);
33
- ${de?_`
34
- vec4 texColor = texture(tex, ${ge?"colorUV":"vuv0"});
35
- ${B(le,"texColor.rgb /= texColor.a;")}
36
- discardOrAdjustAlpha(texColor);`:_`vec4 texColor = vec4(1.0);`}
27
+ ${ee?D`
28
+ vec4 texColor = texture(tex, ${ie?"colorUV":"vuv0"});
29
+ ${M(Q,"texColor.rgb /= texColor.a;")}
30
+ discardOrAdjustAlpha(texColor);`:D`vec4 texColor = vec4(1.0);`}
37
31
  shadingParams.viewDirection = normalize(vpos - cameraPosition);
38
- ${2===ee?_`vec3 normal = screenDerivativeNormal(vPositionLocal);`:_`shadingParams.normalView = vNormalWorld;
32
+ ${2===k?D`vec3 normal = screenDerivativeNormal(vPositionLocal);`:D`shadingParams.normalView = vNormalWorld;
39
33
  vec3 normal = shadingNormal(shadingParams);`}
40
34
  applyPBRFactors();
41
35
  float ssao = evaluateAmbientOcclusionInverse() * getBakedOcclusion();
@@ -46,13 +40,18 @@ import{Offset as e}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.
46
40
  float shadow = readShadow(additionalAmbientScale, vpos);
47
41
 
48
42
  vec3 matColor = max(ambient, diffuse);
49
- vec3 albedo = mixExternalColor(${B(ne,"vColor.rgb *")} matColor, texColor.rgb, vcolorExt.rgb, colorMixMode);
50
- float opacity_ = layerOpacity * mixExternalOpacity(${B(ne,"vColor.a * ")} opacity, texColor.a, vcolorExt.a, opacityMixMode);
43
+ vec3 albedo = mixExternalColor(
44
+ ${M(Y,"vColor.rgb *")} matColor,
45
+ texColor.rgb,
46
+ vExternalColor.rgb,
47
+ colorMixMode
48
+ );
49
+ float opacity_ = getDefaultMaterialOpacity(texColor.a);
51
50
 
52
- ${ce?`mat3 tangentSpace = computeTangentSpace(${te?"normal":"normal, vpos, vuv0"});\n vec3 shadingNormal = computeTextureNormal(tangentSpace, ${me?"normalUV":"vuv0"});`:"vec3 shadingNormal = normal;"}
53
- vec3 normalGround = ${oe?"normalize(posWorld);":"vec3(0.0, 0.0, 1.0);"}
51
+ ${re?`mat3 tangentSpace = computeTangentSpace(${Z?"normal":"normal, vpos, vuv0"});\n vec3 shadingNormal = computeTextureNormal(tangentSpace, ${oe?"normalUV":"vuv0"});`:"vec3 shadingNormal = normal;"}
52
+ vec3 normalGround = ${q?"normalize(posWorld);":"vec3(0.0, 0.0, 1.0);"}
54
53
 
55
- ${B(ie,_`
54
+ ${M(J,D`
56
55
  float snow = getSnow(normal, normalGround);
57
56
  albedo = mix(albedo, vec3(1), snow);
58
57
  shadingNormal = mix(shadingNormal, normal, snow);
@@ -60,10 +59,10 @@ import{Offset as e}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.
60
59
 
61
60
  vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
62
61
 
63
- ${1===ae||2===ae?_`
62
+ ${1===K||2===K?D`
64
63
  float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
65
- ${B(ie,"mrr = applySnowToMRR(mrr, snow);")}
66
- vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, additionalAmbientIrradiance);`:7===ae?_`vec3 shadedColor = albedo;`:_`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
64
+ ${M(J,"mrr = applySnowToMRR(mrr, snow);")}
65
+ vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, additionalAmbientIrradiance);`:7===K?D`vec3 shadedColor = albedo;`:D`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
67
66
  vec4 finalColor = vec4(shadedColor, opacity_);
68
- outputColorHighlightOLID(applySlice(finalColor, vpos), albedo ${B(ie,", snow")});
69
- `),J}const J=Object.freeze(Object.defineProperty({__proto__:null,build:q},Symbol.toStringTag,{value:"Module"}));export{J as D,q as b};
67
+ outputColorHighlightOLID(applySlice(finalColor, vpos), albedo ${M(J,", snow")});
68
+ `),R}const R=Object.freeze(Object.defineProperty({__proto__:null,build:_},Symbol.toStringTag,{value:"Module"}));export{R as D,_ as b};
@@ -1,14 +1,14 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{set as e}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as i}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{RejectBySlicePass as n}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{EvaluateSceneLighting as t,addAmbientBoostFactor as o,addLightingGlobalFactor as r}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{NormalUtils as s}from"../views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js";import{positionOutsideClipSpace as l}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PositionOutsideClipSpace.js";import{ReadShadowMapPassFragment as c}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{GaussianSplatCovariance as d}from"../views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatCovariance.glsl.js";import{GaussianSplatEvaluation as g}from"../views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatEvaluation.glsl.js";import{GaussianSplatTextureFetch as p}from"../views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatTextureFetch.glsl.js";import{GaussianSplatUnpackingPassParameters as m,GaussianSplatUnpacking as u}from"../views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js";import{QuaternionToRotationMatrix as f}from"../views/3d/webgl-engine/core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js";import{RgbNormalizedDepthEncoding as v}from"../views/3d/webgl-engine/core/shaderLibrary/util/RgbNormalizedDepthEncoding.glsl.js";import{Float2BindUniform as h}from"../views/3d/webgl-engine/core/shaderModules/Float2BindUniform.js";import{Float2PassUniform as w}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{Float3BindUniform as x}from"../views/3d/webgl-engine/core/shaderModules/Float3BindUniform.js";import{Float3PassUniform as b}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{FloatPassUniform as y}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as P,If as C}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Matrix4BindUniform as S}from"../views/3d/webgl-engine/core/shaderModules/Matrix4BindUniform.js";import{Texture2DUintPassUniform as M}from"../views/3d/webgl-engine/core/shaderModules/Texture2DUintPassUniform.js";import{getGaussianSplatAlphaCutoffValue as R}from"../views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js";import{ShaderBuilder as j}from"../views/webgl/ShaderBuilder.js";class L extends m{constructor(){super(...arguments),this.clipMinCameraRelative=i(),this.clipMaxCameraRelative=i(),this.focalLength=-1,this.minSplatRadius=-1,this.tanFov=a(),this.origin=i()}}function F(a){const{clippingEnabled:i,hasSlicePlane:m,receiveShadows:L,spherical:F}=a,D=new j;D.varyings.add("vColor","vec4"),D.varyings.add("conicOpacity","vec4"),D.varyings.add("gaussianLogAlphaCutoff","float"),D.varyings.add("offsetFromCenter","vec2"),G(a)&&D.varyings.add("fragmentPositionCameraRelative","vec3"),D.vertex.uniforms.add(new M("splatOrderTexture",e=>e.splatOrder),new M("splatFadingTexture",e=>e.splatFading),new M("splatAtlasTexture",e=>e.splatAtlas),new M("splatHeaderTexture",e=>e.splatHeader),new y("focalLength",e=>e.focalLength),new y("minSplatRadius",e=>e.minSplatRadius),new w("tanFov",e=>e.tanFov),new h("inverseScreenSize",({camera:a})=>e(z,1/a.fullWidth,1/a.fullHeight)),new S("proj",e=>e.camera.projectionMatrix),new S("view",e=>e.camera.viewMatrix),new h("nearFar",e=>e.camera.nearFar),new x("cameraPosition",e=>e.camera.eye)),i&&(D.vertex.uniforms.add(new b("clipMin",e=>e.clipMinCameraRelative),new b("clipMax",e=>e.clipMaxCameraRelative)),D.fragment.uniforms.add(new b("clipMin",e=>e.clipMinCameraRelative),new b("clipMax",e=>e.clipMaxCameraRelative))),D.vertex.include(u),D.vertex.include(p),D.vertex.include(f),D.vertex.include(d),D.vertex.include(g),D.vertex.include(n,a),L?(D.fragment.uniforms.add(new x("cameraPosition",e=>e.camera.eye)),D.fragment.include(t,a)):D.vertex.include(t,a),D.include(s,a),o(L?D.fragment:D.vertex),r(L?D.fragment:D.vertex),L&&D.include(c,a),D.outputs.add("fragColor","vec4",0),D.outputs.add("fragDepthColor","vec4",1);const A=R(a.alphaCutoff),T=Math.log(A),B=P`float groundLightAlignment = dot(groundNormal, mainLightDirection);
2
+ import{set as e}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{RejectBySlicePass as n}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{EvaluateSceneLighting as i,addAmbientBoostFactor as t,addLightingGlobalFactor as o}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{NormalUtils as r}from"../views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js";import{positionOutsideClipSpace as s}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PositionOutsideClipSpace.js";import{ReadShadowMapPassFragment as l}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{GaussianSplatCovariance as c}from"../views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatCovariance.glsl.js";import{GaussianSplatEvaluation as d}from"../views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatEvaluation.glsl.js";import{GaussianSplatTextureFetch as g}from"../views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatTextureFetch.glsl.js";import{GaussianSplatUnpacking as p}from"../views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js";import{QuaternionToRotationMatrix as u}from"../views/3d/webgl-engine/core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js";import{RgbNormalizedDepthEncoding as m}from"../views/3d/webgl-engine/core/shaderLibrary/util/RgbNormalizedDepthEncoding.glsl.js";import{Float2BindUniform as f}from"../views/3d/webgl-engine/core/shaderModules/Float2BindUniform.js";import{Float2PassUniform as v}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{Float3BindUniform as h}from"../views/3d/webgl-engine/core/shaderModules/Float3BindUniform.js";import{Float3PassUniform as w}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{FloatPassUniform as x}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as b,If as y}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Matrix4BindUniform as P}from"../views/3d/webgl-engine/core/shaderModules/Matrix4BindUniform.js";import{Texture2DUintPassUniform as C}from"../views/3d/webgl-engine/core/shaderModules/Texture2DUintPassUniform.js";import{getGaussianSplatAlphaCutoffValue as S}from"../views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js";import{ShaderBuilder as M}from"../views/webgl/ShaderBuilder.js";function j(a){const{clippingEnabled:j,hasSlicePlane:z,receiveShadows:F,spherical:G}=a,D=new M;D.varyings.add("vColor","vec4"),D.varyings.add("conicOpacity","vec4"),D.varyings.add("gaussianLogAlphaCutoff","float"),D.varyings.add("offsetFromCenter","vec2"),R(a)&&D.varyings.add("fragmentPositionCameraRelative","vec3"),D.vertex.uniforms.add(new C("splatOrderTexture",e=>e.splatOrder),new C("splatFadingTexture",e=>e.splatFading),new C("splatAtlasTexture",e=>e.splatAtlas),new C("splatHeaderTexture",e=>e.splatHeader),new x("focalLength",e=>e.focalLength),new x("minSplatRadius",e=>e.minSplatRadius),new v("tanFov",e=>e.tanFov),new f("inverseScreenSize",({camera:a})=>e(L,1/a.fullWidth,1/a.fullHeight)),new P("proj",e=>e.camera.projectionMatrix),new P("view",e=>e.camera.viewMatrix),new f("nearFar",e=>e.camera.nearFar),new h("cameraPosition",e=>e.camera.eye)),j&&(D.vertex.uniforms.add(new w("clipMin",e=>e.clipMinCameraRelative),new w("clipMax",e=>e.clipMaxCameraRelative)),D.fragment.uniforms.add(new w("clipMin",e=>e.clipMinCameraRelative),new w("clipMax",e=>e.clipMaxCameraRelative))),D.vertex.include(p),D.vertex.include(g),D.vertex.include(u),D.vertex.include(c),D.vertex.include(d),D.vertex.include(n,a),F?(D.fragment.uniforms.add(new h("cameraPosition",e=>e.camera.eye)),D.fragment.include(i,a)):D.vertex.include(i,a),D.include(r,a),t(F?D.fragment:D.vertex),o(F?D.fragment:D.vertex),F&&D.include(l,a),D.outputs.add("fragColor","vec4",0),D.outputs.add("fragDepthColor","vec4",1);const A=S(a.alphaCutoff),T=Math.log(A),B=b`float groundLightAlignment = dot(groundNormal, mainLightDirection);
3
3
  float additionalAmbientScale = additionalDirectedAmbientLight(groundLightAlignment);
4
- vec3 additionalLight = mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;`,$=P`
5
- vec3 groundNormal = ${F?P`normalize(cameraRelativePosition + cameraPosition)`:P`vec3(0.0, 0.0, 1.0)`};
4
+ vec3 additionalLight = mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;`,$=b`
5
+ vec3 groundNormal = ${G?b`normalize(cameraRelativePosition + cameraPosition)`:b`vec3(0.0, 0.0, 1.0)`};
6
6
  ${B}
7
- float shadow = ${F?P`lightingGlobalFactor * (1.0 - additionalAmbientScale)`:P`0.0`};
7
+ float shadow = ${G?b`lightingGlobalFactor * (1.0 - additionalAmbientScale)`:b`0.0`};
8
8
  vColor.rgb = evaluateSceneLighting(groundNormal, vColor.rgb, shadow, 0.0, additionalLight);
9
- `,E=P`
10
- vec3 groundNormal = ${F?P`normalize(fragmentPositionCameraRelative + cameraPosition)`:P`vec3(0.0, 0.0, 1.0)`};
9
+ `,E=b`
10
+ vec3 groundNormal = ${G?b`normalize(fragmentPositionCameraRelative + cameraPosition)`:b`vec3(0.0, 0.0, 1.0)`};
11
11
  ${B}
12
12
  float shadow = readShadow(additionalAmbientScale, fragmentPositionCameraRelative);
13
13
  shadedColor = evaluateSceneLighting(groundNormal, vColor.rgb, shadow, 0.0, additionalLight);
14
- `;return D.vertex.main.add(`\n uint gaussianIndex = fetchOrderedGaussianIndex(uint(gl_InstanceID));\n uvec4 packedGaussian = fetchPackedGaussian(gaussianIndex);\n uint pageNum = fetchGaussianPageIndex(gaussianIndex);\n\n // Unpack color first so very transparent splats can discard before fetching the page header.\n vColor = unpackColor(packedGaussian);\n\n // Apply per-page fading before the early alpha rejection.\n ${C(a.fadingEnabled,"\n uint fadingTextureWidth = uint(textureSize(splatFadingTexture, 0).x);\n uint fadeX = pageNum % fadingTextureWidth;\n uint fadeY = pageNum / fadingTextureWidth;\n uint opacityModifierByte = texelFetch(splatFadingTexture, ivec2(fadeX , fadeY), 0).r;\n float opacityModifier = float(opacityModifierByte) / 255.0;\n vColor.a *= opacityModifier;\n ")}\n\n // Set default position outside clip space for early returns.\n gl_Position = ${l};\n\n if (vColor.a < ${A}) {\n return;\n }\n\n // Delay the page header fetch until the splat survives the opacity reject.\n vec3 cameraRelativePosition = fetchGaussianCameraRelativePosition(gaussianIndex, packedGaussian);\n\n ${C(i,"\n if (cameraRelativePosition.x < clipMin.x || cameraRelativePosition.y < clipMin.y || cameraRelativePosition.z < clipMin.z ||\n cameraRelativePosition.x > clipMax.x || cameraRelativePosition.y > clipMax.y || cameraRelativePosition.z > clipMax.z) {\n return;\n }\n ")}\n\n ${C(m,"if (rejectBySlice(cameraRelativePosition)) {\n return;\n }")}\n\n vec4 viewPos = vec4(mat3(view) * cameraRelativePosition, 1);\n\n if (viewPos.z > -nearFar.x || viewPos.z < -nearFar.y) {\n return;\n }\n\n vec3 covarianceA;\n vec3 covarianceB;\n computePackedGaussianCovariance3D(packedGaussian, covarianceA, covarianceB);\n\n float covariance3D[6] = float[6](covarianceA.x, covarianceA.y, covarianceA.z, covarianceB.x, covarianceB.y, covarianceB.z);\n\n vec3 covariance2D = computeGaussianCovariance2D(viewPos.xyz, focalLength, tanFov, covariance3D, view);\n\n // Reject degenerate covariances before inverting them into conic coefficients.\n float determinant = computeGaussianCovarianceDeterminant(covariance2D);\n if (determinant <= 0.) {\n return;\n }\n\n vec2 eigenvalues = computeGaussianCovarianceEigenvalues(covariance2D);\n\n // Fold the per-splat opacity into the log cutoff so the vertex-side ellipse\n // bound matches the fragment alpha discard after fading.\n gaussianLogAlphaCutoff = ${T} - log(vColor.a);\n float gaussianEllipseThreshold = computeGaussianEllipseThreshold(gaussianLogAlphaCutoff);\n vec2 axisLengths = computeGaussianAxisLengths(eigenvalues, gaussianEllipseThreshold);\n float maxRadius = max(axisLengths.x, axisLengths.y);\n\n // Ignore Gaussians with very small contribution, with tolerance based on the quality profile.\n if (rejectGaussianByMinimumRadius(maxRadius, vColor.a, minSplatRadius)) {\n return;\n }\n\n vec4 projPos = proj * viewPos;\n float invW = 1. / (projPos.w + 1e-7);\n vec3 ndcPos = projPos.xyz * invW;\n vec2 clipSpacePixelScale = 2.0 * inverseScreenSize;\n\n // Cull splats whose screen-space ellipse cannot touch the viewport.\n if (rejectGaussianByScreenBounds(ndcPos.xy, maxRadius, clipSpacePixelScale)) {\n return;\n }\n\n offsetFromCenter = computeGaussianQuadOffset(covariance2D, eigenvalues, axisLengths, gl_VertexID);\n\n ${C(G(a),"float viewSpacePixelScale = -viewPos.z / focalLength;\n vec3 fragmentViewOffset = vec3(offsetFromCenter * viewSpacePixelScale, 0.0);\n fragmentPositionCameraRelative = cameraRelativePosition + transpose(mat3(view)) * fragmentViewOffset;")}\n\n // Store conic coefficients with opacity for fragment-side falloff.\n vec3 conic = computeGaussianConic(covariance2D, determinant);\n conicOpacity = vec4(conic, vColor.a);\n\n // Handle environment lighting per vertex when no shadow map is active.\n // When shadows are received, defer lighting to the fragment shader for crisp shadow borders.\n ${C(L,"forwardLinearDepth(-viewPos.z);",$)}\n\n // Place this quad corner in clip space around the projected splat center.\n vec2 quadClipPosition = ndcPos.xy + offsetFromCenter * clipSpacePixelScale - inverseScreenSize;\n\n gl_Position = vec4(quadClipPosition, ndcPos.z, 1.0);\n\n `),D.fragment.include(v),D.fragment.include(g),D.fragment.include(n,a),D.fragment.main.add(`\n ${C(i,"if (fragmentPositionCameraRelative.x < clipMin.x || fragmentPositionCameraRelative.y < clipMin.y || fragmentPositionCameraRelative.z < clipMin.z ||\n fragmentPositionCameraRelative.x > clipMax.x || fragmentPositionCameraRelative.y > clipMax.y || fragmentPositionCameraRelative.z > clipMax.z) {\n discard;\n }")}\n ${C(m,"if (rejectBySlice(fragmentPositionCameraRelative)) { discard; }")}\n\n float gaussianExponent = evaluateGaussianExponent(conicOpacity.xyz, offsetFromCenter);\n\n // A positive exponent indicates alpha > 1, which should not happen.\n // We also early check the opacity-aware alpha cutoff to avoid unnecessary exp().\n if (gaussianExponent > 0.0 || gaussianExponent < gaussianLogAlphaCutoff) {\n discard;\n }\n\n float gaussianFalloff = exp(gaussianExponent);\n\n // Cap at 0.99 to avoid blending issues, such as seams between overlapping Gaussians.\n float alpha = min(.99f, conicOpacity.w * gaussianFalloff);\n\n vec3 shadedColor = vColor.rgb;\n ${C(L,E)}\n fragColor = vec4(shadedColor * alpha, alpha);\n\n // We simulate first hit based depth using 0.25 as the opacity threshold.\n // This works because we render in front-to-back order,\n // i.e. the first hit that counts completely saturates the alpha channel\n // and further splats do not contribute.\n float depthHit = step(0.25, alpha);\n float normalizedDepth = gl_FragCoord.z;\n fragDepthColor = vec4(encodeNormalizedDepthToRGB(normalizedDepth) * depthHit, depthHit);\n `),D}function G({clippingEnabled:e,hasSlicePlane:a,receiveShadows:i}){return i||a||e}const z=a(),D=Object.freeze(Object.defineProperty({__proto__:null,GaussianSplatPassParameters:L,build:F},Symbol.toStringTag,{value:"Module"}));export{L as G,D as a,F as b};
14
+ `;return D.vertex.main.add(`\n uint gaussianIndex = fetchOrderedGaussianIndex(uint(gl_InstanceID));\n uvec4 packedGaussian = fetchPackedGaussian(gaussianIndex);\n uint pageNum = fetchGaussianPageIndex(gaussianIndex);\n\n // Unpack color first so very transparent splats can discard before fetching the page header.\n vColor = unpackColor(packedGaussian);\n\n // Apply per-page fading before the early alpha rejection.\n ${y(a.fadingEnabled,"\n uint fadingTextureWidth = uint(textureSize(splatFadingTexture, 0).x);\n uint fadeX = pageNum % fadingTextureWidth;\n uint fadeY = pageNum / fadingTextureWidth;\n uint opacityModifierByte = texelFetch(splatFadingTexture, ivec2(fadeX , fadeY), 0).r;\n float opacityModifier = float(opacityModifierByte) / 255.0;\n vColor.a *= opacityModifier;\n ")}\n\n // Set default position outside clip space for early returns.\n gl_Position = ${s};\n\n if (vColor.a < ${A}) {\n return;\n }\n\n // Delay the page header fetch until the splat survives the opacity reject.\n vec3 cameraRelativePosition = fetchGaussianCameraRelativePosition(gaussianIndex, packedGaussian);\n\n ${y(j,"\n if (cameraRelativePosition.x < clipMin.x || cameraRelativePosition.y < clipMin.y || cameraRelativePosition.z < clipMin.z ||\n cameraRelativePosition.x > clipMax.x || cameraRelativePosition.y > clipMax.y || cameraRelativePosition.z > clipMax.z) {\n return;\n }\n ")}\n\n ${y(z,"if (rejectBySlice(cameraRelativePosition)) {\n return;\n }")}\n\n vec4 viewPos = vec4(mat3(view) * cameraRelativePosition, 1);\n\n if (viewPos.z > -nearFar.x || viewPos.z < -nearFar.y) {\n return;\n }\n\n vec3 covarianceA;\n vec3 covarianceB;\n computePackedGaussianCovariance3D(packedGaussian, covarianceA, covarianceB);\n\n float covariance3D[6] = float[6](covarianceA.x, covarianceA.y, covarianceA.z, covarianceB.x, covarianceB.y, covarianceB.z);\n\n vec3 covariance2D = computeGaussianCovariance2D(viewPos.xyz, focalLength, tanFov, covariance3D, view);\n\n // Reject degenerate covariances before inverting them into conic coefficients.\n float determinant = computeGaussianCovarianceDeterminant(covariance2D);\n if (determinant <= 0.) {\n return;\n }\n\n vec2 eigenvalues = computeGaussianCovarianceEigenvalues(covariance2D);\n\n // Fold the per-splat opacity into the log cutoff so the vertex-side ellipse\n // bound matches the fragment alpha discard after fading.\n gaussianLogAlphaCutoff = ${T} - log(vColor.a);\n float gaussianEllipseThreshold = computeGaussianEllipseThreshold(gaussianLogAlphaCutoff);\n vec2 axisLengths = computeGaussianAxisLengths(eigenvalues, gaussianEllipseThreshold);\n float maxRadius = max(axisLengths.x, axisLengths.y);\n\n // Ignore Gaussians with very small contribution, with tolerance based on the quality profile.\n if (rejectGaussianByMinimumRadius(maxRadius, vColor.a, minSplatRadius)) {\n return;\n }\n\n vec4 projPos = proj * viewPos;\n float invW = 1. / (projPos.w + 1e-7);\n vec3 ndcPos = projPos.xyz * invW;\n vec2 clipSpacePixelScale = 2.0 * inverseScreenSize;\n\n // Cull splats whose screen-space ellipse cannot touch the viewport.\n if (rejectGaussianByScreenBounds(ndcPos.xy, maxRadius, clipSpacePixelScale)) {\n return;\n }\n\n offsetFromCenter = computeGaussianQuadOffset(covariance2D, eigenvalues, axisLengths, gl_VertexID);\n\n ${y(R(a),"float viewSpacePixelScale = -viewPos.z / focalLength;\n vec3 fragmentViewOffset = vec3(offsetFromCenter * viewSpacePixelScale, 0.0);\n fragmentPositionCameraRelative = cameraRelativePosition + transpose(mat3(view)) * fragmentViewOffset;")}\n\n // Store conic coefficients with opacity for fragment-side falloff.\n vec3 conic = computeGaussianConic(covariance2D, determinant);\n conicOpacity = vec4(conic, vColor.a);\n\n // Handle environment lighting per vertex when no shadow map is active.\n // When shadows are received, defer lighting to the fragment shader for crisp shadow borders.\n ${y(F,"forwardLinearDepth(-viewPos.z);",$)}\n\n // Place this quad corner in clip space around the projected splat center.\n vec2 quadClipPosition = ndcPos.xy + offsetFromCenter * clipSpacePixelScale - inverseScreenSize;\n\n gl_Position = vec4(quadClipPosition, ndcPos.z, 1.0);\n\n `),D.fragment.include(m),D.fragment.include(d),D.fragment.include(n,a),D.fragment.main.add(`\n ${y(j,"if (fragmentPositionCameraRelative.x < clipMin.x || fragmentPositionCameraRelative.y < clipMin.y || fragmentPositionCameraRelative.z < clipMin.z ||\n fragmentPositionCameraRelative.x > clipMax.x || fragmentPositionCameraRelative.y > clipMax.y || fragmentPositionCameraRelative.z > clipMax.z) {\n discard;\n }")}\n ${y(z,"if (rejectBySlice(fragmentPositionCameraRelative)) { discard; }")}\n\n float gaussianExponent = evaluateGaussianExponent(conicOpacity.xyz, offsetFromCenter);\n\n // A positive exponent indicates alpha > 1, which should not happen.\n // We also early check the opacity-aware alpha cutoff to avoid unnecessary exp().\n if (gaussianExponent > 0.0 || gaussianExponent < gaussianLogAlphaCutoff) {\n discard;\n }\n\n float gaussianFalloff = exp(gaussianExponent);\n\n // Cap at 0.99 to avoid blending issues, such as seams between overlapping Gaussians.\n float alpha = min(.99f, conicOpacity.w * gaussianFalloff);\n\n vec3 shadedColor = vColor.rgb;\n ${y(F,E)}\n fragColor = vec4(shadedColor * alpha, alpha);\n\n // We simulate first hit based depth using 0.25 as the opacity threshold.\n // This works because we render in front-to-back order,\n // i.e. the first hit that counts completely saturates the alpha channel\n // and further splats do not contribute.\n float depthHit = step(0.25, alpha);\n float normalizedDepth = gl_FragCoord.z;\n fragDepthColor = vec4(encodeNormalizedDepthToRGB(normalizedDepth) * depthHit, depthHit);\n `),D}function R({clippingEnabled:e,hasSlicePlane:a,receiveShadows:n}){return n||a||e}const L=a(),z=Object.freeze(Object.defineProperty({__proto__:null,build:j},Symbol.toStringTag,{value:"Module"}));export{z as G,j as b};
@@ -1,7 +1,7 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{set as e}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as i}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{RejectBySlicePass as n}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{positionOutsideClipSpace as r}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PositionOutsideClipSpace.js";import{GaussianSplatCovariance as o}from"../views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatCovariance.glsl.js";import{GaussianSplatEvaluation as c}from"../views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatEvaluation.glsl.js";import{GaussianSplatTextureFetch as s}from"../views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatTextureFetch.glsl.js";import{GaussianSplatUnpackingPassParameters as t,GaussianSplatUnpacking as l}from"../views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js";import{QuaternionToRotationMatrix as v}from"../views/3d/webgl-engine/core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js";import{Float2BindUniform as d}from"../views/3d/webgl-engine/core/shaderModules/Float2BindUniform.js";import{Float3PassUniform as p}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{FloatPassUniform as u}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as m,If as f}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Matrix4BindUniform as x}from"../views/3d/webgl-engine/core/shaderModules/Matrix4BindUniform.js";import{Texture2DUintPassUniform as g}from"../views/3d/webgl-engine/core/shaderModules/Texture2DUintPassUniform.js";import{ShaderBuilder as h}from"../views/webgl/ShaderBuilder.js";class w extends t{constructor(){super(...arguments),this.clipMinCameraRelative=i(),this.clipMaxCameraRelative=i(),this.minSplatRadius=-1}}function S(a){const{clippingEnabled:i,hasSlicePlane:t}=a,w=new h,{fragment:S,varyings:j,vertex:y}=w;j.add("conic","vec3"),j.add("gaussianLogAlphaCutoff","float"),j.add("offsetFromCenter","vec2"),y.uniforms.add(new g("splatOrderTexture",e=>e.splatOrder),new g("splatAtlasTexture",e=>e.splatAtlas),new g("splatHeaderTexture",e=>e.splatHeader),new u("minSplatRadius",e=>e.minSplatRadius),new d("inverseScreenSize",({camera:a})=>e(P,1/a.fullWidth,1/a.fullHeight)),new x("proj",e=>e.camera.projectionMatrix),new x("view",e=>e.camera.viewMatrix),new d("nearFar",e=>e.camera.nearFar)),i&&y.uniforms.add(new p("clipMin",e=>e.clipMinCameraRelative),new p("clipMax",e=>e.clipMaxCameraRelative)),y.include(l),y.include(s),y.include(v),y.include(o),y.include(c),y.include(n,a),y.code.add(m`float safeClipW(float clipW) {
2
+ import{set as e}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{RejectBySlicePass as i}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{positionOutsideClipSpace as n}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PositionOutsideClipSpace.js";import{GaussianSplatCovariance as r}from"../views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatCovariance.glsl.js";import{GaussianSplatEvaluation as o}from"../views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatEvaluation.glsl.js";import{GaussianSplatTextureFetch as c}from"../views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatTextureFetch.glsl.js";import{GaussianSplatUnpacking as s}from"../views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js";import{QuaternionToRotationMatrix as t}from"../views/3d/webgl-engine/core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js";import{Float2BindUniform as l}from"../views/3d/webgl-engine/core/shaderModules/Float2BindUniform.js";import{Float3PassUniform as v}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{FloatPassUniform as d}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as p,If as u}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Matrix4BindUniform as f}from"../views/3d/webgl-engine/core/shaderModules/Matrix4BindUniform.js";import{Texture2DUintPassUniform as m}from"../views/3d/webgl-engine/core/shaderModules/Texture2DUintPassUniform.js";import{ShaderBuilder as x}from"../views/webgl/ShaderBuilder.js";function g(a){const{clippingEnabled:g,hasSlicePlane:h}=a,S=new x,{fragment:P,varyings:j,vertex:y}=S;j.add("conic","vec3"),j.add("gaussianLogAlphaCutoff","float"),j.add("offsetFromCenter","vec2"),y.uniforms.add(new m("splatOrderTexture",e=>e.splatOrder),new m("splatAtlasTexture",e=>e.splatAtlas),new m("splatHeaderTexture",e=>e.splatHeader),new d("minSplatRadius",e=>e.minSplatRadius),new l("inverseScreenSize",({camera:a})=>e(w,1/a.fullWidth,1/a.fullHeight)),new f("proj",e=>e.camera.projectionMatrix),new f("view",e=>e.camera.viewMatrix),new l("nearFar",e=>e.camera.nearFar)),g&&y.uniforms.add(new v("clipMin",e=>e.clipMinCameraRelative),new v("clipMax",e=>e.clipMaxCameraRelative)),y.include(s),y.include(c),y.include(t),y.include(r),y.include(o),y.include(i,a),y.code.add(p`float safeClipW(float clipW) {
3
3
  return abs(clipW) < 1e-7 ? (clipW < 0.0 ? -1e-7 : 1e-7) : clipW;
4
- }`),y.code.add(m`vec3 computeProjectivePixelGradient(
4
+ }`),y.code.add(p`vec3 computeProjectivePixelGradient(
5
5
  vec3 clipGradient,
6
6
  vec3 clipWGradient,
7
7
  float clipValue,
@@ -10,13 +10,13 @@ float invWSquared,
10
10
  float halfScreenSize
11
11
  ) {
12
12
  return (clipGradient * safeW - clipValue * clipWGradient) * invWSquared * halfScreenSize;
13
- }`),y.code.add(m`vec3 multiplyCovariance3D(float[6] covariance3D, vec3 value) {
13
+ }`),y.code.add(p`vec3 multiplyCovariance3D(float[6] covariance3D, vec3 value) {
14
14
  return vec3(
15
15
  covariance3D[0] * value.x + covariance3D[1] * value.y + covariance3D[2] * value.z,
16
16
  covariance3D[1] * value.x + covariance3D[3] * value.y + covariance3D[4] * value.z,
17
17
  covariance3D[2] * value.x + covariance3D[4] * value.y + covariance3D[5] * value.z
18
18
  );
19
- }`),y.code.add(m`vec3 computeProjectiveCovariance2D(vec3 pixelXGradient, vec3 pixelYGradient, float[6] covariance3D, mat4 view) {
19
+ }`),y.code.add(p`vec3 computeProjectiveCovariance2D(vec3 pixelXGradient, vec3 pixelYGradient, float[6] covariance3D, mat4 view) {
20
20
  mat3 worldToView = transpose(mat3(view));
21
21
  vec3 axisX = worldToView * pixelXGradient;
22
22
  vec3 axisY = worldToView * pixelYGradient;
@@ -27,15 +27,15 @@ float covarianceXX = dot(axisX, covarianceAxisX) + regularization;
27
27
  float covarianceXY = dot(axisX, covarianceAxisY);
28
28
  float covarianceYY = dot(axisY, covarianceAxisY) + regularization;
29
29
  return vec3(covarianceXX, covarianceXY, covarianceYY);
30
- }`),y.code.add(m`float biasDepth(float linearDepth) {
30
+ }`),y.code.add(p`float biasDepth(float linearDepth) {
31
31
  const float bias = 80.0 * .000015259;
32
32
  return min(linearDepth + bias, 1.0);
33
- }`);const G=.25,D=Math.log(G);return y.main.add(`\n uint gaussianIndex = fetchOrderedGaussianIndex(uint(gl_InstanceID));\n uvec4 packedGaussian = fetchPackedGaussian(gaussianIndex);\n\n float opacity = unpackOpacity(packedGaussian);\n\n gl_Position = ${r};\n\n if (opacity < ${G}) {\n return;\n }\n\n vec3 cameraRelativePosition = fetchGaussianCameraRelativePosition(gaussianIndex, packedGaussian);\n\n ${f(i,m`if (cameraRelativePosition.x < clipMin.x || cameraRelativePosition.y < clipMin.y || cameraRelativePosition.z < clipMin.z ||
33
+ }`);const G=.25,D=Math.log(G);return y.main.add(`\n uint gaussianIndex = fetchOrderedGaussianIndex(uint(gl_InstanceID));\n uvec4 packedGaussian = fetchPackedGaussian(gaussianIndex);\n\n float opacity = unpackOpacity(packedGaussian);\n\n gl_Position = ${n};\n\n if (opacity < ${G}) {\n return;\n }\n\n vec3 cameraRelativePosition = fetchGaussianCameraRelativePosition(gaussianIndex, packedGaussian);\n\n ${u(g,p`if (cameraRelativePosition.x < clipMin.x || cameraRelativePosition.y < clipMin.y || cameraRelativePosition.z < clipMin.z ||
34
34
  cameraRelativePosition.x > clipMax.x || cameraRelativePosition.y > clipMax.y || cameraRelativePosition.z > clipMax.z) {
35
35
  return;
36
- }`)}\n\n ${f(t,m`if (rejectBySlice(cameraRelativePosition)) {
36
+ }`)}\n\n ${u(h,p`if (rejectBySlice(cameraRelativePosition)) {
37
37
  return;
38
- }`)}\n\n vec4 viewPos = vec4(mat3(view) * cameraRelativePosition, 1.0);\n\n if (viewPos.z > -nearFar.x || viewPos.z < -nearFar.y) {\n return;\n }\n\n vec3 covarianceA;\n vec3 covarianceB;\n computePackedGaussianCovariance3D(packedGaussian, covarianceA, covarianceB);\n\n float covariance3D[6] = float[6](covarianceA.x, covarianceA.y, covarianceA.z, covarianceB.x, covarianceB.y, covarianceB.z);\n\n vec4 projPos = proj * viewPos;\n float safeW = safeClipW(projPos.w);\n float invWSquared = 1.0 / (safeW * safeW);\n vec2 halfScreenSize = 0.5 / inverseScreenSize;\n float maxShadowSplatRadius = max(halfScreenSize.x, halfScreenSize.y);\n\n // Projection matrix columns are the clip-space derivatives with respect to view-space xyz.\n vec3 clipWGradient = vec3(proj[0][3], proj[1][3], proj[2][3]);\n vec3 pixelXGradient = computeProjectivePixelGradient(\n vec3(proj[0][0], proj[1][0], proj[2][0]),\n clipWGradient,\n projPos.x,\n safeW,\n invWSquared,\n halfScreenSize.x\n );\n vec3 pixelYGradient = computeProjectivePixelGradient(\n vec3(proj[0][1], proj[1][1], proj[2][1]),\n clipWGradient,\n projPos.y,\n safeW,\n invWSquared,\n halfScreenSize.y\n );\n vec3 covariance2D = computeProjectiveCovariance2D(pixelXGradient, pixelYGradient, covariance3D, view);\n\n float determinant = computeGaussianCovarianceDeterminant(covariance2D);\n if (determinant <= 0.0) {\n return;\n }\n\n vec2 eigenvalues = computeGaussianCovarianceEigenvalues(covariance2D);\n\n gaussianLogAlphaCutoff = ${D} - log(opacity);\n float gaussianEllipseThreshold = computeGaussianEllipseThreshold(gaussianLogAlphaCutoff);\n vec2 axisLengths = computeGaussianAxisLengths(eigenvalues, gaussianEllipseThreshold);\n float maxRadius = max(axisLengths.x, axisLengths.y);\n\n // Avoid invalid/extremely large footprints.\n if (maxRadius < 0.0 || maxRadius > maxShadowSplatRadius) {\n return;\n }\n\n if (rejectGaussianByMinimumRadius(maxRadius, opacity, minSplatRadius)) {\n return;\n }\n\n vec3 ndcPos = projPos.xyz / safeW;\n vec2 clipSpacePixelScale = 2.0 * inverseScreenSize;\n\n if (rejectGaussianByScreenBounds(ndcPos.xy, maxRadius, clipSpacePixelScale)) {\n return;\n }\n\n offsetFromCenter = computeGaussianQuadOffset(covariance2D, eigenvalues, axisLengths, gl_VertexID);\n conic = computeGaussianConic(covariance2D, determinant);\n float linearDepth = (-viewPos.z - nearFar.x) / (nearFar.y - nearFar.x);\n float biasedDepth = biasDepth(linearDepth);\n\n vec2 clipPos = ndcPos.xy + offsetFromCenter * clipSpacePixelScale - inverseScreenSize;\n gl_Position = vec4(clipPos, biasedDepth * 2.0 - 1.0, 1.0);\n `),S.include(c),S.main.add(m`float gaussianExponent = evaluateGaussianExponent(conic, offsetFromCenter);
38
+ }`)}\n\n vec4 viewPos = vec4(mat3(view) * cameraRelativePosition, 1.0);\n\n if (viewPos.z > -nearFar.x || viewPos.z < -nearFar.y) {\n return;\n }\n\n vec3 covarianceA;\n vec3 covarianceB;\n computePackedGaussianCovariance3D(packedGaussian, covarianceA, covarianceB);\n\n float covariance3D[6] = float[6](covarianceA.x, covarianceA.y, covarianceA.z, covarianceB.x, covarianceB.y, covarianceB.z);\n\n vec4 projPos = proj * viewPos;\n float safeW = safeClipW(projPos.w);\n float invWSquared = 1.0 / (safeW * safeW);\n vec2 halfScreenSize = 0.5 / inverseScreenSize;\n float maxShadowSplatRadius = max(halfScreenSize.x, halfScreenSize.y);\n\n // Projection matrix columns are the clip-space derivatives with respect to view-space xyz.\n vec3 clipWGradient = vec3(proj[0][3], proj[1][3], proj[2][3]);\n vec3 pixelXGradient = computeProjectivePixelGradient(\n vec3(proj[0][0], proj[1][0], proj[2][0]),\n clipWGradient,\n projPos.x,\n safeW,\n invWSquared,\n halfScreenSize.x\n );\n vec3 pixelYGradient = computeProjectivePixelGradient(\n vec3(proj[0][1], proj[1][1], proj[2][1]),\n clipWGradient,\n projPos.y,\n safeW,\n invWSquared,\n halfScreenSize.y\n );\n vec3 covariance2D = computeProjectiveCovariance2D(pixelXGradient, pixelYGradient, covariance3D, view);\n\n float determinant = computeGaussianCovarianceDeterminant(covariance2D);\n if (determinant <= 0.0) {\n return;\n }\n\n vec2 eigenvalues = computeGaussianCovarianceEigenvalues(covariance2D);\n\n gaussianLogAlphaCutoff = ${D} - log(opacity);\n float gaussianEllipseThreshold = computeGaussianEllipseThreshold(gaussianLogAlphaCutoff);\n vec2 axisLengths = computeGaussianAxisLengths(eigenvalues, gaussianEllipseThreshold);\n float maxRadius = max(axisLengths.x, axisLengths.y);\n\n // Avoid invalid/extremely large footprints.\n if (maxRadius < 0.0 || maxRadius > maxShadowSplatRadius) {\n return;\n }\n\n if (rejectGaussianByMinimumRadius(maxRadius, opacity, minSplatRadius)) {\n return;\n }\n\n vec3 ndcPos = projPos.xyz / safeW;\n vec2 clipSpacePixelScale = 2.0 * inverseScreenSize;\n\n if (rejectGaussianByScreenBounds(ndcPos.xy, maxRadius, clipSpacePixelScale)) {\n return;\n }\n\n offsetFromCenter = computeGaussianQuadOffset(covariance2D, eigenvalues, axisLengths, gl_VertexID);\n conic = computeGaussianConic(covariance2D, determinant);\n float linearDepth = (-viewPos.z - nearFar.x) / (nearFar.y - nearFar.x);\n float biasedDepth = biasDepth(linearDepth);\n\n vec2 clipPos = ndcPos.xy + offsetFromCenter * clipSpacePixelScale - inverseScreenSize;\n gl_Position = vec4(clipPos, biasedDepth * 2.0 - 1.0, 1.0);\n `),P.include(o),P.main.add(p`float gaussianExponent = evaluateGaussianExponent(conic, offsetFromCenter);
39
39
  if (gaussianExponent > 0.0 || gaussianExponent < gaussianLogAlphaCutoff) {
40
40
  discard;
41
- }`),w}const P=a(),j=Object.freeze(Object.defineProperty({__proto__:null,GaussianSplatShadowPassParameters:w,build:S},Symbol.toStringTag,{value:"Module"}));export{w as G,j as a,S as b};
41
+ }`),S}const w=a(),h=Object.freeze(Object.defineProperty({__proto__:null,build:g},Symbol.toStringTag,{value:"Module"}));export{h as G,g as b};