UNPKG

@three.ez/instanced-mesh

Version:

Enhanced InstancedMesh with frustum culling, fast raycasting (using BVH), sorting, visibility management and more.

39 lines 1.86 kB
import { GLBufferAttribute, TypedArray, WebGLRenderer } from 'three'; /** * A class that extends `GLBufferAttribute` to handle instanced buffer attributes. * This class was specifically created to allow updating instanced buffer attributes during the `onBeforeRender` callback, * providing an efficient way to modify the buffer data dynamically before rendering. */ export declare class GLInstancedBufferAttribute extends GLBufferAttribute { /** * Indicates if this is an `isGLInstancedBufferAttribute`. */ isGLInstancedBufferAttribute: boolean; /** * The number of meshes that share the same attribute data. */ meshPerAttribute: number; /** * The data array that holds the attribute values. */ array: TypedArray; protected _cacheArray: TypedArray; /** * @param gl The WebGL2RenderingContext used to create the buffer. * @param type The type of data in the attribute. * @param itemSize The number of elements per attribute. * @param elementSize The size of individual elements in the array. * @param array The data array that holds the attribute values. * @param meshPerAttribute The number of meshes that share the same attribute data. */ constructor(gl: WebGL2RenderingContext, type: GLenum, itemSize: number, elementSize: 1 | 2 | 4, array: TypedArray, meshPerAttribute?: number); /** * Updates the buffer data. * This method is designed to be called during the `onBeforeRender` callback. * It ensures that the attribute data is updated just before the rendering process begins. * @param renderer The WebGLRenderer used to render the scene. * @param count The number of elements to update in the buffer. */ update(renderer: WebGLRenderer, count: number): void; } //# sourceMappingURL=GLInstancedBufferAttribute.d.ts.map