@field/cascade 0.3.1 → 0.5.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 (129) hide show
  1. package/AGENTS.md +32 -9
  2. package/ARCHITECTURE.md +75 -13
  3. package/CHANGELOG.md +98 -1
  4. package/CONTRIBUTING.md +104 -0
  5. package/DESIGN.md +24 -15
  6. package/README.md +121 -14
  7. package/dist/assets/{CodeEditor-D22fVi-4.js → CodeEditor-dOrU3aQg.js} +7 -7
  8. package/dist/assets/{CodePanel-DPNEYfcR.js → CodePanel-Bqy85qen.js} +2 -2
  9. package/dist/assets/{CustomNodeDialog-DeHCAvgb.js → CustomNodeDialog-DkZlOgjs.js} +1 -1
  10. package/dist/assets/{ProjectSettings-DWpVtWEx.js → ProjectSettings-D192mr6g.js} +2 -2
  11. package/dist/assets/{SettingsDialog-za00IS3L.js → SettingsDialog-BTeeIE3T.js} +1 -1
  12. package/dist/assets/{VersionHistoryDialog-DTMGhI0_.js → VersionHistoryDialog-TZQKkn3Y.js} +1 -1
  13. package/dist/assets/{core-JsyKMO1k.js → core-DwbcGL0o.js} +2 -2
  14. package/dist/assets/{cssMode-emdRheFK.js → cssMode-Dcjn356x.js} +1 -1
  15. package/dist/assets/definitions-C_SY6Bhg.js +1 -0
  16. package/dist/assets/{editor.api-xHX-fMSo.js → editor.api-D7Q83606.js} +1 -1
  17. package/dist/assets/{freemarker2-C3M8_Gs3.js → freemarker2-DCCiHlV6.js} +1 -1
  18. package/dist/assets/geo-CT-wtvaE.js +1 -0
  19. package/dist/assets/{handlebars-CBMurtFk.js → handlebars-BCxC8xu1.js} +1 -1
  20. package/dist/assets/{html-xbLQwknw.js → html-COwepzSd.js} +1 -1
  21. package/dist/assets/{htmlMode-2wKdDTon.js → htmlMode-Dpg7H0rx.js} +1 -1
  22. package/dist/assets/{image-i1j6nWKe.js → image-CMfMMxlC.js} +3 -3
  23. package/dist/assets/index-De1cIZ9N.js +212 -0
  24. package/dist/assets/index-ilgbOu6G.css +1 -0
  25. package/dist/assets/{javascript-DJaOo_2I.js → javascript-CSwWxfLr.js} +1 -1
  26. package/dist/assets/{jsonMode-Bheas8_0.js → jsonMode-BXRriTpj.js} +1 -1
  27. package/dist/assets/{liquid-BCj_BGbM.js → liquid-Cmkfyogc.js} +1 -1
  28. package/dist/assets/{lspLanguageFeatures-BfIsx_xz.js → lspLanguageFeatures-xH9JbZGO.js} +1 -1
  29. package/dist/assets/{mdx-DwiQDiVO.js → mdx-BzrNjNvK.js} +1 -1
  30. package/dist/assets/nodeTypeUtils-BDJsc2Ks.js +1 -0
  31. package/dist/assets/pop-BdKEHslJ.js +1 -0
  32. package/dist/assets/{python-BjrB5nqj.js → python-D4E9jbx7.js} +1 -1
  33. package/dist/assets/{razor-CfoBmGDs.js → razor-B3x9cIEM.js} +1 -1
  34. package/dist/assets/{tsMode-BcEoMSxp.js → tsMode-dhQYPNMZ.js} +1 -1
  35. package/dist/assets/{typescript-DIg7TEmQ.js → typescript-CITkDxAE.js} +1 -1
  36. package/dist/assets/{workers-vXYuwtPw.js → workers-BQvF9bbO.js} +1 -1
  37. package/dist/assets/{xml-DexLQIQy.js → xml-DvHlU3A8.js} +1 -1
  38. package/dist/assets/{yaml-DUnD_1dE.js → yaml-uznsLgs8.js} +1 -1
  39. package/dist/cli/index.js +16465 -12096
  40. package/dist/cli/runtime/gpu.ts +71 -0
  41. package/dist/cli/runtime/io.ts +31 -25
  42. package/dist/contracts/camera.d.ts +70 -0
  43. package/dist/contracts/camera.js +27 -0
  44. package/dist/contracts/capabilities.d.ts +6 -6
  45. package/dist/contracts/definition.d.ts +62 -4
  46. package/dist/contracts/index.d.ts +4 -0
  47. package/dist/contracts/index.js +4 -0
  48. package/dist/contracts/particles.d.ts +54 -0
  49. package/dist/contracts/particles.js +167 -0
  50. package/dist/contracts/scene.d.ts +129 -0
  51. package/dist/contracts/scene.js +73 -0
  52. package/dist/contracts/schema.js +26 -3
  53. package/dist/contracts/series.d.ts +75 -0
  54. package/dist/contracts/series.js +2 -0
  55. package/dist/contracts/validate.js +23 -5
  56. package/dist/contracts/values.d.ts +4 -2
  57. package/dist/contracts/values.js +10 -0
  58. package/dist/gpu.d.ts +17 -0
  59. package/dist/gpu.js +61 -1
  60. package/dist/index.html +3 -3
  61. package/dist/io.d.ts +4 -16
  62. package/dist/io.js +26 -8
  63. package/dist/player/app.js +810 -0
  64. package/dist/player/embed.d.ts +4 -0
  65. package/dist/player/embed.js +77 -0
  66. package/dist/player/types.d.ts +35 -0
  67. package/dist/runtime/builtins/core/camera.d.ts +252 -0
  68. package/dist/runtime/builtins/core/camera.js +149 -0
  69. package/dist/runtime/builtins/core/index.d.ts +4 -2
  70. package/dist/runtime/builtins/core/index.js +8 -2
  71. package/dist/runtime/builtins/core/structural.d.ts +168 -0
  72. package/dist/runtime/builtins/core/structural.js +175 -0
  73. package/dist/runtime/builtins/core/time.d.ts +165 -0
  74. package/dist/runtime/builtins/core/time.js +110 -0
  75. package/dist/runtime/builtins/geo/definitions.d.ts +247 -0
  76. package/dist/runtime/builtins/geo/definitions.js +70 -0
  77. package/dist/runtime/builtins/geo/index.d.ts +2 -1
  78. package/dist/runtime/builtins/geo/index.js +3 -1
  79. package/dist/runtime/builtins/geo/render.d.ts +87 -0
  80. package/dist/runtime/builtins/geo/render.js +87 -0
  81. package/dist/runtime/builtins/geo/svgExport.d.ts +11 -0
  82. package/dist/runtime/builtins/geo/svgExport.js +10 -0
  83. package/dist/runtime/builtins/index.d.ts +5 -2
  84. package/dist/runtime/builtins/index.js +13 -3
  85. package/dist/runtime/builtins/pop/definitions.d.ts +2120 -0
  86. package/dist/runtime/builtins/pop/definitions.js +815 -0
  87. package/dist/runtime/builtins/pop/index.d.ts +2 -0
  88. package/dist/runtime/builtins/pop/index.js +2 -0
  89. package/dist/runtime/builtins/scene/definitions.d.ts +356 -0
  90. package/dist/runtime/builtins/scene/definitions.js +224 -0
  91. package/dist/runtime/builtins/scene/index.d.ts +2 -0
  92. package/dist/runtime/builtins/scene/index.js +2 -0
  93. package/dist/runtime/camera/index.d.ts +60 -0
  94. package/dist/runtime/camera/index.js +234 -0
  95. package/dist/runtime/definition/architecture.js +36 -1
  96. package/dist/runtime/geometry/render.d.ts +109 -0
  97. package/dist/runtime/geometry/render.js +145 -0
  98. package/dist/runtime/geometry/svg.d.ts +29 -0
  99. package/dist/runtime/geometry/svg.js +11 -5
  100. package/dist/runtime/gpu.d.ts +33 -0
  101. package/dist/runtime/gpu.js +218 -0
  102. package/dist/runtime/index.d.ts +4 -0
  103. package/dist/runtime/index.js +4 -0
  104. package/dist/runtime/pop/cache.d.ts +27 -0
  105. package/dist/runtime/pop/cache.js +123 -0
  106. package/dist/runtime/pop/forces.d.ts +202 -0
  107. package/dist/runtime/pop/forces.js +519 -0
  108. package/dist/runtime/pop/index.d.ts +5 -0
  109. package/dist/runtime/pop/index.js +5 -0
  110. package/dist/runtime/pop/state.d.ts +136 -0
  111. package/dist/runtime/pop/state.js +283 -0
  112. package/dist/runtime/pop/trail.d.ts +62 -0
  113. package/dist/runtime/pop/trail.js +142 -0
  114. package/dist/runtime/runtime.js +284 -9
  115. package/dist/runtime/scene/index.d.ts +50 -0
  116. package/dist/runtime/scene/index.js +94 -0
  117. package/dist/runtime/series/index.d.ts +41 -0
  118. package/dist/runtime/series/index.js +167 -0
  119. package/dist/runtime/types.d.ts +1 -1
  120. package/dist/studio/panel.d.ts +68 -1
  121. package/doc/HEADLESS_GPU.md +160 -0
  122. package/doc/NODE_REFERENCE.md +408 -1
  123. package/doc/PROJECT_AUTHORING.md +118 -20
  124. package/doc/WEB_PLAYER.md +131 -0
  125. package/package.json +25 -3
  126. package/dist/assets/geo-BAR6lQp5.js +0 -1
  127. package/dist/assets/index-BDV5xGBZ.css +0 -1
  128. package/dist/assets/index-CMcH8AgP.js +0 -212
  129. package/dist/assets/nodeTypeUtils-BBA1JqHx.js +0 -1
