viral-viewer-2 2.6.0 → 2.6.2

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 (35) hide show
  1. package/LICENSE +57 -57
  2. package/dist/components/spinner/viral-spinner.js +159 -159
  3. package/dist/components/worker/base/worker-pool.d.ts +21 -0
  4. package/dist/components/worker/base/worker-pool.js +47 -0
  5. package/dist/components/worker/base/worker-pool.js.map +1 -0
  6. package/dist/components/worker/base/worker-thread.d.ts +9 -0
  7. package/dist/components/worker/base/worker-thread.js +30 -0
  8. package/dist/components/worker/base/worker-thread.js.map +1 -0
  9. package/dist/components/worker/test-worker.worker.d.ts +6 -0
  10. package/dist/components/worker/test-worker.worker.js +21 -0
  11. package/dist/components/worker/test-worker.worker.js.map +1 -0
  12. package/dist/components/worker/viral-viewer-2.worker.d.ts +1 -1
  13. package/dist/components/worker/viral-viewer-2.worker.js +9 -6
  14. package/dist/components/worker/viral-viewer-2.worker.js.map +1 -1
  15. package/dist/components/worker-script/load-model-worker-2.script.js.map +1 -1
  16. package/dist/components/worker-script/threejs.script.d.ts +1 -0
  17. package/dist/components/worker-script/threejs.script.js +23 -0
  18. package/dist/components/worker-script/threejs.script.js.map +1 -0
  19. package/dist/components/worker-script/threejs.types.js +292 -292
  20. package/dist/viral-viewer-api.d.ts +2 -0
  21. package/dist/viral-viewer-api.js +3 -0
  22. package/dist/viral-viewer-api.js.map +1 -1
  23. package/package.json +29 -29
  24. package/dist/components/worker/load-model.d.ts +0 -126
  25. package/dist/components/worker/load-model.js +0 -1265
  26. package/dist/components/worker/load-model.js.map +0 -1
  27. package/dist/components/worker/test-worker-pool.d.ts +0 -6
  28. package/dist/components/worker/test-worker-pool.js +0 -21
  29. package/dist/components/worker/test-worker-pool.js.map +0 -1
  30. package/dist/components/worker-script/load-model-worker-3.script.d.ts +0 -0
  31. package/dist/components/worker-script/load-model-worker-3.script.js +0 -170
  32. package/dist/components/worker-script/load-model-worker-3.script.js.map +0 -1
  33. package/dist/components/worker-script/test-worker-pool.script.d.ts +0 -1
  34. package/dist/components/worker-script/test-worker-pool.script.js +0 -12
  35. package/dist/components/worker-script/test-worker-pool.script.js.map +0 -1
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.workerCode = void 0;
13
+ function workerFunction() {
14
+ return __awaiter(this, void 0, void 0, function* () {
15
+ const THREE = yield Promise.resolve().then(() => require('../../threejs-addon/simplify-modifier'));
16
+ let modifier = new THREE.SimplifyModifier();
17
+ self.addEventListener("message", (event) => {
18
+ console.log(modifier);
19
+ }, false);
20
+ });
21
+ }
22
+ exports.workerCode = workerFunction;
23
+ //# sourceMappingURL=threejs.script.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"threejs.script.js","sourceRoot":"","sources":["../../../src/components/worker-script/threejs.script.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,SAAe,cAAc;;QACzB,MAAM,KAAK,GAAG,2CAAa,uCAAuC,EAAC,CAAC;QACpE,IAAI,QAAQ,GAAG,IAAI,KAAK,CAAC,gBAAgB,EAAE,CAAC;QAE5C,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,KAAwB,EAAE,EAAE;YAC1D,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QACzB,CAAC,EACG,KAAK,CACR,CAAC;IACN,CAAC;CAAA;AACY,QAAA,UAAU,GAAwB,cAAc,CAAC"}
@@ -7696,42 +7696,42 @@ function workerFunction() {
7696
7696
  uniforms: {
7697
7697
  tEquirect: { value: null },
7698
7698
  },
7699
- vertexShader: /* glsl */ `
7700
-
7701
- varying vec3 vWorldDirection;
7702
-
7703
- vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
7704
-
7705
- return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
7706
-
7707
- }
7708
-
7709
- void main() {
7710
-
7711
- vWorldDirection = transformDirection( position, modelMatrix );
7712
-
7713
- #include <begin_vertex>
7714
- #include <project_vertex>
7715
-
7716
- }
7699
+ vertexShader: /* glsl */ `
7700
+
7701
+ varying vec3 vWorldDirection;
7702
+
7703
+ vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
7704
+
7705
+ return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
7706
+
7707
+ }
7708
+
7709
+ void main() {
7710
+
7711
+ vWorldDirection = transformDirection( position, modelMatrix );
7712
+
7713
+ #include <begin_vertex>
7714
+ #include <project_vertex>
7715
+
7716
+ }
7717
7717
  `,
7718
- fragmentShader: /* glsl */ `
7719
-
7720
- uniform sampler2D tEquirect;
7721
-
7722
- varying vec3 vWorldDirection;
7723
-
7724
- #include <common>
7725
-
7726
- void main() {
7727
-
7728
- vec3 direction = normalize( vWorldDirection );
7729
-
7730
- vec2 sampleUV = equirectUv( direction );
7731
-
7732
- gl_FragColor = texture2D( tEquirect, sampleUV );
7733
-
7734
- }
7718
+ fragmentShader: /* glsl */ `
7719
+
7720
+ uniform sampler2D tEquirect;
7721
+
7722
+ varying vec3 vWorldDirection;
7723
+
7724
+ #include <common>
7725
+
7726
+ void main() {
7727
+
7728
+ vec3 direction = normalize( vWorldDirection );
7729
+
7730
+ vec2 sampleUV = equirectUv( direction );
7731
+
7732
+ gl_FragColor = texture2D( tEquirect, sampleUV );
7733
+
7734
+ }
7735
7735
  `,
