From 3a9152af37e7879e5ed41cb60c549e6a78df57aa Mon Sep 17 00:00:00 2001
From: Garrett Johnson
+ 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.
+ [example:webgl_buffergeometry_drawrange materials / buffergeometry / drawrange ]
+ [link:https://github.com/mrdoob/three.js/blob/master/src/constants.js src/constants.js]
+
Defines the intended usage pattern of the data store for optimization purposes. Corresponds to the *usage* parameter of
[link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData WebGLRenderingContext.bufferData]().
- Default is *THREE.StaticDrawUsage*.
+ Default is [page:BufferAttributeUsage StaticDrawUsage]. See usage [page:BufferAttributeUsage constants] for all possible values.
Buffer Attribute Usage Constants
+
+ Code Example
+
+
+ const geometry = new THREE.BufferGeometry();
+ const positionAttribute = new THREE.BufferAttribute( array, 3 , false );
+ positionAttribute.setUsage( THREE.DynamicDrawUsage );
+ geometry.setAttribute( 'position', positionAttribute );
+
+
+ Examples
+ Geometry Usage
+
+ THREE.StaticDrawUsage
+ THREE.DynamicDrawUsage
+ THREE.StreamDrawUsage
+
+ THREE.StaticReadUsage
+ THREE.DynamicReadUsage
+ THREE.StreamReadUsage
+
+ THREE.StaticCopyUsage
+ THREE.DynamicCopyUsage
+ THREE.StreamCopyUsage
+
+
+ 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].
+
+ Source
+
+ [property:Integer version]
@@ -179,7 +179,7 @@
Set [page:BufferAttribute.usage usage] to value.
+Set [page:BufferAttribute.usage usage] to value. See usage [page:BufferAttributeUsage constants] for all possible input values.
Sets the x component of the vector at the given index.
diff --git a/docs/api/zh/constants/BufferAttributeUsage.html b/docs/api/zh/constants/BufferAttributeUsage.html new file mode 100644 index 0000000000..0cd24a6e34 --- /dev/null +++ b/docs/api/zh/constants/BufferAttributeUsage.html @@ -0,0 +1,51 @@ + + + + ++ 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. +
+ +
+ const geometry = new THREE.BufferGeometry();
+ const positionAttribute = new THREE.BufferAttribute( array, 3 , false );
+ positionAttribute.setUsage( THREE.DynamicDrawUsage );
+ geometry.setAttribute( 'position', positionAttribute );
+
+
+ [example:webgl_buffergeometry_drawrange materials / buffergeometry / drawrange ]
+ +
+ THREE.StaticDrawUsage
+ THREE.DynamicDrawUsage
+ THREE.StreamDrawUsage
+
+ THREE.StaticReadUsage
+ THREE.DynamicReadUsage
+ THREE.StreamReadUsage
+
+ THREE.StaticCopyUsage
+ THREE.DynamicCopyUsage
+ THREE.StreamCopyUsage
+
+
+ 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].
+
+ + [link:https://github.com/mrdoob/three.js/blob/master/src/constants.js src/constants.js] +
+ + diff --git a/docs/api/zh/core/BufferAttribute.html b/docs/api/zh/core/BufferAttribute.html index 410c915ce5..5ebcea9232 100644 --- a/docs/api/zh/core/BufferAttribute.html +++ b/docs/api/zh/core/BufferAttribute.html @@ -87,7 +87,7 @@Defines the intended usage pattern of the data store for optimization purposes. Corresponds to the *usage* parameter of [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData WebGLRenderingContext.bufferData](). - Default is *THREE.StaticDrawUsage*. + Default is [page:BufferAttributeUsage StaticDrawUsage]. See usage [page:BufferAttributeUsage constants] for all possible values.
Set [page:BufferAttribute.usage usage] to value.
+Set [page:BufferAttribute.usage usage] to value. See usage [page:BufferAttributeUsage constants] for all possible input values.
设置给定索引的矢量的第一维数据(设置 X 值)。
diff --git a/docs/list.json b/docs/list.json index 46e167c03e..1a968f3ba5 100644 --- a/docs/list.json +++ b/docs/list.json @@ -75,6 +75,7 @@ "Animation": "api/en/constants/Animation", "Core": "api/en/constants/Core", "CustomBlendingEquation": "api/en/constants/CustomBlendingEquations", + "BufferAttributeUsage": "api/en/constants/BufferAttributeUsage", "Materials": "api/en/constants/Materials", "Renderer": "api/en/constants/Renderer", "Textures": "api/en/constants/Textures" -- GitLab