|
@@ -23,8 +23,27 @@
|
|
</p>
|
|
</p>
|
|
|
|
|
|
<h2>Constructor</h2>
|
|
<h2>Constructor</h2>
|
|
- <h3>[name]( [param:WebGLRenderingContext gl], [param:WebGLBuffer buffer], [param:GLenum type], [param:Integer itemSize], [param:Integer count] )</h3>
|
|
|
|
|
|
+ <h3>[name]( [param:WebGLRenderingContext gl], [param:WebGLBuffer buffer], [param:GLenum type], [param:Integer itemSize], [param:Integer count], [param:Boolean normalized] )</h3>
|
|
<p>
|
|
<p>
|
|
|
|
+ gl — Must be a [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext].
|
|
|
|
+ <br />
|
|
|
|
+ buffer — Must be a [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLBuffer].
|
|
|
|
+ <br />
|
|
|
|
+ type — One of [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants#Data_types].
|
|
|
|
+ <br />
|
|
|
|
+ itemSize — The number of values of the array that should be associated with
|
|
|
|
+ a particular vertex. For instance, if this
|
|
|
|
+ attribute is storing a 3-component vector (such as a position, normal, or color), then itemSize should be 3.
|
|
|
|
+ <br />
|
|
|
|
+ count — The expected number of vertices in VBO.
|
|
|
|
+ <br /><br />
|
|
|
|
+
|
|
|
|
+ normalized — (optional) Applies to integer data only. Indicates how the underlying data
|
|
|
|
+ in the buffer maps to the values in the GLSL code. For instance, if [page:TypedArray array] is an instance
|
|
|
|
+ of UInt16Array, and [page:Boolean normalized] is true, the values 0 - +65535 in the array
|
|
|
|
+ data will be mapped to 0.0f - +1.0f in the GLSL attribute. An Int16Array (signed) would map
|
|
|
|
+ from -32767 - +32767 to -1.0f - +1.0f. If [page:Boolean normalized] is false, the values
|
|
|
|
+ will be converted to floats unmodified, i.e. 32767 becomes 32767.0f.
|
|
</p>
|
|
</p>
|
|
|
|
|
|
<h2>Properties</h2>
|
|
<h2>Properties</h2>
|
|
@@ -39,6 +58,12 @@
|
|
The expected number of vertices in VBO.
|
|
The expected number of vertices in VBO.
|
|
</p>
|
|
</p>
|
|
|
|
|
|
|
|
+ <h3>[property:Boolean normalized]</h3>
|
|
|
|
+ <p>
|
|
|
|
+ Indicates how the underlying data in the buffer maps to the values in the GLSL shader code.
|
|
|
|
+ See the constructor above for details.
|
|
|
|
+ </p>
|
|
|
|
+
|
|
<h3>[property:Integer itemSize]</h3>
|
|
<h3>[property:Integer itemSize]</h3>
|
|
<p>
|
|
<p>
|
|
How many values make up each item (vertex).
|
|
How many values make up each item (vertex).
|