@@ -17,6 +17,68 @@ node and none is needed.
17
17
  These are definition-v1: their declarations are literal, so what follows is
18
18
  exact rather than a description.
19
19
 
20
+ ### `cascade.core.Camera`
21
+
22
+ Camera — A camera, following Houdini's /obj/cam.
23
+
24
+ Runs on `portable`.
25
+
26
+ **Inputs**
27
+
28
+ | name | type | default | range |
29
+ | --- | --- | --- | --- |
30
+ | `translate` | `vec3` | `[0,0,5]` | |
31
+ | `rotate` | `vec3` | `[0,0,0]` | |
32
+ | `focal` | `float` | `50` | 1…300 |
33
+ | `lookat` | `vec3` | `[0,0,0]` | |
34
+ | `up` | `vec3` | `[0,1,0]` | |
35
+ | `spin` | `float` | `0` | |
36
+
37
+ **Props**
38
+
39
+ | name | type | default | range |
40
+ | --- | --- | --- | --- |
41
+ | `lookAt` | `bool` | `false` | |
42
+ | `aperture` | `float` | `41.4214` | 1…200 |
43
+ | `resolution` | `vec2i` | `[1280,720]` | |
44
+ | `aspect` | `float` | `1` | 0.1…10 |
45
+ | `projection` | `string` | `"perspective"` | |
46
+ | `orthowidth` | `float` | `2` | |
47
+ | `near` | `float` | `0.001` | |
48
+ | `far` | `float` | `10000` | |
49
+
50
+ **Outputs**
51
+
52
+ | name | type | default | range |
53
+ | --- | --- | --- | --- |
54
+ | `camera` | `camera` | | |
55
+
56
+ ### `cascade.core.Feedback`
57
+
58
+ Feedback — Runs its contents once per step, carrying the previous result forward.
59
+
60
+ Runs on `portable`.
61
+
62
+ **Inputs**
63
+
64
+ | name | type | default | range |
65
+ | --- | --- | --- | --- |
66
+ | `initial` | `any` | `null` | |
67
+ | `steps` | `int` | `1` | |
68
+
69
+ **Props**
70
+
71
+ | name | type | default | range |
72
+ | --- | --- | --- | --- |
73
+ | `history` | `int` | `0` | 0…100000 |
74
+
75
+ **Outputs**
76
+
77
+ | name | type | default | range |
78
+ | --- | --- | --- | --- |
79
+ | `result` | `any` | | |
80
+ | `history` | `array` | | |
81
+
20
82
  ### `cascade.core.Input`