7736
7736
  };
7737
7737
  const geometry = new BoxGeometry(5, 5, 5);
@@ -10158,70 +10158,70 @@ function workerFunction() {
10158
10158
  outputEncoding: { value: ENCODINGS[LinearEncoding] },
10159
10159
  },
10160
10160
  vertexShader: _getCommonVertexShader(),
10161
- fragmentShader: /* glsl */ `
10162
-
10163
- precision mediump float;
10164
- precision mediump int;
10165
-
10166
- varying vec3 vOutputDirection;
10167
-
10168
- uniform sampler2D envMap;
10169
- uniform int samples;
10170
- uniform float weights[ n ];
10171
- uniform bool latitudinal;
10172
- uniform float dTheta;
10173
- uniform float mipInt;
10174
- uniform vec3 poleAxis;
10175
-
10176
- ${_getEncodings()}
10177
-
10178
- #define ENVMAP_TYPE_CUBE_UV
10179
- #include <cube_uv_reflection_fragment>
10180
-
10181
- vec3 getSample( float theta, vec3 axis ) {
10182
-
10183
- float cosTheta = cos( theta );
10184
- // Rodrigues' axis-angle rotation
10185
- vec3 sampleDirection = vOutputDirection * cosTheta
10186
- + cross( axis, vOutputDirection ) * sin( theta )
10187
- + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );
10188
-
10189
- return bilinearCubeUV( envMap, sampleDirection, mipInt );
10190
-
10191
- }
10192
-
10193
- void main() {
10194
-
10195
- vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );
10196
-
10197
- if ( all( equal( axis, vec3( 0.0 ) ) ) ) {
10198
-
10199
- axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );
10200
-
10201
- }
10202
-
10203
- axis = normalize( axis );
10204
-
10205
- gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
10206
- gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );
10207
-
10208
- for ( int i = 1; i < n; i++ ) {
10209
-
10210
- if ( i >= samples ) {
10211
-
10212
- break;
10213
-
10214
- }
10215
-
10216
- float theta = dTheta * float( i );
10217
- gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
10218
- gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );
10219
-
10220
- }
10221
-
10222
- gl_FragColor = linearToOutputTexel( gl_FragColor );
10223
-
10224
- }
10161
+ fragmentShader: /* glsl */ `
10162
+
10163
+ precision mediump float;
10164
+ precision mediump int;
10165
+
10166
+ varying vec3 vOutputDirection;
10167
+
10168
+ uniform sampler2D envMap;
10169
+ uniform int samples;
10170
+ uniform float weights[ n ];
10171
+ uniform bool latitudinal;
10172
+ uniform float dTheta;
10173
+ uniform float mipInt;
10174
+ uniform vec3 poleAxis;
10175
+
10176
+ ${_getEncodings()}
10177
+
10178
+ #define ENVMAP_TYPE_CUBE_UV
10179
+ #include <cube_uv_reflection_fragment>
10180
+
10181
+ vec3 getSample( float theta, vec3 axis ) {
10182
+
10183
+ float cosTheta = cos( theta );
10184
+ // Rodrigues' axis-angle rotation
10185
+ vec3 sampleDirection = vOutputDirection * cosTheta
10186
+ + cross( axis, vOutputDirection ) * sin( theta )
10187
+ + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );
10188
+
10189
+ return bilinearCubeUV( envMap, sampleDirection, mipInt );
10190
+
10191
+ }
10192
+
10193
+ void main() {
10194
+
10195
+ vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );
10196
+
10197
+ if ( all( equal( axis, vec3( 0.0 ) ) ) ) {
10198
+
10199
+ axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );
10200
+
10201
+ }
10202
+
10203
+ axis = normalize( axis );
10204
+
10205
+ gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
10206
+ gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );
10207
+
10208
+ for ( int i = 1; i < n; i++ ) {
10209
+
10210
+ if ( i >= samples ) {
10211
+
10212
+ break;
10213
+
10214
+ }
10215
+
10216
+ float theta = dTheta * float( i );
10217
+ gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
10218
+ gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );
10219
+
10220
+ }
10221
+
10222
+ gl_FragColor = linearToOutputTexel( gl_FragColor );
10223
+
10224
+ }
10225
10225
  `,
10226
10226
  blending: NoBlending,
10227
10227
  depthTest: false,
@@ -10240,44 +10240,44 @@ function workerFunction() {
10240
10240
  outputEncoding: { value: ENCODINGS[LinearEncoding] },
10241
10241
  },
10242
10242
  vertexShader: _getCommonVertexShader(),
10243
- fragmentShader: /* glsl */ `
10244
-
10245
- precision mediump float;
10246
- precision mediump int;
10247
-
10248
- varying vec3 vOutputDirection;
10249
-
10250
- uniform sampler2D envMap;
10251
- uniform vec2 texelSize;
10252
-
10253
- ${_getEncodings()}
10254
-
10255
- #include <common>
10256
-
10257
- void main() {
10258
-
10259
- gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
10260
-
10261
- vec3 outputDirection = normalize( vOutputDirection );
10262
- vec2 uv = equirectUv( outputDirection );
10263
-
10264
- vec2 f = fract( uv / texelSize - 0.5 );
10265
- uv -= f * texelSize;
10266
- vec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;
10267
- uv.x += texelSize.x;
10268
- vec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;
10269
- uv.y += texelSize.y;
10270
- vec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;
10271
- uv.x -= texelSize.x;
10272
- vec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;
10273
-
10274
- vec3 tm = mix( tl, tr, f.x );
10275
- vec3 bm = mix( bl, br, f.x );
10276
- gl_FragColor.rgb = mix( tm, bm, f.y );
10277
-
10278
- gl_FragColor = linearToOutputTexel( gl_FragColor );
10279
-
10280
- }
10243
+ fragmentShader: /* glsl */ `
10244
+
10245
+ precision mediump float;
10246
+ precision mediump int;
10247
+
10248
+ varying vec3 vOutputDirection;
10249
+
10250
+ uniform sampler2D envMap;
10251
+ uniform vec2 texelSize;
10252
+
10253
+ ${_getEncodings()}
10254
+
10255
+ #include <common>
10256
+
10257
+ void main() {
10258
+
10259
+ gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
10260
+
10261
+ vec3 outputDirection = normalize( vOutputDirection );
10262
+ vec2 uv = equirectUv( outputDirection );
10263
+
10264
+ vec2 f = fract( uv / texelSize - 0.5 );
10265
+ uv -= f * texelSize;
10266
+ vec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;
10267
+ uv.x += texelSize.x;
10268
+ vec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;
10269
+ uv.y += texelSize.y;
10270
+ vec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;
10271
+ uv.x -= texelSize.x;
10272
+ vec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;
10273
+
10274
+ vec3 tm = mix( tl, tr, f.x );
10275
+ vec3 bm = mix( bl, br, f.x );
10276
+ gl_FragColor.rgb = mix( tm, bm, f.y );
10277
+
10278
+ gl_FragColor = linearToOutputTexel( gl_FragColor );
10279
+
10280
+ }
10281
10281
  `,
