@origingame/engine 0.4.0 → 0.5.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 (78) hide show
  1. package/dist/web/origin-engine.d.ts +8 -5
  2. package/dist/web/origin-engine.js +39 -19
  3. package/dist/web/origin-engine_bg.wasm +0 -0
  4. package/dist/web/origin-engine_bg.wasm.d.ts +6 -5
  5. package/dist/web-publish/origin-engine-lanes.js +49 -29
  6. package/dist/web-publish/origin-engine-lanes_bg.wasm +0 -0
  7. package/dist/web-publish/origin-engine.d.ts +8 -5
  8. package/dist/web-publish/origin-engine.js +39 -19
  9. package/dist/web-publish/origin-engine_bg.wasm +0 -0
  10. package/dist/web-publish/origin-engine_bg.wasm.d.ts +6 -5
  11. package/dist/web-publish-2d/origin-engine-lanes.js +49 -29
  12. package/dist/web-publish-2d/origin-engine-lanes_bg.wasm +0 -0
  13. package/dist/web-publish-2d/origin-engine.d.ts +8 -5
  14. package/dist/web-publish-2d/origin-engine.js +39 -19
  15. package/dist/web-publish-2d/origin-engine_bg.wasm +0 -0
  16. package/dist/web-publish-2d/origin-engine_bg.wasm.d.ts +6 -5
  17. package/knowledge/looks/catalogue.json +123 -2
  18. package/knowledge/package.json +1 -1
  19. package/knowledge/scaffold/origin-engine.json +2 -2
  20. package/knowledge/scaffold/template/package.json +1 -1
  21. package/knowledge/scaffold/template/project.ogt +1 -1
  22. package/knowledge/scripts/validate.ts +69 -6
  23. package/knowledge/skills/og-audio/SKILL.md +31 -5
  24. package/knowledge/skills/og-build/SKILL.md +44 -4
  25. package/knowledge/skills/og-core/SKILL.md +4 -3
  26. package/knowledge/skills/og-feel/SKILL.md +9 -1
  27. package/knowledge/skills/og-game/SKILL.md +199 -16
  28. package/knowledge/skills/og-platform-sdk/SKILL.md +6 -0
  29. package/knowledge/skills/og-taste/SKILL.md +7 -0
  30. package/knowledge/skills/og-ui/SKILL.md +24 -0
  31. package/knowledge/wiki/ai.md +20 -20
  32. package/knowledge/wiki/anim.md +526 -60
  33. package/knowledge/wiki/atmosphere.md +13 -13
  34. package/knowledge/wiki/audio.md +160 -20
  35. package/knowledge/wiki/camera.md +13 -13
  36. package/knowledge/wiki/commands.md +11 -11
  37. package/knowledge/wiki/debug.md +13 -13
  38. package/knowledge/wiki/game.md +8 -8
  39. package/knowledge/wiki/i18n.md +7 -7
  40. package/knowledge/wiki/index.md +25 -1
  41. package/knowledge/wiki/input.md +47 -47
  42. package/knowledge/wiki/load.md +76 -50
  43. package/knowledge/wiki/math.md +102 -102
  44. package/knowledge/wiki/nav.md +34 -34
  45. package/knowledge/wiki/net.md +10 -10
  46. package/knowledge/wiki/path.md +14 -14
  47. package/knowledge/wiki/physics.md +111 -100
  48. package/knowledge/wiki/platform.md +44 -44
  49. package/knowledge/wiki/probe.md +86 -86
  50. package/knowledge/wiki/reflect.md +17 -17
  51. package/knowledge/wiki/render.md +245 -176
  52. package/knowledge/wiki/rng.md +14 -14
  53. package/knowledge/wiki/shapes.md +26 -26
  54. package/knowledge/wiki/stream.md +15 -15
  55. package/knowledge/wiki/system.md +8 -8
  56. package/knowledge/wiki/systems.md +2 -2
  57. package/knowledge/wiki/terrain.md +19 -19
  58. package/knowledge/wiki/tilemap.md +13 -13
  59. package/knowledge/wiki/time.md +4 -4
  60. package/knowledge/wiki/timeline.md +14 -14
  61. package/knowledge/wiki/transform.md +8 -8
  62. package/knowledge/wiki/tween.md +17 -17
  63. package/knowledge/wiki/ui.md +243 -243
  64. package/knowledge/wiki/video.md +5 -5
  65. package/knowledge/wiki/world.md +36 -36
  66. package/package.json +4 -4
  67. package/schema/api.schema.json +639 -11
  68. package/shell/page.ts +4 -0
  69. package/src/generated/abi.ts +3 -0
  70. package/src/index.ts +11 -0
  71. package/src/node/device.ts +5 -2
  72. package/src/node/polish.ts +34 -15
  73. package/src/node/run.ts +23 -6
  74. package/src/runtime.ts +1 -0
  75. package/src/web/gl-state.ts +907 -0
  76. package/src/web/worker.ts +6 -0
  77. package/types/bindings.json +823 -349
  78. package/types/index.d.ts +650 -15