21
83
 
22
84
  Input — Defines a public graph or subnet input
@@ -111,6 +173,25 @@ Runs on `portable`.
111
173
  | --- | --- | --- | --- |
112
174
  | `output` | `any` | | |
113
175
 
176
+ ### `cascade.core.Previous`
177
+
178
+ Previous — The previous step's state, inside a Feedback container. The first step gets the container's initial value.
179
+
180
+ Runs on `portable`.
181
+
182
+ **Inputs**
183
+
184
+ | name | type | default | range |
185
+ | --- | --- | --- | --- |
186
+ | `initial` | `any` | `null` | |
187
+
188
+ **Outputs**
189
+
190
+ | name | type | default | range |
191
+ | --- | --- | --- | --- |
192
+ | `value` | `any` | | |
193
+ | `step` | `int` | | |
194
+
114
195
  ### `cascade.core.Random`
115
196
 
116
197
  Random — Generate a deterministic unit value from an explicit seed.
@@ -214,6 +295,28 @@ Runs on `portable`.
214
295
  | --- | --- | --- | --- |
215
296
  | `output` | `any` | | |
216
297
 
298
+ ### `cascade.core.Time`
299
+
300
+ Time — The current frame and time, as values the graph can read.
301
+
302
+ Runs on `portable`.
303
+
304
+ **Props**
305
+
306
+ | name | type | default | range |
307
+ | --- | --- | --- | --- |
308
+ | `frame` | `int` | `1` | |
309
+ | `fframe` | `float` | `1` | |
310
+ | `time` | `float` | `0` | |
311
+
312
+ **Outputs**
313
+
314
+ | name | type | default | range |
315
+ | --- | --- | --- | --- |
316
+ | `frame` | `int` | | |
317
+ | `fframe` | `float` | | |
318
+ | `time` | `float` | | |
319
+
217
320
  ### `cascade.geo.Circle`
218
321
 
219
322
  Circle — A closed circle, as one cubic Bezier chain or as a polygon of divisions segments.
@@ -303,6 +406,39 @@ Runs on `portable`.
303
406
  | --- | --- | --- | --- |
304
407
  | `geometry` | `geometry` | | |
305
408
 
409
+ ### `cascade.geo.Render`
410
+
411
+ Render — Draw a scene through a camera, as a raster.
412
+
413
+ Runs on `portable`.
414
+
415
+ **Inputs**
416
+
417
+ | name | type | default | range |
418
+ | --- | --- | --- | --- |
419
+ | `scene` | `scene` | | |
420
+ | `camera` | `camera` | | |
421
+
422
+ **Props**
423
+
424
+ | name | type | default | range |
425
+ | --- | --- | --- | --- |
426
+ | `size` | `vec2i` | `[1280,720]` | 16…8192 |
427
+ | `filename` | `string` | `"render.png"` | |
428
+ | `background` | `color` | `[0,0,0,0]` | |
429
+ | `stroke` | `color` | `[0,0,0,1]` | |
430
+ | `strokeWidth` | `float` | `1` | 0…200 |
431
+ | `opacity` | `float` | `1` | 0…1 |
432
+ | `drawPoints` | `bool` | `false` | |
433
+ | `pointRadius` | `float` | `1.5` | 0…50 |
434
+
435
+ **Outputs**
436
+
437
+ | name | type | default | range |
438
+ | --- | --- | --- | --- |
439
+ | `image` | `image` | | |
440
+ | `asset` | `asset` | | |
441
+
306
442
  ### `cascade.geo.SvgExport`
307
443
 
308
444
  SVG Export — Write geometry as an SVG document, one group element per group.
@@ -323,6 +459,8 @@ Runs on `portable`.
323
459
  | `width` | `float` | `0` | |
324
460
  | `height` | `float` | `0` | |
325
461
  | `margin` | `float` | `0` | |
