Code Editor
The Fragment and Vertex tabs are plain text editors for writing GLSL shader code directly. Every edit triggers a live recompile — the updated shader appears in your track within half a second.
Fragment shader
Section titled “Fragment shader”The fragment shader runs once per pixel and sets gl_FragColor. This is the main shader file.
Every shader must begin with an ISF JSON metadata block that defines its parameters:
/*{ "DESCRIPTION": "My shader", "CREDIT": "Your Name", "CATEGORIES": ["Generator"], "INPUTS": [ { "NAME": "speed", "TYPE": "float", "DEFAULT": 1.0, "MIN": 0.0, "MAX": 5.0 } ]}*/
void main() { vec2 uv = isf_FragNormCoord; gl_FragColor = vec4(uv, 0.5 + 0.5 * sin(TIME * speed), 1.0);}Built-in uniforms
Section titled “Built-in uniforms”| Uniform | Type | Description |
|---|---|---|
TIME | float | Elapsed seconds since the shader started |
TIMEDELTA | float | Seconds since the last frame |
FRAMEINDEX | int | Frame counter |
isf_FragNormCoord | vec2 | Normalised UV coordinates (0–1) |
RENDERSIZE | vec2 | Output size in pixels |
inputImage | sampler2D | Input texture (effects only — not available on generators) |
Categories
Section titled “Categories”The CATEGORIES array in the metadata block sets the shader type used when loading into Arkestra. Use "Generator" for layer shaders (no input) and "Effect" for post-processors that read inputImage.
Vertex shader
Section titled “Vertex shader”The Vertex tab is for an optional custom vertex shader. Leave it empty if you only need a fragment shader — Arkestra uses a default passthrough vertex shader automatically.
Use a custom vertex shader when you need:
- Varying variables passed from vertex to fragment stage
- Effects that sample neighbouring pixels (optical flow, Sobel edge detection, multi-pass blur)
When the fragment shader declares varying variables, you must provide a matching vertex shader in the Vertex tab.
Switching between Chat and code tabs
Section titled “Switching between Chat and code tabs”The Chat tab and code tabs stay in sync. Edits you make in the Fragment or Vertex tabs are visible to the AI when you switch back to Chat. When you switch from a code tab back to Chat, the current shader state is synced into the AI’s context automatically.