viral-viewer-2 5.9.3 → 5.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/components/camera/viral-camera.d.ts +1 -1
  2. package/dist/components/compress/compress.processor.d.ts +4 -0
  3. package/dist/components/compress/compress.processor.js +29 -0
  4. package/dist/components/compress/compress.processor.js.map +1 -0
  5. package/dist/components/loader/viral-three.loader.d.ts +1 -1
  6. package/dist/components/loader/viral-viewer-point-cloud.loader.d.ts +16 -0
  7. package/dist/components/loader/viral-viewer-point-cloud.loader.js +33 -0
  8. package/dist/components/loader/viral-viewer-point-cloud.loader.js.map +1 -0
  9. package/dist/components/loader/viral-viewer-revit.loader.d.ts +13 -0
  10. package/dist/components/loader/viral-viewer-revit.loader.js +124 -0
  11. package/dist/components/loader/viral-viewer-revit.loader.js.map +1 -0
  12. package/dist/components/post-processing/ambient-occlusion-effect.d.ts +2 -0
  13. package/dist/components/post-processing/ambient-occlusion-effect.js +2 -1
  14. package/dist/components/post-processing/ambient-occlusion-effect.js.map +1 -1
  15. package/dist/components/scene/viral-scene.d.ts +1 -1
  16. package/dist/components/worker/load-model.d.ts +126 -0
  17. package/dist/components/worker/load-model.js +1265 -0
  18. package/dist/components/worker/load-model.js.map +1 -0
  19. package/dist/components/worker/test-worker-pool.d.ts +6 -0
  20. package/dist/components/worker/test-worker-pool.js +21 -0
  21. package/dist/components/worker/test-worker-pool.js.map +1 -0
  22. package/dist/components/worker/viral-viewer-4.worker.js +3 -1
  23. package/dist/components/worker/viral-viewer-4.worker.js.map +1 -1
  24. package/dist/components/worker/viral-viewer.worker-pool.d.ts +0 -0
  25. package/dist/components/worker/viral-viewer.worker-pool.js +61 -0
  26. package/dist/components/worker/viral-viewer.worker-pool.js.map +1 -0
  27. package/dist/components/worker/worker-pool.d.ts +21 -0
  28. package/dist/components/worker/worker-pool.js +47 -0
  29. package/dist/components/worker/worker-pool.js.map +1 -0
  30. package/dist/components/worker/worker-thread.d.ts +9 -0
  31. package/dist/components/worker/worker-thread.js +30 -0
  32. package/dist/components/worker/worker-thread.js.map +1 -0
  33. package/dist/components/worker-script/test-worker-pool.script.d.ts +1 -0
  34. package/dist/components/worker-script/test-worker-pool.script.js +12 -0
  35. package/dist/components/worker-script/test-worker-pool.script.js.map +1 -0
  36. package/dist/models/dictionary.model.d.ts +10 -0
  37. package/dist/models/dictionary.model.js +41 -0
  38. package/dist/models/dictionary.model.js.map +1 -1
  39. package/dist/threejs-addon/gltf-loader.d.ts +1 -1
  40. package/dist/threejs-addon/n8ao/n8ao.d.ts +8 -8
  41. package/dist/threejs-addon/n8ao/post-processing.d.ts +1534 -3919
  42. package/dist/threejs-addon/post-processing/outline-pass.d.ts +7 -7
  43. package/dist/threejs-addon/post-processing/pass.d.ts +1 -1
  44. package/dist/threejs-addon/post-processing/sao-pass.d.ts +5 -5
  45. package/dist/threejs-addon/post-processing/unreal-bloom-pass.d.ts +3 -3
  46. package/dist/threejs-addon/transform-control.d.ts +3 -3
  47. package/package.json +1 -1
  48. package/dist/components/post-processing/viral-post-processing.d.ts +0 -11
  49. package/dist/components/post-processing/viral-post-processing.js +0 -29
  50. package/dist/components/post-processing/viral-post-processing.js.map +0 -1
  51. package/dist/threejs-addon/post-processing/ssaa-render-pass.d.ts +0 -30
  52. package/dist/threejs-addon/post-processing/ssaa-render-pass.js +0 -202
  53. package/dist/threejs-addon/post-processing/ssaa-render-pass.js.map +0 -1
  54. package/dist/threejs-addon/shaders/color-correction-shader.d.ts +0 -22
  55. package/dist/threejs-addon/shaders/color-correction-shader.js +0 -43
  56. package/dist/threejs-addon/shaders/color-correction-shader.js.map +0 -1
  57. package/dist/threejs-addon/shaders/fxaa-shader.d.ts +0 -14
  58. package/dist/threejs-addon/shaders/fxaa-shader.js +0 -279
  59. package/dist/threejs-addon/shaders/fxaa-shader.js.map +0 -1