10282
10282
  blending: NoBlending,
10283
10283
  depthTest: false,
@@ -10294,24 +10294,24 @@ function workerFunction() {
10294
10294
  outputEncoding: { value: ENCODINGS[LinearEncoding] },
10295
10295
  },
10296
10296
  vertexShader: _getCommonVertexShader(),
10297
- fragmentShader: /* glsl */ `
10298
-
10299
- precision mediump float;
10300
- precision mediump int;
10301
-
10302
- varying vec3 vOutputDirection;
10303
-
10304
- uniform samplerCube envMap;
10305
-
10306
- ${_getEncodings()}
10307
-
10308
- void main() {
10309
-
10310
- gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
10311
- gl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb;
10312
- gl_FragColor = linearToOutputTexel( gl_FragColor );
10313
-
10314
- }
10297
+ fragmentShader: /* glsl */ `
10298
+
10299
+ precision mediump float;
10300
+ precision mediump int;
10301
+
10302
+ varying vec3 vOutputDirection;
10303
+
10304
+ uniform samplerCube envMap;
10305
+
10306
+ ${_getEncodings()}
10307
+
10308
+ void main() {
10309
+
10310
+ gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
10311
+ gl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb;
10312
+ gl_FragColor = linearToOutputTexel( gl_FragColor );
10313
+
10314
+ }
10315
10315
  `,
10316
10316
  blending: NoBlending,
10317
10317
  depthTest: false,
@@ -10320,146 +10320,146 @@ function workerFunction() {
10320
10320
  return shaderMaterial;
10321
10321
  }
10322
10322
  function _getCommonVertexShader() {
10323
- return /* glsl */ `
10324
-
10325
- precision mediump float;
10326
- precision mediump int;
10327
-
10328
- attribute vec3 position;
10329
- attribute vec2 uv;
10330
- attribute float faceIndex;
10331
-
10332
- varying vec3 vOutputDirection;
10333
-
10334
- // RH coordinate system; PMREM face-indexing convention
10335
- vec3 getDirection( vec2 uv, float face ) {
10336
-
10337
- uv = 2.0 * uv - 1.0;
10338
-
10339
- vec3 direction = vec3( uv, 1.0 );
10340
-
10341
- if ( face == 0.0 ) {
10342
-
10343
- direction = direction.zyx; // ( 1, v, u ) pos x
10344
-
10345
- } else if ( face == 1.0 ) {
10346
-
10347
- direction = direction.xzy;
10348
- direction.xz *= -1.0; // ( -u, 1, -v ) pos y
10349
-
10350
- } else if ( face == 2.0 ) {
10351
-
10352
- direction.x *= -1.0; // ( -u, v, 1 ) pos z
10353
-
10354
- } else if ( face == 3.0 ) {
10355
-
10356
- direction = direction.zyx;
10357
- direction.xz *= -1.0; // ( -1, v, -u ) neg x
10358
-
10359
- } else if ( face == 4.0 ) {
10360
-
10361
- direction = direction.xzy;
10362
- direction.xy *= -1.0; // ( -u, -1, v ) neg y
10363
-
10364
- } else if ( face == 5.0 ) {
10365
-
10366
- direction.z *= -1.0; // ( u, v, -1 ) neg z
10367
-
10368
- }
10369
-
10370
- return direction;
10371
-
10372
- }
10373
-
10374
- void main() {
10375
-
10376
- vOutputDirection = getDirection( uv, faceIndex );
10377
- gl_Position = vec4( position, 1.0 );
10378
-
10379
- }
10323
+ return /* glsl */ `
10324
+
10325
+ precision mediump float;
10326
+ precision mediump int;
10327
+
10328
+ attribute vec3 position;
10329
+ attribute vec2 uv;
10330
+ attribute float faceIndex;
10331
+
10332
+ varying vec3 vOutputDirection;
10333
+
10334
+ // RH coordinate system; PMREM face-indexing convention
10335
+ vec3 getDirection( vec2 uv, float face ) {
10336
+
10337
+ uv = 2.0 * uv - 1.0;
10338
+
10339
+ vec3 direction = vec3( uv, 1.0 );
10340
+
10341
+ if ( face == 0.0 ) {
10342
+
10343
+ direction = direction.zyx; // ( 1, v, u ) pos x
10344
+
10345
+ } else if ( face == 1.0 ) {
10346
+
10347
+ direction = direction.xzy;
10348
+ direction.xz *= -1.0; // ( -u, 1, -v ) pos y
10349
+
10350
+ } else if ( face == 2.0 ) {
10351
+
10352
+ direction.x *= -1.0; // ( -u, v, 1 ) pos z
10353
+
10354
+ } else if ( face == 3.0 ) {
10355
+
10356
+ direction = direction.zyx;
10357
+ direction.xz *= -1.0; // ( -1, v, -u ) neg x
10358
+
10359
+ } else if ( face == 4.0 ) {
10360
+
10361
+ direction = direction.xzy;
10362
+ direction.xy *= -1.0; // ( -u, -1, v ) neg y
10363
+
10364
+ } else if ( face == 5.0 ) {
10365
+
10366
+ direction.z *= -1.0; // ( u, v, -1 ) neg z
10367
+
10368
+ }
10369
+
10370
+ return direction;
10371
+
10372
+ }
10373
+
10374
+ void main() {
10375
+
10376
+ vOutputDirection = getDirection( uv, faceIndex );
10377
+ gl_Position = vec4( position, 1.0 );
10378
+
10379
+ }
10380
10380
  `;
