@shapediver/viewer.rendering-engine.rendering-engine-threejs 3.16.8 → 3.16.9
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/dist/RenderingEngine.d.ts +294 -294
- package/dist/RenderingEngine.js +987 -977
- package/dist/RenderingEngine.js.map +1 -1
- package/dist/index.d.ts +16 -16
- package/dist/index.js +57 -57
- package/dist/injectors/TextureUnifierInjector.d.ts +13 -13
- package/dist/injectors/TextureUnifierInjector.js +181 -171
- package/dist/injectors/TextureUnifierInjector.js.map +1 -1
- package/dist/interfaces/ILoader.d.ts +3 -3
- package/dist/interfaces/ILoader.js +2 -2
- package/dist/interfaces/IRenderingEngine.d.ts +45 -45
- package/dist/interfaces/IRenderingEngine.js +2 -2
- package/dist/loaders/EnvironmentMapLoader.d.ts +119 -119
- package/dist/loaders/EnvironmentMapLoader.js +512 -502
- package/dist/loaders/EnvironmentMapLoader.js.map +1 -1
- package/dist/loaders/GeometryLoader.d.ts +39 -39
- package/dist/loaders/GeometryLoader.d.ts.map +1 -1
- package/dist/loaders/GeometryLoader.js +603 -593
- package/dist/loaders/GeometryLoader.js.map +1 -1
- package/dist/loaders/HTMLElementAnchorLoader.d.ts +15 -15
- package/dist/loaders/HTMLElementAnchorLoader.js +98 -98
- package/dist/loaders/HTMLElementAnchorLoader.js.map +1 -1
- package/dist/loaders/LightLoader.d.ts +19 -19
- package/dist/loaders/LightLoader.js +197 -187
- package/dist/loaders/LightLoader.js.map +1 -1
- package/dist/loaders/MaterialLoader.d.ts +115 -115
- package/dist/loaders/MaterialLoader.d.ts.map +1 -1
- package/dist/loaders/MaterialLoader.js +1612 -1602
- package/dist/loaders/MaterialLoader.js.map +1 -1
- package/dist/managers/ARManager.d.ts +17 -17
- package/dist/managers/ARManager.js +128 -128
- package/dist/managers/ARManager.js.map +1 -1
- package/dist/managers/CameraManager.d.ts +19 -19
- package/dist/managers/CameraManager.js +244 -234
- package/dist/managers/CameraManager.js.map +1 -1
- package/dist/managers/EnvironmentGeometryManager.d.ts +32 -32
- package/dist/managers/EnvironmentGeometryManager.js +114 -114
- package/dist/managers/EnvironmentGeometryManager.js.map +1 -1
- package/dist/managers/FlagManager.d.ts +19 -19
- package/dist/managers/FlagManager.js +143 -143
- package/dist/managers/FlagManager.js.map +1 -1
- package/dist/managers/PostProcessingManager.d.ts +1019 -1019
- package/dist/managers/PostProcessingManager.js +1306 -1296
- package/dist/managers/PostProcessingManager.js.map +1 -1
- package/dist/managers/RenderingManager.d.ts +84 -84
- package/dist/managers/RenderingManager.d.ts.map +1 -1
- package/dist/managers/RenderingManager.js +679 -669
- package/dist/managers/RenderingManager.js.map +1 -1
- package/dist/managers/SceneTracingManager.d.ts +28 -28
- package/dist/managers/SceneTracingManager.js +160 -150
- package/dist/managers/SceneTracingManager.js.map +1 -1
- package/dist/managers/SceneTreeManager.d.ts +81 -81
- package/dist/managers/SceneTreeManager.d.ts.map +1 -1
- package/dist/managers/SceneTreeManager.js +500 -490
- package/dist/managers/SceneTreeManager.js.map +1 -1
- package/dist/managers/SettingsManager.d.ts +28 -28
- package/dist/managers/SettingsManager.js +284 -284
- package/dist/managers/SettingsManager.js.map +1 -1
- package/dist/managers/environmentGeometry/ContactShadow.d.ts +42 -42
- package/dist/managers/environmentGeometry/ContactShadow.js +295 -285
- package/dist/managers/environmentGeometry/ContactShadow.js.map +1 -1
- package/dist/managers/environmentGeometry/Grid.d.ts +20 -20
- package/dist/managers/environmentGeometry/Grid.js +110 -100
- package/dist/managers/environmentGeometry/Grid.js.map +1 -1
- package/dist/managers/environmentGeometry/GroundPlane.d.ts +21 -21
- package/dist/managers/environmentGeometry/GroundPlane.js +105 -95
- package/dist/managers/environmentGeometry/GroundPlane.js.map +1 -1
- package/dist/managers/environmentGeometry/GroundPlaneShadow.d.ts +21 -21
- package/dist/managers/environmentGeometry/GroundPlaneShadow.js +96 -86
- package/dist/managers/environmentGeometry/GroundPlaneShadow.js.map +1 -1
- package/dist/managers/environmentGeometry/IEnvironmentGeometry.d.ts +8 -8
- package/dist/managers/environmentGeometry/IEnvironmentGeometry.js +2 -2
- package/dist/managers/postprocessing/GodRaysManager.d.ts +12 -12
- package/dist/managers/postprocessing/GodRaysManager.js +73 -63
- package/dist/managers/postprocessing/GodRaysManager.js.map +1 -1
- package/dist/managers/postprocessing/OutlineManager.d.ts +15 -15
- package/dist/managers/postprocessing/OutlineManager.js +86 -76
- package/dist/managers/postprocessing/OutlineManager.js.map +1 -1
- package/dist/managers/postprocessing/SSAARenderPass.d.ts +53 -53
- package/dist/managers/postprocessing/SSAARenderPass.js +281 -281
- package/dist/managers/postprocessing/SSAARenderPass.js.map +1 -1
- package/dist/managers/postprocessing/SelectiveBloomManager.d.ts +14 -14
- package/dist/managers/postprocessing/SelectiveBloomManager.js +76 -66
- package/dist/managers/postprocessing/SelectiveBloomManager.js.map +1 -1
- package/dist/managers/postprocessing/ao/ao/AOEffect.d.ts +46 -46
- package/dist/managers/postprocessing/ao/ao/AOEffect.js +142 -142
- package/dist/managers/postprocessing/ao/ao/AOEffect.js.map +1 -1
- package/dist/managers/postprocessing/ao/ao/AOPass.d.ts +12 -12
- package/dist/managers/postprocessing/ao/ao/AOPass.js +108 -108
- package/dist/managers/postprocessing/ao/ao/AOPass.js.map +1 -1
- package/dist/managers/postprocessing/ao/ao/shader/ao_compose.d.ts +1 -1
- package/dist/managers/postprocessing/ao/ao/shader/ao_compose.js +4 -4
- package/dist/managers/postprocessing/ao/ao/shader/ao_utils.d.ts +1 -1
- package/dist/managers/postprocessing/ao/ao/shader/ao_utils.js +4 -4
- package/dist/managers/postprocessing/ao/hbao/HBAOEffect.d.ts +14 -14
- package/dist/managers/postprocessing/ao/hbao/HBAOEffect.js +24 -24
- package/dist/managers/postprocessing/ao/hbao/shader/hbao.d.ts +1 -1
- package/dist/managers/postprocessing/ao/hbao/shader/hbao.js +4 -4
- package/dist/managers/postprocessing/ao/poissionDenoise/PoissionDenoisePass.d.ts +33 -33
- package/dist/managers/postprocessing/ao/poissionDenoise/PoissionDenoisePass.js +211 -211
- package/dist/managers/postprocessing/ao/poissionDenoise/PoissionDenoisePass.js.map +1 -1
- package/dist/managers/postprocessing/ao/poissionDenoise/shader/poissionDenoise.d.ts +1 -1
- package/dist/managers/postprocessing/ao/poissionDenoise/shader/poissionDenoise.js +4 -4
- package/dist/managers/postprocessing/ao/ssao/SSAOEffect.d.ts +14 -14
- package/dist/managers/postprocessing/ao/ssao/SSAOEffect.js +82 -82
- package/dist/managers/postprocessing/ao/ssao/SSAOEffect.js.map +1 -1
- package/dist/managers/postprocessing/ao/ssao/shader/ssao.d.ts +1 -1
- package/dist/managers/postprocessing/ao/ssao/shader/ssao.js +4 -4
- package/dist/managers/postprocessing/ao/utils/shader/basic.d.ts +1 -1
- package/dist/managers/postprocessing/ao/utils/shader/basic.js +4 -4
- package/dist/managers/postprocessing/ao/utils/shader/sampleBlueNoise.d.ts +1 -1
- package/dist/managers/postprocessing/ao/utils/shader/sampleBlueNoise.js +4 -4
- package/dist/managers/postprocessing/effects/tone-mapping/ToneMappingEffect.d.ts +165 -165
- package/dist/managers/postprocessing/effects/tone-mapping/ToneMappingEffect.js +299 -299
- package/dist/managers/postprocessing/effects/tone-mapping/ToneMappingEffect.js.map +1 -1
- package/dist/managers/postprocessing/effects/tone-mapping/tone-mapping.d.ts +1 -1
- package/dist/managers/postprocessing/effects/tone-mapping/tone-mapping.js +4 -4
- package/dist/managers/postprocessing/utils/CopyMaterial.d.ts +37 -37
- package/dist/managers/postprocessing/utils/CopyMaterial.js +69 -69
- package/dist/managers/postprocessing/utils/CopyShader.d.ts +13 -13
- package/dist/managers/postprocessing/utils/CopyShader.js +12 -12
- package/dist/managers/postprocessing/utils/FullScreenQuad.d.ts +9 -9
- package/dist/managers/postprocessing/utils/FullScreenQuad.js +28 -28
- package/dist/managers/postprocessing/utils/NormalPass.d.ts +87 -87
- package/dist/managers/postprocessing/utils/NormalPass.js +156 -156
- package/dist/managers/postprocessing/utils/NormalPass.js.map +1 -1
- package/dist/managers/postprocessing/utils/RenderPass.d.ts +114 -114
- package/dist/managers/postprocessing/utils/RenderPass.js +259 -259
- package/dist/managers/postprocessing/utils/RenderPass.js.map +1 -1
- package/dist/managers/sceneTree/SDTFUtils.d.ts +6 -6
- package/dist/managers/sceneTree/SDTFUtils.d.ts.map +1 -1
- package/dist/managers/sceneTree/SDTFUtils.js +50 -50
- package/dist/managers/sceneTree/SDTFUtils.js.map +1 -1
- package/dist/managers/sceneTree/SceenTreeManagerUtils.d.ts +7 -7
- package/dist/managers/sceneTree/SceenTreeManagerUtils.d.ts.map +1 -1
- package/dist/managers/sceneTree/SceenTreeManagerUtils.js +175 -165
- package/dist/managers/sceneTree/SceenTreeManagerUtils.js.map +1 -1
- package/dist/managers/sceneTree/ThreeJsDataUtils.d.ts +6 -6
- package/dist/managers/sceneTree/ThreeJsDataUtils.d.ts.map +1 -1
- package/dist/managers/sceneTree/ThreeJsDataUtils.js +80 -70
- package/dist/managers/sceneTree/ThreeJsDataUtils.js.map +1 -1
- package/dist/materials/GemMaterial.d.ts +37 -37
- package/dist/materials/GemMaterial.js +262 -252
- package/dist/materials/GemMaterial.js.map +1 -1
- package/dist/materials/MeshUnlitMaterialParameters.d.ts +3 -3
- package/dist/materials/MeshUnlitMaterialParameters.js +2 -2
- package/dist/materials/MultiPointsMaterial.d.ts +93 -93
- package/dist/materials/MultiPointsMaterial.js +577 -567
- package/dist/materials/MultiPointsMaterial.js.map +1 -1
- package/dist/materials/SpecularGlossinessMaterial.d.ts +13 -13
- package/dist/materials/SpecularGlossinessMaterial.js +171 -161
- package/dist/materials/SpecularGlossinessMaterial.js.map +1 -1
- package/dist/objects/SDColor.d.ts +16 -16
- package/dist/objects/SDColor.js +52 -52
- package/dist/objects/SDColor.js.map +1 -1
- package/dist/objects/SDObject.d.ts +27 -27
- package/dist/objects/SDObject.js +112 -102
- package/dist/objects/SDObject.js.map +1 -1
- package/dist/shaders/PCSS.d.ts +2 -2
- package/dist/shaders/PCSS.js +5 -5
- package/dist/shaders/gem.d.ts +2 -2
- package/dist/shaders/gem.js +5 -5
- package/dist/shaders/multi_points.d.ts +2 -2
- package/dist/shaders/multi_points.js +5 -5
- package/dist/styling/viewport-css.d.ts +1 -1
- package/dist/styling/viewport-css.js +4 -4
- package/dist/three/CSS2DRenderer.d.ts +31 -31
- package/dist/three/CSS2DRenderer.d.ts.map +1 -1
- package/dist/three/CSS2DRenderer.js +152 -152
- package/dist/three/CSS2DRenderer.js.map +1 -1
- package/dist/three/geometries/TextGeometry.d.ts +21 -21
- package/dist/three/geometries/TextGeometry.js +45 -45
- package/dist/three/geometries/TextGeometry.js.map +1 -1
- package/dist/three/loaders/RGBELoader.d.ts +23 -23
- package/dist/three/loaders/RGBELoader.js +311 -311
- package/dist/three/loaders/RGBELoader.js.map +1 -1
- package/dist/types/IThreejsData.d.ts +6 -6
- package/dist/types/IThreejsData.js +2 -2
- package/dist/types/ThreejsData.d.ts +10 -10
- package/dist/types/ThreejsData.js +41 -41
- package/package.json +18 -18
- package/dist/managers/InstanceGroupManager.d.ts +0 -58
- package/dist/managers/InstanceGroupManager.d.ts.map +0 -1
- package/dist/managers/InstanceGroupManager.js +0 -372
- package/dist/managers/InstanceGroupManager.js.map +0 -1
|
@@ -1,1297 +1,1307 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
this.
|
|
64
|
-
|
|
65
|
-
this.
|
|
66
|
-
this.
|
|
67
|
-
this.
|
|
68
|
-
this.
|
|
69
|
-
this.
|
|
70
|
-
this.
|
|
71
|
-
this.
|
|
72
|
-
this.
|
|
73
|
-
this.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
this.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
this.changeEffectPass();
|
|
99
|
-
}
|
|
100
|
-
get
|
|
101
|
-
return this.
|
|
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
|
-
this.
|
|
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
|
-
this.
|
|
176
|
-
|
|
177
|
-
this.
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
this.
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
offset
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
.
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
}
|
|
336
|
-
this.
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
.
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
.
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
.
|
|
490
|
-
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
.
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
.
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
.
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
._effectDefinitions[i]
|
|
632
|
-
.
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
};
|
|
855
|
-
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.
|
|
856
|
-
return {
|
|
857
|
-
blendFunction: postprocessing_1.BlendFunction.
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
}
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
._effectDefinitions[i]
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
._effectDefinitions[i]
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
}
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
this.
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
this.
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
this.
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
this.
|
|
1243
|
-
this._renderingEngine.renderer.
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
this.
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
this.
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
this.
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
exports.PostProcessingManager = void 0;
|
|
46
|
+
const viewer_shared_services_1 = require("@shapediver/viewer.shared.services");
|
|
47
|
+
const viewer_shared_types_1 = require("@shapediver/viewer.shared.types");
|
|
48
|
+
const gl_matrix_1 = require("gl-matrix");
|
|
49
|
+
const postprocessing_1 = require("postprocessing");
|
|
50
|
+
const THREE = __importStar(require("three"));
|
|
51
|
+
const HBAOEffect_1 = require("./postprocessing/ao/hbao/HBAOEffect");
|
|
52
|
+
const PoissionDenoisePass_1 = require("./postprocessing/ao/poissionDenoise/PoissionDenoisePass");
|
|
53
|
+
const SSAOEffect_1 = require("./postprocessing/ao/ssao/SSAOEffect");
|
|
54
|
+
const ToneMappingEffect_1 = require("./postprocessing/effects/tone-mapping/ToneMappingEffect");
|
|
55
|
+
const GodRaysManager_1 = require("./postprocessing/GodRaysManager");
|
|
56
|
+
const OutlineManager_1 = require("./postprocessing/OutlineManager");
|
|
57
|
+
const SelectiveBloomManager_1 = require("./postprocessing/SelectiveBloomManager");
|
|
58
|
+
const SSAARenderPass_1 = require("./postprocessing/SSAARenderPass");
|
|
59
|
+
class PostProcessingManager {
|
|
60
|
+
// #endregion Properties (23)
|
|
61
|
+
// #region Constructors (1)
|
|
62
|
+
constructor(_renderingEngine) {
|
|
63
|
+
this._renderingEngine = _renderingEngine;
|
|
64
|
+
// #region Properties (23)
|
|
65
|
+
this._converter = viewer_shared_services_1.Converter.instance;
|
|
66
|
+
this._eventEngine = viewer_shared_services_1.EventEngine.instance;
|
|
67
|
+
this._systemInfo = viewer_shared_services_1.SystemInfo.instance;
|
|
68
|
+
this._uuidGenerator = viewer_shared_services_1.UuidGenerator.instance;
|
|
69
|
+
this._antiAliasingTechnique = viewer_shared_types_1.ANTI_ALIASING_TECHNIQUE.SMAA;
|
|
70
|
+
this._antiAliasingTechniqueMobile = viewer_shared_types_1.ANTI_ALIASING_TECHNIQUE.FXAA;
|
|
71
|
+
this._currentCameraId = "";
|
|
72
|
+
this._effectDefinitions = [];
|
|
73
|
+
this._effectPasses = [];
|
|
74
|
+
this._effects = [];
|
|
75
|
+
this._enablePostProcessingOnMobile = true;
|
|
76
|
+
this._godRaysManagers = {};
|
|
77
|
+
this._initialized = false;
|
|
78
|
+
this._manualPostProcessing = false;
|
|
79
|
+
this._outlineManagers = {};
|
|
80
|
+
this._sceneExtents = 0;
|
|
81
|
+
this._selectiveBloomManagers = {};
|
|
82
|
+
this._suspendEffectPassUpdate = false;
|
|
83
|
+
this._eventEngine.addListener(viewer_shared_services_1.EVENTTYPE.SCENE.SCENE_BOUNDING_BOX_CHANGE, (e) => {
|
|
84
|
+
const viewerEvent = e;
|
|
85
|
+
if (viewerEvent.viewportId === this._renderingEngine.id) {
|
|
86
|
+
this._sceneExtents = gl_matrix_1.vec3.distance(viewerEvent.boundingBox.min, viewerEvent.boundingBox.max);
|
|
87
|
+
this.changeEffectPass();
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
// #endregion Constructors (1)
|
|
92
|
+
// #region Public Getters And Setters (16)
|
|
93
|
+
get antiAliasingTechnique() {
|
|
94
|
+
return this._antiAliasingTechnique;
|
|
95
|
+
}
|
|
96
|
+
set antiAliasingTechnique(value) {
|
|
97
|
+
this._antiAliasingTechnique = value;
|
|
98
|
+
this.changeEffectPass();
|
|
99
|
+
}
|
|
100
|
+
get antiAliasingTechniqueMobile() {
|
|
101
|
+
return this._antiAliasingTechniqueMobile;
|
|
102
|
+
}
|
|
103
|
+
set antiAliasingTechniqueMobile(value) {
|
|
104
|
+
this._antiAliasingTechniqueMobile = value;
|
|
105
|
+
// we don't allow SSAA on mobile devices anymore as it is too slow
|
|
106
|
+
if (this._antiAliasingTechniqueMobile === viewer_shared_types_1.ANTI_ALIASING_TECHNIQUE.SSAA)
|
|
107
|
+
this._antiAliasingTechniqueMobile = viewer_shared_types_1.ANTI_ALIASING_TECHNIQUE.SMAA;
|
|
108
|
+
this.changeEffectPass();
|
|
109
|
+
}
|
|
110
|
+
get effectComposer() {
|
|
111
|
+
return this._composer;
|
|
112
|
+
}
|
|
113
|
+
get effects() {
|
|
114
|
+
return this._effects;
|
|
115
|
+
}
|
|
116
|
+
get enablePostProcessingOnMobile() {
|
|
117
|
+
return this._enablePostProcessingOnMobile;
|
|
118
|
+
}
|
|
119
|
+
set enablePostProcessingOnMobile(value) {
|
|
120
|
+
this._enablePostProcessingOnMobile = value;
|
|
121
|
+
}
|
|
122
|
+
get godRaysManagers() {
|
|
123
|
+
return this._godRaysManagers;
|
|
124
|
+
}
|
|
125
|
+
get initialized() {
|
|
126
|
+
return this._initialized;
|
|
127
|
+
}
|
|
128
|
+
get manualPostProcessing() {
|
|
129
|
+
return this._manualPostProcessing;
|
|
130
|
+
}
|
|
131
|
+
set manualPostProcessing(value) {
|
|
132
|
+
this._manualPostProcessing = value;
|
|
133
|
+
if (this._composer && this._manualPostProcessing === true)
|
|
134
|
+
this._composer.removeAllPasses();
|
|
135
|
+
}
|
|
136
|
+
get outlineManagers() {
|
|
137
|
+
return this._outlineManagers;
|
|
138
|
+
}
|
|
139
|
+
get selectiveBloomManagers() {
|
|
140
|
+
return this._selectiveBloomManagers;
|
|
141
|
+
}
|
|
142
|
+
get ssaaSampleLevel() {
|
|
143
|
+
return this._ssaaRenderPass ? this._ssaaRenderPass.sampleLevel : 2;
|
|
144
|
+
}
|
|
145
|
+
set ssaaSampleLevel(value) {
|
|
146
|
+
if (this._ssaaRenderPass)
|
|
147
|
+
this._ssaaRenderPass.sampleLevel = value;
|
|
148
|
+
}
|
|
149
|
+
// #endregion Public Getters And Setters (16)
|
|
150
|
+
// #region Public Methods (13)
|
|
151
|
+
addEffect(definition, t) {
|
|
152
|
+
const token = t || this._uuidGenerator.create();
|
|
153
|
+
this._effectDefinitions.push({ token, definition });
|
|
154
|
+
switch (definition.type) {
|
|
155
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.GOD_RAYS:
|
|
156
|
+
if (!this._godRaysManagers[token])
|
|
157
|
+
this._godRaysManagers[token] = new GodRaysManager_1.GodRaysManager(this._renderingEngine);
|
|
158
|
+
break;
|
|
159
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.OUTLINE:
|
|
160
|
+
if (!this._outlineManagers[token])
|
|
161
|
+
this._outlineManagers[token] = new OutlineManager_1.OutlineManager(this._renderingEngine);
|
|
162
|
+
break;
|
|
163
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.SELECTIVE_BLOOM:
|
|
164
|
+
if (!this._selectiveBloomManagers[token])
|
|
165
|
+
this._selectiveBloomManagers[token] =
|
|
166
|
+
new SelectiveBloomManager_1.SelectiveBloomManager(this._renderingEngine);
|
|
167
|
+
break;
|
|
168
|
+
default:
|
|
169
|
+
}
|
|
170
|
+
this.changeEffectPass();
|
|
171
|
+
return token;
|
|
172
|
+
}
|
|
173
|
+
applySettings(settingsEngine) {
|
|
174
|
+
this._suspendEffectPassUpdate = true;
|
|
175
|
+
this.antiAliasingTechnique = settingsEngine.settings.postprocessing
|
|
176
|
+
.antiAliasingTechnique;
|
|
177
|
+
this.antiAliasingTechniqueMobile = settingsEngine.settings
|
|
178
|
+
.postprocessing
|
|
179
|
+
.antiAliasingTechniqueMobile;
|
|
180
|
+
// we don't allow SSAA on mobile devices anymore as it is too slow
|
|
181
|
+
if (this._antiAliasingTechniqueMobile === viewer_shared_types_1.ANTI_ALIASING_TECHNIQUE.SSAA)
|
|
182
|
+
this._antiAliasingTechniqueMobile = viewer_shared_types_1.ANTI_ALIASING_TECHNIQUE.SMAA;
|
|
183
|
+
this.enablePostProcessingOnMobile =
|
|
184
|
+
settingsEngine.settings.postprocessing.enablePostProcessingOnMobile;
|
|
185
|
+
this.ssaaSampleLevel =
|
|
186
|
+
settingsEngine.settings.postprocessing.ssaaSampleLevel;
|
|
187
|
+
this._effectDefinitions = [];
|
|
188
|
+
const effects = settingsEngine.settings.postprocessing.effects;
|
|
189
|
+
for (let i = 0; i < effects.length; i++) {
|
|
190
|
+
const token = this._uuidGenerator.create();
|
|
191
|
+
this._effectDefinitions.push({
|
|
192
|
+
token,
|
|
193
|
+
definition: {
|
|
194
|
+
type: effects[i].type,
|
|
195
|
+
properties: effects[i].properties,
|
|
196
|
+
},
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
this._suspendEffectPassUpdate = false;
|
|
200
|
+
this.changeEffectPass();
|
|
201
|
+
}
|
|
202
|
+
changeEffectPass() {
|
|
203
|
+
var _a;
|
|
204
|
+
if (!this._composer)
|
|
205
|
+
return;
|
|
206
|
+
if (this._suspendEffectPassUpdate === true)
|
|
207
|
+
return;
|
|
208
|
+
if (this._systemInfo.isMobile === true &&
|
|
209
|
+
this._enablePostProcessingOnMobile === false)
|
|
210
|
+
return;
|
|
211
|
+
if (this._manualPostProcessing)
|
|
212
|
+
return;
|
|
213
|
+
for (let i = 0; i < this._composer.passes.length; i++)
|
|
214
|
+
this._composer.passes[i].dispose();
|
|
215
|
+
this._composer.removeAllPasses();
|
|
216
|
+
const antiAliasingTechnique = this._systemInfo.isMobile === true
|
|
217
|
+
? this._antiAliasingTechniqueMobile
|
|
218
|
+
: this._antiAliasingTechnique;
|
|
219
|
+
if (antiAliasingTechnique === viewer_shared_types_1.ANTI_ALIASING_TECHNIQUE.SSAA) {
|
|
220
|
+
this.addPassToEffectComposer(this._ssaaRenderPass);
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
this.addPassToEffectComposer(this._renderPass);
|
|
224
|
+
}
|
|
225
|
+
// remove the effects where the tokens are not in the effectDefinitions
|
|
226
|
+
this._effects.forEach((e) => {
|
|
227
|
+
// Clear selection layer bits from meshes before disposing,
|
|
228
|
+
// otherwise stale layer bits remain on meshes and get picked up
|
|
229
|
+
// when layers are reused by newly created effects.
|
|
230
|
+
if (e.effect instanceof postprocessing_1.OutlineEffect)
|
|
231
|
+
e.effect.selection.clear();
|
|
232
|
+
e.effect.dispose();
|
|
233
|
+
});
|
|
234
|
+
this._effects = [];
|
|
235
|
+
for (let i = 0; i < this._effectDefinitions.length; i++) {
|
|
236
|
+
switch (this._effectDefinitions[i].definition.type) {
|
|
237
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.BLOOM:
|
|
238
|
+
{
|
|
239
|
+
const definition = this
|
|
240
|
+
._effectDefinitions[i]
|
|
241
|
+
.definition;
|
|
242
|
+
const properties = definition.properties || {};
|
|
243
|
+
this._effects.push({
|
|
244
|
+
token: this._effectDefinitions[i].token,
|
|
245
|
+
effect: new postprocessing_1.BloomEffect({
|
|
246
|
+
blendFunction: properties.blendFunction,
|
|
247
|
+
luminanceThreshold: properties.luminanceThreshold,
|
|
248
|
+
luminanceSmoothing: properties.luminanceSmoothing,
|
|
249
|
+
mipmapBlur: properties.mipmapBlur,
|
|
250
|
+
intensity: properties.intensity,
|
|
251
|
+
kernelSize: properties.kernelSize,
|
|
252
|
+
}),
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
break;
|
|
256
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.CHROMATIC_ABERRATION:
|
|
257
|
+
{
|
|
258
|
+
const definition = this._effectDefinitions[i]
|
|
259
|
+
.definition;
|
|
260
|
+
const properties = definition.properties || {};
|
|
261
|
+
const offsetArray = properties.offset !== undefined
|
|
262
|
+
? Array.isArray(properties.offset)
|
|
263
|
+
? properties.offset
|
|
264
|
+
: [
|
|
265
|
+
properties.offset.x,
|
|
266
|
+
properties.offset.y,
|
|
267
|
+
]
|
|
268
|
+
: undefined;
|
|
269
|
+
this._effects.push({
|
|
270
|
+
token: this._effectDefinitions[i].token,
|
|
271
|
+
effect: new postprocessing_1.ChromaticAberrationEffect({
|
|
272
|
+
blendFunction: properties.blendFunction,
|
|
273
|
+
offset: offsetArray
|
|
274
|
+
? new THREE.Vector2(...offsetArray)
|
|
275
|
+
: undefined,
|
|
276
|
+
radialModulation: properties.radialModulation !== undefined
|
|
277
|
+
? properties.radialModulation
|
|
278
|
+
: false,
|
|
279
|
+
modulationOffset: properties.modulationOffset !== undefined
|
|
280
|
+
? properties.modulationOffset
|
|
281
|
+
: 0.15,
|
|
282
|
+
}),
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
break;
|
|
286
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.DEPTH_OF_FIELD:
|
|
287
|
+
{
|
|
288
|
+
const definition = this
|
|
289
|
+
._effectDefinitions[i]
|
|
290
|
+
.definition;
|
|
291
|
+
const properties = definition.properties || {};
|
|
292
|
+
const depthOfFieldEffect = new postprocessing_1.DepthOfFieldEffect(this._renderingEngine.camera, {
|
|
293
|
+
blendFunction: properties.blendFunction,
|
|
294
|
+
focusDistance: properties.focusDistance !== undefined
|
|
295
|
+
? properties.focusDistance
|
|
296
|
+
: 0,
|
|
297
|
+
focusRange: properties.focusRange !== undefined
|
|
298
|
+
? properties.focusRange
|
|
299
|
+
: 0.01,
|
|
300
|
+
bokehScale: properties.bokehScale !== undefined
|
|
301
|
+
? properties.bokehScale
|
|
302
|
+
: 5,
|
|
303
|
+
resolutionScale: 1,
|
|
304
|
+
});
|
|
305
|
+
depthOfFieldEffect.resolution.height = 1080;
|
|
306
|
+
depthOfFieldEffect.blurPass.kernelSize =
|
|
307
|
+
postprocessing_1.KernelSize.HUGE;
|
|
308
|
+
this._effects.push({
|
|
309
|
+
token: this._effectDefinitions[i].token,
|
|
310
|
+
effect: depthOfFieldEffect,
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
break;
|
|
314
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.DOT_SCREEN:
|
|
315
|
+
{
|
|
316
|
+
const definition = this
|
|
317
|
+
._effectDefinitions[i]
|
|
318
|
+
.definition;
|
|
319
|
+
const properties = definition.properties || {};
|
|
320
|
+
this._effects.push({
|
|
321
|
+
token: this._effectDefinitions[i].token,
|
|
322
|
+
effect: new postprocessing_1.DotScreenEffect({
|
|
323
|
+
blendFunction: properties.blendFunction,
|
|
324
|
+
scale: properties.scale,
|
|
325
|
+
angle: properties.angle,
|
|
326
|
+
}),
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
break;
|
|
330
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.GOD_RAYS:
|
|
331
|
+
{
|
|
332
|
+
const definition = this
|
|
333
|
+
._effectDefinitions[i]
|
|
334
|
+
.definition;
|
|
335
|
+
const properties = definition.properties || {};
|
|
336
|
+
const godRaysEffect = new postprocessing_1.GodRaysEffect(this._renderingEngine.camera, new THREE.Mesh(), {
|
|
337
|
+
blendFunction: properties.blendFunction,
|
|
338
|
+
density: properties.density,
|
|
339
|
+
decay: properties.decay,
|
|
340
|
+
weight: properties.weight,
|
|
341
|
+
exposure: properties.exposure,
|
|
342
|
+
clampMax: properties.clampMax,
|
|
343
|
+
kernelSize: properties.kernelSize,
|
|
344
|
+
blur: properties.blur,
|
|
345
|
+
});
|
|
346
|
+
this._effects.push({
|
|
347
|
+
token: this._effectDefinitions[i].token,
|
|
348
|
+
effect: godRaysEffect,
|
|
349
|
+
});
|
|
350
|
+
this._godRaysManagers[this._effectDefinitions[i].token].setEffect(godRaysEffect);
|
|
351
|
+
}
|
|
352
|
+
break;
|
|
353
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.GRID:
|
|
354
|
+
{
|
|
355
|
+
const definition = this
|
|
356
|
+
._effectDefinitions[i]
|
|
357
|
+
.definition;
|
|
358
|
+
const properties = definition.properties || {};
|
|
359
|
+
this._effects.push({
|
|
360
|
+
token: this._effectDefinitions[i].token,
|
|
361
|
+
effect: new postprocessing_1.GridEffect({
|
|
362
|
+
blendFunction: properties.blendFunction !== undefined
|
|
363
|
+
? properties.blendFunction
|
|
364
|
+
: postprocessing_1.BlendFunction.MULTIPLY,
|
|
365
|
+
scale: properties.scale,
|
|
366
|
+
}),
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
break;
|
|
370
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.HBAO:
|
|
371
|
+
{
|
|
372
|
+
// we currently do not support devices with WebGL 1: https://shapediver.atlassian.net/browse/SS-7069
|
|
373
|
+
if (this._renderingEngine.renderer.capabilities
|
|
374
|
+
.isWebGL2 === false)
|
|
375
|
+
break;
|
|
376
|
+
const definition = this
|
|
377
|
+
._effectDefinitions[i]
|
|
378
|
+
.definition;
|
|
379
|
+
const properties = definition.properties || {};
|
|
380
|
+
// we adjust the scene size slightly to make the factor fit our requirements
|
|
381
|
+
// with this adjusted factor, a distance value of 1 fits well as a default
|
|
382
|
+
const sceneSizeFactor = this._sceneExtents / 10.0;
|
|
383
|
+
const hbaoEffect = new HBAOEffect_1.HBAOEffect(this._composer, this._renderingEngine.camera, this._renderingEngine.scene, {
|
|
384
|
+
resolutionScale: properties.resolutionScale !== undefined
|
|
385
|
+
? properties.resolutionScale
|
|
386
|
+
: 1,
|
|
387
|
+
spp: properties.spp !== undefined
|
|
388
|
+
? properties.spp
|
|
389
|
+
: 16,
|
|
390
|
+
distance: properties.distance !== undefined
|
|
391
|
+
? properties.distance * sceneSizeFactor
|
|
392
|
+
: sceneSizeFactor,
|
|
393
|
+
distancePower: properties.distanceIntensity !== undefined
|
|
394
|
+
? properties.distanceIntensity
|
|
395
|
+
: 1,
|
|
396
|
+
power: properties.intensity !== undefined
|
|
397
|
+
? properties.intensity
|
|
398
|
+
: 2.5,
|
|
399
|
+
bias: properties.bias !== undefined
|
|
400
|
+
? properties.bias
|
|
401
|
+
: 10,
|
|
402
|
+
thickness: properties.thickness !== undefined
|
|
403
|
+
? properties.thickness
|
|
404
|
+
: 0.5,
|
|
405
|
+
color: properties.color !== undefined
|
|
406
|
+
? new THREE.Color(this._converter
|
|
407
|
+
.toHexColor(properties.color)
|
|
408
|
+
.substring(0, 7))
|
|
409
|
+
: new THREE.Color("black"),
|
|
410
|
+
iterations: properties.iterations !== undefined
|
|
411
|
+
? properties.iterations
|
|
412
|
+
: 1,
|
|
413
|
+
radius: properties.radius !== undefined
|
|
414
|
+
? properties.radius
|
|
415
|
+
: 12,
|
|
416
|
+
rings: properties.rings !== undefined
|
|
417
|
+
? properties.rings
|
|
418
|
+
: 11,
|
|
419
|
+
lumaPhi: properties.lumaPhi !== undefined
|
|
420
|
+
? properties.lumaPhi
|
|
421
|
+
: 10,
|
|
422
|
+
depthPhi: properties.depthPhi !== undefined
|
|
423
|
+
? properties.depthPhi
|
|
424
|
+
: 2,
|
|
425
|
+
normalPhi: properties.normalPhi !== undefined
|
|
426
|
+
? properties.normalPhi
|
|
427
|
+
: 3.25,
|
|
428
|
+
samples: properties.samples !== undefined
|
|
429
|
+
? properties.samples
|
|
430
|
+
: 16,
|
|
431
|
+
});
|
|
432
|
+
this._effects.push({
|
|
433
|
+
token: this._effectDefinitions[i].token,
|
|
434
|
+
effect: hbaoEffect,
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
break;
|
|
438
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.HUE_SATURATION:
|
|
439
|
+
{
|
|
440
|
+
const definition = this
|
|
441
|
+
._effectDefinitions[i]
|
|
442
|
+
.definition;
|
|
443
|
+
const properties = definition.properties || {};
|
|
444
|
+
this._effects.push({
|
|
445
|
+
token: this._effectDefinitions[i].token,
|
|
446
|
+
effect: new postprocessing_1.HueSaturationEffect({
|
|
447
|
+
blendFunction: properties.blendFunction,
|
|
448
|
+
hue: properties.hue,
|
|
449
|
+
saturation: properties.saturation,
|
|
450
|
+
}),
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
break;
|
|
454
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.NOISE:
|
|
455
|
+
{
|
|
456
|
+
const definition = this
|
|
457
|
+
._effectDefinitions[i]
|
|
458
|
+
.definition;
|
|
459
|
+
const properties = definition.properties || {};
|
|
460
|
+
this._effects.push({
|
|
461
|
+
token: this._effectDefinitions[i].token,
|
|
462
|
+
effect: new postprocessing_1.NoiseEffect({
|
|
463
|
+
blendFunction: properties.blendFunction,
|
|
464
|
+
premultiply: properties.premultiply,
|
|
465
|
+
}),
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
break;
|
|
469
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.OUTLINE:
|
|
470
|
+
{
|
|
471
|
+
const definition = this
|
|
472
|
+
._effectDefinitions[i]
|
|
473
|
+
.definition;
|
|
474
|
+
const properties = definition.properties || {};
|
|
475
|
+
const outlineEffect = new postprocessing_1.OutlineEffect(this._renderingEngine.scene, this._renderingEngine.camera, {
|
|
476
|
+
blendFunction: properties.blendFunction !== undefined
|
|
477
|
+
? properties.blendFunction
|
|
478
|
+
: postprocessing_1.BlendFunction.SCREEN,
|
|
479
|
+
edgeStrength: properties.edgeStrength,
|
|
480
|
+
pulseSpeed: properties.pulseSpeed,
|
|
481
|
+
visibleEdgeColor: (new THREE.Color(this._converter
|
|
482
|
+
.toHexColor(properties.visibleEdgeColor)
|
|
483
|
+
.substring(0, 7))),
|
|
484
|
+
hiddenEdgeColor: (new THREE.Color(this._converter
|
|
485
|
+
.toHexColor(properties.hiddenEdgeColor)
|
|
486
|
+
.substring(0, 7))),
|
|
487
|
+
kernelSize: properties.kernelSize,
|
|
488
|
+
blur: properties.blur,
|
|
489
|
+
xRay: properties.xRay,
|
|
490
|
+
multisampling: properties.multisampling,
|
|
491
|
+
});
|
|
492
|
+
// if there are multiple outline effects
|
|
493
|
+
// we have to get the first unused selection layer
|
|
494
|
+
// starting from 10 (1-9 are reserved)
|
|
495
|
+
let layer = 10;
|
|
496
|
+
while (Object.values(this._effects)
|
|
497
|
+
.filter((e) => e.effect instanceof postprocessing_1.OutlineEffect)
|
|
498
|
+
.some((o) => o.effect.selection
|
|
499
|
+
.layer === layer)) {
|
|
500
|
+
layer++;
|
|
501
|
+
}
|
|
502
|
+
outlineEffect.selection.layer = layer;
|
|
503
|
+
this._effects.push({
|
|
504
|
+
token: this._effectDefinitions[i].token,
|
|
505
|
+
effect: outlineEffect,
|
|
506
|
+
});
|
|
507
|
+
this._outlineManagers[this._effectDefinitions[i].token].setEffect(outlineEffect);
|
|
508
|
+
}
|
|
509
|
+
break;
|
|
510
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.PIXELATION:
|
|
511
|
+
{
|
|
512
|
+
const definition = this
|
|
513
|
+
._effectDefinitions[i]
|
|
514
|
+
.definition;
|
|
515
|
+
const properties = definition.properties || {};
|
|
516
|
+
this._effects.push({
|
|
517
|
+
token: this._effectDefinitions[i].token,
|
|
518
|
+
effect: new postprocessing_1.PixelationEffect(properties.granularity),
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
break;
|
|
522
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.SSAO:
|
|
523
|
+
{
|
|
524
|
+
// we currently do not support devices with WebGL 1: https://shapediver.atlassian.net/browse/SS-7069
|
|
525
|
+
if (this._renderingEngine.renderer.capabilities
|
|
526
|
+
.isWebGL2 === false)
|
|
527
|
+
break;
|
|
528
|
+
const definition = this
|
|
529
|
+
._effectDefinitions[i]
|
|
530
|
+
.definition;
|
|
531
|
+
const properties = definition.properties || {};
|
|
532
|
+
// we adjust the scene size slightly to make the factor fit our requirements
|
|
533
|
+
// with this adjusted factor, a distance value of 1 fits well as a default
|
|
534
|
+
const sceneSizeFactor = this._sceneExtents / 50.0;
|
|
535
|
+
const ssaoEffect = new SSAOEffect_1.SSAOEffect(this._composer, this._renderingEngine.camera, this._renderingEngine.scene, {
|
|
536
|
+
resolutionScale: properties.resolutionScale !== undefined
|
|
537
|
+
? properties.resolutionScale
|
|
538
|
+
: 1,
|
|
539
|
+
spp: properties.spp !== undefined
|
|
540
|
+
? properties.spp
|
|
541
|
+
: 16,
|
|
542
|
+
distance: properties.distance !== undefined
|
|
543
|
+
? properties.distance * sceneSizeFactor
|
|
544
|
+
: sceneSizeFactor,
|
|
545
|
+
distancePower: properties.distanceIntensity !== undefined
|
|
546
|
+
? properties.distanceIntensity
|
|
547
|
+
: 1,
|
|
548
|
+
power: properties.intensity !== undefined
|
|
549
|
+
? properties.intensity
|
|
550
|
+
: 2.5,
|
|
551
|
+
color: properties.color !== undefined
|
|
552
|
+
? new THREE.Color(this._converter
|
|
553
|
+
.toHexColor(properties.color)
|
|
554
|
+
.substring(0, 7))
|
|
555
|
+
: new THREE.Color("black"),
|
|
556
|
+
iterations: properties.iterations !== undefined
|
|
557
|
+
? properties.iterations
|
|
558
|
+
: 1,
|
|
559
|
+
radius: properties.radius !== undefined
|
|
560
|
+
? properties.radius
|
|
561
|
+
: 12,
|
|
562
|
+
rings: properties.rings !== undefined
|
|
563
|
+
? properties.rings
|
|
564
|
+
: 11,
|
|
565
|
+
lumaPhi: properties.lumaPhi !== undefined
|
|
566
|
+
? properties.lumaPhi
|
|
567
|
+
: 10,
|
|
568
|
+
depthPhi: properties.depthPhi !== undefined
|
|
569
|
+
? properties.depthPhi
|
|
570
|
+
: 2,
|
|
571
|
+
normalPhi: properties.normalPhi !== undefined
|
|
572
|
+
? properties.normalPhi
|
|
573
|
+
: 3.25,
|
|
574
|
+
samples: properties.samples !== undefined
|
|
575
|
+
? properties.samples
|
|
576
|
+
: 16,
|
|
577
|
+
});
|
|
578
|
+
this._effects.push({
|
|
579
|
+
token: this._effectDefinitions[i].token,
|
|
580
|
+
effect: ssaoEffect,
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
break;
|
|
584
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.SCANLINE:
|
|
585
|
+
{
|
|
586
|
+
const definition = this
|
|
587
|
+
._effectDefinitions[i]
|
|
588
|
+
.definition;
|
|
589
|
+
const properties = definition.properties || {};
|
|
590
|
+
this._effects.push({
|
|
591
|
+
token: this._effectDefinitions[i].token,
|
|
592
|
+
effect: new postprocessing_1.ScanlineEffect({
|
|
593
|
+
blendFunction: properties.blendFunction,
|
|
594
|
+
density: properties.density,
|
|
595
|
+
}),
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
break;
|
|
599
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.SELECTIVE_BLOOM:
|
|
600
|
+
{
|
|
601
|
+
const definition = this
|
|
602
|
+
._effectDefinitions[i]
|
|
603
|
+
.definition;
|
|
604
|
+
const properties = definition.properties || {};
|
|
605
|
+
const selectiveBloomEffect = new postprocessing_1.SelectiveBloomEffect(this._renderingEngine.scene, this._renderingEngine.camera, {
|
|
606
|
+
blendFunction: properties.blendFunction,
|
|
607
|
+
mipmapBlur: properties.mipmapBlur,
|
|
608
|
+
luminanceThreshold: properties.luminanceThreshold,
|
|
609
|
+
luminanceSmoothing: properties.luminanceSmoothing,
|
|
610
|
+
intensity: properties.intensity,
|
|
611
|
+
kernelSize: properties.kernelSize,
|
|
612
|
+
});
|
|
613
|
+
selectiveBloomEffect.ignoreBackground =
|
|
614
|
+
properties.ignoreBackground !== undefined
|
|
615
|
+
? properties.ignoreBackground
|
|
616
|
+
: true;
|
|
617
|
+
this._effects.push({
|
|
618
|
+
token: this._effectDefinitions[i].token,
|
|
619
|
+
effect: selectiveBloomEffect,
|
|
620
|
+
});
|
|
621
|
+
this._selectiveBloomManagers[this._effectDefinitions[i].token].setEffect(selectiveBloomEffect);
|
|
622
|
+
}
|
|
623
|
+
break;
|
|
624
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.SEPIA:
|
|
625
|
+
{
|
|
626
|
+
const definition = this
|
|
627
|
+
._effectDefinitions[i]
|
|
628
|
+
.definition;
|
|
629
|
+
const properties = definition.properties || {};
|
|
630
|
+
this._effects.push({
|
|
631
|
+
token: this._effectDefinitions[i].token,
|
|
632
|
+
effect: new postprocessing_1.SepiaEffect({
|
|
633
|
+
blendFunction: properties.blendFunction,
|
|
634
|
+
}),
|
|
635
|
+
});
|
|
636
|
+
}
|
|
637
|
+
break;
|
|
638
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.TILT_SHIFT:
|
|
639
|
+
{
|
|
640
|
+
const definition = this
|
|
641
|
+
._effectDefinitions[i]
|
|
642
|
+
.definition;
|
|
643
|
+
const properties = definition.properties || {};
|
|
644
|
+
this._effects.push({
|
|
645
|
+
token: this._effectDefinitions[i].token,
|
|
646
|
+
effect: new postprocessing_1.TiltShiftEffect({
|
|
647
|
+
blendFunction: properties.blendFunction,
|
|
648
|
+
offset: properties.offset,
|
|
649
|
+
rotation: properties.rotation,
|
|
650
|
+
focusArea: properties.focusArea,
|
|
651
|
+
feather: properties.feather,
|
|
652
|
+
kernelSize: properties.kernelSize,
|
|
653
|
+
}),
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
break;
|
|
657
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.VIGNETTE:
|
|
658
|
+
{
|
|
659
|
+
const definition = this
|
|
660
|
+
._effectDefinitions[i]
|
|
661
|
+
.definition;
|
|
662
|
+
const properties = definition.properties || {};
|
|
663
|
+
this._effects.push({
|
|
664
|
+
token: this._effectDefinitions[i].token,
|
|
665
|
+
effect: new postprocessing_1.VignetteEffect({
|
|
666
|
+
blendFunction: properties.blendFunction,
|
|
667
|
+
technique: properties.technique,
|
|
668
|
+
offset: properties.offset,
|
|
669
|
+
darkness: properties.darkness,
|
|
670
|
+
}),
|
|
671
|
+
});
|
|
672
|
+
}
|
|
673
|
+
break;
|
|
674
|
+
default:
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
// sort effects by order in effectDefinitions
|
|
678
|
+
this._effects.sort((a, b) => this._effectDefinitions.indexOf(this._effectDefinitions.find((e) => e.token === a.token)) -
|
|
679
|
+
this._effectDefinitions.indexOf(this._effectDefinitions.find((e) => e.token === b.token)));
|
|
680
|
+
const effectArray = this._effects.map((v) => v.effect);
|
|
681
|
+
if (antiAliasingTechnique === viewer_shared_types_1.ANTI_ALIASING_TECHNIQUE.FXAA) {
|
|
682
|
+
effectArray.unshift(this._fxaaEffect);
|
|
683
|
+
}
|
|
684
|
+
else if (antiAliasingTechnique === viewer_shared_types_1.ANTI_ALIASING_TECHNIQUE.SMAA) {
|
|
685
|
+
effectArray.unshift(this._smaaEffect);
|
|
686
|
+
}
|
|
687
|
+
this._effectPasses = [];
|
|
688
|
+
/**
|
|
689
|
+
* For every 3 effects we add another effects pass.
|
|
690
|
+
* We split it like this to avoid issues with maximum number of textures in one pass.
|
|
691
|
+
*
|
|
692
|
+
* Note that this could be refined in the future to count the number of textures used by the effects
|
|
693
|
+
* instead of just counting the number of effects and compare them to the maximum number of textures
|
|
694
|
+
* supported by the device, but for now this is a good enough solution.
|
|
695
|
+
**/
|
|
696
|
+
for (let i = 0; i < this._effects.length; i += 5) {
|
|
697
|
+
const effectsForPass = this._effects.slice(i, i + 5);
|
|
698
|
+
const effectPass = new postprocessing_1.EffectPass(this._renderingEngine.camera, ...effectsForPass.map((v) => v.effect));
|
|
699
|
+
(_a = this._effectPasses) === null || _a === void 0 ? void 0 : _a.push(effectPass);
|
|
700
|
+
this.addPassToEffectComposer(effectPass);
|
|
701
|
+
}
|
|
702
|
+
// for the AO effects we need to add a separate AA pass at the end that anti-aliases the AO effect
|
|
703
|
+
if (this._effectDefinitions.find((e) => e.definition.type === viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.HBAO ||
|
|
704
|
+
e.definition.type === viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.SSAO)) {
|
|
705
|
+
// respect the AA choice if one of the effects was selected, use SMAA otherwise
|
|
706
|
+
this.addPassToEffectComposer(new postprocessing_1.EffectPass(this._renderingEngine.camera, antiAliasingTechnique === viewer_shared_types_1.ANTI_ALIASING_TECHNIQUE.FXAA
|
|
707
|
+
? this._fxaaEffect
|
|
708
|
+
: this._smaaEffect));
|
|
709
|
+
}
|
|
710
|
+
if (this._renderingEngine.toneMapping !== viewer_shared_types_1.TONE_MAPPING.NONE) {
|
|
711
|
+
const mode = (() => {
|
|
712
|
+
switch (this._renderingEngine.toneMapping) {
|
|
713
|
+
case viewer_shared_types_1.TONE_MAPPING.ACES_FILMIC:
|
|
714
|
+
return postprocessing_1.ToneMappingMode.ACES_FILMIC;
|
|
715
|
+
case viewer_shared_types_1.TONE_MAPPING.CINEON:
|
|
716
|
+
return postprocessing_1.ToneMappingMode.OPTIMIZED_CINEON;
|
|
717
|
+
case viewer_shared_types_1.TONE_MAPPING.REINHARD:
|
|
718
|
+
return postprocessing_1.ToneMappingMode.REINHARD;
|
|
719
|
+
default:
|
|
720
|
+
return postprocessing_1.ToneMappingMode.LINEAR;
|
|
721
|
+
}
|
|
722
|
+
})();
|
|
723
|
+
this._toneMappingEffect = new ToneMappingEffect_1.ToneMappingEffect({ mode });
|
|
724
|
+
const effectPass = new postprocessing_1.EffectPass(this._renderingEngine.camera, this._toneMappingEffect);
|
|
725
|
+
this.addPassToEffectComposer(effectPass);
|
|
726
|
+
}
|
|
727
|
+
// if there is at least one outline effect, with a pulse speed > 0, we need to enable continuous rendering
|
|
728
|
+
if (this._effectDefinitions.find((e) => {
|
|
729
|
+
var _a;
|
|
730
|
+
return e.definition.type === viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.OUTLINE &&
|
|
731
|
+
(((_a = e.definition.properties) === null || _a === void 0 ? void 0 : _a.pulseSpeed) || 0) > 0;
|
|
732
|
+
})) {
|
|
733
|
+
if (this._continuousRenderingToken === undefined)
|
|
734
|
+
this._continuousRenderingToken = this._renderingEngine.addFlag(viewer_shared_types_1.FLAG_TYPE.CONTINUOUS_RENDERING);
|
|
735
|
+
}
|
|
736
|
+
else if (this._continuousRenderingToken !== undefined) {
|
|
737
|
+
this._renderingEngine.removeFlag(this._continuousRenderingToken);
|
|
738
|
+
this._continuousRenderingToken = undefined;
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
getDefaultEffectProperties(type) {
|
|
742
|
+
switch (type) {
|
|
743
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.BLOOM:
|
|
744
|
+
return {
|
|
745
|
+
blendFunction: postprocessing_1.BlendFunction.ADD,
|
|
746
|
+
intensity: 1.0,
|
|
747
|
+
kernelSize: postprocessing_1.KernelSize.LARGE,
|
|
748
|
+
luminanceSmoothing: 0.025,
|
|
749
|
+
luminanceThreshold: 0.9,
|
|
750
|
+
mipmapBlur: false,
|
|
751
|
+
};
|
|
752
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.CHROMATIC_ABERRATION:
|
|
753
|
+
return {
|
|
754
|
+
blendFunction: postprocessing_1.BlendFunction.NORMAL,
|
|
755
|
+
modulationOffset: 0.15,
|
|
756
|
+
offset: { x: 0.001, y: 0.0005 },
|
|
757
|
+
radialModulation: false,
|
|
758
|
+
};
|
|
759
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.DEPTH_OF_FIELD:
|
|
760
|
+
return {
|
|
761
|
+
blendFunction: postprocessing_1.BlendFunction.NORMAL,
|
|
762
|
+
bokehScale: 5.0,
|
|
763
|
+
focusDistance: 0.0,
|
|
764
|
+
focusRange: 0.01,
|
|
765
|
+
};
|
|
766
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.DOT_SCREEN:
|
|
767
|
+
return {
|
|
768
|
+
angle: 1.57,
|
|
769
|
+
blendFunction: postprocessing_1.BlendFunction.NORMAL,
|
|
770
|
+
scale: 1.0,
|
|
771
|
+
};
|
|
772
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.GOD_RAYS:
|
|
773
|
+
return {
|
|
774
|
+
blendFunction: postprocessing_1.BlendFunction.SCREEN,
|
|
775
|
+
blur: true,
|
|
776
|
+
clampMax: 1.0,
|
|
777
|
+
decay: 0.9,
|
|
778
|
+
density: 0.96,
|
|
779
|
+
exposure: 0.6,
|
|
780
|
+
kernelSize: postprocessing_1.KernelSize.SMALL,
|
|
781
|
+
weight: 0.4,
|
|
782
|
+
};
|
|
783
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.GRID:
|
|
784
|
+
return {
|
|
785
|
+
blendFunction: postprocessing_1.BlendFunction.MULTIPLY,
|
|
786
|
+
scale: 1.0,
|
|
787
|
+
};
|
|
788
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.HBAO:
|
|
789
|
+
return {
|
|
790
|
+
resolutionScale: 1,
|
|
791
|
+
spp: 16,
|
|
792
|
+
distance: 1,
|
|
793
|
+
distanceIntensity: 1,
|
|
794
|
+
intensity: 2.5,
|
|
795
|
+
color: "#000000",
|
|
796
|
+
bias: 10,
|
|
797
|
+
thickness: 0.5,
|
|
798
|
+
iterations: 1,
|
|
799
|
+
radius: 12,
|
|
800
|
+
rings: 11,
|
|
801
|
+
lumaPhi: 10,
|
|
802
|
+
depthPhi: 2,
|
|
803
|
+
normalPhi: 3.25,
|
|
804
|
+
samples: 16,
|
|
805
|
+
};
|
|
806
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.HUE_SATURATION:
|
|
807
|
+
return {
|
|
808
|
+
blendFunction: postprocessing_1.BlendFunction.NORMAL,
|
|
809
|
+
hue: 0.0,
|
|
810
|
+
saturation: 0.0,
|
|
811
|
+
};
|
|
812
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.NOISE:
|
|
813
|
+
return {
|
|
814
|
+
blendFunction: postprocessing_1.BlendFunction.SCREEN,
|
|
815
|
+
premultiply: false,
|
|
816
|
+
};
|
|
817
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.OUTLINE:
|
|
818
|
+
return {
|
|
819
|
+
blendFunction: postprocessing_1.BlendFunction.SCREEN,
|
|
820
|
+
blur: false,
|
|
821
|
+
edgeStrength: 1.0,
|
|
822
|
+
hiddenEdgeColor: "#22090a",
|
|
823
|
+
kernelSize: postprocessing_1.KernelSize.VERY_SMALL,
|
|
824
|
+
multisampling: 0,
|
|
825
|
+
pulseSpeed: 0.0,
|
|
826
|
+
resolution: 480,
|
|
827
|
+
visibleEdgeColor: "#ffffff",
|
|
828
|
+
xRay: true,
|
|
829
|
+
};
|
|
830
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.PIXELATION:
|
|
831
|
+
return {
|
|
832
|
+
granularity: 30.0,
|
|
833
|
+
};
|
|
834
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.SSAO:
|
|
835
|
+
return {
|
|
836
|
+
resolutionScale: 1,
|
|
837
|
+
spp: 16,
|
|
838
|
+
distance: 1,
|
|
839
|
+
distanceIntensity: 1,
|
|
840
|
+
intensity: 2.5,
|
|
841
|
+
color: "#000000",
|
|
842
|
+
iterations: 1,
|
|
843
|
+
radius: 12,
|
|
844
|
+
rings: 11,
|
|
845
|
+
lumaPhi: 10,
|
|
846
|
+
depthPhi: 2,
|
|
847
|
+
normalPhi: 3.25,
|
|
848
|
+
samples: 16,
|
|
849
|
+
};
|
|
850
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.SCANLINE:
|
|
851
|
+
return {
|
|
852
|
+
blendFunction: postprocessing_1.BlendFunction.OVERLAY,
|
|
853
|
+
density: 1.25,
|
|
854
|
+
};
|
|
855
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.SELECTIVE_BLOOM:
|
|
856
|
+
return {
|
|
857
|
+
blendFunction: postprocessing_1.BlendFunction.ADD,
|
|
858
|
+
intensity: 1.0,
|
|
859
|
+
kernelSize: postprocessing_1.KernelSize.LARGE,
|
|
860
|
+
luminanceSmoothing: 0.025,
|
|
861
|
+
luminanceThreshold: 0.9,
|
|
862
|
+
mipmapBlur: false,
|
|
863
|
+
ignoreBackground: true,
|
|
864
|
+
};
|
|
865
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.SEPIA:
|
|
866
|
+
return {
|
|
867
|
+
blendFunction: postprocessing_1.BlendFunction.NORMAL,
|
|
868
|
+
};
|
|
869
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.TILT_SHIFT:
|
|
870
|
+
return {
|
|
871
|
+
blendFunction: postprocessing_1.BlendFunction.NORMAL,
|
|
872
|
+
feather: 0.3,
|
|
873
|
+
focusArea: 0.4,
|
|
874
|
+
kernelSize: postprocessing_1.KernelSize.MEDIUM,
|
|
875
|
+
offset: 0.0,
|
|
876
|
+
rotation: 0.0,
|
|
877
|
+
};
|
|
878
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.VIGNETTE:
|
|
879
|
+
return {
|
|
880
|
+
blendFunction: postprocessing_1.BlendFunction.NORMAL,
|
|
881
|
+
darkness: 0.5,
|
|
882
|
+
offset: 0.5,
|
|
883
|
+
technique: postprocessing_1.VignetteTechnique.DEFAULT,
|
|
884
|
+
};
|
|
885
|
+
default:
|
|
886
|
+
return {};
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
initialize() {
|
|
890
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
891
|
+
if (this._initialized)
|
|
892
|
+
return;
|
|
893
|
+
// wait for the blue noise texture to be loaded before initializing the composer
|
|
894
|
+
yield PoissionDenoisePass_1.PoissionDenoisePass.loadBlueNoiseTexture();
|
|
895
|
+
yield new Promise((resolve) => setTimeout(resolve, 0));
|
|
896
|
+
this._initialized = true;
|
|
897
|
+
return;
|
|
898
|
+
});
|
|
899
|
+
}
|
|
900
|
+
getEffect(token) {
|
|
901
|
+
return this._effects.find((e) => e.token === token).effect;
|
|
902
|
+
}
|
|
903
|
+
getEffectTokens() {
|
|
904
|
+
return Object.assign({}, ...this._effectDefinitions.map((e) => ({
|
|
905
|
+
[e.token]: e.definition.type,
|
|
906
|
+
})));
|
|
907
|
+
}
|
|
908
|
+
getPostProcessingEffectsArray() {
|
|
909
|
+
const effects = [];
|
|
910
|
+
for (let i = 0; i < this._effectDefinitions.length; i++) {
|
|
911
|
+
switch (this._effectDefinitions[i].definition.type) {
|
|
912
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.BLOOM:
|
|
913
|
+
{
|
|
914
|
+
const definition = this
|
|
915
|
+
._effectDefinitions[i]
|
|
916
|
+
.definition;
|
|
917
|
+
const properties = definition.properties || {};
|
|
918
|
+
effects.push({
|
|
919
|
+
type: viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.BLOOM,
|
|
920
|
+
token: this._effectDefinitions[i].token,
|
|
921
|
+
properties: {
|
|
922
|
+
blendFunction: properties.blendFunction,
|
|
923
|
+
luminanceThreshold: properties.luminanceThreshold,
|
|
924
|
+
luminanceSmoothing: properties.luminanceSmoothing,
|
|
925
|
+
mipmapBlur: properties.mipmapBlur,
|
|
926
|
+
intensity: properties.intensity,
|
|
927
|
+
kernelSize: properties.kernelSize,
|
|
928
|
+
},
|
|
929
|
+
});
|
|
930
|
+
}
|
|
931
|
+
break;
|
|
932
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.CHROMATIC_ABERRATION:
|
|
933
|
+
{
|
|
934
|
+
const definition = this._effectDefinitions[i]
|
|
935
|
+
.definition;
|
|
936
|
+
const properties = definition.properties || {};
|
|
937
|
+
effects.push({
|
|
938
|
+
type: viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.CHROMATIC_ABERRATION,
|
|
939
|
+
token: this._effectDefinitions[i].token,
|
|
940
|
+
properties: {
|
|
941
|
+
blendFunction: properties.blendFunction,
|
|
942
|
+
offset: properties.offset
|
|
943
|
+
? Array.isArray(properties.offset)
|
|
944
|
+
? {
|
|
945
|
+
x: properties.offset[0],
|
|
946
|
+
y: properties.offset[1],
|
|
947
|
+
}
|
|
948
|
+
: properties.offset
|
|
949
|
+
: undefined,
|
|
950
|
+
radialModulation: properties.radialModulation,
|
|
951
|
+
modulationOffset: properties.modulationOffset,
|
|
952
|
+
},
|
|
953
|
+
});
|
|
954
|
+
}
|
|
955
|
+
break;
|
|
956
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.DEPTH_OF_FIELD:
|
|
957
|
+
{
|
|
958
|
+
const definition = this
|
|
959
|
+
._effectDefinitions[i]
|
|
960
|
+
.definition;
|
|
961
|
+
const properties = definition.properties || {};
|
|
962
|
+
effects.push({
|
|
963
|
+
type: viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.DEPTH_OF_FIELD,
|
|
964
|
+
token: this._effectDefinitions[i].token,
|
|
965
|
+
properties: {
|
|
966
|
+
blendFunction: properties.blendFunction,
|
|
967
|
+
focusDistance: properties.focusDistance,
|
|
968
|
+
focusRange: properties.focusRange,
|
|
969
|
+
bokehScale: properties.bokehScale,
|
|
970
|
+
},
|
|
971
|
+
});
|
|
972
|
+
}
|
|
973
|
+
break;
|
|
974
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.DOT_SCREEN:
|
|
975
|
+
{
|
|
976
|
+
const definition = this
|
|
977
|
+
._effectDefinitions[i]
|
|
978
|
+
.definition;
|
|
979
|
+
const properties = definition.properties || {};
|
|
980
|
+
effects.push({
|
|
981
|
+
type: viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.DOT_SCREEN,
|
|
982
|
+
token: this._effectDefinitions[i].token,
|
|
983
|
+
properties: {
|
|
984
|
+
blendFunction: properties.blendFunction,
|
|
985
|
+
scale: properties.scale,
|
|
986
|
+
angle: properties.angle,
|
|
987
|
+
},
|
|
988
|
+
});
|
|
989
|
+
}
|
|
990
|
+
break;
|
|
991
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.GRID:
|
|
992
|
+
{
|
|
993
|
+
const definition = this
|
|
994
|
+
._effectDefinitions[i]
|
|
995
|
+
.definition;
|
|
996
|
+
const properties = definition.properties || {};
|
|
997
|
+
effects.push({
|
|
998
|
+
type: viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.GRID,
|
|
999
|
+
token: this._effectDefinitions[i].token,
|
|
1000
|
+
properties: {
|
|
1001
|
+
blendFunction: properties.blendFunction,
|
|
1002
|
+
scale: properties.scale,
|
|
1003
|
+
},
|
|
1004
|
+
});
|
|
1005
|
+
}
|
|
1006
|
+
break;
|
|
1007
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.HBAO:
|
|
1008
|
+
{
|
|
1009
|
+
const definition = this
|
|
1010
|
+
._effectDefinitions[i]
|
|
1011
|
+
.definition;
|
|
1012
|
+
const properties = definition.properties || {};
|
|
1013
|
+
effects.push({
|
|
1014
|
+
type: viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.HBAO,
|
|
1015
|
+
token: this._effectDefinitions[i].token,
|
|
1016
|
+
properties: {
|
|
1017
|
+
resolutionScale: properties.resolutionScale,
|
|
1018
|
+
spp: properties.spp,
|
|
1019
|
+
distance: properties.distance,
|
|
1020
|
+
distanceIntensity: properties.distanceIntensity,
|
|
1021
|
+
intensity: properties.intensity,
|
|
1022
|
+
bias: properties.bias,
|
|
1023
|
+
thickness: properties.thickness,
|
|
1024
|
+
color: properties.color !== undefined
|
|
1025
|
+
? this._converter.toHexColor(properties.color)
|
|
1026
|
+
: undefined,
|
|
1027
|
+
iterations: properties.iterations,
|
|
1028
|
+
radius: properties.radius,
|
|
1029
|
+
rings: properties.rings,
|
|
1030
|
+
lumaPhi: properties.lumaPhi,
|
|
1031
|
+
depthPhi: properties.depthPhi,
|
|
1032
|
+
normalPhi: properties.normalPhi,
|
|
1033
|
+
samples: properties.samples,
|
|
1034
|
+
},
|
|
1035
|
+
});
|
|
1036
|
+
}
|
|
1037
|
+
break;
|
|
1038
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.HUE_SATURATION:
|
|
1039
|
+
{
|
|
1040
|
+
const definition = this
|
|
1041
|
+
._effectDefinitions[i]
|
|
1042
|
+
.definition;
|
|
1043
|
+
const properties = definition.properties || {};
|
|
1044
|
+
effects.push({
|
|
1045
|
+
type: viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.HUE_SATURATION,
|
|
1046
|
+
token: this._effectDefinitions[i].token,
|
|
1047
|
+
properties: {
|
|
1048
|
+
blendFunction: properties.blendFunction,
|
|
1049
|
+
hue: properties.hue,
|
|
1050
|
+
saturation: properties.saturation,
|
|
1051
|
+
},
|
|
1052
|
+
});
|
|
1053
|
+
}
|
|
1054
|
+
break;
|
|
1055
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.NOISE:
|
|
1056
|
+
{
|
|
1057
|
+
const definition = this
|
|
1058
|
+
._effectDefinitions[i]
|
|
1059
|
+
.definition;
|
|
1060
|
+
const properties = definition.properties || {};
|
|
1061
|
+
effects.push({
|
|
1062
|
+
type: viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.NOISE,
|
|
1063
|
+
token: this._effectDefinitions[i].token,
|
|
1064
|
+
properties: {
|
|
1065
|
+
blendFunction: properties.blendFunction,
|
|
1066
|
+
premultiply: properties.premultiply,
|
|
1067
|
+
},
|
|
1068
|
+
});
|
|
1069
|
+
}
|
|
1070
|
+
break;
|
|
1071
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.PIXELATION:
|
|
1072
|
+
{
|
|
1073
|
+
const definition = this
|
|
1074
|
+
._effectDefinitions[i]
|
|
1075
|
+
.definition;
|
|
1076
|
+
const properties = definition.properties || {};
|
|
1077
|
+
effects.push({
|
|
1078
|
+
type: viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.PIXELATION,
|
|
1079
|
+
token: this._effectDefinitions[i].token,
|
|
1080
|
+
properties: {
|
|
1081
|
+
granularity: properties.granularity,
|
|
1082
|
+
},
|
|
1083
|
+
});
|
|
1084
|
+
}
|
|
1085
|
+
break;
|
|
1086
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.SSAO:
|
|
1087
|
+
{
|
|
1088
|
+
const definition = this
|
|
1089
|
+
._effectDefinitions[i]
|
|
1090
|
+
.definition;
|
|
1091
|
+
const properties = definition.properties || {};
|
|
1092
|
+
effects.push({
|
|
1093
|
+
type: viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.SSAO,
|
|
1094
|
+
token: this._effectDefinitions[i].token,
|
|
1095
|
+
properties: {
|
|
1096
|
+
resolutionScale: properties.resolutionScale,
|
|
1097
|
+
spp: properties.spp,
|
|
1098
|
+
distance: properties.distance,
|
|
1099
|
+
distanceIntensity: properties.distanceIntensity,
|
|
1100
|
+
intensity: properties.intensity,
|
|
1101
|
+
color: properties.color !== undefined
|
|
1102
|
+
? this._converter.toHexColor(properties.color)
|
|
1103
|
+
: undefined,
|
|
1104
|
+
iterations: properties.iterations,
|
|
1105
|
+
radius: properties.radius,
|
|
1106
|
+
rings: properties.rings,
|
|
1107
|
+
lumaPhi: properties.lumaPhi,
|
|
1108
|
+
depthPhi: properties.depthPhi,
|
|
1109
|
+
normalPhi: properties.normalPhi,
|
|
1110
|
+
samples: properties.samples,
|
|
1111
|
+
},
|
|
1112
|
+
});
|
|
1113
|
+
}
|
|
1114
|
+
break;
|
|
1115
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.SCANLINE:
|
|
1116
|
+
{
|
|
1117
|
+
const definition = this
|
|
1118
|
+
._effectDefinitions[i]
|
|
1119
|
+
.definition;
|
|
1120
|
+
const properties = definition.properties || {};
|
|
1121
|
+
effects.push({
|
|
1122
|
+
type: viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.SCANLINE,
|
|
1123
|
+
token: this._effectDefinitions[i].token,
|
|
1124
|
+
properties: {
|
|
1125
|
+
blendFunction: properties.blendFunction,
|
|
1126
|
+
density: properties.density,
|
|
1127
|
+
},
|
|
1128
|
+
});
|
|
1129
|
+
}
|
|
1130
|
+
break;
|
|
1131
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.SEPIA:
|
|
1132
|
+
{
|
|
1133
|
+
const definition = this
|
|
1134
|
+
._effectDefinitions[i]
|
|
1135
|
+
.definition;
|
|
1136
|
+
const properties = definition.properties || {};
|
|
1137
|
+
effects.push({
|
|
1138
|
+
type: viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.SEPIA,
|
|
1139
|
+
token: this._effectDefinitions[i].token,
|
|
1140
|
+
properties: {
|
|
1141
|
+
blendFunction: properties.blendFunction,
|
|
1142
|
+
},
|
|
1143
|
+
});
|
|
1144
|
+
}
|
|
1145
|
+
break;
|
|
1146
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.TILT_SHIFT:
|
|
1147
|
+
{
|
|
1148
|
+
const definition = this
|
|
1149
|
+
._effectDefinitions[i]
|
|
1150
|
+
.definition;
|
|
1151
|
+
const properties = definition.properties || {};
|
|
1152
|
+
effects.push({
|
|
1153
|
+
type: viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.TILT_SHIFT,
|
|
1154
|
+
token: this._effectDefinitions[i].token,
|
|
1155
|
+
properties: {
|
|
1156
|
+
blendFunction: properties.blendFunction,
|
|
1157
|
+
offset: properties.offset,
|
|
1158
|
+
rotation: properties.rotation,
|
|
1159
|
+
focusArea: properties.focusArea,
|
|
1160
|
+
feather: properties.feather,
|
|
1161
|
+
kernelSize: properties.kernelSize,
|
|
1162
|
+
},
|
|
1163
|
+
});
|
|
1164
|
+
}
|
|
1165
|
+
break;
|
|
1166
|
+
case viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.VIGNETTE:
|
|
1167
|
+
{
|
|
1168
|
+
const definition = this
|
|
1169
|
+
._effectDefinitions[i]
|
|
1170
|
+
.definition;
|
|
1171
|
+
const properties = definition.properties || {};
|
|
1172
|
+
effects.push({
|
|
1173
|
+
type: viewer_shared_types_1.POST_PROCESSING_EFFECT_TYPE.VIGNETTE,
|
|
1174
|
+
token: this._effectDefinitions[i].token,
|
|
1175
|
+
properties: {
|
|
1176
|
+
blendFunction: properties.blendFunction,
|
|
1177
|
+
technique: properties.technique,
|
|
1178
|
+
offset: properties.offset,
|
|
1179
|
+
darkness: properties.darkness,
|
|
1180
|
+
},
|
|
1181
|
+
});
|
|
1182
|
+
}
|
|
1183
|
+
break;
|
|
1184
|
+
default:
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
return effects;
|
|
1188
|
+
}
|
|
1189
|
+
init() {
|
|
1190
|
+
postprocessing_1.OverrideMaterialManager.workaroundEnabled = true;
|
|
1191
|
+
const initComposer = () => {
|
|
1192
|
+
this._composer = new postprocessing_1.EffectComposer(this._renderingEngine.renderer);
|
|
1193
|
+
// EffectComposer disables autoClear, we enable/disable this in the postprocessing render loop
|
|
1194
|
+
this._renderingEngine.renderer.autoClear = true;
|
|
1195
|
+
// create anti-aliasing effects and passes
|
|
1196
|
+
this._fxaaEffect = new postprocessing_1.FXAAEffect();
|
|
1197
|
+
this._smaaEffect = new postprocessing_1.SMAAEffect({ preset: postprocessing_1.SMAAPreset.ULTRA });
|
|
1198
|
+
this._renderPass = new postprocessing_1.RenderPass(this._renderingEngine.scene, this._renderingEngine.camera);
|
|
1199
|
+
this._ssaaRenderPass = new SSAARenderPass_1.SSAARenderPass(this._renderingEngine.scene, this._renderingEngine.camera);
|
|
1200
|
+
};
|
|
1201
|
+
if (this._sceneExtents === 0) {
|
|
1202
|
+
const token = this._eventEngine.addListener(viewer_shared_services_1.EVENTTYPE.SCENE.SCENE_BOUNDING_BOX_CHANGE, (e) => __awaiter(this, void 0, void 0, function* () {
|
|
1203
|
+
const viewerEvent = e;
|
|
1204
|
+
if (viewerEvent.viewportId === this._renderingEngine.id) {
|
|
1205
|
+
if (gl_matrix_1.vec3.distance(viewerEvent.boundingBox.min, viewerEvent.boundingBox.max) > 0) {
|
|
1206
|
+
initComposer();
|
|
1207
|
+
this.changeEffectPass();
|
|
1208
|
+
this._eventEngine.removeListener(token);
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
}));
|
|
1212
|
+
}
|
|
1213
|
+
else {
|
|
1214
|
+
initComposer();
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
removeEffect(token) {
|
|
1218
|
+
const effectToRemove = this._effectDefinitions.find((e) => e.token === token);
|
|
1219
|
+
if (effectToRemove)
|
|
1220
|
+
this._effectDefinitions.splice(this._effectDefinitions.indexOf(effectToRemove), 1);
|
|
1221
|
+
if (this._godRaysManagers[token])
|
|
1222
|
+
delete this._godRaysManagers[token];
|
|
1223
|
+
if (this._outlineManagers[token]) {
|
|
1224
|
+
this._outlineManagers[token].clearSelection();
|
|
1225
|
+
delete this._outlineManagers[token];
|
|
1226
|
+
}
|
|
1227
|
+
if (this._selectiveBloomManagers[token]) {
|
|
1228
|
+
this._selectiveBloomManagers[token].clearSelection();
|
|
1229
|
+
delete this._selectiveBloomManagers[token];
|
|
1230
|
+
}
|
|
1231
|
+
this.changeEffectPass();
|
|
1232
|
+
return true;
|
|
1233
|
+
}
|
|
1234
|
+
render(deltaTime, camera) {
|
|
1235
|
+
if (!this._composer)
|
|
1236
|
+
return;
|
|
1237
|
+
const cameraId = `${camera.id}_${camera.type}${camera.type === "PerspectiveCamera" ? "" : "_" + camera.up.toArray().toString()}`;
|
|
1238
|
+
if (cameraId !== this._currentCameraId) {
|
|
1239
|
+
this._currentCameraId = cameraId;
|
|
1240
|
+
this.changeEffectPass();
|
|
1241
|
+
}
|
|
1242
|
+
const currentToneMapping = this._renderingEngine.renderer.toneMapping;
|
|
1243
|
+
const currentClearColor = this._renderingEngine.renderer.getClearColor(new THREE.Color());
|
|
1244
|
+
const convertedClearColor = currentClearColor
|
|
1245
|
+
.clone()
|
|
1246
|
+
.convertSRGBToLinear();
|
|
1247
|
+
this._renderingEngine.renderer.toneMapping = THREE.NoToneMapping;
|
|
1248
|
+
this._renderingEngine.renderer.setClearColor(convertedClearColor);
|
|
1249
|
+
this._renderingEngine.renderer.setClearAlpha(this._renderingEngine.clearAlpha);
|
|
1250
|
+
this._renderingEngine.renderer.autoClear = false;
|
|
1251
|
+
this._composer.setMainCamera(camera);
|
|
1252
|
+
this._composer.render();
|
|
1253
|
+
this._renderingEngine.renderer.toneMapping = currentToneMapping;
|
|
1254
|
+
this._renderingEngine.renderer.autoClear = true;
|
|
1255
|
+
this._renderingEngine.renderer.setClearColor(currentClearColor);
|
|
1256
|
+
}
|
|
1257
|
+
resize(width, height) {
|
|
1258
|
+
var _a;
|
|
1259
|
+
if (!this._composer)
|
|
1260
|
+
return;
|
|
1261
|
+
this.effects.forEach((e) => {
|
|
1262
|
+
if (e.effect.setSize)
|
|
1263
|
+
e.effect.setSize(width, height);
|
|
1264
|
+
});
|
|
1265
|
+
this._renderPass.setSize(width, height);
|
|
1266
|
+
this._ssaaRenderPass.setSize(width, height);
|
|
1267
|
+
(_a = this._effectPasses) === null || _a === void 0 ? void 0 : _a.forEach((pass) => pass.setSize(width, height));
|
|
1268
|
+
this._composer.setSize(width, height);
|
|
1269
|
+
}
|
|
1270
|
+
saveSettings(settingsEngine) {
|
|
1271
|
+
settingsEngine.settings.postprocessing.antiAliasingTechnique =
|
|
1272
|
+
this.antiAliasingTechnique;
|
|
1273
|
+
settingsEngine.settings.postprocessing.antiAliasingTechniqueMobile =
|
|
1274
|
+
this.antiAliasingTechniqueMobile;
|
|
1275
|
+
settingsEngine.settings.postprocessing.enablePostProcessingOnMobile =
|
|
1276
|
+
this.enablePostProcessingOnMobile;
|
|
1277
|
+
settingsEngine.settings.postprocessing.ssaaSampleLevel =
|
|
1278
|
+
this.ssaaSampleLevel;
|
|
1279
|
+
const effects = this.getPostProcessingEffectsArray();
|
|
1280
|
+
// delete the tokens as we don't want to save them
|
|
1281
|
+
effects.forEach((e) => delete e.token);
|
|
1282
|
+
settingsEngine.settings.postprocessing.effects = effects;
|
|
1283
|
+
}
|
|
1284
|
+
updateEffect(token, definition) {
|
|
1285
|
+
const effectDefinition = this._effectDefinitions.find((e) => e.token === token);
|
|
1286
|
+
if (!effectDefinition)
|
|
1287
|
+
return;
|
|
1288
|
+
this.removeEffect(token);
|
|
1289
|
+
this.addEffect(definition, token);
|
|
1290
|
+
}
|
|
1291
|
+
// #endregion Public Methods (13)
|
|
1292
|
+
// #region Private Methods (1)
|
|
1293
|
+
addPassToEffectComposer(pass) {
|
|
1294
|
+
if (this._composer) {
|
|
1295
|
+
try {
|
|
1296
|
+
this._composer.addPass(pass);
|
|
1297
|
+
}
|
|
1298
|
+
catch (e) {
|
|
1299
|
+
// in this case a WebGL error is thrown, when the WebGL context is lost
|
|
1300
|
+
// as we already throw an error in the rendering engine, we can ignore this error here
|
|
1301
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getContextAttributes
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
exports.PostProcessingManager = PostProcessingManager;
|
|
1297
1307
|
//# sourceMappingURL=PostProcessingManager.js.map
|