@arcgis/core 5.1.0-next.79 → 5.1.0-next.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{ae6b3dfe5f757df539d6.js → 0219edb509e01270d42d.js} +1 -1
- package/assets/esri/core/workers/chunks/{7cea68257d24ffd205bb.js → 035dbb0217f83108fa89.js} +1 -1
- package/assets/esri/core/workers/chunks/{fb100935fd8948d779f5.js → 22bdea4ca52970c29504.js} +1 -1
- package/assets/esri/core/workers/chunks/{3e37019eee1c49d2bf64.js → 3f242f8d092f601c3abf.js} +1 -1
- package/assets/esri/core/workers/chunks/{022067e807905cabeaa1.js → 5417308eba30e668b1ee.js} +1 -1
- package/assets/esri/core/workers/chunks/{052cdc7aaa803b5873f0.js → 63381d81adce0a0d2089.js} +1 -1
- package/assets/esri/core/workers/chunks/{a54aa93b6012a2597f82.js → 6d2abdb48e17b2b56599.js} +1 -1
- package/assets/esri/core/workers/chunks/{5ccc325d83cec4f5ccdb.js → 6dbddf5ab1867ac2ac80.js} +1 -1
- package/assets/esri/core/workers/chunks/{ffc4f3406ce383b9bd88.js → 72691fe14024e35f85d0.js} +1 -1
- package/assets/esri/core/workers/chunks/936f2b1332ece14d7c28.js +2 -0
- package/assets/esri/core/workers/chunks/{c442916805975744dd92.js → 96b13b6042cdf5833d39.js} +1 -1
- package/assets/esri/core/workers/chunks/99c189e1de2b1f14799b.js +1 -0
- package/assets/esri/core/workers/chunks/{0ae360bf253adee46737.js → 9aa6b32cb65fbaa93218.js} +1 -1
- package/assets/esri/core/workers/chunks/c3c19b62d948d53118a8.js +1 -0
- package/assets/esri/core/workers/chunks/{0aebcbf41cb193e76809.js → d5fd99ee40bba9b48a54.js} +334 -307
- package/assets/esri/core/workers/chunks/{8508f238d99021e87f71.js → d7324a00ed576e7a37b1.js} +1 -1
- package/assets/esri/core/workers/chunks/dcbc4072c18278c2b67d.js +1 -0
- package/assets/esri/core/workers/chunks/ff713926985a284f5d81.js +2 -0
- package/chunks/GlobalIllumination.glsl.js +213 -186
- package/chunks/GlobalIlluminationBlur.glsl.js +78 -78
- package/config.js +1 -1
- package/form/elements/inputs/MultipleChoiceInput.d.ts +3 -3
- package/form/elements/inputs/MultipleChoiceInput.js +1 -1
- package/geometry/SpatialReference.js +1 -1
- package/interfaces.d.ts +1 -1
- package/kernel.js +1 -1
- package/layers/KnowledgeGraphLayer.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
- package/networks/CircuitManager.d.ts +25 -4
- package/networks/CircuitManager.js +1 -1
- package/networks/support/CircuitExportJobInfo.d.ts +65 -0
- package/networks/support/CircuitExportJobInfo.js +2 -0
- package/networks/support/CircuitVerifyJobInfo.d.ts +65 -0
- package/networks/support/CircuitVerifyJobInfo.js +2 -0
- package/networks/support/NamedTraceConfiguration.d.ts +13 -2
- package/networks/support/NamedTraceConfiguration.js +1 -1
- package/networks/support/TopologyValidationJobInfo.d.ts +2 -13
- package/networks/support/typeUtils.d.ts +14 -0
- package/package.json +2 -2
- package/rest/networks/circuits/exportCircuits.js +1 -1
- package/rest/networks/circuits/support/ExportCircuitsResult.d.ts +10 -0
- package/rest/networks/circuits/support/VerifyCircuitsResult.d.ts +10 -0
- package/rest/networks/circuits/verifyCircuits.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/View.d.ts +2 -2
- package/views/View.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/assets/esri/core/workers/chunks/10408183681fd6c7b4ed.js +0 -2
- package/assets/esri/core/workers/chunks/8b73f4d2f99c0b54cced.js +0 -1
- package/assets/esri/core/workers/chunks/dacc2e5fa462495ed1cc.js +0 -2
- package/assets/esri/core/workers/chunks/e0fe23019410dea8236b.js +0 -1
- package/assets/esri/core/workers/chunks/ffb70e9358c0b171a315.js +0 -1
- /package/assets/esri/core/workers/chunks/{10408183681fd6c7b4ed.js.LICENSE.txt → 936f2b1332ece14d7c28.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{dacc2e5fa462495ed1cc.js.LICENSE.txt → ff713926985a284f5d81.js.LICENSE.txt} +0 -0
|
@@ -1,187 +1,214 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{ReadDepthLastFrame as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
2
|
+
import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{ReadDepthLastFrame as o}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepthLastFrame.glsl.js";import{addMainLightDirection as t}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{ScreenSpaceReflections as r}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceReflections.glsl.js";import{CameraSpace as a}from"../views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js";import{FloatPassUniform as l}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as i,If as n}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Matrix4BindUniform as s}from"../views/3d/webgl-engine/core/shaderModules/Matrix4BindUniform.js";import{Texture2DBindUniform as c}from"../views/3d/webgl-engine/core/shaderModules/Texture2DBindUniform.js";import{Texture2DPassUniform as m}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{ColorAttachment1 as u}from"../views/webgl/enums.js";import{NoParameters as d}from"../views/webgl/NoParameters.js";import{ShaderBuilder as p}from"../views/webgl/ShaderBuilder.js";const h=.01,f=.008,g=.002,v=.5,x=.02,b=.1,w=.008,y=.012,C=.008,F=40,S=.095,D=.008,W=60,j=2,z=.0039,I=.25,B=1/3,G=2/3,M=2,P=.05,T=.15,$=.75;class O extends d{constructor(){super(...arguments),this.projScale=1,this.scaleGlobalIllumination=1,this.accumulatedFrames=0,this.frameCount=0}}function L(d){const O=new p,L=O.fragment;return O.include(e),O.include(a),t(L),L.include(o),O.include(r,{highStepCount:!1,screenSpaceReflections:!0}),L.uniforms.add(new m("normalMap",e=>e.normalTexture),new m("depthMap",e=>e.depthTexture),new m("lastFrameColorTexture",(e,o)=>o.reprojection.lastFrameColor?.getTexture()),new m("lastFrameDepthTexture",(e,o)=>o.reprojection.lastFrameDepth?.attachment),new c("lastFrameGlobalIlluminationTexture",e=>e.globalIllumination?.getTexture()),new c("lastFrameGlobalIlluminationWeightTexture",e=>e.globalIllumination?.getTexture(u)),new s("reprojectionViewMatrix",e=>e.reprojection.viewMatrix),new s("view",e=>e.camera.viewMatrix),new l("accumulatedFramesGI",e=>e.accumulatedFrames),new l("frameCount",e=>e.frameCount),new l("scaleGlobalIllumination",e=>e.scaleGlobalIllumination),new m("blueNoiseTex",e=>e.noiseTexture)),d.hasEmission&&L.uniforms.add(new m("lastFrameEmissionTexture",(e,o)=>o.reprojection.lastFrameEmission?.attachment)),L.constants.add("timeSamplesSize","float",64),L.constants.add("blueNoiseGridSize","float",8),L.code.add(i`
|
|
3
|
+
float computeIdleColorBlendWeight(float accumulatedFrames) {
|
|
4
|
+
float idleColorBlendProgress = clamp(
|
|
5
|
+
accumulatedFrames / ${i.float(F)},
|
|
6
|
+
0.0,
|
|
7
|
+
1.0
|
|
8
|
+
);
|
|
9
|
+
return mix(
|
|
10
|
+
${i.float(y)},
|
|
11
|
+
${i.float(C)},
|
|
12
|
+
idleColorBlendProgress
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
float computeIdleOcclusionBlendWeight(float accumulatedFrames) {
|
|
17
|
+
float idleOcclusionBlendProgress = clamp(
|
|
18
|
+
accumulatedFrames / ${i.float(W)},
|
|
19
|
+
0.0,
|
|
20
|
+
1.0
|
|
21
|
+
);
|
|
22
|
+
return mix(
|
|
23
|
+
${i.float(S)},
|
|
24
|
+
${i.float(D)},
|
|
25
|
+
pow(idleOcclusionBlendProgress, ${i.float(j)})
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Blue noise value based on a texture lookup
|
|
30
|
+
vec4 randomDirection(float index) {
|
|
31
|
+
vec2 textureOffset = vec2(mod(index, blueNoiseGridSize), floor(index / blueNoiseGridSize)) * timeSamplesSize;
|
|
32
|
+
vec2 noiseCoord = textureOffset + mod(
|
|
33
|
+
floor(uv * vec2(textureSize(normalMap, 0)) * scaleGlobalIllumination),
|
|
34
|
+
vec2(timeSamplesSize)
|
|
35
|
+
);
|
|
36
|
+
vec4 blueNoiseValue = texelFetch(blueNoiseTex, ivec2(noiseCoord), 0);
|
|
37
|
+
|
|
38
|
+
return 2.0 * blueNoiseValue - 1.0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
bool isEdgeDepth(float centerDepth, vec2 sampleUv) {
|
|
42
|
+
vec2 texelSize = 1.0 / vec2(textureSize(depthMap, 0));
|
|
43
|
+
float depthLeft = linearizeDepth(depthFromTexture(depthMap, sampleUv + vec2(-texelSize.x, 0.0)));
|
|
44
|
+
float depthRight = linearizeDepth(depthFromTexture(depthMap, sampleUv + vec2(texelSize.x, 0.0)));
|
|
45
|
+
float depthUp = linearizeDepth(depthFromTexture(depthMap, sampleUv + vec2(0.0, texelSize.y)));
|
|
46
|
+
float depthDown = linearizeDepth(depthFromTexture(depthMap, sampleUv + vec2(0.0, -texelSize.y)));
|
|
47
|
+
|
|
48
|
+
float maxDifference = max(max(abs(centerDepth - depthLeft), abs(centerDepth - depthRight)), max(abs(centerDepth - depthUp), abs(centerDepth - depthDown)));
|
|
49
|
+
|
|
50
|
+
return abs(maxDifference / centerDepth) > 0.01;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
vec3 sampleCosineHemisphere(vec2 u) {
|
|
54
|
+
float phi = 6.28318530718 * u.x;
|
|
55
|
+
float radius = sqrt(u.y);
|
|
56
|
+
float x = radius * cos(phi);
|
|
57
|
+
float y = radius * sin(phi);
|
|
58
|
+
float z = sqrt(max(0.0, 1.0 - u.y));
|
|
59
|
+
|
|
60
|
+
return vec3(x, y, z);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
mat3 basisFromNormal(vec3 n) {
|
|
64
|
+
vec3 up = abs(n.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
|
|
65
|
+
vec3 tangent = normalize(cross(up, n));
|
|
66
|
+
vec3 bitangent = cross(n, tangent);
|
|
67
|
+
|
|
68
|
+
return mat3(tangent, bitangent, n);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
float computeChromaWeight(vec3 color) {
|
|
72
|
+
float gray = dot(color, vec3(${i.float(B)}));
|
|
73
|
+
vec3 deviationFromGray = color - gray;
|
|
74
|
+
float chromaDistanceSquared = dot(deviationFromGray, deviationFromGray);
|
|
75
|
+
float normalizedChroma = chromaDistanceSquared / ${i.float(G)};
|
|
76
|
+
|
|
77
|
+
return clamp(normalizedChroma * ${i.float(M)}, 0.0, 1.0);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
float computeColorBleedWeight(vec3 receiverColor, vec3 sourceColor) {
|
|
81
|
+
float receiverChromaWeight = computeChromaWeight(receiverColor);
|
|
82
|
+
float sourceChromaWeight = computeChromaWeight(sourceColor);
|
|
83
|
+
float receiverAverageIntensity = dot(receiverColor, vec3(${i.float(B)}));
|
|
84
|
+
|
|
85
|
+
// Favor bright, neutral receivers lit by more saturated hit surfaces
|
|
86
|
+
float bleedFactor =
|
|
87
|
+
pow(receiverAverageIntensity, ${i.float(P)}) *
|
|
88
|
+
(1.0 - receiverChromaWeight) *
|
|
89
|
+
pow(sourceChromaWeight, ${i.float(T)});
|
|
90
|
+
|
|
91
|
+
return ${i.float($)} * clamp(bleedFactor, 0.0, 1.0);
|
|
92
|
+
}
|
|
93
|
+
`),O.outputs.add("fragGlobalIllumination","vec4",0),O.outputs.add("fragWeight","float",1),L.main.add(i`
|
|
94
|
+
float depth = depthFromTexture(depthMap, uv);
|
|
95
|
+
|
|
96
|
+
// Early out if depth is out of range, such as in the sky
|
|
97
|
+
if (depth >= 1.0 || depth <= 0.0) {
|
|
98
|
+
fragGlobalIllumination = vec4(0.0, 0.0, 0.0, 1.0);
|
|
99
|
+
fragWeight = 0.0;
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Get the normal of current fragment
|
|
104
|
+
ivec2 iuv = ivec2(uv * vec2(textureSize(normalMap, 0)));
|
|
105
|
+
vec4 normal4 = texelFetch(normalMap, iuv, 0);
|
|
106
|
+
if (normal4.a != 1.0) {
|
|
107
|
+
fragGlobalIllumination = vec4(0.0, 0.0, 0.0, 1.0);
|
|
108
|
+
fragWeight = 0.0;
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
vec3 normal = normalize(normal4.xyz * 2.0 - 1.0);
|
|
112
|
+
|
|
113
|
+
// Reconstruct view space position of current fragment
|
|
114
|
+
float currentPixelDepth = linearizeDepth(depth);
|
|
115
|
+
vec3 currentPixelPos = reconstructPosition(uv * vec2(textureSize(normalMap, 0)), currentPixelDepth);
|
|
116
|
+
vec4 viewPos = vec4(currentPixelPos, 1.0);
|
|
117
|
+
|
|
118
|
+
// Reproject current view position to last frame
|
|
119
|
+
vec4 reprojectedViewPos = reprojectionViewMatrix * viewPos;
|
|
120
|
+
vec4 reprojectedCoordinate = applyProjectionMat(proj, reprojectedViewPos.xyz);
|
|
121
|
+
|
|
122
|
+
// Read last frame reprojected depth and GI history
|
|
123
|
+
float lastFrameDepthViewPos = -linearDepthFromTextureLastFrame(lastFrameDepthTexture, reprojectedCoordinate.xy);
|
|
124
|
+
vec4 lastFrameGlobalIllumination = texture(lastFrameGlobalIlluminationTexture, reprojectedCoordinate.xy);
|
|
125
|
+
float historyOcclusionBlendWeight = texture(lastFrameGlobalIlluminationWeightTexture, reprojectedCoordinate.xy).r;
|
|
126
|
+
|
|
127
|
+
int steps;
|
|
128
|
+
float occlusionBlendWeight = 1.0;
|
|
129
|
+
float colorBlendWeight = 1.0;
|
|
130
|
+
float idleColorBlendWeight = computeIdleColorBlendWeight(accumulatedFramesGI);
|
|
131
|
+
float idleOcclusionBlendWeight = computeIdleOcclusionBlendWeight(accumulatedFramesGI);
|
|
132
|
+
float reprojectionDepthMismatch = abs((lastFrameDepthViewPos + reprojectedViewPos.z) / max(lastFrameDepthViewPos, reprojectedViewPos.z));
|
|
133
|
+
bool hasReprojectionMismatch = reprojectionDepthMismatch > ${i.float(h)};
|
|
134
|
+
bool isScaledGlobalIllumination = scaleGlobalIllumination < 1.0;
|
|
135
|
+
bool isLowQualityEdgePixel = isScaledGlobalIllumination && isEdgeDepth(currentPixelDepth, uv);
|
|
136
|
+
bool resetColorHistory = false;
|
|
137
|
+
|
|
138
|
+
// Heuristic to determine blending weights and number of steps for occlusion and color
|
|
139
|
+
if (hasReprojectionMismatch) {
|
|
140
|
+
if (isLowQualityEdgePixel) {
|
|
141
|
+
steps = 1;
|
|
142
|
+
occlusionBlendWeight = ${i.float(f)};
|
|
143
|
+
resetColorHistory = true;
|
|
144
|
+
} else {
|
|
145
|
+
steps = 6;
|
|
146
|
+
occlusionBlendWeight = 1.0;
|
|
147
|
+
resetColorHistory = true;
|
|
148
|
+
}
|
|
149
|
+
} else {
|
|
150
|
+
steps = 1;
|
|
151
|
+
if (historyOcclusionBlendWeight > ${i.float(v)}) {
|
|
152
|
+
occlusionBlendWeight = ${i.float(b)};
|
|
153
|
+
colorBlendWeight = ${i.float(w)};
|
|
154
|
+
} else if (historyOcclusionBlendWeight > ${i.float(x)}) {
|
|
155
|
+
occlusionBlendWeight = historyOcclusionBlendWeight - 0.05;
|
|
156
|
+
colorBlendWeight = ${i.float(w)};
|
|
157
|
+
} else {
|
|
158
|
+
occlusionBlendWeight = isScaledGlobalIllumination ? ${i.float(f)} : idleOcclusionBlendWeight;
|
|
159
|
+
colorBlendWeight = isScaledGlobalIllumination ? ${i.float(g)} : idleColorBlendWeight;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
vec4 randomDirectionSample;
|
|
164
|
+
mat3 normalBasis = basisFromNormal(normal);
|
|
165
|
+
int temporalSampleStride = min(64 / steps, 6);
|
|
166
|
+
float temporalFrameOffset = mod(frameCount, float(64 / steps));
|
|
167
|
+
|
|
168
|
+
// For each ray determine if it hits geometry and accumulate occlusion or color
|
|
169
|
+
float stepSize = 1.0 / float(steps);
|
|
170
|
+
for (int i = 0; i < steps; ++i) {
|
|
171
|
+
float sampleIndex = float(i * temporalSampleStride + int(temporalFrameOffset));
|
|
172
|
+
randomDirectionSample = randomDirection(sampleIndex);
|
|
173
|
+
vec2 hemisphereSample = randomDirectionSample.rg * 0.5 + 0.5;
|
|
174
|
+
float offsetSample = randomDirectionSample.a * 0.5 + 0.5;
|
|
175
|
+
vec3 rayDirection = normalBasis * sampleCosineHemisphere(hemisphereSample);
|
|
176
|
+
vec3 hit = screenSpaceIntersection(rayDirection, viewPos.xyz, normalize(viewPos.xyz), normal, offsetSample, true);
|
|
177
|
+
|
|
178
|
+
if (hit.z > 0.0) {
|
|
179
|
+
// Emission and color bleed - reproject the current receiver and sampled hit to estimate bounced color
|
|
180
|
+
vec3 receiverColor = texture(lastFrameColorTexture, reprojectedCoordinate.xy).rgb;
|
|
181
|
+
|
|
182
|
+
vec2 hitReprojectedCoordinate = reprojectionCoordinate(hit);
|
|
183
|
+
vec3 sourceColor = texture(lastFrameColorTexture, hitReprojectedCoordinate).rgb;
|
|
184
|
+
vec3 sourceEmission = ${n(d.hasEmission,"texture(lastFrameEmissionTexture, hitReprojectedCoordinate).xyz","vec3(0.0)")};
|
|
185
|
+
|
|
186
|
+
float colorBleedWeight = computeColorBleedWeight(receiverColor, sourceColor);
|
|
187
|
+
fragGlobalIllumination.rgb += (sourceColor * colorBleedWeight + sourceEmission) * stepSize;
|
|
188
|
+
} else {
|
|
189
|
+
// Occlusion - heuristic modulating sky intensity based on angle to main light
|
|
190
|
+
vec4 viewMainLightDirection = view * vec4(mainLightDirection, 0.0);
|
|
191
|
+
float skyModulation = pow(max(dot(rayDirection, viewMainLightDirection.xyz), 0.0), 3.0) * 5.5;
|
|
192
|
+
float skyFacingWeight = clamp(3.5 * dot(viewMainLightDirection.xyz, normal), 0.0, 1.0);
|
|
193
|
+
skyModulation = mix(1.0, skyModulation * 0.2 + 0.8, skyFacingWeight);
|
|
194
|
+
fragGlobalIllumination.a += skyModulation * stepSize;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// Rendering trick add noise to reduce accumulation artifacts
|
|
199
|
+
float accumulationDither = occlusionBlendWeight < 1.0
|
|
200
|
+
? randomDirectionSample.b * ${i.float(z)}
|
|
201
|
+
: 0.0;
|
|
202
|
+
|
|
203
|
+
// Accumulate color
|
|
204
|
+
vec3 lastFrameColor = lastFrameGlobalIllumination.rgb;
|
|
205
|
+
float colorDitherScale = isScaledGlobalIllumination ? ${i.float(I)} : 1.0;
|
|
206
|
+
fragGlobalIllumination.rgb = resetColorHistory
|
|
207
|
+
? vec3(0.0)
|
|
208
|
+
: mix(lastFrameColor + accumulationDither * colorDitherScale, fragGlobalIllumination.rgb, colorBlendWeight);
|
|
209
|
+
|
|
210
|
+
// Accumulate occlusion
|
|
211
|
+
fragGlobalIllumination.a = mix(lastFrameGlobalIllumination.a + accumulationDither, fragGlobalIllumination.a, occlusionBlendWeight);
|
|
212
|
+
|
|
213
|
+
fragWeight = occlusionBlendWeight;
|
|
214
|
+
`),O}const R=Object.freeze(Object.defineProperty({__proto__:null,GlobalIlluminationPassParameters:O,build:L},Symbol.toStringTag,{value:"Module"}));export{O as G,R as a,L as b};
|
|
@@ -1,88 +1,88 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
2
|
import{create as e}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{ScreenSpacePass as l}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{ReadDepth as o}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl.js";import{GlobalIlluminationWeights as i}from"../views/3d/webgl-engine/core/shaderLibrary/shading/GlobalIlluminationWeights.glsl.js";import{CameraSpace as t}from"../views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js";import{BooleanBindUniform as a}from"../views/3d/webgl-engine/core/shaderModules/BooleanBindUniform.js";import{Float2DrawUniform as s}from"../views/3d/webgl-engine/core/shaderModules/Float2DrawUniform.js";import{FloatPassUniform as n}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as r}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DDrawUniform as m}from"../views/3d/webgl-engine/core/shaderModules/Texture2DDrawUniform.js";import{Texture2DPassUniform as u}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{NoParameters as c}from"../views/webgl/NoParameters.js";import{ShaderBuilder as p}from"../views/webgl/ShaderBuilder.js";const h=4;class f extends c{constructor(){super(...arguments),this.blurSize=e()}}function d(){const e=new p,c=e.fragment;e.include(l),e.include(t),e.include(i);const f=(h+3)/2,d=1/(2*f*f);c.include(o);const g=5e4;c.uniforms.add(new a("hasEmission",e=>e.hasEmission),new u("depthMap",e=>e.depthTexture),new u("normalMap",e=>e.normalTexture),new m("globalIlluminationTexture",e=>e.texture),new m("globalIlluminationWeightTexture",e=>e.weightTexture),new s("blurSize",e=>e.blurSize),new n("scaleGlobalIllumination",e=>e.scaleGlobalIllumination),new n("projScale",(e,l)=>{const o=l.camera.distance;return o>g?Math.max(0,e.projScale-(o-g)):e.projScale}));const b=.1,S=400,v=.03,w=.08,W=1.5;return c.code.add(r`
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
3
|
+
void accumulateBlurSample(
|
|
4
|
+
vec2 sampleUv,
|
|
5
|
+
float sampleOffset,
|
|
6
|
+
float centerDepth,
|
|
7
|
+
vec3 centerNormal,
|
|
8
|
+
float depthSharpness,
|
|
9
|
+
bool skipOcclusionBlur,
|
|
10
|
+
inout float emissionWeightSum,
|
|
11
|
+
inout vec3 emissionSum,
|
|
12
|
+
inout float occlusionWeightSum,
|
|
13
|
+
inout float occlusionSum,
|
|
14
|
+
float centerOcclusionBlendWeight
|
|
15
|
+
) {
|
|
16
|
+
vec4 sampleGlobalIllumination = texture(globalIlluminationTexture, sampleUv);
|
|
17
|
+
vec3 sampleNormal = texture(normalMap, sampleUv).rgb;
|
|
18
|
+
float sampleDepth = linearDepthFromTexture(depthMap, sampleUv);
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
float depthDelta = sampleDepth - centerDepth;
|
|
21
|
+
bool isScaledGlobalIllumination = scaleGlobalIllumination < 1.0;
|
|
22
|
+
float normalSimilarityWeight = globalIlluminationNormalSimilarityWeight(sampleNormal, centerNormal);
|
|
23
|
+
float depthNormalCorrection = globalIlluminationDepthNormalCorrection(sampleNormal);
|
|
24
|
+
vec3 emission = sampleGlobalIllumination.rgb;
|
|
25
|
+
float emissionSpatialWeightMultiplier = isScaledGlobalIllumination ? ${r.float(S)} : 1.0;
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
float emissionWeight = exp(
|
|
28
|
+
-sampleOffset * sampleOffset * ${r.float(d)} * ${r.float(b)} * emissionSpatialWeightMultiplier
|
|
29
|
+
- depthDelta * depthDelta * depthSharpness * depthNormalCorrection
|
|
30
|
+
);
|
|
31
|
+
emissionWeight *= normalSimilarityWeight;
|
|
32
|
+
emissionWeightSum += emissionWeight;
|
|
33
|
+
emissionSum += emissionWeight * emission;
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
if (skipOcclusionBlur) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
39
|
+
float occlusionSpatialKernelScale = centerOcclusionBlendWeight > ${r.float(v)}
|
|
40
|
+
? ${r.float(w)}
|
|
41
|
+
: ${r.float(W)};
|
|
42
|
+
float occlusionWeight = exp(-sampleOffset * sampleOffset * occlusionSpatialKernelScale - depthDelta * depthDelta * depthSharpness);
|
|
43
|
+
occlusionWeight *= normalSimilarityWeight;
|
|
44
|
+
occlusionWeightSum += occlusionWeight;
|
|
45
|
+
occlusionSum += occlusionWeight * sampleGlobalIllumination.a;
|
|
46
|
+
}
|
|
47
|
+
`),c.main.add(r`
|
|
48
|
+
vec3 emissionSum = vec3(0.0);
|
|
49
|
+
float emissionWeightSum = 0.0;
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
51
|
+
vec4 centerGlobalIllumination = texture(globalIlluminationTexture, uv);
|
|
52
|
+
float centerOcclusionBlendWeight = texture(globalIlluminationWeightTexture, uv).r;
|
|
53
|
+
bool isScaledGlobalIllumination = scaleGlobalIllumination < 1.0;
|
|
54
|
+
bool shouldReuseCenterOcclusion = isScaledGlobalIllumination && centerOcclusionBlendWeight <= ${r.float(v)};
|
|
55
|
+
bool shouldSkipLowQualityBlur = !hasEmission && shouldReuseCenterOcclusion;
|
|
56
|
+
if (shouldSkipLowQualityBlur) {
|
|
57
|
+
fragColor = centerGlobalIllumination;
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
float centerDepth = linearDepthFromTexture(depthMap, uv);
|
|
62
|
+
vec3 centerNormal = texture(normalMap, uv).rgb;
|
|
63
|
+
float occlusionSum = 0.0;
|
|
64
|
+
float occlusionWeightSum = 0.0;
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
66
|
+
float depthSharpness = globalIlluminationDepthSharpness(projScale, centerDepth);
|
|
67
|
+
for (int sampleOffset = -${r.int(h)}; sampleOffset <= ${r.int(h)}; ++sampleOffset) {
|
|
68
|
+
float sampleOffsetFloat = float(sampleOffset);
|
|
69
|
+
vec2 sampleUv = uv + sampleOffsetFloat * blurSize;
|
|
70
|
+
accumulateBlurSample(
|
|
71
|
+
sampleUv,
|
|
72
|
+
sampleOffsetFloat,
|
|
73
|
+
centerDepth,
|
|
74
|
+
centerNormal,
|
|
75
|
+
depthSharpness,
|
|
76
|
+
shouldReuseCenterOcclusion,
|
|
77
|
+
emissionWeightSum,
|
|
78
|
+
emissionSum,
|
|
79
|
+
occlusionWeightSum,
|
|
80
|
+
occlusionSum,
|
|
81
|
+
centerOcclusionBlendWeight
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
vec3 blurredEmission = (emissionSum / emissionWeightSum).rgb;
|
|
86
|
+
float occlusion = shouldReuseCenterOcclusion ? centerGlobalIllumination.a : occlusionSum / occlusionWeightSum;
|
|
87
|
+
fragColor = vec4(blurredEmission, occlusion);
|
|
88
|
+
`),e}const g=Object.freeze(Object.defineProperty({__proto__:null,GlobalIlluminationBlurDrawParameters:f,build:d},Symbol.toStringTag,{value:"Module"}));export{f as G,g as a,d as b};
|
package/config.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.1.0-next.
|
|
2
|
+
import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.1.0-next.80";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
|
|
@@ -6,7 +6,7 @@ import type { OtherChoiceProperties } from "./multipleChoice/OtherChoice.js";
|
|
|
6
6
|
|
|
7
7
|
export interface MultipleChoiceInputProperties extends Partial<Pick<MultipleChoiceInput, "choiceDelimiter" | "includeOtherChoice" | "maxSelectedChoices" | "minSelectedChoices">> {
|
|
8
8
|
/** An array of available choices. */
|
|
9
|
-
choices?: ChoiceProperties[]
|
|
9
|
+
choices?: ChoiceProperties[];
|
|
10
10
|
/** The configuration for the `other` choice when [includeOtherChoice](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/MultipleChoiceInput/#includeOtherChoice) is `true`. */
|
|
11
11
|
otherChoice?: OtherChoiceProperties | null;
|
|
12
12
|
}
|
|
@@ -43,8 +43,8 @@ export default class MultipleChoiceInput extends Input {
|
|
|
43
43
|
*/
|
|
44
44
|
accessor choiceDelimiter: string;
|
|
45
45
|
/** An array of available choices. */
|
|
46
|
-
get choices(): Choice[]
|
|
47
|
-
set choices(value: ChoiceProperties[]
|
|
46
|
+
get choices(): Choice[];
|
|
47
|
+
set choices(value: ChoiceProperties[]);
|
|
48
48
|
/** Indicates whether an additional `other` choice should be displayed. */
|
|
49
49
|
accessor includeOtherChoice: boolean | null | undefined;
|
|
50
50
|
/** The maximum number of choices allowed. */
|