@@ -1,279 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FXAAShader = void 0;
4
- const three_1 = require("three");
5
- /**
6
- * NVIDIA FXAA by Timothy Lottes
7
- * https://developer.download.nvidia.com/assets/gamedev/files/sdk/11/FXAA_WhitePaper.pdf
8
- * - WebGL port by @supereggbert
9
- * http://www.glge.org/demos/fxaa/
10
- * Further improved by Daniel Sturk
11
- */
12
- const FXAAShader = {
13
- uniforms: {
14
- 'tDiffuse': { value: null },
15
- 'resolution': { value: new three_1.Vector2(1 / 1024, 1 / 512) }
16
- },
17
- vertexShader: /* glsl */ `
18
-
19
- varying vec2 vUv;
20
-
21
- void main() {
22
-
23
- vUv = uv;
24
- gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
25
-
26
- }`,
27
- fragmentShader: `
28
- precision highp float;
29
-
30
- uniform sampler2D tDiffuse;
31
-
32
- uniform vec2 resolution;
33
-
34
- varying vec2 vUv;
35
-
36
- // FXAA 3.11 implementation by NVIDIA, ported to WebGL by Agost Biro (biro@archilogic.com)
37
-
38
- //----------------------------------------------------------------------------------
39
- // File: es3-kepler\FXAA\assets\shaders/FXAA_DefaultES.frag
40
- // SDK Version: v3.00
41
- // Email: gameworks@nvidia.com
42
- // Site: http://developer.nvidia.com/
43
- //
44
- // Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
45
- //
46
- // Redistribution and use in source and binary forms, with or without
47
- // modification, are permitted provided that the following conditions
48
- // are met:
49
- // * Redistributions of source code must retain the above copyright
50
- // notice, this list of conditions and the following disclaimer.
51
- // * Redistributions in binary form must reproduce the above copyright
52
- // notice, this list of conditions and the following disclaimer in the
53
- // documentation and/or other materials provided with the distribution.
54
- // * Neither the name of NVIDIA CORPORATION nor the names of its
55
- // contributors may be used to endorse or promote products derived
56
- // from this software without specific prior written permission.
57
- //
58
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
59
- // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
60
- // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
61
- // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
62
- // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
63
- // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
64
- // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
65
- // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
66
- // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
67
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
68
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
69
- //
70
- //----------------------------------------------------------------------------------
71
-
72
- #ifndef FXAA_DISCARD
73
- //
74
- // Only valid for PC OpenGL currently.
75
- // Probably will not work when FXAA_GREEN_AS_LUMA = 1.
76
- //
77
- // 1 = Use discard on pixels which don't need AA.
78
- // For APIs which enable concurrent TEX+ROP from same surface.
79
- // 0 = Return unchanged color on pixels which don't need AA.
80
- //
81
- #define FXAA_DISCARD 0
82
- #endif
83
-
84
- /*--------------------------------------------------------------------------*/
85
- #define FxaaTexTop(t, p) texture2D(t, p, -100.0)
86
- #define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r), -100.0)
87
- /*--------------------------------------------------------------------------*/
88
-
89
- #define NUM_SAMPLES 5
90
-
91
- // assumes colors have premultipliedAlpha, so that the calculated color contrast is scaled by alpha
92
- float contrast( vec4 a, vec4 b ) {
93
- vec4 diff = abs( a - b );
94
- return max( max( max( diff.r, diff.g ), diff.b ), diff.a );
95
- }
96
-
97
- /*============================================================================
98
-
99
- FXAA3 QUALITY - PC
100
-
101
- ============================================================================*/
102
-
103
- /*--------------------------------------------------------------------------*/
104
- vec4 FxaaPixelShader(
105
- vec2 posM,
106
- sampler2D tex,
107
- vec2 fxaaQualityRcpFrame,
108
- float fxaaQualityEdgeThreshold,
109
- float fxaaQualityinvEdgeThreshold
110
- ) {
111
- vec4 rgbaM = FxaaTexTop(tex, posM);
112
- vec4 rgbaS = FxaaTexOff(tex, posM, vec2( 0.0, 1.0), fxaaQualityRcpFrame.xy);
113
- vec4 rgbaE = FxaaTexOff(tex, posM, vec2( 1.0, 0.0), fxaaQualityRcpFrame.xy);
114
- vec4 rgbaN = FxaaTexOff(tex, posM, vec2( 0.0,-1.0), fxaaQualityRcpFrame.xy);
115
- vec4 rgbaW = FxaaTexOff(tex, posM, vec2(-1.0, 0.0), fxaaQualityRcpFrame.xy);
116
- // . S .
117
- // W M E
118
- // . N .
119
-
120
- bool earlyExit = max( max( max(
121
- contrast( rgbaM, rgbaN ),
122
- contrast( rgbaM, rgbaS ) ),
123
- contrast( rgbaM, rgbaE ) ),
124
- contrast( rgbaM, rgbaW ) )
125
- < fxaaQualityEdgeThreshold;
126
- // . 0 .
127
- // 0 0 0
128
- // . 0 .
129
-
130
- #if (FXAA_DISCARD == 1)
131
- if(earlyExit) FxaaDiscard;
132
- #else
133
- if(earlyExit) return rgbaM;
134
- #endif
135
-
136
- float contrastN = contrast( rgbaM, rgbaN );
137
- float contrastS = contrast( rgbaM, rgbaS );
138
- float contrastE = contrast( rgbaM, rgbaE );
139
- float contrastW = contrast( rgbaM, rgbaW );
140
-
141
- float relativeVContrast = ( contrastN + contrastS ) - ( contrastE + contrastW );
142
- relativeVContrast *= fxaaQualityinvEdgeThreshold;
143
-
144
- bool horzSpan = relativeVContrast > 0.;
145
- // . 1 .
146
- // 0 0 0
147
- // . 1 .
148
-
149
- // 45 deg edge detection and corners of objects, aka V/H contrast is too similar
150
- if( abs( relativeVContrast ) < .3 ) {
151
- // locate the edge
152
- vec2 dirToEdge;
153
- dirToEdge.x = contrastE > contrastW ? 1. : -1.;
154
- dirToEdge.y = contrastS > contrastN ? 1. : -1.;
155
- // . 2 . . 1 .
156
- // 1 0 2 ~= 0 0 1
157
- // . 1 . . 0 .
158
-
159
- // tap 2 pixels and see which ones are "outside" the edge, to
160
- // determine if the edge is vertical or horizontal
161
-
162
- vec4 rgbaAlongH = FxaaTexOff(tex, posM, vec2( dirToEdge.x, -dirToEdge.y ), fxaaQualityRcpFrame.xy);
163
- float matchAlongH = contrast( rgbaM, rgbaAlongH );
164
- // . 1 .
165
- // 0 0 1
166
- // . 0 H
167
-
168
- vec4 rgbaAlongV = FxaaTexOff(tex, posM, vec2( -dirToEdge.x, dirToEdge.y ), fxaaQualityRcpFrame.xy);
169
- float matchAlongV = contrast( rgbaM, rgbaAlongV );
170
- // V 1 .
171
- // 0 0 1
172
- // . 0 .
173
-
174
- relativeVContrast = matchAlongV - matchAlongH;
175
- relativeVContrast *= fxaaQualityinvEdgeThreshold;
176
-
177
- if( abs( relativeVContrast ) < .3 ) { // 45 deg edge
178
- // 1 1 .
179
- // 0 0 1
180
- // . 0 1
181
-
182
- // do a simple blur
183
- return mix(
184
- rgbaM,
185
- (rgbaN + rgbaS + rgbaE + rgbaW) * .25,
186
- .4
187
- );
188
- }
189
-
190
- horzSpan = relativeVContrast > 0.;
191
- }
192
-
193
- if(!horzSpan) rgbaN = rgbaW;
194
- if(!horzSpan) rgbaS = rgbaE;
195
- // . 0 . 1
196
- // 1 0 1 -> 0
197
- // . 0 . 1
198
-
199
- bool pairN = contrast( rgbaM, rgbaN ) > contrast( rgbaM, rgbaS );
200
- if(!pairN) rgbaN = rgbaS;
201
-
202
- vec2 offNP;
203
- offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;
204
- offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;
205
-
206
- bool doneN = false;
207
- bool doneP = false;
208
-
209
- float nDist = 0.;
210
- float pDist = 0.;
211
-
212
- vec2 posN = posM;
213
- vec2 posP = posM;
214
-
215
- int iterationsUsed = 0;
216
- int iterationsUsedN = 0;
217
- int iterationsUsedP = 0;
218
- for( int i = 0; i < NUM_SAMPLES; i++ ) {
219
- iterationsUsed = i;
220
-
221
- float increment = float(i + 1);
222
-
223
- if(!doneN) {
224
- nDist += increment;
225
- posN = posM + offNP * nDist;
226
- vec4 rgbaEndN = FxaaTexTop(tex, posN.xy);
227
- doneN = contrast( rgbaEndN, rgbaM ) > contrast( rgbaEndN, rgbaN );
228
- iterationsUsedN = i;
229
- }
230
-
231
- if(!doneP) {
232
- pDist += increment;
233
- posP = posM - offNP * pDist;
234
- vec4 rgbaEndP = FxaaTexTop(tex, posP.xy);
235
- doneP = contrast( rgbaEndP, rgbaM ) > contrast( rgbaEndP, rgbaN );
236
- iterationsUsedP = i;
237
- }
238
-
239
- if(doneN || doneP) break;
240
- }
241
-
242
-
243
- if ( !doneP && !doneN ) return rgbaM; // failed to find end of edge
244
-
245
- float dist = min(
246
- doneN ? float( iterationsUsedN ) / float( NUM_SAMPLES - 1 ) : 1.,
247
- doneP ? float( iterationsUsedP ) / float( NUM_SAMPLES - 1 ) : 1.
248
- );
249
-
250
- // hacky way of reduces blurriness of mostly diagonal edges
251
- // but reduces AA quality
252
- dist = pow(dist, .5);
253
-
254
- dist = 1. - dist;
255
-
256
- return mix(
257
- rgbaM,
258
- rgbaN,
259
- dist * .5
260
- );
261
- }
262
-
263
- void main() {
264
- const float edgeDetectionQuality = .2;
265
- const float invEdgeDetectionQuality = 1. / edgeDetectionQuality;
266
-
267
- gl_FragColor = FxaaPixelShader(
268
- vUv,
269
- tDiffuse,
270
- resolution,
271
- edgeDetectionQuality, // [0,1] contrast needed, otherwise early discard
272
- invEdgeDetectionQuality
273
- );
274
-
275
- }
276
- `
277
- };
278
- exports.FXAAShader = FXAAShader;
279
- //# sourceMappingURL=fxaa-shader.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fxaa-shader.js","sourceRoot":"","sources":["../../../src/threejs-addon/shaders/fxaa-shader.js"],"names":[],"mappings":";;;AAAA,iCAEe;AAEf;;;;;;GAMG;AAEH,MAAM,UAAU,GAAG;IAEf,QAAQ,EAAE;QAEN,UAAU,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;QAC3B,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,eAAO,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,GAAG,CAAC,EAAE;KAE1D;IAED,YAAY,EAAE,UAAU,CAAC;;;;;;;;;IASzB;IAEA,cAAc,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyPlB;CAED,CAAC;AAEO,gCAAU"}