x_ite 8.12.4 → 8.12.5

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 (47) hide show
  1. package/dist/assets/components/Annotation.js +13 -13
  2. package/dist/assets/components/Annotation.min.js +1 -1
  3. package/dist/assets/components/CADGeometry.js +14 -14
  4. package/dist/assets/components/CADGeometry.min.js +1 -1
  5. package/dist/assets/components/CubeMapTexturing.js +25 -25
  6. package/dist/assets/components/CubeMapTexturing.min.js +1 -1
  7. package/dist/assets/components/DIS.js +13 -13
  8. package/dist/assets/components/DIS.min.js +1 -1
  9. package/dist/assets/components/EventUtilities.js +9 -9
  10. package/dist/assets/components/EventUtilities.min.js +1 -1
  11. package/dist/assets/components/Geometry2D.js +19 -19
  12. package/dist/assets/components/Geometry2D.min.js +1 -1
  13. package/dist/assets/components/Geospatial.js +33 -33
  14. package/dist/assets/components/Geospatial.min.js +1 -1
  15. package/dist/assets/components/HAnim.js +23 -23
  16. package/dist/assets/components/HAnim.min.js +1 -1
  17. package/dist/assets/components/KeyDeviceSensor.js +8 -8
  18. package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
  19. package/dist/assets/components/Layout.js +26 -26
  20. package/dist/assets/components/Layout.min.js +1 -1
  21. package/dist/assets/components/NURBS.js +24 -24
  22. package/dist/assets/components/NURBS.min.js +1 -1
  23. package/dist/assets/components/ParticleSystems.js +23 -23
  24. package/dist/assets/components/ParticleSystems.min.js +1 -1
  25. package/dist/assets/components/Picking.js +18 -18
  26. package/dist/assets/components/Picking.min.js +1 -1
  27. package/dist/assets/components/RigidBodyPhysics.js +17 -17
  28. package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
  29. package/dist/assets/components/Scripting.js +39 -39
  30. package/dist/assets/components/Scripting.min.js +1 -1
  31. package/dist/assets/components/Text.js +24 -24
  32. package/dist/assets/components/Text.min.js +1 -1
  33. package/dist/assets/components/TextureProjector.js +14 -14
  34. package/dist/assets/components/TextureProjector.min.js +1 -1
  35. package/dist/assets/components/Texturing3D.js +30 -30
  36. package/dist/assets/components/Texturing3D.min.js +1 -1
  37. package/dist/assets/components/VolumeRendering.js +18 -18
  38. package/dist/assets/components/VolumeRendering.min.js +1 -1
  39. package/dist/assets/components/X_ITE.js +9 -9
  40. package/dist/assets/components/X_ITE.min.js +1 -1
  41. package/dist/x_ite.css +1 -1
  42. package/dist/x_ite.js +753 -916
  43. package/dist/x_ite.min.js +1 -1
  44. package/dist/x_ite.min.mjs +1 -1
  45. package/dist/x_ite.mjs +753 -915
  46. package/dist/x_ite.zip +0 -0
  47. package/package.json +1 -2
