Selva Compute API Reference - v1.1.2
    Preparing search index...

    Class IndirectStorageBufferAttribute

    This class stores data for an attribute (such as vertex positions, face indices, normals, colors, UVs, and any custom attributes ) associated with a THREE.BufferGeometry | BufferGeometry, which allows for more efficient passing of data to the GPU

    When working with vector-like data, the .fromBufferAttribute( attribute, index ) helper methods on THREE.Vector2.fromBufferAttribute | Vector2, THREE.Vector3.fromBufferAttribute | Vector3, THREE.Vector4.fromBufferAttribute | Vector4, and THREE.Color.fromBufferAttribute | Color classes may be helpful.

    Hierarchy (View Summary)

    • default
      • IndirectStorageBufferAttribute
    Index

    Constructors

    Properties

    array: TypedArray

    The TypedArray holding data stored in the buffer.

    TypedArray

    count: number

    Represents the number of items this buffer attribute stores. It is internally computed by dividing the array's length by the itemSize. Read-only property.

    Configures the bound GPU type for use in shaders. Either FloatType or IntType, default is FloatType.

    Note: this only has an effect for integer arrays and is not configurable for float arrays. For lower precision float types, see https://threejs.org/docs/#api/en/core/bufferAttributeTypes/BufferAttributeTypes.

    id: number

    Unique number for this attribute instance.

    isBufferAttribute: true

    Read-only flag to check if a given object is of type BufferAttribute.

    This is a constant value

    true

    isIndirectStorageBufferAttribute: true
    isStorageBufferAttribute: true
    itemSize: number

    The length of vectors that are being stored in the array.

    Expects a Integer

    name: string

    Optional name for this attribute instance.

    ''
    
    normalized: boolean

    Indicates how the underlying data in the buffer maps to the values in the GLSL shader code.

    constructor above for details.

    false

    onUploadCallback: () => void

    A callback function that is executed after the Renderer has transferred the attribute array data to the GPU.

    updateRanges: { count: number; start: number }[]

    This can be used to only update some components of stored vectors (for example, just the component related to color). Use the .addUpdateRange function to add ranges to this array.

    Type Declaration

    • count: number

      The number of components to update.

    • start: number

      Position at which to start update.

    usage: Usage

    Defines the intended usage pattern of the data store for optimization purposes. Corresponds to the usage parameter of WebGLRenderingContext.bufferData.

    After the initial use of a buffer, its usage cannot be changed. Instead, instantiate a new one and set the desired usage before the next render.

    THREE.StaticDrawUsage | THREE.StaticDrawUsage.

    version: number

    A version number, incremented every time the needsUpdate property is set to true.

    Expects a Integer

    0

    Accessors

    • set needsUpdate(value: boolean): void

      Flag to indicate that this attribute has changed and should be re-sent to the GPU. Set this to true when you modify the value of the array.

      Parameters

      • value: boolean

      Returns void

      Setting this to true also increments the version.

    Methods

    • Adds a range of data in the data array to be updated on the GPU. Adds an object describing the range to the .updateRanges array.

      Parameters

      • start: number
      • count: number

      Returns void

    • Applies matrix m to every Vector3 element of this BufferAttribute.

      Parameters

      Returns this

    • Applies matrix m to every Vector3 element of this BufferAttribute.

      Parameters

      Returns this

    • Applies normal matrix m to every Vector3 element of this BufferAttribute.

      Parameters

      Returns this

    • Clears the .updateRanges array.

      Returns void

    • Copy the array given here (which can be a normal array or TypedArray) into array.

      Parameters

      Returns this

      TypedArray.set for notes on requirements if copying a TypedArray.

    • Copy a vector from bufferAttribute[index2] to array[index1].

      Parameters

      Returns this

    • Returns the given component of the vector at the given index.

      Parameters

      • index: number
      • component: number

      Returns number

    • Returns the w component of the vector at the given index.

      Parameters

      • index: number

        Expects a Integer

      Returns number

    • Returns the x component of the vector at the given index.

      Parameters

      • index: number

        Expects a Integer

      Returns number

    • Returns the y component of the vector at the given index.

      Parameters

      • index: number

        Expects a Integer

      Returns number

    • Returns the z component of the vector at the given index.

      Parameters

      • index: number

        Expects a Integer

      Returns number

    • Sets the value of the onUploadCallback property.

      Parameters

      • callback: () => void

        function that is executed after the Renderer has transferred the attribute array data to the GPU.

      Returns this

    • Sets the given component of the vector at the given index.

      Parameters

      • index: number
      • component: number
      • value: number

      Returns void

    • Set usage

      Parameters

      Returns this

      After the initial use of a buffer, its usage cannot be changed. Instead, instantiate a new one and set the desired usage before the next render.

    • Sets the w component of the vector at the given index.

      Parameters

      • index: number

        Expects a Integer

      • z: number

      Returns this

    • Sets the x component of the vector at the given index.

      Parameters

      • index: number

        Expects a Integer

      • x: number

      Returns this

    • Sets the x and y components of the vector at the given index.

      Parameters

      • index: number

        Expects a Integer

      • x: number
      • y: number

      Returns this

    • Sets the x, y and z components of the vector at the given index.

      Parameters

      • index: number

        Expects a Integer

      • x: number
      • y: number
      • z: number

      Returns this

    • Sets the x, y, z and w components of the vector at the given index.

      Parameters

      • index: number

        Expects a Integer

      • x: number
      • y: number
      • z: number
      • w: number

      Returns this

    • Sets the y component of the vector at the given index.

      Parameters

      • index: number

        Expects a Integer

      • y: number

      Returns this

    • Sets the z component of the vector at the given index.

      Parameters

      • index: number

        Expects a Integer

      • z: number

      Returns this

    • Applies matrix m to every Vector3 element of this BufferAttribute, interpreting the elements as a direction vectors.

      Parameters

      Returns this