@shapediver/viewer.rendering-engine.rendering-engine-threejs 3.16.8 → 3.16.10

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 (185) hide show
  1. package/dist/RenderingEngine.d.ts +294 -294
  2. package/dist/RenderingEngine.js +987 -977
  3. package/dist/RenderingEngine.js.map +1 -1
  4. package/dist/index.d.ts +16 -16
  5. package/dist/index.js +57 -57
  6. package/dist/injectors/TextureUnifierInjector.d.ts +13 -13
  7. package/dist/injectors/TextureUnifierInjector.js +181 -171
  8. package/dist/injectors/TextureUnifierInjector.js.map +1 -1
  9. package/dist/interfaces/ILoader.d.ts +3 -3
  10. package/dist/interfaces/ILoader.js +2 -2
  11. package/dist/interfaces/IRenderingEngine.d.ts +45 -45
  12. package/dist/interfaces/IRenderingEngine.js +2 -2
  13. package/dist/loaders/EnvironmentMapLoader.d.ts +119 -119
  14. package/dist/loaders/EnvironmentMapLoader.js +512 -502
  15. package/dist/loaders/EnvironmentMapLoader.js.map +1 -1
  16. package/dist/loaders/GeometryLoader.d.ts +39 -39
  17. package/dist/loaders/GeometryLoader.d.ts.map +1 -1
  18. package/dist/loaders/GeometryLoader.js +603 -593
  19. package/dist/loaders/GeometryLoader.js.map +1 -1
  20. package/dist/loaders/HTMLElementAnchorLoader.d.ts +15 -15
  21. package/dist/loaders/HTMLElementAnchorLoader.js +98 -98
  22. package/dist/loaders/HTMLElementAnchorLoader.js.map +1 -1
  23. package/dist/loaders/LightLoader.d.ts +19 -19
  24. package/dist/loaders/LightLoader.js +197 -187
  25. package/dist/loaders/LightLoader.js.map +1 -1
  26. package/dist/loaders/MaterialLoader.d.ts +115 -115
  27. package/dist/loaders/MaterialLoader.d.ts.map +1 -1
  28. package/dist/loaders/MaterialLoader.js +1612 -1602
  29. package/dist/loaders/MaterialLoader.js.map +1 -1
  30. package/dist/managers/ARManager.d.ts +17 -17
  31. package/dist/managers/ARManager.js +128 -128
  32. package/dist/managers/ARManager.js.map +1 -1
  33. package/dist/managers/CameraManager.d.ts +19 -19
  34. package/dist/managers/CameraManager.js +244 -234
  35. package/dist/managers/CameraManager.js.map +1 -1
  36. package/dist/managers/EnvironmentGeometryManager.d.ts +32 -32
  37. package/dist/managers/EnvironmentGeometryManager.js +114 -114
  38. package/dist/managers/EnvironmentGeometryManager.js.map +1 -1
  39. package/dist/managers/FlagManager.d.ts +19 -19
  40. package/dist/managers/FlagManager.js +143 -143
  41. package/dist/managers/FlagManager.js.map +1 -1
  42. package/dist/managers/PostProcessingManager.d.ts +1019 -1019
  43. package/dist/managers/PostProcessingManager.js +1306 -1296
  44. package/dist/managers/PostProcessingManager.js.map +1 -1
  45. package/dist/managers/RenderingManager.d.ts +84 -84
  46. package/dist/managers/RenderingManager.d.ts.map +1 -1
  47. package/dist/managers/RenderingManager.js +679 -669
  48. package/dist/managers/RenderingManager.js.map +1 -1
  49. package/dist/managers/SceneTracingManager.d.ts +28 -28
  50. package/dist/managers/SceneTracingManager.js +160 -150
  51. package/dist/managers/SceneTracingManager.js.map +1 -1
  52. package/dist/managers/SceneTreeManager.d.ts +81 -81
  53. package/dist/managers/SceneTreeManager.d.ts.map +1 -1
  54. package/dist/managers/SceneTreeManager.js +500 -490
  55. package/dist/managers/SceneTreeManager.js.map +1 -1
  56. package/dist/managers/SettingsManager.d.ts +28 -28
  57. package/dist/managers/SettingsManager.js +284 -284
  58. package/dist/managers/SettingsManager.js.map +1 -1
  59. package/dist/managers/environmentGeometry/ContactShadow.d.ts +42 -42
  60. package/dist/managers/environmentGeometry/ContactShadow.js +295 -285
  61. package/dist/managers/environmentGeometry/ContactShadow.js.map +1 -1
  62. package/dist/managers/environmentGeometry/Grid.d.ts +20 -20
  63. package/dist/managers/environmentGeometry/Grid.js +110 -100
  64. package/dist/managers/environmentGeometry/Grid.js.map +1 -1
  65. package/dist/managers/environmentGeometry/GroundPlane.d.ts +21 -21
  66. package/dist/managers/environmentGeometry/GroundPlane.js +105 -95
  67. package/dist/managers/environmentGeometry/GroundPlane.js.map +1 -1
  68. package/dist/managers/environmentGeometry/GroundPlaneShadow.d.ts +21 -21
  69. package/dist/managers/environmentGeometry/GroundPlaneShadow.js +96 -86
  70. package/dist/managers/environmentGeometry/GroundPlaneShadow.js.map +1 -1
  71. package/dist/managers/environmentGeometry/IEnvironmentGeometry.d.ts +8 -8
  72. package/dist/managers/environmentGeometry/IEnvironmentGeometry.js +2 -2
  73. package/dist/managers/postprocessing/GodRaysManager.d.ts +12 -12
  74. package/dist/managers/postprocessing/GodRaysManager.js +73 -63
  75. package/dist/managers/postprocessing/GodRaysManager.js.map +1 -1
  76. package/dist/managers/postprocessing/OutlineManager.d.ts +15 -15
  77. package/dist/managers/postprocessing/OutlineManager.js +86 -76
  78. package/dist/managers/postprocessing/OutlineManager.js.map +1 -1
  79. package/dist/managers/postprocessing/SSAARenderPass.d.ts +53 -53
  80. package/dist/managers/postprocessing/SSAARenderPass.js +281 -281
  81. package/dist/managers/postprocessing/SSAARenderPass.js.map +1 -1
  82. package/dist/managers/postprocessing/SelectiveBloomManager.d.ts +14 -14
  83. package/dist/managers/postprocessing/SelectiveBloomManager.js +76 -66
  84. package/dist/managers/postprocessing/SelectiveBloomManager.js.map +1 -1
  85. package/dist/managers/postprocessing/ao/ao/AOEffect.d.ts +46 -46
  86. package/dist/managers/postprocessing/ao/ao/AOEffect.js +142 -142
  87. package/dist/managers/postprocessing/ao/ao/AOEffect.js.map +1 -1
  88. package/dist/managers/postprocessing/ao/ao/AOPass.d.ts +12 -12
  89. package/dist/managers/postprocessing/ao/ao/AOPass.js +108 -108
  90. package/dist/managers/postprocessing/ao/ao/AOPass.js.map +1 -1
  91. package/dist/managers/postprocessing/ao/ao/shader/ao_compose.d.ts +1 -1
  92. package/dist/managers/postprocessing/ao/ao/shader/ao_compose.js +4 -4
  93. package/dist/managers/postprocessing/ao/ao/shader/ao_utils.d.ts +1 -1
  94. package/dist/managers/postprocessing/ao/ao/shader/ao_utils.js +4 -4
  95. package/dist/managers/postprocessing/ao/hbao/HBAOEffect.d.ts +14 -14
  96. package/dist/managers/postprocessing/ao/hbao/HBAOEffect.js +24 -24
  97. package/dist/managers/postprocessing/ao/hbao/shader/hbao.d.ts +1 -1
  98. package/dist/managers/postprocessing/ao/hbao/shader/hbao.js +4 -4
  99. package/dist/managers/postprocessing/ao/poissionDenoise/PoissionDenoisePass.d.ts +33 -33
  100. package/dist/managers/postprocessing/ao/poissionDenoise/PoissionDenoisePass.js +211 -211
  101. package/dist/managers/postprocessing/ao/poissionDenoise/PoissionDenoisePass.js.map +1 -1
  102. package/dist/managers/postprocessing/ao/poissionDenoise/shader/poissionDenoise.d.ts +1 -1
  103. package/dist/managers/postprocessing/ao/poissionDenoise/shader/poissionDenoise.js +4 -4
  104. package/dist/managers/postprocessing/ao/ssao/SSAOEffect.d.ts +14 -14
  105. package/dist/managers/postprocessing/ao/ssao/SSAOEffect.js +82 -82
  106. package/dist/managers/postprocessing/ao/ssao/SSAOEffect.js.map +1 -1
  107. package/dist/managers/postprocessing/ao/ssao/shader/ssao.d.ts +1 -1
  108. package/dist/managers/postprocessing/ao/ssao/shader/ssao.js +4 -4
  109. package/dist/managers/postprocessing/ao/utils/shader/basic.d.ts +1 -1
  110. package/dist/managers/postprocessing/ao/utils/shader/basic.js +4 -4
  111. package/dist/managers/postprocessing/ao/utils/shader/sampleBlueNoise.d.ts +1 -1
  112. package/dist/managers/postprocessing/ao/utils/shader/sampleBlueNoise.js +4 -4
  113. package/dist/managers/postprocessing/effects/tone-mapping/ToneMappingEffect.d.ts +165 -165
  114. package/dist/managers/postprocessing/effects/tone-mapping/ToneMappingEffect.js +299 -299
  115. package/dist/managers/postprocessing/effects/tone-mapping/ToneMappingEffect.js.map +1 -1
  116. package/dist/managers/postprocessing/effects/tone-mapping/tone-mapping.d.ts +1 -1
  117. package/dist/managers/postprocessing/effects/tone-mapping/tone-mapping.js +4 -4
  118. package/dist/managers/postprocessing/utils/CopyMaterial.d.ts +37 -37
  119. package/dist/managers/postprocessing/utils/CopyMaterial.js +69 -69
  120. package/dist/managers/postprocessing/utils/CopyShader.d.ts +13 -13
  121. package/dist/managers/postprocessing/utils/CopyShader.js +12 -12
  122. package/dist/managers/postprocessing/utils/FullScreenQuad.d.ts +9 -9
  123. package/dist/managers/postprocessing/utils/FullScreenQuad.js +28 -28
  124. package/dist/managers/postprocessing/utils/NormalPass.d.ts +87 -87
  125. package/dist/managers/postprocessing/utils/NormalPass.js +156 -156
  126. package/dist/managers/postprocessing/utils/NormalPass.js.map +1 -1
  127. package/dist/managers/postprocessing/utils/RenderPass.d.ts +114 -114
  128. package/dist/managers/postprocessing/utils/RenderPass.js +259 -259
  129. package/dist/managers/postprocessing/utils/RenderPass.js.map +1 -1
  130. package/dist/managers/sceneTree/SDTFUtils.d.ts +6 -6
  131. package/dist/managers/sceneTree/SDTFUtils.d.ts.map +1 -1
  132. package/dist/managers/sceneTree/SDTFUtils.js +50 -50
  133. package/dist/managers/sceneTree/SDTFUtils.js.map +1 -1
  134. package/dist/managers/sceneTree/SceenTreeManagerUtils.d.ts +7 -7
  135. package/dist/managers/sceneTree/SceenTreeManagerUtils.d.ts.map +1 -1
  136. package/dist/managers/sceneTree/SceenTreeManagerUtils.js +175 -165
  137. package/dist/managers/sceneTree/SceenTreeManagerUtils.js.map +1 -1
  138. package/dist/managers/sceneTree/ThreeJsDataUtils.d.ts +6 -6
  139. package/dist/managers/sceneTree/ThreeJsDataUtils.d.ts.map +1 -1
  140. package/dist/managers/sceneTree/ThreeJsDataUtils.js +80 -70
  141. package/dist/managers/sceneTree/ThreeJsDataUtils.js.map +1 -1
  142. package/dist/materials/GemMaterial.d.ts +37 -37
  143. package/dist/materials/GemMaterial.js +262 -252
  144. package/dist/materials/GemMaterial.js.map +1 -1
  145. package/dist/materials/MeshUnlitMaterialParameters.d.ts +3 -3
  146. package/dist/materials/MeshUnlitMaterialParameters.js +2 -2
  147. package/dist/materials/MultiPointsMaterial.d.ts +93 -93
  148. package/dist/materials/MultiPointsMaterial.js +577 -567
  149. package/dist/materials/MultiPointsMaterial.js.map +1 -1
  150. package/dist/materials/SpecularGlossinessMaterial.d.ts +13 -13
  151. package/dist/materials/SpecularGlossinessMaterial.js +171 -161
  152. package/dist/materials/SpecularGlossinessMaterial.js.map +1 -1
  153. package/dist/objects/SDColor.d.ts +16 -16
  154. package/dist/objects/SDColor.js +52 -52
  155. package/dist/objects/SDColor.js.map +1 -1
  156. package/dist/objects/SDObject.d.ts +27 -27
  157. package/dist/objects/SDObject.js +112 -102
  158. package/dist/objects/SDObject.js.map +1 -1
  159. package/dist/shaders/PCSS.d.ts +2 -2
  160. package/dist/shaders/PCSS.js +5 -5
  161. package/dist/shaders/gem.d.ts +2 -2
  162. package/dist/shaders/gem.js +5 -5
  163. package/dist/shaders/multi_points.d.ts +2 -2
  164. package/dist/shaders/multi_points.js +5 -5
  165. package/dist/styling/viewport-css.d.ts +1 -1
  166. package/dist/styling/viewport-css.js +4 -4
  167. package/dist/three/CSS2DRenderer.d.ts +31 -31
  168. package/dist/three/CSS2DRenderer.d.ts.map +1 -1
  169. package/dist/three/CSS2DRenderer.js +152 -152
  170. package/dist/three/CSS2DRenderer.js.map +1 -1
  171. package/dist/three/geometries/TextGeometry.d.ts +21 -21
  172. package/dist/three/geometries/TextGeometry.js +45 -45
  173. package/dist/three/geometries/TextGeometry.js.map +1 -1
  174. package/dist/three/loaders/RGBELoader.d.ts +23 -23
  175. package/dist/three/loaders/RGBELoader.js +311 -311
  176. package/dist/three/loaders/RGBELoader.js.map +1 -1
  177. package/dist/types/IThreejsData.d.ts +6 -6
  178. package/dist/types/IThreejsData.js +2 -2
  179. package/dist/types/ThreejsData.d.ts +10 -10
  180. package/dist/types/ThreejsData.js +41 -41
  181. package/package.json +18 -18
  182. package/dist/managers/InstanceGroupManager.d.ts +0 -58
  183. package/dist/managers/InstanceGroupManager.d.ts.map +0 -1
  184. package/dist/managers/InstanceGroupManager.js +0 -372
  185. package/dist/managers/InstanceGroupManager.js.map +0 -1
