Interface IGraphicsModule7
interface IGraphicsModule7
Extends IGraphicsModule6
Methods
makeRuntimeShader()
Compiles shader source into a runtime shader. Compilation is synchronous. Compiled programs are cached internally for subsequent calls with the same source.IRuntimeShader*makeRuntimeShader(stringsource)
Parameters
source
string — Required
The shader source code. Must not be empty.
Returns
IRuntimeShader*
The compiled IRuntimeShader.
Throws
InvalidArgumentError— If source is empty or contains syntax errors. The exception message includes the failure reason.
makeRuntimeShaderImageFilter()
Creates anIImageFilter*makeRuntimeShaderImageFilter(IRuntimeShader*runtimeShader,stringcontentUniformName,IImageFilter?imageFilter)
IImageFilter from a IRuntimeShader.
The shader source must declare a child shader uniform that receives
input content. The child content is sampled in the shader via
childName.eval(coord).
Child-name binding is resolved when the filter is applied, not when it is
created. If contentUniformName is empty and the shader declares exactly
one child shader, it is auto-bound. If contentUniformName does not match a
child shader declaration, or is empty when the shader declares zero or more
than one child, the filter fails to build and is not applied, so the
content renders unfiltered; an error is logged.
If contentUniformName was previously bound via IRuntimeShader::setInputShader, the image
filter binding overrides it.
Parameters
runtimeShader
IRuntimeShader* — Required
The IRuntimeShader containing the filter effect.
contentUniformName
string — Required
Name of the child shader uniform that receives input content, or empty for auto-bind.
imageFilter
IImageFilter? — Optional
Optional IImageFilter providing filtered content to the child shader uniform, or null to use the source content directly.
Returns
IImageFilter*
An IImageFilter applying the shader to input content.
makeMultiInputRuntimeShaderImageFilter()
Creates anIImageFilter*makeMultiInputRuntimeShaderImageFilter(IRuntimeShader*runtimeShader,ChildShaderInput*[]childInputs)
IImageFilter from a IRuntimeShader with multiple inputs.
Each ChildShaderInput binds a named child shader uniform to an
image filter source. This enables effects that sample from multiple
filtered inputs in a single shader pass. Each declared child shader
resolves to one of three inputs:
- Listed with a non-null imageFilter: the filtered content is sampled.
- Listed with a null imageFilter: the source content is sampled directly.
- Not listed in childInputs: the child is unbound and samples as transparent black.
IRuntimeShader::setInputShader and a
binding is passed through ChildShaderInput, the image filter binding
overrides it. Other children retain their setInputShader bindings if
not present in childInputs.
Child-name binding is resolved when the filter is applied, not when it is
created. If any name is empty, duplicated, or does not match a child shader
declaration, the whole filter fails to build and is not applied, so the
content renders unfiltered; an error is logged.
Warning: omitting a declared child from childInputs leaves it unbound, and
that child samples as transparent black.
Parameters
runtimeShader
IRuntimeShader* — Required
The IRuntimeShader with child shader declarations.
childInputs
ChildShaderInput*[] — Required
Array of child shader bindings. Names must be unique and match child shader declarations in the shader source. List a child with a null imageFilter to sample source content directly.
Returns
IImageFilter*
An IImageFilter applying the shader with multiple inputs.

