-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathh3du-meshbuffer.js
33 lines (30 loc) · 1.71 KB
/
h3du-meshbuffer.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
Any copyright to this file is released to the Public Domain.
In case this is not possible, this file is also licensed under the Unlicense: https://unlicense.org/
*/
/* global Float32Array, Uint16Array, Uint32Array */
/**
* <p><b>Instancing</b>
* <p>Some 3D rendering pipelines support <i>instancing</i>, which is a technique for rendering multiple versions of a mesh buffer with a single draw call. Instancing involves the use of a second mesh buffer (an <i>instance buffer</i>); rather than holding vertex data, the instance buffer holds <i>instance data</i>, that is, data to be used when rendering each instance of the first mesh buffer. Besides this, however, instance buffers are largely similar to vertex buffers as far as the <code>MeshBuffer</code> class is concerned; any reference to vertices in the documentation applies analogously to instances in instance buffers. However, instance buffers should have only one vertex per primitive; it makes little sense to have instance buffers describe triangles or line segments.
* @constructor
* @deprecated It is planned to render this class obsolete and rely on three.js's BufferGeometry.
*/
export const MeshBuffer = function() {};
/** Indicates that a mesh buffer contains line segments; the mesh
* buffer stores each line segment using two consecutive vertices.
* @constant
* @default
* @static */
MeshBuffer.LINES = 1;
/** Indicates that a mesh buffer contains triangles; the mesh
* buffer stores each triangle using three consecutive vertices.
* @constant
* @default
* @static */
MeshBuffer.TRIANGLES = 4;
/** Indicates that a mesh buffer contains points; the mesh
* buffer stores each point using one vertex.
* @constant
* @default
* @static */
MeshBuffer.POINTS = 0;