@null3d/engine 0.0.0 → 0.1.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 (311) hide show
  1. package/README.md +109 -0
  2. package/THIRD-PARTY-NOTICES.txt +0 -1
  3. package/dist/wasm/single/null3d.js +19 -6
  4. package/dist/wasm/single/null3d_bg.wasm +0 -0
  5. package/dist/wasm/threaded/null3d.js +19 -6
  6. package/dist/wasm/threaded/null3d_bg.wasm +0 -0
  7. package/docs/api/animation.md +23 -67
  8. package/docs/api/assets.md +42 -26
  9. package/docs/api/cameras.md +8 -6
  10. package/docs/api/controls.md +46 -44
  11. package/docs/api/debug.md +13 -8
  12. package/docs/api/engine.md +17 -11
  13. package/docs/api/feature-draws.md +3 -3
  14. package/docs/api/feature-effects.md +3 -3
  15. package/docs/api/feature-instances.md +2 -2
  16. package/docs/api/features.md +14 -15
  17. package/docs/api/geometry.md +56 -75
  18. package/docs/api/grass.md +1 -1
  19. package/docs/api/impostors.md +120 -9
  20. package/docs/api/input.md +4 -11
  21. package/docs/api/lights.md +14 -38
  22. package/docs/api/lines.md +8 -25
  23. package/docs/api/materials.md +69 -70
  24. package/docs/api/math.md +6 -7
  25. package/docs/api/objects.md +13 -13
  26. package/docs/api/particles.md +2 -14
  27. package/docs/api/points.md +3 -25
  28. package/docs/api/post.md +22 -23
  29. package/docs/api/quality.md +11 -6
  30. package/docs/api/raycast.md +13 -32
  31. package/docs/api/reference/animation.md +9 -9
  32. package/docs/api/reference/assets.md +18 -18
  33. package/docs/api/reference/cameras.md +5 -2
  34. package/docs/api/reference/controls.md +75 -23
  35. package/docs/api/reference/debug.md +23 -8
  36. package/docs/api/reference/engine.md +22 -10
  37. package/docs/api/reference/geometry.md +161 -82
  38. package/docs/api/reference/grass.md +1 -1
  39. package/docs/api/reference/impostors.md +92 -1
  40. package/docs/api/reference/input.md +3 -3
  41. package/docs/api/reference/lights.md +9 -9
  42. package/docs/api/reference/lines.md +7 -7
  43. package/docs/api/reference/materials.md +48 -48
  44. package/docs/api/reference/math.md +22 -22
  45. package/docs/api/reference/objects.md +9 -9
  46. package/docs/api/reference/points.md +4 -4
  47. package/docs/api/reference/post.md +18 -18
  48. package/docs/api/reference/quality.md +7 -3
  49. package/docs/api/reference/raycast.md +6 -6
  50. package/docs/api/reference/render.md +2 -2
  51. package/docs/api/reference/scene.md +29 -26
  52. package/docs/api/reference/sketch.md +4 -0
  53. package/docs/api/reference/sound.md +203 -0
  54. package/docs/api/reference/sprites.md +5 -5
  55. package/docs/api/reference/terrain.md +2 -1
  56. package/docs/api/reference/textures.md +4 -4
  57. package/docs/api/reference/ui.md +3 -3
  58. package/docs/api/reference/vertex-draws.md +3 -3
  59. package/docs/api/reference/water.md +77 -6
  60. package/docs/api/reference/wind.md +2 -2
  61. package/docs/api/render.md +12 -10
  62. package/docs/api/scene.md +40 -29
  63. package/docs/api/sketch.md +64 -3
  64. package/docs/api/sound.md +169 -0
  65. package/docs/api/splats.md +7 -0
  66. package/docs/api/sprites.md +4 -20
  67. package/docs/api/tasks.md +2 -2
  68. package/docs/api/terrain.md +2 -14
  69. package/docs/api/textures.md +9 -9
  70. package/docs/api/ui.md +3 -15
  71. package/docs/api/water.md +198 -15
  72. package/docs/api/wind.md +5 -5
  73. package/docs/cli/null3d.md +93 -18
  74. package/docs/concepts/architecture.md +10 -10
  75. package/docs/concepts/assets.md +2 -19
  76. package/docs/concepts/backends.md +7 -5
  77. package/docs/concepts/color-management.md +15 -26
  78. package/docs/concepts/culling.md +1 -1
  79. package/docs/concepts/instances.md +5 -5
  80. package/docs/concepts/large-worlds.md +1 -1
  81. package/docs/concepts/lighting.md +50 -55
  82. package/docs/concepts/lod.md +2 -15
  83. package/docs/concepts/materials.md +16 -16
  84. package/docs/concepts/post-processing.md +7 -29
  85. package/docs/concepts/quality-preset-tables.md +53 -50
  86. package/docs/concepts/quality-presets.md +56 -27
  87. package/docs/concepts/render-graph.md +19 -14
  88. package/docs/concepts/render-layers.md +3 -17
  89. package/docs/concepts/shadows.md +10 -28
  90. package/docs/concepts/static-dynamic.md +2 -2
  91. package/docs/cookbook/index.md +1 -1
  92. package/docs/data/threejs-mapping.json +136 -102
  93. package/docs/errors/E1214.md +3 -3
  94. package/docs/errors/E1307.md +23 -0
  95. package/docs/errors/E1420.md +3 -3
  96. package/docs/errors/index.md +3 -2
  97. package/docs/getting-started/cdn.md +17 -1
  98. package/docs/getting-started/first-scene.md +1 -1
  99. package/docs/getting-started/hosting.md +50 -9
  100. package/docs/getting-started/install.md +8 -7
  101. package/docs/getting-started/network-use.md +10 -2
  102. package/docs/getting-started/project-structure.md +15 -6
  103. package/docs/getting-started/third-party-notices.md +8 -6
  104. package/docs/guides/accessibility.md +1 -1
  105. package/docs/guides/add-ons.md +3 -2
  106. package/docs/guides/agents.md +16 -5
  107. package/docs/guides/assets-pipeline.md +13 -12
  108. package/docs/guides/audio.md +109 -124
  109. package/docs/guides/car-paint.md +1 -1
  110. package/docs/guides/content-pages.md +10 -6
  111. package/docs/guides/custom-passes.md +9 -8
  112. package/docs/guides/custom-shaders.md +6 -3
  113. package/docs/guides/debugging.md +78 -4
  114. package/docs/guides/deploying.md +105 -5
  115. package/docs/guides/deterministic-simulation.md +1 -1
  116. package/docs/guides/first-use-shaders.md +4 -4
  117. package/docs/guides/loading-screens.md +78 -33
  118. package/docs/guides/multiple-views.md +41 -2
  119. package/docs/guides/performance.md +6 -3
  120. package/docs/guides/phones.md +12 -1
  121. package/docs/guides/physics.md +1 -1
  122. package/docs/guides/screens.md +7 -5
  123. package/docs/guides/start-time.md +328 -0
  124. package/docs/guides/testing.md +23 -5
  125. package/docs/guides/ui-overlays.md +3 -3
  126. package/docs/index.md +12 -8
  127. package/docs/pages.md +26 -23
  128. package/docs/porting/react-three-fiber.md +228 -5
  129. package/docs/porting/threejs-loop-and-threads.md +220 -6
  130. package/docs/porting/threejs-mapping.md +86 -84
  131. package/docs/porting/threejs-materials.md +212 -5
  132. package/docs/porting/threejs-overview.md +218 -5
  133. package/docs/porting/threejs-postprocessing.md +2 -2
  134. package/docs/porting/threejs-shaders.md +298 -5
  135. package/docs/porting/threejs-unsupported.md +82 -6
  136. package/docs/porting/verification.md +181 -5
  137. package/docs/shaders/builtins.md +1 -1
  138. package/docs/shaders/library.md +63 -39
  139. package/docs/shaders/surface-functions.md +11 -10
  140. package/docs/shaders/wgsl-rules.md +1 -1
  141. package/lib/debug/channel.d.ts +103 -0
  142. package/lib/debug/channel.js +269 -0
  143. package/lib/debug/debug.d.ts +9 -7
  144. package/lib/debug/draw.d.ts +9 -0
  145. package/lib/debug/draw.js +49 -2
  146. package/lib/debug/inspector.d.ts +60 -0
  147. package/lib/debug/inspector.js +475 -0
  148. package/lib/debug/stats-panel.d.ts +1 -1
  149. package/lib/debug/stats.d.ts +2 -3
  150. package/lib/errors/codes.js +8 -2
  151. package/lib/errors/engine-error.js +25 -10
  152. package/lib/errors/fixes.d.ts +1 -0
  153. package/lib/errors/fixes.js +3 -2
  154. package/lib/generated/core.d.ts +1 -1
  155. package/lib/generated/core.js +1 -1
  156. package/lib/gpu/early-builds.d.ts +68 -0
  157. package/lib/gpu/early-builds.js +158 -0
  158. package/lib/gpu/pipeline-name.d.ts +6 -0
  159. package/lib/gpu/pipeline-name.js +23 -0
  160. package/lib/gpu/webgl2/backend.d.ts +63 -2
  161. package/lib/gpu/webgl2/backend.js +226 -8
  162. package/lib/gpu/webgl2/programs.d.ts +18 -0
  163. package/lib/gpu/webgl2/programs.js +4 -1
  164. package/lib/gpu/webgpu/backend.d.ts +89 -2
  165. package/lib/gpu/webgpu/backend.js +255 -8
  166. package/lib/gpu/webgpu/pipelines.d.ts +13 -0
  167. package/lib/gpu/webgpu/pipelines.js +15 -1
  168. package/lib/index.d.ts +6 -4
  169. package/lib/index.js +3 -2
  170. package/lib/math/color.d.ts +5 -5
  171. package/lib/math/color.js +5 -5
  172. package/lib/math/mat4.d.ts +6 -12
  173. package/lib/math/mat4.js +6 -12
  174. package/lib/math/namespaces/quat.d.ts +3 -3
  175. package/lib/math/namespaces/quat.js +3 -3
  176. package/lib/math/quat.d.ts +8 -12
  177. package/lib/math/quat.js +8 -12
  178. package/lib/math/random.d.ts +2 -3
  179. package/lib/math/random.js +2 -3
  180. package/lib/math/types.d.ts +4 -4
  181. package/lib/math/vec3.d.ts +3 -6
  182. package/lib/math/vec3.js +3 -6
  183. package/lib/page/capabilities.d.ts +7 -7
  184. package/lib/page/capabilities.js +39 -25
  185. package/lib/page/check-store.d.ts +14 -2
  186. package/lib/page/check-store.js +34 -11
  187. package/lib/page/engine.d.ts +103 -26
  188. package/lib/page/engine.js +420 -97
  189. package/lib/page/first-frame.d.ts +16 -0
  190. package/lib/page/first-frame.js +35 -0
  191. package/lib/page/frame-stats.d.ts +34 -1
  192. package/lib/page/frame-stats.js +15 -0
  193. package/lib/page/label-loop.d.ts +7 -3
  194. package/lib/page/label-loop.js +17 -10
  195. package/lib/page/labels.d.ts +3 -3
  196. package/lib/page/pipeline-store.d.ts +25 -0
  197. package/lib/page/pipeline-store.js +84 -0
  198. package/lib/page/start-marker.d.ts +4 -1
  199. package/lib/page/start-marker.js +5 -2
  200. package/lib/page/switches.d.ts +32 -2
  201. package/lib/page/switches.js +9 -1
  202. package/lib/quality/check.d.ts +24 -3
  203. package/lib/quality/check.js +21 -7
  204. package/lib/quality/chooser.d.ts +6 -0
  205. package/lib/quality/chooser.js +8 -0
  206. package/lib/quality/governor.d.ts +98 -6
  207. package/lib/quality/governor.js +250 -20
  208. package/lib/quality/preset-docs.d.ts +16 -1
  209. package/lib/quality/preset-docs.js +3 -0
  210. package/lib/quality/presets.d.ts +84 -7
  211. package/lib/quality/presets.js +94 -2
  212. package/lib/render/draw.d.ts +3 -2
  213. package/lib/render/draw.js +15 -5
  214. package/lib/render/load-draw.d.ts +7 -5
  215. package/lib/render/load-draw.js +7 -5
  216. package/lib/render/loss.d.ts +28 -10
  217. package/lib/render/loss.js +50 -22
  218. package/lib/render/recovery.d.ts +20 -0
  219. package/lib/render/recovery.js +44 -4
  220. package/lib/render/renderer.d.ts +85 -9
  221. package/lib/render/renderer.js +181 -42
  222. package/lib/render/scene-renderer.d.ts +19 -1
  223. package/lib/render/scene-renderer.js +25 -1
  224. package/lib/render/webgl2-renderers.js +8 -5
  225. package/lib/render/webgpu-renderers.js +5 -4
  226. package/lib/scene/animation.d.ts +28 -32
  227. package/lib/scene/animation.js +12 -15
  228. package/lib/scene/assets.d.ts +61 -86
  229. package/lib/scene/assets.js +103 -236
  230. package/lib/scene/background.d.ts +14 -18
  231. package/lib/scene/background.js +5 -2
  232. package/lib/scene/color.d.ts +3 -3
  233. package/lib/scene/downloads.d.ts +2 -0
  234. package/lib/scene/downloads.js +371 -0
  235. package/lib/scene/environment.d.ts +7 -7
  236. package/lib/scene/environment.js +1 -1
  237. package/lib/scene/fake-call-values.js +1 -1
  238. package/lib/scene/fog.d.ts +11 -4
  239. package/lib/scene/fog.js +8 -2
  240. package/lib/scene/frame-cameras.d.ts +19 -0
  241. package/lib/scene/frame-cameras.js +58 -0
  242. package/lib/scene/gltf.d.ts +32 -2
  243. package/lib/scene/gltf.js +78 -49
  244. package/lib/scene/grading.d.ts +2 -2
  245. package/lib/scene/grading.js +3 -3
  246. package/lib/scene/ktx2.d.ts +9 -1
  247. package/lib/scene/ktx2.js +3 -2
  248. package/lib/scene/level-rule.d.ts +120 -0
  249. package/lib/scene/level-rule.js +130 -0
  250. package/lib/scene/lines.d.ts +13 -17
  251. package/lib/scene/lines.js +3 -3
  252. package/lib/scene/lut.d.ts +1 -2
  253. package/lib/scene/lut.js +1 -2
  254. package/lib/scene/picks.d.ts +2 -2
  255. package/lib/scene/pointer-events.d.ts +4 -7
  256. package/lib/scene/post.d.ts +38 -43
  257. package/lib/scene/post.js +4 -1
  258. package/lib/scene/prefab.d.ts +7 -8
  259. package/lib/scene/prefab.js +7 -8
  260. package/lib/scene/property-animation.d.ts +1 -1
  261. package/lib/scene/property-animation.js +1 -1
  262. package/lib/scene/queries.d.ts +7 -13
  263. package/lib/scene/resources.d.ts +225 -254
  264. package/lib/scene/resources.js +179 -81
  265. package/lib/scene/scene.d.ts +149 -118
  266. package/lib/scene/scene.js +196 -98
  267. package/lib/scene/serial-loads.d.ts +29 -0
  268. package/lib/scene/serial-loads.js +68 -0
  269. package/lib/scene/shader-preloads.d.ts +34 -0
  270. package/lib/scene/shader-preloads.js +38 -0
  271. package/lib/scene/sprites.d.ts +14 -17
  272. package/lib/scene/sprites.js +5 -6
  273. package/lib/scene/textures.d.ts +11 -12
  274. package/lib/scene/textures.js +9 -10
  275. package/lib/scene/time-of-day.d.ts +3 -4
  276. package/lib/scene/time-of-day.js +2 -3
  277. package/lib/scene/vertex-draws.d.ts +5 -4
  278. package/lib/scene/vertex-draws.js +7 -5
  279. package/lib/shader-artifact.json +1 -0
  280. package/lib/shared/core.d.ts +5 -0
  281. package/lib/shared/core.js +1 -0
  282. package/lib/shared/import-once.d.ts +6 -0
  283. package/lib/shared/import-once.js +19 -0
  284. package/lib/shared/metrics.d.ts +38 -0
  285. package/lib/shared/metrics.js +62 -1
  286. package/lib/shared/run-task.js +7 -1
  287. package/lib/shared/task-pending.d.ts +12 -0
  288. package/lib/shared/task-pending.js +61 -1
  289. package/lib/shared/tasks.js +79 -32
  290. package/lib/shared/version.d.ts +17 -1
  291. package/lib/shared/version.js +19 -1
  292. package/lib/shared/wasm.d.ts +12 -4
  293. package/lib/shared/wasm.js +50 -27
  294. package/lib/shared/worker-start.d.ts +7 -0
  295. package/lib/shared/worker-start.js +27 -0
  296. package/lib/sketch/define-sketch.d.ts +35 -0
  297. package/lib/sketch/input.d.ts +2 -2
  298. package/lib/sketch/preset-check.d.ts +20 -6
  299. package/lib/sketch/preset-check.js +42 -17
  300. package/lib/sketch/quality.d.ts +69 -11
  301. package/lib/sketch/quality.js +54 -13
  302. package/lib/sketch/runner.d.ts +76 -9
  303. package/lib/sketch/runner.js +385 -52
  304. package/lib/sketch/ui.d.ts +5 -8
  305. package/lib/workers/probe-worker.d.ts +5 -0
  306. package/lib/workers/probe-worker.js +13 -4
  307. package/lib/workers/protocol.d.ts +61 -13
  308. package/lib/workers/protocol.js +4 -0
  309. package/lib/workers/render-worker.js +25 -4
  310. package/lib/workers/sketch-worker.js +104 -15
  311. package/package.json +2 -2