package/dist/x_ite.mjs CHANGED
@@ -1,384 +1,9 @@
1
- /* X_ITE v8.12.4 */var __webpack_modules__ = ({
1
+ /* X_ITE v8.12.5 */var __webpack_modules__ = ({
2
2
 
3
- /***/ 45:
4
- /***/ (function(module, exports, __webpack_require__) {
5
-
6
- /* provided dependency */ var jQuery = __webpack_require__(864);
7
- var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;
8
-
9
- /**
10
- * Copyright Marc J. Schmidt. See the LICENSE file at the top-level
11
- * directory of this distribution and at
12
- * https://github.com/marcj/css-element-queries/blob/master/LICENSE.
13
- */
14
- (function (root, factory) {
15
- if (true) {
16
- !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
17
- __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
18
- (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
19
- __WEBPACK_AMD_DEFINE_FACTORY__),
20
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
21
- } else {}
22
- }(typeof window !== 'undefined' ? window : this, function () {
23
-
24
- // Make sure it does not throw in a SSR (Server Side Rendering) situation
25
- if (typeof window === "undefined") {
26
- return null;
27
- }
28
- // https://github.com/Semantic-Org/Semantic-UI/issues/3855
29
- // https://github.com/marcj/css-element-queries/issues/257
30
- var globalWindow = typeof window != 'undefined' && window.Math == Math
31
- ? window
32
- : typeof self != 'undefined' && self.Math == Math
33
- ? self
34
- : Function('return this')();
35
- // Only used for the dirty checking, so the event callback count is limited to max 1 call per fps per sensor.
36
- // In combination with the event based resize sensor this saves cpu time, because the sensor is too fast and
37
- // would generate too many unnecessary events.
38
- var requestAnimationFrame = globalWindow.requestAnimationFrame ||
39
- globalWindow.mozRequestAnimationFrame ||
40
- globalWindow.webkitRequestAnimationFrame ||
41
- function (fn) {
42
- return globalWindow.setTimeout(fn, 20);
43
- };
44
-
45
- var cancelAnimationFrame = globalWindow.cancelAnimationFrame ||
46
- globalWindow.mozCancelAnimationFrame ||
47
- globalWindow.webkitCancelAnimationFrame ||
48
- function (timer) {
49
- globalWindow.clearTimeout(timer);
50
- };
51
-
52
- /**
53
- * Iterate over each of the provided element(s).
54
- *
55
- * @param {HTMLElement|HTMLElement[]} elements
56
- * @param {Function} callback
57
- */
58
- function forEachElement(elements, callback){
59
- var elementsType = Object.prototype.toString.call(elements);
60
- var isCollectionTyped = ('[object Array]' === elementsType
61
- || ('[object NodeList]' === elementsType)
62
- || ('[object HTMLCollection]' === elementsType)
63
- || ('[object Object]' === elementsType)
64
- || ('undefined' !== typeof jQuery && elements instanceof jQuery) //jquery
65
- || ('undefined' !== typeof Elements && elements instanceof Elements) //mootools
66
- );
67
- var i = 0, j = elements.length;
68
- if (isCollectionTyped) {
69
- for (; i < j; i++) {
70
- callback(elements[i]);
71
- }
72
- } else {
73
- callback(elements);
74
- }
75
- }
76
-
77
- /**
78
- * Get element size
79
- * @param {HTMLElement} element
80
- * @returns {Object} {width, height}
81
- */
82
- function getElementSize(element) {
83
- if (!element.getBoundingClientRect) {
84
- return {
85
- width: element.offsetWidth,
86
- height: element.offsetHeight
87
- }
88
- }
89
-
90
- var rect = element.getBoundingClientRect();
91
- return {
92
- width: Math.round(rect.width),
93
- height: Math.round(rect.height)
94
- }
95
- }
96
-
97
- /**
98
- * Apply CSS styles to element.
99
- *
100
- * @param {HTMLElement} element
101
- * @param {Object} style
102
- */
103
- function setStyle(element, style) {
104
- Object.keys(style).forEach(function(key) {
105
- element.style[key] = style[key];
106
- });
107
- }
108
-
109
- /**
110
- * Class for dimension change detection.
111
- *
112
- * @param {Element|Element[]|Elements|jQuery} element
113
- * @param {Function} callback
114
- *
115
- * @constructor
116
- */
117
- var ResizeSensor = function(element, callback) {
118
- //Is used when checking in reset() only for invisible elements
119
- var lastAnimationFrameForInvisibleCheck = 0;
120
-
121
- /**
122
- *
123
- * @constructor
124
- */
125
- function EventQueue() {
126
- var q = [];
127
- this.add = function(ev) {
128
- q.push(ev);
129
- };
130
-
131
- var i, j;
132
- this.call = function(sizeInfo) {
133
- for (i = 0, j = q.length; i < j; i++) {
134
- q[i].call(this, sizeInfo);
135
- }
136
- };
137
-
138
- this.remove = function(ev) {
139
- var newQueue = [];
140
- for(i = 0, j = q.length; i < j; i++) {
141
- if(q[i] !== ev) newQueue.push(q[i]);
142
- }
143
- q = newQueue;
144
- };
145
-
146
- this.length = function() {
147
- return q.length;
148
- }
149
- }
150
-
151
- /**
152
- *
153
- * @param {HTMLElement} element
154
- * @param {Function} resized
155
- */
156
- function attachResizeEvent(element, resized) {
157
- if (!element) return;
158
- if (element.resizedAttached) {
159
- element.resizedAttached.add(resized);
160
- return;
161
- }
162
-
163
- element.resizedAttached = new EventQueue();
164
- element.resizedAttached.add(resized);
165
-
166
- element.resizeSensor = document.createElement('div');
167
- element.resizeSensor.dir = 'ltr';
168
- element.resizeSensor.className = 'resize-sensor';
169
-
170
- var style = {
171
- pointerEvents: 'none',
172
- position: 'absolute',
173
- left: '0px',
174
- top: '0px',
175
- right: '0px',
176
- bottom: '0px',
177
- overflow: 'hidden',
178
- zIndex: '-1',
179
- visibility: 'hidden',
180
- maxWidth: '100%'
181
- };
182
- var styleChild = {
183
- position: 'absolute',
184
- left: '0px',
185
- top: '0px',
186
- transition: '0s',
187
- };
188
-
189
- setStyle(element.resizeSensor, style);
190
-
191
- var expand = document.createElement('div');
192
- expand.className = 'resize-sensor-expand';
193
- setStyle(expand, style);
194
-
195
- var expandChild = document.createElement('div');
196
- setStyle(expandChild, styleChild);
197
- expand.appendChild(expandChild);
198
-
199
- var shrink = document.createElement('div');
200
- shrink.className = 'resize-sensor-shrink';
201
- setStyle(shrink, style);
202
-
203
- var shrinkChild = document.createElement('div');
204
- setStyle(shrinkChild, styleChild);
205
- setStyle(shrinkChild, { width: '200%', height: '200%' });
206
- shrink.appendChild(shrinkChild);
207
-
208
- element.resizeSensor.appendChild(expand);
209
- element.resizeSensor.appendChild(shrink);
210
- element.appendChild(element.resizeSensor);
211
-
212
- var computedStyle = window.getComputedStyle(element);
213
- var position = computedStyle ? computedStyle.getPropertyValue('position') : null;
214
- if ('absolute' !== position && 'relative' !== position && 'fixed' !== position && 'sticky' !== position) {
215
- element.style.position = 'relative';
216
- }
217
-
218
- var dirty = false;
219
-
220
- //last request animation frame id used in onscroll event
221
- var rafId = 0;
222
- var size = getElementSize(element);
223
- var lastWidth = 0;
224
- var lastHeight = 0;
225
- var initialHiddenCheck = true;
226
- lastAnimationFrameForInvisibleCheck = 0;
227
-
228
- var resetExpandShrink = function () {
229
- var width = element.offsetWidth;
230
- var height = element.offsetHeight;
231
-
232
- expandChild.style.width = (width + 10) + 'px';
233
- expandChild.style.height = (height + 10) + 'px';
234
-
235
- expand.scrollLeft = width + 10;
236
- expand.scrollTop = height + 10;
237
-
238
- shrink.scrollLeft = width + 10;
239
- shrink.scrollTop = height + 10;
240
- };
241
-
242
- var reset = function() {
243
- // Check if element is hidden
244
- if (initialHiddenCheck) {
245
- var invisible = element.offsetWidth === 0 && element.offsetHeight === 0;
246
- if (invisible) {
247
- // Check in next frame
248
- if (!lastAnimationFrameForInvisibleCheck){
249
- lastAnimationFrameForInvisibleCheck = requestAnimationFrame(function(){
250
- lastAnimationFrameForInvisibleCheck = 0;
251
- reset();
252
- });
253
- }
254
-
255
- return;
256
- } else {
257
- // Stop checking
258
- initialHiddenCheck = false;
259
- }
260
- }
261
-
262
- resetExpandShrink();
263
- };
264
- element.resizeSensor.resetSensor = reset;
265
-
266
- var onResized = function() {
267
- rafId = 0;
268
-
269
- if (!dirty) return;
270
-
271
- lastWidth = size.width;
272
- lastHeight = size.height;
273
-
274
- if (element.resizedAttached) {
275
- element.resizedAttached.call(size);
276
- }
277
- };
278
-
279
- var onScroll = function() {
280
- size = getElementSize(element);
281
- dirty = size.width !== lastWidth || size.height !== lastHeight;
282
-
283
- if (dirty && !rafId) {
284
- rafId = requestAnimationFrame(onResized);
285
- }
286
-
287
- reset();
288
- };
289
-
290
- var addEvent = function(el, name, cb) {
291
- if (el.attachEvent) {
292
- el.attachEvent('on' + name, cb);
293
- } else {
294
- el.addEventListener(name, cb);
295
- }
296
- };
297
-
298
- addEvent(expand, 'scroll', onScroll);
299
- addEvent(shrink, 'scroll', onScroll);
300
-
301
- // Fix for custom Elements and invisible elements
302
- lastAnimationFrameForInvisibleCheck = requestAnimationFrame(function(){
303
- lastAnimationFrameForInvisibleCheck = 0;
304
- reset();
305
- });
306
- }
307
-
308
- forEachElement(element, function(elem){
309
- attachResizeEvent(elem, callback);
310
- });
311
-
312
- this.detach = function(ev) {
313
- // clean up the unfinished animation frame to prevent a potential endless requestAnimationFrame of reset
314
- if (!lastAnimationFrameForInvisibleCheck) {
315
- cancelAnimationFrame(lastAnimationFrameForInvisibleCheck);
316
- lastAnimationFrameForInvisibleCheck = 0;
317
- }
318
- ResizeSensor.detach(element, ev);
319
- };
320
-
321
- this.reset = function() {
322
- element.resizeSensor.resetSensor();
323
- };
324
- };
325
-
326
- ResizeSensor.reset = function(element) {
327
- forEachElement(element, function(elem){
328
- elem.resizeSensor.resetSensor();
329
- });
330
- };
331
-
332
- ResizeSensor.detach = function(element, ev) {
333
- forEachElement(element, function(elem){
334
- if (!elem) return;
335
- if(elem.resizedAttached && typeof ev === "function"){
336
- elem.resizedAttached.remove(ev);
337
- if(elem.resizedAttached.length()) return;
338
- }
339
- if (elem.resizeSensor) {
340
- if (elem.contains(elem.resizeSensor)) {
341
- elem.removeChild(elem.resizeSensor);
342
- }
343
- delete elem.resizeSensor;
344
- delete elem.resizedAttached;
345
- }
346
- });
347
- };
348
-
349
- if (typeof MutationObserver !== "undefined") {
350
- var observer = new MutationObserver(function (mutations) {
351
- for (var i in mutations) {
352
- if (mutations.hasOwnProperty(i)) {
353
- var items = mutations[i].addedNodes;
354
- for (var j = 0; j < items.length; j++) {
355
- if (items[j].resizeSensor) {
356
- ResizeSensor.reset(items[j]);
357
- }
358
- }
359
- }
360
- }
361
- });
362
-
363
- document.addEventListener("DOMContentLoaded", function (event) {
364
- observer.observe(document.body, {
365
- childList: true,
366
- subtree: true,
367
- });
368
- });
369
- }
370
-
371
- return ResizeSensor;
372
-
373
- }));
374
-
375
-
376
- /***/ }),
377
-
378
- /***/ 543:
3
+ /***/ 196:
379
4
  /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
380
5
 
381
- /* provided dependency */ var jQuery = __webpack_require__(864);
6
+ /* provided dependency */ var jQuery = __webpack_require__(659);
382
7
  /**
383
8
  * @preserve jquery.fullscreen 1.1.5
384
9
  * https://github.com/code-lts/jquery-fullscreen-plugin
@@ -574,7 +199,7 @@ installFullScreenHandlers();
574
199
 
575
200
  /***/ }),
576
201
 
577
- /***/ 273:
202
+ /***/ 946:
578
203
  /***/ ((module, exports, __webpack_require__) => {
579
204
 
580
205
  var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
@@ -588,7 +213,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
588
213
  (function (factory) {
589
214
  if ( true ) {
590
215
  // AMD. Register as an anonymous module.
591
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(864)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
216
+ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(659)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
592
217
  __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
593
218
  (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
594
219
  __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
@@ -799,7 +424,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
799
424
 
800
425
  /***/ }),
801
426
 
802
- /***/ 864:
427
+ /***/ 659:
803
428
  /***/ (function(module, exports) {
804
429
 
805
430
  var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
@@ -11523,7 +11148,7 @@ return jQuery;
11523
11148
 
11524
11149
  /***/ }),
11525
11150
 
11526
- /***/ 180:
11151
+ /***/ 793:
11527
11152
  /***/ ((module) => {
11528
11153
 
11529
11154
  /**
@@ -16302,7 +15927,7 @@ if (true) {
16302
15927
 
16303
15928
  /***/ }),
16304
15929
 
16305
- /***/ 61:
15930
+ /***/ 822:
16306
15931
  /***/ (function(__unused_webpack_module, exports) {
16307
15932
 
16308
15933
 
@@ -19547,7 +19172,7 @@ if (true) {
19547
19172
 
19548
19173
  /***/ }),
19549
19174
 
19550
- /***/ 27:
19175
+ /***/ 357:
19551
19176
  /***/ (function(module, exports) {
19552
19177
 
19553
19178
  var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*
@@ -20674,7 +20299,7 @@ Object .defineProperty (Namespace, "add",
20674
20299
  }
20675
20300
  else
20676
20301
  {
20677
- const X3D = window [Symbol .for ("X_ITE.X3D-8.12.4")];
20302
+ const X3D = window [Symbol .for ("X_ITE.X3D-8.12.5")];
20678
20303
 
20679
20304
  if (X3D)
20680
20305
  X3D [name] = module;
@@ -34394,7 +34019,7 @@ const X3DBaseNode_default_ = X3DBaseNode;
34394
34019
  x_ite_Namespace .add ("X3DBaseNode", "x_ite/Base/X3DBaseNode", X3DBaseNode_default_);
34395
34020
  /* harmony default export */ const Base_X3DBaseNode = (X3DBaseNode_default_);
34396
34021
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Legacy.js
34397
- /* provided dependency */ var $ = __webpack_require__(864);
34022
+ /* provided dependency */ var $ = __webpack_require__(659);
34398
34023
  /*******************************************************************************
34399
34024
  *
34400
34025
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34531,7 +34156,7 @@ x_ite_Namespace .add ("Legacy", "x_ite/Browser/Legacy", Legacy_default_);
34531
34156
  *
34532
34157
  ******************************************************************************/
34533
34158
 
34534
- const VERSION_default_ = "8.12.4";
34159
+ const VERSION_default_ = "8.12.5";
34535
34160
  ;
34536
34161
 
34537
34162
  x_ite_Namespace .add ("VERSION", "x_ite/Browser/VERSION", VERSION_default_);
@@ -38419,7 +38044,7 @@ const X3DProtoDeclarationNode_default_ = X3DProtoDeclarationNode;
38419
38044
  x_ite_Namespace .add ("X3DProtoDeclarationNode", "x_ite/Prototype/X3DProtoDeclarationNode", X3DProtoDeclarationNode_default_);
38420
38045
  /* harmony default export */ const Prototype_X3DProtoDeclarationNode = (X3DProtoDeclarationNode_default_);
38421
38046
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/X3DParser.js
38422
- /* provided dependency */ var X3DParser_$ = __webpack_require__(864);
38047
+ /* provided dependency */ var X3DParser_$ = __webpack_require__(659);
38423
38048
  /*******************************************************************************
38424
38049
  *
38425
38050
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39244,7 +38869,7 @@ const X3DProtoDeclaration_default_ = X3DProtoDeclaration;
39244
38869
  x_ite_Namespace .add ("X3DProtoDeclaration", "x_ite/Prototype/X3DProtoDeclaration", X3DProtoDeclaration_default_);
39245
38870
  /* harmony default export */ const Prototype_X3DProtoDeclaration = (X3DProtoDeclaration_default_);
39246
38871
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/VRMLParser.js
39247
- /* provided dependency */ var VRMLParser_$ = __webpack_require__(864);
38872
+ /* provided dependency */ var VRMLParser_$ = __webpack_require__(659);
39248
38873
  /*******************************************************************************
39249
38874
  *
39250
38875
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41789,7 +41414,7 @@ const VRMLParser_default_ = VRMLParser;
41789
41414
  x_ite_Namespace .add ("VRMLParser", "x_ite/Parser/VRMLParser", VRMLParser_default_);
41790
41415
  /* harmony default export */ const Parser_VRMLParser = (VRMLParser_default_);
41791
41416
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/XMLParser.js
41792
- /* provided dependency */ var XMLParser_$ = __webpack_require__(864);
41417
+ /* provided dependency */ var XMLParser_$ = __webpack_require__(659);
41793
41418
  /*******************************************************************************
41794
41419
  *
41795
41420
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43844,7 +43469,7 @@ const URLs_default_ = URLs;
43844
43469
  x_ite_Namespace .add ("URLs", "x_ite/Browser/Networking/URLs", URLs_default_);
43845
43470
  /* harmony default export */ const Networking_URLs = (URLs_default_);
43846
43471
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/GLTF2Parser.js
43847
- /* provided dependency */ var GLTF2Parser_$ = __webpack_require__(864);
43472
+ /* provided dependency */ var GLTF2Parser_$ = __webpack_require__(659);
43848
43473
  /*******************************************************************************
43849
43474
  *
43850
43475
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44151,12 +43776,12 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
44151
43776
  }
44152
43777
  }
44153
43778
  },
44154
- khrLightsPunctualObject (khrLightsPunctual)
43779
+ khrLightsPunctualObject (KHR_lights_punctual)
44155
43780
  {
44156
- if (!(khrLightsPunctual instanceof Object))
43781
+ if (!(KHR_lights_punctual instanceof Object))
44157
43782
  return;
44158
43783
 
44159
- this .lightsArray (khrLightsPunctual .lights);
43784
+ this .lightsArray (KHR_lights_punctual .lights);
44160
43785
  },
44161
43786
  lightsArray (lights)
44162
43787
  {
@@ -44223,10 +43848,9 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
44223
43848
  scene = this .getExecutionContext (),
44224
43849
  lightNode = scene .createNode ("SpotLight", false);
44225
43850
 
44226
- lightNode ._radius = this .numberValue (light .range, 0) || 1_000_000_000;
43851
+ lightNode ._radius = this .numberValue (light .range, 0) || -1;
44227
43852
  lightNode ._cutOffAngle = this .numberValue (light .outerConeAngle, Math .PI / 4);
44228
43853
  lightNode ._beamWidth = this .numberValue (light .innerConeAngle, 0);
44229
- lightNode ._attenuation = new Numbers_Vector3 (0, 0, 1);
44230
43854
 
44231
43855
  return lightNode;
44232
43856
  },
@@ -44236,8 +43860,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
44236
43860
  scene = this .getExecutionContext (),
44237
43861
  lightNode = scene .createNode ("PointLight", false);
44238
43862
 
44239
- lightNode ._radius = this .numberValue (light .range, 0) || 1_000_000_000;
44240
- lightNode ._attenuation = new Numbers_Vector3 (0, 0, 1);
43863
+ lightNode ._radius = this .numberValue (light .range, 0) || -1;
44241
43864
 
44242
43865
  return lightNode;
44243
43866
  },
@@ -44371,6 +43994,42 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
44371
43994
  },
44372
43995
  configurable: true,
44373
43996
  });
43997
+
43998
+ Object .defineProperty (accessor, "normalizedArray",
43999
+ {
44000
+ get: () =>
44001
+ {
44002
+ switch (accessor .componentType)
44003
+ {
44004
+ case 5120: // Int8Array
44005
+ var value = Float32Array .from (accessor .array, v => Math .max (v / 127, -1));
44006
+ break;
44007
+ case 5121: // Uint8Array
44008
+ var value = Float32Array .from (accessor .array, v => v / 255);
44009
+ break;
44010
+ case 5122: // Int16Array
44011
+ var value = Float32Array .from (accessor .array, v => Math .max (v / 32767, -1));
44012
+ break;
44013
+ case 5123: // Uint16Array
44014
+ var value = Float32Array .from (accessor .array, v => v / 65535);
44015
+ break;
44016
+ case 5124: // Int32Array
44017
+ var value = Float32Array .from (accessor .array, v => Math .max (v / 2147483647, -1));
44018
+ break;
44019
+ case 5125: // Uint32Array
44020
+ var value = Float32Array .from (accessor .array, v => v / 4294967295);
44021
+ break;
44022
+ case 5126: // Float32Array
44023
+ var value = accessor .array;
44024
+ break;
44025
+ }
44026
+
44027
+ Object .defineProperty (accessor, "normalizedArray", { value: value });
44028
+
44029
+ return value;
44030
+ },
44031
+ configurable: true,
44032
+ });
44374
44033
  };
44375
44034
  })(),
44376
44035
  sparseObject: (() =>
@@ -44608,7 +44267,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
44608
44267
 
44609
44268
  const texCoordIndices = this .texCoordIndices ("", material);
44610
44269
 
44611
- this .texCoordIndex = [... texCoordIndices] .reduce (Math .max, -1);
44270
+ this .texCoordIndex = Array .from (texCoordIndices) .reduce (Math .max, -1);
44612
44271
  this .textureTransformNodes = [ ];
44613
44272
  this .texCoordMappings = new Map ();
44614
44273
  material .texCoordMappings = this .texCoordMappings;
@@ -45410,7 +45069,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
45410
45069
 
45411
45070
  // Add light.
45412
45071
 
45413
- this .nodeExtensions (node .extensions, transformNode);
45072
+ this .nodeLight (node .extensions ?.KHR_lights_punctual, transformNode);
45414
45073
 
45415
45074
  // Add children.
45416
45075
 
@@ -45419,7 +45078,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
45419
45078
  // Add Shape nodes.
45420
45079
 
45421
45080
  if (shapeNodes)
45422
- transformNode ._children .push (... shapeNodes);
45081
+ transformNode ._children .push (... this .meshInstancing (node .extensions ?.EXT_mesh_gpu_instancing, shapeNodes));
45423
45082
 
45424
45083
  transformNode .setup ();
45425
45084
 
@@ -45477,19 +45136,12 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
45477
45136
 
45478
45137
  humanoidNode ._skin .push (transformNode);
45479
45138
  },
45480
- nodeExtensions (extensions, transformNode)
45139
+ nodeLight (KHR_lights_punctual, transformNode)
45481
45140
  {
45482
- if (!(extensions instanceof Object))
45141
+ if (!(KHR_lights_punctual instanceof Object))
45483
45142
  return;
45484
45143
 
45485
- this .nodeLight (extensions .KHR_lights_punctual, transformNode);
45486
- },
45487
- nodeLight (khrLightsPunctual, transformNode)
45488
- {
45489
- if (!(khrLightsPunctual instanceof Object))
45490
- return;
45491
-
45492
- const lightNode = this .lightObject (this .lights [khrLightsPunctual .light]);
45144
+ const lightNode = this .lightObject (this .lights [KHR_lights_punctual .light]);
45493
45145
 
45494
45146
  if (!lightNode)
45495
45147
  return;
@@ -45498,16 +45150,81 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
45498
45150
 
45499
45151
  transformNode ._children .push (lightNode);
45500
45152
  },
45153
+ meshInstancing (EXT_mesh_gpu_instancing, shapeNodes)
45154
+ {
45155
+ if (!(EXT_mesh_gpu_instancing instanceof Object))
45156
+ return shapeNodes;
45157
+
45158
+ let
45159
+ attributes = EXT_mesh_gpu_instancing .attributes,
45160
+ translation = this .accessors [attributes ?.TRANSLATION],
45161
+ rotation = this .accessors [attributes ?.ROTATION],
45162
+ scale = this .accessors [attributes ?.SCALE],
45163
+ count = Math .max (translation ?.count ?? 0, rotation ?.count ?? 0, scale ?.count ?? 0);
45164
+
45165
+ if (!count)
45166
+ return shapeNodes;
45167
+
45168
+ if (translation ?.type !== "VEC3")
45169
+ translation = null;
45170
+
45171
+ if (rotation ?.type !== "VEC4")
45172
+ rotation = null;
45173
+
45174
+ if (scale ?.type !== "VEC3")
45175
+ scale = null;
45176
+
45177
+ const
45178
+ scene = this .getScene (),
45179
+ transformNodes = [ ],
45180
+ tArray = translation ?.array,
45181
+ rArray = rotation ?.normalizedArray,
45182
+ sArray = scale ?.array;
45183
+
45184
+ for (let i = 0; i < count; ++ i)
45185
+ {
45186
+ const transformNode = scene .createNode ("Transform", false);
45187
+
45188
+ if (translation && i < translation .count)
45189
+ {
45190
+ transformNode ._translation = new Numbers_Vector3 (tArray [i * 3 + 0],
45191
+ tArray [i * 3 + 1],
45192
+ tArray [i * 3 + 2]);
45193
+ }
45194
+
45195
+ if (rotation && i < rotation .count)
45196
+ {
45197
+ transformNode ._rotation = new Numbers_Rotation4 (new Numbers_Quaternion (rArray [i * 4 + 0],
45198
+ rArray [i * 4 + 1],
45199
+ rArray [i * 4 + 2],
45200
+ rArray [i * 4 + 3]));
45201
+ }
45202
+
45203
+ if (scale && i < scale .count)
45204
+ {
45205
+ transformNode ._scale = new Numbers_Vector3 (sArray [i * 3 + 0],
45206
+ sArray [i * 3 + 1],
45207
+ sArray [i * 3 + 2]);
45208
+ }
45209
+
45210
+ transformNode ._children = shapeNodes;
45211
+
45212
+ transformNode .setup ();
45213
+ transformNodes .push (transformNode);
45214
+ }
45215
+
45216
+ return transformNodes;
45217
+ },
45501
45218
  nodeChildrenArray (children)
45502
45219
  {
45503
45220
  if (!(children instanceof Array))
45504
45221
  return [ ];
45505
45222
 
45506
- const nodes = [... new Set (children
45223
+ const nodes = Array .from (new Set (children
45507
45224
  .map (index => this .nodes [index] ?.childNode)
45508
45225
  .filter (node => node)
45509
45226
  .filter (node => node .getTypeName () !== "HAnimHumanoid" || !node .getCloneCount ())
45510
- )];
45227
+ ));
45511
45228
 
45512
45229
  return nodes;
45513
45230
  },
@@ -45783,7 +45500,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
45783
45500
  if (!output .array .length)
45784
45501
  return [ ];
45785
45502
 
45786
- return this .createInterpolator (timeSensorNode, node, target, sampler .interpolation, input .array, output .array, timeSensorNode ._cycleInterval .getValue ());
45503
+ return this .createInterpolator (timeSensorNode, node, target, sampler .interpolation, input .array, output, timeSensorNode ._cycleInterval .getValue ());
45787
45504
  },
45788
45505
  createNavigationInfo ()
45789
45506
  {
@@ -46209,29 +45926,9 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46209
45926
  opaque = appearanceNode ._alphaMode .getValue () === "OPAQUE",
46210
45927
  colorNode = scene .createNode (opaque ? "Color" : typeName, false);
46211
45928
 
46212
- const array = opaque && typeName !== "Color"
46213
- ? color .array .filter ((_, i) => (i + 1) % 4)
46214
- : color .array;
46215
-
46216
- switch (color .componentType)
46217
- {
46218
- case 5120: // Int8Array
46219
- case 5122: // Int16Array
46220
- case 5124: // Int32Array
46221
- break;
46222
- case 5121: // Uint8Array
46223
- colorNode ._color = array .map (v => v / 0xff);
46224
- break;
46225
- case 5123: // Uint16Array
46226
- colorNode ._color = array .map (v => v / 0xffff);
46227
- break;
46228
- case 5125: // Uint32Array
46229
- colorNode ._color = array .map (v => v / 0xffffffff);
46230
- break;
46231
- case 5126: // Float32Array
46232
- colorNode ._color = array;
46233
- break;
46234
- }
45929
+ colorNode ._color = opaque && typeName !== "Color"
45930
+ ? color .normalizedArray .filter ((_, i) => (i + 1) % 4)
45931
+ : color .normalizedArray;
46235
45932
 
46236
45933
  colorNode .setup ();
46237
45934
 
@@ -46256,13 +45953,11 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46256
45953
  }
46257
45954
  case 1:
46258
45955
  {
46259
- return texCoords .textureCoordinateNode = [... material .texCoordMappings .entries ()]
46260
- .map (([mapping, i]) => this .createTextureCoordinate (texCoords [i], mapping)) [0];
45956
+ return texCoords .textureCoordinateNode = Array .from (material .texCoordMappings .entries (), ([mapping, i]) => this .createTextureCoordinate (texCoords [i], mapping)) [0];
46261
45957
  }
46262
45958
  default:
46263
45959
  {
46264
- const textureCoordinateNodes = [... material .texCoordMappings .entries ()]
46265
- .map (([mapping, i]) => this .createTextureCoordinate (texCoords [i], mapping))
45960
+ const textureCoordinateNodes = Array .from (material .texCoordMappings .entries (), ([mapping, i]) => this .createTextureCoordinate (texCoords [i], mapping))
46266
45961
  .filter (node => node)
46267
45962
  .sort ((a, b) => Math_Algorithm .cmp (a ._mapping .getValue (), b ._mapping .getValue ()));
46268
45963
 
@@ -46294,7 +45989,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46294
45989
  textureCoordinateNode = scene .createNode ("TextureCoordinate", false);
46295
45990
 
46296
45991
  textureCoordinateNode ._mapping = mapping;
46297
- textureCoordinateNode ._point = texCoord .array;
45992
+ textureCoordinateNode ._point = texCoord .normalizedArray;
46298
45993
 
46299
45994
  textureCoordinateNode .setup ();
46300
45995
 
@@ -46312,7 +46007,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46312
46007
  scene = this .getExecutionContext (),
46313
46008
  normalNode = scene .createNode ("Normal", false);
46314
46009
 
46315
- normalNode ._vector = normal .array;
46010
+ normalNode ._vector = normal .normalizedArray;
46316
46011
 
46317
46012
  if ((targets instanceof Array) && (weights instanceof Array))
46318
46013
  {
@@ -46393,7 +46088,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46393
46088
  const
46394
46089
  start = skin .coordinateNode ._point .length,
46395
46090
  jointsArray = joints .array,
46396
- weightsArray = weights .array,
46091
+ weightsArray = weights .normalizedArray,
46397
46092
  numVertices = jointsArray .length / 4;
46398
46093
 
46399
46094
  for (let v = 0; v < numVertices; ++ v)
@@ -46511,7 +46206,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46511
46206
  {
46512
46207
  case "translation":
46513
46208
  {
46514
- const interpolatorNode = this .createPositionInterpolator (interpolation, times, keyValues, cycleInterval);
46209
+ const interpolatorNode = this .createPositionInterpolator (interpolation, times, keyValues .array, cycleInterval);
46515
46210
 
46516
46211
  scene .addNamedNode (scene .getUniqueName ("TranslationInterpolator"), interpolatorNode);
46517
46212
 
@@ -46522,7 +46217,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46522
46217
  }
46523
46218
  case "rotation":
46524
46219
  {
46525
- const interpolatorNode = this .createOrientationInterpolator (interpolation, times, keyValues, cycleInterval);
46220
+ const interpolatorNode = this .createOrientationInterpolator (interpolation, times, keyValues .normalizedArray, cycleInterval);
46526
46221
 
46527
46222
  scene .addNamedNode (scene .getUniqueName ("RotationInterpolator"), interpolatorNode);
46528
46223
 
@@ -46533,7 +46228,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46533
46228
  }
46534
46229
  case "scale":
46535
46230
  {
46536
- const interpolatorNode = this .createPositionInterpolator (interpolation, times, keyValues, cycleInterval);
46231
+ const interpolatorNode = this .createPositionInterpolator (interpolation, times, keyValues .array, cycleInterval);
46537
46232
 
46538
46233
  scene .addNamedNode (scene .getUniqueName ("ScaleInterpolator"), interpolatorNode);
46539
46234
 
@@ -46560,7 +46255,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46560
46255
  if (!geometryNode)
46561
46256
  continue;
46562
46257
 
46563
- const coordinateInterpolatorNode = this .createArrayInterpolator ("Coordinate", interpolation, times, keyValues, cycleInterval, targets, attributes, "POSITION");
46258
+ const coordinateInterpolatorNode = this .createArrayInterpolator ("CoordinateInterpolator", interpolation, times, keyValues .normalizedArray, cycleInterval, targets, attributes, "POSITION", false);
46564
46259
 
46565
46260
  if (coordinateInterpolatorNode)
46566
46261
  {
@@ -46570,7 +46265,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46570
46265
  scene .addRoute (coordinateInterpolatorNode, "value_changed", geometryNode ._coord, "set_point");
46571
46266
  }
46572
46267
 
46573
- const normalInterpolatorNode = this .createArrayInterpolator ("Normal", interpolation, times, keyValues, cycleInterval, targets, attributes, "NORMAL");
46268
+ const normalInterpolatorNode = this .createArrayInterpolator ("NormalInterpolator", interpolation, times, keyValues .normalizedArray, cycleInterval, targets, attributes, "NORMAL", true);
46574
46269
 
46575
46270
  if (normalInterpolatorNode)
46576
46271
  {
@@ -46647,8 +46342,9 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46647
46342
  keyValues [i + 2]));
46648
46343
  }
46649
46344
 
46650
- const samples = [... Array (Math .floor (times .at (-1) * SAMPLES_PER_SECOND)) .keys ()]
46651
- .map ((_, i, array) => i / (array .length - 1) * times .at (-1));
46345
+ const
46346
+ length = Math .floor (times .at (-1) * SAMPLES_PER_SECOND),
46347
+ samples = Array .from ({ length: length }, (_, i) => i / (length - 1) * times .at (-1))
46652
46348
 
46653
46349
  for (const t of samples)
46654
46350
  {
@@ -46737,8 +46433,9 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46737
46433
  keyValues [i + 3]));
46738
46434
  }
46739
46435
 
46740
- const samples = [... Array (Math .floor (times .at (-1) * SAMPLES_PER_SECOND)) .keys ()]
46741
- .map ((_, i, array) => i / (array .length - 1) * times .at (-1));
46436
+ const
46437
+ length = Math .floor (times .at (-1) * SAMPLES_PER_SECOND),
46438
+ samples = Array .from ({ length: length }, (_, i) => i / (length - 1) * times .at (-1))
46742
46439
 
46743
46440
  for (const t of samples)
46744
46441
  {
@@ -46754,7 +46451,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46754
46451
  }
46755
46452
  }
46756
46453
  },
46757
- createArrayInterpolator (Type, interpolation, times, weights, cycleInterval, targets, accessors, key)
46454
+ createArrayInterpolator (typeName, interpolation, times, weights, cycleInterval, targets, accessors, key, normalized)
46758
46455
  {
46759
46456
  const
46760
46457
  scene = this .getExecutionContext (),
@@ -46767,7 +46464,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46767
46464
  {
46768
46465
  case "STEP":
46769
46466
  {
46770
- const interpolatorNode = scene .createNode (`${Type}Interpolator`, false);
46467
+ const interpolatorNode = scene .createNode (typeName, false);
46771
46468
 
46772
46469
  // Key
46773
46470
 
@@ -46780,14 +46477,14 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46780
46477
 
46781
46478
  const w = Array .from (targets .keys (), i => weights [i]);
46782
46479
 
46783
- for (const value of this .applyMorphTargets (accessor .field, targets, key, w))
46480
+ for (const value of this .applyMorphTargets (accessor .field, targets, key, w, normalized))
46784
46481
  interpolatorNode ._keyValue .push (value);
46785
46482
 
46786
46483
  for (let t = 1, length = times .length; t < length; ++ t)
46787
46484
  {
46788
46485
  const
46789
46486
  w = Array .from (targets .keys (), i => weights [t * targets .length + i]),
46790
- values = this .applyMorphTargets (accessor .field, targets, key, w);
46487
+ values = this .applyMorphTargets (accessor .field, targets, key, w, normalized);
46791
46488
 
46792
46489
  for (const value of values)
46793
46490
  interpolatorNode ._keyValue .push (value);
@@ -46805,7 +46502,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46805
46502
  default:
46806
46503
  case "LINEAR":
46807
46504
  {
46808
- const interpolatorNode = scene .createNode (`${Type}Interpolator`, false);
46505
+ const interpolatorNode = scene .createNode (typeName, false);
46809
46506
 
46810
46507
  // Key
46811
46508
 
@@ -46817,7 +46514,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46817
46514
  {
46818
46515
  const w = Array .from (targets .keys (), i => weights [t * targets .length + i]);
46819
46516
 
46820
- for (const value of this .applyMorphTargets (accessor .field, targets, key, w))
46517
+ for (const value of this .applyMorphTargets (accessor .field, targets, key, w, normalized))
46821
46518
  interpolatorNode ._keyValue .push (value);
46822
46519
  }
46823
46520
 
@@ -46829,12 +46526,13 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46829
46526
  }
46830
46527
  case "CUBICSPLINE":
46831
46528
  {
46832
- const interpolatorNode = scene .createNode (`${Type}Interpolator`, false);
46529
+ const interpolatorNode = scene .createNode (typeName, false);
46833
46530
 
46834
46531
  // Key
46835
46532
 
46836
- const samples = [... Array (Math .floor (times .at (-1) * SAMPLES_PER_SECOND)) .keys ()]
46837
- .map ((_, i, array) => i / (array .length - 1) * times .at (-1));
46533
+ const
46534
+ length = Math .floor (times .at (-1) * SAMPLES_PER_SECOND),
46535
+ samples = Array .from ({ length: length }, (_, i) => i / (length - 1) * times .at (-1))
46838
46536
 
46839
46537
  // KeyValue
46840
46538
 
@@ -46844,7 +46542,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46844
46542
 
46845
46543
  const w = Array .from (targets .keys (), i => this .cubicSplineScalarArray (t, times, weights, targets .length, i));
46846
46544
 
46847
- for (const value of this .applyMorphTargets (accessor .field, targets, key, w))
46545
+ for (const value of this .applyMorphTargets (accessor .field, targets, key, w, normalized))
46848
46546
  interpolatorNode ._keyValue .push (value);
46849
46547
  }
46850
46548
 
@@ -46860,7 +46558,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46860
46558
  {
46861
46559
  const value = new Numbers_Vector3 (0, 0, 0);
46862
46560
 
46863
- return function (array, targets, key, weights)
46561
+ return function (array, targets, key, weights, normalized)
46864
46562
  {
46865
46563
  const vectors = Array .from (array, v => v .getValue () .copy ());
46866
46564
 
@@ -46877,7 +46575,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46877
46575
  continue;
46878
46576
 
46879
46577
  const
46880
- array = accessor .array,
46578
+ array = accessor [normalized ? "normalizedArray" : "array"],
46881
46579
  length = array .length;
46882
46580
 
46883
46581
  for (let a = 0, p = 0; a < length; a += 3, ++ p)
@@ -46967,7 +46665,7 @@ const GLTF2Parser_default_ = GLTF2Parser;
46967
46665
  x_ite_Namespace .add ("GLTF2Parser", "x_ite/Parser/GLTF2Parser", GLTF2Parser_default_);
46968
46666
  /* harmony default export */ const Parser_GLTF2Parser = (GLTF2Parser_default_);
46969
46667
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/GLB2Parser.js
46970
- /* provided dependency */ var GLB2Parser_$ = __webpack_require__(864);
46668
+ /* provided dependency */ var GLB2Parser_$ = __webpack_require__(659);
46971
46669
  /*******************************************************************************
46972
46670
  *
46973
46671
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47119,7 +46817,7 @@ const GLB2Parser_default_ = GLB2Parser;
47119
46817
  x_ite_Namespace .add ("GLB2Parser", "x_ite/Parser/GLB2Parser", GLB2Parser_default_);
47120
46818
  /* harmony default export */ const Parser_GLB2Parser = (GLB2Parser_default_);
47121
46819
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/OBJParser.js
47122
- /* provided dependency */ var OBJParser_$ = __webpack_require__(864);
46820
+ /* provided dependency */ var OBJParser_$ = __webpack_require__(659);
47123
46821
  /*******************************************************************************
47124
46822
  *
47125
46823
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50474,8 +50172,8 @@ const MatrixStack_default_ = MatrixStack;
50474
50172
  x_ite_Namespace .add ("MatrixStack", "standard/Math/Utility/MatrixStack", MatrixStack_default_);
50475
50173
  /* harmony default export */ const Utility_MatrixStack = (MatrixStack_default_);
50476
50174
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/SVGParser.js
50477
- /* provided dependency */ var SVGParser_$ = __webpack_require__(864);
50478
- /* provided dependency */ var libtess = __webpack_require__(180);
50175
+ /* provided dependency */ var SVGParser_$ = __webpack_require__(659);
50176
+ /* provided dependency */ var libtess = __webpack_require__(793);
50479
50177
  /*******************************************************************************
50480
50178
  *
50481
50179
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53243,7 +52941,7 @@ const SVGParser_default_ = SVGParser;
53243
52941
  x_ite_Namespace .add ("SVGParser", "x_ite/Parser/SVGParser", SVGParser_default_);
53244
52942
  /* harmony default export */ const Parser_SVGParser = (SVGParser_default_);
53245
52943
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/GoldenGate.js
53246
- /* provided dependency */ var GoldenGate_$ = __webpack_require__(864);
52944
+ /* provided dependency */ var GoldenGate_$ = __webpack_require__(659);
53247
52945
  /*******************************************************************************
53248
52946
  *
53249
52947
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53580,7 +53278,7 @@ const Plane3_default_ = Plane3;
53580
53278
  x_ite_Namespace .add ("Plane3", "standard/Math/Geometry/Plane3", Plane3_default_);
53581
53279
  /* harmony default export */ const Geometry_Plane3 = (Plane3_default_);
53582
53280
  ;// CONCATENATED MODULE: ./src/standard/Math/Geometry/Triangle3.js
53583
- /* provided dependency */ var Triangle3_libtess = __webpack_require__(180);
53281
+ /* provided dependency */ var Triangle3_libtess = __webpack_require__(793);
53584
53282
  /*******************************************************************************
53585
53283
  *
53586
53284
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60238,6 +59936,7 @@ Object .assign (Object .setPrototypeOf (X3DBackgroundNode .prototype, Core_X3DBi
60238
59936
  gl .uniformMatrix4fv (shaderNode .x3d_ProjectionMatrix, false, this .projectionMatrixArray);
60239
59937
  gl .uniformMatrix4fv (shaderNode .x3d_ModelViewMatrix, false, this .modelViewMatrixArray);
60240
59938
 
59939
+ gl .uniform3f (shaderNode .x3d_EmissiveColor, 1, 1, 1)
60241
59940
  gl .uniform1f (shaderNode .x3d_Transparency, transparency)
60242
59941
  gl .uniform1i (shaderNode .x3d_TextureCoordinateGeneratorMode [0], 0);
60243
59942
 
@@ -60965,7 +60664,7 @@ const X3DTexture2DNode_default_ = X3DTexture2DNode;
60965
60664
  x_ite_Namespace .add ("X3DTexture2DNode", "x_ite/Components/Texturing/X3DTexture2DNode", X3DTexture2DNode_default_);
60966
60665
  /* harmony default export */ const Texturing_X3DTexture2DNode = (X3DTexture2DNode_default_);
60967
60666
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Texturing/ImageTexture.js
60968
- /* provided dependency */ var ImageTexture_$ = __webpack_require__(864);
60667
+ /* provided dependency */ var ImageTexture_$ = __webpack_require__(659);
60969
60668
  /*******************************************************************************
60970
60669
  *
60971
60670
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -65570,7 +65269,7 @@ const X3DWorld_default_ = X3DWorld;
65570
65269
  x_ite_Namespace .add ("X3DWorld", "x_ite/Execution/X3DWorld", X3DWorld_default_);
65571
65270
  /* harmony default export */ const Execution_X3DWorld = (X3DWorld_default_);
65572
65271
  ;// CONCATENATED MODULE: ./src/x_ite/InputOutput/FileLoader.js
65573
- /* provided dependency */ var FileLoader_$ = __webpack_require__(864);
65272
+ /* provided dependency */ var FileLoader_$ = __webpack_require__(659);
65574
65273
  /*******************************************************************************
65575
65274
  *
65576
65275
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -80036,6 +79735,7 @@ Object .assign (DirectionalLightContainer .prototype,
80036
79735
  gl .uniform1f (shaderObject .x3d_LightIntensity [i], lightNode .getIntensity ());
80037
79736
  gl .uniform1f (shaderObject .x3d_LightAmbientIntensity [i], lightNode .getAmbientIntensity ());
80038
79737
  gl .uniform3f (shaderObject .x3d_LightDirection [i], direction .x, direction .y, direction .z);
79738
+ gl .uniform1f (shaderObject .x3d_LightRadius [i], -1);
80039
79739
 
80040
79740
  if (this .shadowBuffer)
80041
79741
  {
@@ -80580,7 +80280,8 @@ Object .assign (Object .setPrototypeOf (PointLight .prototype, Lighting_X3DLight
80580
80280
  },
80581
80281
  getRadius ()
80582
80282
  {
80583
- return Math .max (0, this ._radius .getValue ());
80283
+ // Negative values mean infinity.
80284
+ return this ._radius .getValue ();
80584
80285
  },
80585
80286
  getLights ()
80586
80287
  {
@@ -80925,7 +80626,8 @@ Object .assign (Object .setPrototypeOf (SpotLight .prototype, Lighting_X3DLightN
80925
80626
  },
80926
80627
  getRadius ()
80927
80628
  {
80928
- return Math .max (0, this ._radius .getValue ());
80629
+ // Negative values mean infinity.
80630
+ return this ._radius .getValue ();
80929
80631
  },
80930
80632
  getBeamWidth ()
80931
80633
  {
@@ -89079,7 +88781,7 @@ const X3DShaderNode_default_ = X3DShaderNode;
89079
88781
  x_ite_Namespace .add ("X3DShaderNode", "x_ite/Components/Shaders/X3DShaderNode", X3DShaderNode_default_);
89080
88782
  /* harmony default export */ const Shaders_X3DShaderNode = (X3DShaderNode_default_);
89081
88783
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js
89082
- /* provided dependency */ var X3DProgrammableShaderObject_$ = __webpack_require__(864);
88784
+ /* provided dependency */ var X3DProgrammableShaderObject_$ = __webpack_require__(659);
89083
88785
  /*******************************************************************************
89084
88786
  *
89085
88787
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -92104,16 +91806,16 @@ const ShaderSource_default_ = ShaderSource;
92104
91806
 
92105
91807
  x_ite_Namespace .add ("ShaderSource", "x_ite/Browser/Shaders/ShaderSource", ShaderSource_default_);
92106
91808
  /* harmony default export */ const Shaders_ShaderSource = (ShaderSource_default_);
92107
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/include/ClipPlanes1.glsl.js
91809
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/common/ClipPlanes1.glsl.js
92108
91810
  const ClipPlanes1_glsl_default_ = /* glsl */ `#if defined(X3D_CLIP_PLANES)
92109
91811
  uniform vec4 x3d_ClipPlane[X3D_NUM_CLIP_PLANES];void clip(){for(int i=0;i<X3D_NUM_CLIP_PLANES;++i){if(dot(vertex,x3d_ClipPlane[i].xyz)-x3d_ClipPlane[i].w<0.0)discard;}}
92110
91812
  #endif
92111
91813
  `
92112
91814
  ;
92113
91815
 
92114
- x_ite_Namespace .add ("ClipPlanes1.glsl", "assets/shaders/webgl1/include/ClipPlanes1.glsl", ClipPlanes1_glsl_default_);
91816
+ x_ite_Namespace .add ("ClipPlanes1.glsl", "assets/shaders/webgl1/common/ClipPlanes1.glsl", ClipPlanes1_glsl_default_);
92115
91817
  /* harmony default export */ const ClipPlanes1_glsl = (ClipPlanes1_glsl_default_);
92116
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/include/Colors1.glsl.js
91818
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/common/Colors1.glsl.js
92117
91819
  const Colors1_glsl_default_ = /* glsl */ `vec4 SRGBtoLINEAR(const in vec4 srgbIn){
92118
91820
  #if defined(MANUAL_SRGB)
92119
91821
  #if defined(SRGB_FAST_APPROXIMATION)
@@ -92134,9 +91836,9 @@ vec4 Gamma(const in vec4 color){return vec4(pow(color.rgb,vec3(1.0/2.2)),color.a
92134
91836
  `
92135
91837
  ;
92136
91838
 
92137
- x_ite_Namespace .add ("Colors1.glsl", "assets/shaders/webgl1/include/Colors1.glsl", Colors1_glsl_default_);
91839
+ x_ite_Namespace .add ("Colors1.glsl", "assets/shaders/webgl1/common/Colors1.glsl", Colors1_glsl_default_);
92138
91840
  /* harmony default export */ const Colors1_glsl = (Colors1_glsl_default_);
92139
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/include/Fog1.glsl.js
91841
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/common/Fog1.glsl.js
92140
91842
  const Fog1_glsl_default_ = /* glsl */ `#if defined(X3D_FOG)
92141
91843
  uniform x3d_FogParameters x3d_Fog;float getFogInterpolant(){
92142
91844
  #if defined(X3D_FOG_COORDS)
@@ -92154,9 +91856,9 @@ return exp(-dV/max(0.001,visibilityRange-dV));
92154
91856
  `
92155
91857
  ;
92156
91858
 
92157
- x_ite_Namespace .add ("Fog1.glsl", "assets/shaders/webgl1/include/Fog1.glsl", Fog1_glsl_default_);
91859
+ x_ite_Namespace .add ("Fog1.glsl", "assets/shaders/webgl1/common/Fog1.glsl", Fog1_glsl_default_);
92158
91860
  /* harmony default export */ const Fog1_glsl = (Fog1_glsl_default_);
92159
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/include/Fragment1.glsl.js
91861
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/common/Fragment1.glsl.js
92160
91862
  const Fragment1_glsl_default_ = /* glsl */ `#if defined(X3D_NORMAL_TEXTURE)
92161
91863
  #extension GL_OES_standard_derivatives:enable
92162
91864
  #endif
@@ -92257,9 +91959,9 @@ gl_FragDepthEXT=log2(depth)*x3d_LogarithmicFarFactor1_2;
92257
91959
  `
92258
91960
  ;
92259
91961
 
92260
- x_ite_Namespace .add ("Fragment1.glsl", "assets/shaders/webgl1/include/Fragment1.glsl", Fragment1_glsl_default_);
91962
+ x_ite_Namespace .add ("Fragment1.glsl", "assets/shaders/webgl1/common/Fragment1.glsl", Fragment1_glsl_default_);
92261
91963
  /* harmony default export */ const Fragment1_glsl = (Fragment1_glsl_default_);
92262
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/include/Hatch1.glsl.js
91964
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/common/Hatch1.glsl.js
92263
91965
  const Hatch1_glsl_default_ = /* glsl */ `#if(defined(X3D_GEOMETRY_2D)||defined(X3D_GEOMETRY_3D))&&defined(X3D_STYLE_PROPERTIES)
92264
91966
  uniform x3d_FillPropertiesParameters x3d_FillProperties;vec4 getHatchColor(vec4 color){vec4 finalColor=x3d_FillProperties.filled?color:vec4(0.0);
92265
91967
  #if defined(X3D_STYLE_PROPERTIES_TEXTURE)
@@ -92270,14 +91972,14 @@ return finalColor;}
92270
91972
  `
92271
91973
  ;
92272
91974
 
92273
- x_ite_Namespace .add ("Hatch1.glsl", "assets/shaders/webgl1/include/Hatch1.glsl", Hatch1_glsl_default_);
91975
+ x_ite_Namespace .add ("Hatch1.glsl", "assets/shaders/webgl1/common/Hatch1.glsl", Hatch1_glsl_default_);
92274
91976
  /* harmony default export */ const Hatch1_glsl = (Hatch1_glsl_default_);
92275
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/include/Material1.glsl.js
91977
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/common/Material1.glsl.js
92276
91978
  const Material1_glsl_default_ = /* glsl */ `uniform x3d_MaterialParameters x3d_Material;
92277
91979
  #if defined(X3D_LIGHTING)
92278
91980
  #pragma X3D include "SpotFactor.glsl"
92279
91981
  #pragma X3D include "Shadow.glsl"
92280
- uniform x3d_LightSourceParameters x3d_LightSource[X3D_NUM_LIGHTS];vec3 getMaterialColor(const in vec3 vertex,const in vec3 N,const in vec3 ambientColor,const in vec3 diffuseColor,const in vec3 specularColor,const in float shininess){vec3 V=normalize(-vertex);vec3 finalColor=vec3(0.0);for(int i=0;i<X3D_NUM_LIGHTS;++i){x3d_LightSourceParameters light=x3d_LightSource[i];vec3 vL=light.location-vertex;float dL=length(light.matrix*vL);bool di=light.type==x3d_DirectionalLight;if(di||dL<=light.radius){vec3 d=light.direction;vec3 c=light.attenuation;vec3 L=di?-d:normalize(vL);vec3 H=normalize(L+V);float lightAngle=max(dot(N,L),0.0);vec3 diffuseTerm=diffuseColor*lightAngle;float specularFactor=shininess>0.0?pow(max(dot(N,H),0.0),shininess*128.0):1.0;vec3 specularTerm=specularColor*specularFactor;float attenuationFactor=di?1.0:1.0/max(dot(c,vec3(1.0,dL,dL*dL)),1.0);float spotFactor=light.type==x3d_SpotLight?getSpotFactor(light.cutOffAngle,light.beamWidth,L,d):1.0;float attenuationSpotFactor=attenuationFactor*spotFactor;vec3 ambientTerm=light.ambientIntensity*ambientColor;vec3 diffuseSpecularTerm=light.intensity*(diffuseTerm+specularTerm);
91982
+ uniform x3d_LightSourceParameters x3d_LightSource[X3D_NUM_LIGHTS];vec3 getMaterialColor(const in vec3 vertex,const in vec3 N,const in vec3 ambientColor,const in vec3 diffuseColor,const in vec3 specularColor,const in float shininess){vec3 V=normalize(-vertex);vec3 finalColor=vec3(0.0);for(int i=0;i<X3D_NUM_LIGHTS;++i){x3d_LightSourceParameters light=x3d_LightSource[i];vec3 vL=light.location-vertex;float dL=length(light.matrix*vL);bool di=light.type==x3d_DirectionalLight;if(di||dL<=light.radius||light.radius<0.0){vec3 d=light.direction;vec3 c=light.attenuation;vec3 L=di?-d:normalize(vL);vec3 H=normalize(L+V);float lightAngle=max(dot(N,L),0.0);vec3 diffuseTerm=diffuseColor*lightAngle;float specularFactor=shininess>0.0?pow(max(dot(N,H),0.0),shininess*128.0):1.0;vec3 specularTerm=specularColor*specularFactor;float attenuationFactor=di?1.0:1.0/max(dot(c,vec3(1.0,dL,dL*dL)),1.0);float spotFactor=light.type==x3d_SpotLight?getSpotFactor(light.cutOffAngle,light.beamWidth,L,d):1.0;float attenuationSpotFactor=attenuationFactor*spotFactor;vec3 ambientTerm=light.ambientIntensity*ambientColor;vec3 diffuseSpecularTerm=light.intensity*(diffuseTerm+specularTerm);
92281
91983
  #if defined(X3D_FRAGMENT_SHADER)&&defined(X3D_SHADOWS)
92282
91984
  if(lightAngle>0.0&&light.shadowIntensity>0.0)diffuseSpecularTerm=mix(diffuseSpecularTerm,light.shadowColor,getShadowIntensity(i,light));
92283
91985
  #endif
@@ -92286,9 +91988,9 @@ finalColor+=attenuationSpotFactor*light.color*(ambientTerm+diffuseSpecularTerm);
92286
91988
  `
92287
91989
  ;
92288
91990
 
92289
- x_ite_Namespace .add ("Material1.glsl", "assets/shaders/webgl1/include/Material1.glsl", Material1_glsl_default_);
91991
+ x_ite_Namespace .add ("Material1.glsl", "assets/shaders/webgl1/common/Material1.glsl", Material1_glsl_default_);
92290
91992
  /* harmony default export */ const Material1_glsl = (Material1_glsl_default_);
92291
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/include/Normal1.glsl.js
91993
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/common/Normal1.glsl.js
92292
91994
  const Normal1_glsl_default_ = /* glsl */ `#if defined(X3D_NORMAL_TEXTURE)
92293
91995
  mat3 getTBNMatrix(const in vec2 texCoord){vec3 pos_dx=dFdx(vertex);vec3 pos_dy=dFdy(vertex);vec3 tex_dx=dFdx(vec3(texCoord,0.0));vec3 tex_dy=dFdy(vec3(texCoord,0.0));vec3 t=(tex_dy.t*pos_dx-tex_dx.t*pos_dy)/(tex_dx.s*tex_dy.t-tex_dy.s*tex_dx.t);vec3 N=normalize(normal);vec3 T=normalize(t-N*dot(N,t));vec3 B=normalize(cross(N,T));mat3 tbn=mat3(T,B,N);return tbn;}
92294
91996
  #endif
@@ -92311,16 +92013,16 @@ return normalize(normal)*facing;
92311
92013
  `
92312
92014
  ;
92313
92015
 
92314
- x_ite_Namespace .add ("Normal1.glsl", "assets/shaders/webgl1/include/Normal1.glsl", Normal1_glsl_default_);
92016
+ x_ite_Namespace .add ("Normal1.glsl", "assets/shaders/webgl1/common/Normal1.glsl", Normal1_glsl_default_);
92315
92017
  /* harmony default export */ const Normal1_glsl = (Normal1_glsl_default_);
92316
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/include/Perlin1.glsl.js
92018
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/common/Perlin1.glsl.js
92317
92019
  const Perlin1_glsl_default_ = /* glsl */ `float rand(const in vec2 co){return fract(sin(dot(co.xy,vec2(12.9898,78.233)))*43758.5453);}float rand(const in vec2 co,const in float l){return rand(vec2(rand(co),l));}float rand(const in vec2 co,const in float l,const in float t){return rand(vec2(rand(co,l),t));}float perlin(const in vec2 p,const in float dim,const in float time){const float M_PI=3.14159265358979323846;vec2 pos=floor(p*dim);vec2 posx=pos+vec2(1.0,0.0);vec2 posy=pos+vec2(0.0,1.0);vec2 posxy=pos+vec2(1.0);float c=rand(pos,dim,time);float cx=rand(posx,dim,time);float cy=rand(posy,dim,time);float cxy=rand(posxy,dim,time);vec2 d=fract(p*dim);d=-0.5*cos(d*M_PI)+0.5;float ccx=mix(c,cx,d.x);float cycxy=mix(cy,cxy,d.x);float center=mix(ccx,cycxy,d.y);return center*2.0-1.0;}vec3 perlin(const in vec3 p){return vec3(perlin(p.xy,1.0,0.0),perlin(p.yz,1.0,0.0),perlin(p.zx,1.0,0.0));}
92318
92020
  `
92319
92021
  ;
92320
92022
 
92321
- x_ite_Namespace .add ("Perlin1.glsl", "assets/shaders/webgl1/include/Perlin1.glsl", Perlin1_glsl_default_);
92023
+ x_ite_Namespace .add ("Perlin1.glsl", "assets/shaders/webgl1/common/Perlin1.glsl", Perlin1_glsl_default_);
92322
92024
  /* harmony default export */ const Perlin1_glsl = (Perlin1_glsl_default_);
92323
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/include/Point1.glsl.js
92025
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/common/Point1.glsl.js
92324
92026
  const Point1_glsl_default_ = /* glsl */ `#if defined(X3D_GEOMETRY_0D)&&defined(X3D_STYLE_PROPERTIES)
92325
92027
  #if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)
92326
92028
  void setPointTexCoords(){vec4 texCoord=vec4(gl_PointCoord.x,1.0-gl_PointCoord.y,0.0,1.0);
@@ -92346,9 +92048,9 @@ varying float pointSize;vec4 getPointColor(in vec4 color){if(pointSize>1.0)color
92346
92048
  `
92347
92049
  ;
92348
92050
 
92349
- x_ite_Namespace .add ("Point1.glsl", "assets/shaders/webgl1/include/Point1.glsl", Point1_glsl_default_);
92051
+ x_ite_Namespace .add ("Point1.glsl", "assets/shaders/webgl1/common/Point1.glsl", Point1_glsl_default_);
92350
92052
  /* harmony default export */ const Point1_glsl = (Point1_glsl_default_);
92351
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/include/PointSize1.glsl.js
92053
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/common/PointSize1.glsl.js
92352
92054
  const PointSize1_glsl_default_ = /* glsl */ `#if defined(X3D_GEOMETRY_0D)&&defined(X3D_STYLE_PROPERTIES)
92353
92055
  uniform x3d_PointPropertiesParameters x3d_PointProperties;varying float pointSize;float getPointSize(const in vec3 vertex){float pointSizeMinValue=x3d_PointProperties.pointSizeMinValue;float pointSizeMaxValue=x3d_PointProperties.pointSizeMaxValue;vec3 attenuation=x3d_PointProperties.attenuation;float dL=length(vertex);float pointSize=0.0;pointSize=x3d_PointProperties.pointSizeScaleFactor;pointSize/=dot(attenuation,vec3(1.0,dL,dL*dL));pointSize=clamp(pointSize,pointSizeMinValue,pointSizeMaxValue);
92354
92056
  #if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURE)
@@ -92361,9 +92063,9 @@ return pointSize+1.0-step(pointSize,1.0);
92361
92063
  `
92362
92064
  ;
92363
92065
 
92364
- x_ite_Namespace .add ("PointSize1.glsl", "assets/shaders/webgl1/include/PointSize1.glsl", PointSize1_glsl_default_);
92066
+ x_ite_Namespace .add ("PointSize1.glsl", "assets/shaders/webgl1/common/PointSize1.glsl", PointSize1_glsl_default_);
92365
92067
  /* harmony default export */ const PointSize1_glsl = (PointSize1_glsl_default_);
92366
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/include/Shadow1.glsl.js
92068
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/common/Shadow1.glsl.js
92367
92069
  const Shadow1_glsl_default_ = /* glsl */ `#if defined(X3D_FRAGMENT_SHADER)&&defined(X3D_SHADOWS)
92368
92070
  uniform sampler2D x3d_ShadowMap[X3D_NUM_LIGHTS];float getShadowDepth(const in int index,const in vec2 shadowCoord){
92369
92071
  #if X3D_NUM_LIGHTS>0
@@ -92409,16 +92111,16 @@ vec4 shadowCoord=light.shadowMatrix*vec4(vertex,1.0);shadowCoord.z-=light.shadow
92409
92111
  `
92410
92112
  ;
92411
92113
 
92412
- x_ite_Namespace .add ("Shadow1.glsl", "assets/shaders/webgl1/include/Shadow1.glsl", Shadow1_glsl_default_);
92114
+ x_ite_Namespace .add ("Shadow1.glsl", "assets/shaders/webgl1/common/Shadow1.glsl", Shadow1_glsl_default_);
92413
92115
  /* harmony default export */ const Shadow1_glsl = (Shadow1_glsl_default_);
92414
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/include/SpotFactor1.glsl.js
92116
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/common/SpotFactor1.glsl.js
92415
92117
  const SpotFactor1_glsl_default_ = /* glsl */ `float getSpotFactor(const in float cutOffAngle,const in float beamWidth,const in vec3 L,const in vec3 d){float spotAngle=acos(clamp(dot(-L,d),-1.0,1.0));if(spotAngle>=cutOffAngle)return 0.0;else if(spotAngle<=beamWidth)return 1.0;return(spotAngle-cutOffAngle)/(beamWidth-cutOffAngle);}
92416
92118
  `
92417
92119
  ;
92418
92120
 
92419
- x_ite_Namespace .add ("SpotFactor1.glsl", "assets/shaders/webgl1/include/SpotFactor1.glsl", SpotFactor1_glsl_default_);
92121
+ x_ite_Namespace .add ("SpotFactor1.glsl", "assets/shaders/webgl1/common/SpotFactor1.glsl", SpotFactor1_glsl_default_);
92420
92122
  /* harmony default export */ const SpotFactor1_glsl = (SpotFactor1_glsl_default_);
92421
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/include/Texture1.glsl.js
92123
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/common/Texture1.glsl.js
92422
92124
  const Texture1_glsl_default_ = /* glsl */ `#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)
92423
92125
  #pragma X3D include "Perlin.glsl"
92424
92126
  uniform mat4 x3d_TextureMatrix[X3D_NUM_TEXTURE_TRANSFORMS];mat4 getTextureMatrix(const in int i){
@@ -92505,9 +92207,16 @@ return textureColor;}
92505
92207
  #if defined(X3D_MULTI_TEXTURING)
92506
92208
  uniform vec4 x3d_MultiTextureColor;uniform x3d_MultiTextureParameters x3d_MultiTexture[X3D_NUM_TEXTURES];
92507
92209
  #endif
92210
+ #if defined(X3D_PHYSICAL_MATERIAL)
92211
+ vec4 sRGBToLinear(const in vec4 srgbIn);
92212
+ #endif
92508
92213
  int minI(const in int a,const in int b){return a<b?a:b;}vec4 getTextureColor(const in vec4 diffuseColor,const in vec4 specularColor){
92509
92214
  #if defined(X3D_MULTI_TEXTURING)
92510
- vec4 currentColor=diffuseColor;for(int i=0;i<X3D_NUM_TEXTURES;++i){vec3 texCoord=getTexCoord(minI(i,X3D_NUM_TEXTURE_TRANSFORMS-1),minI(i,X3D_NUM_TEXTURE_COORDINATES-1));vec4 textureColor=getTexture(i,texCoord);x3d_MultiTextureParameters multiTexture=x3d_MultiTexture[i];vec4 arg1=textureColor;vec4 arg2=currentColor;int source=multiTexture.source;if(source==x3d_Diffuse){arg1=diffuseColor;}else if(source==x3d_Specular){arg1=specularColor;}else if(source==x3d_Factor){arg1=x3d_MultiTextureColor;}int function=multiTexture.function;if(function==x3d_Complement){arg1=1.0-arg1;}else if(function==x3d_AlphaReplicate){arg1.a=arg2.a;}int mode=multiTexture.mode;int alphaMode=multiTexture.alphaMode;if(mode==x3d_Replace){currentColor.rgb=arg1.rgb;}else if(mode==x3d_Modulate){currentColor.rgb=arg1.rgb*arg2.rgb;}else if(mode==x3d_Modulate2X){currentColor.rgb=(arg1.rgb*arg2.rgb)*2.0;}else if(mode==x3d_Modulate4X){currentColor.rgb=(arg1.rgb*arg2.rgb)*4.0;}else if(mode==x3d_Add){currentColor.rgb=arg1.rgb+arg2.rgb;}else if(mode==x3d_AddSigned){currentColor.rgb=arg1.rgb+arg2.rgb-0.5;}else if(mode==x3d_AddSigned2X){currentColor.rgb=(arg1.rgb+arg2.rgb-0.5)*2.0;}else if(mode==x3d_AddSmooth){currentColor.rgb=arg1.rgb+(1.0-arg1.rgb)*arg2.rgb;}else if(mode==x3d_Subtract){currentColor.rgb=arg1.rgb-arg2.rgb;}else if(mode==x3d_BlendDiffuseAlpha){currentColor.rgb=arg1.rgb*diffuseColor.a+arg2.rgb*(1.0-diffuseColor.a);}else if(mode==x3d_BlendTextureAlpha){currentColor.rgb=arg1.rgb*arg1.a+arg2.rgb*(1.0-arg1.a);}else if(mode==x3d_BlendFactorAlpha){currentColor.rgb=arg1.rgb*x3d_MultiTextureColor.a+arg2.rgb*(1.0-x3d_MultiTextureColor.a);}else if(mode==x3d_BlendCurrentAlpha){currentColor.rgb=arg1.rgb*arg2.a+arg2.rgb*(1.0-arg2.a);}else if(mode==x3d_ModulateAlphaAddColor){currentColor.rgb=arg1.rgb+arg1.a*arg2.rgb;}else if(mode==x3d_ModulateInvAlphaAddColor){currentColor.rgb=(1.0-arg1.a)*arg2.rgb+arg1.rgb;}else if(mode==x3d_ModulateInvColorAddAlpha){currentColor.rgb=(1.0-arg1.rgb)*arg2.rgb+arg1.a;}else if(mode==x3d_DotProduct3){currentColor.rgb=vec3(dot(arg1.rgb*2.0-1.0,arg2.rgb*2.0-1.0));}else if(mode==x3d_SelectArg1){currentColor.rgb=arg1.rgb;}else if(mode==x3d_SelectArg2){currentColor.rgb=arg2.rgb;}else if(mode==x3d_Off);if(alphaMode==x3d_Replace){currentColor.a=arg1.a;}else if(alphaMode==x3d_Modulate){currentColor.a=arg1.a*arg2.a;}else if(alphaMode==x3d_Modulate2X){currentColor.a=(arg1.a*arg2.a)*2.0;}else if(alphaMode==x3d_Modulate4X){currentColor.a=(arg1.a*arg2.a)*4.0;}else if(alphaMode==x3d_Add){currentColor.a=arg1.a+arg2.a;}else if(alphaMode==x3d_AddSigned){currentColor.a=arg1.a+arg2.a-0.5;}else if(alphaMode==x3d_AddSigned2X){currentColor.a=(arg1.a+arg2.a-0.5)*2.0;}else if(alphaMode==x3d_AddSmooth){currentColor.a=arg1.a+(1.0-arg1.a)*arg2.a;}else if(alphaMode==x3d_Subtract){currentColor.a=arg1.a-arg2.a;}else if(alphaMode==x3d_BlendDiffuseAlpha){currentColor.a=arg1.a*diffuseColor.a+arg2.a*(1.0-diffuseColor.a);}else if(alphaMode==x3d_BlendTextureAlpha){currentColor.a=arg1.a*arg1.a+arg2.a*(1.0-arg1.a);}else if(alphaMode==x3d_BlendFactorAlpha){currentColor.a=arg1.a*x3d_MultiTextureColor.a+arg2.a*(1.0-x3d_MultiTextureColor.a);}else if(alphaMode==x3d_BlendCurrentAlpha){currentColor.a=arg1.a*arg2.a+arg2.a*(1.0-arg2.a);}else if(alphaMode==x3d_ModulateAlphaAddColor){currentColor.a=arg1.a+arg1.a*arg2.a;}else if(alphaMode==x3d_ModulateInvAlphaAddColor){currentColor.a=(1.0-arg1.a)*arg2.a+arg1.a;}else if(alphaMode==x3d_ModulateInvColorAddAlpha){currentColor.a=(1.0-arg1.a)*arg2.a+arg1.a;}else if(alphaMode==x3d_DotProduct3){currentColor.a=dot(arg1.rgb*2.0-1.0,arg2.rgb*2.0-1.0);}else if(alphaMode==x3d_SelectArg1){currentColor.a=arg1.a;}else if(alphaMode==x3d_SelectArg2){currentColor.a=arg2.a;}else if(alphaMode==x3d_Off);}return currentColor;
92215
+ vec4 currentColor=diffuseColor;for(int i=0;i<X3D_NUM_TEXTURES;++i){vec3 texCoord=getTexCoord(minI(i,X3D_NUM_TEXTURE_TRANSFORMS-1),minI(i,X3D_NUM_TEXTURE_COORDINATES-1));vec4 textureColor=getTexture(i,texCoord);
92216
+ #if defined(X3D_PHYSICAL_MATERIAL)
92217
+ textureColor=sRGBToLinear(textureColor);
92218
+ #endif
92219
+ x3d_MultiTextureParameters multiTexture=x3d_MultiTexture[i];vec4 arg1=textureColor;vec4 arg2=currentColor;int source=multiTexture.source;if(source==x3d_Diffuse){arg1=diffuseColor;}else if(source==x3d_Specular){arg1=specularColor;}else if(source==x3d_Factor){arg1=x3d_MultiTextureColor;}int function=multiTexture.function;if(function==x3d_Complement){arg1=1.0-arg1;}else if(function==x3d_AlphaReplicate){arg1.a=arg2.a;}int mode=multiTexture.mode;int alphaMode=multiTexture.alphaMode;if(mode==x3d_Replace){currentColor.rgb=arg1.rgb;}else if(mode==x3d_Modulate){currentColor.rgb=arg1.rgb*arg2.rgb;}else if(mode==x3d_Modulate2X){currentColor.rgb=(arg1.rgb*arg2.rgb)*2.0;}else if(mode==x3d_Modulate4X){currentColor.rgb=(arg1.rgb*arg2.rgb)*4.0;}else if(mode==x3d_Add){currentColor.rgb=arg1.rgb+arg2.rgb;}else if(mode==x3d_AddSigned){currentColor.rgb=arg1.rgb+arg2.rgb-0.5;}else if(mode==x3d_AddSigned2X){currentColor.rgb=(arg1.rgb+arg2.rgb-0.5)*2.0;}else if(mode==x3d_AddSmooth){currentColor.rgb=arg1.rgb+(1.0-arg1.rgb)*arg2.rgb;}else if(mode==x3d_Subtract){currentColor.rgb=arg1.rgb-arg2.rgb;}else if(mode==x3d_BlendDiffuseAlpha){currentColor.rgb=arg1.rgb*diffuseColor.a+arg2.rgb*(1.0-diffuseColor.a);}else if(mode==x3d_BlendTextureAlpha){currentColor.rgb=arg1.rgb*arg1.a+arg2.rgb*(1.0-arg1.a);}else if(mode==x3d_BlendFactorAlpha){currentColor.rgb=arg1.rgb*x3d_MultiTextureColor.a+arg2.rgb*(1.0-x3d_MultiTextureColor.a);}else if(mode==x3d_BlendCurrentAlpha){currentColor.rgb=arg1.rgb*arg2.a+arg2.rgb*(1.0-arg2.a);}else if(mode==x3d_ModulateAlphaAddColor){currentColor.rgb=arg1.rgb+arg1.a*arg2.rgb;}else if(mode==x3d_ModulateInvAlphaAddColor){currentColor.rgb=(1.0-arg1.a)*arg2.rgb+arg1.rgb;}else if(mode==x3d_ModulateInvColorAddAlpha){currentColor.rgb=(1.0-arg1.rgb)*arg2.rgb+arg1.a;}else if(mode==x3d_DotProduct3){currentColor.rgb=vec3(dot(arg1.rgb*2.0-1.0,arg2.rgb*2.0-1.0));}else if(mode==x3d_SelectArg1){currentColor.rgb=arg1.rgb;}else if(mode==x3d_SelectArg2){currentColor.rgb=arg2.rgb;}else if(mode==x3d_Off);if(alphaMode==x3d_Replace){currentColor.a=arg1.a;}else if(alphaMode==x3d_Modulate){currentColor.a=arg1.a*arg2.a;}else if(alphaMode==x3d_Modulate2X){currentColor.a=(arg1.a*arg2.a)*2.0;}else if(alphaMode==x3d_Modulate4X){currentColor.a=(arg1.a*arg2.a)*4.0;}else if(alphaMode==x3d_Add){currentColor.a=arg1.a+arg2.a;}else if(alphaMode==x3d_AddSigned){currentColor.a=arg1.a+arg2.a-0.5;}else if(alphaMode==x3d_AddSigned2X){currentColor.a=(arg1.a+arg2.a-0.5)*2.0;}else if(alphaMode==x3d_AddSmooth){currentColor.a=arg1.a+(1.0-arg1.a)*arg2.a;}else if(alphaMode==x3d_Subtract){currentColor.a=arg1.a-arg2.a;}else if(alphaMode==x3d_BlendDiffuseAlpha){currentColor.a=arg1.a*diffuseColor.a+arg2.a*(1.0-diffuseColor.a);}else if(alphaMode==x3d_BlendTextureAlpha){currentColor.a=arg1.a*arg1.a+arg2.a*(1.0-arg1.a);}else if(alphaMode==x3d_BlendFactorAlpha){currentColor.a=arg1.a*x3d_MultiTextureColor.a+arg2.a*(1.0-x3d_MultiTextureColor.a);}else if(alphaMode==x3d_BlendCurrentAlpha){currentColor.a=arg1.a*arg2.a+arg2.a*(1.0-arg2.a);}else if(alphaMode==x3d_ModulateAlphaAddColor){currentColor.a=arg1.a+arg1.a*arg2.a;}else if(alphaMode==x3d_ModulateInvAlphaAddColor){currentColor.a=(1.0-arg1.a)*arg2.a+arg1.a;}else if(alphaMode==x3d_ModulateInvColorAddAlpha){currentColor.a=(1.0-arg1.a)*arg2.a+arg1.a;}else if(alphaMode==x3d_DotProduct3){currentColor.a=dot(arg1.rgb*2.0-1.0,arg2.rgb*2.0-1.0);}else if(alphaMode==x3d_SelectArg1){currentColor.a=arg1.a;}else if(alphaMode==x3d_SelectArg2){currentColor.a=arg2.a;}else if(alphaMode==x3d_Off);}return currentColor;
92511
92220
  #else
92512
92221
  vec3 texCoord=getTexCoord(0,0);
92513
92222
  #if defined(X3D_TEXTURE0_2D)
@@ -92517,6 +92226,9 @@ vec4 textureColor=textureCube(x3d_TextureCube[0],texCoord.stp);
92517
92226
  #else
92518
92227
  vec4 textureColor=vec4(0.0);
92519
92228
  #endif
92229
+ #if defined(X3D_PHYSICAL_MATERIAL)
92230
+ textureColor=sRGBToLinear(textureColor);
92231
+ #endif
92520
92232
  return diffuseColor*textureColor;
92521
92233
  #endif
92522
92234
  }
@@ -92534,9 +92246,9 @@ return color;}vec4 getProjectiveTextureColor(in vec4 currentColor){vec3 N=gl_Fro
92534
92246
  `
92535
92247
  ;
92536
92248
 
92537
- x_ite_Namespace .add ("Texture1.glsl", "assets/shaders/webgl1/include/Texture1.glsl", Texture1_glsl_default_);
92249
+ x_ite_Namespace .add ("Texture1.glsl", "assets/shaders/webgl1/common/Texture1.glsl", Texture1_glsl_default_);
92538
92250
  /* harmony default export */ const Texture1_glsl = (Texture1_glsl_default_);
92539
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/include/Vertex1.glsl.js
92251
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/common/Vertex1.glsl.js
92540
92252
  const Vertex1_glsl_default_ = /* glsl */ `uniform mat4 x3d_ProjectionMatrix;uniform mat4 x3d_ModelViewMatrix;
92541
92253
  #if defined(X3D_FOG)&&defined(X3D_FOG_COORDS)
92542
92254
  attribute float x3d_FogDepth;
@@ -92644,41 +92356,18 @@ depth=1.0+gl_Position.w;
92644
92356
  `
92645
92357
  ;
92646
92358
 
92647
- x_ite_Namespace .add ("Vertex1.glsl", "assets/shaders/webgl1/include/Vertex1.glsl", Vertex1_glsl_default_);
92359
+ x_ite_Namespace .add ("Vertex1.glsl", "assets/shaders/webgl1/common/Vertex1.glsl", Vertex1_glsl_default_);
92648
92360
  /* harmony default export */ const Vertex1_glsl = (Vertex1_glsl_default_);
92649
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/include/ClipPlanes2.glsl.js
92361
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/common/ClipPlanes2.glsl.js
92650
92362
  const ClipPlanes2_glsl_default_ = /* glsl */ `#if defined(X3D_CLIP_PLANES)
92651
92363
  uniform vec4 x3d_ClipPlane[X3D_NUM_CLIP_PLANES];void clip(){for(int i=0;i<X3D_NUM_CLIP_PLANES;++i){if(dot(vertex,x3d_ClipPlane[i].xyz)-x3d_ClipPlane[i].w<0.0)discard;}}
92652
92364
  #endif
92653
92365
  `
92654
92366
  ;
92655
92367
 
92656
- x_ite_Namespace .add ("ClipPlanes2.glsl", "assets/shaders/webgl2/include/ClipPlanes2.glsl", ClipPlanes2_glsl_default_);
92368
+ x_ite_Namespace .add ("ClipPlanes2.glsl", "assets/shaders/webgl2/common/ClipPlanes2.glsl", ClipPlanes2_glsl_default_);
92657
92369
  /* harmony default export */ const ClipPlanes2_glsl = (ClipPlanes2_glsl_default_);
92658
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/include/Colors2.glsl.js
92659
- const Colors2_glsl_default_ = /* glsl */ `vec4 SRGBtoLINEAR(const in vec4 srgbIn){
92660
- #if defined(MANUAL_SRGB)
92661
- #if defined(SRGB_FAST_APPROXIMATION)
92662
- vec3 linOut=pow(srgbIn.xyz,vec3(2.2));
92663
- #else
92664
- vec3 bLess=step(vec3(0.04045),srgbIn.xyz);vec3 linOut=mix(srgbIn.xyz/vec3(12.92),pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)),bLess);
92665
- #endif
92666
- return vec4(linOut,srgbIn.w);
92667
- #else
92668
- return srgbIn;
92669
- #endif
92670
- }
92671
- #if defined(MANUAL_SRGB)
92672
- vec4 Gamma(const in vec4 color){return vec4(pow(color.rgb,vec3(1.0/2.2)),color.a);}
92673
- #else
92674
- #define Gamma(color)(color)
92675
- #endif
92676
- `
92677
- ;
92678
-
92679
- x_ite_Namespace .add ("Colors2.glsl", "assets/shaders/webgl2/include/Colors2.glsl", Colors2_glsl_default_);
92680
- /* harmony default export */ const Colors2_glsl = (Colors2_glsl_default_);
92681
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/include/Fog2.glsl.js
92370
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/common/Fog2.glsl.js
92682
92371
  const Fog2_glsl_default_ = /* glsl */ `#if defined(X3D_FOG)
92683
92372
  uniform x3d_FogParameters x3d_Fog;float getFogInterpolant(){
92684
92373
  #if defined(X3D_FOG_COORDS)
@@ -92696,9 +92385,9 @@ return exp(-dV/max(0.001,visibilityRange-dV));
92696
92385
  `
92697
92386
  ;
92698
92387
 
92699
- x_ite_Namespace .add ("Fog2.glsl", "assets/shaders/webgl2/include/Fog2.glsl", Fog2_glsl_default_);
92388
+ x_ite_Namespace .add ("Fog2.glsl", "assets/shaders/webgl2/common/Fog2.glsl", Fog2_glsl_default_);
92700
92389
  /* harmony default export */ const Fog2_glsl = (Fog2_glsl_default_);
92701
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/include/Fragment2.glsl.js
92390
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/common/Fragment2.glsl.js
92702
92391
  const Fragment2_glsl_default_ = /* glsl */ `#if defined(X3D_ALPHA_MODE_MASK)
92703
92392
  uniform float x3d_AlphaCutoff;
92704
92393
  #endif
@@ -92812,9 +92501,9 @@ gl_FragDepth=log2(depth)*x3d_LogarithmicFarFactor1_2;
92812
92501
  `
92813
92502
  ;
92814
92503
 
92815
- x_ite_Namespace .add ("Fragment2.glsl", "assets/shaders/webgl2/include/Fragment2.glsl", Fragment2_glsl_default_);
92504
+ x_ite_Namespace .add ("Fragment2.glsl", "assets/shaders/webgl2/common/Fragment2.glsl", Fragment2_glsl_default_);
92816
92505
  /* harmony default export */ const Fragment2_glsl = (Fragment2_glsl_default_);
92817
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/include/Hatch2.glsl.js
92506
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/common/Hatch2.glsl.js
92818
92507
  const Hatch2_glsl_default_ = /* glsl */ `#if(defined(X3D_GEOMETRY_2D)||defined(X3D_GEOMETRY_3D))&&defined(X3D_STYLE_PROPERTIES)
92819
92508
  uniform x3d_FillPropertiesParameters x3d_FillProperties;vec4 getHatchColor(vec4 color){vec4 finalColor=x3d_FillProperties.filled?color:vec4(0.0);
92820
92509
  #if defined(X3D_STYLE_PROPERTIES_TEXTURE)
@@ -92825,21 +92514,21 @@ return finalColor;}
92825
92514
  `
92826
92515
  ;
92827
92516
 
92828
- x_ite_Namespace .add ("Hatch2.glsl", "assets/shaders/webgl2/include/Hatch2.glsl", Hatch2_glsl_default_);
92517
+ x_ite_Namespace .add ("Hatch2.glsl", "assets/shaders/webgl2/common/Hatch2.glsl", Hatch2_glsl_default_);
92829
92518
  /* harmony default export */ const Hatch2_glsl = (Hatch2_glsl_default_);
92830
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/include/Line22.glsl.js
92519
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/common/Line22.glsl.js
92831
92520
  const Line22_glsl_default_ = /* glsl */ `struct Line2{vec2 point;vec2 direction;};Line2 line2(const in vec2 point1,const in vec2 point2){return Line2(point1,normalize(point2-point1));}vec2 closest_point(const in Line2 line,const in vec2 point){vec2 r=point-line.point;float d=dot(r,line.direction);return line.direction*d+line.point;}
92832
92521
  `
92833
92522
  ;
92834
92523
 
92835
- x_ite_Namespace .add ("Line22.glsl", "assets/shaders/webgl2/include/Line22.glsl", Line22_glsl_default_);
92524
+ x_ite_Namespace .add ("Line22.glsl", "assets/shaders/webgl2/common/Line22.glsl", Line22_glsl_default_);
92836
92525
  /* harmony default export */ const Line22_glsl = (Line22_glsl_default_);
92837
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/include/Material2.glsl.js
92526
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/common/Material2.glsl.js
92838
92527
  const Material2_glsl_default_ = /* glsl */ `uniform x3d_MaterialParameters x3d_Material;
92839
92528
  #if defined(X3D_LIGHTING)
92840
92529
  #pragma X3D include "SpotFactor.glsl"
92841
92530
  #pragma X3D include "Shadow.glsl"
92842
- uniform x3d_LightSourceParameters x3d_LightSource[X3D_NUM_LIGHTS];vec3 getMaterialColor(const in vec3 vertex,const in vec3 N,const in vec3 ambientColor,const in vec3 diffuseColor,const in vec3 specularColor,const in float shininess){vec3 V=normalize(-vertex);vec3 finalColor=vec3(0.0);for(int i=0;i<X3D_NUM_LIGHTS;++i){x3d_LightSourceParameters light=x3d_LightSource[i];vec3 vL=light.location-vertex;float dL=length(light.matrix*vL);bool di=light.type==x3d_DirectionalLight;if(di||dL<=light.radius){vec3 d=light.direction;vec3 c=light.attenuation;vec3 L=di?-d:normalize(vL);vec3 H=normalize(L+V);float lightAngle=max(dot(N,L),0.0);vec3 diffuseTerm=diffuseColor*lightAngle;float specularFactor=shininess>0.0?pow(max(dot(N,H),0.0),shininess*128.0):1.0;vec3 specularTerm=specularColor*specularFactor;float attenuationFactor=di?1.0:1.0/max(dot(c,vec3(1.0,dL,dL*dL)),1.0);float spotFactor=light.type==x3d_SpotLight?getSpotFactor(light.cutOffAngle,light.beamWidth,L,d):1.0;float attenuationSpotFactor=attenuationFactor*spotFactor;vec3 ambientTerm=light.ambientIntensity*ambientColor;vec3 diffuseSpecularTerm=light.intensity*(diffuseTerm+specularTerm);
92531
+ uniform x3d_LightSourceParameters x3d_LightSource[X3D_NUM_LIGHTS];vec3 getMaterialColor(const in vec3 vertex,const in vec3 N,const in vec3 ambientColor,const in vec3 diffuseColor,const in vec3 specularColor,const in float shininess){vec3 V=normalize(-vertex);vec3 finalColor=vec3(0.0);for(int i=0;i<X3D_NUM_LIGHTS;++i){x3d_LightSourceParameters light=x3d_LightSource[i];vec3 vL=light.location-vertex;float dL=length(light.matrix*vL);if(dL<=light.radius||light.radius<0.0){bool di=light.type==x3d_DirectionalLight;vec3 d=light.direction;vec3 c=light.attenuation;vec3 L=di?-d:normalize(vL);vec3 H=normalize(L+V);float lightAngle=max(dot(N,L),0.0);vec3 diffuseTerm=diffuseColor*lightAngle;float specularFactor=shininess>0.0?pow(max(dot(N,H),0.0),shininess*128.0):1.0;vec3 specularTerm=specularColor*specularFactor;float attenuationFactor=di?1.0:1.0/max(dot(c,vec3(1.0,dL,dL*dL)),1.0);float spotFactor=light.type==x3d_SpotLight?getSpotFactor(light.cutOffAngle,light.beamWidth,L,d):1.0;float attenuationSpotFactor=attenuationFactor*spotFactor;vec3 ambientTerm=light.ambientIntensity*ambientColor;vec3 diffuseSpecularTerm=light.intensity*(diffuseTerm+specularTerm);
92843
92532
  #if defined(X3D_FRAGMENT_SHADER)&&defined(X3D_SHADOWS)
92844
92533
  if(lightAngle>0.0&&light.shadowIntensity>0.0)diffuseSpecularTerm=mix(diffuseSpecularTerm,light.shadowColor,getShadowIntensity(i,light));
92845
92534
  #endif
@@ -92848,11 +92537,11 @@ finalColor+=attenuationSpotFactor*light.color*(ambientTerm+diffuseSpecularTerm);
92848
92537
  `
92849
92538
  ;
92850
92539
 
92851
- x_ite_Namespace .add ("Material2.glsl", "assets/shaders/webgl2/include/Material2.glsl", Material2_glsl_default_);
92540
+ x_ite_Namespace .add ("Material2.glsl", "assets/shaders/webgl2/common/Material2.glsl", Material2_glsl_default_);
92852
92541
  /* harmony default export */ const Material2_glsl = (Material2_glsl_default_);
92853
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/include/Normal2.glsl.js
92542
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/common/Normal2.glsl.js
92854
92543
  const Normal2_glsl_default_ = /* glsl */ `#if defined(X3D_NORMAL_TEXTURE)
92855
- mat3 getTBNMatrix(const in vec2 texCoord){vec3 pos_dx=dFdx(vertex);vec3 pos_dy=dFdy(vertex);vec3 tex_dx=dFdx(vec3(texCoord,0.0));vec3 tex_dy=dFdy(vec3(texCoord,0.0));vec3 t=(tex_dy.t*pos_dx-tex_dx.t*pos_dy)/(tex_dx.s*tex_dy.t-tex_dy.s*tex_dx.t);vec3 N=normalize(normal);vec3 T=normalize(t-N*dot(N,t));vec3 B=normalize(cross(N,T));mat3 tbn=mat3(T,B,N);return tbn;}
92544
+ mat3 getTBNMatrix(const in vec2 texCoord){vec3 pos_dx=dFdx(vertex);vec3 pos_dy=dFdy(vertex);vec2 tex_dx=dFdx(texCoord);vec2 tex_dy=dFdy(texCoord);vec3 t=(tex_dy.t*pos_dx-tex_dx.t*pos_dy)/(tex_dx.s*tex_dy.t-tex_dy.s*tex_dx.t);vec3 N=normalize(normal);vec3 T=normalize(t-N*dot(N,t));vec3 B=normalize(cross(N,T));mat3 tbn=mat3(T,B,N);return tbn;}
92856
92545
  #endif
92857
92546
  #if defined(X3D_NORMAL_TEXTURE)
92858
92547
  uniform x3d_NormalTextureParameters x3d_NormalTexture;
@@ -92875,9 +92564,9 @@ return normalize(normal)*facing;
92875
92564
  `
92876
92565
  ;
92877
92566
 
92878
- x_ite_Namespace .add ("Normal2.glsl", "assets/shaders/webgl2/include/Normal2.glsl", Normal2_glsl_default_);
92567
+ x_ite_Namespace .add ("Normal2.glsl", "assets/shaders/webgl2/common/Normal2.glsl", Normal2_glsl_default_);
92879
92568
  /* harmony default export */ const Normal2_glsl = (Normal2_glsl_default_);
92880
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/include/Particle2.glsl.js
92569
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/common/Particle2.glsl.js
92881
92570
  const Particle2_glsl_default_ = /* glsl */ `#if defined(X3D_PARTICLE_SYSTEM)
92882
92571
  #if defined(X3D_TEX_COORD_RAMP)
92883
92572
  uniform sampler2D x3d_TexCoordRamp;in vec4 x3d_Particle;vec4 getParticleTexCoord(const in vec4 texCoord){const int map[6]=int[6](0,1,2,0,2,3);int index0=int(x3d_Particle[3]);return texelFetch(x3d_TexCoordRamp,index0+map[gl_VertexID % 6],0);}
@@ -92892,16 +92581,16 @@ in mat4 x3d_ParticleMatrix;vec4 getParticleVertex(const in vec4 vertex){return x
92892
92581
  `
92893
92582
  ;
92894
92583
 
92895
- x_ite_Namespace .add ("Particle2.glsl", "assets/shaders/webgl2/include/Particle2.glsl", Particle2_glsl_default_);
92584
+ x_ite_Namespace .add ("Particle2.glsl", "assets/shaders/webgl2/common/Particle2.glsl", Particle2_glsl_default_);
92896
92585
  /* harmony default export */ const Particle2_glsl = (Particle2_glsl_default_);
92897
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/include/Perlin2.glsl.js
92586
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/common/Perlin2.glsl.js
92898
92587
  const Perlin2_glsl_default_ = /* glsl */ `float rand(const in vec2 co){return fract(sin(dot(co.xy,vec2(12.9898,78.233)))*43758.5453);}float rand(const in vec2 co,const in float l){return rand(vec2(rand(co),l));}float rand(const in vec2 co,const in float l,const in float t){return rand(vec2(rand(co,l),t));}float perlin(const in vec2 p,const in float dim,const in float time){const float M_PI=3.14159265358979323846;vec2 pos=floor(p*dim);vec2 posx=pos+vec2(1.0,0.0);vec2 posy=pos+vec2(0.0,1.0);vec2 posxy=pos+vec2(1.0);float c=rand(pos,dim,time);float cx=rand(posx,dim,time);float cy=rand(posy,dim,time);float cxy=rand(posxy,dim,time);vec2 d=fract(p*dim);d=-0.5*cos(d*M_PI)+0.5;float ccx=mix(c,cx,d.x);float cycxy=mix(cy,cxy,d.x);float center=mix(ccx,cycxy,d.y);return center*2.0-1.0;}vec3 perlin(const in vec3 p){return vec3(perlin(p.xy,1.0,0.0),perlin(p.yz,1.0,0.0),perlin(p.zx,1.0,0.0));}
92899
92588
  `
92900
92589
  ;
92901
92590
 
92902
- x_ite_Namespace .add ("Perlin2.glsl", "assets/shaders/webgl2/include/Perlin2.glsl", Perlin2_glsl_default_);
92591
+ x_ite_Namespace .add ("Perlin2.glsl", "assets/shaders/webgl2/common/Perlin2.glsl", Perlin2_glsl_default_);
92903
92592
  /* harmony default export */ const Perlin2_glsl = (Perlin2_glsl_default_);
92904
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/include/Point2.glsl.js
92593
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/common/Point2.glsl.js
92905
92594
  const Point2_glsl_default_ = /* glsl */ `#if defined(X3D_GEOMETRY_0D)&&defined(X3D_STYLE_PROPERTIES)
92906
92595
  #if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)
92907
92596
  void setPointTexCoords(){vec4 texCoord=vec4(gl_PointCoord.x,1.0-gl_PointCoord.y,0.0,1.0);
@@ -92927,9 +92616,9 @@ in float pointSize;vec4 getPointColor(in vec4 color){if(pointSize>1.0)color.a*=c
92927
92616
  `
92928
92617
  ;
92929
92618
 
92930
- x_ite_Namespace .add ("Point2.glsl", "assets/shaders/webgl2/include/Point2.glsl", Point2_glsl_default_);
92619
+ x_ite_Namespace .add ("Point2.glsl", "assets/shaders/webgl2/common/Point2.glsl", Point2_glsl_default_);
92931
92620
  /* harmony default export */ const Point2_glsl = (Point2_glsl_default_);
92932
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/include/PointSize2.glsl.js
92621
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/common/PointSize2.glsl.js
92933
92622
  const PointSize2_glsl_default_ = /* glsl */ `#if defined(X3D_GEOMETRY_0D)&&defined(X3D_STYLE_PROPERTIES)
92934
92623
  uniform x3d_PointPropertiesParameters x3d_PointProperties;out float pointSize;float getPointSize(const in vec3 vertex){float pointSizeMinValue=x3d_PointProperties.pointSizeMinValue;float pointSizeMaxValue=x3d_PointProperties.pointSizeMaxValue;vec3 attenuation=x3d_PointProperties.attenuation;float dL=length(vertex);float pointSize=0.0;pointSize=x3d_PointProperties.pointSizeScaleFactor;pointSize/=dot(attenuation,vec3(1.0,dL,dL*dL));pointSize=clamp(pointSize,pointSizeMinValue,pointSizeMaxValue);
92935
92624
  #if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURE)
@@ -92942,9 +92631,9 @@ return pointSize+1.0-step(pointSize,1.0);
92942
92631
  `
92943
92632
  ;
92944
92633
 
92945
- x_ite_Namespace .add ("PointSize2.glsl", "assets/shaders/webgl2/include/PointSize2.glsl", PointSize2_glsl_default_);
92634
+ x_ite_Namespace .add ("PointSize2.glsl", "assets/shaders/webgl2/common/PointSize2.glsl", PointSize2_glsl_default_);
92946
92635
  /* harmony default export */ const PointSize2_glsl = (PointSize2_glsl_default_);
92947
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/include/Shadow2.glsl.js
92636
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/common/Shadow2.glsl.js
92948
92637
  const Shadow2_glsl_default_ = /* glsl */ `#if defined(X3D_FRAGMENT_SHADER)&&defined(X3D_SHADOWS)
92949
92638
  uniform sampler2D x3d_ShadowMap[X3D_NUM_LIGHTS];float getShadowDepth(const in int index,const in vec2 shadowCoord){switch(index){
92950
92639
  #if X3D_NUM_LIGHTS>0
@@ -92990,9 +92679,9 @@ vec4 shadowCoord=light.shadowMatrix*vec4(vertex,1.0);shadowCoord.z-=light.shadow
92990
92679
  `
92991
92680
  ;
92992
92681
 
92993
- x_ite_Namespace .add ("Shadow2.glsl", "assets/shaders/webgl2/include/Shadow2.glsl", Shadow2_glsl_default_);
92682
+ x_ite_Namespace .add ("Shadow2.glsl", "assets/shaders/webgl2/common/Shadow2.glsl", Shadow2_glsl_default_);
92994
92683
  /* harmony default export */ const Shadow2_glsl = (Shadow2_glsl_default_);
92995
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/include/Skin2.glsl.js
92684
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/common/Skin2.glsl.js
92996
92685
  const Skin2_glsl_default_ = /* glsl */ `#if defined(X3D_SKINNING)
92997
92686
  in float x3d_CoordIndex;uniform sampler2D x3d_JointsTexture;uniform sampler2D x3d_DisplacementsTexture;uniform sampler2D x3d_JointMatricesTexture;mat4 getJointMatrix(const in int joint){vec4 a=texelFetch(x3d_JointMatricesTexture,joint*8,0);vec4 b=texelFetch(x3d_JointMatricesTexture,joint*8+1,0);vec4 c=texelFetch(x3d_JointMatricesTexture,joint*8+2,0);vec4 d=texelFetch(x3d_JointMatricesTexture,joint*8+3,0);return mat4(a,b,c,d);}mat3 getDisplacementJointMatrix(const in int joint){mat4 m=getJointMatrix(joint);return mat3(m[0].xyz,m[1].xyz,m[2].xyz);}
92998
92687
  #if defined(X3D_NORMALS)
@@ -93018,16 +92707,16 @@ skinNormal+=(getJointNormalMatrix(joint)*normal-normal)*weight;
93018
92707
  `
93019
92708
  ;
93020
92709
 
93021
- x_ite_Namespace .add ("Skin2.glsl", "assets/shaders/webgl2/include/Skin2.glsl", Skin2_glsl_default_);
92710
+ x_ite_Namespace .add ("Skin2.glsl", "assets/shaders/webgl2/common/Skin2.glsl", Skin2_glsl_default_);
93022
92711
  /* harmony default export */ const Skin2_glsl = (Skin2_glsl_default_);
93023
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/include/SpotFactor2.glsl.js
92712
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/common/SpotFactor2.glsl.js
93024
92713
  const SpotFactor2_glsl_default_ = /* glsl */ `float getSpotFactor(const in float cutOffAngle,const in float beamWidth,const in vec3 L,const in vec3 d){float spotAngle=acos(clamp(dot(-L,d),-1.0,1.0));if(spotAngle>=cutOffAngle)return 0.0;else if(spotAngle<=beamWidth)return 1.0;return(spotAngle-cutOffAngle)/(beamWidth-cutOffAngle);}
93025
92714
  `
93026
92715
  ;
93027
92716
 
93028
- x_ite_Namespace .add ("SpotFactor2.glsl", "assets/shaders/webgl2/include/SpotFactor2.glsl", SpotFactor2_glsl_default_);
92717
+ x_ite_Namespace .add ("SpotFactor2.glsl", "assets/shaders/webgl2/common/SpotFactor2.glsl", SpotFactor2_glsl_default_);
93029
92718
  /* harmony default export */ const SpotFactor2_glsl = (SpotFactor2_glsl_default_);
93030
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/include/Stipple2.glsl.js
92719
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/common/Stipple2.glsl.js
93031
92720
  const Stipple2_glsl_default_ = /* glsl */ `#if defined(X3D_GEOMETRY_1D)&&defined(X3D_STYLE_PROPERTIES)
93032
92721
  #pragma X3D include "Line2.glsl"
93033
92722
  uniform x3d_LinePropertiesParameters x3d_LineProperties;flat in float lengthSoFar;flat in vec2 startPoint;in vec2 midPoint;void stipple(){vec2 point=closest_point(line2(startPoint,midPoint),gl_FragCoord.xy);float s=(lengthSoFar+length(point-startPoint))*x3d_LineProperties.lineStippleScale;
@@ -93047,9 +92736,9 @@ if(x3d_LineProperties.linetype==16)return;int linetype=x3d_LineProperties.linety
93047
92736
  `
93048
92737
  ;
93049
92738
 
93050
- x_ite_Namespace .add ("Stipple2.glsl", "assets/shaders/webgl2/include/Stipple2.glsl", Stipple2_glsl_default_);
92739
+ x_ite_Namespace .add ("Stipple2.glsl", "assets/shaders/webgl2/common/Stipple2.glsl", Stipple2_glsl_default_);
93051
92740
  /* harmony default export */ const Stipple2_glsl = (Stipple2_glsl_default_);
93052
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/include/Texture2.glsl.js
92741
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/common/Texture2.glsl.js
93053
92742
  const Texture2_glsl_default_ = /* glsl */ `#if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)
93054
92743
  #pragma X3D include "Perlin.glsl"
93055
92744
  vec4 texCoords[X3D_NUM_TEXTURE_COORDINATES];void setTexCoords(){
@@ -93100,9 +92789,16 @@ return texture(x3d_TextureCube[1],texCoord.stp);
93100
92789
  #if defined(X3D_MULTI_TEXTURING)
93101
92790
  uniform vec4 x3d_MultiTextureColor;uniform x3d_MultiTextureParameters x3d_MultiTexture[X3D_NUM_TEXTURES];
93102
92791
  #endif
92792
+ #if defined(X3D_PHYSICAL_MATERIAL)
92793
+ vec4 sRGBToLinear(const in vec4 srgbIn);
92794
+ #endif
93103
92795
  vec4 getTextureColor(const in vec4 diffuseColor,const in vec4 specularColor){
93104
92796
  #if defined(X3D_MULTI_TEXTURING)
93105
- vec4 currentColor=diffuseColor;for(int i=0;i<X3D_NUM_TEXTURES;++i){vec3 texCoord=getTexCoord(min(i,X3D_NUM_TEXTURE_TRANSFORMS-1),min(i,X3D_NUM_TEXTURE_COORDINATES-1));vec4 textureColor=getTexture(i,texCoord);x3d_MultiTextureParameters multiTexture=x3d_MultiTexture[i];vec4 arg1=textureColor;vec4 arg2=currentColor;int source=multiTexture.source;switch(source){case x3d_Diffuse:{arg1=diffuseColor;break;}case x3d_Specular:{arg1=specularColor;break;}case x3d_Factor:{arg1=x3d_MultiTextureColor;break;}}int function=multiTexture.function;switch(function){case x3d_Complement:{arg1=1.0-arg1;break;}case x3d_AlphaReplicate:{arg1.a=arg2.a;break;}}int mode=multiTexture.mode;int alphaMode=multiTexture.alphaMode;switch(mode){case x3d_Replace:{currentColor.rgb=arg1.rgb;break;}case x3d_Modulate:{currentColor.rgb=arg1.rgb*arg2.rgb;break;}case x3d_Modulate2X:{currentColor.rgb=(arg1.rgb*arg2.rgb)*2.0;break;}case x3d_Modulate4X:{currentColor.rgb=(arg1.rgb*arg2.rgb)*4.0;break;}case x3d_Add:{currentColor.rgb=arg1.rgb+arg2.rgb;break;}case x3d_AddSigned:{currentColor.rgb=arg1.rgb+arg2.rgb-0.5;break;}case x3d_AddSigned2X:{currentColor.rgb=(arg1.rgb+arg2.rgb-0.5)*2.0;break;}case x3d_AddSmooth:{currentColor.rgb=arg1.rgb+(1.0-arg1.rgb)*arg2.rgb;break;}case x3d_Subtract:{currentColor.rgb=arg1.rgb-arg2.rgb;break;}case x3d_BlendDiffuseAlpha:{currentColor.rgb=arg1.rgb*diffuseColor.a+arg2.rgb*(1.0-diffuseColor.a);break;}case x3d_BlendTextureAlpha:{currentColor.rgb=arg1.rgb*arg1.a+arg2.rgb*(1.0-arg1.a);break;}case x3d_BlendFactorAlpha:{currentColor.rgb=arg1.rgb*x3d_MultiTextureColor.a+arg2.rgb*(1.0-x3d_MultiTextureColor.a);break;}case x3d_BlendCurrentAlpha:{currentColor.rgb=arg1.rgb*arg2.a+arg2.rgb*(1.0-arg2.a);break;}case x3d_ModulateAlphaAddColor:{currentColor.rgb=arg1.rgb+arg1.a*arg2.rgb;break;}case x3d_ModulateInvAlphaAddColor:{currentColor.rgb=(1.0-arg1.a)*arg2.rgb+arg1.rgb;break;}case x3d_ModulateInvColorAddAlpha:{currentColor.rgb=(1.0-arg1.rgb)*arg2.rgb+arg1.a;break;}case x3d_DotProduct3:{currentColor.rgb=vec3(dot(arg1.rgb*2.0-1.0,arg2.rgb*2.0-1.0));break;}case x3d_SelectArg1:{currentColor.rgb=arg1.rgb;break;}case x3d_SelectArg2:{currentColor.rgb=arg2.rgb;break;}case x3d_Off:{break;}}switch(alphaMode){case x3d_Replace:{currentColor.a=arg1.a;break;}case x3d_Modulate:{currentColor.a=arg1.a*arg2.a;break;}case x3d_Modulate2X:{currentColor.a=(arg1.a*arg2.a)*2.0;break;}case x3d_Modulate4X:{currentColor.a=(arg1.a*arg2.a)*4.0;break;}case x3d_Add:{currentColor.a=arg1.a+arg2.a;break;}case x3d_AddSigned:{currentColor.a=arg1.a+arg2.a-0.5;break;}case x3d_AddSigned2X:{currentColor.a=(arg1.a+arg2.a-0.5)*2.0;break;}case x3d_AddSmooth:{currentColor.a=arg1.a+(1.0-arg1.a)*arg2.a;break;}case x3d_Subtract:{currentColor.a=arg1.a-arg2.a;break;}case x3d_BlendDiffuseAlpha:{currentColor.a=arg1.a*diffuseColor.a+arg2.a*(1.0-diffuseColor.a);break;}case x3d_BlendTextureAlpha:{currentColor.a=arg1.a*arg1.a+arg2.a*(1.0-arg1.a);break;}case x3d_BlendFactorAlpha:{currentColor.a=arg1.a*x3d_MultiTextureColor.a+arg2.a*(1.0-x3d_MultiTextureColor.a);break;}case x3d_BlendCurrentAlpha:{currentColor.a=arg1.a*arg2.a+arg2.a*(1.0-arg2.a);break;}case x3d_ModulateAlphaAddColor:{currentColor.a=arg1.a+arg1.a*arg2.a;break;}case x3d_ModulateInvAlphaAddColor:{currentColor.a=(1.0-arg1.a)*arg2.a+arg1.a;break;}case x3d_ModulateInvColorAddAlpha:{currentColor.a=(1.0-arg1.a)*arg2.a+arg1.a;break;}case x3d_DotProduct3:{currentColor.a=dot(arg1.rgb*2.0-1.0,arg2.rgb*2.0-1.0);break;}case x3d_SelectArg1:{currentColor.a=arg1.a;break;}case x3d_SelectArg2:{currentColor.a=arg2.a;break;}case x3d_Off:{break;}}}return currentColor;
92797
+ vec4 currentColor=diffuseColor;for(int i=0;i<X3D_NUM_TEXTURES;++i){vec3 texCoord=getTexCoord(min(i,X3D_NUM_TEXTURE_TRANSFORMS-1),min(i,X3D_NUM_TEXTURE_COORDINATES-1));vec4 textureColor=getTexture(i,texCoord);
92798
+ #if defined(X3D_PHYSICAL_MATERIAL)
92799
+ textureColor=sRGBToLinear(textureColor);
92800
+ #endif
92801
+ x3d_MultiTextureParameters multiTexture=x3d_MultiTexture[i];vec4 arg1=textureColor;vec4 arg2=currentColor;int source=multiTexture.source;switch(source){case x3d_Diffuse:{arg1=diffuseColor;break;}case x3d_Specular:{arg1=specularColor;break;}case x3d_Factor:{arg1=x3d_MultiTextureColor;break;}}int function=multiTexture.function;switch(function){case x3d_Complement:{arg1=1.0-arg1;break;}case x3d_AlphaReplicate:{arg1.a=arg2.a;break;}}int mode=multiTexture.mode;int alphaMode=multiTexture.alphaMode;switch(mode){case x3d_Replace:{currentColor.rgb=arg1.rgb;break;}case x3d_Modulate:{currentColor.rgb=arg1.rgb*arg2.rgb;break;}case x3d_Modulate2X:{currentColor.rgb=(arg1.rgb*arg2.rgb)*2.0;break;}case x3d_Modulate4X:{currentColor.rgb=(arg1.rgb*arg2.rgb)*4.0;break;}case x3d_Add:{currentColor.rgb=arg1.rgb+arg2.rgb;break;}case x3d_AddSigned:{currentColor.rgb=arg1.rgb+arg2.rgb-0.5;break;}case x3d_AddSigned2X:{currentColor.rgb=(arg1.rgb+arg2.rgb-0.5)*2.0;break;}case x3d_AddSmooth:{currentColor.rgb=arg1.rgb+(1.0-arg1.rgb)*arg2.rgb;break;}case x3d_Subtract:{currentColor.rgb=arg1.rgb-arg2.rgb;break;}case x3d_BlendDiffuseAlpha:{currentColor.rgb=arg1.rgb*diffuseColor.a+arg2.rgb*(1.0-diffuseColor.a);break;}case x3d_BlendTextureAlpha:{currentColor.rgb=arg1.rgb*arg1.a+arg2.rgb*(1.0-arg1.a);break;}case x3d_BlendFactorAlpha:{currentColor.rgb=arg1.rgb*x3d_MultiTextureColor.a+arg2.rgb*(1.0-x3d_MultiTextureColor.a);break;}case x3d_BlendCurrentAlpha:{currentColor.rgb=arg1.rgb*arg2.a+arg2.rgb*(1.0-arg2.a);break;}case x3d_ModulateAlphaAddColor:{currentColor.rgb=arg1.rgb+arg1.a*arg2.rgb;break;}case x3d_ModulateInvAlphaAddColor:{currentColor.rgb=(1.0-arg1.a)*arg2.rgb+arg1.rgb;break;}case x3d_ModulateInvColorAddAlpha:{currentColor.rgb=(1.0-arg1.rgb)*arg2.rgb+arg1.a;break;}case x3d_DotProduct3:{currentColor.rgb=vec3(dot(arg1.rgb*2.0-1.0,arg2.rgb*2.0-1.0));break;}case x3d_SelectArg1:{currentColor.rgb=arg1.rgb;break;}case x3d_SelectArg2:{currentColor.rgb=arg2.rgb;break;}case x3d_Off:{break;}}switch(alphaMode){case x3d_Replace:{currentColor.a=arg1.a;break;}case x3d_Modulate:{currentColor.a=arg1.a*arg2.a;break;}case x3d_Modulate2X:{currentColor.a=(arg1.a*arg2.a)*2.0;break;}case x3d_Modulate4X:{currentColor.a=(arg1.a*arg2.a)*4.0;break;}case x3d_Add:{currentColor.a=arg1.a+arg2.a;break;}case x3d_AddSigned:{currentColor.a=arg1.a+arg2.a-0.5;break;}case x3d_AddSigned2X:{currentColor.a=(arg1.a+arg2.a-0.5)*2.0;break;}case x3d_AddSmooth:{currentColor.a=arg1.a+(1.0-arg1.a)*arg2.a;break;}case x3d_Subtract:{currentColor.a=arg1.a-arg2.a;break;}case x3d_BlendDiffuseAlpha:{currentColor.a=arg1.a*diffuseColor.a+arg2.a*(1.0-diffuseColor.a);break;}case x3d_BlendTextureAlpha:{currentColor.a=arg1.a*arg1.a+arg2.a*(1.0-arg1.a);break;}case x3d_BlendFactorAlpha:{currentColor.a=arg1.a*x3d_MultiTextureColor.a+arg2.a*(1.0-x3d_MultiTextureColor.a);break;}case x3d_BlendCurrentAlpha:{currentColor.a=arg1.a*arg2.a+arg2.a*(1.0-arg2.a);break;}case x3d_ModulateAlphaAddColor:{currentColor.a=arg1.a+arg1.a*arg2.a;break;}case x3d_ModulateInvAlphaAddColor:{currentColor.a=(1.0-arg1.a)*arg2.a+arg1.a;break;}case x3d_ModulateInvColorAddAlpha:{currentColor.a=(1.0-arg1.a)*arg2.a+arg1.a;break;}case x3d_DotProduct3:{currentColor.a=dot(arg1.rgb*2.0-1.0,arg2.rgb*2.0-1.0);break;}case x3d_SelectArg1:{currentColor.a=arg1.a;break;}case x3d_SelectArg2:{currentColor.a=arg2.a;break;}case x3d_Off:{break;}}}return currentColor;
93106
92802
  #else
93107
92803
  vec3 texCoord=getTexCoord(0,0);
93108
92804
  #if defined(X3D_TEXTURE0_2D)
@@ -93112,6 +92808,9 @@ vec4 textureColor=texture(x3d_Texture3D[0],texCoord.stp);
93112
92808
  #elif defined(X3D_TEXTURE0_CUBE)
93113
92809
  vec4 textureColor=texture(x3d_TextureCube[0],texCoord.stp);
93114
92810
  #endif
92811
+ #if defined(X3D_PHYSICAL_MATERIAL)
92812
+ textureColor=sRGBToLinear(textureColor);
92813
+ #endif
93115
92814
  return diffuseColor*textureColor;
93116
92815
  #endif
93117
92816
  }
@@ -93129,18 +92828,18 @@ case 1:return texture(x3d_ProjectiveTexture[1],texCoord);
93129
92828
  `
93130
92829
  ;
93131
92830
 
93132
- x_ite_Namespace .add ("Texture2.glsl", "assets/shaders/webgl2/include/Texture2.glsl", Texture2_glsl_default_);
92831
+ x_ite_Namespace .add ("Texture2.glsl", "assets/shaders/webgl2/common/Texture2.glsl", Texture2_glsl_default_);
93133
92832
  /* harmony default export */ const Texture2_glsl = (Texture2_glsl_default_);
93134
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/include/Utils2.glsl.js
92833
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/common/Utils2.glsl.js
93135
92834
  const Utils2_glsl_default_ = /* glsl */ `#if defined(X3D_SKINNING)||defined(X3D_PARTICLE_SYSTEM)
93136
92835
  vec4 texelFetch(const in sampler2D _sampler,const in int index,const in int lod){int x=textureSize(_sampler,lod).x;ivec2 p=ivec2(index % x,index/x);vec4 t=texelFetch(_sampler,p,lod);return t;}
93137
92836
  #endif
93138
92837
  `
93139
92838
  ;
93140
92839
 
93141
- x_ite_Namespace .add ("Utils2.glsl", "assets/shaders/webgl2/include/Utils2.glsl", Utils2_glsl_default_);
92840
+ x_ite_Namespace .add ("Utils2.glsl", "assets/shaders/webgl2/common/Utils2.glsl", Utils2_glsl_default_);
93142
92841
  /* harmony default export */ const Utils2_glsl = (Utils2_glsl_default_);
93143
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/include/Vertex2.glsl.js
92842
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/common/Vertex2.glsl.js
93144
92843
  const Vertex2_glsl_default_ = /* glsl */ `uniform mat4 x3d_ProjectionMatrix;uniform mat4 x3d_ModelViewMatrix;
93145
92844
  #if defined(X3D_GEOMETRY_1D)&&defined(X3D_STYLE_PROPERTIES)
93146
92845
  in vec3 x3d_LineStipple;
@@ -93266,11 +92965,11 @@ depth=1.0+gl_Position.w;
93266
92965
  `
93267
92966
  ;
93268
92967
 
93269
- x_ite_Namespace .add ("Vertex2.glsl", "assets/shaders/webgl2/include/Vertex2.glsl", Vertex2_glsl_default_);
92968
+ x_ite_Namespace .add ("Vertex2.glsl", "assets/shaders/webgl2/common/Vertex2.glsl", Vertex2_glsl_default_);
93270
92969
  /* harmony default export */ const Vertex2_glsl = (Vertex2_glsl_default_);
93271
92970
  ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/Default1.vs.js
93272
92971
  const Default1_vs_default_ = /* glsl */ `precision highp float;precision highp int;precision highp sampler2D;precision highp samplerCube;
93273
- #pragma X3D include "include/Vertex.glsl"
92972
+ #pragma X3D include "common/Vertex.glsl"
93274
92973
  void main(){vertex_main();}
93275
92974
  `
93276
92975
  ;
@@ -93279,8 +92978,8 @@ x_ite_Namespace .add ("Default1.vs", "assets/shaders/webgl1/Default1.vs", Defaul
93279
92978
  /* harmony default export */ const Default1_vs = (Default1_vs_default_);
93280
92979
  ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/Depth1.fs.js
93281
92980
  const Depth1_fs_default_ = /* glsl */ `precision highp float;precision highp int;precision highp sampler2D;varying vec3 vertex;
93282
- #pragma X3D include "include/ClipPlanes.glsl"
93283
- #pragma X3D include "include/Point.glsl"
92981
+ #pragma X3D include "common/ClipPlanes.glsl"
92982
+ #pragma X3D include "common/Point.glsl"
93284
92983
  void main(){
93285
92984
  #if defined(X3D_CLIP_PLANES)
93286
92985
  clip();
@@ -93296,7 +92995,7 @@ x_ite_Namespace .add ("Depth1.fs", "assets/shaders/webgl1/Depth1.fs", Depth1_fs_
93296
92995
  /* harmony default export */ const Depth1_fs = (Depth1_fs_default_);
93297
92996
  ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/Depth1.vs.js
93298
92997
  const Depth1_vs_default_ = /* glsl */ `precision highp float;precision highp int;uniform mat4 x3d_ProjectionMatrix;uniform mat4 x3d_ModelViewMatrix;attribute vec4 x3d_Vertex;varying vec3 vertex;
93299
- #pragma X3D include "include/PointSize.glsl"
92998
+ #pragma X3D include "common/PointSize.glsl"
93300
92999
  void main(){vec4 position=x3d_ModelViewMatrix*x3d_Vertex;vertex=position.xyz;
93301
93000
  #if defined(X3D_GEOMETRY_0D)
93302
93001
  #if defined(X3D_STYLE_PROPERTIES)
@@ -93313,7 +93012,7 @@ x_ite_Namespace .add ("Depth1.vs", "assets/shaders/webgl1/Depth1.vs", Depth1_vs_
93313
93012
  /* harmony default export */ const Depth1_vs = (Depth1_vs_default_);
93314
93013
  ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/Gouraud1.fs.js
93315
93014
  const Gouraud1_fs_default_ = /* glsl */ `precision highp float;precision highp int;precision highp sampler2D;precision highp samplerCube;
93316
- #pragma X3D include "include/Fragment.glsl"
93015
+ #pragma X3D include "common/Fragment.glsl"
93317
93016
  varying vec4 frontColor;
93318
93017
  #if!defined(X3D_GEOMETRY_0D)&&!defined(X3D_GEOMETRY_1D)
93319
93018
  varying vec4 backColor;
@@ -93338,8 +93037,8 @@ x_ite_Namespace .add ("Gouraud1.fs", "assets/shaders/webgl1/Gouraud1.fs", Gourau
93338
93037
  /* harmony default export */ const Gouraud1_fs = (Gouraud1_fs_default_);
93339
93038
  ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/Gouraud1.vs.js
93340
93039
  const Gouraud1_vs_default_ = /* glsl */ `precision highp float;precision highp int;precision highp sampler2D;precision highp samplerCube;
93341
- #pragma X3D include "include/Vertex.glsl"
93342
- #pragma X3D include "include/Material.glsl"
93040
+ #pragma X3D include "common/Vertex.glsl"
93041
+ #pragma X3D include "common/Material.glsl"
93343
93042
  varying vec4 frontColor;
93344
93043
  #if!defined(X3D_GEOMETRY_0D)&&!defined(X3D_GEOMETRY_1D)
93345
93044
  varying vec4 backColor;
@@ -93367,112 +93066,51 @@ backColor=getMaterialColor(-normal,vertex,x3d_Material);
93367
93066
  x_ite_Namespace .add ("Gouraud1.vs", "assets/shaders/webgl1/Gouraud1.vs", Gouraud1_vs_default_);
93368
93067
  /* harmony default export */ const Gouraud1_vs = (Gouraud1_vs_default_);
93369
93068
  ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/PBR1.fs.js
93370
- const PBR1_fs_default_ = /* glsl */ `#extension GL_EXT_shader_texture_lod:enable
93371
- precision highp float;precision highp int;precision highp sampler2D;precision highp samplerCube;
93372
- #pragma X3D include "include/Fragment.glsl"
93373
- #pragma X3D include "include/Colors.glsl"
93374
- #pragma X3D include "include/Normal.glsl"
93375
- #pragma X3D include "include/SpotFactor.glsl"
93376
- #pragma X3D include "include/Shadow.glsl"
93069
+ const PBR1_fs_default_ = /* glsl */ `precision highp float;precision highp int;precision highp sampler2D;precision highp samplerCube;
93070
+ #pragma X3D include "common/Fragment.glsl"
93071
+ #pragma X3D include "common/Normal.glsl"
93072
+ #pragma X3D include "common/Shadow.glsl"
93377
93073
  #if defined(X3D_LIGHTING)
93378
93074
  uniform x3d_LightSourceParameters x3d_LightSource[X3D_NUM_LIGHTS];
93379
93075
  #endif
93380
93076
  uniform x3d_PhysicalMaterialParameters x3d_Material;
93381
- #if defined(USE_IBL)
93382
- uniform samplerCube diffuseEnvironmentTexture;uniform samplerCube specularEnvironmentTexture;uniform sampler2D brdfLUT;
93383
- #endif
93384
- #if defined(X3D_BASE_TEXTURE)
93385
- uniform x3d_BaseTextureParameters x3d_BaseTexture;
93386
- #endif
93387
- vec4 getBaseColor(){float alpha=1.0-x3d_Material.transparency;
93388
- #if defined(X3D_COLOR_MATERIAL)
93389
- vec4 baseParameter=vec4(color.rgb,color.a*alpha);
93390
- #else
93391
- vec4 baseParameter=vec4(x3d_Material.baseColor,alpha);
93392
- #endif
93393
- #if defined(X3D_BASE_TEXTURE)
93394
- vec3 texCoord=getTexCoord(x3d_BaseTexture.textureTransformMapping,x3d_BaseTexture.textureCoordinateMapping);
93395
- #if defined(X3D_BASE_TEXTURE_2D)
93396
- return baseParameter*SRGBtoLINEAR(texture2D(x3d_BaseTexture.texture2D,texCoord.st));
93397
- #elif defined(X3D_BASE_TEXTURE_CUBE)
93398
- return baseParameter*SRGBtoLINEAR(textureCube(x3d_BaseTexture.textureCube,texCoord));
93399
- #endif
93400
- #elif defined(X3D_TEXTURE)
93401
- return getTextureColor(baseParameter,vec4(vec3(1.0),alpha));
93402
- #else
93403
- return baseParameter;
93404
- #endif
93405
- }
93406
- #if defined(X3D_EMISSIVE_TEXTURE)
93407
- uniform x3d_EmissiveTextureParameters x3d_EmissiveTexture;
93408
- #endif
93409
- vec3 getEmissiveColor(){vec3 emissiveParameter=x3d_Material.emissiveColor;
93410
- #if defined(X3D_EMISSIVE_TEXTURE)
93411
- vec3 texCoord=getTexCoord(x3d_EmissiveTexture.textureTransformMapping,x3d_EmissiveTexture.textureCoordinateMapping);
93412
- #if defined(X3D_EMISSIVE_TEXTURE_2D)
93413
- return emissiveParameter*SRGBtoLINEAR(texture2D(x3d_EmissiveTexture.texture2D,texCoord.st)).rgb;
93414
- #elif defined(X3D_EMISSIVE_TEXTURE_CUBE)
93415
- return emissiveParameter*SRGBtoLINEAR(textureCube(x3d_EmissiveTexture.textureCube,texCoord)).rgb;
93416
- #endif
93417
- #else
93418
- return emissiveParameter.rgb;
93077
+ #pragma X3D include "pbr/BDRF.glsl"
93078
+ #pragma X3D include "pbr/ToneMapping.glsl"
93079
+ #pragma X3D include "pbr/MaterialInfo.glsl"
93080
+ #pragma X3D include "pbr/Punctual.glsl"
93081
+ vec4 getMaterialColor(){vec4 baseColor=getBaseColor();vec3 n=getNormalVector(x3d_Material.normalScale);vec3 v=normalize(-vertex);MaterialInfo materialInfo;materialInfo.baseColor=baseColor.rgb;materialInfo.ior=1.5;materialInfo.f0=vec3(0.04);materialInfo.specularWeight=1.0;
93082
+ #if defined(X3D_MATERIAL_METALLIC_ROUGHNESS)
93083
+ materialInfo=getMetallicRoughnessInfo(materialInfo);
93419
93084
  #endif
93420
- }
93421
- #if defined(X3D_METALLIC_ROUGHNESS_TEXTURE)
93422
- uniform x3d_MetallicRoughnessTextureParameters x3d_MetallicRoughnessTexture;
93085
+ materialInfo.perceptualRoughness=clamp(materialInfo.perceptualRoughness,0.0,1.0);materialInfo.metallic=clamp(materialInfo.metallic,0.0,1.0);materialInfo.alphaRoughness=materialInfo.perceptualRoughness*materialInfo.perceptualRoughness;float reflectance=max(max(materialInfo.f0.r,materialInfo.f0.g),materialInfo.f0.b);materialInfo.f90=vec3(1.0);vec3 f_specular=vec3(0.0);vec3 f_diffuse=vec3(0.0);vec3 f_emissive=vec3(0.0);vec3 f_clearcoat=vec3(0.0);vec3 f_sheen=vec3(0.0);vec3 f_transmission=vec3(0.0);float albedoSheenScaling=1.0;
93086
+ #if defined(X3D_USE_IBL)
93423
93087
  #endif
93424
- vec2 getMetallicRoughness(){float metallic=x3d_Material.metallic;float perceptualRoughness=x3d_Material.roughness;
93425
- #if defined(X3D_METALLIC_ROUGHNESS_TEXTURE)
93426
- vec3 texCoord=getTexCoord(x3d_MetallicRoughnessTexture.textureTransformMapping,x3d_MetallicRoughnessTexture.textureCoordinateMapping);
93427
- #if defined(X3D_METALLIC_ROUGHNESS_TEXTURE_2D)
93428
- vec4 mrSample=texture2D(x3d_MetallicRoughnessTexture.texture2D,texCoord.st);
93429
- #elif defined(X3D_METALLIC_ROUGHNESS_TEXTURE_CUBE)
93430
- vec4 mrSample=textureCube(x3d_MetallicRoughnessTexture.textureCube,texCoord);
93431
- #endif
93432
- metallic*=mrSample.b;perceptualRoughness*=mrSample.g;return vec2(metallic,perceptualRoughness);
93433
- #else
93434
- return vec2(metallic,perceptualRoughness);
93088
+ vec3 f_diffuse_ibl=f_diffuse;vec3 f_specular_ibl=f_specular;vec3 f_sheen_ibl=f_sheen;vec3 f_clearcoat_ibl=f_clearcoat;f_diffuse=vec3(0.0);f_specular=vec3(0.0);f_sheen=vec3(0.0);f_clearcoat=vec3(0.0);
93089
+ #if defined(X3D_LIGHTING)
93090
+ for(int i=0;i<X3D_NUM_LIGHTS;++i){x3d_LightSourceParameters light=x3d_LightSource[i];vec3 pointToLight;float distanceToLight;if(light.type!=x3d_DirectionalLight){pointToLight=light.location-vertex;distanceToLight=length(light.matrix*pointToLight);}else{pointToLight=-light.direction;distanceToLight=-1.0;}if(distanceToLight<=light.radius||light.radius<0.0){vec3 l=normalize(pointToLight);vec3 h=normalize(l+v);float NdotL=clamp(dot(n,l),0.0,1.0);float NdotV=clamp(dot(n,v),0.0,1.0);float NdotH=clamp(dot(n,h),0.0,1.0);float VdotH=clamp(dot(v,h),0.0,1.0);if(NdotL>0.0||NdotV>0.0){vec3 intensity=getLightIntensity(light,pointToLight,distanceToLight);
93091
+ #if defined(X3D_SHADOWS)
93092
+ if(light.shadowIntensity>0.0)intensity=mix(intensity,light.shadowColor,getShadowIntensity(i,light));
93435
93093
  #endif
93436
- }
93437
- #if defined(X3D_OCCLUSION_TEXTURE)
93438
- uniform x3d_OcclusionTextureParameters x3d_OcclusionTexture;
93094
+ f_diffuse+=intensity*NdotL*BRDF_lambertian(materialInfo.f0,materialInfo.f90,materialInfo.c_diff,materialInfo.specularWeight,VdotH);f_specular+=intensity*NdotL*BRDF_specularGGX(materialInfo.f0,materialInfo.f90,materialInfo.alphaRoughness,materialInfo.specularWeight,VdotH,NdotL,NdotV,NdotH);}}}
93439
93095
  #endif
93440
- float getOcclusionFactor(){
93096
+ f_emissive=getEmissiveColor();float clearcoatFactor=0.0;vec3 clearcoatFresnel=vec3(0.0);vec3 diffuse;vec3 specular;vec3 sheen;vec3 clearcoat;
93441
93097
  #if defined(X3D_OCCLUSION_TEXTURE)
93442
- vec3 texCoord=getTexCoord(x3d_OcclusionTexture.textureTransformMapping,x3d_OcclusionTexture.textureCoordinateMapping);
93443
- #if defined(X3D_OCCLUSION_TEXTURE_2D)
93444
- return texture2D(x3d_OcclusionTexture.texture2D,texCoord.st).r;
93445
- #elif defined(X3D_OCCLUSION_TEXTURE_CUBE)
93446
- return textureCube(x3d_OcclusionTexture.textureCube,texCoord).r;
93447
- #endif
93098
+ float ao=getOcclusionFactor();diffuse=f_diffuse+mix(f_diffuse_ibl,f_diffuse_ibl*ao,x3d_Material.occlusionStrength);specular=f_specular+mix(f_specular_ibl,f_specular_ibl*ao,x3d_Material.occlusionStrength);sheen=f_sheen+mix(f_sheen_ibl,f_sheen_ibl*ao,x3d_Material.occlusionStrength);clearcoat=f_clearcoat+mix(f_clearcoat_ibl,f_clearcoat_ibl*ao,x3d_Material.occlusionStrength);
93448
93099
  #else
93449
- return 1.0;
93100
+ diffuse=f_diffuse_ibl+f_diffuse;specular=f_specular_ibl+f_specular;sheen=f_sheen_ibl+f_sheen;clearcoat=f_clearcoat_ibl+f_clearcoat;
93450
93101
  #endif
93451
- }struct PBRInfo{float NdotL;float NdotV;float NdotH;float LdotH;float VdotH;float perceptualRoughness;float metalness;vec3 reflectance0;vec3 reflectance90;float alphaRoughness;vec3 diffuseColor;vec3 specularColor;};const float M_PI=3.141592653589793;const float c_MinRoughness=0.04;
93452
- #if defined(USE_IBL)
93453
- vec3 getIBLContribution(const in PBRInfo pbrInputs,vec3 n,const in vec3 reflection){float mipCount=9.0;float lod=pbrInputs.perceptualRoughness*mipCount;vec3 brdf=SRGBtoLINEAR(texture2D(brdfLUT,vec2(pbrInputs.NdotV,1.0-pbrInputs.perceptualRoughness))).rgb;vec3 diffuseLight=SRGBtoLINEAR(textureCube(diffuseEnvironmentTexture,n)).rgb;
93454
- #if defined(USE_TEX_LOD)
93455
- vec3 specularLight=SRGBtoLINEAR(textureCubeLodEXT(specularEnvironmentTexture,reflection,lod)).rgb;
93102
+ vec3 color=vec3(0.0);
93103
+ #if defined(X3D_MATERIAL_UNLIT)
93104
+ color=baseColor.rgb;
93456
93105
  #else
93457
- vec3 specularLight=SRGBtoLINEAR(textureCube(specularEnvironmentTexture,reflection)).rgb;
93458
- #endif
93459
- vec3 diffuse=diffuseLight*pbrInputs.diffuseColor;vec3 specular=specularLight*(pbrInputs.specularColor*brdf.x+brdf.y);return diffuse+specular;}
93106
+ color=f_emissive+diffuse+specular;color=sheen+color*albedoSheenScaling;color=color*(1.0-clearcoatFactor*clearcoatFresnel)+clearcoat;
93460
93107
  #endif
93461
- vec3 diffuse(const in PBRInfo pbrInputs){return pbrInputs.diffuseColor/M_PI;}vec3 specularReflection(const in PBRInfo pbrInputs){return pbrInputs.reflectance0+(pbrInputs.reflectance90-pbrInputs.reflectance0)*pow(clamp(1.0-pbrInputs.VdotH,0.0,1.0),5.0);}float geometricOcclusion(const in PBRInfo pbrInputs){float NdotL=pbrInputs.NdotL;float NdotV=pbrInputs.NdotV;float r=pbrInputs.alphaRoughness;float attenuationL=2.0*NdotL/(NdotL+sqrt(r*r+(1.0-r*r)*(NdotL*NdotL)));float attenuationV=2.0*NdotV/(NdotV+sqrt(r*r+(1.0-r*r)*(NdotV*NdotV)));return attenuationL*attenuationV;}float microfacetDistribution(const in PBRInfo pbrInputs){float roughnessSq=pbrInputs.alphaRoughness*pbrInputs.alphaRoughness;float f=(pbrInputs.NdotH*roughnessSq-pbrInputs.NdotH)*pbrInputs.NdotH+1.0;return roughnessSq/(M_PI*f*f);}vec4 getMaterialColor(){vec2 metallicRoughness=getMetallicRoughness();float perceptualRoughness=clamp(metallicRoughness[1],c_MinRoughness,1.0);float metallic=clamp(metallicRoughness[0],0.0,1.0);float alphaRoughness=perceptualRoughness*perceptualRoughness;vec4 baseColor=getBaseColor();float alpha=baseColor.a;vec3 f0=vec3(0.04);vec3 diffuseColor=baseColor.rgb*(vec3(1.0)-f0);diffuseColor*=1.0-metallic;vec3 specularColor=mix(f0,baseColor.rgb,metallic);float reflectance=max(max(specularColor.r,specularColor.g),specularColor.b);float reflectance90=clamp(reflectance*25.0,0.0,1.0);vec3 specularEnvironmentR0=specularColor.rgb;vec3 specularEnvironmentR90=vec3(1.0,1.0,1.0)*reflectance90;vec3 n=getNormalVector(x3d_Material.normalScale);vec3 v=normalize(-vertex);vec3 finalColor=vec3(0.0);
93462
- #if defined(X3D_LIGHTING)
93463
- for(int i=0;i<X3D_NUM_LIGHTS;i++){x3d_LightSourceParameters light=x3d_LightSource[i];vec3 vL=light.location-vertex;float dL=length(light.matrix*vL);bool di=light.type==x3d_DirectionalLight;if(di||dL<=light.radius){vec3 d=light.direction;vec3 c=light.attenuation;vec3 L=di?-d:normalize(vL);vec3 l=normalize(L);vec3 h=normalize(l+v);float NdotL=clamp(dot(n,l),0.001,1.0);float NdotV=abs(dot(n,v))+0.001;float NdotH=clamp(dot(n,h),0.0,1.0);float LdotH=clamp(dot(l,h),0.0,1.0);float VdotH=clamp(dot(v,h),0.0,1.0);PBRInfo pbrInputs=PBRInfo(NdotL,NdotV,NdotH,LdotH,VdotH,perceptualRoughness,metallic,specularEnvironmentR0,specularEnvironmentR90,alphaRoughness,diffuseColor,specularColor);vec3 F=specularReflection(pbrInputs);float G=geometricOcclusion(pbrInputs);float D=microfacetDistribution(pbrInputs);float attenuationFactor=di?1.0:1.0/max(dot(c,vec3(1.0,dL,dL*dL)),1.0);float spotFactor=light.type==x3d_SpotLight?getSpotFactor(light.cutOffAngle,light.beamWidth,L,d):1.0;float attenuationSpotFactor=attenuationFactor*spotFactor;vec3 diffuseContrib=(1.0-F)*diffuse(pbrInputs);vec3 specContrib=F*G*D/(4.0*NdotL*NdotV);vec3 diffuseSpecContrib=light.intensity*(diffuseContrib+specContrib);
93464
- #if defined(X3D_SHADOWS)
93465
- if(NdotL>0.001&&light.shadowIntensity>0.0)diffuseSpecContrib=mix(diffuseSpecContrib,light.shadowColor,getShadowIntensity(i,light));
93466
- #endif
93467
- vec3 color=NdotL*attenuationSpotFactor*light.color*diffuseSpecContrib;finalColor+=color;}}
93468
- #endif
93469
- #if defined(USE_IBL)
93470
- vec3 reflection=-normalize(reflect(v,n));finalColor+=getIBLContribution(pbrInputs,n,reflection);
93471
- #endif
93472
- #if defined(X3D_OCCLUSION_TEXTURE)
93473
- finalColor=mix(finalColor,finalColor*getOcclusionFactor(),x3d_Material.occlusionStrength);
93108
+ #if defined(X3D_LINEAR_OUTPUT)
93109
+ return vec4(color.rgb,baseColor.a);
93110
+ #else
93111
+ return vec4(toneMap(color),baseColor.a);
93474
93112
  #endif
93475
- finalColor+=getEmissiveColor();return Gamma(vec4(finalColor,alpha));}void main(){fragment_main();}
93113
+ }void main(){fragment_main();}
93476
93114
  `
93477
93115
  ;
93478
93116
 
@@ -93480,9 +93118,9 @@ x_ite_Namespace .add ("PBR1.fs", "assets/shaders/webgl1/PBR1.fs", PBR1_fs_defaul
93480
93118
  /* harmony default export */ const PBR1_fs = (PBR1_fs_default_);
93481
93119
  ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/Phong1.fs.js
93482
93120
  const Phong1_fs_default_ = /* glsl */ `precision highp float;precision highp int;precision highp sampler2D;precision highp samplerCube;
93483
- #pragma X3D include "include/Fragment.glsl"
93484
- #pragma X3D include "include/Material.glsl"
93485
- #pragma X3D include "include/Normal.glsl"
93121
+ #pragma X3D include "common/Fragment.glsl"
93122
+ #pragma X3D include "common/Material.glsl"
93123
+ #pragma X3D include "common/Normal.glsl"
93486
93124
  #if defined(X3D_AMBIENT_TEXTURE)
93487
93125
  uniform x3d_AmbientTextureParameters x3d_AmbientTexture;
93488
93126
  #endif
@@ -93510,16 +93148,14 @@ vec4 diffuseParameter=vec4(x3d_Material.diffuseColor,alpha);
93510
93148
  #if defined(X3D_DIFFUSE_TEXTURE)
93511
93149
  vec3 texCoord=getTexCoord(x3d_DiffuseTexture.textureTransformMapping,x3d_DiffuseTexture.textureCoordinateMapping);
93512
93150
  #if defined(X3D_DIFFUSE_TEXTURE_2D)
93513
- return diffuseParameter*texture2D(x3d_DiffuseTexture.texture2D,texCoord.st);
93151
+ diffuseParameter*=texture2D(x3d_DiffuseTexture.texture2D,texCoord.st);
93514
93152
  #elif defined(X3D_DIFFUSE_TEXTURE_CUBE)
93515
- return diffuseParameter*textureCube(x3d_DiffuseTexture.textureCube,texCoord);
93153
+ diffuseParameter*=textureCube(x3d_DiffuseTexture.textureCube,texCoord);
93516
93154
  #endif
93517
93155
  #elif defined(X3D_TEXTURE)
93518
- return getTextureColor(diffuseParameter,vec4(x3d_Material.specularColor,alpha));
93519
- #else
93520
- return diffuseParameter;
93156
+ diffuseParameter=getTextureColor(diffuseParameter,vec4(x3d_Material.specularColor,alpha));
93521
93157
  #endif
93522
- }
93158
+ return diffuseParameter;}
93523
93159
  #if defined(X3D_SPECULAR_TEXTURE)
93524
93160
  uniform x3d_SpecularTextureParameters x3d_SpecularTexture;
93525
93161
  #endif
@@ -93527,14 +93163,12 @@ vec3 getSpecularColor(){vec3 specularParameter=x3d_Material.specularColor;
93527
93163
  #if defined(X3D_SPECULAR_TEXTURE)
93528
93164
  vec3 texCoord=getTexCoord(x3d_SpecularTexture.textureTransformMapping,x3d_SpecularTexture.textureCoordinateMapping);
93529
93165
  #if defined(X3D_SPECULAR_TEXTURE_2D)
93530
- return specularParameter*texture2D(x3d_SpecularTexture.texture2D,texCoord.st).rgb;
93166
+ specularParameter*=texture2D(x3d_SpecularTexture.texture2D,texCoord.st).rgb;
93531
93167
  #elif defined(X3D_SPECULAR_TEXTURE_CUBE)
93532
- return specularParameter*textureCube(x3d_SpecularTexture.textureCube,texCoord).rgb;
93168
+ specularParameter*=textureCube(x3d_SpecularTexture.textureCube,texCoord).rgb;
93533
93169
  #endif
93534
- #else
93535
- return specularParameter;
93536
93170
  #endif
93537
- }
93171
+ return specularParameter;}
93538
93172
  #if defined(X3D_EMISSIVE_TEXTURE)
93539
93173
  uniform x3d_EmissiveTextureParameters x3d_EmissiveTexture;
93540
93174
  #endif
@@ -93542,14 +93176,12 @@ vec3 getEmissiveColor(){vec3 emissiveParameter=x3d_Material.emissiveColor;
93542
93176
  #if defined(X3D_EMISSIVE_TEXTURE)
93543
93177
  vec3 texCoord=getTexCoord(x3d_EmissiveTexture.textureTransformMapping,x3d_EmissiveTexture.textureCoordinateMapping);
93544
93178
  #if defined(X3D_EMISSIVE_TEXTURE_2D)
93545
- return emissiveParameter*texture2D(x3d_EmissiveTexture.texture2D,texCoord.st).rgb;
93179
+ emissiveParameter*=texture2D(x3d_EmissiveTexture.texture2D,texCoord.st).rgb;
93546
93180
  #elif defined(X3D_EMISSIVE_TEXTURE_CUBE)
93547
- return emissiveParameter*textureCube(x3d_EmissiveTexture.textureCube,texCoord).rgb;
93181
+ emissiveParameter*=textureCube(x3d_EmissiveTexture.textureCube,texCoord).rgb;
93548
93182
  #endif
93549
- #else
93550
- return emissiveParameter;
93551
93183
  #endif
93552
- }
93184
+ return emissiveParameter;}
93553
93185
  #if defined(X3D_SHININESS_TEXTURE)
93554
93186
  uniform x3d_ShininessTextureParameters x3d_ShininessTexture;
93555
93187
  #endif
@@ -93557,14 +93189,12 @@ float getShininessFactor(){float shininess=x3d_Material.shininess;
93557
93189
  #if defined(X3D_SHININESS_TEXTURE)
93558
93190
  vec3 texCoord=getTexCoord(x3d_ShininessTexture.textureTransformMapping,x3d_ShininessTexture.textureCoordinateMapping);
93559
93191
  #if defined(X3D_SHININESS_TEXTURE_2D)
93560
- return shininess*texture2D(x3d_ShininessTexture.texture2D,texCoord.st).a;
93192
+ shininess*=texture2D(x3d_ShininessTexture.texture2D,texCoord.st).a;
93561
93193
  #elif defined(X3D_SHININESS_TEXTURE_CUBE)
93562
- return shininess*textureCube(x3d_ShininessTexture.textureCube,texCoord).a;
93194
+ shininess*=textureCube(x3d_ShininessTexture.textureCube,texCoord).a;
93563
93195
  #endif
93564
- #else
93565
- return shininess;
93566
93196
  #endif
93567
- }
93197
+ return shininess;}
93568
93198
  #if defined(X3D_OCCLUSION_TEXTURE)
93569
93199
  uniform x3d_OcclusionTextureParameters x3d_OcclusionTexture;
93570
93200
  #endif
@@ -93605,8 +93235,8 @@ varying vec4 texCoord0;
93605
93235
  #else
93606
93236
  vec4 texCoord0=vec4(0.0,0.0,0.0,1.0);
93607
93237
  #endif
93608
- #pragma X3D include "include/ClipPlanes.glsl"
93609
- #pragma X3D include "include/Point.glsl"
93238
+ #pragma X3D include "common/ClipPlanes.glsl"
93239
+ #pragma X3D include "common/Point.glsl"
93610
93240
  uniform float x3d_Id;void main(){
93611
93241
  #if defined(X3D_CLIP_PLANES)
93612
93242
  clip();
@@ -93629,7 +93259,7 @@ varying vec3 vertex;varying vec3 normal;
93629
93259
  #if!defined(X3D_GEOMETRY_0D)&&!defined(X3D_GEOMETRY_1D)
93630
93260
  varying vec4 texCoord0;
93631
93261
  #endif
93632
- #pragma X3D include "include/PointSize.glsl"
93262
+ #pragma X3D include "common/PointSize.glsl"
93633
93263
  void main(){
93634
93264
  #if defined(X3D_GEOMETRY_0D)
93635
93265
  #if defined(X3D_STYLE_PROPERTIES)
@@ -93650,7 +93280,7 @@ x_ite_Namespace .add ("Pointing1.vs", "assets/shaders/webgl1/Pointing1.vs", Poin
93650
93280
  /* harmony default export */ const Pointing1_vs = (Pointing1_vs_default_);
93651
93281
  ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/Unlit1.fs.js
93652
93282
  const Unlit1_fs_default_ = /* glsl */ `precision highp float;precision highp int;precision highp sampler2D;precision highp samplerCube;
93653
- #pragma X3D include "include/Fragment.glsl"
93283
+ #pragma X3D include "common/Fragment.glsl"
93654
93284
  uniform x3d_UnlitMaterialParameters x3d_Material;
93655
93285
  #if defined(X3D_EMISSIVE_TEXTURE)
93656
93286
  uniform x3d_EmissiveTextureParameters x3d_EmissiveTexture;
@@ -93664,16 +93294,14 @@ vec4 emissiveParameter=vec4(x3d_Material.emissiveColor,alpha);
93664
93294
  #if defined(X3D_EMISSIVE_TEXTURE)
93665
93295
  vec3 texCoord=getTexCoord(x3d_EmissiveTexture.textureTransformMapping,x3d_EmissiveTexture.textureCoordinateMapping);
93666
93296
  #if defined(X3D_EMISSIVE_TEXTURE_2D)
93667
- return emissiveParameter*texture2D(x3d_EmissiveTexture.texture2D,texCoord.st);
93297
+ emissiveParameter*=texture2D(x3d_EmissiveTexture.texture2D,texCoord.st);
93668
93298
  #elif defined(X3D_EMISSIVE_TEXTURE_CUBE)
93669
- return emissiveParameter*textureCube(x3d_EmissiveTexture.textureCube,texCoord);
93299
+ emissiveParameter*=textureCube(x3d_EmissiveTexture.textureCube,texCoord);
93670
93300
  #endif
93671
93301
  #elif defined(X3D_TEXTURE)
93672
- return getTextureColor(emissiveParameter,vec4(vec3(1.0),alpha));
93673
- #else
93674
- return emissiveParameter;
93302
+ emissiveParameter=getTextureColor(emissiveParameter,vec4(vec3(1.0),alpha));
93675
93303
  #endif
93676
- }vec4 getMaterialColor(){return getEmissiveColor();}void main(){fragment_main();}
93304
+ return emissiveParameter;}vec4 getMaterialColor(){return getEmissiveColor();}void main(){fragment_main();}
93677
93305
  `
93678
93306
  ;
93679
93307
 
@@ -93698,7 +93326,7 @@ x_ite_Namespace .add ("Compose2.vs", "assets/shaders/webgl2/Compose2.vs", Compos
93698
93326
  ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/Default2.vs.js
93699
93327
  const Default2_vs_default_ = /* glsl */ `#version 300 es
93700
93328
  precision highp float;precision highp int;precision highp sampler2D;precision highp sampler3D;precision highp samplerCube;
93701
- #pragma X3D include "include/Vertex.glsl"
93329
+ #pragma X3D include "common/Vertex.glsl"
93702
93330
  void main(){vertex_main();}
93703
93331
  `
93704
93332
  ;
@@ -93708,8 +93336,8 @@ x_ite_Namespace .add ("Default2.vs", "assets/shaders/webgl2/Default2.vs", Defaul
93708
93336
  ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/Depth2.fs.js
93709
93337
  const Depth2_fs_default_ = /* glsl */ `#version 300 es
93710
93338
  precision highp float;precision highp int;precision highp sampler2D;in vec3 vertex;out vec4 x3d_FragColor;
93711
- #pragma X3D include "include/ClipPlanes.glsl"
93712
- #pragma X3D include "include/Point.glsl"
93339
+ #pragma X3D include "common/ClipPlanes.glsl"
93340
+ #pragma X3D include "common/Point.glsl"
93713
93341
  void main(){
93714
93342
  #if defined(X3D_CLIP_PLANES)
93715
93343
  clip();
@@ -93726,10 +93354,10 @@ x_ite_Namespace .add ("Depth2.fs", "assets/shaders/webgl2/Depth2.fs", Depth2_fs_
93726
93354
  ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/Depth2.vs.js
93727
93355
  const Depth2_vs_default_ = /* glsl */ `#version 300 es
93728
93356
  precision highp float;precision highp int;precision highp sampler2D;uniform mat4 x3d_ProjectionMatrix;uniform mat4 x3d_ModelViewMatrix;in vec4 x3d_Vertex;out vec3 vertex;
93729
- #pragma X3D include "include/Utils.glsl"
93730
- #pragma X3D include "include/Skin.glsl"
93731
- #pragma X3D include "include/Particle.glsl"
93732
- #pragma X3D include "include/PointSize.glsl"
93357
+ #pragma X3D include "common/Utils.glsl"
93358
+ #pragma X3D include "common/Skin.glsl"
93359
+ #pragma X3D include "common/Particle.glsl"
93360
+ #pragma X3D include "common/PointSize.glsl"
93733
93361
  void main(){vec4 x3d_TransformedVertex=getParticleVertex(getSkinVertex(x3d_Vertex,vec3(0.0)));vec4 position=x3d_ModelViewMatrix*x3d_TransformedVertex;vertex=position.xyz;
93734
93362
  #if defined(X3D_GEOMETRY_0D)
93735
93363
  #if defined(X3D_STYLE_PROPERTIES)
@@ -93747,7 +93375,7 @@ x_ite_Namespace .add ("Depth2.vs", "assets/shaders/webgl2/Depth2.vs", Depth2_vs_
93747
93375
  ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/Gouraud2.fs.js
93748
93376
  const Gouraud2_fs_default_ = /* glsl */ `#version 300 es
93749
93377
  precision highp float;precision highp int;precision highp sampler2D;precision highp sampler3D;precision highp samplerCube;
93750
- #pragma X3D include "include/Fragment.glsl"
93378
+ #pragma X3D include "common/Fragment.glsl"
93751
93379
  in vec4 frontColor;
93752
93380
  #if!defined(X3D_GEOMETRY_0D)&&!defined(X3D_GEOMETRY_1D)
93753
93381
  in vec4 backColor;
@@ -93773,8 +93401,8 @@ x_ite_Namespace .add ("Gouraud2.fs", "assets/shaders/webgl2/Gouraud2.fs", Gourau
93773
93401
  ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/Gouraud2.vs.js
93774
93402
  const Gouraud2_vs_default_ = /* glsl */ `#version 300 es
93775
93403
  precision highp float;precision highp int;precision highp sampler2D;precision highp sampler3D;precision highp samplerCube;
93776
- #pragma X3D include "include/Vertex.glsl"
93777
- #pragma X3D include "include/Material.glsl"
93404
+ #pragma X3D include "common/Vertex.glsl"
93405
+ #pragma X3D include "common/Material.glsl"
93778
93406
  out vec4 frontColor;
93779
93407
  #if!defined(X3D_GEOMETRY_0D)&&!defined(X3D_GEOMETRY_1D)
93780
93408
  out vec4 backColor;
@@ -93820,118 +93448,50 @@ x_ite_Namespace .add ("LineTransform2.vs", "assets/shaders/webgl2/LineTransform2
93820
93448
  ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/PBR2.fs.js
93821
93449
  const PBR2_fs_default_ = /* glsl */ `#version 300 es
93822
93450
  precision highp float;precision highp int;precision highp sampler2D;precision highp sampler3D;precision highp samplerCube;
93823
- #pragma X3D include "include/Fragment.glsl"
93824
- #pragma X3D include "include/Colors.glsl"
93825
- #pragma X3D include "include/Normal.glsl"
93826
- #pragma X3D include "include/SpotFactor.glsl"
93827
- #pragma X3D include "include/Shadow.glsl"
93451
+ #pragma X3D include "common/Fragment.glsl"
93452
+ #pragma X3D include "common/Normal.glsl"
93453
+ #pragma X3D include "common/Shadow.glsl"
93828
93454
  #if defined(X3D_LIGHTING)
93829
93455
  uniform x3d_LightSourceParameters x3d_LightSource[X3D_NUM_LIGHTS];
93830
93456
  #endif
93831
93457
  uniform x3d_PhysicalMaterialParameters x3d_Material;
93832
- #if defined(USE_IBL)
93833
- uniform samplerCube diffuseEnvironmentTexture;uniform samplerCube specularEnvironmentTexture;uniform sampler2D brdfLUT;
93834
- #endif
93835
- #if defined(X3D_BASE_TEXTURE)
93836
- uniform x3d_BaseTextureParameters x3d_BaseTexture;
93837
- #endif
93838
- vec4 getBaseColor(){float alpha=1.0-x3d_Material.transparency;
93839
- #if defined(X3D_COLOR_MATERIAL)
93840
- vec4 baseParameter=vec4(color.rgb,color.a*alpha);
93841
- #else
93842
- vec4 baseParameter=vec4(x3d_Material.baseColor,alpha);
93843
- #endif
93844
- #if defined(X3D_BASE_TEXTURE)
93845
- vec3 texCoord=getTexCoord(x3d_BaseTexture.textureTransformMapping,x3d_BaseTexture.textureCoordinateMapping);
93846
- #if defined(X3D_BASE_TEXTURE_2D)
93847
- return baseParameter*SRGBtoLINEAR(texture(x3d_BaseTexture.texture2D,texCoord.st));
93848
- #elif defined(X3D_BASE_TEXTURE_3D)
93849
- return baseParameter*SRGBtoLINEAR(texture(x3d_BaseTexture.texture3D,texCoord));
93850
- #elif defined(X3D_BASE_TEXTURE_CUBE)
93851
- return baseParameter*SRGBtoLINEAR(texture(x3d_BaseTexture.textureCube,texCoord));
93852
- #endif
93853
- #elif defined(X3D_TEXTURE)
93854
- return getTextureColor(baseParameter,vec4(vec3(1.0),alpha));
93855
- #else
93856
- return baseParameter;
93857
- #endif
93858
- }
93859
- #if defined(X3D_EMISSIVE_TEXTURE)
93860
- uniform x3d_EmissiveTextureParameters x3d_EmissiveTexture;
93861
- #endif
93862
- vec3 getEmissiveColor(){vec3 emissiveParameter=x3d_Material.emissiveColor;
93863
- #if defined(X3D_EMISSIVE_TEXTURE)
93864
- vec3 texCoord=getTexCoord(x3d_EmissiveTexture.textureTransformMapping,x3d_EmissiveTexture.textureCoordinateMapping);
93865
- #if defined(X3D_EMISSIVE_TEXTURE_2D)
93866
- return emissiveParameter*SRGBtoLINEAR(texture(x3d_EmissiveTexture.texture2D,texCoord.st)).rgb;
93867
- #elif defined(X3D_EMISSIVE_TEXTURE_3D)
93868
- return emissiveParameter*SRGBtoLINEAR(texture(x3d_EmissiveTexture.texture3D,texCoord)).rgb;
93869
- #elif defined(X3D_EMISSIVE_TEXTURE_CUBE)
93870
- return emissiveParameter*SRGBtoLINEAR(texture(x3d_EmissiveTexture.textureCube,texCoord)).rgb;
93458
+ #pragma X3D include "pbr/BDRF.glsl"
93459
+ #pragma X3D include "pbr/ToneMapping.glsl"
93460
+ #pragma X3D include "pbr/MaterialInfo.glsl"
93461
+ #pragma X3D include "pbr/Punctual.glsl"
93462
+ vec4 getMaterialColor(){vec4 baseColor=getBaseColor();vec3 n=getNormalVector(x3d_Material.normalScale);vec3 v=normalize(-vertex);MaterialInfo materialInfo;materialInfo.baseColor=baseColor.rgb;materialInfo.ior=1.5;materialInfo.f0=vec3(0.04);materialInfo.specularWeight=1.0;
93463
+ #if defined(X3D_MATERIAL_METALLIC_ROUGHNESS)
93464
+ materialInfo=getMetallicRoughnessInfo(materialInfo);
93871
93465
  #endif
93872
- #else
93873
- return emissiveParameter.rgb;
93466
+ materialInfo.perceptualRoughness=clamp(materialInfo.perceptualRoughness,0.0,1.0);materialInfo.metallic=clamp(materialInfo.metallic,0.0,1.0);materialInfo.alphaRoughness=materialInfo.perceptualRoughness*materialInfo.perceptualRoughness;float reflectance=max(max(materialInfo.f0.r,materialInfo.f0.g),materialInfo.f0.b);materialInfo.f90=vec3(1.0);vec3 f_specular=vec3(0.0);vec3 f_diffuse=vec3(0.0);vec3 f_emissive=vec3(0.0);vec3 f_clearcoat=vec3(0.0);vec3 f_sheen=vec3(0.0);vec3 f_transmission=vec3(0.0);float albedoSheenScaling=1.0;
93467
+ #if defined(X3D_USE_IBL)
93874
93468
  #endif
93875
- }
93876
- #if defined(X3D_METALLIC_ROUGHNESS_TEXTURE)
93877
- uniform x3d_MetallicRoughnessTextureParameters x3d_MetallicRoughnessTexture;
93878
- #endif
93879
- vec2 getMetallicRoughness(){float metallic=x3d_Material.metallic;float perceptualRoughness=x3d_Material.roughness;
93880
- #if defined(X3D_METALLIC_ROUGHNESS_TEXTURE)
93881
- vec3 texCoord=getTexCoord(x3d_MetallicRoughnessTexture.textureTransformMapping,x3d_MetallicRoughnessTexture.textureCoordinateMapping);
93882
- #if defined(X3D_METALLIC_ROUGHNESS_TEXTURE_2D)
93883
- vec4 mrSample=texture(x3d_MetallicRoughnessTexture.texture2D,texCoord.st);
93884
- #elif defined(X3D_METALLIC_ROUGHNESS_TEXTURE_3D)
93885
- vec4 mrSample=texture(x3d_MetallicRoughnessTexture.texture3D,texCoord);
93886
- #elif defined(X3D_METALLIC_ROUGHNESS_TEXTURE_CUBE)
93887
- vec4 mrSample=texture(x3d_MetallicRoughnessTexture.textureCube,texCoord);
93469
+ vec3 f_diffuse_ibl=f_diffuse;vec3 f_specular_ibl=f_specular;vec3 f_sheen_ibl=f_sheen;vec3 f_clearcoat_ibl=f_clearcoat;f_diffuse=vec3(0.0);f_specular=vec3(0.0);f_sheen=vec3(0.0);f_clearcoat=vec3(0.0);
93470
+ #if defined(X3D_LIGHTING)
93471
+ for(int i=0;i<X3D_NUM_LIGHTS;++i){x3d_LightSourceParameters light=x3d_LightSource[i];vec3 pointToLight;float distanceToLight;if(light.type!=x3d_DirectionalLight){pointToLight=light.location-vertex;distanceToLight=length(light.matrix*pointToLight);}else{pointToLight=-light.direction;distanceToLight=-1.0;}if(distanceToLight<=light.radius||light.radius<0.0){vec3 l=normalize(pointToLight);vec3 h=normalize(l+v);float NdotL=clamp(dot(n,l),0.0,1.0);float NdotV=clamp(dot(n,v),0.0,1.0);float NdotH=clamp(dot(n,h),0.0,1.0);float VdotH=clamp(dot(v,h),0.0,1.0);if(NdotL>0.0||NdotV>0.0){vec3 intensity=getLightIntensity(light,pointToLight,distanceToLight);
93472
+ #if defined(X3D_SHADOWS)
93473
+ if(light.shadowIntensity>0.0)intensity=mix(intensity,light.shadowColor,getShadowIntensity(i,light));
93888
93474
  #endif
93889
- metallic*=mrSample.b;perceptualRoughness*=mrSample.g;return vec2(metallic,perceptualRoughness);
93890
- #else
93891
- return vec2(metallic,perceptualRoughness);
93475
+ f_diffuse+=intensity*NdotL*BRDF_lambertian(materialInfo.f0,materialInfo.f90,materialInfo.c_diff,materialInfo.specularWeight,VdotH);f_specular+=intensity*NdotL*BRDF_specularGGX(materialInfo.f0,materialInfo.f90,materialInfo.alphaRoughness,materialInfo.specularWeight,VdotH,NdotL,NdotV,NdotH);}}}
93892
93476
  #endif
93893
- }
93477
+ f_emissive=getEmissiveColor();float clearcoatFactor=0.0;vec3 clearcoatFresnel=vec3(0.0);vec3 diffuse;vec3 specular;vec3 sheen;vec3 clearcoat;
93894
93478
  #if defined(X3D_OCCLUSION_TEXTURE)
93895
- uniform x3d_OcclusionTextureParameters x3d_OcclusionTexture;
93896
- #endif
93897
- float getOcclusionFactor(){
93898
- #if defined(X3D_OCCLUSION_TEXTURE)
93899
- vec3 texCoord=getTexCoord(x3d_OcclusionTexture.textureTransformMapping,x3d_OcclusionTexture.textureCoordinateMapping);
93900
- #if defined(X3D_OCCLUSION_TEXTURE_2D)
93901
- return texture(x3d_OcclusionTexture.texture2D,texCoord.st).r;
93902
- #elif defined(X3D_OCCLUSION_TEXTURE_3D)
93903
- return texture(x3d_OcclusionTexture.texture3D,texCoord).r;
93904
- #elif defined(X3D_OCCLUSION_TEXTURE_CUBE)
93905
- return texture(x3d_OcclusionTexture.textureCube,texCoord).r;
93906
- #endif
93479
+ float ao=getOcclusionFactor();diffuse=f_diffuse+mix(f_diffuse_ibl,f_diffuse_ibl*ao,x3d_Material.occlusionStrength);specular=f_specular+mix(f_specular_ibl,f_specular_ibl*ao,x3d_Material.occlusionStrength);sheen=f_sheen+mix(f_sheen_ibl,f_sheen_ibl*ao,x3d_Material.occlusionStrength);clearcoat=f_clearcoat+mix(f_clearcoat_ibl,f_clearcoat_ibl*ao,x3d_Material.occlusionStrength);
93907
93480
  #else
93908
- return 1.0;
93481
+ diffuse=f_diffuse_ibl+f_diffuse;specular=f_specular_ibl+f_specular;sheen=f_sheen_ibl+f_sheen;clearcoat=f_clearcoat_ibl+f_clearcoat;
93909
93482
  #endif
93910
- }struct PBRInfo{float NdotL;float NdotV;float NdotH;float LdotH;float VdotH;float perceptualRoughness;float metalness;vec3 reflectance0;vec3 reflectance90;float alphaRoughness;vec3 diffuseColor;vec3 specularColor;};const float M_PI=3.141592653589793;const float c_MinRoughness=0.04;
93911
- #if defined(USE_IBL)
93912
- vec3 getIBLContribution(const in PBRInfo pbrInputs,vec3 n,const in vec3 reflection){float mipCount=9.0;float lod=pbrInputs.perceptualRoughness*mipCount;vec3 brdf=SRGBtoLINEAR(texture(brdfLUT,vec2(pbrInputs.NdotV,1.0-pbrInputs.perceptualRoughness))).rgb;vec3 diffuseLight=SRGBtoLINEAR(textureCube(diffuseEnvironmentTexture,n)).rgb;
93913
- #if defined(USE_TEX_LOD)
93914
- vec3 specularLight=SRGBtoLINEAR(textureCubeLodEXT(specularEnvironmentTexture,reflection,lod)).rgb;
93483
+ vec3 color=vec3(0.0);
93484
+ #if defined(X3D_MATERIAL_UNLIT)
93485
+ color=baseColor.rgb;
93915
93486
  #else
93916
- vec3 specularLight=SRGBtoLINEAR(textureCube(specularEnvironmentTexture,reflection)).rgb;
93917
- #endif
93918
- vec3 diffuse=diffuseLight*pbrInputs.diffuseColor;vec3 specular=specularLight*(pbrInputs.specularColor*brdf.x+brdf.y);return diffuse+specular;}
93919
- #endif
93920
- vec3 diffuse(const in PBRInfo pbrInputs){return pbrInputs.diffuseColor/M_PI;}vec3 specularReflection(const in PBRInfo pbrInputs){return pbrInputs.reflectance0+(pbrInputs.reflectance90-pbrInputs.reflectance0)*pow(clamp(1.0-pbrInputs.VdotH,0.0,1.0),5.0);}float geometricOcclusion(const in PBRInfo pbrInputs){float NdotL=pbrInputs.NdotL;float NdotV=pbrInputs.NdotV;float r=pbrInputs.alphaRoughness;float attenuationL=2.0*NdotL/(NdotL+sqrt(r*r+(1.0-r*r)*(NdotL*NdotL)));float attenuationV=2.0*NdotV/(NdotV+sqrt(r*r+(1.0-r*r)*(NdotV*NdotV)));return attenuationL*attenuationV;}float microfacetDistribution(const in PBRInfo pbrInputs){float roughnessSq=pbrInputs.alphaRoughness*pbrInputs.alphaRoughness;float f=(pbrInputs.NdotH*roughnessSq-pbrInputs.NdotH)*pbrInputs.NdotH+1.0;return roughnessSq/(M_PI*f*f);}vec4 getMaterialColor(){vec2 metallicRoughness=getMetallicRoughness();float perceptualRoughness=clamp(metallicRoughness[1],c_MinRoughness,1.0);float metallic=clamp(metallicRoughness[0],0.0,1.0);float alphaRoughness=perceptualRoughness*perceptualRoughness;vec4 baseColor=getBaseColor();float alpha=baseColor.a;vec3 f0=vec3(0.04);vec3 diffuseColor=baseColor.rgb*(vec3(1.0)-f0);diffuseColor*=1.0-metallic;vec3 specularColor=mix(f0,baseColor.rgb,metallic);float reflectance=max(max(specularColor.r,specularColor.g),specularColor.b);float reflectance90=clamp(reflectance*25.0,0.0,1.0);vec3 specularEnvironmentR0=specularColor.rgb;vec3 specularEnvironmentR90=vec3(1.0,1.0,1.0)*reflectance90;vec3 n=getNormalVector(x3d_Material.normalScale);vec3 v=normalize(-vertex);vec3 finalColor=vec3(0.0);
93921
- #if defined(X3D_LIGHTING)
93922
- for(int i=0;i<X3D_NUM_LIGHTS;i++){x3d_LightSourceParameters light=x3d_LightSource[i];vec3 vL=light.location-vertex;float dL=length(light.matrix*vL);bool di=light.type==x3d_DirectionalLight;if(di||dL<=light.radius){vec3 d=light.direction;vec3 c=light.attenuation;vec3 L=di?-d:normalize(vL);vec3 l=normalize(L);vec3 h=normalize(l+v);float NdotL=clamp(dot(n,l),0.001,1.0);float NdotV=abs(dot(n,v))+0.001;float NdotH=clamp(dot(n,h),0.0,1.0);float LdotH=clamp(dot(l,h),0.0,1.0);float VdotH=clamp(dot(v,h),0.0,1.0);PBRInfo pbrInputs=PBRInfo(NdotL,NdotV,NdotH,LdotH,VdotH,perceptualRoughness,metallic,specularEnvironmentR0,specularEnvironmentR90,alphaRoughness,diffuseColor,specularColor);vec3 F=specularReflection(pbrInputs);float G=geometricOcclusion(pbrInputs);float D=microfacetDistribution(pbrInputs);float attenuationFactor=di?1.0:1.0/max(dot(c,vec3(1.0,dL,dL*dL)),1.0);float spotFactor=light.type==x3d_SpotLight?getSpotFactor(light.cutOffAngle,light.beamWidth,L,d):1.0;float attenuationSpotFactor=attenuationFactor*spotFactor;vec3 diffuseContrib=(1.0-F)*diffuse(pbrInputs);vec3 specContrib=F*G*D/(4.0*NdotL*NdotV);vec3 diffuseSpecContrib=light.intensity*(diffuseContrib+specContrib);
93923
- #if defined(X3D_SHADOWS)
93924
- if(NdotL>0.001&&light.shadowIntensity>0.0)diffuseSpecContrib=mix(diffuseSpecContrib,light.shadowColor,getShadowIntensity(i,light));
93487
+ color=f_emissive+diffuse+specular;color=sheen+color*albedoSheenScaling;color=color*(1.0-clearcoatFactor*clearcoatFresnel)+clearcoat;
93925
93488
  #endif
93926
- vec3 color=NdotL*attenuationSpotFactor*light.color*diffuseSpecContrib;finalColor+=color;}}
93927
- #endif
93928
- #if defined(USE_IBL)
93929
- vec3 reflection=-normalize(reflect(v,n));finalColor+=getIBLContribution(pbrInputs,n,reflection);
93930
- #endif
93931
- #if defined(X3D_OCCLUSION_TEXTURE)
93932
- finalColor=mix(finalColor,finalColor*getOcclusionFactor(),x3d_Material.occlusionStrength);
93489
+ #if defined(X3D_LINEAR_OUTPUT)
93490
+ return vec4(color.rgb,baseColor.a);
93491
+ #else
93492
+ return vec4(toneMap(color),baseColor.a);
93933
93493
  #endif
93934
- finalColor+=getEmissiveColor();return Gamma(vec4(finalColor,alpha));}void main(){fragment_main();}
93494
+ }void main(){fragment_main();}
93935
93495
  `
93936
93496
  ;
93937
93497
 
@@ -93940,9 +93500,9 @@ x_ite_Namespace .add ("PBR2.fs", "assets/shaders/webgl2/PBR2.fs", PBR2_fs_defaul
93940
93500
  ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/Phong2.fs.js
93941
93501
  const Phong2_fs_default_ = /* glsl */ `#version 300 es
93942
93502
  precision highp float;precision highp int;precision highp sampler2D;precision highp sampler3D;precision highp samplerCube;
93943
- #pragma X3D include "include/Fragment.glsl"
93944
- #pragma X3D include "include/Material.glsl"
93945
- #pragma X3D include "include/Normal.glsl"
93503
+ #pragma X3D include "common/Fragment.glsl"
93504
+ #pragma X3D include "common/Material.glsl"
93505
+ #pragma X3D include "common/Normal.glsl"
93946
93506
  #if defined(X3D_AMBIENT_TEXTURE)
93947
93507
  uniform x3d_AmbientTextureParameters x3d_AmbientTexture;
93948
93508
  #endif
@@ -93950,16 +93510,14 @@ vec3 getAmbientColor(const in vec3 diffuseColor){vec3 ambientParameter=x3d_Mater
93950
93510
  #if defined(X3D_AMBIENT_TEXTURE)
93951
93511
  vec3 texCoord=getTexCoord(x3d_AmbientTexture.textureTransformMapping,x3d_AmbientTexture.textureCoordinateMapping);
93952
93512
  #if defined(X3D_AMBIENT_TEXTURE_2D)
93953
- return ambientParameter*texture(x3d_AmbientTexture.texture2D,texCoord.st).rgb;
93513
+ ambientParameter*=texture(x3d_AmbientTexture.texture2D,texCoord.st).rgb;
93954
93514
  #elif defined(X3D_AMBIENT_TEXTURE_3D)
93955
- return ambientParameter*texture(x3d_AmbientTexture.texture3D,texCoord).rgb;
93515
+ ambientParameter*=texture(x3d_AmbientTexture.texture3D,texCoord).rgb;
93956
93516
  #elif defined(X3D_AMBIENT_TEXTURE_CUBE)
93957
- return ambientParameter*texture(x3d_AmbientTexture.textureCube,texCoord).rgb;
93517
+ ambientParameter*=texture(x3d_AmbientTexture.textureCube,texCoord).rgb;
93958
93518
  #endif
93959
- #else
93960
- return ambientParameter;
93961
93519
  #endif
93962
- }
93520
+ return ambientParameter;}
93963
93521
  #if defined(X3D_DIFFUSE_TEXTURE)
93964
93522
  uniform x3d_DiffuseTextureParameters x3d_DiffuseTexture;
93965
93523
  #endif
@@ -93972,18 +93530,16 @@ vec4 diffuseParameter=vec4(x3d_Material.diffuseColor,alpha);
93972
93530
  #if defined(X3D_DIFFUSE_TEXTURE)
93973
93531
  vec3 texCoord=getTexCoord(x3d_DiffuseTexture.textureTransformMapping,x3d_DiffuseTexture.textureCoordinateMapping);
93974
93532
  #if defined(X3D_DIFFUSE_TEXTURE_2D)
93975
- return diffuseParameter*texture(x3d_DiffuseTexture.texture2D,texCoord.st);
93533
+ diffuseParameter*=texture(x3d_DiffuseTexture.texture2D,texCoord.st);
93976
93534
  #elif defined(X3D_DIFFUSE_TEXTURE_3D)
93977
- return diffuseParameter*texture(x3d_DiffuseTexture.texture3D,texCoord);
93535
+ diffuseParameter*=texture(x3d_DiffuseTexture.texture3D,texCoord);
93978
93536
  #elif defined(X3D_DIFFUSE_TEXTURE_CUBE)
93979
- return diffuseParameter*texture(x3d_DiffuseTexture.textureCube,texCoord);
93537
+ diffuseParameter*=texture(x3d_DiffuseTexture.textureCube,texCoord);
93980
93538
  #endif
93981
93539
  #elif defined(X3D_TEXTURE)
93982
- return getTextureColor(diffuseParameter,vec4(x3d_Material.specularColor,alpha));
93983
- #else
93984
- return diffuseParameter;
93540
+ diffuseParameter=getTextureColor(diffuseParameter,vec4(x3d_Material.specularColor,alpha));
93985
93541
  #endif
93986
- }
93542
+ return diffuseParameter;}
93987
93543
  #if defined(X3D_SPECULAR_TEXTURE)
93988
93544
  uniform x3d_SpecularTextureParameters x3d_SpecularTexture;
93989
93545
  #endif
@@ -93991,16 +93547,14 @@ vec3 getSpecularColor(){vec3 specularParameter=x3d_Material.specularColor;
93991
93547
  #if defined(X3D_SPECULAR_TEXTURE)
93992
93548
  vec3 texCoord=getTexCoord(x3d_SpecularTexture.textureTransformMapping,x3d_SpecularTexture.textureCoordinateMapping);
93993
93549
  #if defined(X3D_SPECULAR_TEXTURE_2D)
93994
- return specularParameter*texture(x3d_SpecularTexture.texture2D,texCoord.st).rgb;
93550
+ specularParameter*=texture(x3d_SpecularTexture.texture2D,texCoord.st).rgb;
93995
93551
  #elif defined(X3D_SPECULAR_TEXTURE_3D)
93996
- return specularParameter*texture(x3d_SpecularTexture.texture3D,texCoord).rgb;
93552
+ specularParameter*=texture(x3d_SpecularTexture.texture3D,texCoord).rgb;
93997
93553
  #elif defined(X3D_SPECULAR_TEXTURE_CUBE)
93998
- return specularParameter*texture(x3d_SpecularTexture.textureCube,texCoord).rgb;
93554
+ specularParameter*=texture(x3d_SpecularTexture.textureCube,texCoord).rgb;
93999
93555
  #endif
94000
- #else
94001
- return specularParameter;
94002
93556
  #endif
94003
- }
93557
+ return specularParameter;}
94004
93558
  #if defined(X3D_EMISSIVE_TEXTURE)
94005
93559
  uniform x3d_EmissiveTextureParameters x3d_EmissiveTexture;
94006
93560
  #endif
@@ -94008,16 +93562,14 @@ vec3 getEmissiveColor(){vec3 emissiveParameter=x3d_Material.emissiveColor;
94008
93562
  #if defined(X3D_EMISSIVE_TEXTURE)
94009
93563
  vec3 texCoord=getTexCoord(x3d_EmissiveTexture.textureTransformMapping,x3d_EmissiveTexture.textureCoordinateMapping);
94010
93564
  #if defined(X3D_EMISSIVE_TEXTURE_2D)
94011
- return emissiveParameter*texture(x3d_EmissiveTexture.texture2D,texCoord.st).rgb;
93565
+ emissiveParameter*=texture(x3d_EmissiveTexture.texture2D,texCoord.st).rgb;
94012
93566
  #elif defined(X3D_EMISSIVE_TEXTURE_3D)
94013
- return emissiveParameter*texture(x3d_EmissiveTexture.texture3D,texCoord).rgb;
93567
+ emissiveParameter*=texture(x3d_EmissiveTexture.texture3D,texCoord).rgb;
94014
93568
  #elif defined(X3D_EMISSIVE_TEXTURE_CUBE)
94015
- return emissiveParameter*texture(x3d_EmissiveTexture.textureCube,texCoord).rgb;
93569
+ emissiveParameter*=texture(x3d_EmissiveTexture.textureCube,texCoord).rgb;
94016
93570
  #endif
94017
- #else
94018
- return emissiveParameter;
94019
93571
  #endif
94020
- }
93572
+ return emissiveParameter;}
94021
93573
  #if defined(X3D_SHININESS_TEXTURE)
94022
93574
  uniform x3d_ShininessTextureParameters x3d_ShininessTexture;
94023
93575
  #endif
@@ -94025,16 +93577,14 @@ float getShininessFactor(){float shininess=x3d_Material.shininess;
94025
93577
  #if defined(X3D_SHININESS_TEXTURE)
94026
93578
  vec3 texCoord=getTexCoord(x3d_ShininessTexture.textureTransformMapping,x3d_ShininessTexture.textureCoordinateMapping);
94027
93579
  #if defined(X3D_SHININESS_TEXTURE_2D)
94028
- return shininess*texture(x3d_ShininessTexture.texture2D,texCoord.st).a;
93580
+ shininess*=texture(x3d_ShininessTexture.texture2D,texCoord.st).a;
94029
93581
  #elif defined(X3D_SHININESS_TEXTURE_3D)
94030
- return shininess*texture(x3d_ShininessTexture.texture3D,texCoord).a;
93582
+ shininess*=texture(x3d_ShininessTexture.texture3D,texCoord).a;
94031
93583
  #elif defined(X3D_SHININESS_TEXTURE_CUBE)
94032
- return shininess*texture(x3d_ShininessTexture.textureCube,texCoord).a;
93584
+ shininess*=texture(x3d_ShininessTexture.textureCube,texCoord).a;
94033
93585
  #endif
94034
- #else
94035
- return shininess;
94036
93586
  #endif
94037
- }
93587
+ return shininess;}
94038
93588
  #if defined(X3D_OCCLUSION_TEXTURE)
94039
93589
  uniform x3d_OcclusionTextureParameters x3d_OcclusionTexture;
94040
93590
  #endif
@@ -94078,8 +93628,8 @@ in vec4 texCoord0;
94078
93628
  vec4 texCoord0=vec4(0.0,0.0,0.0,1.0);
94079
93629
  #endif
94080
93630
  layout(location=0)out vec4 x3d_FragData0;layout(location=1)out vec4 x3d_FragData1;layout(location=2)out vec4 x3d_FragData2;
94081
- #pragma X3D include "include/ClipPlanes.glsl"
94082
- #pragma X3D include "include/Point.glsl"
93631
+ #pragma X3D include "common/ClipPlanes.glsl"
93632
+ #pragma X3D include "common/Point.glsl"
94083
93633
  #pragma X3D include "Stipple.glsl"
94084
93634
  uniform float x3d_Id;void main(){
94085
93635
  #if defined(X3D_CLIP_PLANES)
@@ -94113,10 +93663,10 @@ out vec4 texCoord0;
94113
93663
  #if defined(X3D_GEOMETRY_1D)&&defined(X3D_STYLE_PROPERTIES)
94114
93664
  flat out float lengthSoFar;flat out vec2 startPoint;out vec2 midPoint;
94115
93665
  #endif
94116
- #pragma X3D include "include/Utils.glsl"
94117
- #pragma X3D include "include/Skin.glsl"
94118
- #pragma X3D include "include/Particle.glsl"
94119
- #pragma X3D include "include/PointSize.glsl"
93666
+ #pragma X3D include "common/Utils.glsl"
93667
+ #pragma X3D include "common/Skin.glsl"
93668
+ #pragma X3D include "common/Particle.glsl"
93669
+ #pragma X3D include "common/PointSize.glsl"
94120
93670
  void main(){
94121
93671
  #if defined(X3D_GEOMETRY_1D)&&defined(X3D_STYLE_PROPERTIES)
94122
93672
  lengthSoFar=x3d_LineStipple.z;startPoint=x3d_LineStipple.xy;midPoint=x3d_LineStipple.xy;
@@ -94141,7 +93691,7 @@ x_ite_Namespace .add ("Pointing2.vs", "assets/shaders/webgl2/Pointing2.vs", Poin
94141
93691
  ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/Unlit2.fs.js
94142
93692
  const Unlit2_fs_default_ = /* glsl */ `#version 300 es
94143
93693
  precision highp float;precision highp int;precision highp sampler2D;precision highp sampler3D;precision highp samplerCube;
94144
- #pragma X3D include "include/Fragment.glsl"
93694
+ #pragma X3D include "common/Fragment.glsl"
94145
93695
  uniform x3d_UnlitMaterialParameters x3d_Material;
94146
93696
  #if defined(X3D_EMISSIVE_TEXTURE)
94147
93697
  uniform x3d_EmissiveTextureParameters x3d_EmissiveTexture;
@@ -94155,23 +93705,297 @@ vec4 emissiveParameter=vec4(x3d_Material.emissiveColor,alpha);
94155
93705
  #if defined(X3D_EMISSIVE_TEXTURE)
94156
93706
  vec3 texCoord=getTexCoord(x3d_EmissiveTexture.textureTransformMapping,x3d_EmissiveTexture.textureCoordinateMapping);
94157
93707
  #if defined(X3D_EMISSIVE_TEXTURE_2D)
94158
- return emissiveParameter*texture(x3d_EmissiveTexture.texture2D,texCoord.st);
93708
+ emissiveParameter*=texture(x3d_EmissiveTexture.texture2D,texCoord.st);
94159
93709
  #elif defined(X3D_EMISSIVE_TEXTURE_3D)
94160
- return emissiveParameter*texture(x3d_EmissiveTexture.texture3D,texCoord);
93710
+ emissiveParameter*=texture(x3d_EmissiveTexture.texture3D,texCoord);
94161
93711
  #elif defined(X3D_EMISSIVE_TEXTURE_CUBE)
94162
- return emissiveParameter*texture(x3d_EmissiveTexture.textureCube,texCoord);
93712
+ emissiveParameter*=texture(x3d_EmissiveTexture.textureCube,texCoord);
94163
93713
  #endif
94164
93714
  #elif defined(X3D_TEXTURE)
94165
- return getTextureColor(emissiveParameter,vec4(vec3(1.0),alpha));
94166
- #else
94167
- return emissiveParameter;
93715
+ emissiveParameter=getTextureColor(emissiveParameter,vec4(vec3(1.0),alpha));
94168
93716
  #endif
94169
- }vec4 getMaterialColor(){return getEmissiveColor();}void main(){fragment_main();}
93717
+ return emissiveParameter;}vec4 getMaterialColor(){return getEmissiveColor();}void main(){fragment_main();}
94170
93718
  `
94171
93719
  ;
94172
93720
 
94173
93721
  x_ite_Namespace .add ("Unlit2.fs", "assets/shaders/webgl2/Unlit2.fs", Unlit2_fs_default_);
94174
93722
  /* harmony default export */ const Unlit2_fs = (Unlit2_fs_default_);
93723
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/pbr/BDRF1.glsl.js
93724
+ const BDRF1_glsl_default_ = /* glsl */ `const float M_PI=3.14159265359;vec3 F_Schlick(vec3 f0,vec3 f90,float VdotH){return f0+(f90-f0)*pow(clamp(1.0-VdotH,0.0,1.0),5.0);}float V_GGX(float NdotL,float NdotV,float alphaRoughness){float alphaRoughnessSq=alphaRoughness*alphaRoughness;float GGXV=NdotL*sqrt(NdotV*NdotV*(1.0-alphaRoughnessSq)+alphaRoughnessSq);float GGXL=NdotV*sqrt(NdotL*NdotL*(1.0-alphaRoughnessSq)+alphaRoughnessSq);float GGX=GGXV+GGXL;if(GGX>0.0){return 0.5/GGX;}return 0.0;}float D_GGX(float NdotH,float alphaRoughness){float alphaRoughnessSq=alphaRoughness*alphaRoughness;float f=(NdotH*NdotH)*(alphaRoughnessSq-1.0)+1.0;return alphaRoughnessSq/(M_PI*f*f);}vec3 BRDF_lambertian(vec3 f0,vec3 f90,vec3 diffuseColor,float specularWeight,float VdotH){return(1.0-specularWeight*F_Schlick(f0,f90,VdotH))*(diffuseColor/M_PI);}vec3 BRDF_specularGGX(vec3 f0,vec3 f90,float alphaRoughness,float specularWeight,float VdotH,float NdotL,float NdotV,float NdotH){vec3 F=F_Schlick(f0,f90,VdotH);float Vis=V_GGX(NdotL,NdotV,alphaRoughness);float D=D_GGX(NdotH,alphaRoughness);return specularWeight*F*Vis*D;}
93725
+ `
93726
+ ;
93727
+
93728
+ x_ite_Namespace .add ("BDRF1.glsl", "assets/shaders/webgl1/pbr/BDRF1.glsl", BDRF1_glsl_default_);
93729
+ /* harmony default export */ const BDRF1_glsl = (BDRF1_glsl_default_);
93730
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/pbr/Punctual1.glsl.js
93731
+ const Punctual1_glsl_default_ = /* glsl */ `#if defined(X3D_LIGHTING)
93732
+ float getAttenuation(const in vec3 attenuation,const in float distanceToLight){return 1.0/max(dot(attenuation,vec3(1.0,distanceToLight,distanceToLight*distanceToLight)),1.0);}float getRangeAttenuation(const in float range,const in float _distance){if(range<=0.0){return 1.0/pow(_distance,2.0);}return max(min(1.0-pow(_distance/range,4.0),1.0),0.0)/pow(_distance,2.0);}float getSpotAttenuation(const in vec3 pointToLight,const in vec3 spotDirection,const in float outerConeCos,const in float innerConeCos){float actualCos=dot(normalize(spotDirection),normalize(-pointToLight));if(actualCos>outerConeCos){if(actualCos<innerConeCos){return smoothstep(outerConeCos,innerConeCos,actualCos);}return 1.0;}return 0.0;}vec3 getLightIntensity(const in x3d_LightSourceParameters light,const in vec3 pointToLight,const in float distanceToLight){float attenuation=1.0;float rangeAttenuation=1.0;float spotAttenuation=1.0;if(light.type!=x3d_DirectionalLight){attenuation=getAttenuation(light.attenuation,distanceToLight);rangeAttenuation=getRangeAttenuation(light.radius,length(pointToLight));}if(light.type==x3d_SpotLight){spotAttenuation=getSpotAttenuation(pointToLight,light.direction,cos(light.cutOffAngle),cos(light.beamWidth));}return attenuation*rangeAttenuation*spotAttenuation*light.intensity*light.color;}
93733
+ #endif
93734
+ `
93735
+ ;
93736
+
93737
+ x_ite_Namespace .add ("Punctual1.glsl", "assets/shaders/webgl1/pbr/Punctual1.glsl", Punctual1_glsl_default_);
93738
+ /* harmony default export */ const Punctual1_glsl = (Punctual1_glsl_default_);
93739
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/pbr/MaterialInfo1.glsl.js
93740
+ const MaterialInfo1_glsl_default_ = /* glsl */ `struct MaterialInfo{float ior;float perceptualRoughness;vec3 f0;float alphaRoughness;vec3 c_diff;vec3 f90;float metallic;vec3 baseColor;float sheenRoughnessFactor;vec3 sheenColorFactor;vec3 clearcoatF0;vec3 clearcoatF90;float clearcoatFactor;vec3 clearcoatNormal;float clearcoatRoughness;float specularWeight;float transmissionFactor;float thickness;vec3 attenuationColor;float attenuationDistance;float iridescenceFactor;float iridescenceIor;float iridescenceThickness;vec3 anisotropicT;vec3 anisotropicB;float anisotropyStrength;};
93741
+ #if defined(X3D_MATERIAL_SPECULAR_GLOSSINESS)
93742
+ #if defined(X3D_DIFFUSE_TEXTURE)
93743
+ uniform x3d_DiffuseTextureParameters x3d_DiffuseTexture;
93744
+ #endif
93745
+ #elif defined(X3D_MATERIAL_METALLIC_ROUGHNESS)
93746
+ #if defined(X3D_BASE_TEXTURE)
93747
+ uniform x3d_BaseTextureParameters x3d_BaseTexture;
93748
+ #endif
93749
+ #endif
93750
+ vec4 getBaseColor(){float alpha=1.0-x3d_Material.transparency;
93751
+ #if defined(X3D_MATERIAL_SPECULAR_GLOSSINESS)
93752
+ vec4 baseColor=vec4(x3d_Material.diffuseColor,alpha);
93753
+ #elif defined(X3D_MATERIAL_METALLIC_ROUGHNESS)
93754
+ vec4 baseColor=vec4(x3d_Material.baseColor,alpha);
93755
+ #endif
93756
+ #if defined(X3D_COLOR_MATERIAL)
93757
+ baseColor*=color;
93758
+ #endif
93759
+ #if defined(X3D_MATERIAL_SPECULAR_GLOSSINESS)
93760
+ #if defined(X3D_DIFFUSE_TEXTURE)
93761
+ vec3 texCoord=getTexCoord(x3d_Diffuse.textureTransformMapping,x3d_Diffuse.textureCoordinateMapping);
93762
+ #if defined(X3D_DIFFUSE_TEXTURE_2D)
93763
+ baseColor*=sRGBToLinear(texture2D(x3d_Diffuse.texture2D,texCoord.st));
93764
+ #elif defined(X3D_DIFFUSE_TEXTURE_CUBE)
93765
+ baseColor*=sRGBToLinear(textureCube(x3d_Diffuse.textureCube,texCoord));
93766
+ #endif
93767
+ #elif defined(X3D_TEXTURE)
93768
+ baseColor=getTextureColor(baseColor,vec4(vec3(1.0),alpha));
93769
+ #endif
93770
+ #elif defined(X3D_MATERIAL_METALLIC_ROUGHNESS)
93771
+ #if defined(X3D_BASE_TEXTURE)
93772
+ vec3 texCoord=getTexCoord(x3d_BaseTexture.textureTransformMapping,x3d_BaseTexture.textureCoordinateMapping);
93773
+ #if defined(X3D_BASE_TEXTURE_2D)
93774
+ baseColor*=sRGBToLinear(texture2D(x3d_BaseTexture.texture2D,texCoord.st));
93775
+ #elif defined(X3D_BASE_TEXTURE_CUBE)
93776
+ baseColor*=sRGBToLinear(textureCube(x3d_BaseTexture.textureCube,texCoord));
93777
+ #endif
93778
+ #elif defined(X3D_TEXTURE)
93779
+ baseColor=getTextureColor(baseColor,vec4(vec3(1.0),alpha));
93780
+ #endif
93781
+ #endif
93782
+ return baseColor;}
93783
+ #if defined(X3D_MATERIAL_METALLIC_ROUGHNESS)
93784
+ #if defined(X3D_METALLIC_ROUGHNESS_TEXTURE)
93785
+ uniform x3d_MetallicRoughnessTextureParameters x3d_MetallicRoughnessTexture;
93786
+ #endif
93787
+ MaterialInfo getMetallicRoughnessInfo(MaterialInfo info){info.metallic=x3d_Material.metallic;info.perceptualRoughness=x3d_Material.roughness;
93788
+ #if defined(X3D_METALLIC_ROUGHNESS_TEXTURE)
93789
+ vec3 texCoord=getTexCoord(x3d_MetallicRoughnessTexture.textureTransformMapping,x3d_MetallicRoughnessTexture.textureCoordinateMapping);
93790
+ #if defined(X3D_METALLIC_ROUGHNESS_TEXTURE_2D)
93791
+ vec4 mrSample=texture2D(x3d_MetallicRoughnessTexture.texture2D,texCoord.st);
93792
+ #elif defined(X3D_METALLIC_ROUGHNESS_TEXTURE_CUBE)
93793
+ vec4 mrSample=textureCube(x3d_MetallicRoughnessTexture.textureCube,texCoord);
93794
+ #endif
93795
+ info.metallic*=mrSample.b;info.perceptualRoughness*=mrSample.g;
93796
+ #endif
93797
+ info.c_diff=mix(info.baseColor.rgb,vec3(0.0),info.metallic);info.f0=mix(info.f0,info.baseColor.rgb,info.metallic);return info;}
93798
+ #endif
93799
+ #if defined(X3D_EMISSIVE_TEXTURE)
93800
+ uniform x3d_EmissiveTextureParameters x3d_EmissiveTexture;
93801
+ #endif
93802
+ vec3 getEmissiveColor(){vec3 emissiveParameter=x3d_Material.emissiveColor;
93803
+ #if defined(X3D_EMISSIVE_TEXTURE)
93804
+ vec3 texCoord=getTexCoord(x3d_EmissiveTexture.textureTransformMapping,x3d_EmissiveTexture.textureCoordinateMapping);
93805
+ #if defined(X3D_EMISSIVE_TEXTURE_2D)
93806
+ emissiveParameter*=sRGBToLinear(texture2D(x3d_EmissiveTexture.texture2D,texCoord.st)).rgb;
93807
+ #elif defined(X3D_EMISSIVE_TEXTURE_CUBE)
93808
+ emissiveParameter*=sRGBToLinear(textureCube(x3d_EmissiveTexture.textureCube,texCoord)).rgb;
93809
+ #endif
93810
+ #endif
93811
+ return emissiveParameter.rgb;}
93812
+ #if defined(X3D_OCCLUSION_TEXTURE)
93813
+ uniform x3d_OcclusionTextureParameters x3d_OcclusionTexture;
93814
+ #endif
93815
+ float getOcclusionFactor(){
93816
+ #if defined(X3D_OCCLUSION_TEXTURE)
93817
+ vec3 texCoord=getTexCoord(x3d_OcclusionTexture.textureTransformMapping,x3d_OcclusionTexture.textureCoordinateMapping);
93818
+ #if defined(X3D_OCCLUSION_TEXTURE_2D)
93819
+ return texture2D(x3d_OcclusionTexture.texture2D,texCoord.st).r;
93820
+ #elif defined(X3D_OCCLUSION_TEXTURE_CUBE)
93821
+ return textureCube(x3d_OcclusionTexture.textureCube,texCoord).r;
93822
+ #endif
93823
+ #else
93824
+ return 1.0;
93825
+ #endif
93826
+ }
93827
+ `
93828
+ ;
93829
+
93830
+ x_ite_Namespace .add ("MaterialInfo1.glsl", "assets/shaders/webgl1/pbr/MaterialInfo1.glsl", MaterialInfo1_glsl_default_);
93831
+ /* harmony default export */ const MaterialInfo1_glsl = (MaterialInfo1_glsl_default_);
93832
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/pbr/ToneMapping1.glsl.js
93833
+ const ToneMapping1_glsl_default_ = /* glsl */ `const float exposure=1.0;const float GAMMA=2.2;const float INV_GAMMA=1.0/GAMMA;vec3 linearTosRGB(const in vec3 color){return pow(color,vec3(INV_GAMMA));}vec3 sRGBToLinear(const in vec3 srgbIn){return vec3(pow(srgbIn.xyz,vec3(GAMMA)));}vec4 sRGBToLinear(const in vec4 srgbIn){return vec4(sRGBToLinear(srgbIn.xyz),srgbIn.w);}
93834
+ #if defined(X3D_TONEMAP_ACES_NARKOWICZ)
93835
+ vec3 toneMapACES_Narkowicz(const in vec3 color){const float A=2.51;const float B=0.03;const float C=2.43;const float D=0.59;const float E=0.14;return clamp((color*(A*color+B))/(color*(C*color+D)+E),0.0,1.0);}
93836
+ #endif
93837
+ #if defined(X3D_TONEMAP_ACES_HILL)||defined(X3D_TONEMAP_ACES_HILL_EXPOSURE_BOOST)
93838
+ const mat3 ACESInputMat=mat3(0.59719,0.07600,0.02840,0.35458,0.90834,0.13383,0.04823,0.01566,0.83777);const mat3 ACESOutputMat=mat3(1.60475,-0.10208,-0.00327,-0.53108,1.10813,-0.07276,-0.07367,-0.00605,1.07602);vec3 RRTAndODTFit(const in vec3 color){vec3 a=color*(color+0.0245786)-0.000090537;vec3 b=color*(0.983729*color+0.4329510)+0.238081;return a/b;}vec3 toneMapACES_Hill(in vec3 color){color=ACESInputMat*color;color=RRTAndODTFit(color);color=ACESOutputMat*color;color=clamp(color,0.0,1.0);return color;}
93839
+ #endif
93840
+ vec3 toneMap(in vec3 color){color*=exposure;
93841
+ #if defined(X3D_TONEMAP_ACES_NARKOWICZ)
93842
+ color=toneMapACES_Narkowicz(color);
93843
+ #endif
93844
+ #if defined(X3D_TONEMAP_ACES_HILL)
93845
+ color=toneMapACES_Hill(color);
93846
+ #endif
93847
+ #if defined(X3D_TONEMAP_ACES_HILL_EXPOSURE_BOOST)
93848
+ color/=0.6;color=toneMapACES_Hill(color);
93849
+ #endif
93850
+ return linearTosRGB(color);}
93851
+ `
93852
+ ;
93853
+
93854
+ x_ite_Namespace .add ("ToneMapping1.glsl", "assets/shaders/webgl1/pbr/ToneMapping1.glsl", ToneMapping1_glsl_default_);
93855
+ /* harmony default export */ const ToneMapping1_glsl = (ToneMapping1_glsl_default_);
93856
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/pbr/BDRF2.glsl.js
93857
+ const BDRF2_glsl_default_ = /* glsl */ `const float M_PI=3.14159265359;vec3 F_Schlick(vec3 f0,vec3 f90,float VdotH){return f0+(f90-f0)*pow(clamp(1.0-VdotH,0.0,1.0),5.0);}float V_GGX(float NdotL,float NdotV,float alphaRoughness){float alphaRoughnessSq=alphaRoughness*alphaRoughness;float GGXV=NdotL*sqrt(NdotV*NdotV*(1.0-alphaRoughnessSq)+alphaRoughnessSq);float GGXL=NdotV*sqrt(NdotL*NdotL*(1.0-alphaRoughnessSq)+alphaRoughnessSq);float GGX=GGXV+GGXL;if(GGX>0.0){return 0.5/GGX;}return 0.0;}float D_GGX(float NdotH,float alphaRoughness){float alphaRoughnessSq=alphaRoughness*alphaRoughness;float f=(NdotH*NdotH)*(alphaRoughnessSq-1.0)+1.0;return alphaRoughnessSq/(M_PI*f*f);}vec3 BRDF_lambertian(vec3 f0,vec3 f90,vec3 diffuseColor,float specularWeight,float VdotH){return(1.0-specularWeight*F_Schlick(f0,f90,VdotH))*(diffuseColor/M_PI);}vec3 BRDF_specularGGX(vec3 f0,vec3 f90,float alphaRoughness,float specularWeight,float VdotH,float NdotL,float NdotV,float NdotH){vec3 F=F_Schlick(f0,f90,VdotH);float Vis=V_GGX(NdotL,NdotV,alphaRoughness);float D=D_GGX(NdotH,alphaRoughness);return specularWeight*F*Vis*D;}
93858
+ `
93859
+ ;
93860
+
93861
+ x_ite_Namespace .add ("BDRF2.glsl", "assets/shaders/webgl2/pbr/BDRF2.glsl", BDRF2_glsl_default_);
93862
+ /* harmony default export */ const BDRF2_glsl = (BDRF2_glsl_default_);
93863
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/pbr/Punctual2.glsl.js
93864
+ const Punctual2_glsl_default_ = /* glsl */ `#if defined(X3D_LIGHTING)
93865
+ float getAttenuation(const in vec3 attenuation,const in float distanceToLight){return 1.0/max(dot(attenuation,vec3(1.0,distanceToLight,distanceToLight*distanceToLight)),1.0);}float getRangeAttenuation(const in float range,const in float _distance){if(range<=0.0){return 1.0/pow(_distance,2.0);}return max(min(1.0-pow(_distance/range,4.0),1.0),0.0)/pow(_distance,2.0);}float getSpotAttenuation(const in vec3 pointToLight,const in vec3 spotDirection,const in float outerConeCos,const in float innerConeCos){float actualCos=dot(normalize(spotDirection),normalize(-pointToLight));if(actualCos>outerConeCos){if(actualCos<innerConeCos){return smoothstep(outerConeCos,innerConeCos,actualCos);}return 1.0;}return 0.0;}vec3 getLightIntensity(const in x3d_LightSourceParameters light,const in vec3 pointToLight,const in float distanceToLight){float attenuation=1.0;float rangeAttenuation=1.0;float spotAttenuation=1.0;if(light.type!=x3d_DirectionalLight){attenuation=getAttenuation(light.attenuation,distanceToLight);rangeAttenuation=getRangeAttenuation(light.radius,length(pointToLight));}if(light.type==x3d_SpotLight){spotAttenuation=getSpotAttenuation(pointToLight,light.direction,cos(light.cutOffAngle),cos(light.beamWidth));}return attenuation*rangeAttenuation*spotAttenuation*light.intensity*light.color;}
93866
+ #endif
93867
+ `
93868
+ ;
93869
+
93870
+ x_ite_Namespace .add ("Punctual2.glsl", "assets/shaders/webgl2/pbr/Punctual2.glsl", Punctual2_glsl_default_);
93871
+ /* harmony default export */ const Punctual2_glsl = (Punctual2_glsl_default_);
93872
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/pbr/MaterialInfo2.glsl.js
93873
+ const MaterialInfo2_glsl_default_ = /* glsl */ `struct MaterialInfo{float ior;float perceptualRoughness;vec3 f0;float alphaRoughness;vec3 c_diff;vec3 f90;float metallic;vec3 baseColor;float sheenRoughnessFactor;vec3 sheenColorFactor;vec3 clearcoatF0;vec3 clearcoatF90;float clearcoatFactor;vec3 clearcoatNormal;float clearcoatRoughness;float specularWeight;float transmissionFactor;float thickness;vec3 attenuationColor;float attenuationDistance;float iridescenceFactor;float iridescenceIor;float iridescenceThickness;vec3 anisotropicT;vec3 anisotropicB;float anisotropyStrength;};
93874
+ #if defined(X3D_MATERIAL_SPECULAR_GLOSSINESS)
93875
+ #if defined(X3D_DIFFUSE_TEXTURE)
93876
+ uniform x3d_DiffuseTextureParameters x3d_DiffuseTexture;
93877
+ #endif
93878
+ #elif defined(X3D_MATERIAL_METALLIC_ROUGHNESS)
93879
+ #if defined(X3D_BASE_TEXTURE)
93880
+ uniform x3d_BaseTextureParameters x3d_BaseTexture;
93881
+ #endif
93882
+ #endif
93883
+ vec4 getBaseColor(){float alpha=1.0-x3d_Material.transparency;
93884
+ #if defined(X3D_MATERIAL_SPECULAR_GLOSSINESS)
93885
+ vec4 baseColor=vec4(x3d_Material.diffuseColor,alpha);
93886
+ #elif defined(X3D_MATERIAL_METALLIC_ROUGHNESS)
93887
+ vec4 baseColor=vec4(x3d_Material.baseColor,alpha);
93888
+ #endif
93889
+ #if defined(X3D_COLOR_MATERIAL)
93890
+ baseColor*=color;
93891
+ #endif
93892
+ #if defined(X3D_MATERIAL_SPECULAR_GLOSSINESS)
93893
+ #if defined(X3D_DIFFUSE_TEXTURE)
93894
+ vec3 texCoord=getTexCoord(x3d_Diffuse.textureTransformMapping,x3d_Diffuse.textureCoordinateMapping);
93895
+ #if defined(X3D_DIFFUSE_TEXTURE_2D)
93896
+ baseColor*=sRGBToLinear(texture(x3d_Diffuse.texture2D,texCoord.st));
93897
+ #elif defined(X3D_DIFFUSE_TEXTURE_3D)
93898
+ baseColor*=sRGBToLinear(texture(x3d_Diffuse.texture3D,texCoord));
93899
+ #elif defined(X3D_DIFFUSE_TEXTURE_CUBE)
93900
+ baseColor*=sRGBToLinear(texture(x3d_Diffuse.textureCube,texCoord));
93901
+ #endif
93902
+ #elif defined(X3D_TEXTURE)
93903
+ baseColor=getTextureColor(baseColor,vec4(vec3(1.0),alpha));
93904
+ #endif
93905
+ #elif defined(X3D_MATERIAL_METALLIC_ROUGHNESS)
93906
+ #if defined(X3D_BASE_TEXTURE)
93907
+ vec3 texCoord=getTexCoord(x3d_BaseTexture.textureTransformMapping,x3d_BaseTexture.textureCoordinateMapping);
93908
+ #if defined(X3D_BASE_TEXTURE_2D)
93909
+ baseColor*=sRGBToLinear(texture(x3d_BaseTexture.texture2D,texCoord.st));
93910
+ #elif defined(X3D_BASE_TEXTURE_3D)
93911
+ baseColor*=sRGBToLinear(texture(x3d_BaseTexture.texture3D,texCoord));
93912
+ #elif defined(X3D_BASE_TEXTURE_CUBE)
93913
+ baseColor*=sRGBToLinear(texture(x3d_BaseTexture.textureCube,texCoord));
93914
+ #endif
93915
+ #elif defined(X3D_TEXTURE)
93916
+ baseColor=getTextureColor(baseColor,vec4(vec3(1.0),alpha));
93917
+ #endif
93918
+ #endif
93919
+ return baseColor;}
93920
+ #if defined(X3D_MATERIAL_METALLIC_ROUGHNESS)
93921
+ #if defined(X3D_METALLIC_ROUGHNESS_TEXTURE)
93922
+ uniform x3d_MetallicRoughnessTextureParameters x3d_MetallicRoughnessTexture;
93923
+ #endif
93924
+ MaterialInfo getMetallicRoughnessInfo(MaterialInfo info){info.metallic=x3d_Material.metallic;info.perceptualRoughness=x3d_Material.roughness;
93925
+ #if defined(X3D_METALLIC_ROUGHNESS_TEXTURE)
93926
+ vec3 texCoord=getTexCoord(x3d_MetallicRoughnessTexture.textureTransformMapping,x3d_MetallicRoughnessTexture.textureCoordinateMapping);
93927
+ #if defined(X3D_METALLIC_ROUGHNESS_TEXTURE_2D)
93928
+ vec4 mrSample=texture(x3d_MetallicRoughnessTexture.texture2D,texCoord.st);
93929
+ #elif defined(X3D_METALLIC_ROUGHNESS_TEXTURE_3D)
93930
+ vec4 mrSample=texture(x3d_MetallicRoughnessTexture.texture3D,texCoord);
93931
+ #elif defined(X3D_METALLIC_ROUGHNESS_TEXTURE_CUBE)
93932
+ vec4 mrSample=texture(x3d_MetallicRoughnessTexture.textureCube,texCoord);
93933
+ #endif
93934
+ info.metallic*=mrSample.b;info.perceptualRoughness*=mrSample.g;
93935
+ #endif
93936
+ info.c_diff=mix(info.baseColor.rgb,vec3(0.0),info.metallic);info.f0=mix(info.f0,info.baseColor.rgb,info.metallic);return info;}
93937
+ #endif
93938
+ #if defined(X3D_EMISSIVE_TEXTURE)
93939
+ uniform x3d_EmissiveTextureParameters x3d_EmissiveTexture;
93940
+ #endif
93941
+ vec3 getEmissiveColor(){vec3 emissiveParameter=x3d_Material.emissiveColor;
93942
+ #if defined(X3D_EMISSIVE_TEXTURE)
93943
+ vec3 texCoord=getTexCoord(x3d_EmissiveTexture.textureTransformMapping,x3d_EmissiveTexture.textureCoordinateMapping);
93944
+ #if defined(X3D_EMISSIVE_TEXTURE_2D)
93945
+ emissiveParameter*=sRGBToLinear(texture(x3d_EmissiveTexture.texture2D,texCoord.st)).rgb;
93946
+ #elif defined(X3D_EMISSIVE_TEXTURE_3D)
93947
+ emissiveParameter*=sRGBToLinear(texture(x3d_EmissiveTexture.texture3D,texCoord)).rgb;
93948
+ #elif defined(X3D_EMISSIVE_TEXTURE_CUBE)
93949
+ emissiveParameter*=sRGBToLinear(texture(x3d_EmissiveTexture.textureCube,texCoord)).rgb;
93950
+ #endif
93951
+ #endif
93952
+ return emissiveParameter.rgb;}
93953
+ #if defined(X3D_OCCLUSION_TEXTURE)
93954
+ uniform x3d_OcclusionTextureParameters x3d_OcclusionTexture;
93955
+ #endif
93956
+ float getOcclusionFactor(){
93957
+ #if defined(X3D_OCCLUSION_TEXTURE)
93958
+ vec3 texCoord=getTexCoord(x3d_OcclusionTexture.textureTransformMapping,x3d_OcclusionTexture.textureCoordinateMapping);
93959
+ #if defined(X3D_OCCLUSION_TEXTURE_2D)
93960
+ return texture(x3d_OcclusionTexture.texture2D,texCoord.st).r;
93961
+ #elif defined(X3D_OCCLUSION_TEXTURE_3D)
93962
+ return texture(x3d_OcclusionTexture.texture3D,texCoord).r;
93963
+ #elif defined(X3D_OCCLUSION_TEXTURE_CUBE)
93964
+ return texture(x3d_OcclusionTexture.textureCube,texCoord).r;
93965
+ #endif
93966
+ #else
93967
+ return 1.0;
93968
+ #endif
93969
+ }
93970
+ `
93971
+ ;
93972
+
93973
+ x_ite_Namespace .add ("MaterialInfo2.glsl", "assets/shaders/webgl2/pbr/MaterialInfo2.glsl", MaterialInfo2_glsl_default_);
93974
+ /* harmony default export */ const MaterialInfo2_glsl = (MaterialInfo2_glsl_default_);
93975
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/pbr/ToneMapping2.glsl.js
93976
+ const ToneMapping2_glsl_default_ = /* glsl */ `const float exposure=1.0;const float GAMMA=2.2;const float INV_GAMMA=1.0/GAMMA;vec3 linearTosRGB(const in vec3 color){return pow(color,vec3(INV_GAMMA));}vec3 sRGBToLinear(const in vec3 srgbIn){return vec3(pow(srgbIn.xyz,vec3(GAMMA)));}vec4 sRGBToLinear(const in vec4 srgbIn){return vec4(sRGBToLinear(srgbIn.xyz),srgbIn.w);}
93977
+ #if defined(X3D_TONEMAP_ACES_NARKOWICZ)
93978
+ vec3 toneMapACES_Narkowicz(const in vec3 color){const float A=2.51;const float B=0.03;const float C=2.43;const float D=0.59;const float E=0.14;return clamp((color*(A*color+B))/(color*(C*color+D)+E),0.0,1.0);}
93979
+ #endif
93980
+ #if defined(X3D_TONEMAP_ACES_HILL)||defined(X3D_TONEMAP_ACES_HILL_EXPOSURE_BOOST)
93981
+ const mat3 ACESInputMat=mat3(0.59719,0.07600,0.02840,0.35458,0.90834,0.13383,0.04823,0.01566,0.83777);const mat3 ACESOutputMat=mat3(1.60475,-0.10208,-0.00327,-0.53108,1.10813,-0.07276,-0.07367,-0.00605,1.07602);vec3 RRTAndODTFit(const in vec3 color){vec3 a=color*(color+0.0245786)-0.000090537;vec3 b=color*(0.983729*color+0.4329510)+0.238081;return a/b;}vec3 toneMapACES_Hill(in vec3 color){color=ACESInputMat*color;color=RRTAndODTFit(color);color=ACESOutputMat*color;color=clamp(color,0.0,1.0);return color;}
93982
+ #endif
93983
+ vec3 toneMap(in vec3 color){color*=exposure;
93984
+ #if defined(X3D_TONEMAP_ACES_NARKOWICZ)
93985
+ color=toneMapACES_Narkowicz(color);
93986
+ #endif
93987
+ #if defined(X3D_TONEMAP_ACES_HILL)
93988
+ color=toneMapACES_Hill(color);
93989
+ #endif
93990
+ #if defined(X3D_TONEMAP_ACES_HILL_EXPOSURE_BOOST)
93991
+ color/=0.6;color=toneMapACES_Hill(color);
93992
+ #endif
93993
+ return linearTosRGB(color);}
93994
+ `
93995
+ ;
93996
+
93997
+ x_ite_Namespace .add ("ToneMapping2.glsl", "assets/shaders/webgl2/pbr/ToneMapping2.glsl", ToneMapping2_glsl_default_);
93998
+ /* harmony default export */ const ToneMapping2_glsl = (ToneMapping2_glsl_default_);
94175
93999
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Shaders/ShaderRegistry.js
94176
94000
  /*******************************************************************************
94177
94001
  *
@@ -94256,7 +94080,6 @@ x_ite_Namespace .add ("Unlit2.fs", "assets/shaders/webgl2/Unlit2.fs", Unlit2_fs_
94256
94080
 
94257
94081
 
94258
94082
 
94259
-
94260
94083
  /* WebGL 1 */
94261
94084
 
94262
94085
 
@@ -94285,6 +94108,18 @@ x_ite_Namespace .add ("Unlit2.fs", "assets/shaders/webgl2/Unlit2.fs", Unlit2_fs_
94285
94108
 
94286
94109
 
94287
94110
 
94111
+ /* PBR 1 */
94112
+
94113
+
94114
+
94115
+
94116
+
94117
+ /* PBR 2 */
94118
+
94119
+
94120
+
94121
+
94122
+
94288
94123
  const ShaderRegistry = {
94289
94124
  includes: {
94290
94125
  1: {
@@ -94302,10 +94137,14 @@ const ShaderRegistry = {
94302
94137
  SpotFactor: SpotFactor1_glsl,
94303
94138
  Texture: Texture1_glsl,
94304
94139
  Vertex: Vertex1_glsl,
94140
+ // PBR
94141
+ BDRF: BDRF1_glsl,
94142
+ MaterialInfo: MaterialInfo1_glsl,
94143
+ Punctual: Punctual1_glsl,
94144
+ ToneMapping: ToneMapping1_glsl,
94305
94145
  },
94306
94146
  2: {
94307
94147
  ClipPlanes: ClipPlanes2_glsl,
94308
- Colors: Colors2_glsl,
94309
94148
  Fog: Fog2_glsl,
94310
94149
  Fragment: Fragment2_glsl,
94311
94150
  Hatch: Hatch2_glsl,
@@ -94323,6 +94162,11 @@ const ShaderRegistry = {
94323
94162
  Texture: Texture2_glsl,
94324
94163
  Utils: Utils2_glsl,
94325
94164
  Vertex: Vertex2_glsl,
94165
+ // PBR
94166
+ BDRF: BDRF2_glsl,
94167
+ MaterialInfo: MaterialInfo2_glsl,
94168
+ Punctual: Punctual2_glsl,
94169
+ ToneMapping: ToneMapping2_glsl,
94326
94170
  },
94327
94171
  },
94328
94172
  vertex: {
@@ -94471,7 +94315,7 @@ const ShaderCompiler_default_ = ShaderCompiler;
94471
94315
  x_ite_Namespace .add ("ShaderCompiler", "x_ite/Browser/Shaders/ShaderCompiler", ShaderCompiler_default_);
94472
94316
  /* harmony default export */ const Shaders_ShaderCompiler = (ShaderCompiler_default_);
94473
94317
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Shaders/ShaderPart.js
94474
- /* provided dependency */ var ShaderPart_$ = __webpack_require__(864);
94318
+ /* provided dependency */ var ShaderPart_$ = __webpack_require__(659);
94475
94319
  /*******************************************************************************
94476
94320
  *
94477
94321
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -95128,7 +94972,7 @@ const X3DAppearanceNode_default_ = X3DAppearanceNode;
95128
94972
  x_ite_Namespace .add ("X3DAppearanceNode", "x_ite/Components/Shape/X3DAppearanceNode", X3DAppearanceNode_default_);
95129
94973
  /* harmony default export */ const Shape_X3DAppearanceNode = (X3DAppearanceNode_default_);
95130
94974
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Shape/Appearance.js
95131
- /* provided dependency */ var Appearance_$ = __webpack_require__(864);
94975
+ /* provided dependency */ var Appearance_$ = __webpack_require__(659);
95132
94976
  /*******************************************************************************
95133
94977
  *
95134
94978
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -97133,7 +96977,7 @@ Object .assign (Object .setPrototypeOf (PhysicalMaterial .prototype, Shape_X3DOn
97133
96977
 
97134
96978
  if (geometryContext .hasNormals)
97135
96979
  {
97136
- options .push ("X3D_PHYSICAL_MATERIAL", "MANUAL_SRGB");
96980
+ options .push ("X3D_PHYSICAL_MATERIAL", "X3D_MATERIAL_METALLIC_ROUGHNESS");
97137
96981
 
97138
96982
  if (+this .getTextureBits ())
97139
96983
  {
@@ -98409,7 +98253,7 @@ const Components_Shape_default_ = {
98409
98253
  x_ite_Namespace .add ("Shape", "x_ite/Components/Shape", Components_Shape_default_);
98410
98254
  /* harmony default export */ const Components_Shape = (Components_Shape_default_);
98411
98255
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Sound/X3DSoundProcessingNode.js
98412
- /* provided dependency */ var X3DSoundProcessingNode_$ = __webpack_require__(864);
98256
+ /* provided dependency */ var X3DSoundProcessingNode_$ = __webpack_require__(659);
98413
98257
  /*******************************************************************************
98414
98258
  *
98415
98259
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -99049,7 +98893,7 @@ const X3DSoundSourceNode_default_ = X3DSoundSourceNode;
99049
98893
  x_ite_Namespace .add ("X3DSoundSourceNode", "x_ite/Components/Sound/X3DSoundSourceNode", X3DSoundSourceNode_default_);
99050
98894
  /* harmony default export */ const Sound_X3DSoundSourceNode = (X3DSoundSourceNode_default_);
99051
98895
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Sound/AudioClip.js
99052
- /* provided dependency */ var AudioClip_$ = __webpack_require__(864);
98896
+ /* provided dependency */ var AudioClip_$ = __webpack_require__(659);
99053
98897
  /*******************************************************************************
99054
98898
  *
99055
98899
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -99351,7 +99195,7 @@ const X3DSoundNode_default_ = X3DSoundNode;
99351
99195
  x_ite_Namespace .add ("X3DSoundNode", "x_ite/Components/Sound/X3DSoundNode", X3DSoundNode_default_);
99352
99196
  /* harmony default export */ const Sound_X3DSoundNode = (X3DSoundNode_default_);
99353
99197
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Sound/X3DSoundDestinationNode.js
99354
- /* provided dependency */ var X3DSoundDestinationNode_$ = __webpack_require__(864);
99198
+ /* provided dependency */ var X3DSoundDestinationNode_$ = __webpack_require__(659);
99355
99199
  /*******************************************************************************
99356
99200
  *
99357
99201
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -101001,7 +100845,7 @@ const ListenerPointSource_default_ = ListenerPointSource;
101001
100845
  x_ite_Namespace .add ("ListenerPointSource", "x_ite/Components/Sound/ListenerPointSource", ListenerPointSource_default_);
101002
100846
  /* harmony default export */ const Sound_ListenerPointSource = (ListenerPointSource_default_);
101003
100847
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Sound/MicrophoneSource.js
101004
- /* provided dependency */ var MicrophoneSource_$ = __webpack_require__(864);
100848
+ /* provided dependency */ var MicrophoneSource_$ = __webpack_require__(659);
101005
100849
  /*******************************************************************************
101006
100850
  *
101007
100851
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -102539,7 +102383,7 @@ const Components_Sound_default_ = {
102539
102383
 
102540
102384
  x_ite_Namespace .add ("Sound", "x_ite/Components/Sound", Components_Sound_default_);
102541
102385
  /* harmony default export */ const Components_Sound = (Components_Sound_default_);
102542
- ;// CONCATENATED MODULE: ./src/x_ite/Browser/Texturing/GIFMedia.js
102386
+ ;// CONCATENATED MODULE: ./src/x_ite/Browser/Texturing/GifMedia.js
102543
102387
  /*******************************************************************************
102544
102388
  *
102545
102389
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -102664,14 +102508,14 @@ function GifMedia (gif, movieTexture)
102664
102508
  });
102665
102509
  }
102666
102510
 
102667
- const GIFMedia_default_ = GifMedia;
102511
+ const GifMedia_default_ = GifMedia;
102668
102512
  ;
102669
102513
 
102670
- x_ite_Namespace .add ("GIFMedia", "x_ite/Browser/Texturing/GIFMedia", GIFMedia_default_);
102671
- /* harmony default export */ const GIFMedia = (GIFMedia_default_);
102514
+ x_ite_Namespace .add ("GifMedia", "x_ite/Browser/Texturing/GifMedia", GifMedia_default_);
102515
+ /* harmony default export */ const Texturing_GifMedia = (GifMedia_default_);
102672
102516
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Texturing/MovieTexture.js
102673
- /* provided dependency */ var MovieTexture_$ = __webpack_require__(864);
102674
- /* provided dependency */ var SuperGif = __webpack_require__(27);
102517
+ /* provided dependency */ var MovieTexture_$ = __webpack_require__(659);
102518
+ /* provided dependency */ var SuperGif = __webpack_require__(357);
102675
102519
  /*******************************************************************************
102676
102520
  *
102677
102521
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -102875,7 +102719,7 @@ Object .assign (Object .setPrototypeOf (MovieTexture .prototype, Texturing_X3DTe
102875
102719
  {
102876
102720
  this .gif = gif;
102877
102721
 
102878
- GIFMedia (gif, this);
102722
+ Texturing_GifMedia (gif, this);
102879
102723
 
102880
102724
  gif .pause ();
102881
102725
 
@@ -102905,10 +102749,7 @@ Object .assign (Object .setPrototypeOf (MovieTexture .prototype, Texturing_X3DTe
102905
102749
  if (this .checkLoadState () !== Base_X3DConstants .COMPLETE_STATE)
102906
102750
  return;
102907
102751
 
102908
- if (this .gif)
102909
- this .updateTexture (this .gif .currentFrame .data, true);
102910
- else
102911
- this .updateTexture (this .video [0], true);
102752
+ this .updateTexture (this .gif ?.currentFrame .data ?? this .video [0], true);
102912
102753
  },
102913
102754
  traverse: Texturing_X3DTexture2DNode .prototype .traverse,
102914
102755
  dispose ()
@@ -103842,7 +103683,7 @@ const MultiTextureTransform_default_ = MultiTextureTransform;
103842
103683
  x_ite_Namespace .add ("MultiTextureTransform", "x_ite/Components/Texturing/MultiTextureTransform", MultiTextureTransform_default_);
103843
103684
  /* harmony default export */ const Texturing_MultiTextureTransform = (MultiTextureTransform_default_);
103844
103685
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Texturing/PixelTexture.js
103845
- /* provided dependency */ var PixelTexture_$ = __webpack_require__(864);
103686
+ /* provided dependency */ var PixelTexture_$ = __webpack_require__(659);
103846
103687
  /*******************************************************************************
103847
103688
  *
103848
103689
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -105996,7 +105837,7 @@ const gettext_default_ = gettext;
105996
105837
  x_ite_Namespace .add ("gettext", "locale/gettext", gettext_default_);
105997
105838
  /* harmony default export */ const locale_gettext = (gettext_default_);
105998
105839
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Core/BrowserTimings.js
105999
- /* provided dependency */ var BrowserTimings_$ = __webpack_require__(864);
105840
+ /* provided dependency */ var BrowserTimings_$ = __webpack_require__(659);
106000
105841
  /*******************************************************************************
106001
105842
  *
106002
105843
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -106426,7 +106267,7 @@ const TextureQuality_default_ = TextureQuality;
106426
106267
  x_ite_Namespace .add ("TextureQuality", "x_ite/Browser/Core/TextureQuality", TextureQuality_default_);
106427
106268
  /* harmony default export */ const Core_TextureQuality = (TextureQuality_default_);
106428
106269
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Core/BrowserOptions.js
106429
- /* provided dependency */ var BrowserOptions_$ = __webpack_require__(864);
106270
+ /* provided dependency */ var BrowserOptions_$ = __webpack_require__(659);
106430
106271
  /*******************************************************************************
106431
106272
  *
106432
106273
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -107019,7 +106860,7 @@ const RenderingProperties_default_ = RenderingProperties;
107019
106860
  x_ite_Namespace .add ("RenderingProperties", "x_ite/Browser/Core/RenderingProperties", RenderingProperties_default_);
107020
106861
  /* harmony default export */ const Core_RenderingProperties = (RenderingProperties_default_);
107021
106862
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Core/Notification.js
107022
- /* provided dependency */ var Notification_$ = __webpack_require__(864);
106863
+ /* provided dependency */ var Notification_$ = __webpack_require__(659);
107023
106864
  /*******************************************************************************
107024
106865
  *
107025
106866
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -107142,8 +106983,8 @@ const Notification_default_ = Notification;
107142
106983
  x_ite_Namespace .add ("Notification", "x_ite/Browser/Core/Notification", Notification_default_);
107143
106984
  /* harmony default export */ const Core_Notification = (Notification_default_);
107144
106985
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Core/ContextMenu.js
107145
- /* provided dependency */ var jquery_fullscreen = __webpack_require__(543);
107146
- /* provided dependency */ var ContextMenu_$ = __webpack_require__(864);
106986
+ /* provided dependency */ var jquery_fullscreen = __webpack_require__(196);
106987
+ /* provided dependency */ var ContextMenu_$ = __webpack_require__(659);
107147
106988
  /*******************************************************************************
107148
106989
  *
107149
106990
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -109895,7 +109736,7 @@ const DataStorage_default_ = DataStorage;
109895
109736
  x_ite_Namespace .add ("DataStorage", "standard/Utility/DataStorage", DataStorage_default_);
109896
109737
  /* harmony default export */ const Utility_DataStorage = (DataStorage_default_);
109897
109738
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Core/X3DCoreContext.js
109898
- /* provided dependency */ var X3DCoreContext_$ = __webpack_require__(864);
109739
+ /* provided dependency */ var X3DCoreContext_$ = __webpack_require__(659);
109899
109740
  /*******************************************************************************
109900
109741
  *
109901
109742
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -111941,8 +111782,8 @@ const X3DViewer_default_ = X3DViewer;
111941
111782
  x_ite_Namespace .add ("X3DViewer", "x_ite/Browser/Navigation/X3DViewer", X3DViewer_default_);
111942
111783
  /* harmony default export */ const Navigation_X3DViewer = (X3DViewer_default_);
111943
111784
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Navigation/ExamineViewer.js
111944
- /* provided dependency */ var jquery_mousewheel = __webpack_require__(273);
111945
- /* provided dependency */ var ExamineViewer_$ = __webpack_require__(864);
111785
+ /* provided dependency */ var jquery_mousewheel = __webpack_require__(946);
111786
+ /* provided dependency */ var ExamineViewer_$ = __webpack_require__(659);
111946
111787
  /*******************************************************************************
111947
111788
  *
111948
111789
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -112814,8 +112655,8 @@ const ExamineViewer_default_ = ExamineViewer;
112814
112655
  x_ite_Namespace .add ("ExamineViewer", "x_ite/Browser/Navigation/ExamineViewer", ExamineViewer_default_);
112815
112656
  /* harmony default export */ const Navigation_ExamineViewer = (ExamineViewer_default_);
112816
112657
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Navigation/X3DFlyViewer.js
112817
- /* provided dependency */ var X3DFlyViewer_jquery_mousewheel = __webpack_require__(273);
112818
- /* provided dependency */ var X3DFlyViewer_$ = __webpack_require__(864);
112658
+ /* provided dependency */ var X3DFlyViewer_jquery_mousewheel = __webpack_require__(946);
112659
+ /* provided dependency */ var X3DFlyViewer_$ = __webpack_require__(659);
112819
112660
  /*******************************************************************************
112820
112661
  *
112821
112662
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -113526,7 +113367,7 @@ Object .assign (Object .setPrototypeOf (X3DFlyViewer .prototype, Navigation_X3DV
113526
113367
 
113527
113368
  gl .uniformMatrix4fv (shaderNode .x3d_ProjectionMatrix, false, projectionMatrixArray);
113528
113369
  gl .uniformMatrix4fv (shaderNode .x3d_ModelViewMatrix, false, modelViewMatrixArray);
113529
- gl .uniform3f (shaderNode .x3d_EmissiveColor, 0, 0, 0);
113370
+ gl .uniform3f (shaderNode .x3d_EmissiveColor, 1, 1, 1);
113530
113371
  gl .uniform1f (shaderNode .x3d_Transparency, 0);
113531
113372
 
113532
113373
  if (this .lineVertexArrayObject .enable (shaderNode))
@@ -113819,8 +113660,8 @@ const FlyViewer_default_ = FlyViewer;
113819
113660
  x_ite_Namespace .add ("FlyViewer", "x_ite/Browser/Navigation/FlyViewer", FlyViewer_default_);
113820
113661
  /* harmony default export */ const Navigation_FlyViewer = (FlyViewer_default_);
113821
113662
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Navigation/PlaneViewer.js
113822
- /* provided dependency */ var PlaneViewer_jquery_mousewheel = __webpack_require__(273);
113823
- /* provided dependency */ var PlaneViewer_$ = __webpack_require__(864);
113663
+ /* provided dependency */ var PlaneViewer_jquery_mousewheel = __webpack_require__(946);
113664
+ /* provided dependency */ var PlaneViewer_$ = __webpack_require__(659);
113824
113665
  /*******************************************************************************
113825
113666
  *
113826
113667
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -114151,8 +113992,8 @@ const NoneViewer_default_ = NoneViewer;
114151
113992
  x_ite_Namespace .add ("NoneViewer", "x_ite/Browser/Navigation/NoneViewer", NoneViewer_default_);
114152
113993
  /* harmony default export */ const Navigation_NoneViewer = (NoneViewer_default_);
114153
113994
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Navigation/LookAtViewer.js
114154
- /* provided dependency */ var LookAtViewer_jquery_mousewheel = __webpack_require__(273);
114155
- /* provided dependency */ var LookAtViewer_$ = __webpack_require__(864);
113995
+ /* provided dependency */ var LookAtViewer_jquery_mousewheel = __webpack_require__(946);
113996
+ /* provided dependency */ var LookAtViewer_$ = __webpack_require__(659);
114156
113997
  /*******************************************************************************
114157
113998
  *
114158
113999
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -115291,8 +115132,8 @@ const X3DPickingContext_default_ = X3DPickingContext;
115291
115132
  x_ite_Namespace .add ("X3DPickingContext", "x_ite/Browser/Picking/X3DPickingContext", X3DPickingContext_default_);
115292
115133
  /* harmony default export */ const Picking_X3DPickingContext = (X3DPickingContext_default_);
115293
115134
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js
115294
- /* provided dependency */ var PointingDevice_jquery_mousewheel = __webpack_require__(273);
115295
- /* provided dependency */ var PointingDevice_$ = __webpack_require__(864);
115135
+ /* provided dependency */ var PointingDevice_jquery_mousewheel = __webpack_require__(946);
115136
+ /* provided dependency */ var PointingDevice_$ = __webpack_require__(659);
115296
115137
  /*******************************************************************************
115297
115138
  *
115298
115139
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -116480,6 +116321,12 @@ Object .assign (MultiSampleFrameBuffer .prototype,
116480
116321
  0, 0, width, height,
116481
116322
  gl .COLOR_BUFFER_BIT, samples && !oit ? gl .LINEAR : gl .NEAREST);
116482
116323
  },
116324
+ unbind ()
116325
+ {
116326
+ const { context: gl, lastBuffer } = this;
116327
+
116328
+ gl .bindFramebuffer (gl .FRAMEBUFFER, lastBuffer .pop ());
116329
+ },
116483
116330
  bindForOrderIndependentTransparency ()
116484
116331
  {
116485
116332
  const { context: gl, lastBuffer, oitFrameBuffer } = this;
@@ -116492,12 +116339,6 @@ Object .assign (MultiSampleFrameBuffer .prototype,
116492
116339
  gl .clear (gl .COLOR_BUFFER_BIT);
116493
116340
  gl .blendFuncSeparate (gl .ONE, gl .ONE, gl .ZERO, gl .ONE_MINUS_SRC_ALPHA);
116494
116341
  },
116495
- unbind ()
116496
- {
116497
- const { context: gl, lastBuffer } = this;
116498
-
116499
- gl .bindFramebuffer (gl .FRAMEBUFFER, lastBuffer .pop ());
116500
- },
116501
116342
  compose ()
116502
116343
  {
116503
116344
  const { context: gl, width, height, samples, program } = this;
@@ -116585,8 +116426,7 @@ const MultiSampleFrameBuffer_default_ = MultiSampleFrameBuffer;
116585
116426
  x_ite_Namespace .add ("MultiSampleFrameBuffer", "x_ite/Rendering/MultiSampleFrameBuffer", MultiSampleFrameBuffer_default_);
116586
116427
  /* harmony default export */ const Rendering_MultiSampleFrameBuffer = (MultiSampleFrameBuffer_default_);
116587
116428
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Rendering/X3DRenderingContext.js
116588
- /* provided dependency */ var X3DRenderingContext_$ = __webpack_require__(864);
116589
- /* provided dependency */ var ResizeSensor = __webpack_require__(45);
116429
+ /* provided dependency */ var X3DRenderingContext_$ = __webpack_require__(659);
116590
116430
  /*******************************************************************************
116591
116431
  *
116592
116432
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -116673,10 +116513,8 @@ Object .assign (X3DRenderingContext .prototype,
116673
116513
 
116674
116514
  X3DRenderingContext_$(document) .on ('webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange', this .onfullscreen .bind (this));
116675
116515
 
116676
- //https://github.com/sdecima/javascript-detect-element-resize
116677
- this [_resizer] = new ResizeSensor (this .getSurface (), this .reshape .bind (this));
116678
-
116679
- this .getSurface () .css ("position", ""); // Reset position, set from ResizeSensor.
116516
+ this [_resizer] = new ResizeObserver (this .reshape .bind (this));
116517
+ this [_resizer] .observe (this .getSurface () [0]);
116680
116518
 
116681
116519
  this .reshape ();
116682
116520
  },
@@ -118874,7 +118712,7 @@ const Components_default_ = Components;
118874
118712
  x_ite_Namespace .add ("Components", "x_ite/Components", Components_default_);
118875
118713
  /* harmony default export */ const x_ite_Components = ((/* unused pure expression or super */ null && (Components_default_)));
118876
118714
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/DOMIntegration.js
118877
- /* provided dependency */ var DOMIntegration_$ = __webpack_require__(864);
118715
+ /* provided dependency */ var DOMIntegration_$ = __webpack_require__(659);
118878
118716
  /*******************************************************************************
118879
118717
  * MIT License
118880
118718
  *
@@ -120012,7 +119850,7 @@ const SupportedProfiles_default_ = SupportedProfiles;
120012
119850
  x_ite_Namespace .add ("SupportedProfiles", "x_ite/Configuration/SupportedProfiles", SupportedProfiles_default_);
120013
119851
  /* harmony default export */ const Configuration_SupportedProfiles = (SupportedProfiles_default_);
120014
119852
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/X3DBrowser.js
120015
- /* provided dependency */ var X3DBrowser_$ = __webpack_require__(864);
119853
+ /* provided dependency */ var X3DBrowser_$ = __webpack_require__(659);
120016
119854
  /*******************************************************************************
120017
119855
  *
120018
119856
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -121093,7 +120931,7 @@ const X3DBrowser_default_ = X3DBrowser;
121093
120931
  x_ite_Namespace .add ("X3DBrowser", "x_ite/Browser/X3DBrowser", X3DBrowser_default_);
121094
120932
  /* harmony default export */ const Browser_X3DBrowser = (X3DBrowser_default_);
121095
120933
  ;// CONCATENATED MODULE: ./src/x_ite/X3DCanvasElement.js
121096
- /* provided dependency */ var X3DCanvasElement_$ = __webpack_require__(864);
120934
+ /* provided dependency */ var X3DCanvasElement_$ = __webpack_require__(659);
121097
120935
  /*******************************************************************************
121098
120936
  *
121099
120937
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -121225,8 +121063,8 @@ const X3DCanvasElement_default_ = X3DCanvasElement;
121225
121063
  x_ite_Namespace .add ("X3DCanvasElement", "x_ite/X3DCanvasElement", X3DCanvasElement_default_);
121226
121064
  /* harmony default export */ const x_ite_X3DCanvasElement = (X3DCanvasElement_default_);
121227
121065
  ;// CONCATENATED MODULE: ./src/lib/jquery.js
121228
- /* provided dependency */ var jquery_$ = __webpack_require__(864);
121229
- /* provided dependency */ var pako = __webpack_require__(61);
121066
+ /* provided dependency */ var jquery_$ = __webpack_require__(659);
121067
+ /* provided dependency */ var pako = __webpack_require__(822);
121230
121068
  Object .assign (jquery_$,
121231
121069
  {
121232
121070
  decodeText (input)
@@ -121303,14 +121141,14 @@ const jquery_default_ = jquery_$;
121303
121141
  x_ite_Namespace .add ("jquery", "lib/jquery", jquery_default_);
121304
121142
  /* harmony default export */ const jquery = ((/* unused pure expression or super */ null && (jquery_default_)));
121305
121143
  ;// CONCATENATED MODULE: ./src/lib/libtess.js
121306
- /* provided dependency */ var libtess_libtess = __webpack_require__(180);
121144
+ /* provided dependency */ var libtess_libtess = __webpack_require__(793);
121307
121145
  const libtess_default_ = libtess_libtess;
121308
121146
  ;
121309
121147
 
121310
121148
  x_ite_Namespace .add ("libtess", "lib/libtess", libtess_default_);
121311
121149
  /* harmony default export */ const lib_libtess = ((/* unused pure expression or super */ null && (libtess_default_)));
121312
121150
  ;// CONCATENATED MODULE: ./src/x_ite/X3D.js
121313
- /* provided dependency */ var X3D_$ = __webpack_require__(864);
121151
+ /* provided dependency */ var X3D_$ = __webpack_require__(659);
121314
121152
  /*******************************************************************************
121315
121153
  *
121316
121154
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -121704,7 +121542,7 @@ x_ite_Namespace .add ("shim", "shim", shim_default_);
121704
121542
 
121705
121543
  // Assign X3D to global namespace.
121706
121544
 
121707
- window [Symbol .for ("X_ITE.X3D-8.12.4")] = x_ite_X3D;
121545
+ window [Symbol .for ("X_ITE.X3D-8.12.5")] = x_ite_X3D;
121708
121546
 
121709
121547
  customElements .define ("x3d-canvas", x_ite_X3DCanvasElement);
121710
121548