@plastic-software/three 0.181.2 → 0.182.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (253) hide show
  1. package/README.md +3 -4
  2. package/build/three.cjs +1192 -522
  3. package/build/three.core.js +345 -219
  4. package/build/three.core.min.js +1 -1
  5. package/build/three.module.js +864 -328
  6. package/build/three.module.min.js +1 -1
  7. package/build/three.tsl.js +15 -3
  8. package/build/three.tsl.min.js +1 -1
  9. package/build/three.webgpu.js +3660 -1545
  10. package/build/three.webgpu.min.js +1 -1
  11. package/build/three.webgpu.nodes.js +3659 -1544
  12. package/build/three.webgpu.nodes.min.js +1 -1
  13. package/examples/jsm/controls/MapControls.js +55 -1
  14. package/examples/jsm/controls/OrbitControls.js +6 -6
  15. package/examples/jsm/controls/TrackballControls.js +6 -6
  16. package/examples/jsm/csm/CSM.js +2 -1
  17. package/examples/jsm/environments/RoomEnvironment.js +2 -0
  18. package/examples/jsm/geometries/DecalGeometry.js +1 -1
  19. package/examples/jsm/helpers/LightProbeHelperGPU.js +1 -1
  20. package/examples/jsm/helpers/TextureHelperGPU.js +1 -1
  21. package/examples/jsm/inspector/Inspector.js +53 -9
  22. package/examples/jsm/inspector/RendererInspector.js +12 -2
  23. package/examples/jsm/inspector/tabs/Console.js +2 -2
  24. package/examples/jsm/inspector/tabs/Parameters.js +2 -2
  25. package/examples/jsm/inspector/tabs/Performance.js +2 -2
  26. package/examples/jsm/inspector/tabs/Viewer.js +4 -4
  27. package/examples/jsm/inspector/ui/Profiler.js +1836 -31
  28. package/examples/jsm/inspector/ui/Style.js +948 -13
  29. package/examples/jsm/inspector/ui/Tab.js +188 -1
  30. package/examples/jsm/inspector/ui/Values.js +17 -1
  31. package/examples/jsm/loaders/3DMLoader.js +5 -4
  32. package/examples/jsm/loaders/DRACOLoader.js +5 -5
  33. package/examples/jsm/loaders/FBXLoader.js +0 -2
  34. package/examples/jsm/loaders/HDRLoader.js +0 -1
  35. package/examples/jsm/loaders/KTX2Loader.js +16 -0
  36. package/examples/jsm/loaders/LDrawLoader.js +2 -3
  37. package/examples/jsm/loaders/PCDLoader.js +1 -0
  38. package/examples/jsm/loaders/SVGLoader.js +1 -1
  39. package/examples/jsm/loaders/TDSLoader.js +0 -2
  40. package/examples/jsm/loaders/TGALoader.js +0 -2
  41. package/examples/jsm/loaders/UltraHDRLoader.js +110 -137
  42. package/examples/jsm/loaders/VOXLoader.js +660 -117
  43. package/examples/jsm/loaders/VRMLLoader.js +2 -2
  44. package/examples/jsm/loaders/usd/USDCParser.js +1 -1
  45. package/examples/jsm/materials/LDrawConditionalLineNodeMaterial.js +1 -1
  46. package/examples/jsm/materials/MeshGouraudMaterial.js +0 -1
  47. package/examples/jsm/materials/WoodNodeMaterial.js +11 -11
  48. package/examples/jsm/math/Octree.js +131 -1
  49. package/examples/jsm/misc/Volume.js +0 -1
  50. package/examples/jsm/misc/VolumeSlice.js +0 -1
  51. package/examples/jsm/objects/SkyMesh.js +13 -3
  52. package/examples/jsm/physics/AmmoPhysics.js +12 -7
  53. package/examples/jsm/physics/JoltPhysics.js +3 -1
  54. package/examples/jsm/physics/RapierPhysics.js +3 -1
  55. package/examples/jsm/postprocessing/OutputPass.js +9 -0
  56. package/examples/jsm/postprocessing/RenderPass.js +10 -0
  57. package/examples/jsm/postprocessing/UnrealBloomPass.js +48 -18
  58. package/examples/jsm/renderers/Projector.js +268 -30
  59. package/examples/jsm/renderers/SVGRenderer.js +191 -58
  60. package/examples/jsm/shaders/UnpackDepthRGBAShader.js +2 -4
  61. package/examples/jsm/transpiler/AST.js +44 -0
  62. package/examples/jsm/transpiler/GLSLDecoder.js +61 -4
  63. package/examples/jsm/transpiler/ShaderToyDecoder.js +2 -0
  64. package/examples/jsm/transpiler/TSLEncoder.js +46 -3
  65. package/examples/jsm/transpiler/TranspilerUtils.js +3 -3
  66. package/examples/jsm/transpiler/WGSLEncoder.js +27 -0
  67. package/examples/jsm/tsl/display/AnaglyphPassNode.js +2 -0
  68. package/examples/jsm/tsl/display/BloomNode.js +11 -1
  69. package/examples/jsm/tsl/display/GTAONode.js +3 -2
  70. package/examples/jsm/tsl/display/PixelationPassNode.js +2 -1
  71. package/examples/jsm/tsl/display/SSGINode.js +7 -19
  72. package/examples/jsm/tsl/display/SSRNode.js +1 -1
  73. package/examples/jsm/tsl/display/SSSNode.js +4 -2
  74. package/examples/jsm/tsl/display/StereoCompositePassNode.js +8 -1
  75. package/examples/jsm/tsl/display/TRAANode.js +265 -114
  76. package/examples/jsm/tsl/display/radialBlur.js +68 -0
  77. package/examples/jsm/utils/ShadowMapViewer.js +24 -10
  78. package/examples/jsm/utils/ShadowMapViewerGPU.js +1 -1
  79. package/examples/jsm/utils/WebGPUTextureUtils.js +1 -1
  80. package/package.json +14 -12
  81. package/src/Three.Core.js +1 -0
  82. package/src/Three.TSL.js +14 -2
  83. package/src/animation/AnimationUtils.js +1 -12
  84. package/src/animation/KeyframeTrack.js +1 -1
  85. package/src/animation/tracks/BooleanKeyframeTrack.js +1 -1
  86. package/src/animation/tracks/ColorKeyframeTrack.js +1 -1
  87. package/src/animation/tracks/NumberKeyframeTrack.js +1 -1
  88. package/src/animation/tracks/QuaternionKeyframeTrack.js +1 -1
  89. package/src/animation/tracks/StringKeyframeTrack.js +1 -1
  90. package/src/animation/tracks/VectorKeyframeTrack.js +1 -1
  91. package/src/constants.js +61 -5
  92. package/src/core/BufferGeometry.js +14 -2
  93. package/src/core/Raycaster.js +2 -2
  94. package/src/extras/PMREMGenerator.js +3 -10
  95. package/src/extras/TextureUtils.js +5 -1
  96. package/src/geometries/ExtrudeGeometry.js +2 -2
  97. package/src/geometries/PolyhedronGeometry.js +1 -1
  98. package/src/helpers/PointLightHelper.js +1 -1
  99. package/src/lights/DirectionalLight.js +13 -0
  100. package/src/lights/HemisphereLight.js +10 -0
  101. package/src/lights/Light.js +1 -11
  102. package/src/lights/LightProbe.js +0 -15
  103. package/src/lights/LightShadow.js +0 -3
  104. package/src/lights/PointLight.js +15 -0
  105. package/src/lights/PointLightShadow.js +0 -86
  106. package/src/lights/SpotLight.js +22 -1
  107. package/src/loaders/MaterialLoader.js +2 -1
  108. package/src/loaders/ObjectLoader.js +3 -1
  109. package/src/loaders/nodes/NodeLoader.js +2 -2
  110. package/src/materials/Material.js +2 -0
  111. package/src/materials/ShaderMaterial.js +20 -1
  112. package/src/materials/nodes/Line2NodeMaterial.js +2 -2
  113. package/src/materials/nodes/MeshPhysicalNodeMaterial.js +3 -2
  114. package/src/materials/nodes/MeshStandardNodeMaterial.js +5 -4
  115. package/src/materials/nodes/NodeMaterial.js +59 -3
  116. package/src/materials/nodes/manager/NodeMaterialObserver.js +1 -1
  117. package/src/math/Matrix4.js +40 -40
  118. package/src/math/Sphere.js +1 -1
  119. package/src/math/Vector3.js +0 -2
  120. package/src/nodes/TSL.js +4 -1
  121. package/src/nodes/accessors/BatchNode.js +10 -10
  122. package/src/nodes/accessors/BufferAttributeNode.js +98 -12
  123. package/src/nodes/accessors/BufferNode.js +29 -2
  124. package/src/nodes/accessors/ClippingNode.js +4 -4
  125. package/src/nodes/accessors/CubeTextureNode.js +20 -1
  126. package/src/nodes/accessors/InstanceNode.js +69 -29
  127. package/src/nodes/accessors/MaterialNode.js +9 -1
  128. package/src/nodes/accessors/MaterialReferenceNode.js +1 -2
  129. package/src/nodes/accessors/ModelNode.js +1 -1
  130. package/src/nodes/accessors/Normal.js +2 -2
  131. package/src/nodes/accessors/ReferenceBaseNode.js +4 -4
  132. package/src/nodes/accessors/ReferenceNode.js +4 -4
  133. package/src/nodes/accessors/RendererReferenceNode.js +1 -2
  134. package/src/nodes/accessors/SkinningNode.js +15 -2
  135. package/src/nodes/accessors/StorageBufferNode.js +4 -2
  136. package/src/nodes/accessors/Tangent.js +1 -11
  137. package/src/nodes/accessors/Texture3DNode.js +26 -1
  138. package/src/nodes/accessors/UniformArrayNode.js +2 -2
  139. package/src/nodes/accessors/UserDataNode.js +1 -2
  140. package/src/nodes/accessors/VertexColorNode.js +1 -2
  141. package/src/nodes/code/FunctionNode.js +1 -2
  142. package/src/nodes/core/ArrayNode.js +20 -1
  143. package/src/nodes/core/AssignNode.js +2 -2
  144. package/src/nodes/core/AttributeNode.js +2 -2
  145. package/src/nodes/core/ContextNode.js +103 -4
  146. package/src/nodes/core/NodeBuilder.js +56 -14
  147. package/src/nodes/core/NodeFrame.js +12 -4
  148. package/src/nodes/core/NodeUtils.js +5 -5
  149. package/src/nodes/core/ParameterNode.js +1 -2
  150. package/src/nodes/core/PropertyNode.js +19 -3
  151. package/src/nodes/core/StackNode.js +56 -8
  152. package/src/nodes/core/StructNode.js +1 -2
  153. package/src/nodes/core/StructTypeNode.js +11 -17
  154. package/src/nodes/core/UniformNode.js +19 -4
  155. package/src/nodes/core/VarNode.js +46 -21
  156. package/src/nodes/display/NormalMapNode.js +37 -2
  157. package/src/nodes/display/PassNode.js +77 -7
  158. package/src/nodes/display/ScreenNode.js +1 -0
  159. package/src/nodes/functions/BSDF/BRDF_GGX_Multiscatter.js +3 -3
  160. package/src/nodes/functions/BSDF/DFGLUT.js +56 -0
  161. package/src/nodes/functions/BSDF/EnvironmentBRDF.js +2 -2
  162. package/src/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.js +1 -1
  163. package/src/nodes/functions/PhysicalLightingModel.js +102 -43
  164. package/src/nodes/gpgpu/ComputeBuiltinNode.js +1 -2
  165. package/src/nodes/gpgpu/SubgroupFunctionNode.js +1 -1
  166. package/src/nodes/gpgpu/WorkgroupInfoNode.js +2 -3
  167. package/src/nodes/lighting/AnalyticLightNode.js +53 -0
  168. package/src/nodes/lighting/LightsNode.js +2 -2
  169. package/src/nodes/lighting/PointShadowNode.js +141 -140
  170. package/src/nodes/lighting/ShadowFilterNode.js +53 -37
  171. package/src/nodes/lighting/ShadowNode.js +53 -19
  172. package/src/nodes/math/BitcountNode.js +433 -0
  173. package/src/nodes/math/PackFloatNode.js +98 -0
  174. package/src/nodes/math/UnpackFloatNode.js +96 -0
  175. package/src/nodes/pmrem/PMREMNode.js +1 -1
  176. package/src/nodes/tsl/TSLCore.js +4 -4
  177. package/src/nodes/utils/ArrayElementNode.js +13 -0
  178. package/src/nodes/utils/EventNode.js +1 -2
  179. package/src/nodes/utils/Packing.js +13 -1
  180. package/src/nodes/utils/PostProcessingUtils.js +33 -1
  181. package/src/nodes/utils/ReflectorNode.js +1 -1
  182. package/src/nodes/utils/SampleNode.js +1 -1
  183. package/src/nodes/utils/UVUtils.js +26 -0
  184. package/src/objects/BatchedMesh.js +5 -2
  185. package/src/objects/Line.js +1 -1
  186. package/src/objects/Mesh.js +1 -1
  187. package/src/objects/Points.js +1 -1
  188. package/src/objects/Skeleton.js +9 -0
  189. package/src/renderers/WebGLRenderer.js +145 -33
  190. package/src/renderers/common/Backend.js +8 -0
  191. package/src/renderers/common/Background.js +19 -9
  192. package/src/renderers/common/Binding.js +11 -0
  193. package/src/renderers/common/Bindings.js +7 -7
  194. package/src/renderers/common/Buffer.js +40 -0
  195. package/src/renderers/common/ChainMap.js +30 -6
  196. package/src/renderers/common/Geometries.js +12 -0
  197. package/src/renderers/common/RenderContexts.js +8 -1
  198. package/src/renderers/common/RenderObject.js +14 -1
  199. package/src/renderers/common/Renderer.js +53 -35
  200. package/src/renderers/common/Textures.js +1 -1
  201. package/src/renderers/common/UniformsGroup.js +1 -0
  202. package/src/renderers/common/XRManager.js +1 -0
  203. package/src/renderers/common/extras/PMREMGenerator.js +2 -8
  204. package/src/renderers/common/nodes/NodeUniformBuffer.js +52 -0
  205. package/src/renderers/shaders/DFGLUTData.js +19 -34
  206. package/src/renderers/shaders/ShaderChunk/lights_fragment_begin.glsl.js +5 -2
  207. package/src/renderers/shaders/ShaderChunk/lights_physical_fragment.glsl.js +8 -4
  208. package/src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js +90 -51
  209. package/src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js +194 -186
  210. package/src/renderers/shaders/ShaderChunk/shadowmask_pars_fragment.glsl.js +1 -1
  211. package/src/renderers/shaders/ShaderChunk/transmission_fragment.glsl.js +1 -1
  212. package/src/renderers/shaders/ShaderChunk.js +3 -3
  213. package/src/renderers/shaders/ShaderLib/depth.glsl.js +3 -0
  214. package/src/renderers/shaders/ShaderLib/{distanceRGBA.glsl.js → distance.glsl.js} +1 -2
  215. package/src/renderers/shaders/ShaderLib/meshlambert.glsl.js +0 -1
  216. package/src/renderers/shaders/ShaderLib/meshnormal.glsl.js +1 -2
  217. package/src/renderers/shaders/ShaderLib/meshphong.glsl.js +0 -1
  218. package/src/renderers/shaders/ShaderLib/meshphysical.glsl.js +4 -9
  219. package/src/renderers/shaders/ShaderLib/meshtoon.glsl.js +0 -1
  220. package/src/renderers/shaders/ShaderLib/shadow.glsl.js +0 -1
  221. package/src/renderers/shaders/ShaderLib/vsm.glsl.js +4 -6
  222. package/src/renderers/shaders/ShaderLib.js +3 -3
  223. package/src/renderers/webgl/WebGLCapabilities.js +3 -4
  224. package/src/renderers/webgl/WebGLLights.js +18 -1
  225. package/src/renderers/webgl/WebGLOutput.js +267 -0
  226. package/src/renderers/webgl/WebGLProgram.js +43 -107
  227. package/src/renderers/webgl/WebGLPrograms.js +35 -45
  228. package/src/renderers/webgl/WebGLShadowMap.js +188 -25
  229. package/src/renderers/webgl/WebGLState.js +20 -20
  230. package/src/renderers/webgl/WebGLTextures.js +89 -28
  231. package/src/renderers/webgl/WebGLUniforms.js +40 -3
  232. package/src/renderers/webgl/WebGLUtils.js +6 -2
  233. package/src/renderers/webgl-fallback/WebGLBackend.js +79 -13
  234. package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +59 -7
  235. package/src/renderers/webgl-fallback/utils/WebGLState.js +18 -3
  236. package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +5 -3
  237. package/src/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.js +9 -9
  238. package/src/renderers/webgl-fallback/utils/WebGLUtils.js +6 -2
  239. package/src/renderers/webgpu/WebGPUBackend.js +61 -4
  240. package/src/renderers/webgpu/WebGPURenderer.js +1 -1
  241. package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +65 -23
  242. package/src/renderers/webgpu/utils/WebGPUAttributeUtils.js +4 -17
  243. package/src/renderers/webgpu/utils/WebGPUBindingUtils.js +354 -186
  244. package/src/renderers/webgpu/utils/WebGPUConstants.js +2 -0
  245. package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +20 -7
  246. package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +40 -17
  247. package/src/renderers/webgpu/utils/WebGPUTimestampQueryPool.js +7 -7
  248. package/src/renderers/webgpu/utils/WebGPUUtils.js +7 -5
  249. package/src/textures/CubeDepthTexture.js +76 -0
  250. package/src/textures/Source.js +1 -1
  251. package/src/textures/Texture.js +1 -1
  252. package/src/utils.js +13 -1
  253. package/src/nodes/functions/BSDF/DFGApprox.js +0 -71
