@spiffcommerce/preview 3.6.2-rc.8 → 4.0.0

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 (45) hide show
  1. package/dist/index.esm.js +1576 -38
  2. package/dist/index.umd.js +1 -0
  3. package/package.json +4 -6
  4. package/dist/_tslib.esm.js +0 -33
  5. package/dist/animation.esm.js +0 -1364
  6. package/dist/assetCache.esm.js +0 -6
  7. package/dist/assetCache.esm2.js +0 -825
  8. package/dist/blurPostProcess.esm.js +0 -327
  9. package/dist/bumpVertex.esm.js +0 -497
  10. package/dist/compatibilityOptions.esm.js +0 -68
  11. package/dist/configuration.esm.js +0 -121
  12. package/dist/core.esm.js +0 -8135
  13. package/dist/dynamicTexture.esm.js +0 -105
  14. package/dist/dynamicTexture.esm2.js +0 -238
  15. package/dist/easing.esm.js +0 -130
  16. package/dist/effectFallbacks.esm.js +0 -378
  17. package/dist/engine.esm.js +0 -25504
  18. package/dist/glbLoaderExtensions.esm.js +0 -690
  19. package/dist/glowLayer.esm.js +0 -1621
  20. package/dist/glowLayerManager.esm.js +0 -50
  21. package/dist/guid.esm.js +0 -21
  22. package/dist/hdrFilteringFunctions.esm.js +0 -816
  23. package/dist/helperFunctions.esm.js +0 -5145
  24. package/dist/material.esm.js +0 -115
  25. package/dist/material.esm2.js +0 -5245
  26. package/dist/math.axis.esm.js +0 -35
  27. package/dist/math.color.esm.js +0 -1661
  28. package/dist/math.path.esm.js +0 -15
  29. package/dist/math.size.esm.js +0 -137
  30. package/dist/mesh.esm.js +0 -11170
  31. package/dist/modelContainer.esm.js +0 -1895
  32. package/dist/node.esm.js +0 -795
  33. package/dist/pbrBRDFFunctions.esm.js +0 -124
  34. package/dist/pbrMaterial.esm.js +8 -8739
  35. package/dist/productAnimations.esm.js +0 -182
  36. package/dist/productCamera.esm.js +0 -14
  37. package/dist/productCamera.esm2.js +0 -3870
  38. package/dist/renderConstants.esm.js +0 -116
  39. package/dist/renderingPipeline.esm.js +0 -18
  40. package/dist/renderingPipeline.esm2.js +1 -3594
  41. package/dist/sceneLoaderFlags.esm.js +0 -51
  42. package/dist/types.esm.js +0 -30
  43. package/dist/variants.esm.js +0 -16
  44. package/dist/variants.esm2.js +0 -3097
  45. package/dist/webRequest.esm.js +0 -7777