@@ -73,8 +73,8 @@ export interface MeshLevelOptions {
73
73
  /**
74
74
  * The vertical field of view, in degrees, that checks the order of the levels when the mesh
75
75
  * takes them. Each frame compares a level's error or coverage with the field of view of the
76
- * view that draws it, so this option moves no switch. The default is 50, three.js's default
77
- * for a perspective camera.
76
+ * view that draws it, so this option moves no switch. The default is 50, a perspective
77
+ * camera's default.
78
78
  */
79
79
  fov?: number;
80
80
  }
@@ -131,8 +131,8 @@ export declare class MeshGeometry {
131
131
  /** How many morph targets the mesh has. 0 for a mesh without any. */
132
132
  readonly morphTargets: number;
133
133
  /**
134
- * The morph targets' names, by target, or none when the mesh's arrays named none. Like
135
- * three.js's `morphTargetDictionary`, turned around. `mesh.setMorphWeight` takes a name too.
134
+ * The morph targets' names, in target order, or none when the mesh's arrays named none.
135
+ * `mesh.setMorphWeight` takes a name too.
136
136
  */
137
137
  readonly morphTargetNames: readonly string[];
138
138
  /** The geometry that made the mesh, whose scene says which objects use it. */
@@ -185,26 +185,24 @@ export declare class MeshGeometry {
185
185
  get center(): readonly [number, number, number];
186
186
  private boundsCenter;
187
187
  /**
188
- * Destroys the mesh, like three.js's `geometry.dispose()`. The engine frees its GPU memory and
189
- * its other data at once, and later meshes take its room. Destroy the objects and instance
190
- * batches that use it first, in the same frame or before. Its lower levels go with it, since a
191
- * level draws its base's vertices. Throws E1111 while one
192
- * still uses it, and E1101 for a mesh that is destroyed already. Later calls that pass the mesh
193
- * throw E1101.
188
+ * Destroys the mesh. The engine frees its GPU memory and its other data at once, and later
189
+ * meshes take its room. Destroy the objects and instance batches that use it first, in the same
190
+ * frame or before. Its lower levels go with it, since a level draws its base's vertices. Throws
191
+ * E1111 while one still uses it, and E1101 for a mesh that is destroyed already. Later calls
192
+ * that pass the mesh throw E1101.
194
193
  */
195
194
  destroy(): void;
196
195
  /**
197
- * Writes new values into one attribute of the mesh's vertices, like setting three.js's
198
- * `attribute.needsUpdate` after a change. `values` holds the attribute's values of every
199
- * vertex, in the array type the mesh was made with, as `geometry.fromArrays` takes them. Only
200
- * vertices `start` to `start + count - 1` change, which the next frame uploads. The defaults
201
- * update every vertex. Colors take three or four values per vertex: three keep each vertex's
202
- * alpha. The mesh keeps the bounding sphere it was made with, so give objects that draw
196
+ * Writes new values into one attribute of the mesh's vertices. `values` holds the attribute's
197
+ * values of every vertex, in the array type the mesh was made with, as `geometry.fromArrays`
198
+ * takes them. Only vertices `start` to `start + count - 1` change, which the next frame uploads.
199
+ * The defaults update every vertex. Colors take three or four values per vertex: three keep each
200
+ * vertex's alpha. The mesh keeps the bounding sphere it was made with, so give objects that draw
203
201
  * vertices outside it bounds with `setBounds`. The four-number vertex record takes updates as
204
202
  * `targets`. Joints, weights, and a mesh with joints or morph targets take no updates. A level
205
- * that draws its base mesh's vertices writes them, so the base and every level of it draw the
206
- * new values. The levels that `buildLevels` or the automatic default planned measured the old
207
- * shape, so the first update takes them away, and the mesh plans no automatic levels again;
203
+ * that draws its base mesh's vertices writes them, so the base and every level of it draw the new
204
+ * values. The levels that `buildLevels` or the automatic default planned measured the old shape,
205
+ * so the first update takes them away, and the mesh plans no automatic levels again;
208
206
  * `buildLevels` plans them for the new shape. Throws E1206 for values that do not fit the mesh,
209
207
  * and E1101 for a destroyed mesh. Allocates nothing, so a call in every frame makes no garbage.
210
208
  */
@@ -215,19 +213,19 @@ export declare class MeshGeometry {
215
213
  */
216
214
  get levels(): readonly MeshLevel[];
217
215
  /**
218
- * Gives the mesh lower levels of detail, from the most detailed down, like three.js's
219
- * `LOD.addLevel`. A mesh takes at most 15 lower levels. Every object and instance batch that
220
- * draws the mesh then picks one level per frame. It draws the coarsest level whose error covers
221
- * fewer pixels on the screen than the `lodThreshold` quality setting. A level may name a material of its own, so a far level shades
222
- * more cheaply; a level without one draws with the level before's material. A bound that
223
- * covers fewer pixels than the threshold draws nothing, so the mesh's last level holds no
224
- * geometry. The shadow maps pick their own levels, by each map's texel size, so a caster's
225
- * shadow shows the detail that the map can hold. An empty list takes the levels away.
226
- * Morphed objects, and materials that blend or let light through, draw the base mesh. A
227
- * skinned object draws a level while the level names the base mesh's own vertices.
228
- * Destroying a level's mesh takes every level away. Levels set here win over the ones that
229
- * `buildLevels` or the automatic default plans: a plan that runs ends, and the planned levels
230
- * go. Throws E1221 for levels the mesh cannot take, and E1101 for a destroyed mesh.
216
+ * Gives the mesh lower levels of detail, from the most detailed down. A mesh takes at most 15
217
+ * lower levels. Every object and instance batch that draws the mesh then picks one level per
218
+ * frame. It draws the coarsest level whose error covers fewer pixels on the screen than the
219
+ * `lodThreshold` quality setting. A level may name a material of its own, so a far level shades
220
+ * more cheaply; a level without one draws with the level before's material. A bound that covers
221
+ * fewer pixels than the threshold draws nothing, so the mesh's last level holds no geometry. The
222
+ * shadow maps pick their own levels, by each map's texel size, so a caster's shadow shows the
223
+ * detail that the map can hold. An empty list takes the levels away. Morphed objects, and
224
+ * materials that blend or let light through, draw the base mesh. A skinned object draws a level
225
+ * while the level names the base mesh's own vertices. Destroying a level's mesh takes every level
226
+ * away. Levels set here win over the ones that `buildLevels` or the automatic default plans: a
227
+ * plan that runs ends, and the planned levels go. Throws E1221 for levels the mesh cannot take,
228
+ * and E1101 for a destroyed mesh.
231
229
  */
232
230
  setLevels(levels: readonly MeshLevel[], options?: MeshLevelOptions): void;
233
231
  /**
@@ -531,9 +529,9 @@ export type UpdatableAttribute = 'positions' | 'normals' | 'uvs' | 'uvs1' | 'col
531
529
  */
532
530
  export type IntegerArray = Int8Array | Uint8Array | Int16Array | Uint16Array;
533
531
  /**
534
- * One attribute's numbers with a note on how its integers read, like three.js's `BufferAttribute`,
535
- * whose `array` and `normalized` fields it shares. Normalized integers read as fractions: from 0
536
- * to 1 when unsigned, and from -1 to 1 when signed. Plain integers read as whole numbers.
532
+ * One attribute's numbers with a note on how its integers read. Normalized integers read as
533
+ * fractions: from 0 to 1 when unsigned, and from -1 to 1 when signed. Plain integers read as whole
534
+ * numbers.
537
535
  *
538
536
  * @category api/geometry
539
537
  */
@@ -541,9 +539,9 @@ export interface VertexArray {
541
539
  /** The numbers, as `MeshArrays` takes them. */
542
540
  array: Float32Array | IntegerArray | readonly number[];
543
541
  /**
544
- * True when the integers are normalized. The default is false, as in three.js and glTF. It
545
- * applies to positions and texture coordinates. The other attributes read integers one way
546
- * only, so they refuse a value that says otherwise.
542
+ * True when the integers are normalized. The default is false, as in glTF. It applies to
543
+ * positions and texture coordinates. The other attributes read integers one way only, so they
544
+ * refuse a value that says otherwise.
547
545
  */
548
546
  normalized?: boolean;
549
547
  }
@@ -556,29 +554,28 @@ export interface VertexArray {
556
554
  */
557
555
  export type VertexValues = Float32Array | IntegerArray | readonly number[] | VertexArray;
558
556
  /**
559
- * A mesh's morph targets, like three.js's `morphAttributes` with `morphTargetsRelative` set, as
560
- * glTF stores them. Each list holds one array per target, of three numbers per vertex, or for
561
- * colors as many as the mesh's `colors` hold. They say how far the target moves the vertex's
562
- * position, normal, tangent or color at weight 1. Every list has the same number of targets, from
563
- * 1 to 256. A mesh's targets move its vertices by their weights, which each object sets with
564
- * `setMorphWeight`, and clips animate.
557
+ * A mesh's morph targets, as glTF stores them. Each list holds one array per target, of three
558
+ * numbers per vertex, or for colors as many as the mesh's `colors` hold. They say how far the
559
+ * target moves the vertex's position, normal, tangent or color at weight 1. Every list has the same
560
+ * number of targets, from 1 to 256. A mesh's targets move its vertices by their weights, which each
561
+ * object sets with `setMorphWeight`, and clips animate.
565
562
  *
566
563
  * @category api/geometry
567
564
  */
568
565
  export interface MorphTargets {
569
- /** For each target, how far it moves each position. Like `morphAttributes.position`. */
566
+ /** For each target, how far it moves each position. */
570
567
  positions?: readonly (Float32Array | readonly number[])[];
571
- /** For each target, how far it turns each normal. Like `morphAttributes.normal`. */
568
+ /** For each target, how far it turns each normal. */
572
569
  normals?: readonly (Float32Array | readonly number[])[];
573
570
  /**
574
- * For each target, how far it turns each tangent's direction: three numbers per vertex, as
575
- * glTF gives them. three.js does not morph tangents.
571
+ * For each target, how far it turns each tangent's direction: three numbers per vertex, as glTF
572
+ * gives them.
576
573
  */
577
574
  tangents?: readonly (Float32Array | readonly number[])[];
578
575
  /**
579
576
  * For each target, how far it changes each vertex color: three or four numbers per vertex, as
580
- * many as the mesh's `colors` hold, in linear color. Like `morphAttributes.color`. A morphed
581
- * color is clamped to the range 0 to 1, as the glTF specification asks. Needs `colors`.
577
+ * many as the mesh's `colors` hold, in linear color. A morphed color is clamped to the range 0 to
578
+ * 1, as the glTF specification asks. Needs `colors`.
582
579
  */
583
580
  colors?: readonly (Float32Array | readonly number[])[];
584
581
  /** The targets' names, one per target, which `setMorphWeight` takes in place of numbers. */
@@ -586,8 +583,7 @@ export interface MorphTargets {
586
583
  }
587
584
  /**
588
585
  * The arrays of a mesh for `geometry.fromArrays`. Each array holds its values for vertex 0, then
589
- * vertex 1, and so on, as three.js's `BufferGeometry` keeps its attributes. The engine copies
590
- * them.
586
+ * vertex 1, and so on. The engine copies them.
591
587
  *
592
588
  * An attribute can come as 32-bit floats, or as the 8-bit and 16-bit integers that glTF's
593
589
  * `KHR_mesh_quantization` allows for it. The mesh keeps that type on the GPU. Smaller types take
@@ -599,48 +595,44 @@ export interface MorphTargets {
599
595
  */
600
596
  export interface MeshArrays {
601
597
  /**
602
- * Three numbers per vertex: x, y and z. Like three.js's `position` attribute. Takes floats,
603
- * or 8-bit or 16-bit integers, normalized or plain.
598
+ * Three numbers per vertex: x, y and z. Takes floats, or 8-bit or 16-bit integers, normalized or
599
+ * plain.
604
600
  */
605
601
  positions: VertexValues;
606
602
  /**
607
- * Three numbers per vertex: a direction of length 1 away from the surface. Like three.js's
608
- * `normal` attribute. Pass normals, or set `computeNormals` instead. Takes floats, or an
609
- * `Int8Array` or `Int16Array`, whose integers read as fractions from -1 to 1.
603
+ * Three numbers per vertex: a direction of length 1 away from the surface. Pass normals, or set
604
+ * `computeNormals` instead. Takes floats, or an `Int8Array` or `Int16Array`, whose integers read
605
+ * as fractions from -1 to 1.
610
606
  */
611
607
  normals?: VertexValues;
612
608
  /**
613
- * Texture coordinates: two numbers per vertex, u and v. Like three.js's `uv` attribute. Takes
614
- * floats, or 8-bit or 16-bit integers, normalized or plain.
609
+ * Texture coordinates: two numbers per vertex, u and v. Takes floats, or 8-bit or 16-bit
610
+ * integers, normalized or plain.
615
611
  */
616
612
  uvs?: VertexValues;
617
613
  /**
618
614
  * A second set of texture coordinates, two numbers per vertex, such as those of a light map.
619
- * Like three.js's `uv1` attribute. Takes the same types as `uvs`.
615
+ * Takes the same types as `uvs`.
620
616
  */
621
617
  uvs1?: VertexValues;
622
618
  /**
623
- * Linear colors, three numbers per vertex from 0 to 1, or four with alpha. Like three.js's
624
- * `color` attribute. Takes floats, or a `Uint8Array` or `Uint16Array`, whose integers read as
625
- * fractions from 0 to 1.
619
+ * Linear colors, three numbers per vertex from 0 to 1, or four with alpha. Takes floats, or a
620
+ * `Uint8Array` or `Uint16Array`, whose integers read as fractions from 0 to 1.
626
621
  */
627
622
  colors?: VertexValues;
628
623
  /**
629
- * Four numbers per vertex: the direction in which u grows along the surface, then 1 or -1 for
630
- * the direction in which v grows. Like three.js's `tangent` attribute. Takes the same types as
631
- * `normals`.
624
+ * Four numbers per vertex: the direction in which u grows along the surface, then 1 or -1 for the
625
+ * direction in which v grows. Takes the same types as `normals`.
632
626
  */
633
627
  tangents?: VertexValues;
634
628
  /**
635
629
  * The joints that move each vertex of a skinned mesh: four joint indices per vertex, in a
636
- * `Uint8Array`, a `Uint16Array` or a plain array. Like three.js's `skinIndex` attribute. Give
637
- * `weights` with them.
630
+ * `Uint8Array`, a `Uint16Array` or a plain array. Give `weights` with them.
638
631
  */
639
632
  joints?: VertexValues;
640
633
  /**
641
- * How much each of a vertex's four joints moves it: four numbers per vertex, which add up to
642
- * 1. Like three.js's `skinWeight` attribute. Takes floats, or a `Uint8Array` or `Uint16Array`,
643
- * whose integers read as fractions from 0 to 1.
634
+ * How much each of a vertex's four joints moves it: four numbers per vertex, which add up to 1.
635
+ * Takes floats, or a `Uint8Array` or `Uint16Array`, whose integers read as fractions from 0 to 1.
644
636
  */
645
637
  weights?: VertexValues;
646
638
  /**
@@ -654,17 +646,16 @@ export interface MeshArrays {
654
646
  /**
655
647
  * Three vertex indices per triangle, counter-clockwise when you look at its front. 16-bit and
656
648
  * 32-bit indices both work. Without indices, each three vertices in a row make a triangle.
657
- * Like three.js's `setIndex`.
658
649
  */
659
650
  indices?: Uint16Array | Uint32Array | readonly number[];
660
651
  /**
661
- * Computes the normals from the triangles, as three.js's `computeVertexNormals` does: each
662
- * vertex gets the average of its triangles' normals, weighted by their areas.
652
+ * Computes the normals from the triangles: each vertex gets the average of its triangles'
653
+ * normals, weighted by their areas.
663
654
  */
664
655
  computeNormals?: boolean;
665
656
  /**
666
- * Computes the tangents from the positions, the normals and `uvs`, as three.js's
667
- * `computeTangents` does, on the job workers.
657
+ * Computes the tangents on the job workers, from the positions, the normals and `uvs`, with Eric
658
+ * Lengyel's method.
668
659
  */
669
660
  computeTangents?: boolean;
670
661
  /**
@@ -687,8 +678,7 @@ export interface MeshArrays {
687
678
  levels?: LevelsOption;
688
679
  }
689
680
  /**
690
- * Mesh generators with the parameters and defaults of three.js's geometry classes, and meshes
691
- * from arrays.
681
+ * Mesh generators for common shapes, and meshes from arrays.
692
682
  *
693
683
  * @category api/geometry
694
684
  */
@@ -722,32 +712,31 @@ export declare class Geometry {
722
712
  * number.
723
713
  */
724
714
  private shape;
725
- /** A box, like three.js's `BoxGeometry`. */
715
+ /** A box, centered on its origin. */
726
716
  box(options?: BoxOptions): MeshGeometry;
727
- /** A sphere, like three.js's `SphereGeometry`. */
717
+ /** A sphere with its poles on the Y axis, or a part of one. */
728
718
  sphere(options?: SphereOptions): MeshGeometry;
729
- /** A flat rectangle, like three.js's `PlaneGeometry`. */
719
+ /** A flat rectangle in the XY plane that faces +Z. */
730
720
  plane(options?: PlaneOptions): MeshGeometry;
731
- /** A cylinder, like three.js's `CylinderGeometry`. */
721
+ /** A cylinder on the Y axis, closed at each end unless `openEnded` is true. */
732
722
  cylinder(options?: CylinderOptions): MeshGeometry;
733
- /** A cone, like three.js's `ConeGeometry`: a cylinder whose top is a point. */
723
+ /** A cone on the Y axis: a cylinder whose top is a point. */
734
724
  cone(options?: ConeOptions): MeshGeometry;
735
- /** A torus, like three.js's `TorusGeometry`. */
725
+ /** A torus: a tube bent into a ring around the Z axis. */
736
726
  torus(options?: TorusOptions): MeshGeometry;
737
- /** A capsule, like three.js's `CapsuleGeometry`. */
727
+ /** A capsule: a cylinder on the Y axis with a half sphere on each end. */
738
728
  capsule(options?: CapsuleOptions): MeshGeometry;
739
- /** A flat circle, like three.js's `CircleGeometry`. */
729
+ /** A flat circle in the XY plane that faces +Z, or a slice of one. */
740
730
  circle(options?: CircleOptions): MeshGeometry;
741
- /** A flat ring, like three.js's `RingGeometry`. */
731
+ /** A flat ring: a disc with a hole, in the XY plane, that faces +Z. */
742
732
  ring(options?: RingOptions): MeshGeometry;
743
733
  /**
744
- * A mesh from arrays of vertex attributes and triangle indices, like three.js's
745
- * `BufferGeometry` with `setAttribute` and `setIndex`. The mesh keeps the attributes it gets,
746
- * each in the type of number it came in, and meshes whose attributes have the same types share
747
- * GPU buffers. A mesh can have any number of vertices. Throws E1206 when an array's length does
748
- * not fit the vertex count, when its attribute does not take its type of number, when an index
749
- * names no vertex, for a value that is not a finite number, and for morph targets whose arrays
750
- * do not fit the vertices or whose lists hold different numbers of targets.
734
+ * A mesh from arrays of vertex attributes and triangle indices. The mesh keeps the attributes it
735
+ * gets, each in the type of number it came in, and meshes whose attributes have the same types
736
+ * share GPU buffers. A mesh can have any number of vertices. Throws E1206 when an array's length
737
+ * does not fit the vertex count, when its attribute does not take its type of number, when an
738
+ * index names no vertex, for a value that is not a finite number, and for morph targets whose
739
+ * arrays do not fit the vertices or whose lists hold different numbers of targets.
751
740
  */
752
741
  fromArrays(arrays: MeshArrays): MeshGeometry;
753
742
  }
@@ -775,11 +764,10 @@ export interface MaterialOptions {
775
764
  /**
776
765
  * How a material uses its alpha: its opacity, times its base color map's alpha, and times its
777
766
  * mesh's vertex alpha with `vertexColors`. The `opaque` mode ignores the alpha. The `mask` mode
778
- * draws nothing where the alpha falls below `alphaCutoff`, and draws the rest opaque, as three.js's
779
- * `alphaTest` does. The `hash` mode draws each point of the surface opaque or not at all, by a
780
- * pattern that stays on the mesh. The alpha then sets how much of the surface draws, as three.js's
781
- * `alphaHash` does. The `blend` mode blends the surface over what lies behind it, as three.js's
782
- * `transparent: true` does. Blended objects draw after the opaque ones, farthest first.
767
+ * draws nothing where the alpha falls below `alphaCutoff`, and draws the rest opaque. The `hash`
768
+ * mode draws each point of the surface opaque or not at all, by a pattern that stays on the mesh.
769
+ * The alpha then sets how much of the surface draws. The `blend` mode blends the surface over what
770
+ * lies behind it. Blended objects draw after the opaque ones, farthest first.
783
771
  *
784
772
  * @category api/materials
785
773
  */
@@ -788,29 +776,27 @@ export type AlphaMode = 'opaque' | 'mask' | 'hash' | 'blend';
788
776
  * How a blended surface meets what lies behind it. The `normal` blending covers it as far as the
789
777
  * alpha says. The `additive` blending adds the surface's light, for glows and fire. The `multiply`
790
778
  * blending tints it, for stains and tinted glass. The `weighted` blending covers it as `normal`
791
- * does, but blends the surfaces of this blending in any order, by a weighted average, as
792
- * three.js's `OITPassNode` does. Use it for smoke, dense particles and many overlapping panes,
793
- * where sorting by object leaves surfaces in the wrong order.
779
+ * does, but blends the surfaces of this blending in any order, by a weighted average. Use it for
780
+ * smoke, dense particles and many overlapping panes, where sorting by object leaves surfaces in the
781
+ * wrong order.
794
782
  *
795
783
  * @category api/materials
796
784
  */
797
785
  export type Blending = 'normal' | 'additive' | 'multiply' | 'weighted';
798
786
  /**
799
- * A depth bias, as three.js's polygon offset gives. It moves a surface's depth, so a decal on a
800
- * wall wins the depth test and does not fight with the wall. Negative values pull the surface
801
- * toward the camera, as in three.js.
787
+ * A depth bias. It moves a surface's depth before the depth test, so a decal on a wall wins the
788
+ * depth test and does not fight with the wall. Negative values pull the surface toward the camera.
802
789
  *
803
790
  * @category api/materials
804
791
  */
805
792
  export interface DepthBias {
806
793
  /**
807
- * Steps of the depth buffer's smallest difference, as three.js's `polygonOffsetUnits`. A
808
- * fraction rounds to the nearest whole number, as WebGPU takes it. The default is 0.
794
+ * Steps of the depth buffer's smallest difference. A fraction rounds to the nearest whole
795
+ * number, as WebGPU takes it. The default is 0.
809
796
  */
810
797
  constant?: number;
811
798
  /**
812
- * A factor of how steeply the surface's depth changes across the screen, as three.js's
813
- * `polygonOffsetFactor`. The default is 0.
799
+ * A factor of how steeply the surface's depth changes across the screen. The default is 0.
814
800
  */
815
801
  slopeScale?: number;
816
802
  }
@@ -837,20 +823,18 @@ export interface StandardValues extends MaterialOptions {
837
823
  */
838
824
  normalScale?: readonly [number, number];
839
825
  /**
840
- * How strongly the bump map bends normals, as three.js's `bumpScale`: the change of its red
841
- * channel from one pixel to the next times this. Negative values turn bumps into dents. The
842
- * default is 1.
826
+ * How strongly the bump map bends normals: the change of its red channel from one pixel to the
827
+ * next times this. Negative values turn bumps into dents. The default is 1.
843
828
  */
844
829
  bumpScale?: number;
845
830
  /**
846
- * How far the displacement map's white moves each vertex along its normal, in the mesh's units,
847
- * as three.js's `displacementScale`. The default is 1.
831
+ * How far the displacement map's white moves each vertex along its normal, in the mesh's units.
832
+ * The default is 1.
848
833
  */
849
834
  displacementScale?: number;
850
835
  /**
851
836
  * How far the displacement map moves every vertex along its normal, added to its texel's
852
- * share of `displacementScale`, in the mesh's units, as three.js's `displacementBias`. The
853
- * default is 0.
837
+ * share of `displacementScale`, in the mesh's units. The default is 0.
854
838
  */
855
839
  displacementBias?: number;
856
840
  /** How much the occlusion map darkens ambient light, from 0 to 1. The default is 1. */
@@ -858,30 +842,27 @@ export interface StandardValues extends MaterialOptions {
858
842
  /** The factor of the light map's light: 0 or more. The default is 1. */
859
843
  lightMapIntensity?: number;
860
844
  /**
861
- * The index of refraction of the surface's non-metallic part, 1 or more, as three.js's
862
- * `MeshPhysicalMaterial.ior`. It sets how much light the surface reflects when seen head on:
863
- * `((ior - 1) / (ior + 1))^2`. The default is 1.5, which reflects 4%, as glTF's metallic-roughness
864
- * model does.
845
+ * The index of refraction of the surface's non-metallic part, 1 or more. It sets how much
846
+ * light the surface reflects when seen head on: `((ior - 1) / (ior + 1))^2`. The default is
847
+ * 1.5, which reflects 4%, as glTF's metallic-roughness model does.
865
848
  */
866
849
  ior?: number;
867
850
  /**
868
- * The strength of the specular reflection of the surface's non-metallic part, from 0 to 1, as
869
- * three.js's `specularIntensity`. It scales the reflection at every angle, so 0 leaves only
870
- * diffuse light. Metals ignore it. The default is 1.
851
+ * The strength of the specular reflection of the surface's non-metallic part, from 0 to 1. It
852
+ * scales the reflection at every angle, so 0 leaves only diffuse light. Metals ignore it. The
853
+ * default is 1.
871
854
  */
872
855
  specularIntensity?: number;
873
856
  /**
874
857
  * The color that tints the specular reflection of the surface's non-metallic part when seen head
875
- * on, as three.js's `specularColor`. At grazing angles the reflection stays white, and metals
876
- * ignore it. It takes the forms that `color` takes, and its three linear components may also
877
- * exceed 1, as glTF allows, to reflect more than the index of refraction gives, up to all the
878
- * light. The default is white.
858
+ * on. At grazing angles the reflection stays white, and metals ignore it. It takes the forms
859
+ * that `color` takes, and its three linear components may also exceed 1, as glTF allows, to
860
+ * reflect more than the index of refraction gives, up to all the light. The default is white.
879
861
  */
880
862
  specularColor?: ColorInput;
881
863
  /**
882
- * The factor of the scene environment's light on the surface, 0 or more, as three.js's
883
- * `envMapIntensity`. It multiplies the intensity that `scene.setEnvironment` gives. The
884
- * default is 1.
864
+ * The factor of the scene environment's light on the surface, 0 or more. It multiplies the
865
+ * intensity that `scene.setEnvironment` gives. The default is 1.
885
866
  */
886
867
  envIntensity?: number;
887
868
  /** Where the maps sit on the texture coordinates. The default leaves them as they are. */
@@ -893,40 +874,36 @@ export interface StandardValues extends MaterialOptions {
893
874
  mapUvTransforms?: MapUvTransforms;
894
875
  /**
895
876
  * How much of the light behind the surface passes through it, from 0 to 1, for glass and clear
896
- * water, as three.js's `MeshPhysicalMaterial.transmission`. That share of the diffuse light
897
- * becomes the light from behind, and the reflections stay. Roughness blurs what shows through.
898
- * Give it when you create the material, even as 0, to change it later. A material created
899
- * without it lets no light through. Such a material draws after the opaque objects, with the
900
- * blended ones, and only opaque objects show through it. It takes the `opaque`, `mask` or
901
- * `blend` alpha mode. A mask decides which pixels draw, and the light from behind fills the
902
- * pixels that remain, as three.js's `alphaTest` does. The default is 0.
877
+ * water. That share of the diffuse light becomes the light from behind, and the reflections
878
+ * stay. Roughness blurs what shows through. Give it when you create the material, even as 0, to
879
+ * change it later. A material created without it lets no light through. Such a material draws
880
+ * after the opaque objects, with the blended ones, and only opaque objects show through it. It
881
+ * takes the `opaque`, `mask` or `blend` alpha mode. A mask decides which pixels draw, and the
882
+ * light from behind fills the pixels that remain. The default is 0.
903
883
  */
904
884
  transmission?: number;
905
885
  /**
906
- * The thickness of the volume under the surface, in the mesh's own units, 0 or more, as
907
- * three.js's `thickness`. Light that passes through bends by `ior` over this distance, and the
908
- * volume's color absorbs part of it. 0 is a thin wall, which bends no light. The default is 0.
886
+ * The thickness of the volume under the surface, in the mesh's own units, 0 or more. Light that
887
+ * passes through bends by `ior` over this distance, and the volume's color absorbs part of it.
888
+ * 0 is a thin wall, which bends no light. The default is 0.
909
889
  */
910
890
  thickness?: number;
911
891
  /**
912
892
  * The color that white light takes after it travels `attenuationDistance` through the
913
- * volume, as three.js's `attenuationColor`, in the forms that `color` takes. The default is
914
- * white, which absorbs nothing.
893
+ * volume, in the forms that `color` takes. The default is white, which absorbs nothing.
915
894
  */
916
895
  attenuationColor?: ColorInput;
917
896
  /**
918
897
  * The distance in world units over which light in the volume takes `attenuationColor`, above
919
- * 0, as three.js's `attenuationDistance`. `Infinity` absorbs nothing. The default is
920
- * `Infinity`.
898
+ * 0. `Infinity` absorbs nothing. The default is `Infinity`.
921
899
  */
922
900
  attenuationDistance?: number;
923
901
  /**
924
- * The strength of the volume's dispersion, 0 or more, as three.js's
925
- * `MeshPhysicalMaterial.dispersion` and glTF's `KHR_materials_dispersion`: 20 divided by the
926
- * Abbe number, so a diamond's 0.36 is weak and rutile's 2.04 is strong. The light from behind
927
- * bends by a slightly different index of refraction for each color, so a prism or a gem
928
- * separates it into colors at its edges. 0 bends every color alike. It shows only with
929
- * `transmission`, and the default is 0.
902
+ * The strength of the volume's dispersion, 0 or more, as glTF's `KHR_materials_dispersion`
903
+ * gives it: 20 divided by the Abbe number, so a diamond's 0.36 is weak and rutile's 2.04 is
904
+ * strong. The light from behind bends by a slightly different index of refraction for each
905
+ * color, so a prism or a gem separates it into colors at its edges. 0 bends every color alike.
906
+ * It shows only with `transmission`, and the default is 0.
930
907
  */
931
908
  dispersion?: number;
932
909
  /**
@@ -964,67 +941,63 @@ export interface StandardValues extends MaterialOptions {
964
941
  */
965
942
  subsurfaceColor?: ColorInput;
966
943
  /**
967
- * How much of a clear coat covers the surface, from 0 to 1, as three.js's
968
- * `MeshPhysicalMaterial.clearcoat`: a thin, shiny layer, as on car paint, varnish or a wet
969
- * stone, with its own highlights and reflection. It dims what lies below it where it reflects
970
- * light. Give it, or another option of a clear coat or a sheen, when you create the material, to
971
- * change it later. The default is 0.
944
+ * How much of a clear coat covers the surface, from 0 to 1: a thin, shiny layer, as on car
945
+ * paint, varnish or a wet stone, with its own highlights and reflection. It dims what lies
946
+ * below it where it reflects light. Give it, or another option of a clear coat or a sheen, when
947
+ * you create the material, to change it later. The default is 0.
972
948
  */
973
949
  clearcoat?: number;
974
- /** How rough the clear coat is, from 0 (a mirror) to 1, as three.js's `clearcoatRoughness`. The default is 0. */
950
+ /** How rough the clear coat is, from 0 (a mirror) to 1. The default is 0. */
975
951
  clearcoatRoughness?: number;
976
952
  /**
977
- * How strongly the coat normal map bends the coat's normals along u and along v, as three.js's
978
- * `clearcoatNormalScale`. The default is `[1, 1]`, and negative values flip a direction.
953
+ * How strongly the coat normal map bends the coat's normals along u and along v. The default is
954
+ * `[1, 1]`, and negative values flip a direction.
979
955
  */
980
956
  clearcoatNormalScale?: readonly [number, number];
981
957
  /**
982
- * The color of a sheen, the soft glow at grazing angles of velvet, cloth and fuzz, as three.js's
983
- * `sheenColor`, in the forms that `color` takes. three.js's `sheen` multiplies it; here the
984
- * color alone sets the sheen. Black gives none. Give it, or another option of a clear coat or a
985
- * sheen, when you create the material, to change it later. The default is black.
958
+ * The color of a sheen, the soft glow at grazing angles of velvet, cloth and fuzz, in the forms
959
+ * that `color` takes. The color alone sets the sheen's strength, so black gives none. Give it,
960
+ * or another option of a clear coat or a sheen, when you create the material, to change it
961
+ * later. The default is black.
986
962
  */
987
963
  sheenColor?: ColorInput;
988
- /** How rough the sheen is, from 0 to 1, as three.js's `sheenRoughness`: rougher sheens spread wider. The default is 1. */
964
+ /** How rough the sheen is, from 0 to 1: rougher sheens spread wider. The default is 1. */
989
965
  sheenRoughness?: number;
990
966
  /**
991
- * How much a thin film above the surface tints its reflection, from 0 to 1, as three.js's
992
- * `iridescence`: soap bubbles, oil and beetle shells show the colors of the film's thickness.
993
- * Give it, or another option of iridescence, when you create the material, to change it later.
994
- * The default is 0.
967
+ * How much a thin film above the surface tints its reflection, from 0 to 1: soap bubbles, oil
968
+ * and beetle shells show the colors of the film's thickness. Give it, or another option of
969
+ * iridescence, when you create the material, to change it later. The default is 0.
995
970
  */
996
971
  iridescence?: number;
997
972
  /**
998
- * The thin film's index of refraction, 1 or more, as three.js's `iridescenceIOR`: 1 makes the
999
- * film reflect as the surface does, and a value near 2 shows its colors most strongly. The
1000
- * default is 1.3.
973
+ * The thin film's index of refraction, 1 or more: 1 makes the film reflect as the surface does,
974
+ * and a value near 2 shows its colors most strongly. The default is 1.3.
1001
975
  */
1002
976
  iridescenceIor?: number;
1003
977
  /**
1004
- * The thinnest and thickest parts of the film, in nanometers, as three.js's
1005
- * `iridescenceThicknessRange`: the map's green channel mixes between them. The default is
1006
- * `[100, 400]`.
978
+ * The thinnest and thickest parts of the film, in nanometers: the map's green channel mixes
979
+ * between them. The default is `[100, 400]`.
1007
980
  */
1008
981
  iridescenceThicknessRange?: readonly [number, number];
1009
982
  /**
1010
983
  * How far the specular reflection stretches along one direction of the surface, from 0 (round)
1011
- * to 1, as three.js's `anisotropy`: brushed metal shows a highlight across its grooves rather
1012
- * than around. A material with a map takes the stretch's direction from the mesh's tangents or
1013
- * from the map's coordinates; a material without one takes a frame square to the surface.
1014
- * Give it, or `anisotropyRotation`, when you create the material, to change it later.
1015
- * The default is 0.
984
+ * to 1: brushed metal shows a highlight across its grooves rather than around. A material with
985
+ * a map takes the stretch's direction from the mesh's tangents or from the map's coordinates; a
986
+ * material without one takes a frame square to the surface. Give it, or `anisotropyRotation`,
987
+ * when you create the material, to change it later. The default is 0.
1016
988
  */
1017
989
  anisotropy?: number;
1018
990
  /**
1019
- * The direction along which the reflection stretches, in radians from the surface's tangent,
1020
- * as three.js's `anisotropyRotation`. The default is 0.
991
+ * The direction along which the reflection stretches, in radians from the surface's tangent.
992
+ * The default is 0.
1021
993
  */
1022
994
  anisotropyRotation?: number;
1023
995
  }
1024
996
  /**
1025
- * Where a material's maps sit on the texture coordinates, as three.js's texture `offset`, `repeat`
1026
- * and `rotation` place a texture, with its `center` at the coordinates' origin. A transform that
1027
- * leaves a value out takes its default.
997
+ * Where a material's maps sit on the texture coordinates. The engine turns the coordinates by
998
+ * `rotation` about their origin, scales them by `repeat`, and then adds `offset`:
999
+ * u' = repeat.u × (u cos r + v sin r) + offset.u, and v' = repeat.v × (v cos r − u sin r) + offset.v.
1000
+ * A transform that leaves a value out takes its default.
1028
1001
  *
1029
1002
  * @category api/materials
1030
1003
  */
@@ -1056,18 +1029,17 @@ export interface StandardMaps {
1056
1029
  /** Normals in tangent space, in linear color, which `normalScale` scales. */
1057
1030
  normalMap?: Texture;
1058
1031
  /**
1059
- * Heights in red, in linear color, which bend the normals as three.js's bump map does, by
1060
- * `bumpScale`. A normal map wins over it, as in three.js, and so does a wireframe.
1032
+ * Heights in red, in linear color, which bend the normals by the change of the height from one
1033
+ * pixel to the next, times `bumpScale`. A normal map wins over it, and so does a wireframe.
1061
1034
  */
1062
1035
  bumpMap?: Texture;
1063
1036
  /**
1064
1037
  * Heights in red, in linear color, which move each vertex along its normal by
1065
- * `displacementScale` and `displacementBias`, as three.js's displacement map does. Shadows and
1066
- * the depth prepass follow the moved vertices, and culling grows each object's bounds to hold
1067
- * them. Without a normal or bump map, the map's slope also bends the normals, so the light
1068
- * follows the new shape, which three.js does not do. The vertex shader reads the map at its
1069
- * full size, so the mesh needs vertices about as dense as the detail it should show. Raycasts,
1070
- * outlines and debug views see the mesh before it moves.
1038
+ * `displacementScale` and `displacementBias`. Shadows and the depth prepass follow the moved
1039
+ * vertices, and culling grows each object's bounds to hold them. Without a normal or bump map,
1040
+ * the map's slope also bends the normals, so the light follows the new shape. The vertex shader
1041
+ * reads the map at its full size, so the mesh needs vertices about as dense as the detail it
1042
+ * should show. Raycasts, outlines and debug views see the mesh before it moves.
1071
1043
  */
1072
1044
  displacementMap?: Texture;
1073
1045
  /**
@@ -1171,30 +1143,28 @@ export interface MaterialFeatures {
1171
1143
  /** Takes the scene's fog. False keeps the material's color at every distance. The default is true. */
1172
1144
  fog?: boolean;
1173
1145
  /**
1174
- * Keeps the color as the display shows it, as three.js's `toneMapped: false` does. The tone
1175
- * curve leaves it alone: the 8-bit path decides that in the shader of the material's own build,
1176
- * and the HDR path's final pass reads a mask of these surfaces and skips the curve where one
1177
- * draws. A blended surface keeps the curve on the HDR path, since a blended pixel mixes two
1178
- * surfaces. The vignette and the sRGB encoding still apply, and the exposure already scales
1179
- * the material's colors, so the color shows brighter than the same color tone mapped. The
1180
- * default is true.
1146
+ * False keeps the color as the display shows it. The tone curve leaves it alone: the 8-bit path
1147
+ * decides that in the shader of the material's own build, and the HDR path's final pass reads a
1148
+ * mask of these surfaces and skips the curve where one draws. A blended surface keeps the curve
1149
+ * on the HDR path, since a blended pixel mixes two surfaces. The vignette and the sRGB encoding
1150
+ * still apply, and the exposure already scales the material's colors, so the color shows
1151
+ * brighter than the same color tone mapped. The default is true.
1181
1152
  */
1182
1153
  toneMapped?: boolean;
1183
1154
  /** How the material uses its alpha. The default is `opaque`. */
1184
1155
  alphaMode?: AlphaMode;
1185
1156
  /**
1186
- * With the `mask` alpha mode, smooths the cut edges with MSAA, as three.js's
1187
- * `alphaToCoverage` does: the alpha fades over about one pixel above `alphaCutoff`, and covers
1188
- * that share of the pixel. Without MSAA the mask cuts as without it. False gives three.js's hard
1189
- * cut edges of `alphaTest`. A custom material takes it where its WGSL sets or reads the
1190
- * surface's `alpha`, and a development build throws E1217 otherwise. The default is true.
1157
+ * With the `mask` alpha mode, smooths the cut edges with MSAA: the alpha fades over about one
1158
+ * pixel above `alphaCutoff`, and covers that share of the pixel. Without MSAA the mask cuts as
1159
+ * without it. False gives hard cut edges. A custom material takes it where its WGSL sets or
1160
+ * reads the surface's `alpha`, and a development build throws E1217 otherwise. The default is
1161
+ * true.
1191
1162
  */
1192
1163
  alphaToCoverage?: boolean;
1193
1164
  /**
1194
1165
  * With the `blend` alpha mode and `doubleSided`, draws both faces in one draw, in the mesh's
1195
- * order, as three.js's `forceSinglePass` does. By default such a surface draws its back faces
1196
- * first and then its front faces, so its near side always covers its far side. The default is
1197
- * false.
1166
+ * order. By default such a surface draws its back faces first and then its front faces, so its
1167
+ * near side always covers its far side. The default is false.
1198
1168
  */
1199
1169
  forceSinglePass?: boolean;
1200
1170
  /** With the `blend` alpha mode, how the surface meets what lies behind it. The default is `normal`. */
@@ -1202,25 +1172,25 @@ export interface MaterialFeatures {
1202
1172
  /** False to write no depth, so the surface hides nothing behind it. The default is true. */
1203
1173
  depthWrite?: boolean;
1204
1174
  /**
1205
- * False to draw the surface whatever lies in front of it. It then writes no depth either, as
1206
- * in three.js's WebGL renderer. The default is true.
1175
+ * False to draw the surface whatever lies in front of it. It then writes no depth either. The
1176
+ * default is true.
1207
1177
  */
1208
1178
  depthTest?: boolean;
1209
1179
  /**
1210
- * False to write no color, so the surface shows nothing itself and hides what lies behind it
1211
- * by the depth it writes, as three.js's `colorWrite: false` does. Its objects draw before the
1212
- * opaque objects that write color, so nothing behind it shows through. With the `mask` or
1213
- * `hash` alpha mode, the parts that the alpha drops write no depth either, so the surface cuts
1214
- * a shape out of the space it holds. A blended surface keeps its place among the blended
1215
- * objects, which `setRenderOrder` orders. The default is true.
1180
+ * False to write no color, so the surface shows nothing itself and hides what lies behind it by
1181
+ * the depth it writes. Its objects draw before the opaque objects that write color, so nothing
1182
+ * behind it shows through. With the `mask` or `hash` alpha mode, the parts that the alpha drops
1183
+ * write no depth either, so the surface cuts a shape out of the space it holds. A blended
1184
+ * surface keeps its place among the blended objects, which `setRenderOrder` orders. The default
1185
+ * is true.
1216
1186
  */
1217
1187
  colorWrite?: boolean;
1218
- /** Moves the surface's depth, as three.js's polygon offset does. The default is no bias. */
1188
+ /** Moves the surface's depth before the depth test. The default is no bias. */
1219
1189
  depthBias?: DepthBias;
1220
1190
  /**
1221
- * Draws the edges of each triangle as lines one pixel wide, with the material's own shading,
1222
- * as three.js's `wireframe` does. Edges that two triangles share draw twice. Its shadows draw
1223
- * lines too. Flat shading and bump maps have no effect on it. The default is false.
1191
+ * Draws the edges of each triangle as lines one pixel wide, with the material's own shading.
1192
+ * Edges that two triangles share draw twice. Its shadows draw lines too. Flat shading and bump
1193
+ * maps have no effect on it. The default is false.
1224
1194
  */
1225
1195
  wireframe?: boolean;
1226
1196
  }
@@ -1245,14 +1215,15 @@ export interface StandardBaseOptions extends StandardValues, MaterialFeatures {
1245
1215
  */
1246
1216
  flatShading?: boolean;
1247
1217
  /**
1248
- * Where a light map's texture coordinates start, as three.js's `texture.offset`. A bake places
1249
- * each light map on a mesh with its own scale and offset, apart from the other maps. It takes
1250
- * two numbers, and needs a `lightMap`. The default leaves the coordinates alone.
1218
+ * Where a light map's texture coordinates start: the engine adds it to the coordinates after
1219
+ * `lightMapRepeat` scales them. A bake places each light map on a mesh with its own scale and
1220
+ * offset, apart from the other maps. It takes two numbers, and needs a `lightMap`. The default
1221
+ * leaves the coordinates alone.
1251
1222
  */
1252
1223
  lightMapOffset?: readonly [number, number];
1253
1224
  /**
1254
- * How a light map's texture coordinates stretch, as three.js's `texture.repeat`. It takes two
1255
- * numbers, and needs a `lightMap`. The default is `[1, 1]`.
1225
+ * How a light map's texture coordinates stretch: the engine multiplies the coordinates by it.
1226
+ * It takes two numbers, and needs a `lightMap`. The default is `[1, 1]`.
1256
1227
  */
1257
1228
  lightMapRepeat?: readonly [number, number];
1258
1229
  /**
@@ -1348,8 +1319,7 @@ export interface UnlitOptions extends UnlitValues, MaterialFeatures {
1348
1319
  export interface ShadowCatcherValues extends MaterialOptions {
1349
1320
  }
1350
1321
  /**
1351
- * Options of `materials.shadowCatcher`, a material that draws only the shadows that fall on it, as
1352
- * three.js's `ShadowMaterial`.
1322
+ * Options of `materials.shadowCatcher`, a material that draws only the shadows that fall on it.
1353
1323
  *
1354
1324
  * @category api/materials
1355
1325
  */
@@ -1438,9 +1408,10 @@ export interface ShaderOptions<Wgsl extends string | CompiledWgsl = string | Com
1438
1408
  * the WGSL calls `sceneDepth(uv)` or `sceneDistance(uv)`, and the engine binds the copy of the
1439
1409
  * opaque scene's depth. A material that declares it draws after that copy exists, so it reads
1440
1410
  * it in the transparent pass; a surface that draws earlier reads 0, the far plane. A material
1441
- * that declares it takes at most seven textures of its own: its maps' group gives up one slot,
1442
- * so that the copy fits the fragment stage beside the maps under WebGPU's limit of sixteen
1443
- * sampled textures. The engine checks that the declaration and the WGSL agree.
1411
+ * that declares it samples at most six textures of its own, as every custom material does. Its
1412
+ * maps' group gives the copy a slot that those textures leave free, under WebGPU's limit of
1413
+ * sixteen sampled textures in the fragment stage. The engine checks that the declaration and
1414
+ * the WGSL agree.
1444
1415
  */
1445
1416
  sceneInputs?: readonly SceneInput[];
1446
1417
  /**
@@ -1490,6 +1461,11 @@ export declare class Material<Values extends MaterialOptions = MaterialOptions>
1490
1461
  private bump;
1491
1462
  /** The displacement map's scale and bias, which `set` changes one at a time, where it has one. */
1492
1463
  private displacement;
1464
+ private inspectorNumbersGiven;
1465
+ private inspectorEmissive;
1466
+ private inspectorColorGiven;
1467
+ private inspectorEmissiveGiven;
1468
+ private inspectorBlending;
1493
1469
  /**
1494
1470
  * Where each map sits on the texture coordinates, as `set` last gave them: for every slot, the
1495
1471
  * offset's two numbers, the scale's two and the rotation, so an animation can change one pair
@@ -1525,20 +1501,18 @@ export declare class Material<Values extends MaterialOptions = MaterialOptions>
1525
1501
  /** Each map's transform, which a value makes where the material has none. */
1526
1502
  private uvValues;
1527
1503
  /**
1528
- * Destroys the material, like three.js's `material.dispose()`. Objects and instance batches that
1529
- * still use it draw nothing until `setMaterial` gives them another material. Once no object uses
1530
- * it, its place in the engine's table of materials goes to the next material. When the last
1531
- * material of a custom material's WGSL goes, the engine frees that WGSL's pipelines. The
1532
- * material's textures stay, so destroy them apart. Later calls on the material, and calls that
1533
- * pass it, throw E1101.
1504
+ * Destroys the material. Objects and instance batches that still use it draw nothing until
1505
+ * `setMaterial` gives them another material. Once no object uses it, its place in the engine's
1506
+ * table of materials goes to the next material. When the last material of a custom material's
1507
+ * WGSL goes, the engine frees that WGSL's pipelines. The material's textures stay, so destroy
1508
+ * them apart. Later calls on the material, and calls that pass it, throw E1101.
1534
1509
  */
1535
1510
  destroy(): void;
1536
1511
  }
1537
1512
  /**
1538
1513
  * Material factories. The standard material follows glTF's metallic-roughness model and shades
1539
- * with the formulas of three.js's `MeshStandardMaterial`. The unlit material shows its color as
1540
- * three.js's `MeshBasicMaterial` does. The shadow-catcher material shows only the main directional
1541
- * light's shadows, as three.js's `ShadowMaterial`.
1514
+ * with Lambert diffuse light and a GGX highlight. The unlit material shows its color whatever the
1515
+ * lights. The shadow-catcher material shows only the main directional light's shadows.
1542
1516
  *
1543
1517
  * @category api/materials
1544
1518
  */
@@ -1555,33 +1529,30 @@ export declare class Materials {
1555
1529
  */
1556
1530
  private createId;
1557
1531
  /**
1558
- * A lit material with glTF's metallic-roughness model, like three.js's
1559
- * `MeshStandardMaterial`.
1532
+ * A lit material with glTF's metallic-roughness model.
1560
1533
  */
1561
1534
  standard(options?: StandardOptions): Material<StandardValues>;
1562
1535
  /**
1563
1536
  * A decal's material: the standard material, projected onto every opaque surface inside the
1564
- * box of each object that it draws, as three.js's `DecalGeometry` places a decal. Give it to a
1565
- * mesh of `geometry.box()`: the object's position, rotation and scale place the box, and the
1566
- * material's maps stretch over the box's x and y sides, seen along its z axis. The surfaces
1567
- * inside take its color, roughness, metalness, normal map and emissive light, lit by the
1568
- * scene's lights, and blend with them as far as its alpha says. A decal draws after the opaque
1569
- * objects, and marks no blended surface. It casts no shadow.
1537
+ * box of each object that it draws. Give it to a mesh of `geometry.box()`: the object's
1538
+ * position, rotation and scale place the box, and the material's maps stretch over the box's x
1539
+ * and y sides, seen along its z axis. The surfaces inside take its color, roughness, metalness,
1540
+ * normal map and emissive light, lit by the scene's lights, and blend with them as far as its
1541
+ * alpha says. A decal draws after the opaque objects, and marks no blended surface. It casts no
1542
+ * shadow.
1570
1543
  */
1571
1544
  decal(options?: DecalOptions): Material<DecalValues>;
1572
1545
  /**
1573
- * A material that ignores lights and shows its color unlit, like three.js's
1574
- * `MeshBasicMaterial`. The exposure and the tone mapping still apply to it, as three.js applies
1575
- * them to that material.
1546
+ * A material that ignores lights and shows its color unlit. The exposure and the tone mapping
1547
+ * still apply to it.
1576
1548
  */
1577
1549
  unlit(options?: UnlitOptions): Material<UnlitValues>;
1578
1550
  /**
1579
- * A material that draws only the shadows that fall on it, as three.js's `ShadowMaterial`: its
1580
- * `color` where the main directional light's shadow falls, and nothing where the light reaches
1581
- * it, at `opacity`. The mesh must receive shadows (`setReceiveShadows(true)`), as three.js's
1582
- * `receiveShadow` must be set. Every shadow that falls on the surface comes from the main
1583
- * directional light; point and spot lights cast none onto it. The default color is black, as
1584
- * three.js's. The material blends, so it draws in the transparent pass after the opaque
1551
+ * A material that draws only the shadows that fall on it: its `color` where the main
1552
+ * directional light's shadow falls, and nothing where the light reaches it, at `opacity`. The
1553
+ * mesh must receive shadows (`setReceiveShadows(true)`). Every shadow that falls on the surface
1554
+ * comes from the main directional light; point and spot lights cast none onto it. The default
1555
+ * color is black. The material blends, so it draws in the transparent pass after the opaque
1585
1556
  * objects, and the scene's fog leaves it alone. It takes no texture maps.
1586
1557
  */
1587
1558
  shadowCatcher(options?: ShadowCatcherOptions): Material<ShadowCatcherValues>;