@@ -1,6 +1,31 @@
1
+ /**
2
+ * Tab class
3
+ * @param {string} title - The title of the tab
4
+ * @param {Object} options - Options for the tab
5
+ * @param {boolean} [options.allowDetach=true] - Whether the tab can be detached into a separate window
6
+ * @param {boolean} [options.builtin=false] - Whether the tab should appear in the profiler-toggle button
7
+ * @param {string} [options.icon] - SVG icon HTML for the builtin button
8
+ *
9
+ * @example
10
+ * // Create a tab that can be detached (default behavior)
11
+ * const tab1 = new Tab('My Tab');
12
+ *
13
+ * // Create a tab that cannot be detached
14
+ * const tab2 = new Tab('Fixed Tab', { allowDetach: false });
15
+ *
16
+ * // Create a builtin tab that appears in the profiler-toggle
17
+ * const tab3 = new Tab('Builtin Tab', { builtin: true });
18
+ *
19
+ * // Create a builtin tab with custom icon
20
+ * const tab4 = new Tab('Settings', { builtin: true, icon: '<svg>...</svg>' });
21
+ *
22
+ * // Control builtin tab visibility
23
+ * tab3.showBuiltin(); // Show the builtin button and mini-content
24
+ * tab3.hideBuiltin(); // Hide the builtin button and mini-content
25
+ */
1
26
  export class Tab {
2
27
 
3
- constructor( title ) {
28
+ constructor( title, options = {} ) {
4
29
 
5
30
  this.id = title.toLowerCase();
6
31
  this.button = document.createElement( 'button' );
@@ -13,6 +38,15 @@ export class Tab {
13
38
 
14
39
  this.isActive = false;
15
40
  this.isVisible = true;
41
+ this.isDetached = false;
42
+ this.detachedWindow = null;
43
+ this.allowDetach = options.allowDetach !== undefined ? options.allowDetach : true;
44
+ this.builtin = options.builtin !== undefined ? options.builtin : false;
45
+ this.icon = options.icon || null;
46
+ this.builtinButton = null; // Reference to the builtin button in profiler-toggle
47
+ this.miniContent = null; // Reference to the mini-panel content container
48
+ this.profiler = null; // Reference to the profiler instance
49
+ this.onVisibilityChange = null; // Callback for visibility changes
16
50
 
17
51
  }
18
52
 
@@ -32,6 +66,22 @@ export class Tab {
32
66
 
33
67
  this.isVisible = true;
34
68
 
69
+ // Show detached window if tab is detached
70
+ if ( this.isDetached && this.detachedWindow ) {
71
+
72
+ this.detachedWindow.panel.style.display = '';
73
+
74
+ }
75
+
76
+ // Notify profiler of visibility change
77
+ if ( this.onVisibilityChange ) {
78
+
79
+ this.onVisibilityChange();
80
+
81
+ }
82
+
83
+ this.showBuiltin();
84
+
35
85
  }
36
86
 
37
87
  hide() {
@@ -41,6 +91,143 @@ export class Tab {
41
91
 
42
92
  this.isVisible = false;
43
93
 
94
+ // Hide detached window if tab is detached
95
+ if ( this.isDetached && this.detachedWindow ) {
96
+
97
+ this.detachedWindow.panel.style.display = 'none';
98
+
99
+ }
100
+
101
+ // Notify profiler of visibility change
102
+ if ( this.onVisibilityChange ) {
103
+
104
+ this.onVisibilityChange();
105
+
106
+ }
107
+
108
+ this.hideBuiltin();
109
+
110
+ }
111
+
112
+ showBuiltin() {
113
+
114
+ if ( ! this.builtin ) return;
115
+
116
+ // Show the builtin-tabs-container
117
+ if ( this.profiler && this.profiler.builtinTabsContainer ) {
118
+
119
+ this.profiler.builtinTabsContainer.style.display = '';
120
+
121
+ }
122
+
123
+ // Show the button
124
+ if ( this.builtinButton ) {
125
+
126
+ this.builtinButton.style.display = '';
127
+
128
+ }
129
+
130
+ // Show and activate the mini-panel with content
131
+ if ( this.miniContent && this.profiler ) {
132
+
133
+ // Hide all other mini-panel contents
134
+ this.profiler.miniPanel.querySelectorAll( '.mini-panel-content' ).forEach( content => {
135
+
136
+ content.style.display = 'none';
137
+
138
+ } );
139
+
140
+ // Remove active state from all builtin buttons
141
+ this.profiler.builtinTabsContainer.querySelectorAll( '.builtin-tab-btn' ).forEach( btn => {
142
+
143
+ btn.classList.remove( 'active' );
144
+
145
+ } );
146
+
147
+ // Activate this tab's button
148
+ if ( this.builtinButton ) {
149
+
150
+ this.builtinButton.classList.add( 'active' );
151
+
152
+ }
153
+
154
+ // Move content to mini-panel if not already there
155
+ if ( ! this.miniContent.firstChild ) {
156
+
157
+ const actualContent = this.content.querySelector( '.list-scroll-wrapper' ) || this.content.firstElementChild;
158
+
159
+ if ( actualContent ) {
160
+
161
+ this.miniContent.appendChild( actualContent );
162
+
163
+ }
164
+
165
+ }
166
+
167
+ // Show the mini-panel and content
168
+ this.miniContent.style.display = 'block';
169
+ this.profiler.miniPanel.classList.add( 'visible' );
170
+
171
+ }
172
+
173
+ }
174
+
175
+ hideBuiltin() {
176
+
177
+ if ( ! this.builtin ) return;
178
+
179
+ // Hide the button
180
+ if ( this.builtinButton ) {
181
+
182
+ this.builtinButton.style.display = 'none';
183
+
184
+ }
185
+
186
+ // Hide the mini-panel content
187
+ if ( this.miniContent ) {
188
+
189
+ this.miniContent.style.display = 'none';
190
+
191
+ // Move content back to main panel
192
+ if ( this.miniContent.firstChild ) {
193
+
194
+ this.content.appendChild( this.miniContent.firstChild );
195
+
196
+ }
197
+
198
+ }
199
+
200
+ // Deactivate button
201
+ if ( this.builtinButton ) {
202
+
203
+ this.builtinButton.classList.remove( 'active' );
204
+
205
+ }
206
+
207
+ // Hide mini-panel if no content is visible
208
+ if ( this.profiler ) {
209
+
210
+ const hasVisibleContent = Array.from( this.profiler.miniPanel.querySelectorAll( '.mini-panel-content' ) )
211
+ .some( content => content.style.display !== 'none' );
212
+
213
+ if ( ! hasVisibleContent ) {
214
+
215
+ this.profiler.miniPanel.classList.remove( 'visible' );
216
+
217
+ }
218
+
219
+ // Hide the builtin-tabs-container if all builtin buttons are hidden
220
+ const hasVisibleBuiltinButtons = Array.from( this.profiler.builtinTabsContainer.querySelectorAll( '.builtin-tab-btn' ) )
221
+ .some( btn => btn.style.display !== 'none' );
222
+
223
+ if ( ! hasVisibleBuiltinButtons ) {
224
+
225
+ this.profiler.builtinTabsContainer.style.display = 'none';
226
+
227
+ }
228
+
229
+ }
230
+
44
231
  }
45
232
 
46
233
  }
@@ -157,6 +157,14 @@ class ValueNumber extends Value {
157
157
 
158
158
  }
159
159
 
160
+ setValue( val ) {
161
+
162
+ this.input.value = val;
163
+
164
+ return super.setValue( val );
165
+
166
+ }
167
+
160
168
  getValue() {
161
169
 
162
170
  return parseFloat( this.input.value );
@@ -194,6 +202,14 @@ class ValueCheckbox extends Value {
194
202
 
195
203
  }
196
204
 
205
+ setValue( val ) {
206
+
207
+ this.checkbox.value = val;
208
+
209
+ return super.setValue( val );
210
+
211
+ }
212
+
197
213
  getValue() {
198
214
 
199
215
  return this.checkbox.checked;
@@ -216,7 +232,7 @@ class ValueSlider extends Value {
216
232
 
217
233
  const numberValue = new ValueNumber( { value, min, max, step } );
218
234
  this.numberInput = numberValue.input;
219
- this.numberInput.style.width = '60px';
235
+ this.numberInput.style.flexBasis = '80px';
220
236
  this.numberInput.style.flexShrink = '0';
221
237
 
222
238
  this.slider.value = value;
@@ -23,7 +23,8 @@ import {
23
23
  SpotLight,
24
24
  Sprite,
25
25
  SpriteMaterial,
26
- TextureLoader
26
+ TextureLoader,
27
+ EquirectangularReflectionMapping
27
28
  } from 'three';
28
29
 
29
30
  import { EXRLoader } from '../loaders/EXRLoader.js';
@@ -507,7 +508,7 @@ class Rhino3dmLoader extends Loader {
507
508
 
508
509
  new EXRLoader().load( renderEnvironment.image, function ( texture ) {
509
510
 
510
- texture.mapping = THREE.EquirectangularReflectionMapping;
511
+ texture.mapping = EquirectangularReflectionMapping;
511
512
  mat.envMap = texture;
512
513
 
513
514
  } );
@@ -697,7 +698,7 @@ class Rhino3dmLoader extends Loader {
697
698
 
698
699
  geometry = loader.parse( obj.geometry );
699
700
 
700
- if ( geometry.attributes.hasOwnProperty( 'color' ) ) {
701
+ if ( geometry.hasAttribute( 'color' ) ) {
701
702
 
702
703
  material = new PointsMaterial( { vertexColors: true, sizeAttenuation: false, size: 2 } );
703
704
 
@@ -740,7 +741,7 @@ class Rhino3dmLoader extends Loader {
740
741
  }
741
742
 
742
743
 
743
- if ( geometry.attributes.hasOwnProperty( 'color' ) ) {
744
+ if ( geometry.hasAttribute( 'color' ) ) {
744
745
 
745
746
  mat.vertexColors = true;
746
747
 
@@ -667,7 +667,7 @@ function DRACOWorker() {
667
667
  const srcByteStride = itemSize * TypedArray.BYTES_PER_ELEMENT;
668
668
  const dstByteStride = Math.ceil( srcByteStride / 4 ) * 4;
669
669
 
670
- const dstStride = dstByteStride / TypedArray.BYTES_PER_ELEMENT
670
+ const dstStride = dstByteStride / TypedArray.BYTES_PER_ELEMENT;
671
671
 
672
672
  const srcByteLength = count * srcByteStride;
673
673
  const dstByteLength = count * dstByteStride;
@@ -690,13 +690,13 @@ function DRACOWorker() {
690
690
 
691
691
  dstArray = new TypedArray( dstByteLength / TypedArray.BYTES_PER_ELEMENT );
692
692
 
693
- let dstOffset = 0
693
+ let dstOffset = 0;
694
694
 
695
- for ( let i = 0, il = srcArray.length; i < il; i++ ) {
695
+ for ( let i = 0, il = srcArray.length; i < il; i ++ ) {
696
696
 
697
- for ( let j = 0; j < itemSize; j++ ) {
697
+ for ( let j = 0; j < itemSize; j ++ ) {
698
698
 
699
- dstArray[ dstOffset + j ] = srcArray[ i * itemSize + j ]
699
+ dstArray[ dstOffset + j ] = srcArray[ i * itemSize + j ];
700
700
 
701
701
  }
702
702
 
@@ -1615,11 +1615,9 @@ class GeometryParser {
1615
1615
 
1616
1616
  case 'Mesh':
1617
1617
  return this.parseMeshGeometry( relationships, geoNode, deformers );
1618
- break;
1619
1618
 
1620
1619
  case 'NurbsCurve':
1621
1620
  return this.parseNurbsGeometry( geoNode );
1622
- break;
1623
1621
 
1624
1622
  }
1625
1623
 
@@ -424,7 +424,6 @@ class HDRLoader extends DataTextureLoader {
424
424
  default:
425
425
 
426
426
  throw new Error( 'THREE.HDRLoader: Unsupported type: ' + this.type );
427
- break;
428
427
 
429
428
  }
430
429
 
@@ -20,6 +20,10 @@ import {
20
20
  RGBA_BPTC_Format,
21
21
  RGBA_S3TC_DXT3_Format,
22
22
  RGBA_ETC2_EAC_Format,
23
+ R11_EAC_Format,
24
+ SIGNED_R11_EAC_Format,
25
+ RG11_EAC_Format,
26
+ SIGNED_RG11_EAC_Format,
23
27
  RGBA_PVRTC_4BPPV1_Format,
24
28
  RGBA_PVRTC_2BPPV1_Format,
25
29
  RGBA_S3TC_DXT1_Format,
@@ -71,6 +75,10 @@ import {
71
75
  VK_FORMAT_BC7_UNORM_BLOCK,
72
76
  VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK,
73
77
  VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK,
78
+ VK_FORMAT_EAC_R11_UNORM_BLOCK,
79
+ VK_FORMAT_EAC_R11_SNORM_BLOCK,
80
+ VK_FORMAT_EAC_R11G11_UNORM_BLOCK,
81
+ VK_FORMAT_EAC_R11G11_SNORM_BLOCK,
74
82
  VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG,
75
83
  VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG,
76
84
  VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG,
@@ -968,6 +976,10 @@ const FORMAT_MAP = {
968
976
 
969
977
  [ VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK ]: RGBA_ETC2_EAC_Format,
970
978
  [ VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK ]: RGB_ETC2_Format,
979
+ [ VK_FORMAT_EAC_R11_UNORM_BLOCK ]: R11_EAC_Format,
980
+ [ VK_FORMAT_EAC_R11_SNORM_BLOCK ]: SIGNED_R11_EAC_Format,
981
+ [ VK_FORMAT_EAC_R11G11_UNORM_BLOCK ]: RG11_EAC_Format,
982
+ [ VK_FORMAT_EAC_R11G11_SNORM_BLOCK ]: SIGNED_RG11_EAC_Format,
971
983
 
972
984
  [ VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT ]: RGBA_ASTC_4x4_Format,
973
985
  [ VK_FORMAT_ASTC_4x4_SRGB_BLOCK ]: RGBA_ASTC_4x4_Format,
@@ -1022,6 +1034,10 @@ const TYPE_MAP = {
1022
1034
 
1023
1035
  [ VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK ]: UnsignedByteType,
1024
1036
  [ VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK ]: UnsignedByteType,
1037
+ [ VK_FORMAT_EAC_R11_UNORM_BLOCK ]: UnsignedByteType,
1038
+ [ VK_FORMAT_EAC_R11_UNORM_BLOCK ]: UnsignedByteType,
1039
+ [ VK_FORMAT_EAC_R11G11_UNORM_BLOCK ]: UnsignedByteType,
1040
+ [ VK_FORMAT_EAC_R11G11_UNORM_BLOCK ]: UnsignedByteType,
1025
1041
 
1026
1042
  [ VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT ]: HalfFloatType,
1027
1043
  [ VK_FORMAT_ASTC_4x4_SRGB_BLOCK ]: UnsignedByteType,
@@ -1664,7 +1664,7 @@ function createObject( loader, elements, elementSize, isConditionalSegments = fa
1664
1664
 
1665
1665
  if ( numGroupVerts > 0 ) {
1666
1666
 
1667
- bufferGeometry.addGroup( index0, Infinity, materials.length - 1 );
1667
+ bufferGeometry.addGroup( index0, numGroupVerts, materials.length - 1 );
1668
1668
 
1669
1669
  }
1670
1670
 
@@ -1749,7 +1749,7 @@ function createObject( loader, elements, elementSize, isConditionalSegments = fa
1749
1749
  /**
1750
1750
  * A loader for the LDraw format.
1751
1751
  *
1752
- * [LDraw](https://ldraw.org/} (LEGO Draw) is an [open format specification]{@link https://ldraw.org/article/218.html)
1752
+ * [LDraw](https://ldraw.org/} (LEGO Draw) is an [open format specification](https://ldraw.org/article/218.html)
1753
1753
  * for describing LEGO and other construction set 3D models.
1754
1754
  *
1755
1755
  * An LDraw asset (a text file usually with extension .ldr, .dat or .txt) can describe just a single construction
@@ -2400,7 +2400,6 @@ class LDrawLoader extends Loader {
2400
2400
 
2401
2401
  material.color.setStyle( fillColor, COLOR_SPACE_LDRAW );
2402
2402
  material.transparent = isTransparent;
2403
- material.premultipliedAlpha = true;
2404
2403
  material.opacity = alpha;
2405
2404
  material.depthWrite = ! isTransparent;
2406
2405
 
@@ -100,6 +100,7 @@ class PCDLoader extends Loader {
100
100
  /**
101
101
  * Get dataview value by field type and size.
102
102
  *
103
+ * @private
103
104
  * @param {DataView} dataview - The DataView to read from.
104
105
  * @param {number} offset - The offset to start reading from.
105
106
  * @param {'F' | 'U' | 'I'} type - Field type.
@@ -1082,7 +1082,7 @@ class SVGLoader extends Loader {
1082
1082
  };
1083
1083
 
1084
1084
  if ( node.hasAttribute( svgName ) ) style[ jsName ] = adjustFunction( node.getAttribute( svgName ) );
1085
- if ( stylesheetStyles[ svgName ] ) style[ jsName ] = adjustFunction( stylesheetStyles[ svgName ] );
1085
+ if ( stylesheetStyles[ jsName ] ) style[ jsName ] = adjustFunction( stylesheetStyles[ jsName ] );
1086
1086
  if ( node.style && node.style[ svgName ] !== '' ) style[ jsName ] = adjustFunction( node.style[ svgName ] );
1087
1087
 
1088
1088
  }
@@ -684,11 +684,9 @@ class TDSLoader extends Loader {
684
684
 
685
685
  case INT_PERCENTAGE:
686
686
  return ( subChunk.readShort( ) / 100 );
687
- break;
688
687
 
689
688
  case FLOAT_PERCENTAGE:
690
689
  return subChunk.readFloat( );
691
- break;
692
690
 
693
691
  default:
694
692
  this.debugMessage( ' Unknown percentage chunk: ' + subChunk.hexId );
@@ -389,7 +389,6 @@ class TGALoader extends DataTextureLoader {
389
389
 
390
390
  default:
391
391
  throw new Error( 'THREE.TGALoader: Format not supported.' );
392
- break;
393
392
 
394
393
  }
395
394
 
@@ -415,7 +414,6 @@ class TGALoader extends DataTextureLoader {
415
414
 
416
415
  default:
417
416
  throw new Error( 'THREE.TGALoader: Format not supported.' );
418
- break;
419
417
 
420
418
  }
421
419