462
+ | `bounds` | `vec4` | `[0,0,0,0]` | |
463
+ | `background` | `color` | `[0,0,0,0]` | |
326
464
  | `stroke` | `color` | `[0,0,0,1]` | |
327
465
  | `strokeWidth` | `float` | `1` | |
328
466
  | `opacity` | `float` | `1` | 0…1 |
@@ -360,6 +498,275 @@ Runs on `portable`.
360
498
  | --- | --- | --- | --- |
361
499
  | `geometry` | `geometry` | | |
362
500
 
501
+ ### `cascade.pop.FieldForce`
502
+
503
+ POP Field Force — Pull particles along a field's gradient and around its contours. The calligraphy force.
504
+
505
+ Runs on `portable`.
506
+
507
+ **Inputs**
508
+
509
+ | name | type | default | range |
510
+ | --- | --- | --- | --- |
511
+ | `particles` | `geometry` | | |
512
+ | `field` | `geometry` | | |
513
+
514
+ **Props**
515
+
516
+ | name | type | default | range |
517
+ | --- | --- | --- | --- |
518
+ | `normal` | `float` | `0` | -100000…100000 |
519
+ | `tangential` | `float` | `2600` | -100000…100000 |
520
+ | `radius` | `float` | `20` | 0…10000 |
521
+ | `level` | `float` | `0.28` | 0…1 |
522
+ | `hold` | `float` | `5200` | 0…100000 |
523
+
524
+ **Outputs**
525
+
526
+ | name | type | default | range |
527
+ | --- | --- | --- | --- |
528
+ | `geometry` | `geometry` | | |
529
+
530
+ ### `cascade.pop.NoiseForce`
531
+
532
+ POP Noise Force — Push particles along a heading read from a noise field.
533
+
534
+ Runs on `portable`.
535
+
536
+ **Inputs**
537
+
538
+ | name | type | default | range |
539
+ | --- | --- | --- | --- |
540
+ | `particles` | `geometry` | | |
541
+
542
+ **Props**
543
+
544
+ | name | type | default | range |
545
+ | --- | --- | --- | --- |
546
+ | `amplitude` | `float` | `6` | 0…500 |
547
+ | `frequency` | `float` | `0.3` | 0.001…10 |
548
+ | `evolve` | `float` | `0` | -1000…1000 |
549
+ | `timestep` | `float` | `0.041666666666666664` | 0.004166666666666667…1 |
550
+ | `seed` | `int` | `7` | 0…999999 |
551
+
552
+ **Outputs**
553
+
554
+ | name | type | default | range |
555
+ | --- | --- | --- | --- |
556
+ | `geometry` | `geometry` | | |
557
+
558
+ ### `cascade.pop.Separate`
559
+
560
+ POP Separate — Push neighbours apart within a radius.
561
+
562
+ Runs on `portable`.
563
+
564
+ **Inputs**
565
+
566
+ | name | type | default | range |
567
+ | --- | --- | --- | --- |
568
+ | `particles` | `geometry` | | |
569
+
570
+ **Props**
571
+
572
+ | name | type | default | range |
573
+ | --- | --- | --- | --- |
574
+ | `radius` | `float` | `0.5` | 0…100 |
575
+ | `strength` | `float` | `4` | 0…500 |
576
+ | `timestep` | `float` | `0.041666666666666664` | 0.004166666666666667…1 |
577
+
578
+ **Outputs**
579
+
580
+ | name | type | default | range |
581
+ | --- | --- | --- | --- |
582
+ | `geometry` | `geometry` | | |
583
+
584
+ ### `cascade.pop.Simulate`
585
+
586
+ POP Simulate — Re-simulate a particle system from frame zero to this frame.
587
+
588
+ Runs on `portable`.
589
+
590
+ **Inputs**
591
+
592
+ | name | type | default | range |
593
+ | --- | --- | --- | --- |
594
+ | `geometry` | `geometry` | | |
595
+ | `frame` | `float` | `1` | |
596
+ | `attract` | `geometry` | | |
597
+ | `field` | `geometry` | | |
598
+
599
+ **Props**
600
+
601
+ | name | type | default | range |
602
+ | --- | --- | --- | --- |
603
+ | `trail_length` | `int` | `14` | 1…500 |
604
+ | `trail_increment` | `int` | `1` | 1…32 |
605
+ | `substeps` | `int` | `1` | 1…32 |
606
+ | `timestep` | `float` | `0.041666666666666664` | 0.004166666666666667…1 |
607
+ | `impulse` | `int` | `6` | 0…100000 |
608
+ | `life` | `float` | `4` | 0…3600 |
609
+ | `lifevar` | `float` | `0.4` | 0…1 |
610
+ | `force` | `vec2` | `[0,0]` | |
611
+ | `airresist` | `float` | `0.4` | 0…20 |
612
+ | `noise_amplitude` | `float` | `14` | 0…500 |
613
+ | `noise_frequency` | `float` | `0.02` | 0.001…10 |
614
+ | `noise_evolve` | `float` | `0.08` | -10…10 |
615
+ | `field_normal` | `float` | `0` | -20000…20000 |
616
+ | `field_tangential` | `float` | `0` | -20000…20000 |
617
+ | `field_radius` | `float` | `24` | 0.5…2000 |
618
+ | `field_level` | `float` | `0.35` | 0…1 |
619
+ | `field_hold` | `float` | `0` | 0…40000 |
620
+ | `birth_area` | `vec4` | `[0,0,0,0]` | |
621
+ | `birth_hue` | `vec2` | `[0,0]` | 0…1 |
622
+ | `birth_saturation` | `float` | `0.6` | 0…1 |
623
+ | `birth_value` | `float` | `1` | 0…1 |
624
+ | `attract_amplitude` | `float` | `0` | 0…20000 |
625
+ | `attract_radius` | `float` | `60` | 0…5000 |
626
+ | `separate_radius` | `float` | `0` | 0…500 |
627
+ | `separate_strength` | `float` | `12` | 0…500 |
628
+ | `maxspeed` | `float` | `60` | 0…10000 |
629
+ | `wrap` | `vec4` | `[0,0,0,0]` | |
630
+ | `seed` | `int` | `7` | 0…999999 |
631
+
632
+ **Outputs**
633
+
634
+ | name | type | default | range |
635
+ | --- | --- | --- | --- |
636
+ | `geometry` | `geometry` | | |
637
+ | `trails` | `geometry` | | |
638
+
639
+ ### `cascade.pop.Solver`
640
+
641
+ POP Solver — Advance a particle system by one timestep.
642
+
643
+ Runs on `portable`.
644
+
645
+ **Inputs**
646
+
647
+ | name | type | default | range |
648
+ | --- | --- | --- | --- |
649
+ | `particles` | `geometry` | | |
650
+
651
+ **Props**
652
+
653
+ | name | type | default | range |
654
+ | --- | --- | --- | --- |
655
+ | `timestep_mode` | `string` | `"fixed"` | |
656
+ | `timestep` | `float` | `0.041666666666666664` | 0.004166666666666667…1 |
657
+ | `maxspeed` | `float` | `0` | 0…10000 |
658
+ | `force` | `vec2` | `[0,0]` | |
659
+ | `airresist` | `float` | `0` | 0…20 |
660
+
661
+ **Outputs**
662
+
663
+ | name | type | default | range |
664
+ | --- | --- | --- | --- |
665
+ | `geometry` | `geometry` | | |
666
+
667
+ ### `cascade.pop.Source`
668
+
669
+ POP Source — Birth particles from a geometry's points.
670
+
671
+ Runs on `portable`.
672
+
673
+ **Inputs**
674
+
675
+ | name | type | default | range |
676
+ | --- | --- | --- | --- |
677
+ | `geometry` | `geometry` | | |
678
+ | `particles` | `geometry` | | |
679
+
680
+ **Props**
681
+
682
+ | name | type | default | range |
683
+ | --- | --- | --- | --- |
684
+ | `impulse` | `int` | `8` | 0…100000 |
685
+ | `life` | `float` | `3` | 0…3600 |
686
+ | `lifevar` | `float` | `0.3` | 0…1 |
687
+ | `velocity` | `vec2` | `[0,0]` | |
688
+ | `seed` | `int` | `7` | 0…999999 |
689
+
690
+ **Outputs**
691
+
692
+ | name | type | default | range |
693
+ | --- | --- | --- | --- |
694
+ | `geometry` | `geometry` | | |
695
+
696
+ ### `cascade.pop.Trail`
697
+
698
+ POP Trail — Build trails from a Feedback container's history.
699
+
700
+ Runs on `portable`.
701
+
702
+ **Inputs**
703
+
704
+ | name | type | default | range |
705
+ | --- | --- | --- | --- |
706
+ | `history` | `array` | | |
707
+ | `particles` | `geometry` | | |
708
+
709
+ **Props**
710
+
711
+ | name | type | default | range |
712
+ | --- | --- | --- | --- |
713
+ | `result` | `string` | `"polylines"` | |
714
+ | `length` | `int` | `12` | 1…100000 |
715
+ | `increment` | `int` | `1` | 1…1000 |
716
+ | `velocityscale` | `float` | `1` | 0…100 |
717
+
718
+ **Outputs**
719
+
720
+ | name | type | default | range |
721
+ | --- | --- | --- | --- |
722
+ | `geometry` | `geometry` | | |
723
+
724
+ ### `cascade.scene.Light`
725
+
726
+ Light — A light, following Houdini's /obj/hlight. Nothing shades with lights yet — the viewport draws wireframe and points.
727
+
728
+ Runs on `portable`.
729
+
730
+ **Inputs**
731
+
732
+ | name | type | default | range |
733
+ | --- | --- | --- | --- |
734
+ | `translate` | `vec3` | `[0,0,5]` | |
735
+ | `direction` | `vec3` | `[0,0,-1]` | |
736
+ | `color` | `color` | `[1,1,1,1]` | |
737
+ | `intensity` | `float` | `1` | |
738
+
739
+ **Props**
740
+
741
+ | name | type | default | range |
742
+ | --- | --- | --- | --- |
743
+ | `type` | `string` | `"point"` | |
744
+ | `coneangle` | `float` | `45` | 0…180 |
745
+
746
+ **Outputs**
747
+
748
+ | name | type | default | range |
749
+ | --- | --- | --- | --- |
750
+ | `light` | `light` | | |
751
+
752
+ ### `cascade.scene.Scene`
753
+
754
+ Scene — Geometry, a camera and lights, assembled into a scene. Attach anything to the input.
755
+
756
+ Runs on `portable`.
757
+
758
+ **Inputs**
759
+
760
+ | name | type | default | range |
761
+ | --- | --- | --- | --- |
762
+ | `inputs` | `any` | | |
763
+
764
+ **Outputs**
765
+
766
+ | name | type | default | range |
767
+ | --- | --- | --- | --- |
768
+ | `scene` | `scene` | | |
769
+
363
770
  ## Studio node libraries
