Skip to main content
POST
Compile and store a shader

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

POST /v1/shaders: compile an SkSL source and store it.

name
string
required

A label, carried into renders as the entry's name.

Required string length: 1 - 255
source
string
required

The SkSL body: half4 main(float2 uv) (uv 0 to 1 from the top-left), or Jitter's half4 jitterMain(float2 uv). No uniform declarations: uniforms come from the prelude and params.

Minimum string length: 1
lang
string
default:sksl

The source language; SkSL is the only one.

Allowed value: "sksl"
jitter
boolean | null

Compile in Jitter's dialect. Omitted: when the source defines jitterMain.

params
ShaderParamSpec · object[]

The params the source reads, in order.

Response

Successful Response

A stored shader. variants and source come back with ?view=full only.

id
string
required

Its id, for effects[].shader.id.

Example:

"sh_01J8QR2K5VKDGN2T4FBM3CZYX7"

name
string
required
lang
string
required
hash
string
required

SHA-256 of "sksl\n" + source, 64 lowercase hex digits: the entry's identity.

jitter
boolean
required

Compiled in Jitter's dialect.

status
enum<string>
required

failed shaders cannot render; errors says why.

Available options:
compiled,
failed
params
ShaderParamSpec · object[]
required
shared
boolean
required

A shared shader every workspace can use, and none can delete.

created_at
string<date-time>
required
updated_at
string<date-time>
required
errors
ShaderCompileError · object[]

The compiler's errors, with positions.

variant_hashes
Variant Hashes · object

SHA-256 of each variant (glsl330, glsles300, wgsl), as the engines check them.

source
string | null

The SkSL source (?view=full).

variants
Variants · object | null

The compiled variants' text (?view=full).