10381
10381
  }
10382
10382
  function _getEncodings() {
10383
- return /* glsl */ `
10384
-
10385
- uniform int inputEncoding;
10386
- uniform int outputEncoding;
10387
-
10388
- #include <encodings_pars_fragment>
10389
-
10390
- vec4 inputTexelToLinear( vec4 value ) {
10391
-
10392
- if ( inputEncoding == 0 ) {
10393
-
10394
- return value;
10395
-
10396
- } else if ( inputEncoding == 1 ) {
10397
-
10398
- return sRGBToLinear( value );
10399
-
10400
- } else if ( inputEncoding == 2 ) {
10401
-
10402
- return RGBEToLinear( value );
10403
-
10404
- } else if ( inputEncoding == 3 ) {
10405
-
10406
- return RGBMToLinear( value, 7.0 );
10407
-
10408
- } else if ( inputEncoding == 4 ) {
10409
-
10410
- return RGBMToLinear( value, 16.0 );
10411
-
10412
- } else if ( inputEncoding == 5 ) {
10413
-
10414
- return RGBDToLinear( value, 256.0 );
10415
-
10416
- } else {
10417
-
10418
- return GammaToLinear( value, 2.2 );
10419
-
10420
- }
10421
-
10422
- }
10423
-
10424
- vec4 linearToOutputTexel( vec4 value ) {
10425
-
10426
- if ( outputEncoding == 0 ) {
10427
-
10428
- return value;
10429
-
10430
- } else if ( outputEncoding == 1 ) {
10431
-
10432
- return LinearTosRGB( value );
10433
-
10434
- } else if ( outputEncoding == 2 ) {
10435
-
10436
- return LinearToRGBE( value );
10437
-
10438
- } else if ( outputEncoding == 3 ) {
10439
-
10440
- return LinearToRGBM( value, 7.0 );
10441
-
10442
- } else if ( outputEncoding == 4 ) {
10443
-
10444
- return LinearToRGBM( value, 16.0 );
10445
-
10446
- } else if ( outputEncoding == 5 ) {
10447
-
10448
- return LinearToRGBD( value, 256.0 );
10449
-
10450
- } else {
10451
-
10452
- return LinearToGamma( value, 2.2 );
10453
-
10454
- }
10455
-
10456
- }
10457
-
10458
- vec4 envMapTexelToLinear( vec4 color ) {
10459
-
10460
- return inputTexelToLinear( color );
10461
-
10462
- }
10383
+ return /* glsl */ `
10384
+
10385
+ uniform int inputEncoding;
10386
+ uniform int outputEncoding;
10387
+
10388
+ #include <encodings_pars_fragment>
10389
+
10390
+ vec4 inputTexelToLinear( vec4 value ) {
10391
+
10392
+ if ( inputEncoding == 0 ) {
10393
+
10394
+ return value;
10395
+
10396
+ } else if ( inputEncoding == 1 ) {
10397
+
10398
+ return sRGBToLinear( value );
10399
+
10400
+ } else if ( inputEncoding == 2 ) {
10401
+
10402
+ return RGBEToLinear( value );
10403
+
10404
+ } else if ( inputEncoding == 3 ) {
10405
+
10406
+ return RGBMToLinear( value, 7.0 );
10407
+
10408
+ } else if ( inputEncoding == 4 ) {
10409
+
10410
+ return RGBMToLinear( value, 16.0 );
10411
+
10412
+ } else if ( inputEncoding == 5 ) {
10413
+
10414
+ return RGBDToLinear( value, 256.0 );
10415
+
10416
+ } else {
10417
+
10418
+ return GammaToLinear( value, 2.2 );
10419
+
10420
+ }
10421
+
10422
+ }
10423
+
10424
+ vec4 linearToOutputTexel( vec4 value ) {
10425
+
10426
+ if ( outputEncoding == 0 ) {
10427
+
10428
+ return value;
10429
+
10430
+ } else if ( outputEncoding == 1 ) {
10431
+
10432
+ return LinearTosRGB( value );
10433
+
10434
+ } else if ( outputEncoding == 2 ) {
10435
+
10436
+ return LinearToRGBE( value );
10437
+
10438
+ } else if ( outputEncoding == 3 ) {
10439
+
10440
+ return LinearToRGBM( value, 7.0 );
10441
+
10442
+ } else if ( outputEncoding == 4 ) {
10443
+
10444
+ return LinearToRGBM( value, 16.0 );
10445
+
10446
+ } else if ( outputEncoding == 5 ) {
10447
+
10448
+ return LinearToRGBD( value, 256.0 );
10449
+
10450
+ } else {
10451
+
10452
+ return LinearToGamma( value, 2.2 );
10453
+
10454
+ }
10455
+
10456
+ }
10457
+
10458
+ vec4 envMapTexelToLinear( vec4 color ) {
10459
+
10460
+ return inputTexelToLinear( color );
10461
+
10462
+ }
10463
10463
  `;
10464
10464
  }
10465
10465
  function WebGLCubeUVMaps(renderer) {
@@ -14,6 +14,7 @@ import { ViralSpinner } from "./components/spinner/viral-spinner";
14
14
  import { LocalStorageService } from "./services/local-storage.service";
15
15
  import { ViralKeyboard } from "./components/keyboard/viral-keyboard";
16
16
  import { ViralViewerWorker2 } from "./components/worker/viral-viewer-2.worker";
17
+ import { TestWorker } from "./components/worker/test-worker.worker";
17
18
  export declare class ViralViewerApi {
18
19
  options: ViewerOptions;
19
20
  targetElement: HTMLElement;
@@ -31,6 +32,7 @@ export declare class ViralViewerApi {
31
32
  compressProcessor: CompressProcessor;
32
33
  worker: ViralViewerWorker | null;
33
34
  worker2: ViralViewerWorker2 | null;
35
+ worker3: TestWorker | null;
34
36
  localStorageService: LocalStorageService;
35
37
  constructor(options: ViewerOptions);
36
38
  }
@@ -16,11 +16,13 @@ const viral_spinner_1 = require("./components/spinner/viral-spinner");
16
16
  const local_storage_service_1 = require("./services/local-storage.service");
17
17
  const viral_keyboard_1 = require("./components/keyboard/viral-keyboard");
18
18
  const viral_viewer_2_worker_1 = require("./components/worker/viral-viewer-2.worker");
19
+ const test_worker_worker_1 = require("./components/worker/test-worker.worker");
19
20
  class ViralViewerApi {
20
21
  constructor(options) {
21
22
  this.compressProcessor = new compress_processor_1.CompressProcessor();
22
23
  this.worker = null;
23
24
  this.worker2 = null;
25
+ this.worker3 = null;
24
26
  // worker3: TestWorkerPool | null = null;
25
27
  this.localStorageService = new local_storage_service_1.LocalStorageService();
26
28
  this.options = options;
@@ -38,6 +40,7 @@ class ViralViewerApi {
38
40
  this.pointCloudLoader = new viral_viewer_point_cloud_loader_1.ViralViewerPointCloudLoader(this);
39
41
  this.worker = new viral_viewer_worker_1.ViralViewerWorker(this);
40
42
  this.worker2 = new viral_viewer_2_worker_1.ViralViewerWorker2(this);
43
+ this.worker3 = new test_worker_worker_1.TestWorker();
41
44
  // this.worker3 = new TestWorkerPool();
42
45
  this.viralAnimation.animation();
43
46
  }