GLBufferAttribute.html 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../" />
  6. <script src="list.js"></script>
  7. <script src="page.js"></script>
  8. <link type="text/css" rel="stylesheet" href="page.css" />
  9. </head>
  10. <body>
  11. <h1>[name]</h1>
  12. <p class="desc">
  13. This buffer attribute class does not construct a VBO. Instead, it uses
  14. whatever VBO is passed in constructor and can later be altered via the
  15. *buffer* property.<br /><br />
  16. It is required to pass additional params alongside the VBO. Those are:
  17. the GL context, the GL data type, the number of components per vertex
  18. and the number of vertices.<br /><br />
  19. The most common use case for this class is when some kind of GPGPU
  20. calculation interferes or even produces the VBOs in question.
  21. </p>
  22. <h2>Constructor</h2>
  23. <h3>[name]( [param:WebGLRenderingContext gl], [param:WebGLBuffer buffer], [param:GLenum type], [param:Integer itemSize], [param:Integer count] )</h3>
  24. <p>
  25. </p>
  26. <h2>Properties</h2>
  27. <h3>[property:WebGLBuffer buffer]</h3>
  28. <p>
  29. The current <a href="https://developer.mozilla.org/en-US/docs/Web/API/WebGLBuffer" target="_blank">WebGLBuffer</a> instance.
  30. </p>
  31. <h3>[property:Integer count]</h3>
  32. <p>
  33. The expected number of vertices in VBO.
  34. </p>
  35. <h3>[property:Integer itemSize]</h3>
  36. <p>
  37. How many values make up each item (vertex).
  38. </p>
  39. <h3>[property:Integer elementSize]</h3>
  40. <p>
  41. Stores the corresponding size in bytes for the current *type* property value.
  42. </p>
  43. <p>
  44. <b>Don't touch</b>.
  45. </p>
  46. <h3>[property:GLenum type]</h3>
  47. <p>
  48. A <a href="https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants#Standard_WebGL_1_constants" target="_blank">WebGL Data Type</a> describing the underlying VBO contents.
  49. </p>
  50. <p>
  51. Setting this is only allowed with *setType*.
  52. </p>
  53. <h3>[property:Boolean isGLBufferAttribute]</h3>
  54. <p>
  55. Should be *true*.
  56. </p>
  57. <h2>Methods</h2>
  58. <h3>[method:null setBuffer]( buffer ) </h3>
  59. <p>Sets the *buffer* property.</p>
  60. <h3>[method:null setType]( type ) </h3>
  61. <p>Sets the *type* property.</p>
  62. <h3>[method:null setItemSize]( itemSize ) </h3>
  63. <p>Sets the *itemSize* property.</p>
  64. <h3>[method:null setCount]( count ) </h3>
  65. <p>Sets the *count* property.</p>
  66. <h2>Source</h2>
  67. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  68. </body>
  69. </html>