$npx -y skills add tebjan/vvvv-skills --skill vvvv-fundamentalsExplains vvvv gamma core concepts — data types, frame-based execution model, pins, pads, links, node browser, live compilation (source project vs binary reference workflows), .vl document structure, file types (.vl/.sdsl/.cs/.csproj), ecosystem overview, and AppHost runtime detec
| 1 | # vvvv gamma Fundamentals |
| 2 | |
| 3 | ## What Is vvvv gamma |
| 4 | |
| 5 | vvvv gamma is a visual programming environment for .NET 8. It combines node-based patching with C# code generation, targeting Stride (3D engine) and .NET APIs. Programs are built by connecting nodes with links in a visual editor. |
| 6 | |
| 7 | vvvv is a live programming environment — programs run continuously while you build them. Both visual patch edits and C# code changes take effect immediately without restarting. vvvv compiles C# source files itself via Roslyn into in-memory assemblies on every save. |
| 8 | |
| 9 | ## Document Structure |
| 10 | |
| 11 | - **`.vl` files** — vvvv gamma documents (XML-based, version controlled) |
| 12 | - Each document contains **Patches** (visual programs) and **Definitions** (types, operations) |
| 13 | - Documents can reference NuGet packages and other `.vl` files |
| 14 | - The **Patch Explorer** shows the document's type hierarchy |
| 15 | |
| 16 | ## Execution Model |
| 17 | |
| 18 | - **Frame-based evaluation** — the mainloop evaluates the entire graph every frame (~60 FPS) |
| 19 | - **Data flows left-to-right, top-to-bottom** through links between nodes |
| 20 | - **Process nodes** maintain state between frames (constructor → Update loop → Dispose) |
| 21 | - **Operation nodes** are pure functions evaluated each frame |
| 22 | - vvvv evaluates all connected nodes, skips disconnected subgraphs |
| 23 | |
| 24 | ## Live Compilation Model |
| 25 | |
| 26 | vvvv runs your program continuously while you edit it. There is no edit-compile-run cycle for patches and shaders. For C#, live reload depends on how the code is referenced. |
| 27 | |
| 28 | ### Patch Changes |
| 29 | |
| 30 | - Edits to visual patches apply immediately |
| 31 | - Node state (instance fields) is preserved across edits |
| 32 | - New nodes and links become active on the next frame |
| 33 | |
| 34 | ### Shader Changes |
| 35 | |
| 36 | - `.sdsl` shader files always live-reload when saved |
| 37 | - vvvv recompiles shaders in the background and swaps them in the running program |
| 38 | |
| 39 | ### C# — Two Workflows |
| 40 | |
| 41 | C# code can be integrated via source project reference or pre-compiled binary. The choice depends on project size and development phase. |
| 42 | |
| 43 | **Source project reference** (live reload): |
| 44 | |
| 45 | When a .vl document references a .csproj source project, vvvv compiles .cs files itself via Roslyn into in-memory assemblies. No `dotnet build` or external toolchain is involved. |
| 46 | |
| 47 | - On .cs file save, vvvv detects the change and recompiles in the background |
| 48 | - Status indicator: gray = building symbols, orange = emitting C# |
| 49 | - On successful compilation, affected nodes restart their lifecycle: |
| 50 | 1. `Dispose()` called on old instance |
| 51 | 2. New constructor runs (with fresh `NodeContext`) |
| 52 | 3. `Update()` resumes on the next frame |
| 53 | - Static fields reset on reload — the entire in-memory assembly is replaced |
| 54 | - On compilation error, the program continues running with the last valid code |
| 55 | |
| 56 | **Binary reference** (no live reload): |
| 57 | |
| 58 | When a .vl document references a pre-compiled DLL or NuGet package, the assembly is loaded once at startup. To pick up changes, you must rebuild the DLL externally (e.g., `dotnet build`) and restart vvvv. This workflow is common for larger projects and stable libraries where live reload is not needed. |
| 59 | |
| 60 | ## Node Categories |
| 61 | |
| 62 | ### Process Nodes |
| 63 | - Have Create (constructor), Update (per-frame), and Dispose lifecycle |
| 64 | - Written in C# with `[ProcessNode]` attribute |
| 65 | - Maintain internal state between frames |
| 66 | - Use change detection to avoid redundant work |
| 67 | |
| 68 | ### Operation Nodes |
| 69 | - Pure functions: same input always produces same output |
| 70 | - Written as static C# methods (auto-discovered by vvvv) |
| 71 | - No state between frames |
| 72 | - No `[ProcessNode]` attribute needed |
| 73 | |
| 74 | ### Adaptive Nodes |
| 75 | - Nodes that adapt their implementation based on connected input types |
| 76 | - Example: `+` works with int, float, Vector3, string, etc. |
| 77 | - Resolved at link-time, not runtime |
| 78 | |
| 79 | ## Pins, Pads, and Links |
| 80 | |
| 81 | - **Pins** — inputs and outputs on nodes and regions |
| 82 | - **Pads** — visual nodes for reading/writing Properties inside operation patches; all pads with the same name refer to the same property |
| 83 | - **Links** — connections between pins that define data flow and execution order |
| 84 | - **Spreading** — when a `Spread<T>` connects to a single-value input, the node auto-iterates |
| 85 | |
| 86 | ## When to Patch vs Write C# |
| 87 | |
| 88 | | Use Patching | Use C# Code | |
| 89 | |---|---| |
| 90 | | Prototyping, data flow | Custom nodes, performance-critical code | |
| 91 | | Visual connections, UI composition | Complex algorithms | |
| 92 | | Real-time parameter tweaking | .NET library interop | |
| 93 | | Dataflow routing and spreading |