364
771
 
365
772
  Class-based nodes, available in Studio. Their parameters are declared in the
@@ -377,7 +784,7 @@ under `src/nodes/<library>/nodes/`.
377
784
 
378
785
  ### Geometry — `cascade.geo.*`
379
786
 
380
- **Geometry.** `cascade.geo.Rectangle` (A closed four-point polygon, counter-clockwise from bottom-left.), `cascade.geo.Circle` (A closed circle, as one cubic Bezier chain or as a polygon of divisions segments.), `cascade.geo.Transform` (Translate, rotate and scale geometry about a pivot.), `cascade.geo.Merge` (Concatenate geometries, taking the union of their attributes.), `cascade.geo.CopyToPoints` (Instance one geometry onto every point of another.), `cascade.geo.SvgExport` (Write geometry as an SVG document, one group element per group.)
787
+ **Geometry.** `cascade.geo.Rectangle` (A closed four-point polygon, counter-clockwise from bottom-left.), `cascade.geo.Circle` (A closed circle, as one cubic Bezier chain or as a polygon of divisions segments.), `cascade.geo.Transform` (Translate, rotate and scale geometry about a pivot.), `cascade.geo.Merge` (Concatenate geometries, taking the union of their attributes.), `cascade.geo.CopyToPoints` (Instance one geometry onto every point of another.), `cascade.geo.SvgExport` (Write geometry as an SVG document, one group element per group.), `cascade.geo.Render` (Draw a scene through a camera, as a raster.)
381
788
 
