Class DynamicTextureExpression

The DynamicTextureExpression class implements a more compact version of DynamicTexture. The class allows the user to get an output from a simple fragment of a base GPU program.

Hierarchy (view full)

Constructors

Methods

  • Assigns a sprite texture to the shader parameter with the specified name. If the sprite texture contains animation it will be automatically evaluated every frame.

    Parameters

    Returns DynamicTexture

    In order for the sprite sub-image to be properly applied the shader needs to have a 4D vector parameter marked with the SpriteUV attribute referencing this parameter. This vector will then receive the necessary UV offset and size which should be utilized by the shader code to render a subset of the texture as defined in the sprite texture.

  • Assigns an unsigned integer value to the shader parameter with the specified name.

    Optionally if the parameter is an array you may provide an array index to assign the value to.

    Parameters

    • name: string
    • value: number

    Returns DynamicTexture