Interface IRuntimeShader
interface IRuntimeShader
Extends IShader
A shader compiled from source at runtime, enabling custom GPU visual effects.
Supports two rendering modes:
- Procedural: shader generates pixels directly via
IPaint::setShader. - Content: shader post-processes input content via
IGraphicsModule7::makeRuntimeShaderImageFilter.
IPaint::setShader and IGraphicsModule7::makeRuntimeShaderImageFilter capture a
snapshot of the current uniform values - mutating uniforms after binding does not affect
already-issued draw calls. All methods must be called on the UI thread; no external
synchronization is needed.
Methods
setUniformFloat()
Sets a float uniform value.voidsetUniformFloat(stringname,floatvalue)
Parameters
name
string — Required
The uniform name matching the shader source declaration.
value
float — Required
The float value.
Throws
InvalidArgumentError— If the uniform name is not found or empty, or the type does not match the shader declaration.
setUniformFloat2()
Sets a float2 uniform value.voidsetUniformFloat2(stringname,floatv1,floatv2)
Parameters
name
string — Required
The uniform name matching the shader source declaration.
v1
float — Required
First component.
v2
float — Required
Second component.
Throws
InvalidArgumentError— If the uniform name is not found or empty, or the type does not match the shader declaration.
setUniformFloat3()
Sets a float3 uniform value.voidsetUniformFloat3(stringname,floatv1,floatv2,floatv3)
Parameters
name
string — Required
The uniform name matching the shader source declaration.
v1
float — Required
First component.
v2
float — Required
Second component.
v3
float — Required
Third component.
Throws
InvalidArgumentError— If the uniform name is not found or empty, or the type does not match the shader declaration.
setUniformFloat4()
Sets a float4 uniform value.voidsetUniformFloat4(stringname,floatv1,floatv2,floatv3,floatv4)
Parameters
name
string — Required
The uniform name matching the shader source declaration.
v1
float — Required
First component.
v2
float — Required
Second component.
v3
float — Required
Third component.
v4
float — Required
Fourth component.
Throws
InvalidArgumentError— If the uniform name is not found or empty, or the type does not match the shader declaration.
setUniformInt()
Sets an integer uniform value.voidsetUniformInt(stringname,i32value)
Parameters
name
string — Required
The uniform name matching the shader source declaration.
value
i32 — Required
The integer value.
Throws
InvalidArgumentError— If the uniform name is not found or empty, or the type does not match the shader declaration.
setUniformInt2()
Sets an int2 uniform value.voidsetUniformInt2(stringname,i32v1,i32v2)
Parameters
name
string — Required
The uniform name matching the shader source declaration.
v1
i32 — Required
First component.
v2
i32 — Required
Second component.
Throws
InvalidArgumentError— If the uniform name is not found or empty, or the type does not match the shader declaration.
setUniformInt3()
Sets an int3 uniform value.voidsetUniformInt3(stringname,i32v1,i32v2,i32v3)
Parameters
name
string — Required
The uniform name matching the shader source declaration.
v1
i32 — Required
First component.
v2
i32 — Required
Second component.
v3
i32 — Required
Third component.
Throws
InvalidArgumentError— If the uniform name is not found or empty, or the type does not match the shader declaration.
setUniformInt4()
Sets an int4 uniform value.voidsetUniformInt4(stringname,i32v1,i32v2,i32v3,i32v4)
Parameters
name
string — Required
The uniform name matching the shader source declaration.
v1
i32 — Required
First component.
v2
i32 — Required
Second component.
v3
i32 — Required
Third component.
v4
i32 — Required
Fourth component.
Throws
InvalidArgumentError— If the uniform name is not found or empty, or the type does not match the shader declaration.
setInputShader()
Binds a child shader input for composition. The name must match a child shader declaration in the source. The child shader is evaluated in the source viavoidsetInputShader(stringname,IShader?shader)
childName.eval(coord).
Replaces any previously bound shader for that name. Passing null clears the binding —
unbound children produce transparent black.
Note: Null here differs from null in IGraphicsModule7::makeRuntimeShaderImageFilter.
In the image filter pipeline, a null imageFilter means “use source content directly.”
In setInputShader, null clears the binding, producing transparent black for that child.
Parameters
name
string — Required
The child shader name matching the shader source declaration.
shader
IShader? — Optional
The shader to bind, or null to clear.
Throws
InvalidArgumentError— If the child shader name is not found or empty.
isChildBound()
Checks whether a child shader has been bound viaboolisChildBound(stringname)
IRuntimeShader::setInputShader.
Returns true if the named child has a non-null shader bound. Returns false if the child
has never been bound, was cleared by passing null to setInputShader, or if the name does
not match any child shader declaration. Image filter bindings made via
IGraphicsModule7::makeRuntimeShaderImageFilter or
IGraphicsModule7::makeMultiInputRuntimeShaderImageFilter are separate and do not
affect this result — those bindings happen internally at the filter pipeline level.
Parameters
name
string — Required
The child shader name matching the shader source declaration.
Returns
bool
True if the child shader is bound via IRuntimeShader::setInputShader, false otherwise.

