GLBufferAttribute.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <!DOCTYPE html>
  2. <html lang="ko">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. <h1>[name]</h1>
  11. <p class="desc">
  12. 이 버퍼 속성 클래스는 VBO를 생성하지 않습니다. 대신, VBO가 생성자로 전달되고 난 후의 모든 것을 사용하며 후에 *buffer* 속성으로 변경될 수 있습니다.<br /><br />
  13. VBO와 나란히 추가적인 파라미터 전달이 필요합니다. 해당 파라미터는 다음과 같습니다:
  14. GL 구조체, GL 데이터 타입, 꼭짓점 당 컴포넌트 갯수,
  15. 컴포넌트 당 바이트 수, 꼭짓점의 수.<br /><br />
  16. 이 클래스의 가장 일반적인 사용 사례는 어떤 종류의 GPGPU 계산이 해당 VBO를 방해하거나 심지어 생성하는 경우입니다.
  17. </p>
  18. <h2>Examples</h2>
  19. <p>
  20. [example:webgl_buffergeometry_glbufferattribute Points with custom buffers]<br />
  21. </p>
  22. <h2>생성자</h2>
  23. <h3>[name]( [param:WebGLBuffer buffer], [param:GLenum type], [param:Integer itemSize], [param:Integer elementSize], [param:Integer count], [param:Boolean normalized] )</h3>
  24. <p>
  25. *buffer* — 반드시 [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLBuffer WebGLBuffer]여야 합니다.
  26. <br />
  27. *type* — [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants#Data_types WebGL] 데이터 타입 중 하나.
  28. <br />
  29. *itemSize* — 특정 꼭짓점가 연관되어야 하는 배열의 값의 수. 예를 들어 이 속성이 3-컴포넌트 벡터(예: 위치, 법선 또는 색상)를 저장하는 경우 (
  30. itemSize는 3이어야 합니다.
  31. <br />
  32. *elementSize* — 1, 2 혹은 4. 할당된 "type" 파라미터에 상응하는 사이즈(바이트).
  33. <ul>
  34. <li>gl.FLOAT: 4</li>
  35. <li>gl.UNSIGNED_SHORT: 2</li>
  36. <li>gl.SHORT: 2</li>
  37. <li>gl.UNSIGNED_INT: 4</li>
  38. <li>gl.INT: 4</li>
  39. <li>gl.BYTE: 1</li>
  40. <li>gl.UNSIGNED_BYTE: 1</li>
  41. </ul>
  42. *count* — 예상되는 VBO의 꼭짓점 수.
  43. <br />
  44. *normalized* — (optional) Applies to integer data only.
  45. Indicates how the underlying data in the buffer maps to the values in the
  46. GLSL code. For instance, if [page:WebGLBuffer buffer] contains data of
  47. `gl.UNSIGNED_SHORT`, and [page:Boolean normalized] is true, the values `0 -
  48. +65535` in the buffer data will be mapped to 0.0f - +1.0f in the GLSL
  49. attribute. A `gl.SHORT` (signed) would map from -32768 - +32767 to -1.0f
  50. - +1.0f. If [page:Boolean normalized] is false, the values will be
  51. converted to floats unmodified, i.e. 32767 becomes 32767.0f.
  52. </p>
  53. <h2>프로퍼티</h2>
  54. <h3>[property:WebGLBuffer buffer]</h3>
  55. <p>
  56. 현재의 [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLBuffer WebGLBuffer] 인스턴스.
  57. </p>
  58. <h3>[property:Integer count]</h3>
  59. <p>
  60. VBO의 꼭짓점 수.
  61. </p>
  62. <h3>[property:Integer elementSize]</h3>
  63. <p>
  64. 현재의 *type* 속성 값에 맞는 바이트 사이즈를 저장.
  65. </p>
  66. <p>
  67. 알려진 타입 크기 리스트는 위의 (생성자)를 참고.
  68. </p>
  69. <h3>[property:Boolean isGLBufferAttribute]</h3>
  70. <p>
  71. 읽기 전용. 언제나 *true*입니다.
  72. </p>
  73. <h3>[property:Integer itemSize]</h3>
  74. <p>
  75. 각 항목을 구성하는 값의 크기 (꼭짓점).
  76. </p>
  77. <h3>[property:String name]</h3>
  78. <p>
  79. 이 속성 인스턴스의 임시 이름. 기본값은 빈 문자열입니다.
  80. </p>
  81. <h3>[property:Boolean needsUpdate]</h3>
  82. <p>
  83. 기본값은 *false* 입니다. true로 설정하면 [page:GLBufferAttribute.version version]을 증가시킵니다.
  84. </p>
  85. <h3>[property:Boolean normalized]</h3>
  86. <p>
  87. Indicates how the underlying data in the buffer maps to the values in the
  88. GLSL shader code. See the constructor above for details.
  89. </p>
  90. <h3>[property:GLenum type]</h3>
  91. <p>
  92. 기저의 VBO 컨텐츠를 묘사하는 [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants#Data_types WebGL Data Type]
  93. .
  94. </p>
  95. <p>
  96. *elementSize*와 함께 이 속성을 설정합니다. 추천하는 방법은 *setType* 메서드를 사용하는 것입니다.
  97. </p>
  98. <h3>[property:Integer version]</h3>
  99. <p>
  100. 버전 넘버이며 needsUpdate 속성이 true가 될 때마다 증가합니다.
  101. </p>
  102. <h2>메서드</h2>
  103. <h3>[method:this setBuffer]( buffer ) </h3>
  104. <p>*buffer* 속성을 설정합니다.</p>
  105. <h3>[method:this setType]( type, elementSize ) </h3>
  106. <p>*type* 및 *elementSize* 속성을 설정합니다.</p>
  107. <h3>[method:this setItemSize]( itemSize ) </h3>
  108. <p>*itemSize* 속성을 설정합니다.</p>
  109. <h3>[method:this setCount]( count ) </h3>
  110. <p>*count* 속성을 설정합니다.</p>
  111. <h2>소스코드</h2>
  112. <p>
  113. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  114. </p>
  115. </body>
  116. </html>
粤ICP备19079148号