@@ -14,7 +14,7 @@ module render {
14
14
  # declarations follow, each quoted below
15
15
  ```
16
16
 
17
- <sub>`api.ogt` line 2243</sub>
17
+ <sub>`api.ogt` line 2244</sub>
18
18
 
19
19
  ## Contents
20
20
 
@@ -57,12 +57,15 @@ module render {
57
57
  | [`DofQuality()`](#column-DofQuality) | column kind | A DofQuality field: the variant's index. |
58
58
  | [`SpriteBlend`](#type-SpriteBlend) | enum | How a sprite is blended over what is below it. |
59
59
  | [`SpriteBlend()`](#column-SpriteBlend) | column kind | A SpriteBlend field: the variant's index. |
60
+ | [`SpriteFacing`](#type-SpriteFacing) | enum | How a world sprite turns towards the camera that draws it: a billboard (three.js Sprite). Decided as a mode of og.Sprite and SpriteDesc rather than a component of its own: a billboard is the same quad, texture, region, flash, glow, blend, layer, drop shadow and texture array layer as any sprite, drawn by the same sprite batch and shader, which only stands its corners differently. The turn is computed on the GPU from each camera's own axes (the main camera, every og.CameraView and og.Mirror, every face of a reflection probe), so it never feeds back into the simulation and a snapshot holds only the mode. The sprite turns about its anchor (a nine-slice turns as one panel), `rotation` still turns it within its own plane, and its drop shadow is cast by the quad stood upright facing the sun, so it shows the whole shape from every camera. Within its layer a faced sprite without sortY draws back to front from the camera's eye (by view depth; a probe's six faces by distance from the probe), after the layer's drop shadows and before its unfaced sprites; and it is culled by its bounds (a sphere round the anchor through the farthest corner) against the camera's view. Sprites draw over the 3D scene after its transparent meshes and particles, depth tested and not depth writing, so a billboard behind a transparent mesh still draws over it. |
61
+ | [`SpriteFacing()`](#column-SpriteFacing) | column kind | A SpriteFacing field: the variant's index. |
60
62
  | [`StripBlend`](#type-StripBlend) | enum | How a trail, ribbon or beam is blended. |
61
63
  | [`StripBlend()`](#column-StripBlend) | column kind | A StripBlend field: the variant's index. |
62
64
  | [`og.PostEffects`](#record-PostEffects) | resource | The post stack beyond RenderSettings' bloom, exposure and tone mapping, and camera shake. Every effect is off by default (its switch false or its amount 0) and then costs nothing: no pass is recorded. Read after each tick; it never feeds back into the simulation. |
63
65
  | [`Palette`](#type-Palette) | handle | A colour palette for Stylise.palette, from og.load.palette (a `.hex` or GIMP `.gpl` file of up to 256 colours). |
64
66
  | [`Look`](#type-Look) | handle | A look from og.load.look (an `.ogt` of `type look`): the frame's whole art direction as data, applied with og.render.applyLook. |
65
67
  | [`Palette()`](#column-Palette) | column kind | A Palette handle field (0 is none). |
68
+ | [`Look()`](#column-Look) | column kind | A Look handle field (0 is none): a look og.load.look answered, kept for og.render.applyLook. |
66
69
  | [`DitherPattern`](#type-DitherPattern) | enum | The threshold pattern Stylise.dither spreads the steps of posterize and palette with. |
67
70
  | [`DitherPattern()`](#column-DitherPattern) | column kind | A DitherPattern field: the variant's index. |
68
71
  | [`StyliseSpace`](#type-StyliseSpace) | enum | Where Stylise lays a pattern (the paint canvas, the hatching, the halftone). |
@@ -84,9 +87,9 @@ module render {
84
87
  | [`TextDesc`](#type-TextDesc) | desc struct | A line or block of MSDF text in the world's xy plane facing +z, drawn this frame only (immediate mode: submit it every tick it should show). |
85
88
  | [`TextMeasureDesc`](#type-TextMeasureDesc) | desc struct | Text to measure with og.render.measureText, laid out as og.render.text lays it out. |
86
89
  | [`TextMetrics`](#type-TextMetrics) | struct | The extent of a laid-out text, in world units. |
87
- | [`SpriteDesc`](#type-SpriteDesc) | desc struct | A textured or solid quad in the world's xy plane facing +z, drawn this frame only (immediate mode, as og.render.text): submit it every tick it should show. Sprites and text are sorted by layer and drawn over the 3D scene. |
90
+ | [`SpriteDesc`](#type-SpriteDesc) | desc struct | A textured or solid quad in the world's xy plane facing +z (or turned to the camera, `facing`), drawn this frame only (immediate mode, as og.render.text): submit it every tick it should show. Sprites and text are sorted by layer and drawn over the 3D scene. |
88
91
  | [`og.render.sprite`](#fn-sprite) | function | Draw a sprite this frame. Systems and commands may call it; the list is cleared at every tick, so submit it every tick the sprite should show. |
89
- | [`og.Sprite`](#record-Sprite) | component | A sprite drawn every frame at the entity's MatrixWorld (its xy and z, its rotation about z; its scale multiplies width and height, so squash and stretch is a tween of og.Transform.scale). With an og.Flipbook on the entity, the texture (or an `array true` sheet's texture array layer), region and anchor come from the flipbook's current frame. |
92
+ | [`og.Sprite`](#record-Sprite) | component | A sprite drawn every frame at the entity's MatrixWorld (its xy and z, its rotation about z, in the xy plane or turned to the camera by `facing`; its scale multiplies width and height, so squash and stretch is a tween of og.Transform.scale). With an og.Flipbook on the entity, the texture (or an `array true` sheet's texture array layer), region and anchor come from the flipbook's current frame. |
90
93
  | [`og.Afterimage`](#record-Afterimage) | component | Ghosts of the entity's og.Sprite: every `interval` ticks its pose (position, rotation, scale, frame, flips) is kept, and the last `count` are drawn behind it, fading from `opacity` to 0, tinted by color. A dash, a speed-up, a teleport. The history is world state (the og.sprite state block). |
91
94
  | [`FloatingTextDesc`](#type-FloatingTextDesc) | desc struct | A damage number or pickup text that pops at a point, rises, spreads and fades by itself (no per-tick submission). Deterministic: its drift comes from the tick and its order, and it is world state (the og.sprite state block). |
92
95
  | [`og.render.floatingText`](#fn-floatingText) | function | Spawn a floating text (damage numbers, +coins, `blocked`). It lives `lifetime` seconds of scaled time on its own; systems and commands may call it. |
@@ -108,6 +111,7 @@ module render {
108
111
  | [`og.render.standardMaterial`](#fn-standardMaterial) | function | Create a standard material. |
109
112
  | [`og.render.updateMaterial`](#fn-updateMaterial) | function | Change some parameters of a standard material. |
110
113
  | [`Shader`](#type-Shader) | handle | A material shader from og.load.shader (an `.ogt` of `type shader`): WGSL hooks of the lit shader, or with `mode full` its own vertex and fragment entries, and the parameters they read. |
114
+ | [`Shader()`](#column-Shader) | column kind | A Shader handle field (0 is none): a material shader og.load.shader answered, kept for og.render.shaderMaterial. |
111
115
  | [`og.render.shaderMaterial`](#fn-shaderMaterial) | function | Create a standard material that draws with a material shader's hooks (vertex_offset, surface_color, surface_normal, surface_emissive; the og-game skill's Material shaders section has their WGSL contract), its parameters at their defaults. The hooks apply to skinned meshes too, and shadows and the depth prepass (ambient occlusion, outlines, depth of field) see the mesh where vertex_offset moved it and cut where surface_color's alpha falls below alphaTest. |
112
116
  | [`og.render.setMaterialShader`](#fn-setMaterialShader) | function | Give an existing material a material shader, or take it away with null: a loaded model's material (GltfInfo.materials) draws its skinned or static meshes through the hooks, with the shader's parameters at their defaults. Every mesh drawn with that material changes. |
113
117
  | [`og.render.setShaderParam`](#fn-setShaderParam) | function | Set a parameter of a shader material, by the name its shader declares: a number for float, two to four for vec2, vec3, vec4 and color. |
@@ -220,7 +224,7 @@ fn ribbon {
220
224
  }
221
225
  ```
222
226
 
223
- <sub>`api.ogt` line 3584</sub>
227
+ <sub>`api.ogt` line 3606</sub>
224
228
 
225
229
  <a id="fn-sprite"></a>
226
230
 
@@ -250,7 +254,7 @@ fn sprite {
250
254
  }
251
255
  ```
252
256
 
253
- <sub>`api.ogt` line 3712</sub>
257
+ <sub>`api.ogt` line 3735</sub>
254
258
 
255
259
  <a id="fn-floatingText"></a>
256
260
 
@@ -280,7 +284,7 @@ fn floatingText {
280
284
  }
281
285
  ```
282
286
 
283
- <sub>`api.ogt` line 3892</sub>
287
+ <sub>`api.ogt` line 3916</sub>
284
288
 
285
289
  <a id="fn-measureText"></a>
286
290
 
@@ -310,7 +314,7 @@ fn measureText {
310
314
  }
311
315
  ```
312
316
 
313
- <sub>`api.ogt` line 3899</sub>
317
+ <sub>`api.ogt` line 3923</sub>
314
318
 
315
319
  <a id="fn-boxGeometry"></a>
316
320
 
@@ -340,7 +344,7 @@ fn boxGeometry {
340
344
  }
341
345
  ```
342
346
 
343
- <sub>`api.ogt` line 3968</sub>
347
+ <sub>`api.ogt` line 3992</sub>
344
348
 
345
349
  <a id="fn-planeGeometry"></a>
346
350
 
@@ -370,7 +374,7 @@ fn planeGeometry {
370
374
  }
371
375
  ```
372
376
 
373
- <sub>`api.ogt` line 3975</sub>
377
+ <sub>`api.ogt` line 3999</sub>
374
378
 
375
379
  <a id="fn-sphereGeometry"></a>
376
380
 
@@ -400,7 +404,7 @@ fn sphereGeometry {
400
404
  }
401
405
  ```
402
406
 
403
- <sub>`api.ogt` line 3982</sub>
407
+ <sub>`api.ogt` line 4006</sub>
404
408
 
405
409
  <a id="fn-standardMaterial"></a>
406
410
 
@@ -430,7 +434,7 @@ fn standardMaterial {
430
434
  }
431
435
  ```
432
436
 
433
- <sub>`api.ogt` line 4064</sub>
437
+ <sub>`api.ogt` line 4088</sub>
434
438
 
435
439
  <a id="fn-updateMaterial"></a>
436
440
 
@@ -462,7 +466,7 @@ fn updateMaterial {
462
466
  }
463
467
  ```
464
468
 
465
- <sub>`api.ogt` line 4071</sub>
469
+ <sub>`api.ogt` line 4095</sub>
466
470
 
467
471
  <a id="fn-shaderMaterial"></a>
468
472
 
@@ -494,7 +498,7 @@ fn shaderMaterial {
494
498
  }
495
499
  ```
496
500
 
497
- <sub>`api.ogt` line 4081</sub>
501
+ <sub>`api.ogt` line 4112</sub>
498
502
 
499
503
  <a id="fn-setMaterialShader"></a>
500
504
 
@@ -526,7 +530,7 @@ fn setMaterialShader {
526
530
  }
527
531
  ```
528
532
 
529
- <sub>`api.ogt` line 4089</sub>
533
+ <sub>`api.ogt` line 4120</sub>
530
534
 
531
535
  <a id="fn-setShaderParam"></a>
532
536
 
@@ -560,7 +564,7 @@ fn setShaderParam {
560
564
  }
561
565
  ```
562
566
 
563
- <sub>`api.ogt` line 4097</sub>
567
+ <sub>`api.ogt` line 4128</sub>
564
568
 
565
569
  <a id="fn-applyLook"></a>
566
570
 
@@ -590,7 +594,7 @@ fn applyLook {
590
594
  }
591
595
  ```
592
596
 
593
- <sub>`api.ogt` line 4106</sub>
597
+ <sub>`api.ogt` line 4137</sub>
594
598
 
595
599
  <a id="fn-applyQuality"></a>
596
600
 
@@ -644,7 +648,7 @@ fn applyQuality {
644
648
  }
645
649
  ```
646
650
 
647
- <sub>`api.ogt` line 4113</sub>
651
+ <sub>`api.ogt` line 4144</sub>
648
652
 
649
653
  <a id="fn-look"></a>
650
654
 
@@ -672,7 +676,7 @@ fn look {
672
676
  }
673
677
  ```
674
678
 
675
- <sub>`api.ogt` line 4131</sub>
679
+ <sub>`api.ogt` line 4162</sub>
676
680
 
677
681
  <a id="fn-capabilities"></a>
678
682
 
@@ -700,7 +704,7 @@ fn capabilities {
700
704
  }
701
705
  ```
702
706
 
703
- <sub>`api.ogt` line 4137</sub>
707
+ <sub>`api.ogt` line 4168</sub>
704
708
 
705
709
  <a id="fn-text"></a>
706
710
 
@@ -730,7 +734,7 @@ fn text {
730
734
  }
731
735
  ```
732
736
 
733
- <sub>`api.ogt` line 4143</sub>
737
+ <sub>`api.ogt` line 4174</sub>
734
738
 
735
739
  <a id="fn-bufferGeometry"></a>
736
740
 
@@ -760,7 +764,7 @@ fn bufferGeometry {
760
764
  }
761
765
  ```
762
766
 
763
- <sub>`api.ogt` line 4181</sub>
767
+ <sub>`api.ogt` line 4212</sub>
764
768
 
765
769
  <a id="fn-updateGeometry"></a>
766
770
 
@@ -792,7 +796,7 @@ fn updateGeometry {
792
796
  }
793
797
  ```
794
798
 
795
- <sub>`api.ogt` line 4188</sub>
799
+ <sub>`api.ogt` line 4219</sub>
796
800
 
797
801
  <a id="fn-geometryInfo"></a>
798
802
 
@@ -822,7 +826,7 @@ fn geometryInfo {
822
826
  }
823
827
  ```
824
828
 
825
- <sub>`api.ogt` line 4196</sub>
829
+ <sub>`api.ogt` line 4227</sub>
826
830
 
827
831
  <a id="fn-cylinderGeometry"></a>
828
832
 
@@ -852,7 +856,7 @@ fn cylinderGeometry {
852
856
  }
853
857
  ```
854
858
 
855
- <sub>`api.ogt` line 4391</sub>
859
+ <sub>`api.ogt` line 4422</sub>
856
860
 
857
861
  <a id="fn-coneGeometry"></a>
858
862
 
@@ -882,7 +886,7 @@ fn coneGeometry {
882
886
  }
883
887
  ```
884
888
 
885
- <sub>`api.ogt` line 4398</sub>
889
+ <sub>`api.ogt` line 4429</sub>
886
890
 
887
891
  <a id="fn-capsuleGeometry"></a>
888
892
 
@@ -912,7 +916,7 @@ fn capsuleGeometry {
912
916
  }
913
917
  ```
914
918
 
915
- <sub>`api.ogt` line 4405</sub>
919
+ <sub>`api.ogt` line 4436</sub>
916
920
 
917
921
  <a id="fn-torusGeometry"></a>
918
922
 
@@ -942,7 +946,7 @@ fn torusGeometry {
942
946
  }
943
947
  ```
944
948
 
945
- <sub>`api.ogt` line 4412</sub>
949
+ <sub>`api.ogt` line 4443</sub>
946
950
 
947
951
  <a id="fn-ringGeometry"></a>
948
952
 
@@ -972,7 +976,7 @@ fn ringGeometry {
972
976
  }
973
977
  ```
974
978
 
975
- <sub>`api.ogt` line 4419</sub>
979
+ <sub>`api.ogt` line 4450</sub>
976
980
 
977
981
  <a id="fn-circleGeometry"></a>
978
982
 
@@ -1002,7 +1006,7 @@ fn circleGeometry {
1002
1006
  }
1003
1007
  ```
1004
1008
 
1005
- <sub>`api.ogt` line 4426</sub>
1009
+ <sub>`api.ogt` line 4457</sub>
1006
1010
 
1007
1011
  <a id="fn-tubeGeometry"></a>
1008
1012
 
@@ -1032,7 +1036,7 @@ fn tubeGeometry {
1032
1036
  }
1033
1037
  ```
1034
1038
 
1035
- <sub>`api.ogt` line 4433</sub>
1039
+ <sub>`api.ogt` line 4464</sub>
1036
1040
 
1037
1041
  <a id="fn-shapeGeometry"></a>
1038
1042
 
@@ -1062,7 +1066,7 @@ fn shapeGeometry {
1062
1066
  }
1063
1067
  ```
1064
1068
 
1065
- <sub>`api.ogt` line 4670</sub>
1069
+ <sub>`api.ogt` line 4701</sub>
1066
1070
 
1067
1071
  <a id="fn-extrudeGeometry"></a>
1068
1072
 
@@ -1092,7 +1096,7 @@ fn extrudeGeometry {
1092
1096
  }
1093
1097
  ```
1094
1098
 
1095
- <sub>`api.ogt` line 4677</sub>
1099
+ <sub>`api.ogt` line 4708</sub>
1096
1100
 
1097
1101
  <a id="fn-latheGeometry"></a>
1098
1102
 
@@ -1122,7 +1126,7 @@ fn latheGeometry {
1122
1126
  }
1123
1127
  ```
1124
1128
 
1125
- <sub>`api.ogt` line 4684</sub>
1129
+ <sub>`api.ogt` line 4715</sub>
1126
1130
 
1127
1131
  <a id="fn-polyhedronGeometry"></a>
1128
1132
 
@@ -1152,7 +1156,7 @@ fn polyhedronGeometry {
1152
1156
  }
1153
1157
  ```
1154
1158
 
1155
- <sub>`api.ogt` line 4691</sub>
1159
+ <sub>`api.ogt` line 4722</sub>
1156
1160
 
1157
1161
  <a id="fn-icosahedronGeometry"></a>
1158
1162
 
@@ -1182,7 +1186,7 @@ fn icosahedronGeometry {
1182
1186
  }
1183
1187
  ```
1184
1188
 
1185
- <sub>`api.ogt` line 4698</sub>
1189
+ <sub>`api.ogt` line 4729</sub>
1186
1190
 
1187
1191
  <a id="fn-dodecahedronGeometry"></a>
1188
1192
 
@@ -1212,7 +1216,7 @@ fn dodecahedronGeometry {
1212
1216
  }
1213
1217
  ```
1214
1218
 
1215
- <sub>`api.ogt` line 4705</sub>
1219
+ <sub>`api.ogt` line 4736</sub>
1216
1220
 
1217
1221
  <a id="fn-octahedronGeometry"></a>
1218
1222
 
@@ -1242,7 +1246,7 @@ fn octahedronGeometry {
1242
1246
  }
1243
1247
  ```
1244
1248
 
1245
- <sub>`api.ogt` line 4712</sub>
1249
+ <sub>`api.ogt` line 4743</sub>
1246
1250
 
1247
1251
  <a id="fn-tetrahedronGeometry"></a>
1248
1252
 
@@ -1272,7 +1276,7 @@ fn tetrahedronGeometry {
1272
1276
  }
1273
1277
  ```
1274
1278
 
1275
- <sub>`api.ogt` line 4719</sub>
1279
+ <sub>`api.ogt` line 4750</sub>
1276
1280
 
1277
1281
  <a id="fn-sweepGeometry"></a>
1278
1282
 
@@ -1302,7 +1306,7 @@ fn sweepGeometry {
1302
1306
  }
1303
1307
  ```
1304
1308
 
1305
- <sub>`api.ogt` line 4726</sub>
1309
+ <sub>`api.ogt` line 4757</sub>
1306
1310
 
1307
1311
  <a id="fn-csgGeometry"></a>
1308
1312
 
@@ -1332,7 +1336,7 @@ fn csgGeometry {
1332
1336
  }
1333
1337
  ```
1334
1338
 
1335
- <sub>`api.ogt` line 4733</sub>
1339
+ <sub>`api.ogt` line 4764</sub>
1336
1340
 
1337
1341
  <a id="fn-mergeGeometries"></a>
1338
1342
 
@@ -1362,7 +1366,7 @@ fn mergeGeometries {
1362
1366
  }
1363
1367
  ```
1364
1368
 
1365
- <sub>`api.ogt` line 4740</sub>
1369
+ <sub>`api.ogt` line 4771</sub>
1366
1370
 
1367
1371
  <a id="fn-lines"></a>
1368
1372
 
@@ -1392,7 +1396,7 @@ fn lines {
1392
1396
  }
1393
1397
  ```
1394
1398
 
1395
- <sub>`api.ogt` line 4798</sub>
1399
+ <sub>`api.ogt` line 4829</sub>
1396
1400
 
1397
1401
  <a id="fn-points"></a>
1398
1402
 
@@ -1422,7 +1426,7 @@ fn points {
1422
1426
  }
1423
1427
  ```
1424
1428
 
1425
- <sub>`api.ogt` line 4833</sub>
1429
+ <sub>`api.ogt` line 4864</sub>
1426
1430
 
1427
1431
  <a id="fn-raycast"></a>
1428
1432
 
@@ -1454,7 +1458,7 @@ fn raycast {
1454
1458
  }
1455
1459
  ```
1456
1460
 
1457
- <sub>`api.ogt` line 4937</sub>
1461
+ <sub>`api.ogt` line 4968</sub>
1458
1462
 
1459
1463
  <a id="fn-renderTarget"></a>
1460
1464
 
@@ -1484,7 +1488,7 @@ fn renderTarget {
1484
1488
  }
1485
1489
  ```
1486
1490
 
1487
- <sub>`api.ogt` line 4993</sub>
1491
+ <sub>`api.ogt` line 5024</sub>
1488
1492
 
1489
1493
  <a id="fn-setPostParam"></a>
1490
1494
 
@@ -1518,7 +1522,7 @@ fn setPostParam {
1518
1522
  }
1519
1523
  ```
1520
1524
 
1521
- <sub>`api.ogt` line 5105</sub>
1525
+ <sub>`api.ogt` line 5136</sub>
1522
1526
 
1523
1527
  <a id="fn-postErrors"></a>
1524
1528
 
@@ -1546,7 +1550,7 @@ fn postErrors {
1546
1550
  }
1547
1551
  ```
1548
1552
 
1549
- <sub>`api.ogt` line 5120</sub>
1553
+ <sub>`api.ogt` line 5151</sub>
1550
1554
 
1551
1555
  <a id="fn-bakedLighting"></a>
1552
1556
 
@@ -1574,7 +1578,7 @@ fn bakedLighting {
1574
1578
  }
1575
1579
  ```
1576
1580
 
1577
- <sub>`api.ogt` line 5188</sub>
1581
+ <sub>`api.ogt` line 5219</sub>
1578
1582
 
1579
1583
  ## Components, resources and events
1580
1584
 
@@ -1632,7 +1636,7 @@ component Mesh {
1632
1636
  }
1633
1637
  ```
1634
1638
 
1635
- <sub>`api.ogt` line 2511</sub>
1639
+ <sub>`api.ogt` line 2512</sub>
1636
1640
 
1637
1641
  <a id="record-DirectionalLight"></a>
1638
1642
 
@@ -1687,7 +1691,7 @@ component DirectionalLight {
1687
1691
  }
1688
1692
  ```
1689
1693
 
1690
- <sub>`api.ogt` line 2541</sub>
1694
+ <sub>`api.ogt` line 2542</sub>
1691
1695
 
1692
1696
  <a id="record-PointLight"></a>
1693
1697
 
@@ -1730,7 +1734,7 @@ component PointLight {
1730
1734
  }
1731
1735
  ```
1732
1736
 
1733
- <sub>`api.ogt` line 2573</sub>
1737
+ <sub>`api.ogt` line 2574</sub>
1734
1738
 
1735
1739
  <a id="record-SpotLight"></a>
1736
1740
 
@@ -1784,7 +1788,7 @@ component SpotLight {
1784
1788
  }
1785
1789
  ```
1786
1790
 
1787
- <sub>`api.ogt` line 2594</sub>
1791
+ <sub>`api.ogt` line 2595</sub>
1788
1792
 
1789
1793
  <a id="record-RenderSettings"></a>
1790
1794
 
@@ -1912,7 +1916,7 @@ resource RenderSettings {
1912
1916
  }
1913
1917
  ```
1914
1918
 
1915
- <sub>`api.ogt` line 2662</sub>
1919
+ <sub>`api.ogt` line 2663</sub>
1916
1920
 
1917
1921
  <a id="record-Environment"></a>
1918
1922
 
@@ -1952,7 +1956,7 @@ resource Environment {
1952
1956
  }
1953
1957
  ```
1954
1958
 
1955
- <sub>`api.ogt` line 2778</sub>
1959
+ <sub>`api.ogt` line 2779</sub>
1956
1960
 
1957
1961
  <a id="record-PostEffects"></a>
1958
1962
 
@@ -2227,7 +2231,7 @@ resource PostEffects {
2227
2231
  }
2228
2232
  ```
2229
2233
 
2230
- <sub>`api.ogt` line 2858</sub>
2234
+ <sub>`api.ogt` line 2873</sub>
2231
2235
 
2232
2236
  <a id="record-Stylise"></a>
2233
2237
 
@@ -2482,7 +2486,7 @@ resource Stylise {
2482
2486
  }
2483
2487
  ```
2484
2488
 
2485
- <sub>`api.ogt` line 3107</sub>
2489
+ <sub>`api.ogt` line 3129</sub>
2486
2490
 
2487
2491
  <a id="record-MaterialStyle"></a>
2488
2492
 
@@ -2547,7 +2551,7 @@ resource MaterialStyle {
2547
2551
  }
2548
2552
  ```
2549
2553
 
2550
- <sub>`api.ogt` line 3300</sub>
2554
+ <sub>`api.ogt` line 3322</sub>
2551
2555
 
2552
2556
  <a id="record-Lighting2D"></a>
2553
2557
 
@@ -2586,7 +2590,7 @@ resource Lighting2D {
2586
2590
  }
2587
2591
  ```
2588
2592
 
2589
- <sub>`api.ogt` line 3350</sub>
2593
+ <sub>`api.ogt` line 3372</sub>
2590
2594
 
2591
2595
  <a id="record-Light2D"></a>
2592
2596
 
@@ -2637,7 +2641,7 @@ component Light2D {
2637
2641
  }
2638
2642
  ```
2639
2643
 
2640
- <sub>`api.ogt` line 3369</sub>
2644
+ <sub>`api.ogt` line 3391</sub>
2641
2645
 
2642
2646
  <a id="record-Occluder2D"></a>
2643
2647
 
@@ -2668,7 +2672,7 @@ component Occluder2D {
2668
2672
  }
2669
2673
  ```
2670
2674
 
2671
- <sub>`api.ogt` line 3399</sub>
2675
+ <sub>`api.ogt` line 3421</sub>
2672
2676
 
2673
2677
  <a id="record-Decal"></a>
2674
2678
 
@@ -2723,7 +2727,7 @@ component Decal {
2723
2727
  }
2724
2728
  ```
2725
2729
 
2726
- <sub>`api.ogt` line 3413</sub>
2730
+ <sub>`api.ogt` line 3435</sub>
2727
2731
 
2728
2732
  <a id="record-ParticleSystem"></a>
2729
2733
 
@@ -2760,7 +2764,7 @@ component ParticleSystem {
2760
2764
  }
2761
2765
  ```
2762
2766
 
2763
- <sub>`api.ogt` line 3447</sub>
2767
+ <sub>`api.ogt` line 3469</sub>
2764
2768
 
2765
2769
  <a id="record-Trail"></a>
2766
2770
 
@@ -2836,7 +2840,7 @@ component Trail {
2836
2840
  }
2837
2841
  ```
2838
2842
 
2839
- <sub>`api.ogt` line 3463</sub>
2843
+ <sub>`api.ogt` line 3485</sub>
2840
2844
 
2841
2845
  <a id="record-Beam"></a>
2842
2846
 
@@ -2902,13 +2906,13 @@ component Beam {
2902
2906
  }
2903
2907
  ```
2904
2908
 
2905
- <sub>`api.ogt` line 3511</sub>
2909
+ <sub>`api.ogt` line 3533</sub>
2906
2910
 
2907
2911
  <a id="record-Sprite"></a>
2908
2912
 
2909
2913
  ### `og.Sprite` (component)
2910
2914
 
2911
- A sprite drawn every frame at the entity's MatrixWorld (its xy and z, its rotation about z; its scale multiplies width and height, so squash and stretch is a tween of og.Transform.scale). With an og.Flipbook on the entity, the texture (or an `array true` sheet's texture array layer), region and anchor come from the flipbook's current frame.
2915
+ A sprite drawn every frame at the entity's MatrixWorld (its xy and z, its rotation about z, in the xy plane or turned to the camera by `facing`; its scale multiplies width and height, so squash and stretch is a tween of og.Transform.scale). With an og.Flipbook on the entity, the texture (or an `array true` sheet's texture array layer), region and anchor come from the flipbook's current frame.
2912
2916
 
