/extra/gpu/framebuffers/framebuffers-docs.factor

http://github.com/abeaumont/factor · Factor · 324 lines · 269 code · 54 blank · 1 comment · 0 complexity · f003073384ba1265fc7c36e784b0ab77 MD5 · raw file

  1. ! (c)2009 Joe Groff bsd license
  2. USING: alien byte-arrays gpu.buffers gpu.textures help.markup
  3. help.syntax images kernel math math.rectangles sequences ;
  4. IN: gpu.framebuffers
  5. HELP: <color-attachment>
  6. { $values
  7. { "index" integer }
  8. { "color-attachment" color-attachment }
  9. }
  10. { $description "Constructs an " { $link attachment-ref } " referencing the " { $snippet "index" } "th " { $snippet "color-attachment" } " of a framebuffer." }
  11. { $notes "User-created framebuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions." } ;
  12. HELP: <framebuffer-rect>
  13. { $values
  14. { "framebuffer" any-framebuffer } { "attachment" attachment-ref } { "rect" rect }
  15. { "framebuffer-rect" framebuffer-rect }
  16. }
  17. { $description "Constructs a " { $link framebuffer-rect } " tuple that references a rectangular region of " { $snippet "attachment" } " in " { $snippet "framebuffer" } "." }
  18. { $notes "User-created framebuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions." } ;
  19. { framebuffer-rect <framebuffer-rect> <full-framebuffer-rect> } related-words
  20. HELP: <framebuffer>
  21. { $values
  22. { "color-attachments" sequence } { "depth-attachment" framebuffer-attachment } { "stencil-attachment" framebuffer-attachment } { "dim" { $maybe sequence } }
  23. { "framebuffer" framebuffer }
  24. }
  25. { $description "Creates a new " { $link framebuffer } " object comprising the given set of " { $snippet "color-attachments" } ", " { $snippet "depth-attachment" } ", and " { $snippet "stencil-attachment" } ". If " { $snippet "dim" } " is not null, all of the attachments will be resized using " { $link resize-framebuffer } "; otherwise, each texture or renderbuffer being attached must have image memory allocated for the framebuffer creation to succeed." }
  26. { $notes "User-created framebuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions. If only the " { $snippet "GL_EXT_framebuffer_object" } " is available, all framebuffer attachments must have the same size, and all color attachments must have the same " { $link component-order } " and " { $link component-type } "." } ;
  27. HELP: <full-framebuffer-rect>
  28. { $values
  29. { "framebuffer" any-framebuffer } { "attachment" attachment-ref }
  30. { "framebuffer-rect" framebuffer-rect }
  31. }
  32. { $description "Constructs a " { $link framebuffer-rect } " tuple that spans the entire size of " { $snippet "attachment" } " in " { $snippet "framebuffer" } "." }
  33. { $notes "User-created framebuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions." } ;
  34. HELP: <renderbuffer>
  35. { $values
  36. { "component-order" component-order } { "component-type" component-type } { "samples" { $maybe integer } } { "dim" { $maybe sequence } }
  37. { "renderbuffer" renderbuffer }
  38. }
  39. { $description "Creates a new " { $link renderbuffer } " object. If " { $snippet "samples" } " is not " { $link f } ", it specifies the multisampling level to use. If " { $snippet "dim" } " is not " { $link f } ", image memory of the given dimensions will be allocated for the renderbuffer; otherwise, memory will have to be allocated separately with " { $link allocate-renderbuffer } "." }
  40. { $notes "Renderbuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions. Multisampled renderbuffers require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_multisample" } " extensions." } ;
  41. HELP: <system-attachment>
  42. { $values
  43. { "side" { $maybe framebuffer-attachment-side } } { "face" { $maybe framebuffer-attachment-face } }
  44. { "system-attachment" system-attachment }
  45. }
  46. { $description "Constructs an " { $link attachment-ref } " referencing a " { $link system-framebuffer } " color attachment." } ;
  47. HELP: <texture-1d-attachment>
  48. { $values
  49. { "texture" texture-data-target } { "level" integer }
  50. { "texture-1d-attachment" texture-1d-attachment }
  51. }
  52. { $description "Constructs a " { $link framebuffer-attachment } " to the " { $snippet "level" } "th level of detail of one-dimensional texture " { $snippet "texture" } "." }
  53. { $notes "User-created framebuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions." } ;
  54. HELP: <texture-2d-attachment>
  55. { $values
  56. { "texture" texture-data-target } { "level" integer }
  57. { "texture-2d-attachment" texture-2d-attachment }
  58. }
  59. { $description "Constructs a " { $link framebuffer-attachment } " to the " { $snippet "level" } "th level of detail of two-dimensional texture " { $snippet "texture" } "." }
  60. { $notes "User-created framebuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions." } ;
  61. HELP: <texture-3d-attachment>
  62. { $values
  63. { "texture" texture-data-target } { "z-offset" integer } { "level" integer }
  64. { "texture-3d-attachment" texture-3d-attachment }
  65. }
  66. { $description "Constructs a " { $link framebuffer-attachment } " to the " { $snippet "z-offset" } "th plane of the " { $snippet "level" } "th level of detail of three-dimensional texture " { $snippet "texture" } "." }
  67. { $notes "User-created framebuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions." } ;
  68. HELP: <texture-layer-attachment>
  69. { $values
  70. { "texture" texture-data-target } { "layer" integer } { "level" integer }
  71. { "texture-layer-attachment" texture-layer-attachment }
  72. }
  73. { $description "Constructs a " { $link framebuffer-attachment } " to the " { $snippet "layer" } "th layer of the " { $snippet "level" } "th level of detail of three-dimensional texture or array texture " { $snippet "texture" } "." }
  74. { $notes "User-created framebuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions. Array textures require OpenGL 3.0 or the " { $snippet "GL_EXT_texture_array" } " extension." } ;
  75. HELP: allocate-renderbuffer
  76. { $values
  77. { "renderbuffer" renderbuffer } { "dim" sequence }
  78. }
  79. { $description "Allocates image memory for " { $snippet "renderbuffer" } " with dimension " { $snippet "dim" } "." }
  80. { $notes "Renderbuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions." } ;
  81. HELP: any-framebuffer
  82. { $class-description "This class is a union of the " { $link framebuffer } " class, which represents user-created framebuffer objects, and the " { $link system-framebuffer } ". Words which accept " { $snippet "any-framebuffer" } " can operate on either the system framebuffer or user framebuffers." }
  83. { $notes "User-created framebuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions." } ;
  84. HELP: attachment-ref
  85. { $class-description "An " { $snippet "attachment-ref" } " value references a particular color, depth, or stencil attachment to a " { $link framebuffer } " object."
  86. { $list
  87. { { $link system-attachment } " references one or more of the color attachments to the " { $link system-framebuffer } "." }
  88. { { $link color-attachment } " references one of the indexed color attachments to a user-created " { $link framebuffer } "." }
  89. { { $link default-attachment } " references the back buffer of the " { $snippet "system-framebuffer" } " or the first color attachment of a user " { $snippet "framebuffer" } "." }
  90. { { $link depth-attachment } " references the depth buffer attachment to any framebuffer." }
  91. { { $link stencil-attachment } " references the stencil buffer attachment to any framebuffer." }
  92. } }
  93. { $notes "User-created framebuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions." } ;
  94. HELP: back-face
  95. { $class-description "Use this value in the " { $snippet "face" } " slot of a " { $link system-attachment } " reference to select the back face of a double-buffered " { $link system-framebuffer } "." } ;
  96. HELP: clear-framebuffer
  97. { $values
  98. { "framebuffer" any-framebuffer } { "alist" "a list of " { $link attachment-ref } "/value pairs" }
  99. }
  100. { $description "Clears the active viewport area of the specified attachments to " { $snippet "framebuffer" } " to the associated values." }
  101. { $notes "User-created framebuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions." } ;
  102. HELP: clear-framebuffer-attachment
  103. { $values
  104. { "framebuffer" any-framebuffer } { "attachment-ref" attachment-ref } { "value" object }
  105. }
  106. { $description "Clears the active viewport area of the given attachment to " { $snippet "framebuffer" } " to " { $snippet "value" } "." }
  107. { $notes "User-created framebuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions." } ;
  108. { clear-framebuffer clear-framebuffer-attachment } related-words
  109. HELP: color-attachment
  110. { $class-description "This " { $link attachment-ref } " type references a color attachment to a user-created " { $link framebuffer } " object. The " { $snippet "index" } " slot of the tuple indicates the color attachment referenced. Color attachments to the " { $link system-framebuffer } " are referenced by the " { $link system-attachment } " type." }
  111. { $notes "User-created framebuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions." } ;
  112. {
  113. color-attachment system-attachment default-attachment depth-attachment stencil-attachment
  114. attachment-ref color-attachment-ref
  115. } related-words
  116. HELP: color-attachment-ref
  117. { $class-description "A " { $snippet "color-attachment-ref" } " value references a particular color attachment to a " { $link framebuffer } " object."
  118. { $list
  119. { { $link system-attachment } " references one or more of the color attachments to the " { $link system-framebuffer } "." }
  120. { { $link color-attachment } " references one of the indexed color attachments to a user-created " { $link framebuffer } "." }
  121. { { $link default-attachment } " references the back buffer of the " { $snippet "system-framebuffer" } " or the first color attachment of a user " { $snippet "framebuffer" } "." }
  122. } }
  123. { $notes "User-created framebuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions." } ;
  124. HELP: copy-framebuffer
  125. { $values
  126. { "to-fb-rect" framebuffer-rect } { "from-fb-rect" framebuffer-rect } { "depth?" boolean } { "stencil?" boolean } { "filter" texture-filter }
  127. }
  128. { $description "Copies the rectangular region " { $snippet "from-fb-rect" } " to " { $snippet "to-fb-rect" } ". If " { $snippet "depth?" } " is true, depth values are also copied, and if " { $snippet "stencil?" } " is true, so are stencil values. If the rectangle sizes do not match, the region is scaled using nearest-neighbor or linear filtering based on " { $snippet "filter" } "." }
  129. { $notes "This word requires OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_blit" } " extensions." } ;
  130. HELP: default-attachment
  131. { $class-description "This " { $link attachment-ref } " references the back buffer of the " { $link system-framebuffer } " or the first color attachment of a user-created " { $link framebuffer } "." }
  132. { $notes "User-created framebuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions." } ;
  133. HELP: depth-attachment
  134. { $class-description "This " { $link attachment-ref } " references the depth buffer attachment of a user-created " { $link framebuffer } " or the " { $link system-framebuffer } "." }
  135. { $notes "User-created framebuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions." } ;
  136. HELP: framebuffer
  137. { $class-description "Objects of this class represent user-created framebuffer objects. These framebuffer objects provide an offscreen target for rendering operations and can send rendering output either to textures or to dedicated " { $link renderbuffer } "s. A framebuffer consists of a set of one or more color " { $link framebuffer-attachment } "s, an optional depth buffer " { $snippet "framebuffer-attachment" } ", and an optional stencil buffer " { $snippet "framebuffer-attachment" } "." }
  138. { $notes "User-created framebuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions." } ;
  139. HELP: framebuffer-attachment
  140. { $class-description "This class is a union of the " { $link renderbuffer } " and " { $link texture-attachment } " classes, either of which can function as an attachment to a user-created " { $link framebuffer } " object." }
  141. { $notes "User-created framebuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions." } ;
  142. HELP: framebuffer-attachment-at
  143. { $values
  144. { "framebuffer" framebuffer } { "attachment-ref" attachment-ref }
  145. { "attachment" framebuffer-attachment }
  146. }
  147. { $description "Returns the " { $link texture-attachment } " or " { $link renderbuffer } " referenced by " { $snippet "attachment-ref" } " in " { $snippet "framebuffer" } "." }
  148. { $notes "User-created framebuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions." } ;
  149. HELP: framebuffer-attachment-face
  150. { $class-description "The values " { $link front-face } " and " { $link back-face } " select a face of a double-buffered " { $link system-framebuffer } " when stored in the " { $snippet "face" } " slot of a " { $link system-attachment } " reference." } ;
  151. HELP: framebuffer-attachment-side
  152. { $class-description "The values " { $link left-side } " and " { $link right-side } " select a face of a stereoscopic " { $link system-framebuffer } " when stored in the " { $snippet "side" } " slot of a " { $link system-attachment } " reference." } ;
  153. HELP: framebuffer-rect
  154. { $class-description "This tuple class references a rectangular subregion of a color attachment of a " { $link framebuffer } " object."
  155. { $list
  156. { { $snippet "framebuffer" } " references either a user-created " { $link framebuffer } " or the " { $link system-framebuffer } "." }
  157. { { $snippet "attachment" } " is a " { $link color-attachment-ref } " referencing the color attachment of interest in the framebuffer." }
  158. { { $snippet "rect" } " is a " { $link rect } " referencing the rectangular region of interest of the attachment." }
  159. } }
  160. { $notes "User-created framebuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions." } ;
  161. HELP: front-face
  162. { $class-description "Use this value in the " { $snippet "face" } " slot of a " { $link system-attachment } " reference to select the front face of a double-buffered " { $link system-framebuffer } "." } ;
  163. { front-face back-face } related-words
  164. HELP: left-side
  165. { $class-description "Use this value in the " { $snippet "side" } " slot of a " { $link system-attachment } " reference to select the left side of a stereoscopic " { $link system-framebuffer } "." } ;
  166. { left-side right-side } related-words
  167. HELP: read-framebuffer
  168. { $values
  169. { "framebuffer-rect" framebuffer-rect }
  170. { "byte-array" byte-array }
  171. }
  172. { $description "Reads the rectangular region " { $snippet "framebuffer-rect" } " into a new " { $snippet "byte-array" } ". The format of the byte array is determined by the " { $link component-order } " and " { $link component-type } " of the associated " { $link framebuffer-attachment } "." }
  173. { $notes "User-created framebuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions." } ;
  174. HELP: read-framebuffer-image
  175. { $values
  176. { "framebuffer-rect" framebuffer-rect }
  177. { "image" image }
  178. }
  179. { $description "Reads the rectangular region " { $snippet "framebuffer-rect" } " into a new " { $snippet "image" } ". The format of the image is determined by the " { $link component-order } " and " { $link component-type } " of the associated " { $link framebuffer-attachment } "." }
  180. { $notes "User-created framebuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions." } ;
  181. HELP: read-framebuffer-to
  182. { $values
  183. { "framebuffer-rect" framebuffer-rect } { "gpu-data-ptr" gpu-data-ptr }
  184. }
  185. { $description "Reads the rectangular region " { $snippet "framebuffer-rect" } " into " { $snippet "gpu-data-ptr" } ", which can reference either CPU memory (a " { $link byte-array } " or " { $link alien } ") or a GPU " { $link buffer-ptr } ". The format of the written data is determined by the " { $link component-order } " and " { $link component-type } " of the associated " { $link framebuffer-attachment } "." }
  186. { $notes "User-created framebuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions. Reading into a " { $snippet "buffer-ptr" } " requires OpenGL 2.1 or the " { $snippet "GL_ARB_pixel_buffer_object" } " extension." } ;
  187. { read-framebuffer read-framebuffer-image read-framebuffer-to } related-words
  188. HELP: renderbuffer
  189. { $class-description "Objects of this type represent renderbuffer objects, two-dimensional image buffers that can serve as " { $link framebuffer-attachment } "s to user-created " { $link framebuffer } " objects." }
  190. { $notes "Renderbuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions." } ;
  191. { renderbuffer renderbuffer-dim allocate-renderbuffer <renderbuffer> } related-words
  192. { framebuffer <framebuffer> resize-framebuffer } related-words
  193. HELP: renderbuffer-dim
  194. { $values
  195. { "renderbuffer" renderbuffer }
  196. { "dim" sequence }
  197. }
  198. { $description "Returns the dimensions of the allocated image memory for " { $snippet "renderbuffer" } "." }
  199. { $notes "Renderbuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions." } ;
  200. HELP: resize-framebuffer
  201. { $values
  202. { "framebuffer" framebuffer } { "dim" sequence }
  203. }
  204. { $description "Reallocates the image memory for all of the textures and renderbuffers bound to " { $snippet "framebuffer" } " to be of the given dimensions." }
  205. { $notes "User-created framebuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions." } ;
  206. HELP: right-side
  207. { $class-description "Use this value in the " { $snippet "side" } " slot of a " { $link system-attachment } " reference to select the right side of a stereoscopic " { $link system-framebuffer } "." } ;
  208. HELP: stencil-attachment
  209. { $class-description "This " { $link attachment-ref } " references the stencil buffer attachment of a user-created " { $link framebuffer } " or the " { $link system-framebuffer } "." }
  210. { $notes "User-created framebuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions." } ;
  211. HELP: system-attachment
  212. { $class-description "This " { $link attachment-ref } " references one or more of the color attachments to the " { $link system-framebuffer } ". Depending on the window system pixel format for the window, up to four attachments may be available:"
  213. { $list
  214. { "If double buffering is available, there is a " { $link back-face } ", which holds the screen image as it is drawn, and a " { $link front-face } ", which holds the current contents of the screen. The two buffers get swapped when a scene is completely drawn." }
  215. { "If stereoscopic rendering is available, there is a " { $link left-side } " and " { $link right-side } ", representing the left and right eye viewpoints of a 3D viewing apparatus." }
  216. }
  217. "To select a subset of these attachments, the " { $snippet "system-attachment" } " tuple type has two slots:"
  218. { $list
  219. { { $snippet "side" } " selects either the " { $snippet "left-side" } " or " { $snippet "right-side" } ", or both if set to " { $link f } "." }
  220. { { $snippet "face" } " selects either the " { $snippet "back-face" } " or " { $snippet "front-face" } ", or both if set to " { $link f } "." }
  221. }
  222. "If stereo or double buffering are not available, then both sides or faces respectively will be equivalent. All attachments can be selected by setting both slots to " { $link f } ", both attachments of a side or face can be selected by setting a single slot, and a single attachment can be targeted by setting both slots." } ;
  223. HELP: system-framebuffer
  224. { $class-description "This symbol represents the framebuffer supplied by the window system to store the contents of the window on screen. Since this framebuffer is managed by the window system, it cannot have its attachments modified or resized; however, it is still a valid target for rendering, copying via " { $link copy-framebuffer } ", clearing via " { $link clear-framebuffer } ", and reading via " { $link read-framebuffer } "." } ;
  225. HELP: texture-1d-attachment
  226. { $class-description "This class references a single level of detail of a one-dimensional texture for use as a " { $link framebuffer-attachment } "." }
  227. { $notes "User-created framebuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions." } ;
  228. HELP: texture-2d-attachment
  229. { $class-description "This class references a single level of detail of a two-dimensional texture for use as a " { $link framebuffer-attachment } "." }
  230. { $notes "User-created framebuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions." } ;
  231. HELP: texture-3d-attachment
  232. { $class-description "This class references a single plane and level of detail of a three-dimensional texture for use as a " { $link framebuffer-attachment } "." }
  233. { $notes "User-created framebuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions." } ;
  234. HELP: texture-attachment
  235. { $class-description "This class is a union of the " { $link texture-1d-attachment } ", " { $link texture-2d-attachment } ", " { $link texture-3d-attachment } ", and " { $link texture-layer-attachment } " classes, which select layers and levels of detail of " { $link texture } " objects to serve as " { $link framebuffer } " attachments." }
  236. { $notes "User-created framebuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions." } ;
  237. HELP: texture-layer-attachment
  238. { $class-description "This class references a single layer and level of detail of a three-dimensional texture or array texture for use as a " { $link framebuffer-attachment } "." }
  239. { $notes "User-created framebuffer objects require OpenGL 3.0 or one of the " { $snippet "GL_ARB_framebuffer_object" } " or " { $snippet "GL_EXT_framebuffer_object" } " extensions. Array textures require OpenGL 3.0 or the " { $snippet "GL_EXT_texture_array" } " extension." } ;
  240. { texture-1d-attachment <texture-1d-attachment> } related-words
  241. { texture-2d-attachment <texture-2d-attachment> } related-words
  242. { texture-3d-attachment <texture-3d-attachment> } related-words
  243. { texture-layer-attachment <texture-layer-attachment> } related-words
  244. ARTICLE: "gpu.framebuffers" "Framebuffer objects"
  245. "The " { $vocab-link "gpu.framebuffers" } " vocabulary provides words for creating, allocating, and reading from framebuffer objects. Framebuffer objects are used as rendering targets; the " { $link system-framebuffer } " is supplied by the window system and contains the contents of the window on screen. User-created " { $link framebuffer } " objects can also be created to direct rendering output to offscreen " { $link texture } "s or " { $link renderbuffer } "s."
  246. { $subsections
  247. system-framebuffer
  248. framebuffer
  249. renderbuffer
  250. }
  251. "The contents of a framebuffer can be cleared to known values before rendering a scene:"
  252. { $subsections
  253. clear-framebuffer
  254. clear-framebuffer-attachment
  255. }
  256. "The image memory for a renderbuffer can be resized, or the full set of textures and renderbuffers attached to a framebuffer can be resized to the same dimensions together:"
  257. { $subsections
  258. allocate-renderbuffer
  259. resize-framebuffer
  260. }
  261. "Rectangular regions of framebuffers can be read into memory, read into GPU " { $link buffer } "s, and copied between framebuffers:"
  262. { $subsections
  263. framebuffer-rect
  264. attachment-ref
  265. read-framebuffer
  266. read-framebuffer-to
  267. read-framebuffer-image
  268. copy-framebuffer
  269. } ;
  270. ABOUT: "gpu.framebuffers"