382
789
  ### Image — `cascade.image.*`
383
790
 
@@ -4,10 +4,15 @@ Cascade projects are filesystem-native. The graph, custom nodes, assets, presets
4
4
 
5
5
  ## Create and open a project
6
6
 
7
+ `cascade new` scaffolds and starts Studio. Stop that initial server before
8
+ installing dependencies and reopening the project. This example assumes the
9
+ default projects directory; use `cascade projects` to check your configured path.
10
+
7
11
  ```bash
8
12
  cascade new my-artwork
9
13
  cd ~/Documents/Cascade/my-artwork
10
- cascade .
14
+ npm install
15
+ npx --no-install cascade .
11
16
  ```
12
17
 
13
18
  For a workstation reached by name over a trusted VPN or LAN, bind deliberately
@@ -21,10 +26,41 @@ Open `http://KURO:3030`. Loopback remains the default. Cascade trusts the
21
26
  specific non-loopback bind hostname; `--trusted-host` is only needed when the
22
27
  browser uses a different hostname. Wildcard remote binds are rejected.
23
28
 
29
+ For an HTTPS reverse proxy that terminates TLS and forwards to loopback, bind
30
+ loopback explicitly and allow the exact external hostname:
31
+
32
+ ```bash
33
+ cascade . --host 127.0.0.1 --port 3030 --trusted-host cascade.example.internal
34
+ ```
35
+
36
+ The proxy must preserve that `Host` value; include a non-default external port
37
+ in `--trusted-host` when applicable. Add `--no-open` and visit the HTTPS URL
38
+ yourself, since automatic opening still constructs an HTTP URL. Cascade does not configure the
39
+ proxy or certificate; the explicit trusted host only admits its browser
40
+ authority while the server remains unreachable directly from the network.
41
+
24
42
  Cascade and generated projects require Node.js 22.13 or newer. Generated
25
43
  projects use TypeScript 6 so their static node definitions match Cascade's
26
44
  compiler and definition extractor.
27
45
 
46
+ `cascade new` writes a project-local dependency named `cascade` which aliases
47
+ the published `@field/cascade` package. Install it before using the project's
48
+ npm scripts:
49
+
50
+ ```bash
51
+ npm install
52
+ npm run check
53
+ npm run validate
54
+ ```
55
+
56
+ That dependency uses a caret range in the CLI's current minor line; the lockfile
57
+ records the resolved version. A local Cascade repository may contain newer
58
+ work even with the same version number. Record both the version and whether
59
+ the project resolves a checkout or a published package when diagnosing a
60
+ difference. Use a deliberate local package override
61
+ for framework development rather than committing a machine-specific
62
+ `file:../../Dev/cascade` dependency to a shared project.
63
+
28
64
  `index.cascade` is the default graph name. A project may contain several `.cascade` files; pass one explicitly when there is no unambiguous default:
29
65
 
30
66
  ```bash
@@ -94,13 +130,15 @@ export const renderers = {
94
130
 
95
131
  Each renderer instance owns its cleanup. An optional `update` method receives later values without remounting.
96
132
 
97
- To open a panel from the Inspector, declare an action parameter:
133
+ To open a panel from the Inspector, add an action prop to a definition-v1 node:
98
134
 
99
135
  ```ts
100
- node.param('asset_id', '', {
101
- label: 'Choose asset',
102
- action: 'panel:asset-browser',
103
- });
136
+ props: {
137
+ asset_id: {
138
+ type: 'string', default: '', label: 'Choose asset',
139
+ action: 'panel:asset-browser'
140
+ }
141
+ }
104
142
  ```
105
143
 
106
144
  The initiating node ID is captured as `api.sourceNodeId`; `setParam` uses the same history/dirty/cook path as the Inspector, so undo and save continue to work. Panels and project value renderers are Studio-only and are never imported during `cascade run` or by `cascade/runtime`.
@@ -133,11 +171,12 @@ const response = await authorizedFetch('image-api', 'https://api.example.com/v1/
133
171
  });
134
172
  ```