2913
2917
  Sorted with the immediate sprites and text by layer, then (sortY) by y, then texture: one draw per run of one texture. Tile layers draw before the sprites of their layer.
2914
2918
 
@@ -2928,6 +2932,7 @@ Token `og.Sprite`, registered under the schema name `og.Sprite`; its value type
2928
2932
  | `uvMax` | `Vector2` | `{ x: 1, y: 1 }` | — | — | — | The texture region's bottom-right corner, v down. |
2929
2933
  | `layer` | `number` | `0` | — | — | — | Draw order among sprites, tiles and text; higher draws on top. |
2930
2934
  | `sortY` | `boolean` | `false` | — | — | — | Within its layer, lower y draws in front: top-down characters, props and trees overlap by their feet. |
2935
+ | `facing` | `SpriteFacing` | `"none"` | — | — | — | A billboard (SpriteDesc.facing): none keeps the quad in the world's xy plane; camera turns it into each camera's view plane; cameraY stands it upright turned about y towards the camera, for trees and characters in a 3D set. Its afterimages face as it does; its blob shadow stays flat. |
2931
2936
  | `flipX` | `boolean` | `false` | — | — | — | Mirror left to right (a character facing left). |
2932
2937
  | `flipY` | `boolean` | `false` | — | — | — | Mirror top to bottom. |
