@arcgis/core 6.0.0-next.32 → 6.0.0-next.34
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/README.md +2 -2
- package/applications/Urban/meshUtils.d.ts +1 -0
- package/applications/Urban/meshUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{f3dc0bc0e00635855a7a.js → 03daf6f235c6edef6268.js} +1 -1
- package/assets/esri/core/workers/chunks/04a1d08c3b5b1dc7628f.js +1 -0
- package/assets/esri/core/workers/chunks/{1eaf8bfdd3765a90ccc2.js → 0523f893870a1546d7d9.js} +1 -1
- package/assets/esri/core/workers/chunks/{72d20d3957d612f86431.js → 0a508e25ec05363e1f04.js} +1 -1
- package/assets/esri/core/workers/chunks/{84038dd85005fea413eb.js → 139e753d95cfc9470e74.js} +1 -1
- package/assets/esri/core/workers/chunks/15950c2fb173b62ee0ec.js +1 -0
- package/assets/esri/core/workers/chunks/{418addce122dbb8897b4.js → 1a614bac5db42c6263f8.js} +1 -1
- package/assets/esri/core/workers/chunks/{58c3ae6030def2ed5f31.js → 1b17f5f720f6cf3f6d73.js} +1 -1
- package/assets/esri/core/workers/chunks/{f9dc38761b314d33890f.js → 1f51567f47c2e2fc8a23.js} +1 -1
- package/assets/esri/core/workers/chunks/2211ff0a1f1ae8100231.js +1 -0
- package/assets/esri/core/workers/chunks/24ada9511b074dc5ae27.js +1 -0
- package/assets/esri/core/workers/chunks/29c610ce1c81ebb84a6b.js +1 -0
- package/assets/esri/core/workers/chunks/2b4dd42920d37b1ff0a9.js +2 -0
- package/assets/esri/core/workers/chunks/2c8ca43563c4f3e94535.js +1 -0
- package/assets/esri/core/workers/chunks/{55a9eaeb152a3abada67.js → 311e4969f19df63451dd.js} +1 -1
- package/assets/esri/core/workers/chunks/{8da2a10318f49d0dc73a.js → 31ef7b7074b3e3829763.js} +1 -1
- package/assets/esri/core/workers/chunks/{360c944c610efa2051fc.js → 379db67f78161ebd5468.js} +2 -2
- package/assets/esri/core/workers/chunks/{b8fd7c3b36981261378b.js → 38df7b1d58c4bcf693d0.js} +1 -1
- package/assets/esri/core/workers/chunks/{be55771758e4bcef0976.js → 3e406043a374ee17475b.js} +1 -1
- package/assets/esri/core/workers/chunks/46c290108a90518ef695.js +1 -0
- package/assets/esri/core/workers/chunks/{a596779eaeec7310671d.js → 478a89317a12e9b4d146.js} +1 -1
- package/assets/esri/core/workers/chunks/{fcc3902d6d9eda6f09f5.js → 48b8b57f559a53c6c513.js} +1 -1
- package/assets/esri/core/workers/chunks/4f3e0d583cfa9d1d6727.js +2 -0
- package/assets/esri/core/workers/chunks/507ecc3692e6d0700958.js +1 -0
- package/assets/esri/core/workers/chunks/{bd46a04a9ee4ea9e6ef1.js → 5864bce1498a13ee5b7e.js} +2 -2
- package/assets/esri/core/workers/chunks/{f4d91d470ca5fea0bd26.js → 5bd1414220e42cb8ebcf.js} +1 -1
- package/assets/esri/core/workers/chunks/5c3aa8386705c5e40358.js +1 -0
- package/assets/esri/core/workers/chunks/{176d75e76318bfc25a53.js → 60c8eedd06080edab3e3.js} +1 -1
- package/assets/esri/core/workers/chunks/661847f1b7044f21600f.js +1 -0
- package/assets/esri/core/workers/chunks/{1a8d8274df292d65f82e.js → 676c8c0329d68f9f3ac4.js} +1 -1
- package/assets/esri/core/workers/chunks/{29cc6b1705418b1be5d7.js → 687deb918eb48a963c8f.js} +1 -1
- package/assets/esri/core/workers/chunks/{0694c7bcfe71692e2ccf.js → 723df53cfa0189837d01.js} +1 -1
- package/assets/esri/core/workers/chunks/7582654a0fc70910731c.js +1 -0
- package/assets/esri/core/workers/chunks/{1ee4df0fd61440cb5f02.js → 7810586c35dfe1437516.js} +1 -1
- package/assets/esri/core/workers/chunks/8517d96fc8ba7b21d845.js +2 -0
- package/assets/esri/core/workers/chunks/90360c0bd053d3e3fd77.js +1 -0
- package/assets/esri/core/workers/chunks/9c3de54513bf8619271c.js +1 -0
- package/assets/esri/core/workers/chunks/{0e445ec3523de9f2dfa2.js → a107f16cd004626b5018.js} +1 -1
- package/assets/esri/core/workers/chunks/{e3b212f8af448ec29eef.js → a1e8209d00809c9520a0.js} +1 -1
- package/assets/esri/core/workers/chunks/{46453ebfee17b5421d9d.js → bf62be00f3040f91aaee.js} +1 -1
- package/assets/esri/core/workers/chunks/{89dc49e784f7ba3b93ea.js → c034c30e577d620b8e28.js} +1 -1
- package/assets/esri/core/workers/chunks/c5bf19da62a3d31009fe.js +2 -0
- package/assets/esri/core/workers/chunks/{2226c20c38e20713bcb5.js.LICENSE.txt → c5bf19da62a3d31009fe.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{6bb191b19ce43a27f205.js → caad4f475d6eb01c2850.js} +1 -1
- package/assets/esri/core/workers/chunks/cd55cad81accf51d2989.js +1 -0
- package/assets/esri/core/workers/chunks/db1f7b2562de495b3401.js +2 -0
- package/assets/esri/core/workers/chunks/e0a37d3bcb9a944e53dd.js +1 -0
- package/assets/esri/core/workers/chunks/{fe6dcb21570395e46ce8.js → e0a7a75709121a26f255.js} +1 -1
- package/assets/esri/core/workers/chunks/{096b2bf1c0d69d27f20c.js → e8e54faf947a582b4cf7.js} +1 -1
- package/assets/esri/core/workers/chunks/{636e9c4ac1f9ae98f9d1.js → ea81f9d71b0842a4be26.js} +1 -1
- package/assets/esri/core/workers/chunks/{164c8eeefa8232b2b191.js → eaa0e906b46ae4c84d72.js} +2 -2
- package/assets/esri/core/workers/chunks/{a504a5e06cb89a620799.js → ec8b7476eac4718eb0ac.js} +1 -1
- package/chunks/GlobalIllumination.glsl.js +55 -46
- package/chunks/GlobalIlluminationBlur.glsl.js +13 -9
- package/chunks/RibbonLine.glsl.js +90 -88
- package/config.js +1 -1
- package/core/has.js +1 -1
- package/core/workers.d.ts +1 -0
- package/geometry/support/MeshLocalVertexSpace.d.ts +3 -3
- package/geometry/support/aaBoundingRect.js +1 -1
- package/geometry/support/meshUtils/convertMeshVertexSpace.js +1 -1
- package/geometry/support/meshUtils/vertexSpaceConversion.js +1 -1
- package/identity/IdentityManagerBase.js +1 -1
- package/kernel.d.ts +3 -3
- package/kernel.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/WFSLayer.d.ts +8 -4
- package/layers/graphics/sources/WFSSource.js +1 -1
- package/layers/graphics/sources/geojson/geojson.js +1 -1
- package/layers/mixins/ArcGISMapService.d.ts +17 -0
- package/layers/mixins/ArcGISMapService.js +1 -1
- package/layers/ogc/wfsUtils.d.ts +7 -2
- package/layers/ogc/wfsUtils.js +1 -1
- package/layers/ogc/xmlUtils.js +1 -1
- package/package.json +4 -4
- package/rest/route.d.ts +1 -1
- package/rest/support/AreasAndLengthsParameters.d.ts +1 -1
- package/rest/support/LengthsParameters.d.ts +1 -1
- package/symbols/TextSymbol.d.ts +0 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/3d/FocusAreasView.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
- package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
- package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/layers/graphics/ElevationAligners.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshObject3DGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWebStyleSymbol.js +1 -1
- package/views/3d/layers/graphics/MeshFastUpdateProcessor.js +1 -1
- package/views/3d/layers/graphics/polygonUtils.js +1 -1
- package/views/3d/state/ScreenSizePerspective.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/support/RenderCoordsHelper.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/ManagedTexture.js +1 -1
- package/views/3d/webgl-engine/lib/NavigationDepthCache.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/RibbonLineVertexInfo.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/webgl/BufferObject.js +1 -1
- package/views/webgl/FramebufferObject.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
- package/widgets/HistogramRangeSlider.d.ts +1 -1
- package/assets/esri/core/workers/chunks/0cc7fba402a93e6d2455.js +0 -2
- package/assets/esri/core/workers/chunks/131185d26343a997495e.js +0 -1
- package/assets/esri/core/workers/chunks/1a3f71c4d97c36050030.js +0 -1
- package/assets/esri/core/workers/chunks/2226c20c38e20713bcb5.js +0 -2
- package/assets/esri/core/workers/chunks/2981e904ab62f3ed80d0.js +0 -2
- package/assets/esri/core/workers/chunks/32cc59e126df8c96a0cf.js +0 -2
- package/assets/esri/core/workers/chunks/5bb6c255bdc8aa9ba23e.js +0 -1
- package/assets/esri/core/workers/chunks/654f5441227579d2b6b4.js +0 -1
- package/assets/esri/core/workers/chunks/7084dd6e10c6c1393e92.js +0 -1
- package/assets/esri/core/workers/chunks/7566321c6a2913f2852b.js +0 -1
- package/assets/esri/core/workers/chunks/7b5cd150a4d0139850be.js +0 -1
- package/assets/esri/core/workers/chunks/7cc9d7a88b64e25fce14.js +0 -1
- package/assets/esri/core/workers/chunks/844eedda8f749972f707.js +0 -2
- package/assets/esri/core/workers/chunks/87177e0f82e8a6ae3189.js +0 -1
- package/assets/esri/core/workers/chunks/9976eaa81085c0d17e14.js +0 -1
- package/assets/esri/core/workers/chunks/a2196a49f89d57a0a1c7.js +0 -1
- package/assets/esri/core/workers/chunks/aba259a70bee68d2edb7.js +0 -1
- package/assets/esri/core/workers/chunks/b9cb92858a576eb6aa06.js +0 -1
- package/assets/esri/core/workers/chunks/c33a9635c294c8774977.js +0 -1
- package/assets/esri/core/workers/chunks/f39c700f3db7db52b522.js +0 -1
- /package/assets/esri/core/workers/chunks/{844eedda8f749972f707.js.LICENSE.txt → 2b4dd42920d37b1ff0a9.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{32cc59e126df8c96a0cf.js.LICENSE.txt → 4f3e0d583cfa9d1d6727.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{bd46a04a9ee4ea9e6ef1.js.LICENSE.txt → 5864bce1498a13ee5b7e.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{0cc7fba402a93e6d2455.js.LICENSE.txt → 8517d96fc8ba7b21d845.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{2981e904ab62f3ed80d0.js.LICENSE.txt → db1f7b2562de495b3401.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{164c8eeefa8232b2b191.js.LICENSE.txt → eaa0e906b46ae4c84d72.js.LICENSE.txt} +0 -0
|
@@ -35,6 +35,28 @@ highQualityIdleOcclusionBlendEnd,
|
|
|
35
35
|
pow(idleOcclusionBlendProgress, highQualityIdleOcclusionBlendExponent)
|
|
36
36
|
);
|
|
37
37
|
}
|
|
38
|
+
vec2 computeAccumulationBlendWeights(
|
|
39
|
+
bool hasReprojectionMismatch,
|
|
40
|
+
float historyOcclusionBlendWeight,
|
|
41
|
+
bool isScaledGlobalIllumination
|
|
42
|
+
) {
|
|
43
|
+
if (hasReprojectionMismatch) {
|
|
44
|
+
return vec2(1.0);
|
|
45
|
+
}
|
|
46
|
+
if (historyOcclusionBlendWeight > weakHistoryOcclusionThreshold) {
|
|
47
|
+
return vec2(weakHistoryOcclusionBlendWeight, stableHistoryColorBlendWeight);
|
|
48
|
+
}
|
|
49
|
+
if (historyOcclusionBlendWeight > strongHistoryOcclusionThreshold) {
|
|
50
|
+
return vec2(historyOcclusionBlendWeight - 0.05, stableHistoryColorBlendWeight);
|
|
51
|
+
}
|
|
52
|
+
return isScaledGlobalIllumination
|
|
53
|
+
? vec2(lowQualityOcclusionBlendWeight, lowQualityColorBlendWeight)
|
|
54
|
+
: vec2(computeIdleOcclusionBlendWeight(accumulatedFrames), computeIdleColorBlendWeight(accumulatedFrames));
|
|
55
|
+
}
|
|
56
|
+
float computeSkyContribution(vec3 rayDirection, vec3 viewMainLightDirection, float skyFacingWeight) {
|
|
57
|
+
float skyModulation = pow(max(dot(rayDirection, viewMainLightDirection), 0.0), 3.0) * 5.5;
|
|
58
|
+
return mix(1.0, skyModulation * (1.0 - factorDaylightDirectional) + factorDaylightDirectional, skyFacingWeight);
|
|
59
|
+
}
|
|
38
60
|
vec3 sampleCosineHemisphere(vec2 u) {
|
|
39
61
|
float phi = 6.28318530718 * u.x;
|
|
40
62
|
float radius = sqrt(u.y);
|
|
@@ -49,21 +71,21 @@ vec3 tangent = normalize(cross(up, n));
|
|
|
49
71
|
vec3 bitangent = cross(n, tangent);
|
|
50
72
|
return mat3(tangent, bitangent, n);
|
|
51
73
|
}
|
|
52
|
-
float blueNoiseDitherValue(vec2 pixel,
|
|
53
|
-
float scroll = 5.588238 * mod(frame, 512.0);
|
|
54
|
-
vec2 p = pixel + vec2(scroll);
|
|
74
|
+
float blueNoiseDitherValue(vec2 pixel, vec2 axis, float phase) {
|
|
55
75
|
vec2 rotated = vec2(
|
|
56
|
-
axis.x *
|
|
57
|
-
-axis.y *
|
|
76
|
+
axis.x * pixel.x + axis.y * pixel.y,
|
|
77
|
+
-axis.y * pixel.x + axis.x * pixel.y
|
|
58
78
|
);
|
|
59
79
|
return fract(52.9829189 * fract(0.06711056 * rotated.x + 0.00583715 * rotated.y + phase));
|
|
60
80
|
}
|
|
61
81
|
vec4 blueNoiseDither(vec2 pixel, float frame) {
|
|
82
|
+
float scroll = 5.588238 * mod(frame, 512.0);
|
|
83
|
+
vec2 translatedPixel = pixel + vec2(scroll);
|
|
62
84
|
vec4 value = vec4(
|
|
63
|
-
blueNoiseDitherValue(
|
|
64
|
-
blueNoiseDitherValue(
|
|
65
|
-
blueNoiseDitherValue(
|
|
66
|
-
blueNoiseDitherValue(
|
|
85
|
+
blueNoiseDitherValue(translatedPixel, vec2(0.9659258, 0.25881904), 0.0),
|
|
86
|
+
blueNoiseDitherValue(translatedPixel, vec2(0.70710677, 0.70710677), 0.17),
|
|
87
|
+
blueNoiseDitherValue(translatedPixel, vec2(0.25881904, 0.9659258), 0.37),
|
|
88
|
+
blueNoiseDitherValue(translatedPixel, vec2(1.0, 0.0), 0.61)
|
|
67
89
|
);
|
|
68
90
|
return value * 2.0 - 1.0;
|
|
69
91
|
}`),C.outputs.add(`fragGlobalIllumination`,`vec4`,0),C.outputs.add(`fragWeight`,`vec2`,1),w.main.add(c`
|
|
@@ -77,7 +99,8 @@ return value * 2.0 - 1.0;
|
|
|
77
99
|
}
|
|
78
100
|
|
|
79
101
|
// Get the normal of current fragment
|
|
80
|
-
ivec2
|
|
102
|
+
ivec2 normalMapSize = textureSize(normalMap, 0);
|
|
103
|
+
ivec2 iuv = ivec2(uv * vec2(normalMapSize));
|
|
81
104
|
|
|
82
105
|
vec4 normalTexel = texelFetch(normalMap, iuv, 0);
|
|
83
106
|
|
|
@@ -94,7 +117,7 @@ return value * 2.0 - 1.0;
|
|
|
94
117
|
|
|
95
118
|
// Reconstruct view space position of current fragment
|
|
96
119
|
float currentPixelDepth = linearizeDepth(depth);
|
|
97
|
-
vec3 currentPixelPos = reconstructPosition(uv * vec2(
|
|
120
|
+
vec3 currentPixelPos = reconstructPosition(uv * vec2(normalMapSize), currentPixelDepth);
|
|
98
121
|
vec4 viewPos = vec4(currentPixelPos, 1.0);
|
|
99
122
|
|
|
100
123
|
// Reproject current view position to last frame
|
|
@@ -106,44 +129,34 @@ return value * 2.0 - 1.0;
|
|
|
106
129
|
vec4 lastFrameGlobalIllumination = texture(lastFrameGlobalIlluminationTexture, reprojectedCoordinate.xy);
|
|
107
130
|
float historyOcclusionBlendWeight = texture(lastFrameGlobalIlluminationWeightTexture, reprojectedCoordinate.xy).r;
|
|
108
131
|
|
|
109
|
-
int steps;
|
|
110
|
-
float occlusionBlendWeight = 1.0;
|
|
111
|
-
float colorBlendWeight = 1.0;
|
|
112
|
-
float idleColorBlendWeight = computeIdleColorBlendWeight(accumulatedFrames);
|
|
113
|
-
float idleOcclusionBlendWeight = computeIdleOcclusionBlendWeight(accumulatedFrames);
|
|
114
132
|
float reprojectionDepthMismatch = abs((lastFrameDepthViewPos + reprojectedViewPos.z) / max(lastFrameDepthViewPos, reprojectedViewPos.z));
|
|
115
133
|
bool hasReprojectionMismatch = reprojectionDepthMismatch > reprojectionMismatchThreshold;
|
|
116
134
|
bool isScaledGlobalIllumination = resolutionScale < 1.0;
|
|
117
135
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
colorBlendWeight = stableHistoryColorBlendWeight;
|
|
127
|
-
} else if (historyOcclusionBlendWeight > strongHistoryOcclusionThreshold) {
|
|
128
|
-
occlusionBlendWeight = historyOcclusionBlendWeight - 0.05;
|
|
129
|
-
colorBlendWeight = stableHistoryColorBlendWeight;
|
|
130
|
-
} else {
|
|
131
|
-
occlusionBlendWeight = isScaledGlobalIllumination ? lowQualityOcclusionBlendWeight : idleOcclusionBlendWeight;
|
|
132
|
-
colorBlendWeight = isScaledGlobalIllumination ? lowQualityColorBlendWeight : idleColorBlendWeight;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
136
|
+
vec2 blendWeights = computeAccumulationBlendWeights(
|
|
137
|
+
hasReprojectionMismatch,
|
|
138
|
+
historyOcclusionBlendWeight,
|
|
139
|
+
isScaledGlobalIllumination
|
|
140
|
+
);
|
|
141
|
+
float occlusionBlendWeight = blendWeights.x;
|
|
142
|
+
float colorBlendWeight = blendWeights.y;
|
|
143
|
+
int rayCount = hasReprojectionMismatch ? 6 : 1;
|
|
135
144
|
|
|
136
145
|
vec4 randomDirectionSample;
|
|
137
146
|
mat3 normalBasis = basisFromNormal(normal);
|
|
138
|
-
int temporalSampleStride = min(64 /
|
|
139
|
-
float temporalFrameOffset = mod(temporalSampleFrame, float(64 /
|
|
147
|
+
int temporalSampleStride = min(64 / rayCount, 6);
|
|
148
|
+
float temporalFrameOffset = mod(temporalSampleFrame, float(64 / rayCount));
|
|
149
|
+
vec2 pixel = floor(gl_FragCoord.xy);
|
|
150
|
+
vec3 viewDirection = normalize(viewPos.xyz);
|
|
151
|
+
vec3 viewMainLightDirection = (view * vec4(mainLightDirection, 0.0)).xyz;
|
|
152
|
+
float skyFacingWeight = clamp(3.5 * dot(viewMainLightDirection, normal), 0.0, 1.0);
|
|
140
153
|
|
|
141
154
|
// For each ray determine if it hits geometry and accumulate occlusion or color
|
|
142
|
-
float
|
|
155
|
+
float inverseRayCount = 1.0 / float(rayCount);
|
|
143
156
|
|
|
144
|
-
for (int i = 0; i <
|
|
157
|
+
for (int i = 0; i < rayCount; ++i) {
|
|
145
158
|
float sampleIndex = float(i * temporalSampleStride + int(temporalFrameOffset));
|
|
146
|
-
randomDirectionSample = blueNoiseDither(
|
|
159
|
+
randomDirectionSample = blueNoiseDither(pixel, sampleIndex);
|
|
147
160
|
vec2 hemisphereSample = randomDirectionSample.rg * 0.5 + 0.5;
|
|
148
161
|
float offsetSample = randomDirectionSample.a * 0.5 + 0.5;
|
|
149
162
|
vec3 rayDirection = normalBasis * sampleCosineHemisphere(hemisphereSample);
|
|
@@ -152,7 +165,7 @@ return value * 2.0 - 1.0;
|
|
|
152
165
|
vec3 hit = screenSpaceIntersectionWithLimits(
|
|
153
166
|
rayDirection,
|
|
154
167
|
viewPos.xyz,
|
|
155
|
-
|
|
168
|
+
viewDirection,
|
|
156
169
|
normal,
|
|
157
170
|
offsetSample,
|
|
158
171
|
rayMarchScreenReach,
|
|
@@ -161,7 +174,6 @@ return value * 2.0 - 1.0;
|
|
|
161
174
|
|
|
162
175
|
float hitOpacity = 0.0;
|
|
163
176
|
if (hit.z > 0.0) {
|
|
164
|
-
ivec2 normalMapSize = textureSize(normalMap, 0);
|
|
165
177
|
ivec2 hitIuv = clamp(ivec2(hit.xy * vec2(normalMapSize)), ivec2(0), normalMapSize - ivec2(1));
|
|
166
178
|
float storedHitOpacity = texelFetch(normalMap, hitIuv, 0).a;
|
|
167
179
|
|
|
@@ -175,17 +187,14 @@ return value * 2.0 - 1.0;
|
|
|
175
187
|
vec3 sourceEmission = rejectReprojectedHitEmission
|
|
176
188
|
? vec3(0.0)
|
|
177
189
|
: texture(lastFrameEmissionTexture, hitReprojectedCoordinate).xyz * inputScale;
|
|
178
|
-
fragGlobalIllumination.rgb += emissionBoostFactor * sourceEmission *
|
|
190
|
+
fragGlobalIllumination.rgb += emissionBoostFactor * sourceEmission * inverseRayCount;
|
|
179
191
|
`)}
|
|
180
192
|
}
|
|
181
193
|
|
|
182
194
|
if (hitOpacity < 1.0) {
|
|
183
195
|
// Occlusion - heuristic modulating sky intensity based on angle to main light
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
float skyFacingWeight = clamp(3.5 * dot(viewMainLightDirection.xyz, normal), 0.0, 1.0);
|
|
187
|
-
skyModulation = mix(1.0, skyModulation * (1.0 - factorDaylightDirectional) + factorDaylightDirectional, skyFacingWeight);
|
|
188
|
-
fragGlobalIllumination.a += (1.0 - hitOpacity) * skyModulation * stepSize;
|
|
196
|
+
float skyModulation = computeSkyContribution(rayDirection, viewMainLightDirection, skyFacingWeight);
|
|
197
|
+
fragGlobalIllumination.a += (1.0 - hitOpacity) * skyModulation * inverseRayCount;
|
|
189
198
|
}
|
|
190
199
|
}
|
|
191
200
|
|
|
@@ -6,23 +6,22 @@ import{create as e}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{Sc
|
|
|
6
6
|
float centerDepth,
|
|
7
7
|
vec3 centerNormal,
|
|
8
8
|
float depthSharpness,
|
|
9
|
+
float emissionSpatialWeightMultiplier,
|
|
9
10
|
bool skipOcclusionBlur,
|
|
10
11
|
inout float emissionWeightSum,
|
|
11
12
|
inout vec3 emissionSum,
|
|
12
13
|
inout float occlusionWeightSum,
|
|
13
14
|
inout float occlusionSum,
|
|
14
|
-
float
|
|
15
|
+
float occlusionSpatialKernelScale
|
|
15
16
|
) {
|
|
16
17
|
vec4 sampleGlobalIllumination = texture(globalIlluminationTexture, sampleUv);
|
|
17
18
|
vec3 sampleNormal = texture(normalMap, sampleUv).rgb;
|
|
18
19
|
float sampleDepth = linearDepthFromTexture(depthMap, sampleUv);
|
|
19
20
|
|
|
20
21
|
float depthDelta = sampleDepth - centerDepth;
|
|
21
|
-
bool isScaledGlobalIllumination = resolutionScale < 1.0;
|
|
22
22
|
float normalSimilarityWeight = globalIlluminationNormalSimilarityWeight(sampleNormal, centerNormal);
|
|
23
23
|
float depthNormalCorrection = globalIlluminationDepthNormalCorrection(sampleNormal);
|
|
24
24
|
vec3 emission = sampleGlobalIllumination.rgb;
|
|
25
|
-
float emissionSpatialWeightMultiplier = isScaledGlobalIllumination ? ${s.float(120)} : 1.0;
|
|
26
25
|
|
|
27
26
|
float emissionWeight = exp(
|
|
28
27
|
-sampleOffset * sampleOffset * ${s.float(.04081632653061224)} * ${s.float(.1)} * emissionSpatialWeightMultiplier
|
|
@@ -36,9 +35,6 @@ import{create as e}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{Sc
|
|
|
36
35
|
return;
|
|
37
36
|
}
|
|
38
37
|
|
|
39
|
-
float occlusionSpatialKernelScale = centerOcclusionBlendWeight > ${s.float(g)}
|
|
40
|
-
? ${s.float(.08)}
|
|
41
|
-
: ${s.float(1.5)};
|
|
42
38
|
float occlusionWeight = exp(-sampleOffset * sampleOffset * occlusionSpatialKernelScale - depthDelta * depthDelta * depthSharpness);
|
|
43
39
|
occlusionWeight *= normalSimilarityWeight;
|
|
44
40
|
occlusionWeightSum += occlusionWeight;
|
|
@@ -49,8 +45,9 @@ import{create as e}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{Sc
|
|
|
49
45
|
float emissionWeightSum = 0.0;
|
|
50
46
|
|
|
51
47
|
vec4 centerGlobalIllumination = texture(globalIlluminationTexture, uv);
|
|
52
|
-
|
|
53
|
-
float
|
|
48
|
+
vec2 centerBlendWeights = texture(globalIlluminationWeightTexture, uv).rg;
|
|
49
|
+
float centerOcclusionBlendWeight = centerBlendWeights.r;
|
|
50
|
+
float centerColorBlendWeight = centerBlendWeights.g;
|
|
54
51
|
bool isScaledGlobalIllumination = resolutionScale < 1.0;
|
|
55
52
|
bool shouldReuseCenterOcclusion = isScaledGlobalIllumination && centerOcclusionBlendWeight <= ${s.float(g)};
|
|
56
53
|
bool shouldSkipLowQualityBlur = !hasEmission && shouldReuseCenterOcclusion;
|
|
@@ -65,6 +62,12 @@ import{create as e}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{Sc
|
|
|
65
62
|
float occlusionWeightSum = 0.0;
|
|
66
63
|
|
|
67
64
|
float depthSharpness = globalIlluminationDepthSharpness(projScale, centerDepth);
|
|
65
|
+
float emissionSpatialWeightMultiplier = isScaledGlobalIllumination
|
|
66
|
+
? ${s.float(120)}
|
|
67
|
+
: 1.0;
|
|
68
|
+
float occlusionSpatialKernelScale = centerOcclusionBlendWeight > ${s.float(g)}
|
|
69
|
+
? ${s.float(.08)}
|
|
70
|
+
: ${s.float(1.5)};
|
|
68
71
|
float lowQualityBlurScale = hasEmission
|
|
69
72
|
? mix(
|
|
70
73
|
1.0,
|
|
@@ -81,12 +84,13 @@ import{create as e}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{Sc
|
|
|
81
84
|
centerDepth,
|
|
82
85
|
centerNormal,
|
|
83
86
|
depthSharpness,
|
|
87
|
+
emissionSpatialWeightMultiplier,
|
|
84
88
|
shouldReuseCenterOcclusion,
|
|
85
89
|
emissionWeightSum,
|
|
86
90
|
emissionSum,
|
|
87
91
|
occlusionWeightSum,
|
|
88
92
|
occlusionSum,
|
|
89
|
-
|
|
93
|
+
occlusionSpatialKernelScale
|
|
90
94
|
);
|
|
91
95
|
}
|
|
92
96
|
|