135
173
 
136
- `cascade/net` is resolved by Cascade's project compiler and backed by the
137
- Studio server's `/api/net` route. It is not a published package export or a
138
- neutral headless runtime capability. A standalone headless host must provide
139
- its own remote-I/O adapter or run the integration through an injected shell,
140
- Python, or application-specific server bridge.
174
+ `cascade/net` is a published host bridge backed by the Studio server's
175
+ `/api/net` route when project code is compiled by Cascade. It is not a neutral
176
+ runtime capability and has no useful authority without that installed bridge.
177
+ A standalone headless host must provide its own remote-I/O adapter or run the
178
+ integration through an injected shell, Python, or application-specific server
179
+ bridge.
141
180
 
142
181
  Browser proxy credentials must declare the exact allowed hosts and header metadata alongside the secret:
143
182
 
@@ -160,10 +199,18 @@ There are two styles. Write **definition-v1** for anything new; the dynamic styl
160
199
 
161
200
  | | Cooked by | Checked by |
162
201
  | --- | --- | --- |
163
- | **definition-v1**: a literal `definition` plus `execute(context)` | the deterministic runtime through `cascade run`, and Studio, which builds the ports from the literal | `cascade check`, which requires this style |
164
- | **dynamic**: `execute(node, graph)` declaring its own ports and parameters | Studio, and `cascade run` including `--frames` | `cascade validate` and a cook |
165
-
166
- Studio cooks both, and a Studio graph may mix them. `cascade run` picks one host per document: a graph whose project modules are all definition-v1 runs through the deterministic runtime, and anything else runs through the compatibility engine — which is also why `--frames` is refused on an all-definition-v1 graph, the deterministic runtime owning its own clock. The `AGENTS.md` that `cascade new` writes into a project states which style that project expects, and it is the file to believe over this one for a specific project.
202
+ | **definition-v1**: a literal `definition` plus `execute(context)` | the deterministic runtime through `cascade run`, including `--frames`; Studio adapts it into its compatibility controller | `cascade check`, which requires this style |
203
+ | **dynamic**: `execute(node, graph)` declaring its own ports and parameters | Studio and the CLI compatibility engine, including `--frames` | `cascade validate` and a cook |
204
+
205
+ Studio cooks both, and a Studio graph may mix them. `cascade run` picks one host
206
+ per document: an all-definition-v1 graph runs through the deterministic
207
+ runtime and an all-dynamic graph runs through the compatibility engine. A
208
+ mixed CLI document is rejected until the bounded adapter between those engines
209
+ exists. Both homogeneous forms support `--frames`; deterministic runs receive
210
+ an explicit frame and fps so expressions and keyframe channels resolve
211
+ reproducibly. The `AGENTS.md` that `cascade new` writes into a project states
212
+ which style that project expects, and it is the file to believe over this one
213
+ for a specific project.
167
214
 
168
215
  ### definition-v1
169
216
 
@@ -244,9 +291,9 @@ export async function execute(node: any) {
244
291
  }
245
292
  ```
246
293
 
247
- `param()` is a method on the node the engine hands to `execute`, not an import. It is re-declared on every cook, so it never resets a value, an expression, or a keyframe someone set: reading `.value` gives the *resolved* value for the current frame, whichever of the three bindings is in force. Top-level statements outside `execute` do not run, because the loader imports a real ES module and needs the `execute` export.
294
+ `param()` is a method on the node the engine hands to `execute`, not an import. It is re-declared on every cook, so it never resets a value, an expression, or a keyframe someone set: reading `.value` gives the *resolved* value for the current frame, whichever of the three bindings is in force. The loader imports the module as real JavaScript, so top-level code does run at import time. Keep dynamic modules free of top-level effects and put interface declaration and cooking inside `execute`.
248
295
 
249
- Prefer `new OffscreenCanvas(width, height)` to `document.createElement('canvas')` when both hosts could run the node, and keep `runsOn: 'browser'` for code that genuinely needs the page. Web technology comes first, meaning Canvas 2D, WebGL and WebGPU. A Python stage is for work that cannot run in a browser at all, such as an exotic ML library. A Python stage costs a process spawn and a round trip per cook, which is invisible on one still frame and fatal to dragging a parameter or playing an animation.
296
+ Prefer `new OffscreenCanvas(width, height)` to `document.createElement('canvas')` when both hosts can run the node. A portable declaration still requires output parity checks; installing Skia does not override a browser-only declaration. Use Python for libraries or tools that require a server. Measure transport, serialization, and cold-start costs; persistent workers can avoid repeated process/model startup.
250
297
 
251
298
  Choose the narrowest execution locus:
252
299
 
@@ -268,6 +315,25 @@ export const definition = {
268
315
 
269
316
  The runtime refuses unsupported host/capability combinations before executing the graph.
270
317
 
318
+ ### GPU nodes today
319
+
320
+ A definition-v1 node may declare `capabilities: ['gpu']`. Studio and the optional
321
+ Dawn CLI host provide one shared `GPUDevice`, adapter identity and limits, plus
322
+ a cache scoped to each node instance for pipelines, samplers, and other
323
+ resources that outlive one cook. The host clears cached resources on host
324
+ disposal or device loss and requests a fresh device on a later cook.
325
+
326
+ Use `runsOn: 'portable'` for shared WebGPU code without browser APIs. Render into
327
+ a texture and use `readTexture` from `cascade/gpu` for explicit RGBA8 pixels,
328
+ then encode through the image/IO host. See [headless GPU rendering](HEADLESS_GPU.md)
329
+ for CLI/agent commands, restrictions and tests.
330
+
331
+ This is the first GPU capability stage. Texture connections are not available:
332
+ GPU nodes still publish images, so an image must be encoded or read back before
333
+ another node receives it. Do not model a current graph as a chain of portable
334
+ texture handles, and do not keep a device or pipeline in module-level mutable
335
+ state.
336
+
271
337
  Some portable operations have genuinely useful browser and server
272
338
  implementations. Keep one literal definition and one module ID; let the host's
273
339
  registration load the implementation for its environment. Do not add an
@@ -340,7 +406,11 @@ In the document, a channel sits in the node's `props` next to the value and the
340
406
  }
341
407
  ```