2933
2938
  | `flash` | `number` | `0` | 0 … 1 | — | tunable | A hit flash: the colour mixed towards flashColor by this much (og.tween.flash fades it out). |
@@ -2949,7 +2954,7 @@ Token `og.Sprite`, registered under the schema name `og.Sprite`; its value type
2949
2954
 
2950
2955
  ```ogt
2951
2956
  component Sprite {
2952
- doc "A sprite drawn every frame at the entity's MatrixWorld (its xy and z, its rotation about z; its scale multiplies width and height, so squash and stretch is a tween of og.Transform.scale). With an og.Flipbook on the entity, the texture (or an `array true` sheet's texture array layer), region and anchor come from the flipbook's current frame."
2957
+ doc "A sprite drawn every frame at the entity's MatrixWorld (its xy and z, its rotation about z, in the xy plane or turned to the camera by `facing`; its scale multiplies width and height, so squash and stretch is a tween of og.Transform.scale). With an og.Flipbook on the entity, the texture (or an `array true` sheet's texture array layer), region and anchor come from the flipbook's current frame."
2953
2958
  doc "Sorted with the immediate sprites and text by layer, then (sortY) by y, then texture: one draw per run of one texture. Tile layers draw before the sprites of their layer."
2954
2959
  field texture Texture "The texture (og.load.texture); 0 draws a solid quad of the colour."
2955
2960
  field array TextureArray "Draw from a layer of this texture array (og.load.textureArray) instead of `texture`; 0 uses `texture`. Every sprite of one array is one draw whichever layer each shows. While the array's streaming group is not resident the sprite draws nothing."
@@ -2984,6 +2989,7 @@ component Sprite {
2984
2989
  }
2985
2990
  field layer i32 "Draw order among sprites, tiles and text; higher draws on top."
2986
2991
  field sortY bool "Within its layer, lower y draws in front: top-down characters, props and trees overlap by their feet."
2992
+ field facing SpriteFacing "A billboard (SpriteDesc.facing): none keeps the quad in the world's xy plane; camera turns it into each camera's view plane; cameraY stands it upright turned about y towards the camera, for trees and characters in a 3D set. Its afterimages face as it does; its blob shadow stays flat."
2987
2993
  field flipX bool "Mirror left to right (a character facing left)."
2988
2994
  field flipY bool "Mirror top to bottom."
2989
2995
  field flash f32 "A hit flash: the colour mixed towards flashColor by this much (og.tween.flash fades it out)." {
@@ -3037,7 +3043,7 @@ component Sprite {
3037
3043
  }
3038
3044
  ```
3039
3045
 
3040
- <sub>`api.ogt` line 3719</sub>
3046
+ <sub>`api.ogt` line 3742</sub>
3041
3047
 
3042
3048
  <a id="record-Afterimage"></a>
3043
3049
 
@@ -3085,7 +3091,7 @@ component Afterimage {
3085
3091
  }
3086
3092
  ```
3087
3093
 
3088
- <sub>`api.ogt` line 3807</sub>
3094
+ <sub>`api.ogt` line 3831</sub>
3089
3095
 
3090
3096
  <a id="record-ReflectionProbe"></a>
3091
3097
 
@@ -3138,7 +3144,7 @@ component ReflectionProbe {
3138
3144
  }
3139
3145
  ```
3140
3146
 
3141
- <sub>`api.ogt` line 4032</sub>
3147
+ <sub>`api.ogt` line 4056</sub>
3142
3148
 
3143
3149
  <a id="record-Lines"></a>
3144
3150
 
@@ -3201,7 +3207,7 @@ component Lines {
3201
3207
  }
3202
3208
  ```
3203
3209
 
3204
- <sub>`api.ogt` line 4840</sub>
3210
+ <sub>`api.ogt` line 4871</sub>
3205
3211
 
3206
3212
  <a id="record-Points"></a>
3207
3213
 
@@ -3255,7 +3261,7 @@ component Points {
3255
3261
  }
3256
3262
  ```
3257
3263
 
3258
- <sub>`api.ogt` line 4877</sub>
3264
+ <sub>`api.ogt` line 4908</sub>
3259
3265
 
3260
3266
  <a id="record-CameraView"></a>
3261
3267
 
@@ -3362,7 +3368,7 @@ component CameraView {
3362
3368
  }
3363
3369
  ```
3364
3370
 
3365
- <sub>`api.ogt` line 5000</sub>
3371
+ <sub>`api.ogt` line 5031</sub>
3366
3372
 
3367
3373
  <a id="record-Mirror"></a>
3368
3374
 
@@ -3407,7 +3413,7 @@ component Mirror {
3407
3413
  }
3408
3414
  ```
3409
3415
 
3410
- <sub>`api.ogt` line 5072</sub>
3416
+ <sub>`api.ogt` line 5103</sub>
3411
3417
 
3412
3418
  <a id="record-RectLight"></a>
3413
3419
 
@@ -3457,7 +3463,7 @@ component RectLight {
3457
3463
  }
3458
3464
  ```
3459
3465
 
3460
- <sub>`api.ogt` line 5134</sub>
3466
+ <sub>`api.ogt` line 5165</sub>
3461
3467
 
3462
3468
  <a id="record-LightVolume"></a>
3463
3469
 
@@ -3491,7 +3497,7 @@ component LightVolume {
3491
3497
  }
3492
3498
  ```
3493
3499
 
3494
- <sub>`api.ogt` line 5161</sub>
3500
+ <sub>`api.ogt` line 5192</sub>
3495
3501
 
3496
3502
  ## Types
3497
3503
 
@@ -3507,7 +3513,7 @@ A generational handle: a number the engine hands out. A dead handle is an error
3507
3513
  handle Geometry "Vertex and index data, as three.js BufferGeometry. Comes from a loaded glTF."
3508
3514
  ```
3509
3515
 
3510
- <sub>`api.ogt` line 2247</sub>
3516
+ <sub>`api.ogt` line 2248</sub>
3511
3517
 
3512
3518
  <a id="type-Material"></a>
3513
3519
 
@@ -3521,7 +3527,7 @@ A generational handle: a number the engine hands out. A dead handle is an error
3521
3527
  handle Material "A material instance."
3522
3528
  ```
3523
3529
 
3524
- <sub>`api.ogt` line 2248</sub>
3530
+ <sub>`api.ogt` line 2249</sub>
3525
3531
 
3526
3532
  <a id="type-Texture"></a>
3527
3533
 
@@ -3535,7 +3541,7 @@ A generational handle: a number the engine hands out. A dead handle is an error
3535
3541
  handle Texture "A cooked texture."
3536
3542
  ```
3537
3543
 
3538
- <sub>`api.ogt` line 2249</sub>
3544
+ <sub>`api.ogt` line 2250</sub>
3539
3545
 
3540
3546
  <a id="type-Side"></a>
3541
3547
 
@@ -3560,7 +3566,7 @@ enum Side {
3560
3566
  }
3561
3567
  ```
3562
3568
 
3563
- <sub>`api.ogt` line 2265</sub>
3569
+ <sub>`api.ogt` line 2266</sub>
3564
3570
 
3565
3571
  <a id="type-RenderTier"></a>
3566
3572
 
@@ -3591,7 +3597,7 @@ enum RenderTier {
3591
3597
  }
3592
3598
  ```
3593
3599
 
3594
- <sub>`api.ogt` line 2272</sub>
3600
+ <sub>`api.ogt` line 2273</sub>
3595
3601
 
3596
3602
  <a id="type-Antialias"></a>
3597
3603
 
@@ -3620,7 +3626,7 @@ enum Antialias {
3620
3626
  }
3621
3627
  ```
3622
3628
 
3623
- <sub>`api.ogt` line 2282</sub>
3629
+ <sub>`api.ogt` line 2283</sub>
3624
3630
 
3625
3631
  <a id="type-PointShadows"></a>
3626
3632
 
@@ -3645,7 +3651,7 @@ enum PointShadows {
3645
3651
  }
3646
3652
  ```
3647
3653
 
3648
- <sub>`api.ogt` line 2291</sub>
3654
+ <sub>`api.ogt` line 2292</sub>
3649
3655
 
3650
3656
  <a id="type-TaaHistory"></a>
3651
3657
 
@@ -3668,7 +3674,7 @@ enum TaaHistory {
3668
3674
  }
3669
3675
  ```
3670
3676
 
3671
- <sub>`api.ogt` line 2298</sub>
3677
+ <sub>`api.ogt` line 2299</sub>
3672
3678
 
3673
3679
  <a id="type-DebugView"></a>
3674
3680
 
@@ -3697,7 +3703,7 @@ enum DebugView {
3697
3703
  }
3698
3704
  ```
3699
3705
 
3700
- <sub>`api.ogt` line 2304</sub>
3706
+ <sub>`api.ogt` line 2305</sub>
3701
3707
 
3702
3708
  <a id="type-RenderOptions"></a>
3703
3709
 
@@ -3737,7 +3743,7 @@ struct RenderOptions {
3737
3743
  }
3738
3744
  ```
3739
3745
 
3740
- <sub>`api.ogt` line 2313</sub>
3746
+ <sub>`api.ogt` line 2314</sub>
3741
3747
 
3742
3748
  <a id="type-StandardMaterialDesc"></a>
3743
3749
 
@@ -4007,7 +4013,7 @@ struct StandardMaterialDesc {
4007
4013
  }
4008
4014
  ```
4009
4015
 
4010
- <sub>`api.ogt` line 2332</sub>
4016
+ <sub>`api.ogt` line 2333</sub>
4011
4017
 
4012
4018
  <a id="type-ToneMapping"></a>
4013
4019
 
@@ -4032,7 +4038,7 @@ enum ToneMapping {
4032
4038
  }
4033
4039
  ```
4034
4040
 
4035
- <sub>`api.ogt` line 2626</sub>
4041
+ <sub>`api.ogt` line 2627</sub>
4036
4042
 
4037
4043
  <a id="type-GraphicsQuality"></a>
4038
4044
 
