Class DynamicTexture

The DynamicTexture class provides the ability to generate a 2D texture as an output from a user-specified RSL program. This class enables you to create dynamic textures such as histograms or dynamic backgrounds, without having to manually create the material, program and rendering boilerplate. The class support creating and providing uniform parameter data through simple APIs.

Hierarchy (view full)

Constructors

Methods

  • Assigns a 3x3 matrix 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

    Returns DynamicTexture

  • Assigns a 4x4 matrix 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

    Returns DynamicTexture

  • 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

  • Gets the final output texture.

    Returns Texture

    Handle to the output texture.

  • Gets an the size of the output texture.

    Returns Vector2

    The dimension of the texture.