@arcgis/core 5.2.0-next.86 → 5.2.0-next.87

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 (119) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/0993e51d3a9701ed2198.js +1 -0
  3. package/assets/esri/core/workers/chunks/114ba901fd319ce87dc6.js +1 -0
  4. package/assets/esri/core/workers/chunks/{3aeb934ebdab1d8c4608.js → 12a3b55195ce3244259d.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{7c3d46201b11a45f79d0.js → 39c0a3eb6a870953d530.js} +74 -107
  6. package/assets/esri/core/workers/chunks/3b009c05eaec5a7048a8.js +1 -0
  7. package/assets/esri/core/workers/chunks/3b376318df4ff8519370.js +1 -0
  8. package/assets/esri/core/workers/chunks/{a0da026a06de379b8f39.js → 3de20165796fa4f76728.js} +1 -1
  9. package/assets/esri/core/workers/chunks/414093fa4957d17bf551.js +1 -0
  10. package/assets/esri/core/workers/chunks/{4ec306e5c11808b96e07.js → 48b31b8534e7bfe42976.js} +1 -1
  11. package/assets/esri/core/workers/chunks/48f6af09436723f2d861.js +1 -0
  12. package/assets/esri/core/workers/chunks/5536cee0dfc183584a9b.js +1 -0
  13. package/assets/esri/core/workers/chunks/6561c01c67db1f4c546e.js +1 -0
  14. package/assets/esri/core/workers/chunks/68705692335d57522030.js +1 -0
  15. package/assets/esri/core/workers/chunks/{ed5e9718c4dcad1156f7.js → 6f2a9259240769c7cd6e.js} +1 -1
  16. package/assets/esri/core/workers/chunks/7b2174b19d06c16715f0.js +1 -0
  17. package/assets/esri/core/workers/chunks/{b015b8c7a073dbc4a3ad.js → 820c530b8765ecb1f36e.js} +1 -1
  18. package/assets/esri/core/workers/chunks/830daaca32352da6eebe.js +1 -0
  19. package/assets/esri/core/workers/chunks/8c2921081ca3e7fd0385.js +1 -0
  20. package/assets/esri/core/workers/chunks/9407db0584c730591161.js +1 -0
  21. package/assets/esri/core/workers/chunks/9658b46a7111cda53b0d.js +1 -0
  22. package/assets/esri/core/workers/chunks/974bcaf2a059b8cfb153.js +1 -0
  23. package/assets/esri/core/workers/chunks/9c7fc1c97125ea2a7b7e.js +1 -0
  24. package/assets/esri/core/workers/chunks/9ee6e8a6b9bfda758c21.js +1 -0
  25. package/assets/esri/core/workers/chunks/b3c518ca8679fbe16ece.js +1 -0
  26. package/assets/esri/core/workers/chunks/b61b7005edd9ced925e9.js +1 -0
  27. package/assets/esri/core/workers/chunks/c1a7c475ce0c59ffa75a.js +1 -0
  28. package/assets/esri/core/workers/chunks/{3da39efc5f68f15c105f.js → c2b2942456f1b10d0e96.js} +1 -1
  29. package/assets/esri/core/workers/chunks/c5dc2743c7116d0bc0d8.js +1 -0
  30. package/assets/esri/core/workers/chunks/c68cc3b9c170b8de22dc.js +1 -0
  31. package/assets/esri/core/workers/chunks/d56603e1d0031f3c5f3b.js +1 -0
  32. package/assets/esri/core/workers/chunks/e474106292834633e7d4.js +1 -0
  33. package/assets/esri/core/workers/chunks/{d09491b340af3b779505.js → f988d5a6dcc15fe34797.js} +1 -1
  34. package/assets/esri/core/workers/chunks/fbd02e8277fe2252ecd2.js +1 -0
  35. package/assets/esri/themes/base/widgets/_BuildingDisciplinesTree.scss +1 -1
  36. package/assets/esri/themes/base/widgets/_Daylight.scss +2 -2
  37. package/assets/esri/themes/base/widgets/_Editor.scss +1 -1
  38. package/assets/esri/themes/base/widgets/_Sketch.scss +1 -1
  39. package/assets/esri/themes/base/widgets/_SketchTooltipControls.scss +1 -1
  40. package/assets/esri/themes/base/widgets/_Slider.scss +1 -1
  41. package/assets/esri/themes/base/widgets/_SnappingControls.scss +1 -1
  42. package/assets/esri/themes/base/widgets/_TimezonePicker.scss +1 -1
  43. package/chunks/EmissionComposite.glsl.js +2 -2
  44. package/chunks/GlobalIllumination.glsl.js +69 -102
  45. package/chunks/RibbonLine.glsl.js +202 -141
  46. package/config.js +1 -1
  47. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  48. package/geometry/operators/projectOperator.d.ts +1 -1
  49. package/geometry/operators/shapePreservingProjectOperator.d.ts +15 -1
  50. package/geometry/operators/support/GeographicTransformation.d.ts +4 -3
  51. package/geometry/operators/support/GeographicTransformationStep.d.ts +2 -1
  52. package/geometry/operators/support/geographicTransformationUtils.d.ts +22 -15
  53. package/geometry/operators/types.d.ts +2 -1
  54. package/geometry/support/convexPolyhedron.js +2 -0
  55. package/geometry/support/frustum.js +1 -1
  56. package/kernel.js +1 -1
  57. package/layers/LinkChartLayer.js +1 -1
  58. package/layers/support/mediaUtils.js +1 -1
  59. package/package.json +3 -3
  60. package/popup/FeatureContentCollection.js +1 -1
  61. package/support/actions/ActionBase.d.ts +1 -1
  62. package/support/revision.js +1 -1
  63. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  64. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  65. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  66. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  67. package/views/3d/layers/graphics/polygonUtils.js +1 -1
  68. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  69. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  70. package/views/3d/state/utils/navigationUtils.js +1 -1
  71. package/views/3d/state/utils/ropePullUtils.js +2 -0
  72. package/views/3d/support/ElevationAgnosticVisibility.js +2 -0
  73. package/views/3d/support/engineContent/line.js +1 -1
  74. package/views/3d/support/sphericalTileUtils.js +2 -0
  75. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatCovariance.glsl.js +9 -3
  76. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatEvaluation.glsl.js +5 -8
  77. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  78. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  79. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  80. package/views/3d/webgl-engine/lib/Material.js +1 -1
  81. package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
  82. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  83. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  84. package/views/3d/webgl-engine/lib/screenPolygonTriangleIntersections.js +1 -1
  85. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  86. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  87. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  88. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  89. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  90. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  91. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  92. package/views/3d/webgl-engine/shaders/GaussianSplatPass.glsl.js +39 -51
  93. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  94. package/views/popupAdapter.js +1 -1
  95. package/assets/esri/core/workers/chunks/05acc17cb66fa6c08845.js +0 -1
  96. package/assets/esri/core/workers/chunks/11224af8b037ccbf252c.js +0 -1
  97. package/assets/esri/core/workers/chunks/17a10916114754f1f216.js +0 -1
  98. package/assets/esri/core/workers/chunks/1b4e050a3884fc6fa6cf.js +0 -1
  99. package/assets/esri/core/workers/chunks/2f652b330a9978a68e83.js +0 -1
  100. package/assets/esri/core/workers/chunks/33d6ca59eeb88e739c81.js +0 -1
  101. package/assets/esri/core/workers/chunks/3cecf627827f5d9213a9.js +0 -1
  102. package/assets/esri/core/workers/chunks/40ec85b7813a396ee490.js +0 -1
  103. package/assets/esri/core/workers/chunks/5903dceb172897e5675b.js +0 -1
  104. package/assets/esri/core/workers/chunks/5e5a05abcb41915802f6.js +0 -1
  105. package/assets/esri/core/workers/chunks/62f37d1075390a177ae9.js +0 -1
  106. package/assets/esri/core/workers/chunks/73cb944b87ffce33bb49.js +0 -1
  107. package/assets/esri/core/workers/chunks/86de2d1f13915ab7a51d.js +0 -1
  108. package/assets/esri/core/workers/chunks/9b5e890fb0ab29f3a3f1.js +0 -1
  109. package/assets/esri/core/workers/chunks/ad29b77843a7d93d9f8a.js +0 -1
  110. package/assets/esri/core/workers/chunks/b812f817c465c64e8c63.js +0 -1
  111. package/assets/esri/core/workers/chunks/b94b36581842749863f0.js +0 -1
  112. package/assets/esri/core/workers/chunks/bc6e488f5fbd50f9f3d0.js +0 -1
  113. package/assets/esri/core/workers/chunks/c229325f41f10fe7f732.js +0 -1
  114. package/assets/esri/core/workers/chunks/ca6652c6304ad0e37e8f.js +0 -1
  115. package/assets/esri/core/workers/chunks/d4d2a0d882fef463e7bc.js +0 -1
  116. package/assets/esri/core/workers/chunks/da45d9576b8d66131623.js +0 -1
  117. package/assets/esri/core/workers/chunks/e76662562e03eef52ba4.js +0 -1
  118. package/assets/esri/core/workers/chunks/f1d0208c6b09c1c4b248.js +0 -1
  119. package/assets/esri/core/workers/chunks/f3680b71d496839de72c.js +0 -1
@@ -1,83 +1,55 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{ReadDepthLastFrame as a}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepthLastFrame.glsl.js";import{Gamma as t}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl.js";import{addMainLightDirection as r}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{ScreenSpaceRayMarching as i}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js";import{CameraSpace as o}from"../views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js";import{FloatBindUniform as l}from"../views/3d/webgl-engine/core/shaderModules/FloatBindUniform.js";import{FloatPassUniform as n}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as c,If as s}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Matrix4BindUniform as m}from"../views/3d/webgl-engine/core/shaderModules/Matrix4BindUniform.js";import{Texture2DBindUniform as h}from"../views/3d/webgl-engine/core/shaderModules/Texture2DBindUniform.js";import{Texture2DPassUniform as d}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{GlobalIlluminationColorQuantization as u}from"../views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationColorQuantization.glsl.js";import{floatBlendReductionFactor as p}from"../views/3d/webgl-engine/shaders/floatBlendScale.glsl.js";import{ColorAttachment1 as g,SizedPixelFormat as f}from"../views/webgl/enums.js";import{NoParameters as x}from"../views/webgl/NoParameters.js";import{ShaderBuilder as v}from"../views/webgl/ShaderBuilder.js";const y=.01,M=.008,b=.002,w=.5,S=.02,W=.1,F=.008,D=.3,R=.008,B=150,I=.095,j=.008,C=60,z=2,G=.0039,P=.25,T=.012,O=0,$=6,E=.15,L=25,V=.15,U=.5,H=1,N=1,k=16;class Q extends x{constructor(){super(...arguments),this.projScale=1,this.scaleGlobalIllumination=1,this.accumulatedFrames=0,this.temporalSampleFrame=0,this.rayMarchMinReach=V,this.rayMarchMaxReach=U,this.rayMarchWorldReach=L,this.rayMarchMinReachEmissionWeight=H,this.rayMarchMaxReachEmissionWeight=N,this.rayMarchMaxSteps=k,this.colorBleedWeight=E,this.highQualityIdleColorBlendStart=D}}function _(x){const D=new v,E=D.fragment;D.include(e),D.include(o),r(E),E.include(a),E.include(t),E.include(u),D.include(i,x),E.uniforms.add(new d("normalMap",e=>e.normalTexture),new d("depthMap",e=>e.depthTexture),new h("lastFrameColorTexture",e=>e.reprojection.lastFrameColor?.getTexture()),new h("lastFrameDepthTexture",e=>e.reprojection.lastFrameDepth?.attachment),new h("lastFrameGlobalIlluminationTexture",e=>e.globalIllumination?.getTexture()),new h("lastFrameGlobalIlluminationWeightTexture",e=>e.globalIllumination?.getTexture(g)),new m("reprojectionViewMatrix",e=>e.reprojection.viewMatrix),new m("view",e=>e.camera.viewMatrix),new n("accumulatedFrames",e=>e.accumulatedFrames),new n("temporalSampleFrame",e=>e.temporalSampleFrame),new n("scaleGlobalIllumination",e=>e.scaleGlobalIllumination)),E.uniforms.add(new n("rayMarchMinReach",e=>e.rayMarchMinReach),new n("rayMarchMaxReach",e=>e.rayMarchMaxReach),new n("rayMarchWorldReach",e=>e.rayMarchWorldReach),new n("rayMarchMinReachEmissionWeight",e=>e.rayMarchMinReachEmissionWeight),new n("rayMarchMaxReachEmissionWeight",e=>e.rayMarchMaxReachEmissionWeight),new n("rayMarchMaxSteps",e=>e.rayMarchMaxSteps),new n("colorBleedWeight",e=>e.colorBleedWeight),new n("highQualityIdleColorBlendStart",e=>e.highQualityIdleColorBlendStart));const{hasEmission:L,hasColor:V}=x;return L&&E.uniforms.add(new l("inputScale",e=>e.reprojection.lastFrameEmission?.attachment.descriptor.internalFormat===f.RGBA8?p:1),new h("lastFrameEmissionTexture",e=>e.reprojection.lastFrameEmission?.attachment)),E.code.add(c`
3
- float computeIdleColorBlendWeight(float accumulatedFrames) {
4
- float idleColorBlendProgress = clamp(
5
- accumulatedFrames / ${c.float(B)},
6
- 0.0,
7
- 1.0
8
- );
9
- return mix(
10
- highQualityIdleColorBlendStart,
11
- ${c.float(R)},
12
- pow(idleColorBlendProgress, 1./5.)
13
- );
14
- }
15
-
16
- float computeIdleOcclusionBlendWeight(float accumulatedFrames) {
17
- float idleOcclusionBlendProgress = clamp(
18
- accumulatedFrames / ${c.float(C)},
19
- 0.0,
20
- 1.0
21
- );
22
- return mix(
23
- ${c.float(I)},
24
- ${c.float(j)},
25
- pow(idleOcclusionBlendProgress, ${c.float(z)})
26
- );
27
- }
28
-
29
- bool isEdgeDepth(float centerDepth, vec2 sampleUv) {
30
- vec2 texelSize = 1.0 / vec2(textureSize(depthMap, 0));
31
- float depthLeft = linearizeDepth(depthFromTexture(depthMap, sampleUv + vec2(-texelSize.x, 0.0)));
32
- float depthRight = linearizeDepth(depthFromTexture(depthMap, sampleUv + vec2(texelSize.x, 0.0)));
33
- float depthUp = linearizeDepth(depthFromTexture(depthMap, sampleUv + vec2(0.0, texelSize.y)));
34
- float depthDown = linearizeDepth(depthFromTexture(depthMap, sampleUv + vec2(0.0, -texelSize.y)));
35
-
36
- float maxDifference = max(max(abs(centerDepth - depthLeft), abs(centerDepth - depthRight)), max(abs(centerDepth - depthUp), abs(centerDepth - depthDown)));
37
-
38
- return abs(maxDifference / centerDepth) > 0.01;
39
- }
40
-
41
- vec3 sampleCosineHemisphere(vec2 u) {
42
- float phi = 6.28318530718 * u.x;
43
- float radius = sqrt(u.y);
44
- float x = radius * cos(phi);
45
- float y = radius * sin(phi);
46
- float z = sqrt(max(0.0, 1.0 - u.y));
47
-
48
- return vec3(x, y, z);
49
- }
50
-
51
- mat3 basisFromNormal(vec3 n) {
52
- vec3 up = abs(n.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
53
- vec3 tangent = normalize(cross(up, n));
54
- vec3 bitangent = cross(n, tangent);
55
-
56
- return mat3(tangent, bitangent, n);
57
- }
58
-
59
- float blueNoiseDitherValue(vec2 pixel, float frame, vec2 axis, float phase) {
60
- float scroll = 5.588238 * mod(frame, 512.0);
61
- vec2 p = pixel + vec2(scroll);
62
- vec2 rotated = vec2(
63
- axis.x * p.x + axis.y * p.y,
64
- -axis.y * p.x + axis.x * p.y
65
- );
66
-
67
- return fract(52.9829189 * fract(0.06711056 * rotated.x + 0.00583715 * rotated.y + phase));
68
- }
69
-
70
- vec4 blueNoiseDither(vec2 pixel, float frame) {
71
- vec4 value = vec4(
72
- blueNoiseDitherValue(pixel, frame, vec2(0.9659258, 0.25881904), 0.0),
73
- blueNoiseDitherValue(pixel, frame, vec2(0.70710677, 0.70710677), 0.17),
74
- blueNoiseDitherValue(pixel, frame, vec2(0.25881904, 0.9659258), 0.37),
75
- blueNoiseDitherValue(pixel, frame, vec2(1.0, 0.0), 0.61)
76
- );
77
-
78
- return value * 2.0 - 1.0;
79
- }
80
- `),D.outputs.add("fragGlobalIllumination","vec4",0),D.outputs.add("fragWeight","vec2",1),E.main.add(c`
2
+ import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{ReadDepthLastFrame as a}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepthLastFrame.glsl.js";import{Gamma as t}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl.js";import{addMainLightDirection as l}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{ScreenSpaceRayMarching as o}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js";import{CameraSpace as i}from"../views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js";import{FloatBindUniform as r}from"../views/3d/webgl-engine/core/shaderModules/FloatBindUniform.js";import{FloatPassUniform as n}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as c,If as s}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Matrix4BindUniform as h}from"../views/3d/webgl-engine/core/shaderModules/Matrix4BindUniform.js";import{Texture2DBindUniform as d}from"../views/3d/webgl-engine/core/shaderModules/Texture2DBindUniform.js";import{Texture2DPassUniform as m}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{GlobalIlluminationColorQuantization as u}from"../views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationColorQuantization.glsl.js";import{floatBlendReductionFactor as p}from"../views/3d/webgl-engine/shaders/floatBlendScale.glsl.js";import{ColorAttachment1 as g,SizedPixelFormat as f}from"../views/webgl/enums.js";import{NoParameters as y}from"../views/webgl/NoParameters.js";import{ShaderBuilder as x}from"../views/webgl/ShaderBuilder.js";const v=.01,M=.008,b=.002,w=.5,B=.02,S=.1,W=.008,I=.3,F=.008,D=150,C=.095,R=.008,j=60,O=2,z=.0039,G=.25,T=.012,P=0,E=6,Q=.15,L=25,H=.15,V=.5,k=1,U=1,N=16;class _ extends y{constructor(){super(...arguments),this.projScale=1,this.scaleGlobalIllumination=1,this.accumulatedFrames=0,this.temporalSampleFrame=0,this.rayMarchMinReach=H,this.rayMarchMaxReach=V,this.rayMarchWorldReach=L,this.rayMarchMinReachEmissionWeight=k,this.rayMarchMaxReachEmissionWeight=U,this.rayMarchMaxSteps=N,this.colorBleedWeight=Q,this.highQualityIdleColorBlendStart=I}}function q(y){const I=new x,Q=I.fragment;I.include(e),I.include(i),l(Q),Q.include(a),Q.include(t),Q.include(u),I.include(o,y),Q.uniforms.add(new m("normalMap",e=>e.normalTexture),new m("depthMap",e=>e.depthTexture),new d("lastFrameColorTexture",e=>e.reprojection.lastFrameColor?.getTexture()),new d("lastFrameDepthTexture",e=>e.reprojection.lastFrameDepth?.attachment),new d("lastFrameGlobalIlluminationTexture",e=>e.globalIllumination?.getTexture()),new d("lastFrameGlobalIlluminationWeightTexture",e=>e.globalIllumination?.getTexture(g)),new h("reprojectionViewMatrix",e=>e.reprojection.viewMatrix),new h("view",e=>e.camera.viewMatrix),new n("accumulatedFrames",e=>e.accumulatedFrames),new n("temporalSampleFrame",e=>e.temporalSampleFrame),new n("scaleGlobalIllumination",e=>e.scaleGlobalIllumination)),Q.uniforms.add(new n("rayMarchMinReach",e=>e.rayMarchMinReach),new n("rayMarchMaxReach",e=>e.rayMarchMaxReach),new n("rayMarchWorldReach",e=>e.rayMarchWorldReach),new n("rayMarchMinReachEmissionWeight",e=>e.rayMarchMinReachEmissionWeight),new n("rayMarchMaxReachEmissionWeight",e=>e.rayMarchMaxReachEmissionWeight),new n("rayMarchMaxSteps",e=>e.rayMarchMaxSteps),new n("colorBleedWeight",e=>e.colorBleedWeight),new n("highQualityIdleColorBlendStart",e=>e.highQualityIdleColorBlendStart));const{hasEmission:L,hasColor:H}=y;return L&&Q.uniforms.add(new r("inputScale",e=>e.reprojection.lastFrameEmission?.attachment.descriptor.internalFormat===f.RGBA8?p:1),new d("lastFrameEmissionTexture",e=>e.reprojection.lastFrameEmission?.attachment)),Q.constants.add("highQualityIdleColorBlendEnd","float",F),Q.constants.add("highQualityIdleColorBlendFrames","float",D),Q.constants.add("highQualityIdleOcclusionBlendEnd","float",R),Q.constants.add("highQualityIdleOcclusionBlendExponent","float",O),Q.constants.add("highQualityIdleOcclusionBlendFrames","float",j),Q.constants.add("highQualityIdleOcclusionBlendStart","float",C),Q.constants.add("fullColorBleedBlendWeight","float",T),Q.constants.add("initialColorBleedScale","float",P),Q.constants.add("accumulationDitherScale","float",z),Q.constants.add("lowQualityColorBlendWeight","float",b),Q.constants.add("lowQualityColorDitherScale","float",G),Q.constants.add("lowQualityOcclusionBlendWeight","float",M),Q.constants.add("reprojectionMismatchThreshold","float",v),Q.constants.add("stableHistoryColorBlendWeight","float",W),Q.constants.add("strongHistoryOcclusionThreshold","float",B),Q.constants.add("weakHistoryOcclusionBlendWeight","float",S),Q.constants.add("weakHistoryOcclusionThreshold","float",w),Q.constants.add("storedColorBlendWeightScale","float",E),Q.code.add(c`float computeIdleColorBlendWeight(float accumulatedFrames) {
3
+ float idleColorBlendProgress = clamp(accumulatedFrames / highQualityIdleColorBlendFrames, 0.0, 1.0);
4
+ return mix(highQualityIdleColorBlendStart, highQualityIdleColorBlendEnd, pow(idleColorBlendProgress, 1./5.)
5
+ );
6
+ }
7
+ float computeIdleOcclusionBlendWeight(float accumulatedFrames) {
8
+ float idleOcclusionBlendProgress = clamp(accumulatedFrames / highQualityIdleOcclusionBlendFrames, 0.0, 1.0);
9
+ return mix(highQualityIdleOcclusionBlendStart, highQualityIdleOcclusionBlendEnd,
10
+ pow(idleOcclusionBlendProgress, highQualityIdleOcclusionBlendExponent));
11
+ }
12
+ bool isEdgeDepth(float centerDepth, vec2 sampleUv) {
13
+ vec2 texelSize = 1.0 / vec2(textureSize(depthMap, 0));
14
+ float depthLeft = linearizeDepth(depthFromTexture(depthMap, sampleUv + vec2(-texelSize.x, 0.0)));
15
+ float depthRight = linearizeDepth(depthFromTexture(depthMap, sampleUv + vec2(texelSize.x, 0.0)));
16
+ float depthUp = linearizeDepth(depthFromTexture(depthMap, sampleUv + vec2(0.0, texelSize.y)));
17
+ float depthDown = linearizeDepth(depthFromTexture(depthMap, sampleUv + vec2(0.0, -texelSize.y)));
18
+ float maxDifference = max(max(abs(centerDepth - depthLeft), abs(centerDepth - depthRight)), max(abs(centerDepth - depthUp), abs(centerDepth - depthDown)));
19
+ return abs(maxDifference / centerDepth) > 0.01;
20
+ }
21
+ vec3 sampleCosineHemisphere(vec2 u) {
22
+ float phi = 6.28318530718 * u.x;
23
+ float radius = sqrt(u.y);
24
+ float x = radius * cos(phi);
25
+ float y = radius * sin(phi);
26
+ float z = sqrt(max(0.0, 1.0 - u.y));
27
+ return vec3(x, y, z);
28
+ }
29
+ mat3 basisFromNormal(vec3 n) {
30
+ vec3 up = abs(n.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
31
+ vec3 tangent = normalize(cross(up, n));
32
+ vec3 bitangent = cross(n, tangent);
33
+ return mat3(tangent, bitangent, n);
34
+ }
35
+ float blueNoiseDitherValue(vec2 pixel, float frame, vec2 axis, float phase) {
36
+ float scroll = 5.588238 * mod(frame, 512.0);
37
+ vec2 p = pixel + vec2(scroll);
38
+ vec2 rotated = vec2(
39
+ axis.x * p.x + axis.y * p.y,
40
+ -axis.y * p.x + axis.x * p.y
41
+ );
42
+ return fract(52.9829189 * fract(0.06711056 * rotated.x + 0.00583715 * rotated.y + phase));
43
+ }
44
+ vec4 blueNoiseDither(vec2 pixel, float frame) {
45
+ vec4 value = vec4(
46
+ blueNoiseDitherValue(pixel, frame, vec2(0.9659258, 0.25881904), 0.0),
47
+ blueNoiseDitherValue(pixel, frame, vec2(0.70710677, 0.70710677), 0.17),
48
+ blueNoiseDitherValue(pixel, frame, vec2(0.25881904, 0.9659258), 0.37),
49
+ blueNoiseDitherValue(pixel, frame, vec2(1.0, 0.0), 0.61)
50
+ );
51
+ return value * 2.0 - 1.0;
52
+ }`),I.outputs.add("fragGlobalIllumination","vec4",0),I.outputs.add("fragWeight","vec2",1),Q.main.add(c`
81
53
  float depth = depthFromTexture(depthMap, uv);
82
54
 
83
55
  // Early out if depth is out of range, such as in the sky
@@ -122,7 +94,7 @@ import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/Scr
122
94
  float idleColorBlendWeight = computeIdleColorBlendWeight(accumulatedFrames);
123
95
  float idleOcclusionBlendWeight = computeIdleOcclusionBlendWeight(accumulatedFrames);
124
96
  float reprojectionDepthMismatch = abs((lastFrameDepthViewPos + reprojectedViewPos.z) / max(lastFrameDepthViewPos, reprojectedViewPos.z));
125
- bool hasReprojectionMismatch = reprojectionDepthMismatch > ${c.float(y)};
97
+ bool hasReprojectionMismatch = reprojectionDepthMismatch > reprojectionMismatchThreshold;
126
98
  bool isScaledGlobalIllumination = scaleGlobalIllumination < 1.0;
127
99
  bool isLowQualityEdgePixel = isScaledGlobalIllumination && isEdgeDepth(currentPixelDepth, uv);
128
100
  bool resetColorHistory = false;
@@ -131,7 +103,7 @@ import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/Scr
131
103
  if (hasReprojectionMismatch) {
132
104
  if (isLowQualityEdgePixel) {
133
105
  steps = 1;
134
- occlusionBlendWeight = ${c.float(M)};
106
+ occlusionBlendWeight = lowQualityOcclusionBlendWeight;
135
107
  resetColorHistory = true;
136
108
  } else {
137
109
  steps = 6;
@@ -140,15 +112,15 @@ import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/Scr
140
112
  }
141
113
  } else {
142
114
  steps = 1;
143
- if (historyOcclusionBlendWeight > ${c.float(w)}) {
144
- occlusionBlendWeight = ${c.float(W)};
145
- colorBlendWeight = ${c.float(F)};
146
- } else if (historyOcclusionBlendWeight > ${c.float(S)}) {
115
+ if (historyOcclusionBlendWeight > weakHistoryOcclusionThreshold) {
116
+ occlusionBlendWeight = weakHistoryOcclusionBlendWeight;
117
+ colorBlendWeight = stableHistoryColorBlendWeight;
118
+ } else if (historyOcclusionBlendWeight > strongHistoryOcclusionThreshold) {
147
119
  occlusionBlendWeight = historyOcclusionBlendWeight - 0.05;
148
- colorBlendWeight = ${c.float(F)};
120
+ colorBlendWeight = stableHistoryColorBlendWeight;
149
121
  } else {
150
- occlusionBlendWeight = isScaledGlobalIllumination ? ${c.float(M)} : idleOcclusionBlendWeight;
151
- colorBlendWeight = isScaledGlobalIllumination ? ${c.float(b)} : idleColorBlendWeight;
122
+ occlusionBlendWeight = isScaledGlobalIllumination ? lowQualityOcclusionBlendWeight : idleOcclusionBlendWeight;
123
+ colorBlendWeight = isScaledGlobalIllumination ? lowQualityColorBlendWeight : idleColorBlendWeight;
152
124
  }
153
125
  }
154
126
 
@@ -159,15 +131,10 @@ import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/Scr
159
131
 
160
132
  // For each ray determine if it hits geometry and accumulate occlusion or color
161
133
  float stepSize = 1.0 / float(steps);
162
- ${s(V,c`
134
+ ${s(H,c`
163
135
  float colorBleedScale = mix(
164
- 1.0,
165
- ${c.float(O)},
166
- smoothstep(
167
- ${c.float(T)},
168
- highQualityIdleColorBlendStart,
169
- colorBlendWeight
170
- )
136
+ 1.0, initialColorBleedScale,
137
+ smoothstep(fullColorBleedBlendWeight, highQualityIdleColorBlendStart, colorBlendWeight)
171
138
  );
172
139
  `)}
173
140
  for (int i = 0; i < steps; ++i) {
@@ -197,7 +164,7 @@ import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/Scr
197
164
  // 0.0 alpha excludes the surface as a receiver (e.g. water), but a valid ray hit still occludes as opaque
198
165
  hitOpacity = storedHitOpacity == 0.0 ? 1.0 : storedHitOpacity;
199
166
 
200
- ${s(V,c`
167
+ ${s(H,c`
201
168
  // Emission and color bleed - Reproject the current receiver and sampled hit to estimate bounced color
202
169
  vec3 receiverColor = texture(lastFrameColorTexture, reprojectedCoordinate.xy).rgb;
203
170
 
@@ -232,13 +199,13 @@ import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/Scr
232
199
 
233
200
  // Rendering trick add noise to reduce accumulation artifacts
234
201
  float accumulationDither = occlusionBlendWeight < 1.0
235
- ? receiverOpacity * randomDirectionSample.b * ${c.float(G)}
202
+ ? receiverOpacity * randomDirectionSample.b * accumulationDitherScale
236
203
  : 0.0;
237
204
 
238
- ${s(V,c`
205
+ ${s(H,c`
239
206
  // Accumulate color
240
207
  vec3 lastFrameColor = lastFrameGlobalIllumination.rgb;
241
- float colorDitherScale = isScaledGlobalIllumination ? ${c.float(P)} : 1.0;
208
+ float colorDitherScale = isScaledGlobalIllumination ? lowQualityColorDitherScale : 1.0;
242
209
  fragGlobalIllumination.rgb = resetColorHistory
243
210
  ? vec3(0.0)
244
211
  : mix(lastFrameColor + accumulationDither * colorDitherScale, fragGlobalIllumination.rgb, colorBlendWeight);
@@ -250,5 +217,5 @@ import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/Scr
250
217
  // Accumulate occlusion
251
218
  fragGlobalIllumination.a = mix(lastFrameGlobalIllumination.a + accumulationDither, fragGlobalIllumination.a, occlusionBlendWeight);
252
219
 
253
- fragWeight = vec2(occlusionBlendWeight, colorBlendWeight * ${c.float($)});
254
- `),D}const q=Object.freeze(Object.defineProperty({__proto__:null,GlobalIlluminationPassParameters:Q,build:_,defaultColorBleedWeight:E,defaultRayMarchMaxReach:U,defaultRayMarchMaxReachEmissionWeight:N,defaultRayMarchMaxSteps:k,defaultRayMarchMinReach:V,defaultRayMarchMinReachEmissionWeight:H,defaultRayMarchWorldReach:L},Symbol.toStringTag,{value:"Module"}));export{Q as G,q as a,k as b,_ as c,U as d,E as e,N as f,V as g,H as h,L as i};
220
+ fragWeight = vec2(occlusionBlendWeight, colorBlendWeight * storedColorBlendWeightScale);
221
+ `),I}const $=Object.freeze(Object.defineProperty({__proto__:null,GlobalIlluminationPassParameters:_,build:q,defaultColorBleedWeight:Q,defaultRayMarchMaxReach:V,defaultRayMarchMaxReachEmissionWeight:U,defaultRayMarchMaxSteps:N,defaultRayMarchMinReach:H,defaultRayMarchMinReachEmissionWeight:k,defaultRayMarchWorldReach:L},Symbol.toStringTag,{value:"Module"}));export{_ as G,$ as a,N as b,q as c,V as d,Q as e,U as f,H as g,k as h,L as i};