@@ -4057,7 +4063,7 @@ enum GraphicsQuality {
4057
4063
  }
4058
4064
  ```
4059
4065
 
4060
- <sub>`api.ogt` line 2640</sub>
4066
+ <sub>`api.ogt` line 2641</sub>
4061
4067
 
4062
4068
  <a id="type-QualityPreset"></a>
4063
4069
 
@@ -4084,7 +4090,7 @@ enum QualityPreset {
4084
4090
  }
4085
4091
  ```
4086
4092
 
4087
- <sub>`api.ogt` line 2647</sub>
4093
+ <sub>`api.ogt` line 2648</sub>
4088
4094
 
4089
4095
  <a id="type-Lut"></a>
4090
4096
 
@@ -4098,7 +4104,7 @@ A generational handle: a number the engine hands out. A dead handle is an error
4098
4104
  handle Lut "A colour lookup table for PostEffects.lut, from og.load.lut (a `.cube` file)."
4099
4105
  ```
4100
4106
 
4101
- <sub>`api.ogt` line 2753</sub>
4107
+ <sub>`api.ogt` line 2754</sub>
4102
4108
 
4103
4109
  <a id="type-EnvironmentMap"></a>
4104
4110
 
@@ -4112,7 +4118,7 @@ A generational handle: a number the engine hands out. A dead handle is an error
4112
4118
  handle EnvironmentMap "A prefiltered HDR environment map for Environment.map, from og.load.environment (an `.ogt` of `type environment` naming an equirectangular `.hdr` or `.exr`, a KTX2 cube map, or six face images)."
4113
4119
  ```
4114
4120
 
4115
- <sub>`api.ogt` line 2754</sub>
4121
+ <sub>`api.ogt` line 2755</sub>
4116
4122
 
4117
4123
  <a id="type-ParticleEmitter"></a>
4118
4124
 
@@ -4126,7 +4132,7 @@ A generational handle: a number the engine hands out. A dead handle is an error
4126
4132
  handle ParticleEmitter "A particle emitter asset for ParticleSystem.emitter, from og.load.emitter (an `.ogt` of `type particles`)."
4127
4133
  ```
4128
4134
 
4129
- <sub>`api.ogt` line 2755</sub>
4135
+ <sub>`api.ogt` line 2756</sub>
4130
4136
 
4131
4137
  <a id="type-AoMethod"></a>
4132
4138
 
@@ -4151,7 +4157,7 @@ enum AoMethod {
4151
4157
  }
4152
4158
  ```
4153
4159
 
4154
- <sub>`api.ogt` line 2805</sub>
4160
+ <sub>`api.ogt` line 2806</sub>
4155
4161
 
4156
4162
  <a id="type-DofQuality"></a>
4157
4163
 
@@ -4174,7 +4180,7 @@ enum DofQuality {
4174
4180
  }
4175
4181
  ```
4176
4182
 
4177
- <sub>`api.ogt` line 2819</sub>
4183
+ <sub>`api.ogt` line 2820</sub>
4178
4184
 
4179
4185
  <a id="type-SpriteBlend"></a>
4180
4186
 
@@ -4197,7 +4203,32 @@ enum SpriteBlend {
4197
4203
  }
4198
4204
  ```
4199
4205
 