@@ -1,28 +1,28 @@
1
- import { ISDObject } from "@shapediver/viewer.rendering-engine.rendering-engine";
2
- import { mat4 } from "gl-matrix";
3
- import { Object3D } from "three";
4
- export declare enum SD_DATA_TYPE {
5
- GEOMETRY = "geometry",
6
- MATERIAL = "material",
7
- THREEJS = "threejs",
8
- LIGHT = "light",
9
- CAMERA = "camera",
10
- ANIMATION = "animation",
11
- INTERACTION = "interaction",
12
- HTML_ELEMENT_ANCHOR = "html_element_anchor",
13
- CUSTOM = "custom",
14
- OBJECT = "object"
15
- }
16
- export declare class SDObject extends Object3D implements ISDObject {
17
- #private;
18
- constructor(SDid: string, SDversion: string, type?: SD_DATA_TYPE);
19
- applyTransformation(transformation: mat4): void;
20
- get SDid(): string;
21
- set SDid(value: string);
22
- get SDversion(): string;
23
- set SDversion(value: string);
24
- get SDtype(): SD_DATA_TYPE;
25
- set SDtype(value: SD_DATA_TYPE);
26
- cloneObject(): SDObject;
27
- }
1
+ import { ISDObject } from "@shapediver/viewer.rendering-engine.rendering-engine";
2
+ import { mat4 } from "gl-matrix";
3
+ import { Object3D } from "three";
4
+ export declare enum SD_DATA_TYPE {
5
+ GEOMETRY = "geometry",
6
+ MATERIAL = "material",
7
+ THREEJS = "threejs",
8
+ LIGHT = "light",
9
+ CAMERA = "camera",
10
+ ANIMATION = "animation",
11
+ INTERACTION = "interaction",
12
+ HTML_ELEMENT_ANCHOR = "html_element_anchor",
13
+ CUSTOM = "custom",
14
+ OBJECT = "object"
15
+ }
16
+ export declare class SDObject extends Object3D implements ISDObject {
17
+ #private;
18
+ constructor(SDid: string, SDversion: string, type?: SD_DATA_TYPE);
19
+ applyTransformation(transformation: mat4): void;
20
+ get SDid(): string;
21
+ set SDid(value: string);
22
+ get SDversion(): string;
23
+ set SDversion(value: string);
24
+ get SDtype(): SD_DATA_TYPE;
25
+ set SDtype(value: SD_DATA_TYPE);
26
+ cloneObject(): SDObject;
27
+ }
28
28
  //# sourceMappingURL=SDObject.d.ts.map
@@ -1,103 +1,113 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
26
- if (kind === "m") throw new TypeError("Private method is not writable");
27
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
28
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
29
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
30
- };
31
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
32
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
33
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
34
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
35
- };
36
- var _SDObject_SDid, _SDObject_SDversion, _SDObject_SDtype;
37
- Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.SDObject = exports.SD_DATA_TYPE = void 0;
39
- const THREE = __importStar(require("three"));
40
- const three_1 = require("three");
41
- var SD_DATA_TYPE;
42
- (function (SD_DATA_TYPE) {
43
- SD_DATA_TYPE["GEOMETRY"] = "geometry";
44
- SD_DATA_TYPE["MATERIAL"] = "material";
45
- SD_DATA_TYPE["THREEJS"] = "threejs";
46
- SD_DATA_TYPE["LIGHT"] = "light";
47
- SD_DATA_TYPE["CAMERA"] = "camera";
48
- SD_DATA_TYPE["ANIMATION"] = "animation";
49
- SD_DATA_TYPE["INTERACTION"] = "interaction";
50
- SD_DATA_TYPE["HTML_ELEMENT_ANCHOR"] = "html_element_anchor";
51
- SD_DATA_TYPE["CUSTOM"] = "custom";
52
- SD_DATA_TYPE["OBJECT"] = "object";
53
- })(SD_DATA_TYPE = exports.SD_DATA_TYPE || (exports.SD_DATA_TYPE = {}));
54
- class SDObject extends three_1.Object3D {
55
- constructor(SDid, SDversion, type = SD_DATA_TYPE.OBJECT) {
56
- super();
57
- // #region Constructors (1)
58
- _SDObject_SDid.set(this, void 0);
59
- _SDObject_SDversion.set(this, void 0);
60
- _SDObject_SDtype.set(this, void 0);
61
- __classPrivateFieldSet(this, _SDObject_SDid, SDid, "f");
62
- __classPrivateFieldSet(this, _SDObject_SDversion, SDversion, "f");
63
- __classPrivateFieldSet(this, _SDObject_SDtype, type, "f");
64
- }
65
- applyTransformation(transformation) {
66
- this.matrix.identity();
67
- this.matrixWorld.identity();
68
- this.position.set(0, 0, 0);
69
- this.scale.set(1, 1, 1);
70
- this.quaternion.set(0, 0, 0, 1);
71
- this.applyMatrix4(new THREE.Matrix4().fromArray(transformation));
72
- }
73
- // #endregion Constructors (1)
74
- // #region Public Accessors (4)
75
- get SDid() {
76
- return __classPrivateFieldGet(this, _SDObject_SDid, "f");
77
- }
78
- set SDid(value) {
79
- __classPrivateFieldSet(this, _SDObject_SDid, value, "f");
80
- }
81
- get SDversion() {
82
- return __classPrivateFieldGet(this, _SDObject_SDversion, "f");
83
- }
84
- set SDversion(value) {
85
- __classPrivateFieldSet(this, _SDObject_SDversion, value, "f");
86
- }
87
- get SDtype() {
88
- return __classPrivateFieldGet(this, _SDObject_SDtype, "f");
89
- }
90
- set SDtype(value) {
91
- __classPrivateFieldSet(this, _SDObject_SDtype, value, "f");
92
- }
93
- cloneObject() {
94
- const clone = this.clone();
95
- clone.SDid = this.SDid;
96
- clone.SDversion = this.SDversion;
97
- clone.SDtype = this.SDtype;
98
- return clone;
99
- }
100
- }
101
- exports.SDObject = SDObject;
102
- _SDObject_SDid = new WeakMap(), _SDObject_SDversion = new WeakMap(), _SDObject_SDtype = new WeakMap();
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
36
+ if (kind === "m") throw new TypeError("Private method is not writable");
37
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
38
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
39
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
40
+ };
41
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
42
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
43
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
44
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
45
+ };
46
+ var _SDObject_SDid, _SDObject_SDversion, _SDObject_SDtype;
47
+ Object.defineProperty(exports, "__esModule", { value: true });
48
+ exports.SDObject = exports.SD_DATA_TYPE = void 0;
49
+ const THREE = __importStar(require("three"));
50
+ const three_1 = require("three");
51
+ var SD_DATA_TYPE;
52
+ (function (SD_DATA_TYPE) {
53
+ SD_DATA_TYPE["GEOMETRY"] = "geometry";
54
+ SD_DATA_TYPE["MATERIAL"] = "material";
55
+ SD_DATA_TYPE["THREEJS"] = "threejs";
56
+ SD_DATA_TYPE["LIGHT"] = "light";
57
+ SD_DATA_TYPE["CAMERA"] = "camera";
58
+ SD_DATA_TYPE["ANIMATION"] = "animation";
59
+ SD_DATA_TYPE["INTERACTION"] = "interaction";
60
+ SD_DATA_TYPE["HTML_ELEMENT_ANCHOR"] = "html_element_anchor";
61
+ SD_DATA_TYPE["CUSTOM"] = "custom";
62
+ SD_DATA_TYPE["OBJECT"] = "object";
63
+ })(SD_DATA_TYPE || (exports.SD_DATA_TYPE = SD_DATA_TYPE = {}));
64
+ class SDObject extends three_1.Object3D {
65
+ constructor(SDid, SDversion, type = SD_DATA_TYPE.OBJECT) {
66
+ super();
67
+ // #region Constructors (1)
68
+ _SDObject_SDid.set(this, void 0);
69
+ _SDObject_SDversion.set(this, void 0);
70
+ _SDObject_SDtype.set(this, void 0);
71
+ __classPrivateFieldSet(this, _SDObject_SDid, SDid, "f");
72
+ __classPrivateFieldSet(this, _SDObject_SDversion, SDversion, "f");
73
+ __classPrivateFieldSet(this, _SDObject_SDtype, type, "f");
74
+ }
75
+ applyTransformation(transformation) {
76
+ this.matrix.identity();
77
+ this.matrixWorld.identity();
78
+ this.position.set(0, 0, 0);
79
+ this.scale.set(1, 1, 1);
80
+ this.quaternion.set(0, 0, 0, 1);
81
+ this.applyMatrix4(new THREE.Matrix4().fromArray(transformation));
82
+ }
83
+ // #endregion Constructors (1)
84
+ // #region Public Accessors (4)
85
+ get SDid() {
86
+ return __classPrivateFieldGet(this, _SDObject_SDid, "f");
87
+ }
88
+ set SDid(value) {
89
+ __classPrivateFieldSet(this, _SDObject_SDid, value, "f");
90
+ }
91
+ get SDversion() {
92
+ return __classPrivateFieldGet(this, _SDObject_SDversion, "f");
93
+ }
94
+ set SDversion(value) {
95
+ __classPrivateFieldSet(this, _SDObject_SDversion, value, "f");
96
+ }
97
+ get SDtype() {
98
+ return __classPrivateFieldGet(this, _SDObject_SDtype, "f");
99
+ }
100
+ set SDtype(value) {
101
+ __classPrivateFieldSet(this, _SDObject_SDtype, value, "f");
102
+ }
103
+ cloneObject() {
104
+ const clone = this.clone();
105
+ clone.SDid = this.SDid;
106
+ clone.SDversion = this.SDversion;
107
+ clone.SDtype = this.SDtype;
108
+ return clone;
109
+ }
110
+ }
111
+ exports.SDObject = SDObject;
112
+ _SDObject_SDid = new WeakMap(), _SDObject_SDversion = new WeakMap(), _SDObject_SDtype = new WeakMap();
103
113
  //# sourceMappingURL=SDObject.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SDObject.js","sourceRoot":"","sources":["../../src/objects/SDObject.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,6CAA+B;AAC/B,iCAA+B;AAE/B,IAAY,YAWX;AAXD,WAAY,YAAY;IACvB,qCAAqB,CAAA;IACrB,qCAAqB,CAAA;IACrB,mCAAmB,CAAA;IACnB,+BAAe,CAAA;IACf,iCAAiB,CAAA;IACjB,uCAAuB,CAAA;IACvB,2CAA2B,CAAA;IAC3B,2DAA2C,CAAA;IAC3C,iCAAiB,CAAA;IACjB,iCAAiB,CAAA;AAClB,CAAC,EAXW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAWvB;AAED,MAAa,QAAS,SAAQ,gBAAQ;IAOrC,YACC,IAAY,EACZ,SAAiB,EACjB,OAAqB,YAAY,CAAC,MAAM;QAExC,KAAK,EAAE,CAAC;QAXT,2BAA2B;QAE3B,iCAAc;QACd,sCAAmB;QACnB,mCAAsB;QAQrB,uBAAA,IAAI,kBAAS,IAAI,MAAA,CAAC;QAClB,uBAAA,IAAI,uBAAc,SAAS,MAAA,CAAC;QAC5B,uBAAA,IAAI,oBAAW,IAAI,MAAA,CAAC;IACrB,CAAC;IAEM,mBAAmB,CAAC,cAAoB;QAC9C,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QACvB,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC;QAC5B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACxB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAChC,IAAI,CAAC,YAAY,CAAC,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC;IAClE,CAAC;IAED,8BAA8B;IAE9B,+BAA+B;IAE/B,IAAW,IAAI;QACd,OAAO,uBAAA,IAAI,sBAAM,CAAC;IACnB,CAAC;IAED,IAAW,IAAI,CAAC,KAAa;QAC5B,uBAAA,IAAI,kBAAS,KAAK,MAAA,CAAC;IACpB,CAAC;IAED,IAAW,SAAS;QACnB,OAAO,uBAAA,IAAI,2BAAW,CAAC;IACxB,CAAC;IAED,IAAW,SAAS,CAAC,KAAa;QACjC,uBAAA,IAAI,uBAAc,KAAK,MAAA,CAAC;IACzB,CAAC;IAED,IAAW,MAAM;QAChB,OAAO,uBAAA,IAAI,wBAAQ,CAAC;IACrB,CAAC;IAED,IAAW,MAAM,CAAC,KAAmB;QACpC,uBAAA,IAAI,oBAAW,KAAK,MAAA,CAAC;IACtB,CAAC;IAEM,WAAW;QACjB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACvB,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QACjC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,OAAO,KAAK,CAAC;IACd,CAAC;CAGD;AAhED,4BAgEC"}
