123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- <!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>[name]</h1>
- <p class="desc">
- This buffer attribute class does not construct a VBO. Instead, it uses
- whatever VBO is passed in constructor and can later be altered via the
- *buffer* property.<br /><br />
- It is required to pass additional params alongside the VBO. Those are:
- the GL context, the GL data type, the number of components per vertex,
- the number of bytes per component, and the number of vertices.<br /><br />
- The most common use case for this class is when some kind of GPGPU
- calculation interferes or even produces the VBOs in question.
- </p>
- <h2>Constructor</h2>
- <h3>[name]( [param:WebGLBuffer buffer], [param:GLenum type], [param:Integer itemSize], [param:Integer elementSize], [param:Integer count] )</h3>
- <p>
- *buffer* — Must be a <a href="https://developer.mozilla.org/en-US/docs/Web/API/WebGLBuffer" target="_blank">WebGLBuffer</a>.
- <br />
- *type* — One of <a href="https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants#Data_types" target="_blank">WebGL Data Types</a>.
- <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 />
- *elementSize* — 1, 2 or 4. The corresponding size (in bytes) for the given "type" param.
- <ul>
- <li>gl.FLOAT: 4</li>
- <li>gl.UNSIGNED_SHORT: 2</li>
- <li>gl.SHORT: 2</li>
- <li>gl.UNSIGNED_INT: 4</li>
- <li>gl.INT: 4</li>
- <li>gl.BYTE: 1</li>
- <li>gl.UNSIGNED_BYTE: 1</li>
- </ul>
- *count* — The expected number of vertices in VBO.
- </p>
- <h2>Properties</h2>
- <h3>[property:WebGLBuffer buffer]</h3>
- <p>
- The current <a href="https://developer.mozilla.org/en-US/docs/Web/API/WebGLBuffer" target="_blank">WebGLBuffer</a> instance.
- </p>
- <h3>[property:Integer count]</h3>
- <p>
- The expected number of vertices in VBO.
- </p>
- <h3>[property:Integer itemSize]</h3>
- <p>
- How many values make up each item (vertex).
- </p>
- <h3>[property:Integer elementSize]</h3>
- <p>
- Stores the corresponding size in bytes for the current *type* property value.
- </p>
- <p>
- See above (constructor) for a list of known type sizes.
- </p>
- <h3>[property:GLenum type]</h3>
- <p>
- A <a href="https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants#Data_types" target="_blank">WebGL Data Type</a>
- describing the underlying VBO contents.
- </p>
- <p>
- Set this property together with *elementSize*. The recommended way is
- using the *setType* method.
- </p>
- <h3>[property:Boolean isGLBufferAttribute]</h3>
- <p>
- Read-only. Always *true*.
- </p>
- <h2>Methods</h2>
- <h3>[method:null setBuffer]( buffer ) </h3>
- <p>Sets the *buffer* property.</p>
- <h3>[method:null setType]( type, elementSize ) </h3>
- <p>Sets the both *type* and *elementSize* properties.</p>
- <h3>[method:null setItemSize]( itemSize ) </h3>
- <p>Sets the *itemSize* property.</p>
- <h3>[method:null setCount]( count ) </h3>
- <p>Sets the *count* property.</p>
- <h3>[property:Integer version]</h3>
- <p>
- A version number, incremented every time the needsUpdate property is set to true.
- </p>
- <h3>[property:Boolean needsUpdate]</h3>
- <p>
- Default is *false*. Setting this to true increments [page:GLBufferAttribute.version version].
- </p>
- <h2>Source</h2>
- <p>
- [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
- </p>
- </body>
- </html>
|