4200
- <sub>`api.ogt` line 2832</sub>
4206
+ <sub>`api.ogt` line 2833</sub>
4207
+
4208
+ <a id="type-SpriteFacing"></a>
4209
+
4210
+ ### `SpriteFacing` (enum)
4211
+
4212
+ How a world sprite turns towards the camera that draws it: a billboard (three.js Sprite). Decided as a mode of og.Sprite and SpriteDesc rather than a component of its own: a billboard is the same quad, texture, region, flash, glow, blend, layer, drop shadow and texture array layer as any sprite, drawn by the same sprite batch and shader, which only stands its corners differently. The turn is computed on the GPU from each camera's own axes (the main camera, every og.CameraView and og.Mirror, every face of a reflection probe), so it never feeds back into the simulation and a snapshot holds only the mode. The sprite turns about its anchor (a nine-slice turns as one panel), `rotation` still turns it within its own plane, and its drop shadow is cast by the quad stood upright facing the sun, so it shows the whole shape from every camera. Within its layer a faced sprite without sortY draws back to front from the camera's eye (by view depth; a probe's six faces by distance from the probe), after the layer's drop shadows and before its unfaced sprites; and it is culled by its bounds (a sphere round the anchor through the farthest corner) against the camera's view. Sprites draw over the 3D scene after its transparent meshes and particles, depth tested and not depth writing, so a billboard behind a transparent mesh still draws over it.
4213
+
4214
+ A string: one of the variants below. The zero value is `"none"`.
4215
+
4216
+ | Variant | Doc |
4217
+ |---|---|
4218
+ | `"none"` | In the world's xy plane facing +z, as every sprite before billboards. |
4219
+ | `"camera"` | In the camera's view plane: its x along the camera's right, its y along its up, as particle billboards (smoke, glints, impostors seen from any side). |
4220
+ | `"cameraY"` | Upright, turned about the world's y axis towards the camera: its y stays +y, its x the camera's right laid level. Trees, characters and props that must stand while the camera looks down on them. |
4221
+
4222
+ ```ogt
4223
+ enum SpriteFacing {
4224
+ doc "How a world sprite turns towards the camera that draws it: a billboard (three.js Sprite). Decided as a mode of og.Sprite and SpriteDesc rather than a component of its own: a billboard is the same quad, texture, region, flash, glow, blend, layer, drop shadow and texture array layer as any sprite, drawn by the same sprite batch and shader, which only stands its corners differently. The turn is computed on the GPU from each camera's own axes (the main camera, every og.CameraView and og.Mirror, every face of a reflection probe), so it never feeds back into the simulation and a snapshot holds only the mode. The sprite turns about its anchor (a nine-slice turns as one panel), `rotation` still turns it within its own plane, and its drop shadow is cast by the quad stood upright facing the sun, so it shows the whole shape from every camera. Within its layer a faced sprite without sortY draws back to front from the camera's eye (by view depth; a probe's six faces by distance from the probe), after the layer's drop shadows and before its unfaced sprites; and it is culled by its bounds (a sphere round the anchor through the farthest corner) against the camera's view. Sprites draw over the 3D scene after its transparent meshes and particles, depth tested and not depth writing, so a billboard behind a transparent mesh still draws over it."
4225
+ variant none "In the world's xy plane facing +z, as every sprite before billboards."
4226
+ variant camera "In the camera's view plane: its x along the camera's right, its y along its up, as particle billboards (smoke, glints, impostors seen from any side)."
4227
+ variant cameraY "Upright, turned about the world's y axis towards the camera: its y stays +y, its x the camera's right laid level. Trees, characters and props that must stand while the camera looks down on them."
4228
+ }
4229
+ ```
4230
+
4231
+ <sub>`api.ogt` line 2846</sub>
4201
4232
 
4202
4233
  <a id="type-StripBlend"></a>
4203
4234
 
@@ -4220,7 +4251,7 @@ enum StripBlend {
4220
4251
  }
4221
4252
  ```
4222
4253
 
4223
- <sub>`api.ogt` line 2845</sub>
4254
+ <sub>`api.ogt` line 2860</sub>
4224
4255
 
4225
4256
  <a id="type-Palette"></a>
4226
4257
 
@@ -4234,7 +4265,7 @@ A generational handle: a number the engine hands out. A dead handle is an error
4234
4265
  handle Palette "A colour palette for Stylise.palette, from og.load.palette (a `.hex` or GIMP `.gpl` file of up to 256 colours)."
4235
4266
  ```
4236
4267
 
4237
- <sub>`api.ogt` line 3066</sub>
4268
+ <sub>`api.ogt` line 3081</sub>
4238
4269
 
4239
4270
  <a id="type-Look"></a>
4240
4271
 
@@ -4248,7 +4279,7 @@ A generational handle: a number the engine hands out. A dead handle is an error
4248
4279
  handle Look "A look from og.load.look (an `.ogt` of `type look`): the frame's whole art direction as data, applied with og.render.applyLook."
4249
4280
  ```
4250
4281
 
4251
- <sub>`api.ogt` line 3067</sub>
4282
+ <sub>`api.ogt` line 3082</sub>
4252
4283
 
4253
4284
  <a id="type-DitherPattern"></a>
4254
4285
 
@@ -4279,7 +4310,7 @@ enum DitherPattern {
4279
4310
  }
4280
4311
  ```
4281
4312
 
4282
- <sub>`api.ogt` line 3076</sub>
4313
+ <sub>`api.ogt` line 3098</sub>
4283
4314
 
4284
4315
  <a id="type-StyliseSpace"></a>
4285
4316
 
@@ -4304,7 +4335,7 @@ enum StyliseSpace {
4304
4335
  }
4305
4336
  ```
4306
4337
 
4307
- <sub>`api.ogt` line 3093</sub>
4338
+ <sub>`api.ogt` line 3115</sub>
4308
4339
 
4309
4340
  <a id="type-LookInfo"></a>
4310
4341
 
@@ -4335,7 +4366,7 @@ struct LookInfo {
4335
4366
  }
4336
4367
  ```
4337
4368
 
4338
- <sub>`api.ogt` line 3339</sub>
4369
+ <sub>`api.ogt` line 3361</sub>
4339
4370
 
4340
4371
  <a id="type-RibbonPoint"></a>
4341
4372
 
@@ -4375,7 +4406,7 @@ struct RibbonPoint {
4375
4406
  }
4376
4407
  ```
4377
4408
 
4378
- <sub>`api.ogt` line 3551</sub>
4409
+ <sub>`api.ogt` line 3573</sub>
4379
4410
 
4380
4411
  <a id="type-RibbonDesc"></a>
4381
4412
 
@@ -4406,7 +4437,7 @@ struct RibbonDesc {
4406
4437
  }
4407
4438
  ```
4408
4439
 
4409
- <sub>`api.ogt` line 3572</sub>
4440
+ <sub>`api.ogt` line 3594</sub>
4410
4441
 
4411
4442
  <a id="type-TextDesc"></a>
4412
4443
 
@@ -4468,7 +4499,7 @@ struct TextDesc {
4468
4499
  }
4469
4500
  ```
4470
4501
 
4471
- <sub>`api.ogt` line 3591</sub>
4502
+ <sub>`api.ogt` line 3613</sub>
4472
4503
 
4473
4504
  <a id="type-TextMeasureDesc"></a>
4474
4505
 
@@ -4497,7 +4528,7 @@ struct TextMeasureDesc {
4497
4528
  }
4498
4529
  ```
4499
4530
 
4500
- <sub>`api.ogt` line 3625</sub>
4531
+ <sub>`api.ogt` line 3647</sub>
4501
4532
 
4502
4533
  <a id="type-TextMetrics"></a>
4503
4534
 
@@ -4520,13 +4551,13 @@ struct TextMetrics {
4520
4551
  }
4521
4552
  ```
4522
4553
 
4523
- <sub>`api.ogt` line 3636</sub>
4554
+ <sub>`api.ogt` line 3658</sub>
4524
4555
 
4525
4556
  <a id="type-SpriteDesc"></a>
4526
4557
 
4527
4558
  ### `SpriteDesc` (desc struct)
4528
4559
 
4529
- A textured or solid quad in the world's xy plane facing +z, drawn this frame only (immediate mode, as og.render.text): submit it every tick it should show. Sprites and text are sorted by layer and drawn over the 3D scene.
4560
+ A textured or solid quad in the world's xy plane facing +z (or turned to the camera, `facing`), drawn this frame only (immediate mode, as og.render.text): submit it every tick it should show. Sprites and text are sorted by layer and drawn over the 3D scene.
4530
4561
 
4531
4562
  A desc: every field may be omitted and takes its default; `{}` is valid.
4532
4563
 
@@ -4552,6 +4583,7 @@ A desc: every field may be omitted and takes its default; `{}` is valid.
4552
4583
  | `dropShadow` | `number` | `0` | 0 … 1 | — | — | A drop shadow this dark (0 none, 0.5 typical): the sprite's shape in black, flattened along the sun (the first og.DirectionalLight) onto the ground under it (dropShadowHeight, or the og.Terrain there), drawn before every sprite of its layer: pixel sprites standing in a 3D set cast shadows that agree with it. Where the ground already lies in the sun's cascaded shadow the drop shadow fades, so a shadow inside a shadow is no darker. None with the sun below the horizon; at most five times the sprite's height long under a low one. World sprites with a perspective camera over the xz ground; a 2D camera sees the ground edge on. |
4553
4584
  | `dropShadowHeight` | `number` | `0` | — | `m` | — | The height of the level ground the drop shadow lies on (a floor, a deck, a step). Where an og.Terrain under the sprite's anchor is higher, the shadow lies on the terrain instead, on the plane fitted to its slope under the shadow, or bent over a hollow or a ridge narrower than the shadow (the terrain's heights under a 4 x 2 grid of the shadow's cells). 0 with no terrain is the ground plane y = 0. |
4554
4585
  | `toneMapped` | `boolean` | `true` | — | — | — | As three.js Material.toneMapped: true draws the sprite into the lit scene, carried by exposure (auto exposure included), bloom and the tone curve like any surface. false keeps its colours as given: still placed in the world, depth tested and sorted with the other sprites, but shown unexposed and uncurved (clamped to 0 to 1), outside bloom and fog; the grade, vignette, grain and screen flash still apply. For world UI that must read the same at noon and at dusk: speech bubbles, name tags, markers. Alpha blending only: an additive sprite adds light and is always tone mapped. |
4586
+ | `facing` | `SpriteFacing` | `"none"` | — | — | — | A billboard: none keeps the quad in the world's xy plane; camera turns it into the view plane of each camera that draws it; cameraY stands it upright turned about y towards the camera (trees, characters). World sprites only (a screen sprite ignores it); see SpriteFacing for sorting, culling and its drop shadow. |
4555
4587
  | `flipX` | `boolean` | `false` | — | — | — | Mirror the region left to right. |
4556
4588
  | `flipY` | `boolean` | `false` | — | — | — | Mirror the region top to bottom. |
4557
4589
  | `sortY` | `boolean` | `false` | — | — | — | Within its layer, draw by y: lower on the screen draws in front (top-down games). |
@@ -4562,7 +4594,7 @@ A desc: every field may be omitted and takes its default; `{}` is valid.
4562
4594
 
4563
4595
  ```ogt
4564
4596
  struct SpriteDesc {
4565
- doc "A textured or solid quad in the world's xy plane facing +z, drawn this frame only (immediate mode, as og.render.text): submit it every tick it should show. Sprites and text are sorted by layer and drawn over the 3D scene."
4597
+ doc "A textured or solid quad in the world's xy plane facing +z (or turned to the camera, `facing`), drawn this frame only (immediate mode, as og.render.text): submit it every tick it should show. Sprites and text are sorted by layer and drawn over the 3D scene."
4566
4598
  desc true
4567
4599
  field texture Option.Texture "The texture from og.load.texture; null draws a solid quad of the colour."
4568
4600
  field array Option.TextureArray "Draw from a layer of this texture array (og.load.textureArray) instead of `texture`: every sprite of one array is one draw whichever layer each shows, so a flipbook's frames packed as layers batch across frames. World and screen sprites alike, with flash, glow, blend and 2D lighting as a textured sprite. null uses `texture`."
@@ -4618,6 +4650,7 @@ struct SpriteDesc {
4618
4650
  field toneMapped bool "As three.js Material.toneMapped: true draws the sprite into the lit scene, carried by exposure (auto exposure included), bloom and the tone curve like any surface. false keeps its colours as given: still placed in the world, depth tested and sorted with the other sprites, but shown unexposed and uncurved (clamped to 0 to 1), outside bloom and fog; the grade, vignette, grain and screen flash still apply. For world UI that must read the same at noon and at dusk: speech bubbles, name tags, markers. Alpha blending only: an additive sprite adds light and is always tone mapped." {
4619
4651
  default true
4620
4652
  }
4653
+ field facing SpriteFacing "A billboard: none keeps the quad in the world's xy plane; camera turns it into the view plane of each camera that draws it; cameraY stands it upright turned about y towards the camera (trees, characters). World sprites only (a screen sprite ignores it); see SpriteFacing for sorting, culling and its drop shadow."
4621
4654
  field flipX bool "Mirror the region left to right."
4622
4655
  field flipY bool "Mirror the region top to bottom."
4623
4656
  field sortY bool "Within its layer, draw by y: lower on the screen draws in front (top-down games)."
@@ -4631,7 +4664,7 @@ struct SpriteDesc {
4631
4664
  }
4632
4665
  ```
4633
4666
 
4634
- <sub>`api.ogt` line 3643</sub>
4667
+ <sub>`api.ogt` line 3665</sub>
4635
4668
 
4636
4669
  <a id="type-FloatingTextDesc"></a>
4637
4670
 
@@ -4719,7 +4752,7 @@ struct FloatingTextDesc {
4719
4752
  }
4720
4753
  ```
4721
4754
 
4722
- <sub>`api.ogt` line 3834</sub>
4755
+ <sub>`api.ogt` line 3858</sub>
4723
4756
 
4724
4757
  <a id="type-BoxGeometryDesc"></a>
4725
4758
 
@@ -4761,7 +4794,7 @@ struct BoxGeometryDesc {
4761
4794
  }
4762
4795
  ```
4763
4796
 
4764
- <sub>`api.ogt` line 3906</sub>
4797
+ <sub>`api.ogt` line 3930</sub>
4765
4798
 
4766
4799
  <a id="type-PlaneGeometryDesc"></a>
4767
4800
 
@@ -4797,7 +4830,7 @@ struct PlaneGeometryDesc {
4797
4830
  }
4798
4831
  ```
4799
4832
 
4800
- <sub>`api.ogt` line 3929</sub>
4833
+ <sub>`api.ogt` line 3953</sub>
4801
4834
 
4802
4835
  <a id="type-SphereGeometryDesc"></a>
4803
4836
 
@@ -4837,7 +4870,7 @@ struct SphereGeometryDesc {
4837
4870
  }
4838
4871
  ```
4839
4872
 
4840
- <sub>`api.ogt` line 3947</sub>
4873
+ <sub>`api.ogt` line 3971</sub>
4841
4874
 
4842
4875
  <a id="type-RenderCapabilities"></a>
4843
4876
 
@@ -4894,7 +4927,7 @@ struct RenderCapabilities {
4894
4927
  }
4895
4928
  ```
4896
4929
 
4897
- <sub>`api.ogt` line 3993</sub>
4930
+ <sub>`api.ogt` line 4017</sub>
4898
4931
 
4899
4932
  <a id="type-ReflectionProbeMode"></a>
4900
4933
 
@@ -4917,7 +4950,7 @@ enum ReflectionProbeMode {
4917
4950
  }
4918
4951
  ```
4919
4952
 
4920
- <sub>`api.ogt` line 4019</sub>
4953
+ <sub>`api.ogt` line 4043</sub>
4921
4954
 
4922
4955
  <a id="type-Shader"></a>
4923
4956
 
@@ -4931,7 +4964,7 @@ A generational handle: a number the engine hands out. A dead handle is an error
4931
4964
  handle Shader "A material shader from og.load.shader (an `.ogt` of `type shader`): WGSL hooks of the lit shader, or with `mode full` its own vertex and fragment entries, and the parameters they read."
4932
4965
  ```
4933
4966
 
4934
- <sub>`api.ogt` line 4079</sub>
4967
+ <sub>`api.ogt` line 4103</sub>
4935
4968
 
4936
4969
  <a id="type-BufferGeometryDesc"></a>
4937
4970
 
@@ -4972,7 +5005,7 @@ struct BufferGeometryDesc {
4972
5005
  }
4973
5006
  ```
4974
5007
 
4975
- <sub>`api.ogt` line 4152</sub>
5008
+ <sub>`api.ogt` line 4183</sub>
4976
5009
 
4977
5010
  <a id="type-GeometryInfo"></a>
4978
5011
 
@@ -5003,7 +5036,7 @@ struct GeometryInfo {
5003
5036
  }
5004
5037
  ```
5005
5038
 
5006
- <sub>`api.ogt` line 4168</sub>
5039
+ <sub>`api.ogt` line 4199</sub>
5007
5040
 
5008
5041
  <a id="type-CylinderGeometryDesc"></a>
5009
5042
 
@@ -5062,7 +5095,7 @@ struct CylinderGeometryDesc {
5062
5095
  }
5063
5096
  ```
5064
5097
 
5065
- <sub>`api.ogt` line 4203</sub>
5098
+ <sub>`api.ogt` line 4234</sub>
5066
5099
 
5067
5100
  <a id="type-ConeGeometryDesc"></a>
5068
5101
 
@@ -5106,7 +5139,7 @@ struct ConeGeometryDesc {
5106
5139
  }
5107
5140
  ```
5108
5141
 
5109
- <sub>`api.ogt` line 4239</sub>
5142
+ <sub>`api.ogt` line 4270</sub>
5110
5143
 
5111
5144
  <a id="type-CapsuleGeometryDesc"></a>
5112
5145
 
@@ -5153,7 +5186,7 @@ struct CapsuleGeometryDesc {
5153
5186
  }
5154
5187
  ```
5155
5188
 
5156
- <sub>`api.ogt` line 4263</sub>
5189
+ <sub>`api.ogt` line 4294</sub>
5157
5190
 
5158
5191
  <a id="type-TorusGeometryDesc"></a>
5159
5192
 
@@ -5200,7 +5233,7 @@ struct TorusGeometryDesc {
5200
5233
  }
5201
5234
  ```
5202
5235
 
5203
- <sub>`api.ogt` line 4290</sub>
5236
+ <sub>`api.ogt` line 4321</sub>
5204
5237
 
5205
5238
  <a id="type-RingGeometryDesc"></a>
5206
5239
 
@@ -5251,7 +5284,7 @@ struct RingGeometryDesc {
5251
5284
  }
5252
5285
  ```
5253
5286
 
5254
- <sub>`api.ogt` line 4317</sub>
5287
+ <sub>`api.ogt` line 4348</sub>
5255
5288
 
5256
5289
  <a id="type-CircleGeometryDesc"></a>
5257
5290
 
@@ -5291,7 +5324,7 @@ struct CircleGeometryDesc {
5291
5324
  }
5292
5325
  ```
5293
5326
 
5294
- <sub>`api.ogt` line 4347</sub>
5327
+ <sub>`api.ogt` line 4378</sub>
5295
5328
 
5296
5329
  <a id="type-TubeGeometryDesc"></a>
5297
5330
 
@@ -5335,7 +5368,7 @@ struct TubeGeometryDesc {
5335
5368
  }
5336
5369
  ```
5337
5370
 
5338
- <sub>`api.ogt` line 4368</sub>
5371
+ <sub>`api.ogt` line 4399</sub>
5339
5372
 
5340
5373
  <a id="type-ShapePoints"></a>
5341
5374
 
@@ -5356,7 +5389,7 @@ struct ShapePoints {
5356
5389
  }
5357
5390
  ```
5358
5391
 
5359
- <sub>`api.ogt` line 4442</sub>
5392
+ <sub>`api.ogt` line 4473</sub>
5360
5393
 
5361
5394
  <a id="type-ShapeGeometryDesc"></a>
5362
5395
 
@@ -5393,7 +5426,7 @@ struct ShapeGeometryDesc {
5393
5426
  }
5394
5427
  ```
5395
5428
 
5396
- <sub>`api.ogt` line 4448</sub>
5429
+ <sub>`api.ogt` line 4479</sub>
5397
5430
 
5398
5431
  <a id="type-ExtrudeGeometryDesc"></a>
5399
5432
 
@@ -5466,7 +5499,7 @@ struct ExtrudeGeometryDesc {
5466
5499
  }
5467
5500
  ```
5468
5501
 
5469
- <sub>`api.ogt` line 4465</sub>
5502
+ <sub>`api.ogt` line 4496</sub>
5470
5503
 
5471
5504
  <a id="type-LatheGeometryDesc"></a>
5472
5505
 
@@ -5514,7 +5547,7 @@ struct LatheGeometryDesc {
5514
5547
  }
5515
5548
  ```
5516
5549
 
5517
- <sub>`api.ogt` line 4510</sub>
5550
+ <sub>`api.ogt` line 4541</sub>
5518
5551
 
5519
5552
  <a id="type-PolyhedronGeometryDesc"></a>
5520
5553
 
@@ -5558,7 +5591,7 @@ struct PolyhedronGeometryDesc {
5558
5591
  }
5559
5592
  ```
5560
5593
 
5561
- <sub>`api.ogt` line 4536</sub>
5594
+ <sub>`api.ogt` line 4567</sub>
5562
5595
 
5563
5596
  <a id="type-SolidGeometryDesc"></a>
5564
5597
 
@@ -5598,7 +5631,7 @@ struct SolidGeometryDesc {
5598
5631
  }
5599
5632
  ```
5600
5633
 
5601
- <sub>`api.ogt` line 4558</sub>
5634
+ <sub>`api.ogt` line 4589</sub>
5602
5635
 
5603
5636
  <a id="type-SweepKey"></a>
5604
5637
 
@@ -5621,7 +5654,7 @@ struct SweepKey {
5621
5654
  }
5622
5655
  ```
5623
5656
 
5624
- <sub>`api.ogt` line 4578</sub>
5657
+ <sub>`api.ogt` line 4609</sub>
5625
5658
 
5626
5659
  <a id="type-SweepGeometryDesc"></a>
5627
5660
 
@@ -5673,7 +5706,7 @@ struct SweepGeometryDesc {
5673
5706
  }
5674
5707
  ```
5675
5708
 
5676
- <sub>`api.ogt` line 4586</sub>
5709
+ <sub>`api.ogt` line 4617</sub>
5677
5710
 
5678
5711
  <a id="type-MirrorAxis"></a>
5679
5712
 
@@ -5700,7 +5733,7 @@ enum MirrorAxis {
5700
5733
  }
5701
5734
  ```
5702
5735
 
5703
- <sub>`api.ogt` line 4613</sub>
5736
+ <sub>`api.ogt` line 4644</sub>
5704
5737
 
5705
5738
  <a id="type-GeometryPart"></a>
5706
5739
 
@@ -5734,7 +5767,7 @@ struct GeometryPart {
5734
5767
  }
5735
5768
  ```
5736
5769
 
5737
- <sub>`api.ogt` line 4621</sub>
5770
+ <sub>`api.ogt` line 4652</sub>
5738
5771
 
5739
5772
  <a id="type-CsgOp"></a>
5740
5773
 
@@ -5759,7 +5792,7 @@ enum CsgOp {
5759
5792
  }
5760
5793
  ```
5761
5794
 
5762
- <sub>`api.ogt` line 4635</sub>
5795
+ <sub>`api.ogt` line 4666</sub>
5763
5796
 
5764
5797
  <a id="type-CsgGeometryDesc"></a>
5765
5798
 
@@ -5795,7 +5828,7 @@ struct CsgGeometryDesc {
5795
5828
  }
5796
5829
  ```
5797
5830
 
5798
- <sub>`api.ogt` line 4642</sub>
5831
+ <sub>`api.ogt` line 4673</sub>
5799
5832
 
5800
5833
  <a id="type-MergeGeometriesDesc"></a>
5801
5834
 
@@ -5827,7 +5860,7 @@ struct MergeGeometriesDesc {
5827
5860
  }
5828
5861
  ```
5829
5862
 
5830
- <sub>`api.ogt` line 4657</sub>
5863
+ <sub>`api.ogt` line 4688</sub>
5831
5864
 
5832
5865
  <a id="type-LineMode"></a>
5833
5866
 
@@ -5852,7 +5885,7 @@ enum LineMode {
5852
5885
  }
5853
5886
  ```
5854
5887
 
5855
- <sub>`api.ogt` line 4747</sub>
5888
+ <sub>`api.ogt` line 4778</sub>
5856
5889
 
5857
5890
  <a id="type-LinesDesc"></a>
5858
5891
 
@@ -5918,7 +5951,7 @@ struct LinesDesc {
5918
5951
  }
5919
5952
  ```
5920
5953
 
5921
- <sub>`api.ogt` line 4761</sub>
5954
+ <sub>`api.ogt` line 4792</sub>
5922
5955
 
5923
5956
  <a id="type-PointsDesc"></a>
5924
5957
 
@@ -5969,7 +6002,7 @@ struct PointsDesc {
5969
6002
  }
5970
6003
  ```
5971
6004
 
5972
- <sub>`api.ogt` line 4805</sub>
6005
+ <sub>`api.ogt` line 4836</sub>
5973
6006
 
5974
6007
  <a id="type-RaycastGeometryDesc"></a>
5975
6008
 
@@ -6002,7 +6035,7 @@ struct RaycastGeometryDesc {
6002
6035
  }
6003
6036
  ```
6004
6037
 
6005
- <sub>`api.ogt` line 4908</sub>
6038
+ <sub>`api.ogt` line 4939</sub>
6006
6039
 
6007
6040
  <a id="type-GeometryHit"></a>
6008
6041
 
@@ -6037,7 +6070,7 @@ struct GeometryHit {
6037
6070
  }
6038
6071
  ```
6039
6072
 
6040
- <sub>`api.ogt` line 4922</sub>
6073
+ <sub>`api.ogt` line 4953</sub>
6041
6074
 
6042
6075
  <a id="type-RenderTargetFormat"></a>
6043
6076
 
@@ -6060,7 +6093,7 @@ enum RenderTargetFormat {
6060
6093
  }
6061
6094
  ```
6062
6095
 
6063
- <sub>`api.ogt` line 4947</sub>
6096
+ <sub>`api.ogt` line 4978</sub>
6064
6097
 
6065
6098
  <a id="type-RenderTarget"></a>
6066
6099
 
@@ -6074,7 +6107,7 @@ A generational handle: a number the engine hands out. A dead handle is an error
6074
6107
  handle RenderTarget "A texture a camera draws into (og.render.renderTarget), as three.js WebGLRenderTarget."
6075
6108
  ```
6076
6109
 
6077
- <sub>`api.ogt` line 4960</sub>
6110
+ <sub>`api.ogt` line 4991</sub>
6078
6111
 
6079
6112
  <a id="type-RenderTargetDesc"></a>
6080
6113
 
@@ -6108,7 +6141,7 @@ struct RenderTargetDesc {
6108
6141
  }
6109
6142
  ```
6110
6143
 
6111
- <sub>`api.ogt` line 4969</sub>
6144
+ <sub>`api.ogt` line 5000</sub>
6112
6145
 
6113
6146
  <a id="type-RenderTargetInfo"></a>
6114
6147
 
@@ -6135,7 +6168,7 @@ struct RenderTargetInfo {
6135
6168
  }
6136
6169
  ```
6137
6170
 
6138
- <sub>`api.ogt` line 4984</sub>
6171
+ <sub>`api.ogt` line 5015</sub>
6139
6172
 
6140
6173
  <a id="type-Post"></a>
6141
6174
 
@@ -6149,7 +6182,7 @@ A generational handle: a number the engine hands out. A dead handle is an error
6149
6182
  handle Post "A custom post pass from og.load.post (an `.ogt` of `type post`): a WGSL `post` function over the lit image and the parameters it reads."
6150
6183
  ```
6151
6184
 
6152
- <sub>`api.ogt` line 5096</sub>
6185
+ <sub>`api.ogt` line 5127</sub>
6153
6186
 
6154
6187
  <a id="type-PostError"></a>
6155
6188
 
@@ -6170,7 +6203,7 @@ struct PostError {
6170
6203
  }
6171
6204
  ```
6172
6205
 
6173
- <sub>`api.ogt` line 5114</sub>
6206
+ <sub>`api.ogt` line 5145</sub>
6174
6207
 
6175
6208
  <a id="type-VolumetricFog"></a>
6176
6209
 
@@ -6193,7 +6226,7 @@ enum VolumetricFog {
6193
6226
  }
6194
6227
  ```
6195
6228
 
6196
- <sub>`api.ogt` line 5128</sub>
6229
+ <sub>`api.ogt` line 5159</sub>
6197
6230
 
6198
6231
  <a id="type-BakedScene"></a>
6199
6232
 
@@ -6226,7 +6259,7 @@ struct BakedScene {
6226
6259
  }
6227
6260
  ```
6228
6261
 
6229
- <sub>`api.ogt` line 5176</sub>
6262
+ <sub>`api.ogt` line 5207</sub>
6230
6263
 
6231
6264
  ## Column kinds
6232
6265
 
@@ -6245,11 +6278,14 @@ Each is a factory, `Geometry(value?, options?)`, that makes one field of a compo
6245
6278
  | <a id="column-AoMethod"></a>`AoMethod` | `AoMethod` | `Uint32Array` | 1 | An AoMethod field: the variant's index. |
6246
6279
  | <a id="column-DofQuality"></a>`DofQuality` | `DofQuality` | `Uint32Array` | 1 | A DofQuality field: the variant's index. |
6247
6280
  | <a id="column-SpriteBlend"></a>`SpriteBlend` | `SpriteBlend` | `Uint32Array` | 1 | A SpriteBlend field: the variant's index. |
6281
+ | <a id="column-SpriteFacing"></a>`SpriteFacing` | `SpriteFacing` | `Uint32Array` | 1 | A SpriteFacing field: the variant's index. |
6248
6282
  | <a id="column-StripBlend"></a>`StripBlend` | `StripBlend` | `Uint32Array` | 1 | A StripBlend field: the variant's index. |
6249
6283
  | <a id="column-Palette"></a>`Palette` | `Palette` | `Uint32Array` | 2 | A Palette handle field (0 is none). |
6284
+ | <a id="column-Look"></a>`Look` | `Look` | `Uint32Array` | 2 | A Look handle field (0 is none): a look og.load.look answered, kept for og.render.applyLook. |
6250
6285
  | <a id="column-DitherPattern"></a>`DitherPattern` | `DitherPattern` | `Uint32Array` | 1 | A DitherPattern field: the variant's index. |
6251
6286
  | <a id="column-StyliseSpace"></a>`StyliseSpace` | `StyliseSpace` | `Uint32Array` | 1 | A StyliseSpace field: the variant's index. |
6252
6287
  | <a id="column-ReflectionProbeMode"></a>`ReflectionProbeMode` | `ReflectionProbeMode` | `Uint32Array` | 1 | A ReflectionProbeMode field: the variant's index. |
6288
+ | <a id="column-Shader"></a>`Shader` | `Shader` | `Uint32Array` | 2 | A Shader handle field (0 is none): a material shader og.load.shader answered, kept for og.render.shaderMaterial. |
6253
6289
  | <a id="column-LineMode"></a>`LineMode` | `LineMode` | `Uint32Array` | 1 | A LineMode field: the variant's index. |
6254
6290
  | <a id="column-RenderTargetFormat"></a>`RenderTargetFormat` | `RenderTargetFormat` | `Uint32Array` | 1 | A RenderTargetFormat field: the variant's index. |
6255
6291
  | <a id="column-RenderTarget"></a>`RenderTarget` | `RenderTarget` | `Uint32Array` | 2 | A RenderTarget handle field (0 is none). |
@@ -6264,7 +6300,7 @@ column Geometry {
6264
6300
  }
6265
6301
  ```
6266
6302
 
6267
- <sub>`api.ogt` line 2251</sub>
6303
+ <sub>`api.ogt` line 2252</sub>
6268
6304
 
6269
6305
  ```ogt
6270
6306
  column Material {
@@ -6275,7 +6311,7 @@ column Material {
6275
6311
  }
6276
6312
  ```
6277
6313
 
6278
- <sub>`api.ogt` line 2258</sub>
6314
+ <sub>`api.ogt` line 2259</sub>
6279
6315
 
6280
6316
  ```ogt
6281
6317
  column ToneMapping {
@@ -6286,7 +6322,7 @@ column ToneMapping {
6286
6322
  }
6287
6323
  ```
6288
6324
 
6289
- <sub>`api.ogt` line 2633</sub>
6325
+ <sub>`api.ogt` line 2634</sub>
6290
6326
 
6291
6327
  ```ogt
6292
6328
  column QualityPreset {
@@ -6297,7 +6333,7 @@ column QualityPreset {
6297
6333
  }
6298
6334
  ```
6299
6335
 
6300
- <sub>`api.ogt` line 2655</sub>
6336
+ <sub>`api.ogt` line 2656</sub>
6301
6337
 
6302
6338
  ```ogt
6303
6339
  column Texture {
@@ -6308,7 +6344,7 @@ column Texture {
6308
6344
  }
6309
6345
  ```
6310
6346
 
6311
- <sub>`api.ogt` line 2757</sub>
6347
+ <sub>`api.ogt` line 2758</sub>
6312
6348
 
6313
6349
  ```ogt
6314
6350
  column Lut {
@@ -6319,7 +6355,7 @@ column Lut {
6319
6355
  }
6320
6356
  ```
6321
6357
 
6322
- <sub>`api.ogt` line 2764</sub>
6358
+ <sub>`api.ogt` line 2765</sub>
6323
6359
 
6324
6360
  ```ogt
6325
6361
  column EnvironmentMap {
@@ -6330,7 +6366,7 @@ column EnvironmentMap {
6330
6366
  }
6331
6367
  ```
6332
6368
 
6333
- <sub>`api.ogt` line 2771</sub>
6369
+ <sub>`api.ogt` line 2772</sub>
6334
6370
 
6335
6371
  ```ogt
6336
6372
  column ParticleEmitter {
@@ -6341,7 +6377,7 @@ column ParticleEmitter {
6341
6377
  }
6342
6378
  ```
6343
6379
 
6344
- <sub>`api.ogt` line 2798</sub>
6380
+ <sub>`api.ogt` line 2799</sub>
6345
6381
 
6346
6382
  ```ogt
6347
6383
  column AoMethod {
@@ -6352,7 +6388,7 @@ column AoMethod {
6352
6388
  }
6353
6389
  ```
6354
6390
 
6355
- <sub>`api.ogt` line 2812</sub>
6391
+ <sub>`api.ogt` line 2813</sub>
6356
6392
 
6357
6393
  ```ogt
6358
6394
  column DofQuality {
@@ -6363,7 +6399,7 @@ column DofQuality {
6363
6399
  }
6364
6400
  ```
6365
6401
 
6366
- <sub>`api.ogt` line 2825</sub>
6402
+ <sub>`api.ogt` line 2826</sub>
6367
6403
 
6368
6404
  ```ogt
6369
6405
  column SpriteBlend {
@@ -6374,7 +6410,18 @@ column SpriteBlend {
6374
6410
  }
6375
6411
  ```
6376
6412
 
6377
- <sub>`api.ogt` line 2838</sub>
6413
+ <sub>`api.ogt` line 2839</sub>
6414
+
6415
+ ```ogt
6416
+ column SpriteFacing {
6417
+ doc "A SpriteFacing field: the variant's index."
6418
+ array Uint32Array
6419
+ stride 1
6420
+ value SpriteFacing
6421
+ }
6422
+ ```
6423
+
6424
+ <sub>`api.ogt` line 2853</sub>
6378
6425
 
6379
6426
  ```ogt
6380
6427
  column StripBlend {
@@ -6385,7 +6432,7 @@ column StripBlend {
6385
6432
  }
6386
6433
  ```
6387
6434
 
6388
- <sub>`api.ogt` line 2851</sub>
6435
+ <sub>`api.ogt` line 2866</sub>
6389
6436
 
6390
6437
  ```ogt
6391
6438
  column Palette {
@@ -6396,7 +6443,18 @@ column Palette {
6396
6443
  }
6397
6444
  ```
6398
6445
 
6399
- <sub>`api.ogt` line 3069</sub>
6446
+ <sub>`api.ogt` line 3084</sub>
6447
+
6448
+ ```ogt
6449
+ column Look {
6450
+ doc "A Look handle field (0 is none): a look og.load.look answered, kept for og.render.applyLook."
6451
+ array Uint32Array
6452
+ stride 2
6453
+ value Look
6454
+ }
6455
+ ```
6456
+
6457
+ <sub>`api.ogt` line 3091</sub>
6400
6458
 
6401
6459
  ```ogt
6402
6460
  column DitherPattern {
@@ -6407,7 +6465,7 @@ column DitherPattern {
6407
6465
  }
6408
6466
  ```
6409
6467
 
6410
- <sub>`api.ogt` line 3086</sub>
6468
+ <sub>`api.ogt` line 3108</sub>
6411
6469
 
6412
6470
  ```ogt
6413
6471
  column StyliseSpace {
@@ -6418,7 +6476,7 @@ column StyliseSpace {
6418
6476
  }
6419
6477
  ```
6420
6478
 
6421
- <sub>`api.ogt` line 3100</sub>
6479
+ <sub>`api.ogt` line 3122</sub>
6422
6480
 
6423
6481
  ```ogt
6424
6482
  column ReflectionProbeMode {
@@ -6429,7 +6487,18 @@ column ReflectionProbeMode {
6429
6487
  }
6430
6488
  ```
6431
6489
 
6432
- <sub>`api.ogt` line 4025</sub>
6490
+ <sub>`api.ogt` line 4049</sub>
6491
+
6492
+ ```ogt
6493
+ column Shader {
6494
+ doc "A Shader handle field (0 is none): a material shader og.load.shader answered, kept for og.render.shaderMaterial."
6495
+ array Uint32Array
6496
+ stride 2
6497
+ value Shader
6498
+ }
6499
+ ```
6500
+
6501
+ <sub>`api.ogt` line 4105</sub>
6433
6502
 
6434
6503
  ```ogt
6435
6504
  column LineMode {
@@ -6440,7 +6509,7 @@ column LineMode {
6440
6509
  }
6441
6510
  ```
6442
6511
 
6443
- <sub>`api.ogt` line 4754</sub>
6512
+ <sub>`api.ogt` line 4785</sub>
6444
6513
 
6445
6514
  ```ogt
6446
6515
  column RenderTargetFormat {
@@ -6451,7 +6520,7 @@ column RenderTargetFormat {
6451
6520
  }
6452
6521
  ```
6453
6522
 
6454
- <sub>`api.ogt` line 4953</sub>
6523
+ <sub>`api.ogt` line 4984</sub>
6455
6524
 
6456
6525
  ```ogt
6457
6526
  column RenderTarget {
@@ -6462,7 +6531,7 @@ column RenderTarget {
6462
6531
  }
6463
6532
  ```
6464
6533
 
6465
- <sub>`api.ogt` line 4962</sub>
6534
+ <sub>`api.ogt` line 4993</sub>
6466
6535
 
6467
6536
  ```ogt
6468
6537
  column Post {
@@ -6473,7 +6542,7 @@ column Post {
6473
6542
  }
6474
6543
  ```
6475
6544
 
6476
- <sub>`api.ogt` line 5098</sub>
6545
+ <sub>`api.ogt` line 5129</sub>
6477
6546
 
6478
6547
  ## Constants
6479
6548
 
@@ -6489,28 +6558,28 @@ column Post {
6489
6558
  const PARTICLES_ARMED u32 4294967295 "ParticleSystem.startTick's default: never written. A looping emitter emits as if started at tick 0; a one-shot (`looping false`) emits nothing until its startTick is written, so a burst spawned in `start` waits for its first use. Write it back to re-arm a one-shot without firing it."
6490
6559
  ```
6491
6560
 
6492
- <sub>`api.ogt` line 3445</sub>
6561
+ <sub>`api.ogt` line 3467</sub>
6493
6562
 
6494
6563
  ```ogt
6495
6564
  const MAX_LIGHTS u32 256 "The most point and spot lights one frame draws, among those in view; past it the ones brightest at the camera are kept."
6496
6565
  ```
6497
6566
 
6498
- <sub>`api.ogt` line 3989</sub>
6567
+ <sub>`api.ogt` line 4013</sub>
6499
6568
 
6500
6569
  ```ogt
6501
6570
  const MAX_CLUSTER_LIGHTS u32 64 "The most point and spot lights that shade one screen cluster (a 1/16 by 1/9 tile of the view and one of 24 depth slices); past it the ones brightest at the camera are kept there."
6502
6571
  ```
6503
6572
 
6504
- <sub>`api.ogt` line 3990</sub>
6573
+ <sub>`api.ogt` line 4014</sub>
6505
6574
 
6506
6575
  ```ogt
6507
6576
  const UI_LAYER i32 1000 "The UI's layer among screen sprites and screen text (SpriteDesc and TextDesc with screen): those at or below it draw under every og.ui element, those above it over every one, modals, toasts and the screen transition included (a HUD element made of sprites sitting on a UI panel: draw it only while its screen shows), in their layers' order either way."
6508
6577
  ```
6509
6578
 
6510
- <sub>`api.ogt` line 3991</sub>
6579
+ <sub>`api.ogt` line 4015</sub>
6511
6580
 
6512
6581
  ```ogt
6513
6582
  const MAX_REFLECTION_PROBES u32 8 "The most og.ReflectionProbe components one frame samples, nearest the camera first; the rest are skipped."
6514
6583
  ```
6515
6584
 
6516
- <sub>`api.ogt` line 4017</sub>
6585
+ <sub>`api.ogt` line 4041</sub>