Appearance
kids.kapish.terrains.vista
unity
Custom graph nodes for Pinwheel Vista — an Input-with-Default node plus image utility nodes.
Installation
Add to your Unity project's package manifest:
json
{
"kids.kapish.terrains.vista": "file:../../src/unity/kids.kapish.terrains.vista"
}Requires Unity 6000.0+ and Vista installed with the VISTA scripting define set.
Architecture
Vista as an external, non-UPM dependency
Vista ships through the Asset Store, not a UPM feed, so it cannot be declared in package.json dependencies. Instead the assemblies:
- Reference Vista's assemblies by name —
Pinwheel.Vista.Runtime(andPinwheel.Vista.Editorfor the editor assembly). - Carry a
VISTAdefine constraint — the asmdefs only compile whenVISTAis defined. In a project without Vista (whereVISTAis absent and the Pinwheel assemblies don't exist), the asmdefs are skipped entirely, so the missing references never dangle.
The source is additionally wrapped in #if VISTA, mirroring the constraint at the file level. This is the same overlay pattern used for other external-asset integrations in the kapish (e.g. the FMOD audio backend), adapted for an asset that isn't UPM-distributed.
Why these live outside the Vista tree
Vista's own folders are vendor code — anything placed inside them is lost on a Vista reinstall/upgrade. These nodes were originally authored inside the Vista assemblies; lifting them into their own package makes them survivable, versionable, and reusable across projects. Because every Vista member they touch is public/protected, they compile cleanly from a separate assembly that merely references Vista.
Node design
- InputNodeDefault subclasses Vista's
InputNodeand adds a second input slot (the Default pin) whose data type lazily tracks the input's slot type. At execute time it probes theGraphContextto decide whether the input is genuinely bound from outside; if so it defers to the baseInputNodebehaviour, otherwise it copies the Default pin's buffer/texture to the output. Reference counts are balanced in both paths so pooled resources free correctly. - ColorLerpNode / ColorTintByMaskNode / FlipYNode subclass
ImageNodeBaseand follow Vista's standard execute pattern: read input textures (with sensible white/black fallbacks for unconnected pins), allocate a render target sized viaCalculateResolution, run a single-pass fragment shader, and release references. Each owns a hidden shader loaded by name withShaderUtilities.Find.
Shaders
Shaders are loaded by their declared name (Hidden/Game/Terrain/*), not by asset path or GUID, so they must be discoverable in a build — hence they live under a Resources/ folder. The shader name in each .shader file is the contract with the SHADER_NAME constant in the corresponding node; keep them in sync.
File Structure
Runtime/
├── InputNodeDefault.cs # InputNode + fallback Default pin
├── ColorLerpNode.cs # lerp(A, B, mask)
├── ColorTintByMaskNode.cs # multiplicative tint by mask
├── FlipYNode.cs # vertical mask flip
├── Resources/Game/Shaders/
│ ├── ColorLerp.shader
│ ├── ColorTintByMask.shader
│ └── FlipY.shader
└── Carrot.Terrains.Vista.asmdef
Editor/
├── InputNodeDefaultEditor.cs # inspector for InputNodeDefault
└── Carrot.Terrains.Vista.Editor.asmdefDependencies
| Reference | Kind |
|---|---|
Pinwheel.Vista.Runtime | external — Vista runtime (ImageNodeBase, InputNode, GraphContext, SlotProvider, Drawing, DataPool, ShaderUtilities) |
Pinwheel.Vista.Editor | external — Vista editor (ExecutableNodeEditorBase, NodeEditor, NodeView, InputNodeEditor) |
Build
Import via Unity Package Manager alongside Vista. Requires Unity 6000.0+. Assemblies compile only when VISTA is defined.
Usage Guide
Custom graph nodes for Pinwheel Vista.
Prerequisites
- Vista installed (Pro or Personal).
- The
VISTAscripting define present (Vista sets this; if your project relies on a manual define, addVISTAunder Project Settings → Player → Scripting Define Symbols).
Once both are in place and the package is added, the nodes appear in the Vista graph's node-creation menu.
The nodes
Input (Default) — IO / Graph Input (Default)
Use in place of a regular Graph Input when you want the graph to preview standalone. Wire your fallback (a Constant, a Load Texture, etc.) into the Default pin. While editing the graph on its own — or whenever a parent sub-graph leaves the input unconnected — the Default value drives the output. When the graph is consumed as a sub-graph (or the input is bound from code), the external value takes over and Default is ignored. Set the input Name and Slot Type in the node inspector exactly as you would for a stock Graph Input; the reserved-name dropdown is available too.
Color Lerp — Game / Color Lerp
Blend two colour textures by a mask: output = lerp(A * colorA, B * colorB, mask). Leave A or B unconnected to use its colour as a flat fill; connect a texture and the colour becomes a tint (set it white to pass the texture through unchanged).
Color Tint By Mask — Game / Color Tint By Mask
Darken/tint a colour texture where a mask is strong: output = lerp(input, input * tint, mask * strength). Good for wetness or flow darkening, and biome-edge desaturation. Strength (0–1) scales the mask's influence.
Flip Y — Game / Flip Y
Vertically flips a mask. Equivalent to a Transform 2D with scale (100, -100) — drop it after a Load Texture whose source is upside-down rather than wiring a full Transform 2D each time.
Tips
- Gating — if the nodes don't appear, confirm Vista is installed and
VISTAis defined; the assemblies are excluded otherwise (by design). - Shaders ship in Resources — they load by name (
Hidden/Game/Terrain/*), so they resolve in builds, not just the editor. Don't move them out ofResources/. - Default pin type —
InputNodeDefaultrebuilds its Default pin to match the chosen slot type, so set the slot type first; the Default pin follows automatically.