342
408
 
343
- `params` holds plain values; a binding needs the object form under `props`. Playback settings, the frame range and loop, belong to the Timeline panel and are not saved with the document.
409
+ Definition-v1 parameter values belong under `props`: use a bare value for an
410
+ unbound parameter or the object form for an expression/channel. A leftover
411
+ `params` array is not read by the deterministic runtime and produces a
412
+ `runtime/stray-params` warning. Playback settings, frame range, and loop belong
413
+ to the Timeline panel and are not saved with the document.
344
414
 
345
415
  ## Run a coding agent in the project
346
416
 
@@ -484,12 +554,35 @@ cascade run index.cascade --frames 42 --entry-node logo-1024
484
554
 
485
555
  Offline, drawing goes through Skia: the optional `@napi-rs/canvas` supplies `OffscreenCanvas`, `Image`, `Path2D` and the rest as globals in the Node process, deliberately not `document`, because that is how a node tells which host it is in. This is why a node that draws on an `OffscreenCanvas` needs no second implementation for headless runs, and why the built-in `cascade.image.*` nodes render under `cascade run` as well as in Studio. A graph that draws nothing runs without the renderer installed.
486
556
 
487
- `--frames` renders dynamic graphs. A definition-v1 graph runs through the deterministic runtime, which owns its own clock and has no parameter animation, and the flag is refused rather than silently rendering the first frame repeatedly.
557
+ `--frames` renders both homogeneous graph forms. An all-definition-v1 graph
558
+ runs once per requested frame through the deterministic runtime, which resolves
559
+ expressions and channels from the explicit frame and fps. An all-dynamic graph
560
+ uses the compatibility frame renderer. A mixed graph is rejected rather than
561
+ silently choosing one engine.
488
562
 
489
563
  Applications can use `createRuntime()` from `cascade/runtime` directly. Register node modules and host capabilities, load the graph, mutate inputs or presets, run or trigger it, read outputs, then dispose it. This path loads no Svelte or Studio code and works in a backend service or a custom browser application.
490
564
 
491
565
  Server and browser hosts are deliberately explicit. A graph that uses Python or shell stages belongs on the server or behind an application-defined bridge; the runtime does not silently move computation between environments.
492
566
 
567
+ For a browser-only deployment, build a static player:
568
+
569
+ ```bash
570
+ cascade build index.cascade --out web-player --asset assets/source.svg
571
+ ```
572
+
573
+ The output directory must be new. Serve it over HTTP(S), open `index.html`, or
574
+ embed `player.html` in an iframe. `embed.js` supplies same-origin playback,
575
+ parameter and output controls. Only explicitly included files and literal typed
576
+ asset/image references are copied; server capabilities are rejected, not proxied.
577
+ See [Web player](WEB_PLAYER.md) for the full deployment and asset contract.
578
+
579
+ The Studio single-HTML/folder exporter is separate from this player. It currently
580
+ serializes a compatibility graph into its own small browser runtime, so it does
581
+ not preserve every node, capability, or runtime behavior. Use it only after
582
+ testing the exported artifact for the particular graph. Prefer `cascade build`
583
+ for definition-v1 browser graphs, or embed `cascade/runtime` directly when an
584
+ application needs custom capabilities and presentation.
585
+
493
586
  ## Verify a project
494
587
 
495
588
  Before committing a custom node or graph:
@@ -499,4 +592,9 @@ Before committing a custom node or graph:
499
592
  3. Run the graph headlessly when its capabilities are available. This is the step that catches a document that loads, reports its nodes, and draws nothing. The characteristic failure here is silent, so a static pass alone proves little.
500
593
  4. Open Studio only for visual inspection or authoring that benefits from the graph UI.
501
594
 
502
- Dynamic modules are not deprecated and 0.3.0 stopped calling them legacy: the two styles are cooked by different hosts, and a project's own `AGENTS.md` says which one it expects. Convert a node when you need what the other style gives, static inspection and `cascade check` on one side or Studio cooking and `--frames` on the other, rather than on a schedule.
595
+ Dynamic modules are not deprecated and 0.3.0 stopped calling them legacy. The
596
+ two styles are cooked by different CLI engines, while Studio currently adapts
597
+ both through its compatibility controller. Prefer definition-v1 for new work
598
+ because it provides static inspection, `cascade check`, and the neutral runtime.
599
+ Keep an existing dynamic node when its current compatibility-only APIs are
600
+ still required, and keep CLI graphs homogeneous until mixed execution exists.