1
+ {"version":3,"file":"SDObject.js","sourceRoot":"","sources":["../../src/objects/SDObject.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,6CAA+B;AAC/B,iCAA+B;AAE/B,IAAY,YAWX;AAXD,WAAY,YAAY;IACvB,qCAAqB,CAAA;IACrB,qCAAqB,CAAA;IACrB,mCAAmB,CAAA;IACnB,+BAAe,CAAA;IACf,iCAAiB,CAAA;IACjB,uCAAuB,CAAA;IACvB,2CAA2B,CAAA;IAC3B,2DAA2C,CAAA;IAC3C,iCAAiB,CAAA;IACjB,iCAAiB,CAAA;AAClB,CAAC,EAXW,YAAY,4BAAZ,YAAY,QAWvB;AAED,MAAa,QAAS,SAAQ,gBAAQ;IAOrC,YACC,IAAY,EACZ,SAAiB,EACjB,OAAqB,YAAY,CAAC,MAAM;QAExC,KAAK,EAAE,CAAC;QAXT,2BAA2B;QAE3B,iCAAc;QACd,sCAAmB;QACnB,mCAAsB;QAQrB,uBAAA,IAAI,kBAAS,IAAI,MAAA,CAAC;QAClB,uBAAA,IAAI,uBAAc,SAAS,MAAA,CAAC;QAC5B,uBAAA,IAAI,oBAAW,IAAI,MAAA,CAAC;IACrB,CAAC;IAEM,mBAAmB,CAAC,cAAoB;QAC9C,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QACvB,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC;QAC5B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACxB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAChC,IAAI,CAAC,YAAY,CAAC,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC;IAClE,CAAC;IAED,8BAA8B;IAE9B,+BAA+B;IAE/B,IAAW,IAAI;QACd,OAAO,uBAAA,IAAI,sBAAM,CAAC;IACnB,CAAC;IAED,IAAW,IAAI,CAAC,KAAa;QAC5B,uBAAA,IAAI,kBAAS,KAAK,MAAA,CAAC;IACpB,CAAC;IAED,IAAW,SAAS;QACnB,OAAO,uBAAA,IAAI,2BAAW,CAAC;IACxB,CAAC;IAED,IAAW,SAAS,CAAC,KAAa;QACjC,uBAAA,IAAI,uBAAc,KAAK,MAAA,CAAC;IACzB,CAAC;IAED,IAAW,MAAM;QAChB,OAAO,uBAAA,IAAI,wBAAQ,CAAC;IACrB,CAAC;IAED,IAAW,MAAM,CAAC,KAAmB;QACpC,uBAAA,IAAI,oBAAW,KAAK,MAAA,CAAC;IACtB,CAAC;IAEM,WAAW;QACjB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACvB,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QACjC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,OAAO,KAAK,CAAC;IACd,CAAC;CAGD;AAhED,4BAgEC"}
@@ -1,3 +1,3 @@
1
- export declare const main = "\n\nuniform float lightSizeUV;\nuniform float blending;\n\n#ifdef SHADOWMAP_TYPE_PCF\n\n#define NEAR_PLANE 0.1\n#define NUM_SAMPLES 20\n#define NUM_RINGS 11\n\nvec2 poissonDisk[NUM_SAMPLES];\n\nvoid initPoissonSamples( const in vec2 randomSeed ) {\n float ANGLE_STEP = PI2 * float(NUM_RINGS) / float(NUM_SAMPLES);\n float INV_NUM_SAMPLES = 1.0 / float(NUM_SAMPLES);\n\n // jsfiddle that shows sample pattern: https://jsfiddle.net/a16ff1p7/\n float angle = rand(randomSeed) * PI2;\n float radius = INV_NUM_SAMPLES;\n float radiusStep = radius;\n\n for (int i = 0; i < int(NUM_SAMPLES); i++ ) {\n poissonDisk[i] = vec2(cos(angle), sin(angle)) * pow(radius, 0.75);\n radius += radiusStep;\n angle += ANGLE_STEP;\n }\n}\n\nfloat penumbraSize( const in float zReceiver, const in float zBlocker ) { // Parallel plane estimation\n return (zReceiver - zBlocker) / zBlocker;\n}\n\nfloat findBlocker(sampler2D shadowMap, const in vec2 uv, const in float zReceiver ) {\n // This uses similar triangles to compute what\n // area of the shadow map we should search\n float searchRadius = lightSizeUV * (zReceiver - NEAR_PLANE) / zReceiver;\n float blockerDepthSum = 0.0;\n int numBlockers = 0;\n\n for (int i = 0; i < int(NUM_SAMPLES); i++ ) {\n float shadowMapDepth = unpackRGBAToDepth(texture2D(shadowMap, uv + poissonDisk[i] * searchRadius));\n if (shadowMapDepth < zReceiver) {\n blockerDepthSum += shadowMapDepth;\n numBlockers++;\n }\n }\n\n if (numBlockers == 0) return -1.0;\n\n return blockerDepthSum / float(numBlockers);\n}\n\nfloat PCF_Filter(sampler2D shadowMap, vec2 uv, float zReceiver, float filterRadius) {\n float sum = 0.0;\n for (int i = 0; i < int(NUM_SAMPLES); i++ ) {\n float depth = unpackRGBAToDepth(texture2D(shadowMap, uv + poissonDisk[i] * filterRadius));\n if (zReceiver <= depth) sum += 1.0;\n }\n for (int i = 0; i < int(NUM_SAMPLES); i++ ) {\n float depth = unpackRGBAToDepth(texture2D(shadowMap, uv + -poissonDisk[i].yx * filterRadius));\n if (zReceiver <= depth) sum += 1.0;\n }\n return sum / (2.0 * float(NUM_SAMPLES));\n}\n\nfloat PCSS(sampler2D shadowMap, vec4 coords) {\n vec2 uv = coords.xy;\n float zReceiver = coords.z; // Assumed to be eye-space z in this code\n\n initPoissonSamples(uv);\n // STEP 1: blocker search\n float avgBlockerDepth = findBlocker(shadowMap, uv, zReceiver);\n\n //There are no occluders so early out (this saves filtering)\n if (avgBlockerDepth == -1.0) return 1.0;\n\n // STEP 2: penumbra size\n float penumbraRatio = penumbraSize(zReceiver, avgBlockerDepth);\n float filterRadius = penumbraRatio * lightSizeUV * NEAR_PLANE / zReceiver;\n\n // STEP 3: filtering\n //return avgBlockerDepth;\n return PCF_Filter(shadowMap, uv, zReceiver, filterRadius);\n}\n#endif\n";
2
- export declare const entry = "\n// PCSS implementation\nvec2 texelSize = vec2( 1.0 / 1024.0 ); // Always use 1024 for consistency\nfloat dx = texelSize.x;\nfloat dy = texelSize.y;\nvec2 uv = shadowCoord.xy;\nvec2 f = fract( uv * shadowMapSize + 0.5 );\nuv -= f * texelSize;\nfloat shadow1 = (\n texture2DCompare( shadowMap, uv, shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n f.x ),\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n f.x ),\n f.y )\n) * ( 1.0 / 9.0 );\nfloat shadow2 = PCSS( shadowMap, shadowCoord );\nshadow = shadow1 * (1.0 - blending) + blending * shadow2;\n ";
1
+ export declare const main = "\n\nuniform float lightSizeUV;\nuniform float blending;\n\n#ifdef SHADOWMAP_TYPE_PCF\n\n#define NEAR_PLANE 0.1\n#define NUM_SAMPLES 20\n#define NUM_RINGS 11\n\nvec2 poissonDisk[NUM_SAMPLES];\n\nvoid initPoissonSamples( const in vec2 randomSeed ) {\n float ANGLE_STEP = PI2 * float(NUM_RINGS) / float(NUM_SAMPLES);\n float INV_NUM_SAMPLES = 1.0 / float(NUM_SAMPLES);\n\n // jsfiddle that shows sample pattern: https://jsfiddle.net/a16ff1p7/\n float angle = rand(randomSeed) * PI2;\n float radius = INV_NUM_SAMPLES;\n float radiusStep = radius;\n\n for (int i = 0; i < int(NUM_SAMPLES); i++ ) {\n poissonDisk[i] = vec2(cos(angle), sin(angle)) * pow(radius, 0.75);\n radius += radiusStep;\n angle += ANGLE_STEP;\n }\n}\n\nfloat penumbraSize( const in float zReceiver, const in float zBlocker ) { // Parallel plane estimation\n return (zReceiver - zBlocker) / zBlocker;\n}\n\nfloat findBlocker(sampler2D shadowMap, const in vec2 uv, const in float zReceiver ) {\n // This uses similar triangles to compute what\n // area of the shadow map we should search\n float searchRadius = lightSizeUV * (zReceiver - NEAR_PLANE) / zReceiver;\n float blockerDepthSum = 0.0;\n int numBlockers = 0;\n\n for (int i = 0; i < int(NUM_SAMPLES); i++ ) {\n float shadowMapDepth = unpackRGBAToDepth(texture2D(shadowMap, uv + poissonDisk[i] * searchRadius));\n if (shadowMapDepth < zReceiver) {\n blockerDepthSum += shadowMapDepth;\n numBlockers++;\n }\n }\n\n if (numBlockers == 0) return -1.0;\n\n return blockerDepthSum / float(numBlockers);\n}\n\nfloat PCF_Filter(sampler2D shadowMap, vec2 uv, float zReceiver, float filterRadius) {\n float sum = 0.0;\n for (int i = 0; i < int(NUM_SAMPLES); i++ ) {\n float depth = unpackRGBAToDepth(texture2D(shadowMap, uv + poissonDisk[i] * filterRadius));\n if (zReceiver <= depth) sum += 1.0;\n }\n for (int i = 0; i < int(NUM_SAMPLES); i++ ) {\n float depth = unpackRGBAToDepth(texture2D(shadowMap, uv + -poissonDisk[i].yx * filterRadius));\n if (zReceiver <= depth) sum += 1.0;\n }\n return sum / (2.0 * float(NUM_SAMPLES));\n}\n\nfloat PCSS(sampler2D shadowMap, vec4 coords) {\n vec2 uv = coords.xy;\n float zReceiver = coords.z; // Assumed to be eye-space z in this code\n\n initPoissonSamples(uv);\n // STEP 1: blocker search\n float avgBlockerDepth = findBlocker(shadowMap, uv, zReceiver);\n\n //There are no occluders so early out (this saves filtering)\n if (avgBlockerDepth == -1.0) return 1.0;\n\n // STEP 2: penumbra size\n float penumbraRatio = penumbraSize(zReceiver, avgBlockerDepth);\n float filterRadius = penumbraRatio * lightSizeUV * NEAR_PLANE / zReceiver;\n\n // STEP 3: filtering\n //return avgBlockerDepth;\n return PCF_Filter(shadowMap, uv, zReceiver, filterRadius);\n}\n#endif\n";
2
+ export declare const entry = "\n// PCSS implementation\nvec2 texelSize = vec2( 1.0 / 1024.0 ); // Always use 1024 for consistency\nfloat dx = texelSize.x;\nfloat dy = texelSize.y;\nvec2 uv = shadowCoord.xy;\nvec2 f = fract( uv * shadowMapSize + 0.5 );\nuv -= f * texelSize;\nfloat shadow1 = (\n texture2DCompare( shadowMap, uv, shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n f.x ),\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n f.x ),\n f.y )\n) * ( 1.0 / 9.0 );\nfloat shadow2 = PCSS( shadowMap, shadowCoord );\nshadow = shadow1 * (1.0 - blending) + blending * shadow2;\n ";
3
3
  //# sourceMappingURL=PCSS.d.ts.map
@@ -1,6 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.entry = exports.main = void 0;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.entry = exports.main = void 0;
4
4
  exports.main = `
5
5
 
6
6
  uniform float lightSizeUV;
@@ -87,7 +87,7 @@ float PCSS(sampler2D shadowMap, vec4 coords) {
87
87
  return PCF_Filter(shadowMap, uv, zReceiver, filterRadius);
88
88
  }
89
89
  #endif
90
- `;
90
+ `;
91
91
  exports.entry = `
92
92
  // PCSS implementation
93
93
  vec2 texelSize = vec2( 1.0 / 1024.0 ); // Always use 1024 for consistency
@@ -123,5 +123,5 @@ float shadow1 = (
123
123
  ) * ( 1.0 / 9.0 );
124
124
  float shadow2 = PCSS( shadowMap, shadowCoord );
125
125
  shadow = shadow1 * (1.0 - blending) + blending * shadow2;
126
- `;
126
+ `;
127
127
  //# sourceMappingURL=PCSS.js.map
@@ -1,3 +1,3 @@
1
- export declare const vert = "\n#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\n// CUSTOM START\nvarying vec3 frag_position;\nvarying vec3 frag_normal;\n// CUSTOM END\n\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n #ifdef USE_TRANSMISSION\n vWorldPosition = worldPosition.xyz;\n #endif\n\n // CUSTOM START\n frag_position = position;\n frag_normal = objectNormal;\n // CUSTOM END\n}\n";
2
- export declare const frag = "\n#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define SPECULAR\n#endif\n\n// CUSTOM START\n#ifdef USE_IMPURITYMAP\n\tuniform sampler2D impurityMap;\n#endif\n// CUSTOM END\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARCOLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\n\n\n// CUSTOM START\n\nvarying vec4 initialPosition;\nvarying vec3 initialNormal;\n\nvarying vec3 frag_position;\nvarying vec3 frag_normal;\n\nuniform vec3 center;\nuniform float radius;\nuniform samplerCube sphericalNormalMap;\nuniform mat3 normalMatrix;\nuniform mat4 modelMatrix;\n\nuniform float impurityScale;\nuniform vec3 colorTransferBegin;\nuniform vec3 colorTransferEnd;\nuniform float refractionIndex;\nuniform float gamma;\nuniform float contrast;\nuniform float brightness;\nuniform float dispersion;\nuniform float tracingOpacity;\n\n\nvec3 getIBLRadianceVariation( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t// Mixing the reflection with the normal is more accurate and keeps rough objects from gathering light from behind their tangent plane.\n\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\treturn min(envMapColor.rgb * envMapIntensity, vec3(1.0));\n\t#else\n\t\treturn vec3( 0.0 );\n\t#endif\n}\n\nvec3 calculateReflectedLight(vec3 position, vec3 normal, vec3 viewDir, PhysicalMaterial material, int depth) {\n\t\n\tvec3 currentGeometryPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n\n\tmat3 normalMatrix;\n\tnormalMatrix[0] = normalize(modelMatrix[0].xyz);\n\tnormalMatrix[1] = normalize(modelMatrix[1].xyz);\n\tnormalMatrix[2] = normalize(modelMatrix[2].xyz);\n\t\n\t// Calculate the normal vector in world space\n\tvec3 currentGeometryNormal = normalize(normalMatrix * normal);\n\t\n\t// Calculate the view direction vector in world space\n\tvec3 currentGeometryViewDir = normalize(normalMatrix * -viewDir);\n\n vec3 currentGeometryClearcoatNormal;\n\t\n\t#ifdef USE_CLEARCOAT\n currentGeometryClearcoatNormal = clearcoatNormal;\n #endif\n\n\tReflectedLight rLight;\n\tIncidentLight dLight;\n\n\tfloat temp = material.roughness;\n\tmaterial.roughness = 0.5;\n\n\t#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\t\tPointLight pointLight;\n #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLightShadow;\n #endif\n\n\t #pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\t\tpointLight = pointLights[ i ];\n getPointLightInfo( pointLight, currentGeometryPosition, dLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n pointLightShadow = pointLightShadows[ i ];\n dLight.color *= all( bvec2( dLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n #endif\n\t\t RE_Direct( dLight, currentGeometryPosition, currentGeometryNormal, currentGeometryViewDir, currentGeometryClearcoatNormal, material, rLight );\n\t\t}\n #pragma unroll_loop_end\n\t#endif\n\t#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n SpotLight spotLight;\n #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n spotLight = spotLights[ i ];\n getSpotLightInfo( spotLight, currentGeometryPosition, dLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n spotLightShadow = spotLightShadows[ i ];\n dLight.color *= all( bvec2( dLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( dLight, currentGeometryPosition, currentGeometryNormal, currentGeometryViewDir, currentGeometryClearcoatNormal, material, rLight );\n }\n #pragma unroll_loop_end\n\t#endif\n\n #if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n DirectionalLight directionalLight;\n #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n directionalLight = directionalLights[ i ];\n getDirectionalLightInfo( directionalLight, dLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n directionalLightShadow = directionalLightShadows[ i ];\n dLight.color *= all( bvec2( dLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( dLight, currentGeometryPosition, currentGeometryNormal, currentGeometryViewDir, currentGeometryClearcoatNormal, material, rLight );\n }\n #pragma unroll_loop_end\n #endif\n\tmaterial.roughness = temp;\n\t\n #if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n RectAreaLight rectAreaLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n rectAreaLight = rectAreaLights[ i ];\n RE_Direct_RectArea( rectAreaLight, currentGeometryPosition, currentGeometryNormal, currentGeometryViewDir, currentGeometryClearcoatNormal, material, rLight );\n }\n #pragma unroll_loop_end\n #endif\n #if defined( RE_IndirectDiffuse )\n vec3 iblIrradiance = vec3( 0.0 );\n vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t\t\n\t\t#if defined( USE_LIGHT_PROBES )\n \tirradiance += getLightProbeIrradiance( lightProbe, currentGeometryNormal );\n\t\t#endif\n #if ( NUM_HEMI_LIGHTS > 0 )\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], currentGeometryNormal );\n }\n #pragma unroll_loop_end\n #endif\n #endif\n #if defined( RE_IndirectSpecular )\n vec3 radiance = vec3( 0.0 );\n vec3 clearcoatRadiance = vec3( 0.0 );\n #endif\n\n\n #if defined( RE_IndirectDiffuse )\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vUv2 );\n vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n irradiance += lightMapIrradiance;\n #endif\n #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n iblIrradiance += getIBLIrradiance( currentGeometryNormal );\n #endif\n #endif\n #if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n radiance += getIBLRadianceVariation( currentGeometryViewDir, currentGeometryNormal, material.roughness );\n #ifdef USE_CLEARCOAT\n clearcoatRadiance += getIBLRadianceVariation( currentGeometryViewDir, currentGeometryClearcoatNormal, material.clearcoatRoughness );\n #endif\n #endif\n\n #if defined( RE_IndirectDiffuse )\n RE_IndirectDiffuse( irradiance, currentGeometryPosition, currentGeometryNormal, currentGeometryViewDir, currentGeometryClearcoatNormal, material, rLight );\n #endif\n #if defined( RE_IndirectSpecular )\n RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, currentGeometryPosition, currentGeometryNormal, currentGeometryViewDir, currentGeometryClearcoatNormal, material, rLight );\n #endif\n\n\tif(depth >= 0) {\n\t\tfloat frac = float(depth) / float(TRACING_DEPTH);\n\t\tvec3 colorTransfer = (1.0-frac) * colorTransferBegin + frac * colorTransferEnd;\n\t\trLight.indirectSpecular *= colorTransfer;\n\t\trLight.directSpecular *= colorTransfer;\n\t}\n\n\tvec3 color = rLight.indirectSpecular + rLight.directSpecular + rLight.indirectDiffuse + rLight.directDiffuse;\n\n\t// gamma\n\tcolor = pow(color, vec3(1.0/gamma)); \n\n\t// contrast\n\tcolor.rgb = ((color.rgb - 0.5) * max(contrast, 0.0)) + 0.5; \n\n\t// brightness\n\tcolor.r = min(max(color.r + brightness, 0.0), 1.0);\n\tcolor.g = min(max(color.g + brightness, 0.0), 1.0);\n\tcolor.b = min(max(color.b + brightness, 0.0), 1.0);\n\n\treturn color;\n}\n\nvec3 normalLookUp(vec3 dir) {\n\tvec4 s = textureCube(sphericalNormalMap, dir);\n\tif(s.a < 1.0/256.0) {\n\t\treturn normalize(vec3(-s.x, -s.y, -s.z));\n\t} else if(s.a < 3.0/256.0) {\n\t\treturn normalize(vec3(-s.x, -s.y, s.z));\n\t} else if(s.a < 5.0/256.0) {\n\t\treturn normalize(vec3(-s.x, s.y, -s.z));\n\t} else if(s.a < 7.0/256.0) {\n\t\treturn normalize(vec3(s.x, -s.y, -s.z));\n\t} else if(s.a < 9.0/256.0) {\n\t\treturn normalize(vec3(-s.x, s.y, s.z));\n\t} else if(s.a < 11.0/256.0) {\n\t\treturn normalize(vec3(s.x, -s.y, s.z));\n\t} else if(s.a < 13.0/256.0) {\n\t\treturn normalize(vec3(s.x, s.y, -s.z));\n\t} else {\n\t\treturn normalize(s.xyz);\n\t}\n}\n\n#ifdef USE_IMPURITYMAP\n\tfloat impurityLookUp(vec3 dir) {\n\t\tvec3 c = textureCube(impurityMap, dir.xy).rgb;\n\t\treturn (c.x + c.y + c.z) / 3.0;\n\t}\n#endif\n\nvec3 raySphereIntersection(vec3 o, vec3 d) {\n\n\tvec3 oc = o - center;\n float a = dot(d, d);\n float b = 2.0 * dot(oc, d);\n float c = dot(oc,oc) - radius*radius;\n float discriminant = b*b - 4.0*a*c;\n if(discriminant < 0.0){\n return vec3(0.0);\n }\n else{\n return o +( (-b + sqrt(discriminant)) / (2.0*a)) * d;\n }\n}\n\nvec3 hueToSaturatedColor(float hue) {\n float r,g,b;\n if (hue < 0.25){\n\t\tfloat t = 1.0 - (hue / 0.25);\n r = 1.0;\n g = 1.0;\n b = t; \n\t} else if (hue < 0.5){\n \tfloat t = 1.0 - (hue - 0.25 / 0.25);\n\t\tr = 1.0;\n g = t;\n b = 0.0;\n\t} else if (hue < 0.75){\n \tfloat t = 1.0 - (hue - 0.5 / 0.25);\n\t\tr = t;\n g = 0.0;\n b = 1.0 - t;\n } else {\n \tfloat t = hue - 0.75 / 0.25;\n r = t;\n g = t;\n b = 1.0;\n }\n return vec3(r, g, b) / 0.5 + 0.5;\n}\n// CUSTOM END\n\nvoid main() { \n // CUSTOM START\n vec3 frag_normal_normalized = frag_normal;\n // CUSTOM END\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\n // CUSTOM START\n\t\n // Extract the translation part of the model matrix\n\tvec3 translation = modelMatrix[3].xyz;\n\n\t// Extract the rotation part of the model matrix (3x3 upper-left submatrix)\n\tmat3 rotationMatrix = mat3(modelMatrix);\n\n\t// Calculate the inverse of the rotation matrix (transpose since it's orthogonal)\n\tmat3 inverseRotationMatrix;\n\tinverseRotationMatrix[0] = vec3(rotationMatrix[0].x, rotationMatrix[1].x, rotationMatrix[2].x);\n\tinverseRotationMatrix[1] = vec3(rotationMatrix[0].y, rotationMatrix[1].y, rotationMatrix[2].y);\n\tinverseRotationMatrix[2] = vec3(rotationMatrix[0].z, rotationMatrix[1].z, rotationMatrix[2].z);\n\n\t// Calculate the camera position in model space\n\tvec3 cameraPositionInModelSpace = inverseRotationMatrix * (cameraPosition - translation);\n\n\t// Calculate the initial direction\n\tvec3 initialDirection = normalize(frag_position.xyz - cameraPositionInModelSpace);\n\n\tvec4 outgoingLight2;\n\tfloat r_0 = (1.0-refractionIndex)/(1.0+refractionIndex);\n\tr_0 = r_0*r_0;\n\n\tfloat cos_theta_0 = -dot(initialDirection, frag_normal_normalized);\n\tfloat r_0_outside = (refractionIndex-1.0)/(refractionIndex+1.0);\n\tr_0_outside = r_0_outside*r_0_outside;\n\tfloat initialProbability = r_0_outside + (1.0 - r_0_outside)*pow(1.0 - cos_theta_0, 5.0);\n\n\toutgoingLight2 = vec4(calculateReflectedLight(frag_position, frag_normal_normalized, initialDirection, material, -1), 1.0);\n\t// gl_FragColor = outgoingLight2;\n\t// return;\n\tif(TRACING_DEPTH > 0) \n\t\toutgoingLight2 *= initialProbability;\n\t\t\n\tvec3 tempColor;\n\n\t#ifdef DISPERSION\n\t\tconst int loop = 3;\n\t\tvec3 dispersionColor;\n\t#else\n\t\tconst int loop = 1;\n\t#endif\n\t\t#pragma unroll_loop_start\n\t\tfor(int j = 0; j < loop; j++){\n\t\t\tvec3 refractedDirection = refract(initialDirection, frag_normal_normalized, 1.0/refractionIndex + float(j)*dispersion * 0.025);\n\t\t\tvec3 newPosition = raySphereIntersection(frag_position, refractedDirection);\n\t\t\tvec3 lookUpVector = normalize(newPosition - center);\n\t\t\tvec3 newNormal = normalLookUp(lookUpVector);\n\t\t\tvec3 newDirection = reflect(refractedDirection, newNormal);\n\n\t\t\tfloat currentProbability = 1.0;\n\n\t\t\t#ifdef USE_IMPURITYMAP\n\t\t\t\tfloat impurityProbability = impurityLookUp(lookUpVector);\n\t\t\t\tcurrentProbability -= impurityProbability * impurityScale;\n\t\t\t\t// gl_FragColor = vec4(vec3(impurityProbability), 1.0);\n\t\t\t\t// return;\n\t\t\t#endif\n\t\t\t\n\t\t\t// if(0 == TRACING_DEPTH) {\n\t\t\t// \tgl_FragColor = vec4(0.5 * newNormal + 0.5, 1.0);\n\t\t\t// \treturn;\n\t\t\t// }\n\n\t\t\ttempColor = vec3(0.0);\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor(int i = 0; i < TRACING_DEPTH; i++) {\n\t\t\t\t// small position correction to avoid artefacts\n\t\t\t\tnewPosition = newPosition - lookUpVector * 1e-6;\n\t\t\t\tnewPosition = raySphereIntersection(newPosition, newDirection);\n\t\t\t\tlookUpVector = normalize(newPosition - center);\n\t\t\t\tnewNormal = normalLookUp(lookUpVector);\n\t\t\t\n\t\t\t\tfloat cos_theta = dot(newDirection, newNormal);\n\t\t\t\tfloat ratio;\n\t\t\t\tif(cos_theta > 0.0) {\n\t\t\t\t\tratio = refractionIndex;\n\t\t\t\t} else {\n\t\t\t\t\tcos_theta = -cos_theta;\n\t\t\t\t\tratio = 1.0 / refractionIndex;\n\t\t\t\t}\n\t\t\t\tfloat cos_theta_2 = 1.0 - ratio*ratio * (1.0 - cos_theta*cos_theta);\n\t\t\t\tfloat probability = r_0 + (1.0 - r_0)*pow(1.0 - cos_theta, 5.0);\n\t\t\t\tif(cos_theta_2 < 0.0) probability = 0.0;\n\n\t\t\t\tvec3 refracted = refract(newDirection, newNormal*-1.0, 1.0/refractionIndex);\n\t\t\t\ttempColor += probability * currentProbability * calculateReflectedLight(newPosition, newNormal*-1.0, reflect(refracted, newNormal), material, i);\n\t\t\t\tif(i+1 == TRACING_DEPTH)\n\t\t\t\t\ttempColor += (1.0 - probability) * currentProbability * calculateReflectedLight(newPosition, newNormal, newDirection, material, i);\n\n\t\t\t\tnewDirection = reflect(newDirection, newNormal);\n\n\t\t\t\t// if(i+1 == TRACING_DEPTH) {\n\t\t\t\t// \tgl_FragColor = vec4(0.5 * newNormal + 0.5, 1.0);\n\t\t\t\t// \treturn;\n\t\t\t\t// }\n\n\t\t\t\tcurrentProbability *= (1.0 - probability);\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\n\t\t\t#ifdef DISPERSION\n\t\t\t\tif(j == 0) {\n\t\t\t\t\tdispersionColor.r = tempColor.r;\t\n\t\t\t\t} else if(j == 1) {\n\t\t\t\t\tdispersionColor.g = tempColor.g;\t\n\t\t\t\t} else if(j == 2) {\n\t\t\t\t\tdispersionColor.b = tempColor.b;\t\n\t\t\t\t}\n\t\t\t\ttempColor = dispersionColor;\n\t\t\t#endif\n\t\t}\t\n\t\t#pragma unroll_loop_end\n\n\tif(TRACING_DEPTH > 0)\n\t\toutgoingLight2.rgb += (1.0 - initialProbability) * tempColor;\n\n\tfloat alpha = (1.0 - initialProbability) + initialProbability*tracingOpacity;\n\tgl_FragColor = vec4(outgoingLight2.rgb, alpha*diffuseColor.a);\n\n // CUSTOM END\n\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n\n";
1
+ export declare const vert = "\n#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\n// CUSTOM START\nvarying vec3 frag_position;\nvarying vec3 frag_normal;\n// CUSTOM END\n\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n #ifdef USE_TRANSMISSION\n vWorldPosition = worldPosition.xyz;\n #endif\n\n // CUSTOM START\n frag_position = position;\n frag_normal = objectNormal;\n // CUSTOM END\n}\n";
2
+ export declare const frag = "\n#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define SPECULAR\n#endif\n\n// CUSTOM START\n#ifdef USE_IMPURITYMAP\n\tuniform sampler2D impurityMap;\n#endif\n// CUSTOM END\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARCOLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\n\n\n// CUSTOM START\n\nvarying vec4 initialPosition;\nvarying vec3 initialNormal;\n\nvarying vec3 frag_position;\nvarying vec3 frag_normal;\n\nuniform vec3 center;\nuniform float radius;\nuniform samplerCube sphericalNormalMap;\nuniform mat3 normalMatrix;\nuniform mat4 modelMatrix;\n\nuniform float impurityScale;\nuniform vec3 colorTransferBegin;\nuniform vec3 colorTransferEnd;\nuniform float refractionIndex;\nuniform float gamma;\nuniform float contrast;\nuniform float brightness;\nuniform float dispersion;\nuniform float tracingOpacity;\n\n\nvec3 getIBLRadianceVariation( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t// Mixing the reflection with the normal is more accurate and keeps rough objects from gathering light from behind their tangent plane.\n\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\treturn min(envMapColor.rgb * envMapIntensity, vec3(1.0));\n\t#else\n\t\treturn vec3( 0.0 );\n\t#endif\n}\n\nvec3 calculateReflectedLight(vec3 position, vec3 normal, vec3 viewDir, PhysicalMaterial material, int depth) {\n\t\n\tvec3 currentGeometryPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n\n\tmat3 normalMatrix;\n\tnormalMatrix[0] = normalize(modelMatrix[0].xyz);\n\tnormalMatrix[1] = normalize(modelMatrix[1].xyz);\n\tnormalMatrix[2] = normalize(modelMatrix[2].xyz);\n\t\n\t// Calculate the normal vector in world space\n\tvec3 currentGeometryNormal = normalize(normalMatrix * normal);\n\t\n\t// Calculate the view direction vector in world space\n\tvec3 currentGeometryViewDir = normalize(normalMatrix * -viewDir);\n\n vec3 currentGeometryClearcoatNormal;\n\t\n\t#ifdef USE_CLEARCOAT\n currentGeometryClearcoatNormal = clearcoatNormal;\n #endif\n\n\tReflectedLight rLight;\n\tIncidentLight dLight;\n\n\tfloat temp = material.roughness;\n\tmaterial.roughness = 0.5;\n\n\t#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\t\tPointLight pointLight;\n #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLightShadow;\n #endif\n\n\t #pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\t\tpointLight = pointLights[ i ];\n getPointLightInfo( pointLight, currentGeometryPosition, dLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n pointLightShadow = pointLightShadows[ i ];\n dLight.color *= all( bvec2( dLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n #endif\n\t\t RE_Direct( dLight, currentGeometryPosition, currentGeometryNormal, currentGeometryViewDir, currentGeometryClearcoatNormal, material, rLight );\n\t\t}\n #pragma unroll_loop_end\n\t#endif\n\t#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n SpotLight spotLight;\n #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n spotLight = spotLights[ i ];\n getSpotLightInfo( spotLight, currentGeometryPosition, dLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n spotLightShadow = spotLightShadows[ i ];\n dLight.color *= all( bvec2( dLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( dLight, currentGeometryPosition, currentGeometryNormal, currentGeometryViewDir, currentGeometryClearcoatNormal, material, rLight );\n }\n #pragma unroll_loop_end\n\t#endif\n\n #if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n DirectionalLight directionalLight;\n #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n directionalLight = directionalLights[ i ];\n getDirectionalLightInfo( directionalLight, dLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n directionalLightShadow = directionalLightShadows[ i ];\n dLight.color *= all( bvec2( dLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( dLight, currentGeometryPosition, currentGeometryNormal, currentGeometryViewDir, currentGeometryClearcoatNormal, material, rLight );\n }\n #pragma unroll_loop_end\n #endif\n\tmaterial.roughness = temp;\n\t\n #if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n RectAreaLight rectAreaLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n rectAreaLight = rectAreaLights[ i ];\n RE_Direct_RectArea( rectAreaLight, currentGeometryPosition, currentGeometryNormal, currentGeometryViewDir, currentGeometryClearcoatNormal, material, rLight );\n }\n #pragma unroll_loop_end\n #endif\n #if defined( RE_IndirectDiffuse )\n vec3 iblIrradiance = vec3( 0.0 );\n vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t\t\n\t\t#if defined( USE_LIGHT_PROBES )\n \tirradiance += getLightProbeIrradiance( lightProbe, currentGeometryNormal );\n\t\t#endif\n #if ( NUM_HEMI_LIGHTS > 0 )\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], currentGeometryNormal );\n }\n #pragma unroll_loop_end\n #endif\n #endif\n #if defined( RE_IndirectSpecular )\n vec3 radiance = vec3( 0.0 );\n vec3 clearcoatRadiance = vec3( 0.0 );\n #endif\n\n\n #if defined( RE_IndirectDiffuse )\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vUv2 );\n vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n irradiance += lightMapIrradiance;\n #endif\n #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n iblIrradiance += getIBLIrradiance( currentGeometryNormal );\n #endif\n #endif\n #if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n radiance += getIBLRadianceVariation( currentGeometryViewDir, currentGeometryNormal, material.roughness );\n #ifdef USE_CLEARCOAT\n clearcoatRadiance += getIBLRadianceVariation( currentGeometryViewDir, currentGeometryClearcoatNormal, material.clearcoatRoughness );\n #endif\n #endif\n\n #if defined( RE_IndirectDiffuse )\n RE_IndirectDiffuse( irradiance, currentGeometryPosition, currentGeometryNormal, currentGeometryViewDir, currentGeometryClearcoatNormal, material, rLight );\n #endif\n #if defined( RE_IndirectSpecular )\n RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, currentGeometryPosition, currentGeometryNormal, currentGeometryViewDir, currentGeometryClearcoatNormal, material, rLight );\n #endif\n\n\tif(depth >= 0) {\n\t\tfloat frac = float(depth) / float(TRACING_DEPTH);\n\t\tvec3 colorTransfer = (1.0-frac) * colorTransferBegin + frac * colorTransferEnd;\n\t\trLight.indirectSpecular *= colorTransfer;\n\t\trLight.directSpecular *= colorTransfer;\n\t}\n\n\tvec3 color = rLight.indirectSpecular + rLight.directSpecular + rLight.indirectDiffuse + rLight.directDiffuse;\n\n\t// gamma\n\tcolor = pow(color, vec3(1.0/gamma)); \n\n\t// contrast\n\tcolor.rgb = ((color.rgb - 0.5) * max(contrast, 0.0)) + 0.5; \n\n\t// brightness\n\tcolor.r = min(max(color.r + brightness, 0.0), 1.0);\n\tcolor.g = min(max(color.g + brightness, 0.0), 1.0);\n\tcolor.b = min(max(color.b + brightness, 0.0), 1.0);\n\n\treturn color;\n}\n\nvec3 normalLookUp(vec3 dir) {\n\tvec4 s = textureCube(sphericalNormalMap, dir);\n\tif(s.a < 1.0/256.0) {\n\t\treturn normalize(vec3(-s.x, -s.y, -s.z));\n\t} else if(s.a < 3.0/256.0) {\n\t\treturn normalize(vec3(-s.x, -s.y, s.z));\n\t} else if(s.a < 5.0/256.0) {\n\t\treturn normalize(vec3(-s.x, s.y, -s.z));\n\t} else if(s.a < 7.0/256.0) {\n\t\treturn normalize(vec3(s.x, -s.y, -s.z));\n\t} else if(s.a < 9.0/256.0) {\n\t\treturn normalize(vec3(-s.x, s.y, s.z));\n\t} else if(s.a < 11.0/256.0) {\n\t\treturn normalize(vec3(s.x, -s.y, s.z));\n\t} else if(s.a < 13.0/256.0) {\n\t\treturn normalize(vec3(s.x, s.y, -s.z));\n\t} else {\n\t\treturn normalize(s.xyz);\n\t}\n}\n\n#ifdef USE_IMPURITYMAP\n\tfloat impurityLookUp(vec3 dir) {\n\t\tvec3 c = textureCube(impurityMap, dir.xy).rgb;\n\t\treturn (c.x + c.y + c.z) / 3.0;\n\t}\n#endif\n\nvec3 raySphereIntersection(vec3 o, vec3 d) {\n\n\tvec3 oc = o - center;\n float a = dot(d, d);\n float b = 2.0 * dot(oc, d);\n float c = dot(oc,oc) - radius*radius;\n float discriminant = b*b - 4.0*a*c;\n if(discriminant < 0.0){\n return vec3(0.0);\n }\n else{\n return o +( (-b + sqrt(discriminant)) / (2.0*a)) * d;\n }\n}\n\nvec3 hueToSaturatedColor(float hue) {\n float r,g,b;\n if (hue < 0.25){\n\t\tfloat t = 1.0 - (hue / 0.25);\n r = 1.0;\n g = 1.0;\n b = t; \n\t} else if (hue < 0.5){\n \tfloat t = 1.0 - (hue - 0.25 / 0.25);\n\t\tr = 1.0;\n g = t;\n b = 0.0;\n\t} else if (hue < 0.75){\n \tfloat t = 1.0 - (hue - 0.5 / 0.25);\n\t\tr = t;\n g = 0.0;\n b = 1.0 - t;\n } else {\n \tfloat t = hue - 0.75 / 0.25;\n r = t;\n g = t;\n b = 1.0;\n }\n return vec3(r, g, b) / 0.5 + 0.5;\n}\n// CUSTOM END\n\nvoid main() { \n // CUSTOM START\n vec3 frag_normal_normalized = frag_normal;\n // CUSTOM END\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\n // CUSTOM START\n\t\n // Extract the translation part of the model matrix\n\tvec3 translation = modelMatrix[3].xyz;\n\n\t// Extract the rotation part of the model matrix (3x3 upper-left submatrix)\n\tmat3 rotationMatrix = mat3(modelMatrix);\n\n\t// Calculate the inverse of the rotation matrix (transpose since it's orthogonal)\n\tmat3 inverseRotationMatrix;\n\tinverseRotationMatrix[0] = vec3(rotationMatrix[0].x, rotationMatrix[1].x, rotationMatrix[2].x);\n\tinverseRotationMatrix[1] = vec3(rotationMatrix[0].y, rotationMatrix[1].y, rotationMatrix[2].y);\n\tinverseRotationMatrix[2] = vec3(rotationMatrix[0].z, rotationMatrix[1].z, rotationMatrix[2].z);\n\n\t// Calculate the camera position in model space\n\tvec3 cameraPositionInModelSpace = inverseRotationMatrix * (cameraPosition - translation);\n\n\t// Calculate the initial direction\n\tvec3 initialDirection = normalize(frag_position.xyz - cameraPositionInModelSpace);\n\n\tvec4 outgoingLight2;\n\tfloat r_0 = (1.0-refractionIndex)/(1.0+refractionIndex);\n\tr_0 = r_0*r_0;\n\n\tfloat cos_theta_0 = -dot(initialDirection, frag_normal_normalized);\n\tfloat r_0_outside = (refractionIndex-1.0)/(refractionIndex+1.0);\n\tr_0_outside = r_0_outside*r_0_outside;\n\tfloat initialProbability = r_0_outside + (1.0 - r_0_outside)*pow(1.0 - cos_theta_0, 5.0);\n\n\toutgoingLight2 = vec4(calculateReflectedLight(frag_position, frag_normal_normalized, initialDirection, material, -1), 1.0);\n\t// gl_FragColor = outgoingLight2;\n\t// return;\n\tif(TRACING_DEPTH > 0) \n\t\toutgoingLight2 *= initialProbability;\n\t\t\n\tvec3 tempColor;\n\n\t#ifdef DISPERSION\n\t\tconst int loop = 3;\n\t\tvec3 dispersionColor;\n\t#else\n\t\tconst int loop = 1;\n\t#endif\n\t\t#pragma unroll_loop_start\n\t\tfor(int j = 0; j < loop; j++){\n\t\t\tvec3 refractedDirection = refract(initialDirection, frag_normal_normalized, 1.0/refractionIndex + float(j)*dispersion * 0.025);\n\t\t\tvec3 newPosition = raySphereIntersection(frag_position, refractedDirection);\n\t\t\tvec3 lookUpVector = normalize(newPosition - center);\n\t\t\tvec3 newNormal = normalLookUp(lookUpVector);\n\t\t\tvec3 newDirection = reflect(refractedDirection, newNormal);\n\n\t\t\tfloat currentProbability = 1.0;\n\n\t\t\t#ifdef USE_IMPURITYMAP\n\t\t\t\tfloat impurityProbability = impurityLookUp(lookUpVector);\n\t\t\t\tcurrentProbability -= impurityProbability * impurityScale;\n\t\t\t\t// gl_FragColor = vec4(vec3(impurityProbability), 1.0);\n\t\t\t\t// return;\n\t\t\t#endif\n\t\t\t\n\t\t\t// if(0 == TRACING_DEPTH) {\n\t\t\t// \tgl_FragColor = vec4(0.5 * newNormal + 0.5, 1.0);\n\t\t\t// \treturn;\n\t\t\t// }\n\n\t\t\ttempColor = vec3(0.0);\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor(int i = 0; i < TRACING_DEPTH; i++) {\n\t\t\t\t// small position correction to avoid artefacts\n\t\t\t\tnewPosition = newPosition - lookUpVector * 1e-6;\n\t\t\t\tnewPosition = raySphereIntersection(newPosition, newDirection);\n\t\t\t\tlookUpVector = normalize(newPosition - center);\n\t\t\t\tnewNormal = normalLookUp(lookUpVector);\n\t\t\t\n\t\t\t\tfloat cos_theta = dot(newDirection, newNormal);\n\t\t\t\tfloat ratio;\n\t\t\t\tif(cos_theta > 0.0) {\n\t\t\t\t\tratio = refractionIndex;\n\t\t\t\t} else {\n\t\t\t\t\tcos_theta = -cos_theta;\n\t\t\t\t\tratio = 1.0 / refractionIndex;\n\t\t\t\t}\n\t\t\t\tfloat cos_theta_2 = 1.0 - ratio*ratio * (1.0 - cos_theta*cos_theta);\n\t\t\t\tfloat probability = r_0 + (1.0 - r_0)*pow(1.0 - cos_theta, 5.0);\n\t\t\t\tif(cos_theta_2 < 0.0) probability = 0.0;\n\n\t\t\t\tvec3 refracted = refract(newDirection, newNormal*-1.0, 1.0/refractionIndex);\n\t\t\t\ttempColor += probability * currentProbability * calculateReflectedLight(newPosition, newNormal*-1.0, reflect(refracted, newNormal), material, i);\n\t\t\t\tif(i+1 == TRACING_DEPTH)\n\t\t\t\t\ttempColor += (1.0 - probability) * currentProbability * calculateReflectedLight(newPosition, newNormal, newDirection, material, i);\n\n\t\t\t\tnewDirection = reflect(newDirection, newNormal);\n\n\t\t\t\t// if(i+1 == TRACING_DEPTH) {\n\t\t\t\t// \tgl_FragColor = vec4(0.5 * newNormal + 0.5, 1.0);\n\t\t\t\t// \treturn;\n\t\t\t\t// }\n\n\t\t\t\tcurrentProbability *= (1.0 - probability);\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\n\t\t\t#ifdef DISPERSION\n\t\t\t\tif(j == 0) {\n\t\t\t\t\tdispersionColor.r = tempColor.r;\t\n\t\t\t\t} else if(j == 1) {\n\t\t\t\t\tdispersionColor.g = tempColor.g;\t\n\t\t\t\t} else if(j == 2) {\n\t\t\t\t\tdispersionColor.b = tempColor.b;\t\n\t\t\t\t}\n\t\t\t\ttempColor = dispersionColor;\n\t\t\t#endif\n\t\t}\t\n\t\t#pragma unroll_loop_end\n\n\tif(TRACING_DEPTH > 0)\n\t\toutgoingLight2.rgb += (1.0 - initialProbability) * tempColor;\n\n\tfloat alpha = (1.0 - initialProbability) + initialProbability*tracingOpacity;\n\tgl_FragColor = vec4(outgoingLight2.rgb, alpha*diffuseColor.a);\n\n // CUSTOM END\n\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n\n";
3
3
  //# sourceMappingURL=gem.d.ts.map
@@ -1,6 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.frag = exports.vert = void 0;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.frag = exports.vert = void 0;
4
4
  exports.vert = `
5
5
  #define STANDARD
6
6
  varying vec3 vViewPosition;
@@ -54,7 +54,7 @@ void main() {
54
54
  frag_normal = objectNormal;
55
55
  // CUSTOM END
56
56
  }
57
- `;
57
+ `;
58
58
  exports.frag = `
59
59
  #define STANDARD
60
60
  #ifdef PHYSICAL
@@ -578,5 +578,5 @@ void main() {
578
578
  #include <dithering_fragment>
579
579
  }
580
580
 
581
- `;
581
+ `;
582
582
  //# sourceMappingURL=gem.js.map
@@ -1,3 +1,3 @@
1
- export declare const vert = "\nattribute float positionIndex;\nflat varying int vMaterialIndex;\nflat varying int vPositionIndex;\n\nuniform float size_0;\nuniform float size_1;\nuniform float size_2;\nuniform float size_3;\nuniform float size_4;\nuniform float size_5;\nuniform float size_6;\nuniform float size_7;\n\nuniform bool sizeAttenuation_0;\nuniform bool sizeAttenuation_1;\nuniform bool sizeAttenuation_2;\nuniform bool sizeAttenuation_3;\nuniform bool sizeAttenuation_4;\nuniform bool sizeAttenuation_5;\nuniform bool sizeAttenuation_6;\nuniform bool sizeAttenuation_7;\n\nuniform highp usampler2D materialIndexDataTexture;\n\nuniform float scale;\n\nfloat getSize(int materialIndex) {\n if ( materialIndex == 1 ) {\n return size_1;\n } else if ( materialIndex == 2 ) {\n return size_2;\n } else if ( materialIndex == 3 ) {\n return size_3;\n } else if ( materialIndex == 4 ) {\n return size_4;\n } else if ( materialIndex == 5 ) {\n return size_5;\n } else if ( materialIndex == 6 ) {\n return size_6;\n } else if ( materialIndex == 7 ) {\n return size_7;\n } else {\n return size_0;\n }\n}\n\nbool getSizeAttenuation(int materialIndex) {\n if ( materialIndex == 1 ) {\n return sizeAttenuation_1;\n } else if ( materialIndex == 2 ) {\n return sizeAttenuation_2;\n } else if ( materialIndex == 3 ) {\n return sizeAttenuation_3;\n } else if ( materialIndex == 4 ) {\n return sizeAttenuation_4;\n } else if ( materialIndex == 5 ) {\n return sizeAttenuation_5;\n } else if ( materialIndex == 6 ) {\n return sizeAttenuation_6;\n } else if ( materialIndex == 7 ) {\n return sizeAttenuation_7;\n } else {\n return sizeAttenuation_0;\n }\n}\n\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\n#ifdef USE_POINTS_UV\n\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n\n#endif\n\nint retrieveMaterialIndex() {\n vec2 uv = vec2(positionIndex/1024.0, 0.5);\n\n // get the value of a texture at a specific index\n return int(texture2D(materialIndexDataTexture, uv).r);\n}\n\nvoid main() {\n int materialIndex = retrieveMaterialIndex();\n vMaterialIndex = materialIndex;\n\n float size = getSize(materialIndex);\n bool sizeAttenuation = getSizeAttenuation(materialIndex);\n\n\t#ifdef USE_POINTS_UV\n\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\n\t#endif\n\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\n gl_PointSize = size;\n\n\tif(sizeAttenuation) {\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n }\n\n\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n\n}\n";
2
- export declare const frag = "\nuniform vec3 diffuse;\nuniform vec3 color_0;\nuniform vec3 color_1;\nuniform vec3 color_2;\nuniform vec3 color_3;\nuniform vec3 color_4;\nuniform vec3 color_5;\nuniform vec3 color_6;\nuniform vec3 color_7;\n\n\nuniform float opacity;\nflat varying int vMaterialIndex;\nflat varying int vPositionIndex;\n\n#include <common>\n#include <color_pars_fragment>\n\n#if defined( USE_POINTS_UV )\n\n\tvarying vec2 vUv;\n\n#else\n\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\n\t\tuniform mat3 uvTransform;\n\n\t#endif\n\n#endif\n\n#ifdef USE_MAP\n\n\tuniform sampler2D map_0;\n\tuniform sampler2D map_1;\n\tuniform sampler2D map_2;\n\tuniform sampler2D map_3;\n uniform sampler2D map_4;\n uniform sampler2D map_5;\n uniform sampler2D map_6;\n uniform sampler2D map_7;\n\n#endif\n\n#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap_0;\n uniform sampler2D alphaMap_1;\n uniform sampler2D alphaMap_2;\n uniform sampler2D alphaMap_3;\n uniform sampler2D alphaMap_4;\n uniform sampler2D alphaMap_5;\n uniform sampler2D alphaMap_6;\n uniform sampler2D alphaMap_7;\n\n#endif\n\n\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec3 outgoingLight = vec3( 0.0 );\n\n vec3 c = vec3(1.0, 0.0, 0.0);\n if ( vMaterialIndex == 1 ) {\n c = color_1;\n } else if ( vMaterialIndex == 2 ) {\n c = color_2;\n } else if ( vMaterialIndex == 3 ) {\n c = color_3;\n } else if ( vMaterialIndex == 4 ) {\n c = color_4;\n } else if ( vMaterialIndex == 5 ) {\n c = color_5;\n } else if ( vMaterialIndex == 6 ) {\n c = color_6;\n } else if ( vMaterialIndex == 7 ) {\n c = color_7;\n } else {\n c = color_0;\n }\n\n\tvec4 diffuseColor = vec4( c, opacity );\n\n \n\n\n\t#include <logdepthbuf_fragment>\n\n #if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\n #if defined( USE_POINTS_UV )\n\n vec2 uv = vUv;\n\n #else\n\n vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\n #endif\n\n #endif\n\n #ifdef USE_MAP\n\n if ( vMaterialIndex == 1 ) {\n diffuseColor *= texture2D( map_1, uv );\n } else if ( vMaterialIndex == 2 ) {\n diffuseColor *= texture2D( map_2, uv );\n } else if ( vMaterialIndex == 3 ) {\n diffuseColor *= texture2D( map_3, uv );\n } else if ( vMaterialIndex == 4 ) {\n diffuseColor *= texture2D( map_4, uv );\n } else if ( vMaterialIndex == 5 ) {\n diffuseColor *= texture2D( map_5, uv );\n } else if ( vMaterialIndex == 6 ) {\n diffuseColor *= texture2D( map_6, uv );\n } else if ( vMaterialIndex == 7 ) {\n diffuseColor *= texture2D( map_7, uv );\n } else {\n diffuseColor *= texture2D( map_0, uv );\n }\n\n #endif\n\n #ifdef USE_ALPHAMAP\n\n if ( vMaterialIndex == 1 ) {\n diffuseColor *= texture2D( alphaMap_1, uv );\n } else if ( vMaterialIndex == 2 ) {\n diffuseColor *= texture2D( alphaMap_2, uv );\n } else if ( vMaterialIndex == 3 ) {\n diffuseColor *= texture2D( alphaMap_3, uv );\n } else if ( vMaterialIndex == 4 ) {\n diffuseColor *= texture2D( alphaMap_4, uv );\n } else if ( vMaterialIndex == 5 ) {\n diffuseColor *= texture2D( alphaMap_5, uv );\n } else if ( vMaterialIndex == 6 ) {\n diffuseColor *= texture2D( alphaMap_6, uv );\n } else if ( vMaterialIndex == 7 ) {\n diffuseColor *= texture2D( alphaMap_7, uv );\n } else {\n diffuseColor *= texture2D( alphaMap_0, uv );\n }\n\n #endif\n\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\n\toutgoingLight = diffuseColor.rgb;\n\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\n}\n";
1
+ export declare const vert = "\nattribute float positionIndex;\nflat varying int vMaterialIndex;\nflat varying int vPositionIndex;\n\nuniform float size_0;\nuniform float size_1;\nuniform float size_2;\nuniform float size_3;\nuniform float size_4;\nuniform float size_5;\nuniform float size_6;\nuniform float size_7;\n\nuniform bool sizeAttenuation_0;\nuniform bool sizeAttenuation_1;\nuniform bool sizeAttenuation_2;\nuniform bool sizeAttenuation_3;\nuniform bool sizeAttenuation_4;\nuniform bool sizeAttenuation_5;\nuniform bool sizeAttenuation_6;\nuniform bool sizeAttenuation_7;\n\nuniform highp usampler2D materialIndexDataTexture;\n\nuniform float scale;\n\nfloat getSize(int materialIndex) {\n if ( materialIndex == 1 ) {\n return size_1;\n } else if ( materialIndex == 2 ) {\n return size_2;\n } else if ( materialIndex == 3 ) {\n return size_3;\n } else if ( materialIndex == 4 ) {\n return size_4;\n } else if ( materialIndex == 5 ) {\n return size_5;\n } else if ( materialIndex == 6 ) {\n return size_6;\n } else if ( materialIndex == 7 ) {\n return size_7;\n } else {\n return size_0;\n }\n}\n\nbool getSizeAttenuation(int materialIndex) {\n if ( materialIndex == 1 ) {\n return sizeAttenuation_1;\n } else if ( materialIndex == 2 ) {\n return sizeAttenuation_2;\n } else if ( materialIndex == 3 ) {\n return sizeAttenuation_3;\n } else if ( materialIndex == 4 ) {\n return sizeAttenuation_4;\n } else if ( materialIndex == 5 ) {\n return sizeAttenuation_5;\n } else if ( materialIndex == 6 ) {\n return sizeAttenuation_6;\n } else if ( materialIndex == 7 ) {\n return sizeAttenuation_7;\n } else {\n return sizeAttenuation_0;\n }\n}\n\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\n#ifdef USE_POINTS_UV\n\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n\n#endif\n\nint retrieveMaterialIndex() {\n vec2 uv = vec2(positionIndex/1024.0, 0.5);\n\n // get the value of a texture at a specific index\n return int(texture2D(materialIndexDataTexture, uv).r);\n}\n\nvoid main() {\n int materialIndex = retrieveMaterialIndex();\n vMaterialIndex = materialIndex;\n\n float size = getSize(materialIndex);\n bool sizeAttenuation = getSizeAttenuation(materialIndex);\n\n\t#ifdef USE_POINTS_UV\n\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\n\t#endif\n\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\n gl_PointSize = size;\n\n\tif(sizeAttenuation) {\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n }\n\n\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n\n}\n";
2
+ export declare const frag = "\nuniform vec3 diffuse;\nuniform vec3 color_0;\nuniform vec3 color_1;\nuniform vec3 color_2;\nuniform vec3 color_3;\nuniform vec3 color_4;\nuniform vec3 color_5;\nuniform vec3 color_6;\nuniform vec3 color_7;\n\n\nuniform float opacity;\nflat varying int vMaterialIndex;\nflat varying int vPositionIndex;\n\n#include <common>\n#include <color_pars_fragment>\n\n#if defined( USE_POINTS_UV )\n\n\tvarying vec2 vUv;\n\n#else\n\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\n\t\tuniform mat3 uvTransform;\n\n\t#endif\n\n#endif\n\n#ifdef USE_MAP\n\n\tuniform sampler2D map_0;\n\tuniform sampler2D map_1;\n\tuniform sampler2D map_2;\n\tuniform sampler2D map_3;\n uniform sampler2D map_4;\n uniform sampler2D map_5;\n uniform sampler2D map_6;\n uniform sampler2D map_7;\n\n#endif\n\n#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap_0;\n uniform sampler2D alphaMap_1;\n uniform sampler2D alphaMap_2;\n uniform sampler2D alphaMap_3;\n uniform sampler2D alphaMap_4;\n uniform sampler2D alphaMap_5;\n uniform sampler2D alphaMap_6;\n uniform sampler2D alphaMap_7;\n\n#endif\n\n\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec3 outgoingLight = vec3( 0.0 );\n\n vec3 c = vec3(1.0, 0.0, 0.0);\n if ( vMaterialIndex == 1 ) {\n c = color_1;\n } else if ( vMaterialIndex == 2 ) {\n c = color_2;\n } else if ( vMaterialIndex == 3 ) {\n c = color_3;\n } else if ( vMaterialIndex == 4 ) {\n c = color_4;\n } else if ( vMaterialIndex == 5 ) {\n c = color_5;\n } else if ( vMaterialIndex == 6 ) {\n c = color_6;\n } else if ( vMaterialIndex == 7 ) {\n c = color_7;\n } else {\n c = color_0;\n }\n\n\tvec4 diffuseColor = vec4( c, opacity );\n\n \n\n\n\t#include <logdepthbuf_fragment>\n\n #if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\n #if defined( USE_POINTS_UV )\n\n vec2 uv = vUv;\n\n #else\n\n vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\n #endif\n\n #endif\n\n #ifdef USE_MAP\n\n if ( vMaterialIndex == 1 ) {\n diffuseColor *= texture2D( map_1, uv );\n } else if ( vMaterialIndex == 2 ) {\n diffuseColor *= texture2D( map_2, uv );\n } else if ( vMaterialIndex == 3 ) {\n diffuseColor *= texture2D( map_3, uv );\n } else if ( vMaterialIndex == 4 ) {\n diffuseColor *= texture2D( map_4, uv );\n } else if ( vMaterialIndex == 5 ) {\n diffuseColor *= texture2D( map_5, uv );\n } else if ( vMaterialIndex == 6 ) {\n diffuseColor *= texture2D( map_6, uv );\n } else if ( vMaterialIndex == 7 ) {\n diffuseColor *= texture2D( map_7, uv );\n } else {\n diffuseColor *= texture2D( map_0, uv );\n }\n\n #endif\n\n #ifdef USE_ALPHAMAP\n\n if ( vMaterialIndex == 1 ) {\n diffuseColor *= texture2D( alphaMap_1, uv );\n } else if ( vMaterialIndex == 2 ) {\n diffuseColor *= texture2D( alphaMap_2, uv );\n } else if ( vMaterialIndex == 3 ) {\n diffuseColor *= texture2D( alphaMap_3, uv );\n } else if ( vMaterialIndex == 4 ) {\n diffuseColor *= texture2D( alphaMap_4, uv );\n } else if ( vMaterialIndex == 5 ) {\n diffuseColor *= texture2D( alphaMap_5, uv );\n } else if ( vMaterialIndex == 6 ) {\n diffuseColor *= texture2D( alphaMap_6, uv );\n } else if ( vMaterialIndex == 7 ) {\n diffuseColor *= texture2D( alphaMap_7, uv );\n } else {\n diffuseColor *= texture2D( alphaMap_0, uv );\n }\n\n #endif\n\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\n\toutgoingLight = diffuseColor.rgb;\n\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\n}\n";
3
3
  //# sourceMappingURL=multi_points.d.ts.map
@@ -1,6 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.frag = exports.vert = void 0;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.frag = exports.vert = void 0;
4
4
  exports.vert = `
5
5
  attribute float positionIndex;
6
6
  flat varying int vMaterialIndex;
@@ -122,7 +122,7 @@ void main() {
122
122
  #include <fog_vertex>
123
123
 
124
124
  }
125
- `;
125
+ `;
126
126
  exports.frag = `
127
127
  uniform vec3 diffuse;
128
128
  uniform vec3 color_0;
@@ -290,5 +290,5 @@ void main() {
290
290
  #include <premultiplied_alpha_fragment>
291
291
 
292
292
  }
293
- `;
293
+ `;
294
294
  //# sourceMappingURL=multi_points.js.map
@@ -1,2 +1,2 @@
1
- export declare const css = "\n.sdv-error-message-container {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n text-align: center;\n}\n\n.sdv-error-message {\n font-family: \"CircularXXWeb-Book\", sans-serif;\n font-size: x-large;\n filter: invert(100);\n}\n\n.sdv-anchor-container {\n user-select: none;\n cursor: default;\n pointer-events: none;\n overflow: hidden;\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0%;\n top: 0%;\n}\n\n.sdv-anchor-inner-container {\n position: absolute;\n white-space: nowrap;\n text-overflow: clip;\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n}\n\n.sdv-anchor-text {\n user-select: none;\n cursor: default;\n pointer-events: none;\n display: block;\n text-overflow: clip;\n overflow: hidden;\n}\n\n.sdv-anchor-image {\n user-select: none;\n cursor: default;\n pointer-events: none;\n}\n\n.sdv-logo-container {\n position: relative;\n height: 100%;\n width: 100%;\n}\n\n.sdv-logo {\n position: absolute;\n top: 50%;\n left: 50%;\n max-width: calc(100% - 0.5);\n max-height: calc(100% - 0.5);\n transform: translate(-50%, -50%);\n}\n\n.sdv-spinner-container {\n position: absolute;\n height: 100%;\n width: 100%;\n top: 0;\n left: 0;\n user-select: none;\n cursor: default;\n pointer-events: none;\n}\n\n.sdv-spinner {\n position: absolute;\n max-width: calc(100% * 0.15);\n max-height: calc(100% * 0.15);\n mix-blend-mode: difference;\n filter: invert(1) grayscale(100%);\n}\n\n.sdv-spinner-top-left {\n left: calc(100% * 0.01);\n top: calc(100% * 0.01);\n float: left;\n}\n\n.sdv-spinner-top-right {\n right: calc(100% * 0.01);\n top: calc(100% * 0.01);\n float: right;\n}\n\n.sdv-spinner-bottom-left {\n left: calc(100% * 0.01);\n bottom: calc(100% * 0.01);\n float: left;\n}\n\n.sdv-spinner-bottom-right {\n right: calc(100% * 0.01);\n bottom: calc(100% * 0.01);\n float: right;\n}\n\n.sdv-spinner-center {\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n ";
1
+ export declare const css = "\n.sdv-error-message-container {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n text-align: center;\n}\n\n.sdv-error-message {\n font-family: \"CircularXXWeb-Book\", sans-serif;\n font-size: x-large;\n filter: invert(100);\n}\n\n.sdv-anchor-container {\n user-select: none;\n cursor: default;\n pointer-events: none;\n overflow: hidden;\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0%;\n top: 0%;\n}\n\n.sdv-anchor-inner-container {\n position: absolute;\n white-space: nowrap;\n text-overflow: clip;\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n}\n\n.sdv-anchor-text {\n user-select: none;\n cursor: default;\n pointer-events: none;\n display: block;\n text-overflow: clip;\n overflow: hidden;\n}\n\n.sdv-anchor-image {\n user-select: none;\n cursor: default;\n pointer-events: none;\n}\n\n.sdv-logo-container {\n position: relative;\n height: 100%;\n width: 100%;\n}\n\n.sdv-logo {\n position: absolute;\n top: 50%;\n left: 50%;\n max-width: calc(100% - 0.5);\n max-height: calc(100% - 0.5);\n transform: translate(-50%, -50%);\n}\n\n.sdv-spinner-container {\n position: absolute;\n height: 100%;\n width: 100%;\n top: 0;\n left: 0;\n user-select: none;\n cursor: default;\n pointer-events: none;\n}\n\n.sdv-spinner {\n position: absolute;\n max-width: calc(100% * 0.15);\n max-height: calc(100% * 0.15);\n mix-blend-mode: difference;\n filter: invert(1) grayscale(100%);\n}\n\n.sdv-spinner-top-left {\n left: calc(100% * 0.01);\n top: calc(100% * 0.01);\n float: left;\n}\n\n.sdv-spinner-top-right {\n right: calc(100% * 0.01);\n top: calc(100% * 0.01);\n float: right;\n}\n\n.sdv-spinner-bottom-left {\n left: calc(100% * 0.01);\n bottom: calc(100% * 0.01);\n float: left;\n}\n\n.sdv-spinner-bottom-right {\n right: calc(100% * 0.01);\n bottom: calc(100% * 0.01);\n float: right;\n}\n\n.sdv-spinner-center {\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n ";
2
2
  //# sourceMappingURL=viewport-css.d.ts.map
@@ -1,6 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.css = void 0;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.css = void 0;
4
4
  exports.css = `
5
5
  .sdv-error-message-container {
6
6
  position: absolute;
@@ -113,5 +113,5 @@ exports.css = `
113
113
  left: 50%;
114
114
  transform: translate(-50%, -50%);
115
115
  }
116
- `;
116
+ `;
117
117
  //# sourceMappingURL=viewport-css.js.map