@null3d/engine 0.1.0 → 0.1.1

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 (381) hide show
  1. package/dist/wasm/single/null3d.js +10 -8
  2. package/dist/wasm/single/null3d_bg.wasm +0 -0
  3. package/dist/wasm/threaded/null3d.js +10 -8
  4. package/dist/wasm/threaded/null3d_bg.wasm +0 -0
  5. package/docs/api/animation.md +96 -24
  6. package/docs/api/assets.md +99 -29
  7. package/docs/api/cameras.md +38 -7
  8. package/docs/api/controls.md +47 -23
  9. package/docs/api/debug.md +105 -35
  10. package/docs/api/engine.md +108 -32
  11. package/docs/api/feature-draws.md +21 -15
  12. package/docs/api/feature-effects.md +8 -8
  13. package/docs/api/feature-instances.md +68 -17
  14. package/docs/api/features.md +68 -37
  15. package/docs/api/geometry.md +83 -14
  16. package/docs/api/grass.md +55 -13
  17. package/docs/api/impostors.md +92 -50
  18. package/docs/api/input.md +22 -9
  19. package/docs/api/lights.md +67 -16
  20. package/docs/api/lines.md +38 -13
  21. package/docs/api/materials.md +187 -59
  22. package/docs/api/math.md +6 -6
  23. package/docs/api/objects.md +40 -15
  24. package/docs/api/page.md +58 -7
  25. package/docs/api/particles.md +36 -11
  26. package/docs/api/points.md +18 -8
  27. package/docs/api/post.md +57 -23
  28. package/docs/api/quality.md +36 -16
  29. package/docs/api/raycast.md +57 -24
  30. package/docs/api/reference/animation.md +1 -2
  31. package/docs/api/reference/assets.md +7 -4
  32. package/docs/api/reference/cameras.md +3 -2
  33. package/docs/api/reference/controls.md +59 -2
  34. package/docs/api/reference/debug.md +58 -6
  35. package/docs/api/reference/engine.md +39 -10
  36. package/docs/api/reference/feature-draws.md +3 -4
  37. package/docs/api/reference/feature-effects.md +2 -3
  38. package/docs/api/reference/feature-instances.md +5 -4
  39. package/docs/api/reference/features.md +7 -4
  40. package/docs/api/reference/geometry.md +132 -21
  41. package/docs/api/reference/grass.md +62 -2
  42. package/docs/api/reference/impostors.md +120 -16
  43. package/docs/api/reference/input.md +1 -2
  44. package/docs/api/reference/lights.md +4 -3
  45. package/docs/api/reference/lines.md +3 -4
  46. package/docs/api/reference/materials.md +7 -6
  47. package/docs/api/reference/math.md +13 -2
  48. package/docs/api/reference/objects.md +2 -3
  49. package/docs/api/reference/particles.md +31 -6
  50. package/docs/api/reference/points.md +2 -3
  51. package/docs/api/reference/post.md +4 -3
  52. package/docs/api/reference/quality.md +1 -2
  53. package/docs/api/reference/raycast.md +1 -2
  54. package/docs/api/reference/render.md +4 -3
  55. package/docs/api/reference/scene.md +24 -5
  56. package/docs/api/reference/sketch.md +11 -11
  57. package/docs/api/reference/sound.md +33 -2
  58. package/docs/api/reference/splats.md +42 -3
  59. package/docs/api/reference/sprites.md +2 -3
  60. package/docs/api/reference/tasks.md +16 -3
  61. package/docs/api/reference/terrain.md +26 -5
  62. package/docs/api/reference/textures.md +1 -2
  63. package/docs/api/reference/three-compat.md +18 -7
  64. package/docs/api/reference/time.md +1 -2
  65. package/docs/api/reference/ui.md +10 -7
  66. package/docs/api/reference/vertex-draws.md +2 -3
  67. package/docs/api/reference/water.md +78 -5
  68. package/docs/api/reference/wind.md +15 -2
  69. package/docs/api/render.md +67 -25
  70. package/docs/api/scene.md +129 -36
  71. package/docs/api/sketch.md +45 -19
  72. package/docs/api/sound.md +48 -12
  73. package/docs/api/splats.md +42 -15
  74. package/docs/api/sprites.md +8 -6
  75. package/docs/api/tasks.md +31 -22
  76. package/docs/api/terrain.md +44 -12
  77. package/docs/api/textures.md +61 -12
  78. package/docs/api/three-compat.md +15 -7
  79. package/docs/api/time.md +3 -5
  80. package/docs/api/ui.md +18 -10
  81. package/docs/api/vertex-draws.md +13 -12
  82. package/docs/api/water.md +111 -67
  83. package/docs/api/wind.md +61 -15
  84. package/docs/cli/null3d.md +90 -15
  85. package/docs/concepts/architecture.md +69 -23
  86. package/docs/concepts/assets.md +57 -16
  87. package/docs/concepts/backends.md +65 -25
  88. package/docs/concepts/color-management.md +42 -13
  89. package/docs/concepts/culling.md +68 -47
  90. package/docs/concepts/handles.md +14 -5
  91. package/docs/concepts/instances.md +72 -23
  92. package/docs/concepts/large-worlds.md +17 -7
  93. package/docs/concepts/lighting.md +117 -44
  94. package/docs/concepts/lod.md +128 -33
  95. package/docs/concepts/materials.md +43 -12
  96. package/docs/concepts/particle-buffer.md +48 -35
  97. package/docs/concepts/post-processing.md +77 -14
  98. package/docs/concepts/quality-preset-tables.md +3 -2
  99. package/docs/concepts/quality-presets.md +122 -39
  100. package/docs/concepts/render-graph.md +56 -21
  101. package/docs/concepts/render-layers.md +9 -5
  102. package/docs/concepts/shadows.md +96 -25
  103. package/docs/concepts/static-dynamic.md +22 -7
  104. package/docs/cookbook/index.md +163 -119
  105. package/docs/data/threejs-mapping.json +301 -340
  106. package/docs/errors/E1101.md +23 -5
  107. package/docs/errors/E1102.md +11 -3
  108. package/docs/errors/E1103.md +11 -3
  109. package/docs/errors/E1104.md +11 -3
  110. package/docs/errors/E1105.md +13 -5
  111. package/docs/errors/E1106.md +11 -3
  112. package/docs/errors/E1107.md +15 -5
  113. package/docs/errors/E1108.md +11 -3
  114. package/docs/errors/E1109.md +32 -6
  115. package/docs/errors/E1110.md +23 -5
  116. package/docs/errors/E1111.md +11 -3
  117. package/docs/errors/E1112.md +11 -3
  118. package/docs/errors/E1203.md +12 -4
  119. package/docs/errors/E1204.md +11 -3
  120. package/docs/errors/E1205.md +11 -3
  121. package/docs/errors/E1206.md +28 -6
  122. package/docs/errors/E1207.md +11 -3
  123. package/docs/errors/E1208.md +12 -3
  124. package/docs/errors/E1209.md +11 -3
  125. package/docs/errors/E1213.md +27 -5
  126. package/docs/errors/E1214.md +11 -3
  127. package/docs/errors/E1215.md +31 -6
  128. package/docs/errors/E1216.md +31 -6
  129. package/docs/errors/E1217.md +29 -6
  130. package/docs/errors/E1218.md +22 -6
  131. package/docs/errors/E1219.md +11 -3
  132. package/docs/errors/E1220.md +24 -5
  133. package/docs/errors/E1221.md +24 -5
  134. package/docs/errors/E1222.md +11 -3
  135. package/docs/errors/E1223.md +39 -6
  136. package/docs/errors/E1224.md +11 -3
  137. package/docs/errors/E1225.md +11 -3
  138. package/docs/errors/E1301.md +11 -3
  139. package/docs/errors/E1302.md +11 -3
  140. package/docs/errors/E1303.md +11 -3
  141. package/docs/errors/E1304.md +11 -3
  142. package/docs/errors/E1305.md +13 -3
  143. package/docs/errors/E1306.md +11 -3
  144. package/docs/errors/E1307.md +23 -6
  145. package/docs/errors/E1401.md +11 -3
  146. package/docs/errors/E1402.md +13 -5
  147. package/docs/errors/E1403.md +11 -3
  148. package/docs/errors/E1404.md +13 -3
  149. package/docs/errors/E1405.md +15 -4
  150. package/docs/errors/E1406.md +31 -5
  151. package/docs/errors/E1407.md +11 -3
  152. package/docs/errors/E1408.md +11 -3
  153. package/docs/errors/E1409.md +11 -3
  154. package/docs/errors/E1410.md +13 -5
  155. package/docs/errors/E1411.md +11 -3
  156. package/docs/errors/E1412.md +29 -6
  157. package/docs/errors/E1413.md +11 -3
  158. package/docs/errors/E1414.md +11 -3
  159. package/docs/errors/E1415.md +11 -3
  160. package/docs/errors/E1416.md +27 -6
  161. package/docs/errors/E1417.md +11 -3
  162. package/docs/errors/E1418.md +12 -3
  163. package/docs/errors/E1419.md +13 -5
  164. package/docs/errors/E1420.md +11 -3
  165. package/docs/errors/E1421.md +11 -3
  166. package/docs/errors/E1422.md +12 -3
  167. package/docs/errors/E1423.md +12 -3
  168. package/docs/errors/E1424.md +24 -5
  169. package/docs/errors/E1425.md +11 -3
  170. package/docs/errors/E1426.md +11 -3
  171. package/docs/errors/E1430.md +11 -3
  172. package/docs/errors/E1431.md +11 -3
  173. package/docs/errors/E1432.md +11 -3
  174. package/docs/errors/E1433.md +11 -3
  175. package/docs/errors/E1434.md +15 -6
  176. package/docs/errors/E1435.md +11 -3
  177. package/docs/errors/E1436.md +11 -3
  178. package/docs/errors/E1437.md +14 -6
  179. package/docs/errors/E1501.md +41 -6
  180. package/docs/errors/E1502.md +13 -3
  181. package/docs/errors/E1503.md +11 -3
  182. package/docs/errors/E1504.md +11 -3
  183. package/docs/errors/E1505.md +23 -5
  184. package/docs/errors/E1506.md +11 -3
  185. package/docs/errors/index.md +52 -29
  186. package/docs/getting-started/cdn.md +15 -9
  187. package/docs/getting-started/first-scene.md +20 -12
  188. package/docs/getting-started/hosting.md +111 -63
  189. package/docs/getting-started/install.md +39 -24
  190. package/docs/getting-started/network-use.md +31 -21
  191. package/docs/getting-started/project-structure.md +20 -8
  192. package/docs/getting-started/third-party-notices.md +6 -10
  193. package/docs/guides/accessibility.md +4 -4
  194. package/docs/guides/add-ons.md +83 -13
  195. package/docs/guides/agents.md +2 -6
  196. package/docs/guides/assets-pipeline.md +248 -72
  197. package/docs/guides/audio.md +17 -15
  198. package/docs/guides/baked-light-data.md +44 -23
  199. package/docs/guides/car-paint.md +37 -31
  200. package/docs/guides/content-pages.md +53 -29
  201. package/docs/guides/custom-passes.md +59 -17
  202. package/docs/guides/custom-shaders.md +54 -37
  203. package/docs/guides/debugging.md +31 -41
  204. package/docs/guides/deploying.md +6 -27
  205. package/docs/guides/deterministic-simulation.md +23 -16
  206. package/docs/guides/first-use-shaders.md +83 -45
  207. package/docs/guides/lens-kit.md +29 -26
  208. package/docs/guides/loading-screens.md +70 -30
  209. package/docs/guides/multiple-views.md +22 -11
  210. package/docs/guides/performance.md +188 -37
  211. package/docs/guides/phones.md +71 -19
  212. package/docs/guides/physics.md +6 -10
  213. package/docs/guides/screens.md +41 -29
  214. package/docs/guides/start-time.md +120 -85
  215. package/docs/guides/testing.md +137 -98
  216. package/docs/guides/ui-overlays.md +17 -12
  217. package/docs/guides/video-textures.md +14 -13
  218. package/docs/images/api/animation/character.webp +0 -0
  219. package/docs/images/api/animation/look-at-ring.webp +0 -0
  220. package/docs/images/api/animation/morph-tulips.webp +0 -0
  221. package/docs/images/api/animation/skeleton-lines.webp +0 -0
  222. package/docs/images/api/controls/gizmo-handles.webp +0 -0
  223. package/docs/images/api/controls/walk-and-fly.webp +0 -0
  224. package/docs/images/api/debug/debug-shapes.webp +0 -0
  225. package/docs/images/api/debug/levels-view.webp +0 -0
  226. package/docs/images/api/engine/transparent-canvas.webp +0 -0
  227. package/docs/images/api/feature-draws/feature-draw-clouds.webp +0 -0
  228. package/docs/images/api/feature-instances/compute-instances.webp +0 -0
  229. package/docs/images/api/feature-instances/instances-shadow.webp +0 -0
  230. package/docs/images/api/geometry/extra-shapes.webp +0 -0
  231. package/docs/images/api/geometry/generators.webp +0 -0
  232. package/docs/images/api/geometry/mesh-arrays.webp +0 -0
  233. package/docs/images/api/geometry/vertex-updates.webp +0 -0
  234. package/docs/images/api/grass/grass-grove.webp +0 -0
  235. package/docs/images/api/grass/grass-presets.webp +0 -0
  236. package/docs/images/api/grass/grass-shadow.webp +0 -0
  237. package/docs/images/api/impostors/impostor-handover.webp +0 -0
  238. package/docs/images/api/impostors/impostor-shadow.webp +0 -0
  239. package/docs/images/api/impostors/impostors-forest.webp +0 -0
  240. package/docs/images/api/lights/spot-cookies.webp +0 -0
  241. package/docs/images/api/lines/lines-lit.webp +0 -0
  242. package/docs/images/api/lines/lines-widths.webp +0 -0
  243. package/docs/images/api/materials/coat-and-sheen.webp +0 -0
  244. package/docs/images/api/materials/decals.webp +0 -0
  245. package/docs/images/api/materials/iridescence-and-anisotropy.webp +0 -0
  246. package/docs/images/api/materials/relief.webp +0 -0
  247. package/docs/images/api/materials/shader-inputs.webp +0 -0
  248. package/docs/images/api/materials/standard-grid.webp +0 -0
  249. package/docs/images/api/materials/subsurface.webp +0 -0
  250. package/docs/images/api/materials/translucency.webp +0 -0
  251. package/docs/images/api/objects/objects-turntable.webp +0 -0
  252. package/docs/images/api/particles/campfire.webp +0 -0
  253. package/docs/images/api/points/galaxy.webp +0 -0
  254. package/docs/images/api/reference/textures/texture-wrap.webp +0 -0
  255. package/docs/images/api/render/fullscreen-glow.webp +0 -0
  256. package/docs/images/api/render/reflection-mirror.webp +0 -0
  257. package/docs/images/api/render/security-camera.webp +0 -0
  258. package/docs/images/api/scene/aurora-sky-layer.webp +0 -0
  259. package/docs/images/api/sound/sound-demo.webp +0 -0
  260. package/docs/images/api/splats/splats-demo.webp +0 -0
  261. package/docs/images/api/sprites/sprites-lines.webp +0 -0
  262. package/docs/images/api/terrain/terrain-demo.webp +0 -0
  263. package/docs/images/api/textures/canvas-screen.webp +0 -0
  264. package/docs/images/api/textures/mipmaps.webp +0 -0
  265. package/docs/images/api/vertex-draws/rain.webp +0 -0
  266. package/docs/images/api/water/ocean.webp +0 -0
  267. package/docs/images/api/water/water-demo.webp +0 -0
  268. package/docs/images/api/water/water-rain.webp +0 -0
  269. package/docs/images/api/water/waterfall.webp +0 -0
  270. package/docs/images/concepts/assets/gltf-model.webp +0 -0
  271. package/docs/images/concepts/color-management/tone-mapped.webp +0 -0
  272. package/docs/images/concepts/culling/far-from-origin.webp +0 -0
  273. package/docs/images/concepts/instances/instances.webp +0 -0
  274. package/docs/images/concepts/instances/per-row-colors.webp +0 -0
  275. package/docs/images/concepts/large-worlds/large-world.webp +0 -0
  276. package/docs/images/concepts/lighting/area-lights.webp +0 -0
  277. package/docs/images/concepts/lighting/atmosphere.webp +0 -0
  278. package/docs/images/concepts/lighting/environment.webp +0 -0
  279. package/docs/images/concepts/lighting/light-shafts.webp +0 -0
  280. package/docs/images/concepts/lighting/reflection-probes.webp +0 -0
  281. package/docs/images/concepts/lod/forest.webp +0 -0
  282. package/docs/images/concepts/materials/weighted-transparency.webp +0 -0
  283. package/docs/images/concepts/post-processing/auto-exposure.webp +0 -0
  284. package/docs/images/concepts/post-processing/bounce-light.webp +0 -0
  285. package/docs/images/concepts/post-processing/depth-of-field.webp +0 -0
  286. package/docs/images/concepts/post-processing/post-effects-alley.webp +0 -0
  287. package/docs/images/concepts/post-processing/sharpen.webp +0 -0
  288. package/docs/images/concepts/post-processing/ssr-wet-street.webp +0 -0
  289. package/docs/images/concepts/render-layers/layers-cottages.webp +0 -0
  290. package/docs/images/concepts/shadows/hero-shadow.webp +0 -0
  291. package/docs/images/cookbook/index/picking.webp +0 -0
  292. package/docs/images/cookbook/index/time-of-day.webp +0 -0
  293. package/docs/images/errors/E1431/area-lights-no-tables.webp +0 -0
  294. package/docs/images/guides/custom-passes/reflection-water.webp +0 -0
  295. package/docs/images/guides/deterministic-simulation/replay-demo.webp +0 -0
  296. package/docs/images/guides/multiple-views/split-screen.webp +0 -0
  297. package/docs/images/guides/performance/overdraw-view.webp +0 -0
  298. package/docs/images/guides/testing/hold-mode-frame.webp +0 -0
  299. package/docs/images/index/showcase-island.webp +0 -0
  300. package/docs/images/porting/threejs-shaders/dissolve.webp +0 -0
  301. package/docs/images/shaders/builtins/builtins.webp +0 -0
  302. package/docs/images/shaders/surface-functions/custom-surface.webp +0 -0
  303. package/docs/images/shaders/surface-functions/vertex-offset.webp +0 -0
  304. package/docs/images/shots.json +2231 -0
  305. package/docs/index.md +14 -23
  306. package/docs/moves.json +1 -0
  307. package/docs/nav.json +300 -0
  308. package/docs/pages.md +230 -212
  309. package/docs/porting/react-three-fiber.md +2 -6
  310. package/docs/porting/threejs-loop-and-threads.md +1 -5
  311. package/docs/porting/threejs-mapping.md +1248 -234
  312. package/docs/porting/threejs-materials.md +10 -5
  313. package/docs/porting/threejs-overview.md +26 -6
  314. package/docs/porting/threejs-postprocessing.md +2 -6
  315. package/docs/porting/threejs-shaders.md +16 -14
  316. package/docs/porting/threejs-unsupported.md +6 -6
  317. package/docs/porting/verification.md +0 -4
  318. package/docs/shaders/builtins.md +15 -4
  319. package/docs/shaders/library.md +9 -6
  320. package/docs/shaders/surface-functions.md +51 -16
  321. package/docs/shaders/wgsl-rules.md +12 -5
  322. package/lib/debug/debug.d.ts +2 -2
  323. package/lib/debug/draw.d.ts +2 -2
  324. package/lib/debug/draw.js +8 -4
  325. package/lib/debug/overlay-look.d.ts +6 -0
  326. package/lib/debug/overlay-look.js +29 -7
  327. package/lib/debug/overlay.js +15 -11
  328. package/lib/debug/stats-options.d.ts +13 -0
  329. package/lib/debug/stats-panel.d.ts +21 -6
  330. package/lib/debug/stats-panel.js +80 -13
  331. package/lib/errors/codes.d.ts +17 -3
  332. package/lib/errors/codes.js +111 -105
  333. package/lib/errors/fixes.js +18 -18
  334. package/lib/gpu/variants.d.ts +8 -2
  335. package/lib/gpu/variants.js +39 -7
  336. package/lib/gpu/webgl2/programs.js +1 -1
  337. package/lib/gpu/webgpu/pipelines.js +13 -13
  338. package/lib/index.d.ts +1 -1
  339. package/lib/page/capabilities.d.ts +1 -1
  340. package/lib/page/engine.d.ts +14 -5
  341. package/lib/page/engine.js +18 -2
  342. package/lib/page/label-loop.js +9 -4
  343. package/lib/page/stats-switch.js +2 -0
  344. package/lib/page/switches.d.ts +6 -4
  345. package/lib/page/switches.js +20 -4
  346. package/lib/scene/baked-light.d.ts +2 -2
  347. package/lib/scene/fake-call-values.js +2 -2
  348. package/lib/scene/frame-cameras.d.ts +16 -4
  349. package/lib/scene/frame-cameras.js +28 -10
  350. package/lib/scene/gltf.d.ts +1 -1
  351. package/lib/scene/level-rule.d.ts +6 -5
  352. package/lib/scene/level-rule.js +2 -2
  353. package/lib/scene/particles.d.ts +7 -3
  354. package/lib/scene/particles.js +3 -1
  355. package/lib/scene/post.d.ts +3 -2
  356. package/lib/scene/resources.d.ts +15 -9
  357. package/lib/scene/scene.d.ts +18 -2
  358. package/lib/scene/scene.js +47 -5
  359. package/lib/scene/time-of-day.d.ts +10 -5
  360. package/lib/scene/time-of-day.js +11 -7
  361. package/lib/shader-artifact.json +1 -1
  362. package/lib/shared/labels.d.ts +5 -2
  363. package/lib/shared/labels.js +5 -2
  364. package/lib/shared/permutation-words.d.ts +2 -0
  365. package/lib/shared/permutation-words.js +8 -0
  366. package/lib/shared/recording.d.ts +13 -5
  367. package/lib/shared/recording.js +31 -10
  368. package/lib/shared/sketch-data.d.ts +9 -0
  369. package/lib/shared/sketch-data.js +57 -0
  370. package/lib/shared/version.d.ts +1 -1
  371. package/lib/shared/version.js +1 -1
  372. package/lib/sketch/define-sketch.d.ts +16 -7
  373. package/lib/sketch/define-sketch.js +2 -1
  374. package/lib/sketch/runner.d.ts +4 -0
  375. package/lib/sketch/runner.js +5 -0
  376. package/lib/sketch/ui.js +4 -2
  377. package/lib/stats.d.ts +1 -0
  378. package/lib/workers/protocol.d.ts +10 -0
  379. package/lib/workers/render-worker.js +4 -1
  380. package/lib/workers/sketch-worker.js +4 -1
  381. package/package.json +1 -1
