You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.4 KiB

2 years ago
<!DOCTYPE html>
<html lang="zh">
<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>