@@ -1,378 +0,0 @@
1
- import { e as ShaderStore } from './engine.esm.js';
2
-
3
- // Do not edit.
4
- const name$d = "clipPlaneFragmentDeclaration";
5
- const shader$d = `#ifdef CLIPPLANE
6
- varying float fClipDistance;
7
- #ifdef CLIPPLANE2
8
- varying float fClipDistance2;
9
- #ifdef CLIPPLANE3
10
- varying float fClipDistance3;
11
- #ifdef CLIPPLANE4
12
- varying float fClipDistance4;
13
- #ifdef CLIPPLANE5
14
- varying float fClipDistance5;
15
- #ifdef CLIPPLANE6
16
- varying float fClipDistance6;
17
- `;
18
- // Sideeffect
19
- ShaderStore.IncludesShadersStore[name$d] = shader$d;
20
-
21
- // Do not edit.
22
- const name$c = "clipPlaneFragment";
23
- const shader$c = `#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)
24
- if (false) {}
25
- #ifdef CLIPPLANE
26
- else if (fClipDistance>0.0)
27
- #ifdef CLIPPLANE2
28
- else if (fClipDistance2>0.0)
29
- #ifdef CLIPPLANE3
30
- else if (fClipDistance3>0.0)
31
- #ifdef CLIPPLANE4
32
- else if (fClipDistance4>0.0)
33
- #ifdef CLIPPLANE5
34
- else if (fClipDistance5>0.0)
35
- #ifdef CLIPPLANE6
36
- else if (fClipDistance6>0.0)
37
- `;
38
- // Sideeffect
39
- ShaderStore.IncludesShadersStore[name$c] = shader$c;
40
-
41
- // Do not edit.
42
- const name$b = "bonesDeclaration";
43
- const shader$b = `#if NUM_BONE_INFLUENCERS>0
44
- attribute vec4 matricesIndices;
45
- attribute vec4 matricesIndicesExtra;
46
- #ifndef BAKED_VERTEX_ANIMATION_TEXTURE
47
- #ifdef BONETEXTURE
48
- uniform sampler2D boneSampler;
49
- uniform mat4 mBones[BonesPerMesh];
50
- uniform mat4 mPreviousBones[BonesPerMesh];
51
- #endif
52
- #ifdef BONETEXTURE
53
- #define inline
54
- mat4 readMatrixFromRawSampler(sampler2D smp,float index)
55
- #endif
56
- #endif
57
- `;
58
- // Sideeffect
59
- ShaderStore.IncludesShadersStore[name$b] = shader$b;
60
-
61
- // Do not edit.
62
- const name$a = "bakedVertexAnimationDeclaration";
63
- const shader$a = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE
64
- uniform float bakedVertexAnimationTime;
65
- attribute vec4 bakedVertexAnimationSettingsInstanced;
66
- #define inline
67
- mat4 readMatrixFromRawSamplerVAT(sampler2D smp,float index,float frame)
68
- `;
69
- // Sideeffect
70
- ShaderStore.IncludesShadersStore[name$a] = shader$a;
71
-
72
- // Do not edit.
73
- const name$9 = "morphTargetsVertexGlobalDeclaration";
74
- const shader$9 = `#ifdef MORPHTARGETS
75
- uniform float morphTargetInfluences[NUM_MORPH_INFLUENCERS];
76
- precision mediump sampler2DArray;
77
- #endif
78
- `;
79
- // Sideeffect
80
- ShaderStore.IncludesShadersStore[name$9] = shader$9;
81
-
82
- // Do not edit.
83
- const name$8 = "morphTargetsVertexDeclaration";
84
- const shader$8 = `#ifdef MORPHTARGETS
85
- #ifndef MORPHTARGETS_TEXTURE
86
- attribute vec3 position{X};
87
- attribute vec3 normal{X};
88
- #ifdef MORPHTARGETS_TANGENT
89
- attribute vec3 tangent{X};
90
- #ifdef MORPHTARGETS_UV
91
- attribute vec2 uv_{X};
92
- #endif
93
- #endif
94
- `;
95
- // Sideeffect
96
- ShaderStore.IncludesShadersStore[name$8] = shader$8;
97
-
98
- // Do not edit.
99
- const name$7 = "clipPlaneVertexDeclaration";
100
- const shader$7 = `#ifdef CLIPPLANE
101
- uniform vec4 vClipPlane;
102
- #ifdef CLIPPLANE2
103
- uniform vec4 vClipPlane2;
104
- #ifdef CLIPPLANE3
105
- uniform vec4 vClipPlane3;
106
- #ifdef CLIPPLANE4
107
- uniform vec4 vClipPlane4;
108
- #ifdef CLIPPLANE5
109
- uniform vec4 vClipPlane5;
110
- #ifdef CLIPPLANE6
111
- uniform vec4 vClipPlane6;
112
- `;
113
- // Sideeffect
114
- ShaderStore.IncludesShadersStore[name$7] = shader$7;
115
-
116
- // Do not edit.
117
- const name$6 = "instancesDeclaration";
118
- const shader$6 = `#ifdef INSTANCES
119
- attribute vec4 world0;
120
- attribute vec4 instanceColor;
121
- #if defined(THIN_INSTANCES) && !defined(WORLD_UBO)
122
- uniform mat4 world;
123
- #if defined(VELOCITY) || defined(PREPASS_VELOCITY)
124
- attribute vec4 previousWorld0;
125
- uniform mat4 previousWorld;
126
- #endif
127
- #else
128
- #if !defined(WORLD_UBO)
129
- uniform mat4 world;
130
- #if defined(VELOCITY) || defined(PREPASS_VELOCITY)
131
- uniform mat4 previousWorld;
132
- #endif
133
- `;
134
- // Sideeffect
135
- ShaderStore.IncludesShadersStore[name$6] = shader$6;
136
-
137
- // Do not edit.
138
- const name$5 = "morphTargetsVertexGlobal";
139
- const shader$5 = `#ifdef MORPHTARGETS
140
- #ifdef MORPHTARGETS_TEXTURE
141
- float vertexID;
142
- #endif
143
- `;
144
- // Sideeffect
145
- ShaderStore.IncludesShadersStore[name$5] = shader$5;
146
-
147
- // Do not edit.
148
- const name$4 = "morphTargetsVertex";
149
- const shader$4 = `#ifdef MORPHTARGETS
150
- #ifdef MORPHTARGETS_TEXTURE
151
- vertexID=float(gl_VertexID)*morphTargetTextureInfo.x;
152
- normalUpdated+=(readVector3FromRawSampler({X},vertexID) -normal)*morphTargetInfluences[{X}];
153
- #ifdef MORPHTARGETS_UV
154
- uvUpdated+=(readVector3FromRawSampler({X},vertexID).xy-uv)*morphTargetInfluences[{X}];
155
- #ifdef MORPHTARGETS_TANGENT
156
- tangentUpdated.xyz+=(readVector3FromRawSampler({X},vertexID) -tangent.xyz)*morphTargetInfluences[{X}];
157
- #else
158
- positionUpdated+=(position{X}-position)*morphTargetInfluences[{X}];
159
- normalUpdated+=(normal{X}-normal)*morphTargetInfluences[{X}];
160
- #ifdef MORPHTARGETS_TANGENT
161
- tangentUpdated.xyz+=(tangent{X}-tangent.xyz)*morphTargetInfluences[{X}];
162
- #ifdef MORPHTARGETS_UV
163
- uvUpdated+=(uv_{X}-uv)*morphTargetInfluences[{X}];
164
- #endif
165
- #endif
166
- `;
167
- // Sideeffect
168
- ShaderStore.IncludesShadersStore[name$4] = shader$4;
169
-
170
- // Do not edit.
171
- const name$3 = "instancesVertex";
172
- const shader$3 = `#ifdef INSTANCES
173
- mat4 finalWorld=mat4(world0,world1,world2,world3);
174
- mat4 finalPreviousWorld=mat4(previousWorld0,previousWorld1,previousWorld2,previousWorld3);
175
- #ifdef THIN_INSTANCES
176
- finalWorld=world*finalWorld;
177
- finalPreviousWorld=previousWorld*finalPreviousWorld;
178
- #endif
179
- #else
180
- mat4 finalWorld=world;
181
- mat4 finalPreviousWorld=previousWorld;
182
- #endif
183
- `;
184
- // Sideeffect
185
- ShaderStore.IncludesShadersStore[name$3] = shader$3;
186
-
187
- // Do not edit.
188
- const name$2 = "bonesVertex";
189
- const shader$2 = `#ifndef BAKED_VERTEX_ANIMATION_TEXTURE
190
- #if NUM_BONE_INFLUENCERS>0
191
- mat4 influence;
192
- influence=readMatrixFromRawSampler(boneSampler,matricesIndices[0])*matricesWeights[0];
193
- influence+=readMatrixFromRawSampler(boneSampler,matricesIndices[1])*matricesWeights[1];
194
- #if NUM_BONE_INFLUENCERS>2
195
- influence+=readMatrixFromRawSampler(boneSampler,matricesIndices[2])*matricesWeights[2];
196
- #if NUM_BONE_INFLUENCERS>3
197
- influence+=readMatrixFromRawSampler(boneSampler,matricesIndices[3])*matricesWeights[3];
198
- #if NUM_BONE_INFLUENCERS>4
199
- influence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[0])*matricesWeightsExtra[0];
200
- #if NUM_BONE_INFLUENCERS>5
201
- influence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[1])*matricesWeightsExtra[1];
202
- #if NUM_BONE_INFLUENCERS>6
203
- influence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[2])*matricesWeightsExtra[2];
204
- #if NUM_BONE_INFLUENCERS>7
205
- influence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[3])*matricesWeightsExtra[3];
206
- #else
207
- influence=mBones[int(matricesIndices[0])]*matricesWeights[0];
208
- influence+=mBones[int(matricesIndices[1])]*matricesWeights[1];
209
- #if NUM_BONE_INFLUENCERS>2
210
- influence+=mBones[int(matricesIndices[2])]*matricesWeights[2];
211
- #if NUM_BONE_INFLUENCERS>3
212
- influence+=mBones[int(matricesIndices[3])]*matricesWeights[3];
213
- #if NUM_BONE_INFLUENCERS>4
214
- influence+=mBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];
215
- #if NUM_BONE_INFLUENCERS>5
216
- influence+=mBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];
217
- #if NUM_BONE_INFLUENCERS>6
218
- influence+=mBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];
219
- #if NUM_BONE_INFLUENCERS>7
220
- influence+=mBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];
221
- #endif
222
- finalWorld=finalWorld*influence;
223
- #endif
224
- `;
225
- // Sideeffect
226
- ShaderStore.IncludesShadersStore[name$2] = shader$2;
227
-
228
- // Do not edit.
229
- const name$1 = "bakedVertexAnimation";
230
- const shader$1 = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE
231
- {
232
- #define BVASNAME bakedVertexAnimationSettingsInstanced
233
- #else
234
- #define BVASNAME bakedVertexAnimationSettings
235
- #endif
236
- float VATStartFrame=BVASNAME.x;
237
- VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[1],VATFrameNum)*matricesWeights[1];
238
- #if NUM_BONE_INFLUENCERS>2
239
- VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[2],VATFrameNum)*matricesWeights[2];
240
- #if NUM_BONE_INFLUENCERS>3
241
- VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[3],VATFrameNum)*matricesWeights[3];
242
- #if NUM_BONE_INFLUENCERS>4
243
- VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[0],VATFrameNum)*matricesWeightsExtra[0];
244
- #if NUM_BONE_INFLUENCERS>5
245
- VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[1],VATFrameNum)*matricesWeightsExtra[1];
246
- #if NUM_BONE_INFLUENCERS>6
247
- VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[2],VATFrameNum)*matricesWeightsExtra[2];
248
- #if NUM_BONE_INFLUENCERS>7
249
- VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[3],VATFrameNum)*matricesWeightsExtra[3];
250
- finalWorld=finalWorld*VATInfluence;
251
- `;
252
- // Sideeffect
253
- ShaderStore.IncludesShadersStore[name$1] = shader$1;
254
-
255
- // Do not edit.
256
- const name = "clipPlaneVertex";
257
- const shader = `#ifdef CLIPPLANE
258
- fClipDistance=dot(worldPos,vClipPlane);
259
- #ifdef CLIPPLANE2
260
- fClipDistance2=dot(worldPos,vClipPlane2);
261
- #ifdef CLIPPLANE3
262
- fClipDistance3=dot(worldPos,vClipPlane3);
263
- #ifdef CLIPPLANE4
264
- fClipDistance4=dot(worldPos,vClipPlane4);
265
- #ifdef CLIPPLANE5
266
- fClipDistance5=dot(worldPos,vClipPlane5);
267
- #ifdef CLIPPLANE6
268
- fClipDistance6=dot(worldPos,vClipPlane6);
269
- `;
270
- // Sideeffect
271
- ShaderStore.IncludesShadersStore[name] = shader;
272
-
273
- /**
274
- * EffectFallbacks can be used to add fallbacks (properties to disable) to certain properties when desired to improve performance.
275
- * (Eg. Start at high quality with reflection and fog, if fps is low, remove reflection, if still low remove fog)
276
- */
277
- class EffectFallbacks {
278
- constructor() {
279
- this._defines = {};
280
- this._currentRank = 32;
281
- this._maxRank = -1;
282
- this._mesh = null;
283
- }
284
- /**
285
- * Removes the fallback from the bound mesh.
286
- */
287
- unBindMesh() {
288
- this._mesh = null;
289
- }
290
- /**
291
- * Adds a fallback on the specified property.
292
- * @param rank The rank of the fallback (Lower ranks will be fallbacked to first)
293
- * @param define The name of the define in the shader
294
- */
295
- addFallback(rank, define) {
296
- if (!this._defines[rank]) {
297
- if (rank < this._currentRank) {
298
- this._currentRank = rank;
299
- }
300
- if (rank > this._maxRank) {
301
- this._maxRank = rank;
302
- }
303
- this._defines[rank] = new Array();
304
- }
305
- this._defines[rank].push(define);
306
- }
307
- /**
308
- * Sets the mesh to use CPU skinning when needing to fallback.
309
- * @param rank The rank of the fallback (Lower ranks will be fallbacked to first)
310
- * @param mesh The mesh to use the fallbacks.
311
- */
312
- addCPUSkinningFallback(rank, mesh) {
313
- this._mesh = mesh;
314
- if (rank < this._currentRank) {
315
- this._currentRank = rank;
316
- }
317
- if (rank > this._maxRank) {
318
- this._maxRank = rank;
319
- }
320
- }
321
- /**
322
- * Checks to see if more fallbacks are still available.
323
- */
324
- get hasMoreFallbacks() {
325
- return this._currentRank <= this._maxRank;
326
- }
327
- /**
328
- * Removes the defines that should be removed when falling back.
329
- * @param currentDefines defines the current define statements for the shader.
330
- * @param effect defines the current effect we try to compile
331
- * @returns The resulting defines with defines of the current rank removed.
332
- */
333
- reduce(currentDefines, effect) {
334
- // First we try to switch to CPU skinning
335
- if (this._mesh && this._mesh.computeBonesUsingShaders && this._mesh.numBoneInfluencers > 0) {
336
- this._mesh.computeBonesUsingShaders = false;
337
- currentDefines = currentDefines.replace("#define NUM_BONE_INFLUENCERS " + this._mesh.numBoneInfluencers, "#define NUM_BONE_INFLUENCERS 0");
338
- effect._bonesComputationForcedToCPU = true;
339
- const scene = this._mesh.getScene();
340
- for (let index = 0; index < scene.meshes.length; index++) {
341
- const otherMesh = scene.meshes[index];
342
- if (!otherMesh.material) {
343
- if (!this._mesh.material && otherMesh.computeBonesUsingShaders && otherMesh.numBoneInfluencers > 0) {
344
- otherMesh.computeBonesUsingShaders = false;
345
- }
346
- continue;
347
- }
348
- if (!otherMesh.computeBonesUsingShaders || otherMesh.numBoneInfluencers === 0) {
349
- continue;
350
- }
351
- if (otherMesh.material.getEffect() === effect) {
352
- otherMesh.computeBonesUsingShaders = false;
353
- }
354
- else if (otherMesh.subMeshes) {
355
- for (const subMesh of otherMesh.subMeshes) {
356
- const subMeshEffect = subMesh.effect;
357
- if (subMeshEffect === effect) {
358
- otherMesh.computeBonesUsingShaders = false;
359
- break;
360
- }
361
- }
362
- }
363
- }
364
- }
365
- else {
366
- const currentFallbacks = this._defines[this._currentRank];
367
- if (currentFallbacks) {
368
- for (let index = 0; index < currentFallbacks.length; index++) {
369
- currentDefines = currentDefines.replace("#define " + currentFallbacks[index], "");
370
- }
371
- }
372
- this._currentRank++;
373
- }
374
- return currentDefines;
375
- }
376
- }
377
-
378
- export { EffectFallbacks as E };