Class Source

Represents the data Source of a texture.

Constructors

Properties

Accessors

Methods

Constructors

  • Create a new instance of Source

    Parameters

    • data: any

      The data definition of a texture. Default null

    Returns Source

Properties

isSource: true

Flag to check if a given object is of type Source.

This is a constant value

true

id: number
data: any

The actual data of a texture.

The type of this property depends on the texture that uses this instance.

dataReady: boolean

This property is only relevant when .needsUpdate is set to true and provides more control on how
texture data should be processed.
When dataReady is set to false, the engine performs the memory allocation (if necessary) but does not
transfer the data into the GPU memory.

true
uuid: string

UUID of this object instance.

This gets automatically assigned and shouldn't be edited.

version: number

This starts at 0 and counts how many times .needsUpdate is set to true.

Expects a Integer

0

Accessors

  • set needsUpdate(value): void
  • When the property is set to true, the engine allocates the memory for the texture (if necessary) and triggers
    the actual texture upload to the GPU next time the source is used.

    Parameters

    • value: boolean

    Returns void

Methods

  • Convert the data Source to three.js JSON Object/Scene format.

    Parameters

    • Optionalmeta: string | {}

      Optional object containing metadata.

    Returns {}