forked from serjIII/threejsSDK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BufferAttributeUsage.html
54 lines (44 loc) · 1.38 KB
/
BufferAttributeUsage.html
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../../" />
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>Buffer Attribute Usage Constants</h1>
<p>
The usage constants can be used to provide a hint to the API regarding how
the geometry buffer attribute will be used in order to optimize
performance.
</p>
<h2>Code Example</h2>
<code>
const geometry = new THREE.BufferGeometry();
const positionAttribute = new THREE.BufferAttribute( array, 3 , false );
positionAttribute.setUsage( THREE.DynamicDrawUsage );
geometry.setAttribute( 'position', positionAttribute );
</code>
<h2>Examples</h2>
<p>[example:webgl_buffergeometry_drawrange materials / buffergeometry / drawrange ]</p>
<h2>Geometry Usage</h2>
<code>
THREE.StaticDrawUsage
THREE.DynamicDrawUsage
THREE.StreamDrawUsage
THREE.StaticReadUsage
THREE.DynamicReadUsage
THREE.StreamReadUsage
THREE.StaticCopyUsage
THREE.DynamicCopyUsage
THREE.StreamCopyUsage
</code>
For more detailed information on each of these constants see
[link:https://www.khronos.org/opengl/wiki/Buffer_Object#Buffer_Object_Usage this OpenGL documentation].
<h2>Source</h2>
<p>
[link:https://github.com/mrdoob/three.js/blob/master/src/constants.js src/constants.js]
</p>
</body>
</html>