Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface IGraphicsModule7

interface IGraphicsModule7
Extends IGraphicsModule6

Methods

makeRuntimeShader()

IRuntimeShader* makeRuntimeShader(string source)
Compiles shader source into a runtime shader. Compilation is synchronous. Compiled programs are cached internally for subsequent calls with the same source.

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()

IImageFilter* makeRuntimeShaderImageFilter(IRuntimeShader* runtimeShader, string contentUniformName, IImageFilter? imageFilter)
Creates an 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()

IImageFilter* makeMultiInputRuntimeShaderImageFilter(IRuntimeShader* runtimeShader, ChildShaderInput*[] childInputs)
Creates an 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.
If any named child was previously bound via 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.
Last modified on October 29, 2026