@@ -1,8 +1,7 @@
1
1
  ---
2
2
  id: errors/E1209
3
3
  title: "E1209: Too many textures"
4
- status: generated
5
- since: "0.3"
4
+ generated: true
6
5
  summary: "A material whose shader reads more textures than a WebGL2 shader stage has units. The engine numbers the textures that a program reads, and WebGL2 gives every stage at least 16 units, as many as the device reports. The lit shader reads most of them, so a custom material or add-on draw reaches the limit with its own textures, beside the maps and the shadows."
7
6
  ---
8
7
 
@@ -16,8 +15,17 @@ A material whose shader reads more textures than a WebGL2 shader stage has units
16
15
 
17
16
  Give the material fewer textures. WebGL2 gives each shader stage at least 16 texture units, as many as the device reports, and the engine's lit shader reads most of them, so a custom material's own textures must fit in what is left. Use the standard material's own maps where they draw the effect.
18
17
 
19
- ## Example
18
+ [Where problems appear](../guides/debugging.md#where-problems-appear) says where each kind of error reaches your code.
19
+
20
+ ## Example message
21
+
22
+ The engine prints the part below, then the fix above and a link to this page.
20
23
 
21
24
  ```text
22
25
  E1209: a WebGL2 program reads 18 textures in its fragment stage, and a stage has 16 units: give the material fewer textures.
23
26
  ```
27
+
28
+ ## See also
29
+
30
+ - [Error codes](index.md)
31
+ - [Debugging](../guides/debugging.md)
@@ -1,23 +1,45 @@
1
1
  ---
2
2
  id: errors/E1213
3
3
  title: "E1213: Invalid setting"
4
- status: generated
5
- since: "0.1"
6
- summary: "A call received a setting that it does not have, or a value that the setting does not take. Examples are a tone mapping that the engine does not know, a negative exposure, a grading control outside its range, and a built-in environment that the engine does not have. It also covers a glTF extension handler that names no extension, that another handler reads, or that returns a part without a mesh or a material."
4
+ generated: true
5
+ summary: "A call received a setting that it does not have, or a value that the setting does not take. A tone mapping that the engine does not know, or a grading control outside its range, are examples."
7
6
  ---
8
7
 
9
8
  # E1213: Invalid setting
10
9
 
11
10
  ## What happened
12
11
 
13
- A call received a setting that it does not have, or a value that the setting does not take. Examples are a tone mapping that the engine does not know, a negative exposure, a grading control outside its range, and a built-in environment that the engine does not have. It also covers a glTF extension handler that names no extension, that another handler reads, or that returns a part without a mesh or a material.
12
+ A call received a setting that it does not have, or a value that the setting does not take. A tone mapping that the engine does not know, or a grading control outside its range, are examples.
13
+
14
+ <details>
15
+ <summary>Technical details: the calls and settings that raise it</summary>
16
+
17
+ `post.set()` refuses a tone mapping that the engine does not know, a negative exposure, and a grading control outside its range.
18
+
19
+ `assets.builtinEnvironment()` refuses a name that no built-in environment has.
20
+
21
+ `assets.registerGltfExtension()` refuses a handler that names no extension, that another handler reads, or that returns a part without a mesh or a material.
22
+
23
+ `createEngine()` refuses sketch data that is not plain JSON data, or that takes more than 64 KiB as JSON.
24
+
25
+ </details>
14
26
 
15
27
  ## How to fix it
16
28
 
17
29
  Pass only the settings that the call has, each with a value that it takes. The call's docs page lists them.
18
30
 
19
- ## Example
31
+ [Where problems appear](../guides/debugging.md#where-problems-appear) says where each kind of error reaches your code.
32
+
33
+ ## Example message
34
+
35
+ The engine prints the part below, then the fix above and a link to this page.
20
36
 
21
37
  ```text
22
38
  E1213: post.set() got the tone mapping "filmic", which is not 'agx', 'agx-punchy', 'neutral', 'aces' or 'none'.
23
39
  ```
40
+
41
+ ## See also
42
+
43
+ - [Materials](../api/materials.md)
44
+ - [Error codes](index.md)
45
+ - [Debugging](../guides/debugging.md)
@@ -1,8 +1,7 @@
1
1
  ---
2
2
  id: errors/E1214
3
3
  title: "E1214: Invalid sketch option"
4
- status: generated
5
- since: "0.1"
4
+ generated: true
6
5
  summary: "defineSketch() received an option out of its range. fixedRate must be a number above 0, and maxFixedSteps a whole number of 1 or more. downloads must be an array of file addresses: an empty string, or a string that is not an address, fails. The engine checks the options before it runs the setup function."
7
6
  ---
8
7
 
@@ -16,8 +15,17 @@ defineSketch() received an option out of its range. fixedRate must be a number a
16
15
 
17
16
  Give fixedRate the fixed steps per second, a number above 0 such as 60 or 120. Give maxFixedSteps a whole number of 1 or more, such as 8. Give downloads an array of the files that the setup loads, each a URL or an address string such as 'models/ship.glb'.
18
17
 
19
- ## Example
18
+ [Where problems appear](../guides/debugging.md#where-problems-appear) says where each kind of error reaches your code.
19
+
20
+ ## Example message
21
+
22
+ The engine prints the part below, then the fix above and a link to this page.
20
23
 
21
24
  ```text
22
25
  E1214: defineSketch() got 0 for fixedRate.
23
26
  ```
27
+
28
+ ## See also
29
+
30
+ - [Error codes](index.md)
31
+ - [Debugging](../guides/debugging.md)
@@ -1,23 +1,48 @@
1
1
  ---
2
2
  id: errors/E1215
3
3
  title: "E1215: Invalid custom WGSL"
4
- status: generated
5
- since: "0.1"
6
- summary: "materials.shader(), post.addEffect(), post.set() or scene.setSkyLayer() received WGSL that it cannot draw with. The null3D Vite plugin compiles WGSL while it builds the project. The engine therefore takes only what the plugin compiled: a template literal after a /* wgsl */ comment, or a .wgsl file that a module imports. The WGSL of a custom material declares a surface function, a vertex offset or a lobe. A full shader instead has a @vertex entry point that takes an InstanceIn from null3d::mesh. An effect declares fn effect, a tone curve fn toneCurve, and a sky layer fn skyLayer."
4
+ generated: true
5
+ summary: "`materials.shader()`, `post.addEffect()`, `post.set()` or `scene.setSkyLayer()` received WGSL that it cannot draw with. The engine takes only WGSL that the null3D Vite plugin compiled, as a shader of the kind that the call takes."
7
6
  ---
8
7
 
9
8
  # E1215: Invalid custom WGSL
10
9
 
11
10
  ## What happened
12
11
 
13
- materials.shader(), post.addEffect(), post.set() or scene.setSkyLayer() received WGSL that it cannot draw with. The null3D Vite plugin compiles WGSL while it builds the project. The engine therefore takes only what the plugin compiled: a template literal after a /* wgsl */ comment, or a .wgsl file that a module imports. The WGSL of a custom material declares a surface function, a vertex offset or a lobe. A full shader instead has a @vertex entry point that takes an InstanceIn from null3d::mesh. An effect declares fn effect, a tone curve fn toneCurve, and a sky layer fn skyLayer.
12
+ `materials.shader()`, `post.addEffect()`, `post.set()` or `scene.setSkyLayer()` received WGSL that it cannot draw with. The engine takes only WGSL that the null3D Vite plugin compiled, as a shader of the kind that the call takes.
14
13
 
15
14
  ## How to fix it
16
15
 
17
- Add the null3D Vite plugin to vite.config.ts. Write the WGSL in a template literal right after a /* wgsl */ comment, or import it from a .wgsl file. Declare fn surface(input: SurfaceInput) -> Surface, fn vertexOffset(input: VertexInput) -> vec3f or fn lobe(input: LobeInput) -> vec3f in it, with no @vertex or @fragment entry point. For a full shader, give the @vertex entry point an InstanceIn from null3d::mesh. For a draw that makes its own vertices, give it @builtin(vertex_index) and @builtin(instance_index) and no mesh attribute. Give post.addEffect() WGSL that declares fn effect(input: EffectInput) -> vec4f, post.set({ toneMapping }) WGSL that declares fn toneCurve(color: vec3f) -> vec3f, and scene.setSkyLayer() WGSL that declares fn skyLayer(input: SkyLayerInput) -> SkyLayer.
16
+ Add the null3D Vite plugin to `vite.config.ts`. Write the WGSL in a template literal right after a `/* wgsl */` comment, or import it from a `.wgsl` file. Give each call the WGSL that its kind declares: the table on this page lists each declaration.
18
17
 
19
- ## Example
18
+ <details>
19
+ <summary>Technical details: the WGSL that each call declares</summary>
20
+
21
+ | Call | WGSL declares |
22
+ | --- | --- |
23
+ | `materials.shader()`, surface | `fn surface(input: SurfaceInput) -> Surface`, with no `@vertex` or `@fragment` entry |
24
+ | `materials.shader()`, vertex offset | `fn vertexOffset(input: VertexInput) -> vec3f` |
25
+ | `materials.shader()`, lobe | `fn lobe(input: LobeInput) -> vec3f` |
26
+ | `materials.shader()`, full shader | a `@vertex` entry that takes an `InstanceIn` from `null3d::mesh` |
27
+ | `materials.shader()`, own vertices | a `@vertex` entry with `@builtin(vertex_index)` and `@builtin(instance_index)`, and no mesh attribute |
28
+ | `post.addEffect()` | `fn effect(input: EffectInput) -> vec4f` |
29
+ | `post.set({ toneMapping })` | `fn toneCurve(color: vec3f) -> vec3f` |
30
+ | `scene.setSkyLayer()` | `fn skyLayer(input: SkyLayerInput) -> SkyLayer` |
31
+
32
+ </details>
33
+
34
+ [Where problems appear](../guides/debugging.md#where-problems-appear) says where each kind of error reaches your code.
35
+
36
+ ## Example message
37
+
38
+ The engine prints the part below, then the fix above and a link to this page.
20
39
 
21
40
  ```text
22
41
  E1215: materials.shader() got WGSL as text, which the null3D Vite plugin did not compile.
23
42
  ```
43
+
44
+ ## See also
45
+
46
+ - [Custom shaders](../guides/custom-shaders.md)
47
+ - [Error codes](index.md)
48
+ - [Debugging](../guides/debugging.md)
@@ -1,23 +1,48 @@
1
1
  ---
2
2
  id: errors/E1216
3
3
  title: "E1216: Invalid uniform or texture"
4
- status: generated
5
- since: "0.1"
6
- summary: "A custom material's or effect's uniforms or textures did not match its WGSL. The uniforms option and set() take the names of the fields of struct Uniforms in the WGSL, each with a value of its type. A field cannot have the name of a standard value, such as color or roughness, because set() takes those too. The textures option takes the names of the WGSL's `var name: texture_2d<f32>;` and `var name: texture_2d_array<f32>;` declarations, each with a texture of the layers that its declaration takes."
4
+ generated: true
5
+ summary: "A custom material's or effect's uniforms or textures did not match its WGSL. The options take the names of the fields of `struct Uniforms` and of the WGSL's texture declarations. Give each one a value or texture of the type that its declaration takes, and leave standard values such as `color` to `set()`."
7
6
  ---
8
7
 
9
8
  # E1216: Invalid uniform or texture
10
9
 
11
10
  ## What happened
12
11
 
13
- A custom material's or effect's uniforms or textures did not match its WGSL. The uniforms option and set() take the names of the fields of struct Uniforms in the WGSL, each with a value of its type. A field cannot have the name of a standard value, such as color or roughness, because set() takes those too. The textures option takes the names of the WGSL's `var name: texture_2d<f32>;` and `var name: texture_2d_array<f32>;` declarations, each with a texture of the layers that its declaration takes.
12
+ A custom material's or effect's uniforms or textures did not match its WGSL. The options take the names of the fields of `struct Uniforms` and of the WGSL's texture declarations. Give each one a value or texture of the type that its declaration takes, and leave standard values such as `color` to `set()`.
14
13
 
15
14
  ## How to fix it
16
15
 
17
- Use the names of the fields of struct Uniforms in the WGSL. Give an f32 a number, and an i32 or a u32 a whole number. Give a vec2f, vec3f or vec4f an array of 2, 3 or 4 numbers. A vec3f also takes a color. Rename a field that has the name of a standard value, such as color. Give a slot that the WGSL declares as a texture_2d<f32> a texture of one layer, and a slot that it declares as a texture_2d_array<f32> a texture of several layers, from textures.fromData with a depth or a KTX2 file of layers. Give post.setEffectUniform() an effect that post.addEffect() returned.
16
+ Use the names of the fields of `struct Uniforms` in the WGSL, and the names of its texture declarations. Give each value the type that its declaration takes. Rename a field that has the name of a standard value, such as `color`. Give `post.setEffectUniform()` an effect that `post.addEffect()` returned.
18
17
 
19
- ## Example
18
+ <details>
19
+ <summary>Technical details: the value that each WGSL type takes</summary>
20
+
21
+ | WGSL type | Give |
22
+ | --- | --- |
23
+ | `f32` | a number |
24
+ | `i32` | a whole number |
25
+ | `u32` | a whole number |
26
+ | `vec2f` | an array of 2 numbers |
27
+ | `vec3f` | an array of 3 numbers, or a color |
28
+ | `vec4f` | an array of 4 numbers |
29
+ | `texture_2d<f32>` | a texture of one layer |
30
+ | `texture_2d_array<f32>` | a texture of one or more layers, from `textures.fromData()` with a depth or a KTX2 file of layers |
31
+
32
+ </details>
33
+
34
+ [Where problems appear](../guides/debugging.md#where-problems-appear) says where each kind of error reaches your code.
35
+
36
+ ## Example message
37
+
38
+ The engine prints the part below, then the fix above and a link to this page.
20
39
 
21
40
  ```text
22
41
  E1216: materials.shader.set() got speeed, which is not a uniform of the material's WGSL.
23
42
  ```
43
+
44
+ ## See also
45
+
46
+ - [Custom shaders](../guides/custom-shaders.md)
47
+ - [Error codes](index.md)
48
+ - [Debugging](../guides/debugging.md)
@@ -1,23 +1,46 @@
1
1
  ---
2
2
  id: errors/E1217
3
3
  title: "E1217: Invalid material option"
4
- status: generated
5
- since: "0.1"
6
- summary: "A material factory or scene.createLines() received an option value that it does not take, such as an unknown alpha mode, blending or line mode. Custom materials refuse the 'weighted' blending, and take alpha to coverage or the hash mode only where their WGSL sets or reads the surface's alpha. A material that lets light through refuses the hash alpha mode and the weighted blending. A layered material, with a clear coat, a sheen, iridescence or anisotropy, refuses a light map, specular maps, and two textures for a pair of layer maps that glTF packs into one. It refuses a transmission or a thickness map only where one of its layer maps fills the array that the map samples: the clear coat's normal map and iridescence's thickness map fill the array that the transmission map samples, and the sheen's maps and the anisotropy map fill the array that the thickness map samples. A material with transmission refuses a thickness map beside a specular color map, whose sRGB texture never shares the thickness map's array, and other materials refuse those two maps. A material that lets light through to its other side refuses the specular maps, whose places its diffuse transmission maps take, a clear coat, a sheen and the weighted blending, and other materials refuse the diffuse transmission maps. A custom material refuses subsurfaceRadius, which only a standard material takes. A custom material whose WGSL declares a coverage function takes the mask mode, or the blend mode with the cutoff that its shadow caster tests."
4
+ generated: true
5
+ summary: "A material factory or scene.createLines() got an option value that it does not take, or two options that cannot go together. The message names the option and the rule it breaks."
7
6
  ---
8
7
 
9
8
  # E1217: Invalid material option
10
9
 
11
10
  ## What happened
12
11
 
13
- A material factory or scene.createLines() received an option value that it does not take, such as an unknown alpha mode, blending or line mode. Custom materials refuse the 'weighted' blending, and take alpha to coverage or the hash mode only where their WGSL sets or reads the surface's alpha. A material that lets light through refuses the hash alpha mode and the weighted blending. A layered material, with a clear coat, a sheen, iridescence or anisotropy, refuses a light map, specular maps, and two textures for a pair of layer maps that glTF packs into one. It refuses a transmission or a thickness map only where one of its layer maps fills the array that the map samples: the clear coat's normal map and iridescence's thickness map fill the array that the transmission map samples, and the sheen's maps and the anisotropy map fill the array that the thickness map samples. A material with transmission refuses a thickness map beside a specular color map, whose sRGB texture never shares the thickness map's array, and other materials refuse those two maps. A material that lets light through to its other side refuses the specular maps, whose places its diffuse transmission maps take, a clear coat, a sheen and the weighted blending, and other materials refuse the diffuse transmission maps. A custom material refuses subsurfaceRadius, which only a standard material takes. A custom material whose WGSL declares a coverage function takes the mask mode, or the blend mode with the cutoff that its shadow caster tests.
12
+ A material factory or scene.createLines() got an option value that it does not take, or two options that cannot go together. The message names the option and the rule it breaks.
13
+
14
+ <details>
15
+ <summary>Technical details: the rules for each material option</summary>
16
+
17
+ A material factory or scene.createLines() received an option value that it does not take, such as an unknown alpha mode, blending or line mode. Custom materials refuse the 'weighted' blending, and take alpha to coverage or the hash mode only where their WGSL sets or reads the surface's alpha. A material that lets light through refuses the hash alpha mode and the weighted blending.
18
+
19
+ A layered material, with a clear coat, a sheen, iridescence or anisotropy, refuses a light map, specular maps, and two textures for a pair of layer maps that glTF packs into one. It refuses a transmission or a thickness map only where one of its layer maps fills the array that the map samples: the clear coat's normal map and iridescence's thickness map fill the array that the transmission map samples, and the sheen's maps and the anisotropy map fill the array that the thickness map samples.
20
+
21
+ A material with transmission refuses a thickness map beside a specular color map, whose sRGB texture never shares the thickness map's array, and other materials refuse those two maps.
22
+
23
+ A material that lets light through to its other side refuses the specular maps, whose places its diffuse transmission maps take, a clear coat, a sheen and the weighted blending, and other materials refuse the diffuse transmission maps. A custom material refuses subsurfaceRadius, which only a standard material takes. A custom material whose WGSL declares a coverage function takes the mask mode, or the blend mode with the cutoff that its shadow caster tests.
24
+
25
+ </details>
14
26
 
15
27
  ## How to fix it
16
28
 
17
- Give alphaMode 'opaque', 'mask', 'hash' or 'blend', and blending 'normal', 'additive', 'multiply' or 'weighted'. three.js's transparent: true is alphaMode: 'blend', and its alphaTest is alphaMode: 'mask' with alphaCutoff. A custom material takes 'opaque', 'mask', 'hash' or 'blend', and no 'weighted' blending. It takes alphaToCoverage or the hash mode only where its WGSL sets or reads the surface's alpha, such as s.alpha = texel.a in fn surface. A draw that makes its own vertices blends, and its WGSL declares no texture. A material with transmission takes 'opaque', 'mask' or 'blend', not the 'weighted' blending, and a custom one needs WGSL that sets the surface's transmission. A layered material takes no lightMap or specular maps: give clearcoatMap with clearcoatRoughnessMap as one texture, and sheenColorMap with sheenRoughnessMap as one. Give diffuseTransmissionMap and diffuseTransmissionColorMap only with diffuseTransmission, and no specular maps beside them. Give transmissionMap and thicknessMap only with transmission. Each samples a specular slot's texture array at a layer of its own, so a specular map may draw beside them when the two textures share an array, and a thicknessMap refuses a specularColorMap, whose sRGB texture never shares its array. A layered material keeps them beside the layer map of the light map's slot, but not beside a layer map of the array that one of them samples: transmissionMap samples the specular intensity slot's array, and thicknessMap the specular color slot's. Give diffuseTransmission without a clear coat, a sheen or the 'weighted' blending. A material's layer maps come from one family: the coat's and the sheen's, or iridescence's and the anisotropy's, since they take the same slots. Give an anisotropy map, and another map that gives the surface's texture coordinates. A custom material with diffuseTransmission needs WGSL that sets the surface's diffuseTransmission. Give subsurfaceRadius to materials.standard: a custom material draws no subsurface blur. Give a custom material that declares a coverage function alphaMode 'mask', or 'blend' with the alphaCutoff that its caster tests.
29
+ Give alphaMode 'opaque', 'mask', 'hash' or 'blend', and blending 'normal', 'additive', 'multiply' or 'weighted'. three.js's transparent: true is alphaMode: 'blend', and its alphaTest is alphaMode: 'mask' with alphaCutoff. For a conflict between two options, follow the message, or read the rule for each kind of material on the E1217 docs page.
30
+
31
+ [Where problems appear](../guides/debugging.md#where-problems-appear) says where each kind of error reaches your code.
32
+
33
+ ## Example message
18
34
 
19
- ## Example
35
+ The engine prints the part below, then the fix above and a link to this page.
20
36
 
21
37
  ```text
22
38
  E1217: materials.standard() got the alpha mode "cutout"; it takes 'opaque', 'mask' or 'blend'.
23
39
  ```
40
+
41
+ ## See also
42
+
43
+ - [Materials](../api/materials.md)
44
+ - [Lines](../api/lines.md)
45
+ - [Error codes](index.md)
46
+ - [Debugging](../guides/debugging.md)
@@ -1,23 +1,39 @@
1
1
  ---
2
2
  id: errors/E1218
3
3
  title: "E1218: Invalid animation call"
4
- status: generated
5
- since: "0.2"
6
- summary: "An animator call named a clip, layer or joint that the object's animation does not have. Or it got an option out of range, such as a negative fade. animator() was called on an object that has no animation clips. Or the engine refused animation data, such as a skeleton that lists a joint before its parent. Or setMorphWeight or getMorphWeight named a morph target that the mesh does not have. A clip of more than 4,194,304 keys, its frames times its tracks, is refused too, as a clip whose keys lie hours apart is."
4
+ generated: true
5
+ summary: "An animation call, or animation data that the engine loads, named something that does not exist or gave a value out of range. The call can be an animator call, a morph-weight call or `animateProperty()`."
7
6
  ---
8
7
 
9
8
  # E1218: Invalid animation call
10
9
 
11
10
  ## What happened
12
11
 
13
- An animator call named a clip, layer or joint that the object's animation does not have. Or it got an option out of range, such as a negative fade. animator() was called on an object that has no animation clips. Or the engine refused animation data, such as a skeleton that lists a joint before its parent. Or setMorphWeight or getMorphWeight named a morph target that the mesh does not have. A clip of more than 4,194,304 keys, its frames times its tracks, is refused too, as a clip whose keys lie hours apart is.
12
+ An animation call, or animation data that the engine loads, named something that does not exist or gave a value out of range. The call can be an animator call, a morph-weight call or `animateProperty()`.
13
+
14
+ - An unknown clip, layer or joint.
15
+ - An option out of range, such as a negative fade, a layer outside 0 to 3, or a weight outside 0 to 1.
16
+ - `animator()` on an object that has no animation clips.
17
+ - A morph target that the mesh does not have.
18
+ - Two clips with the same name, or a clip event named `loop` or `finished`.
19
+ - Animation data that the core refuses, such as a skeleton that lists a joint before its parent.
20
+ - A clip of more than 4,194,304 keys, which is its frames times its tracks.
14
21
 
15
22
  ## How to fix it
16
23
 
17
- Use the names in animator.clips, and the joint names of the model's skeleton. Give layers whole numbers from 0 to 3, weights from 0 to 1, and fades of 0 or more seconds. Call animator() only on an object that a glTF file with animations created. Name your clip events anything but 'loop' and 'finished', which the animator reports itself. Give setMorphWeight a target number below its geometry's morphTargets, or a name in its morphTargetNames. Trim a clip that holds keys hours apart, or split a long clip into shorter ones.
24
+ Use the names in `animator.clips`, and the joint names of the model's skeleton. Call `animator()` only on an object that a glTF file with animations created, and name clip events anything but `loop` and `finished`. Give `setMorphWeight` a target number below its geometry's `morphTargets`, or a name in its `morphTargetNames`. Trim or split a clip that holds keys hours apart, and keep layers, weights and fades inside the range that the message gives.
25
+
26
+ [Where problems appear](../guides/debugging.md#where-problems-appear) says where each kind of error reaches your code.
27
+
28
+ ## Example message
18
29
 
19
- ## Example
30
+ The engine prints the part below, then the fix above and a link to this page.
20
31
 
21
32
  ```text
22
33
  E1218: play() got "rnu", which names no clip of "Hero" (slot 3). Its clips are idle, run and walk.
23
34
  ```
35
+
36
+ ## See also
37
+
38
+ - [Error codes](index.md)
39
+ - [Debugging](../guides/debugging.md)
@@ -1,8 +1,7 @@
1
1
  ---
2
2
  id: errors/E1219
3
3
  title: "E1219: Invalid label"
4
- status: generated
5
- since: "0.2"
4
+ generated: true
6
5
  summary: "ui.trackLabel() or ui.untrackLabel() got an id that is not a string with at least one character. Or trackLabel() got a transform that is not 'screen', 'world' or 'billboard', or a rotation that is not a number for a label that faces the camera. Or the sketch tracked more labels at once than createEngine's maxLabels option allows: 4,096 by default. A label that is a plane of the scene counts against maxLabels3d instead, which holds 256 by default."
7
6
  ---
8
7
 
@@ -16,8 +15,17 @@ ui.trackLabel() or ui.untrackLabel() got an id that is not a string with at leas
16
15
 
17
16
  Give each label an id of its own, such as 'hp-12', and pass the same id to engine.labels.bind on the page. Give transform one of 'screen', 'world' or 'billboard', and a rotation only to a billboard label. Untrack labels that you no longer show with ui.untrackLabel. To track more labels at once, raise createEngine's maxLabels option, or maxLabels3d for labels that are planes of the scene.
18
17
 
19
- ## Example
18
+ [Where problems appear](../guides/debugging.md#where-problems-appear) says where each kind of error reaches your code.
19
+
20
+ ## Example message
21
+
22
+ The engine prints the part below, then the fix above and a link to this page.
20
23
 
21
24
  ```text
22
25
  E1219: trackLabel() could not track "hp-4097": the engine already tracks 4096 labels. Raise createEngine()'s maxLabels option for more.
23
26
  ```
27
+
28
+ ## See also
29
+
30
+ - [Error codes](index.md)
31
+ - [Debugging](../guides/debugging.md)
@@ -1,23 +1,42 @@
1
1
  ---
2
2
  id: errors/E1220
3
3
  title: "E1220: Invalid render pass"
4
- status: generated
5
- since: "0.2"
6
- summary: "render.addPass() got options that it does not take: an unknown kind or option, no camera, a size outside 1 to the largest texture, both a size and a scale, an input image it does not know, a workgroup size or dispatch that a device cannot run, a format that a compute pass does not write, a compute pass on WebGL2 with no fallback, or a texture name or pass name that another pass has. Or the sketch added more passes than draw at once: 31. Or textures.fromPass(), render.setPassEnabled(), render.setPassUniform(), render.setPassUniforms() or render.removePass() got something that is not a render pass, render.setPassUniform() got a pass that is not a full-screen pass, or render.setPassUniforms() got a pass that is not a compute pass."
4
+ generated: true
5
+ summary: "A render pass call got options that it does not take, or a pass of a kind that it does not work on. The message names the call and the rule that it breaks."
7
6
  ---
8
7
 
9
8
  # E1220: Invalid render pass
10
9
 
11
10
  ## What happened
12
11
 
13
- render.addPass() got options that it does not take: an unknown kind or option, no camera, a size outside 1 to the largest texture, both a size and a scale, an input image it does not know, a workgroup size or dispatch that a device cannot run, a format that a compute pass does not write, a compute pass on WebGL2 with no fallback, or a texture name or pass name that another pass has. Or the sketch added more passes than draw at once: 31. Or textures.fromPass(), render.setPassEnabled(), render.setPassUniform(), render.setPassUniforms() or render.removePass() got something that is not a render pass, render.setPassUniform() got a pass that is not a full-screen pass, or render.setPassUniforms() got a pass that is not a compute pass.
12
+ A render pass call got options that it does not take, or a pass of a kind that it does not work on. The message names the call and the rule that it breaks.
13
+
14
+ <details>
15
+ <summary>Technical details: what each render call refuses</summary>
16
+
17
+ `render.addPass()` refuses an unknown kind or option, no camera, and a size outside 1 to the largest texture. It refuses both a size and a scale, an unknown input image, and a workgroup size or dispatch that a device cannot run.
18
+
19
+ It refuses a format that a compute pass does not write, and a compute pass on WebGL2 with no fallback. It refuses a texture name or pass name that another pass has, and a 32nd live pass, since at most 31 passes draw at once.
20
+
21
+ `textures.fromPass()`, `render.setPassEnabled()` and `render.removePass()` take any render pass. `render.setPassUniform()` takes a full-screen pass, and `render.setPassUniforms()` takes a compute pass and at most 32 numbers.
22
+
23
+ </details>
14
24
 
15
25
  ## How to fix it
16
26
 
17
27
  Give render.addPass the options of its kind, such as { kind: 'scene', camera, writes: 'minimap', size: [256, 256] }. Give a compute pass a workgroup size that the shader declares and that a device runs, and a fallback for WebGL2. Give each pass a name and a texture name of its own. Remove passes that no longer draw before you add more.
18
28
 
19
- ## Example
29
+ [Where problems appear](../guides/debugging.md#where-problems-appear) says where each kind of error reaches your code.
30
+
31
+ ## Example message
32
+
33
+ The engine prints the part below, then the fix above and a link to this page.
20
34
 
21
35
  ```text
22
36
  E1220: render.addPass() got writes "minimap", which the pass "minimap" writes already. Give each pass a texture name of its own.
23
37
  ```
38
+
39
+ ## See also
40
+
41
+ - [Error codes](index.md)
42
+ - [Debugging](../guides/debugging.md)
@@ -1,23 +1,42 @@
1
1
  ---
2
2
  id: errors/E1221
3
3
  title: "E1221: Invalid levels of detail"
4
- status: generated
5
- since: "0.2"
6
- summary: "mesh.setLevels() received levels that the mesh cannot take, or a glTF file's MSFT_lod levels could not become them. Each level's error, distance or coverage must be a finite number above 0, and its switch distance must lie farther than the level's before it. A coarser level covers more of the screen, so its coverage is smaller. A mesh takes at most 15 lower levels. Each level must be another live mesh of the same engine, with the same vertex attributes as the base mesh. A level's material, where it gives one, must be a live material of the same engine. mesh.buildLevels() refuses a mesh with joints, morph targets or a vertex record, whose shape poses or moves."
4
+ generated: true
5
+ summary: "`mesh.setLevels()` received levels that the mesh cannot take, or a glTF file's MSFT_lod levels could not become them. Each level gives one of an error, a distance and a coverage, and the switch distances grow from level to level."
7
6
  ---
8
7
 
9
8
  # E1221: Invalid levels of detail
10
9
 
11
10
  ## What happened
12
11
 
13
- mesh.setLevels() received levels that the mesh cannot take, or a glTF file's MSFT_lod levels could not become them. Each level's error, distance or coverage must be a finite number above 0, and its switch distance must lie farther than the level's before it. A coarser level covers more of the screen, so its coverage is smaller. A mesh takes at most 15 lower levels. Each level must be another live mesh of the same engine, with the same vertex attributes as the base mesh. A level's material, where it gives one, must be a live material of the same engine. mesh.buildLevels() refuses a mesh with joints, morph targets or a vertex record, whose shape poses or moves.
12
+ `mesh.setLevels()` received levels that the mesh cannot take, or a glTF file's MSFT_lod levels could not become them. Each level gives one of an error, a distance and a coverage, and the switch distances grow from level to level.
13
+
14
+ <details>
15
+ <summary>Technical details: the rules for each level</summary>
16
+
17
+ A mesh takes at most 15 lower levels. Each level gives exactly one of an error, a distance and a coverage, as a finite number above 0. Its switch distance must lie farther than the level before it, and a coarser level covers more of the screen, so its coverage is smaller.
18
+
19
+ Each level must be another live mesh of the same engine, with the same vertex attributes as the base mesh. A level's material, where it gives one, must be a live material of the same engine. The `fov` option sets the reference view, and lies between 0 and 180.
20
+
21
+ `mesh.buildLevels()` refuses a mesh with joints, morph targets or a vertex record, whose shape poses or moves.
22
+
23
+ </details>
14
24
 
15
25
  ## How to fix it
16
26
 
17
27
  List the levels from the most detailed down, each with a larger error, a farther distance or a smaller coverage than the one before, at most 15 of them. Make each level from the same kind of arrays as the base mesh, with the same attributes, such as the same texture coordinates and tangents. Give a mesh that poses or moves its levels with setLevels, not buildLevels.
18
28
 
19
- ## Example
29
+ [Where problems appear](../guides/debugging.md#where-problems-appear) says where each kind of error reaches your code.
30
+
31
+ ## Example message
32
+
33
+ The engine prints the part below, then the fix above and a link to this page.
20
34
 
21
35
  ```text
22
36
  E1221: mesh.setLevels() got an error of 0.02 for level 2, not above the 0.05 of level 1. Errors grow from level to level.
23
37
  ```
38
+
39
+ ## See also
40
+
41
+ - [Error codes](index.md)
42
+ - [Debugging](../guides/debugging.md)
@@ -1,8 +1,7 @@
1
1
  ---
2
2
  id: errors/E1222
3
3
  title: "E1222: Invalid light probe grid texture"
4
- status: generated
5
- since: "0.2"
4
+ generated: true
6
5
  summary: "scene.setLightProbeGrid() received a texture that is not a 3D texture. A probe grid sample reads a 3D texture, so the frame cannot bind a texture array in its place. setLightProbeGrid() also refuses a texture that is not live."
7
6
  ---
8
7
 
@@ -16,8 +15,17 @@ scene.setLightProbeGrid() received a texture that is not a 3D texture. A probe g
16
15
 
17
16
  Make the grid's texture with LightProbeGridData.toTexture(), which a 3D texture alone holds, or with textures.fromVolumeData(). An image texture, or one made with textures.fromData() and a depth, is a texture array, which the probe grid cannot bind.
18
17
 
19
- ## Example
18
+ [Where problems appear](../guides/debugging.md#where-problems-appear) says where each kind of error reaches your code.
19
+
20
+ ## Example message
21
+
22
+ The engine prints the part below, then the fix above and a link to this page.
20
23
 
21
24
  ```text
22
25
  E1222: setLightProbeGrid() got a texture that is not a 3D texture. Make the grid's texture with LightProbeGridData.toTexture().
23
26
  ```
27
+
28
+ ## See also
29
+
30
+ - [Error codes](index.md)
31
+ - [Debugging](../guides/debugging.md)
@@ -1,23 +1,56 @@
1
1
  ---
2
2
  id: errors/E1223
3
3
  title: "E1223: Invalid feature description"
4
- status: generated
5
- since: "0.3"
6
- summary: "defineFeature(), FeatureRegistry.add(), addFeatureDraw(), post.addFeatureEffect(), scene.setSkyLayer() or a compute pass of render.addPass() got a description that it cannot take: an unknown option, a name that is empty or longer than 64 characters, a frame point or kind that does not exist or does not go together, an order outside its band, an unknown resource, lighting slot or view, a resource or view without a frame point, an output with no neutral default, a feature name, output name or debug view name that another feature has, a lighting slot that another feature provides, a debug view name that names one of the views that the engine draws itself or gives no set callback, a draw at a frame point, view or alpha mode that the draw adapter does not place, a full-screen effect at another frame point or view, writing another resource, reading one the effect chain does not bind, publishing an output, providing a slot, or disagreeing with its WGSL about the scene depth, a sky layer that does not record at the background point, as a draw, providing the sky and drawing in the three views, or a compute pass at a frame point, view, scene resource read or output that the compute adapter does not place."
4
+ generated: true
5
+ summary: "A call that registers a feature, a feature draw, a full-screen effect, a sky layer or a compute pass got a description it cannot take. The message names the value and the rule that it breaks."
7
6
  ---
8
7
 
9
8
  # E1223: Invalid feature description
10
9
 
11
10
  ## What happened
12
11
 
13
- defineFeature(), FeatureRegistry.add(), addFeatureDraw(), post.addFeatureEffect(), scene.setSkyLayer() or a compute pass of render.addPass() got a description that it cannot take: an unknown option, a name that is empty or longer than 64 characters, a frame point or kind that does not exist or does not go together, an order outside its band, an unknown resource, lighting slot or view, a resource or view without a frame point, an output with no neutral default, a feature name, output name or debug view name that another feature has, a lighting slot that another feature provides, a debug view name that names one of the views that the engine draws itself or gives no set callback, a draw at a frame point, view or alpha mode that the draw adapter does not place, a full-screen effect at another frame point or view, writing another resource, reading one the effect chain does not bind, publishing an output, providing a slot, or disagreeing with its WGSL about the scene depth, a sky layer that does not record at the background point, as a draw, providing the sky and drawing in the three views, or a compute pass at a frame point, view, scene resource read or output that the compute adapter does not place.
12
+ A call that registers a feature, a feature draw, a full-screen effect, a sky layer or a compute pass got a description it cannot take. The message names the value and the rule that it breaks.
13
+
14
+ <details>
15
+ <summary>Technical details: every description that the engine refuses</summary>
16
+
17
+ - Names: a name that is empty, longer than 64 characters, or holds a line break. A feature, output or debug view name that another feature has. An output name that names one of the engine's own resources.
18
+ - Frame points, kinds and order: a frame point or kind that does not exist, or two that do not go together. A kind, read, write or view without a frame point. An order outside its band.
19
+ - Resources, slots, views and outputs: an unknown resource, lighting slot or view, or the same one twice. An output without a neutral default. A lighting slot that another feature provides. A debug view that names an engine view, or whose set is not a function.
20
+ - Settings and budgets: an option that a description does not take. A setting whose presets are not four values from its range. A governor without a budget. A budget whose presets are not four times above 0, or whose minimum is outside 0 to 1.
21
+ - The GPU scope: a pass that `render.addPass()` did not return.
22
+
23
+ </details>
14
24
 
15
25
  ## How to fix it
16
26
 
17
- Give each feature and output a name of its own. Give a frame point and a kind that go together, such as 'opaque' with 'draw' or 'post' with 'fullscreen'. Keep an order inside its band. Name resources, lighting slots and views from the lists. Give every output a neutral default: 'black', 'white' or 'transparent', and 'black' or 'transparent' for a compute pass. One feature provides each lighting slot. Give each setting's presets a value that its values take, and a governor only with a budget. Give the budget four times in ms above 0. A full-screen effect records at the resolve point, in the main view, reads 'sceneColor' and the depth only when its WGSL reads it with effectDepth, effectViewPosition or effectDistance, and writes 'sceneColor' alone. A sky layer's description records at the background point, as a draw, provides the sky, and draws in the main, scene-pass and reflection views.
27
+ Give each feature and output a name of its own. Give a frame point and a kind that go together, and keep the order inside its band. Name resources, lighting slots and views from the lists, and give every output a neutral default. One feature provides each lighting slot, and a setting takes the values that its range allows.
28
+
29
+ <details>
30
+ <summary>Technical details: what each kind of feature accepts</summary>
31
+
32
+ | Kind | Frame point | Views | Rules |
33
+ | --- | --- | --- | --- |
34
+ | Draw | 'opaque', 'transparent' or 'resolve' | main | The alpha mode must match the frame. |
35
+ | Full-screen effect | 'resolve' | main | Reads 'sceneColor', and 'sceneDepth' when its WGSL reads the depth. Writes 'sceneColor' alone. |
36
+ | Sky layer | 'background' | main, scenePass and reflection | Provides 'sky'. |
37
+ | Compute pass | 'background', 'opaque', 'transparent', 'resolve' or 'post' | main | Reads no scene resource. Publishes one output texture, or fills an instance draw's buffers. |
38
+
39
+ A full-screen effect publishes no texture and provides no lighting slot. A compute pass that fills an instance draw publishes no output. A budget gives its time in ms at full quality on each preset: four numbers above 0.
18
40
 
19
- ## Example
41
+ </details>
42
+
43
+ [Where problems appear](../guides/debugging.md#where-problems-appear) says where each kind of error reaches your code.
44
+
45
+ ## Example message
46
+
47
+ The engine prints the part below, then the fix above and a link to this page.
20
48
 
21
49
  ```text
22
50
  E1223: FeatureRegistry.add() got the slot 'ao', which the feature 'ambient-occlusion' provides already. One feature provides each lighting slot.
23
51
  ```
52
+
53
+ ## See also
54
+
55
+ - [Error codes](index.md)
56
+ - [Debugging](../guides/debugging.md)
@@ -1,8 +1,7 @@
1
1
  ---
2
2
  id: errors/E1224
3
3
  title: "E1224: Material cannot draw a mesh"
4
- status: generated
5
- since: "0.3"
4
+ generated: true
6
5
  summary: "scene.overrideMaterial received a sprite, point or line material. Such a material draws the rows of its batch, or a sprite or line of its own, rather than the surface of a mesh, so it cannot stand in for every mesh of the pass."
7
6
  ---
8
7
 
@@ -16,8 +15,17 @@ scene.overrideMaterial received a sprite, point or line material. Such a materia
16
15
 
17
16
  Give scene.overrideMaterial a material that draws meshes, from materials.standard(), materials.unlit(), materials.shader() or materials.decal(), or null to draw each mesh with its own material.
18
17
 
19
- ## Example
18
+ [Where problems appear](../guides/debugging.md#where-problems-appear) says where each kind of error reaches your code.
19
+
20
+ ## Example message
21
+
22
+ The engine prints the part below, then the fix above and a link to this page.
20
23
 
21
24
  ```text
22
25
  E1224: scene.overrideMaterial got a sprite material. It takes a material that draws meshes, from materials.standard(), materials.unlit(), materials.shader() or materials.decal().
23
26
  ```
27
+
28
+ ## See also
29
+
30
+ - [Error codes](index.md)
31
+ - [Debugging](../guides/debugging.md)
@@ -1,8 +1,7 @@
1
1
  ---
2
2
  id: errors/E1225
3
3
  title: "E1225: Add-on name clash"
4
- status: generated
5
- since: "0.3"
4
+ generated: true
6
5
  summary: "An add-on registered a name that the engine or another add-on holds: its namespace, its shader library, an error-code range, a quality key, or the name of a feature, output or lighting slot. A namespace also names the package that owns it, so a second add-on that takes the name is refused even when its other fields match, while a reload of the same package keeps its namespace. Two add-ons cannot share a name, a range or a key, because the engine would have two answers for one of them."
7
6
  ---
8
7
 
@@ -16,8 +15,17 @@ An add-on registered a name that the engine or another add-on holds: its namespa
16
15
 
17
16
  Give each add-on a namespace of its own: one name at declareAddonNamespace(), claimed once where the add-on's module loads, with the package that owns it. Let its shader library default to that name, keep its error codes inside 2000 to 9999, and give its quality keys names that the engine's table lacks. Give each feature, output and lighting slot a name that no other add-on registers. Two add-ons that share a name cannot load together.
18
17
 
19
- ## Example
18
+ [Where problems appear](../guides/debugging.md#where-problems-appear) says where each kind of error reaches your code.
19
+
20
+ ## Example message
21
+
22
+ The engine prints the part below, then the fix above and a link to this page.
20
23
 
21
24
  ```text
22
25
  E1225: declareAddonNamespace() got the add-on name 'water' for the package '@ben/water', which the package '@ana/water' claims already. Give each add-on a name of its own.
23
26
  ```
27
+
28
+ ## See also
29
+
30
+ - [Error codes](index.md)
31
+ - [Debugging](../guides/debugging.md)