class_renderscenebuffersrd.rst 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/RenderSceneBuffersRD.xml.
  6. .. _class_RenderSceneBuffersRD:
  7. RenderSceneBuffersRD
  8. ====================
  9. **Inherits:** :ref:`RenderSceneBuffers<class_RenderSceneBuffers>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Abstract render scene buffer implementation for the RenderingDevice based renderers.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. This object manages all 3D rendering buffers for the rendering device based renderers. An instance of this object is created for every viewport that has 3D rendering enabled.
  15. All buffers are organized in **contexts**. The default context is called **render_buffers** and can contain amongst others the color buffer, depth buffer, velocity buffers, VRS density map and MSAA variants of these buffers.
  16. Buffers are only guaranteed to exist during rendering of the viewport.
  17. \ **Note:** this is an internal rendering server object only exposed for GDExtension plugins.
  18. .. rst-class:: classref-reftable-group
  19. Methods
  20. -------
  21. .. table::
  22. :widths: auto
  23. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | void | :ref:`clear_context<class_RenderSceneBuffersRD_method_clear_context>` **(** :ref:`StringName<class_StringName>` context **)** |
  25. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`RID<class_RID>` | :ref:`create_texture<class_RenderSceneBuffersRD_method_create_texture>` **(** :ref:`StringName<class_StringName>` context, :ref:`StringName<class_StringName>` name, :ref:`DataFormat<enum_RenderingDevice_DataFormat>` data_format, :ref:`int<class_int>` usage_bits, :ref:`TextureSamples<enum_RenderingDevice_TextureSamples>` texture_samples, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` layers, :ref:`int<class_int>` mipmaps, :ref:`bool<class_bool>` unique **)** |
  27. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`RID<class_RID>` | :ref:`create_texture_from_format<class_RenderSceneBuffersRD_method_create_texture_from_format>` **(** :ref:`StringName<class_StringName>` context, :ref:`StringName<class_StringName>` name, :ref:`RDTextureFormat<class_RDTextureFormat>` format, :ref:`RDTextureView<class_RDTextureView>` view, :ref:`bool<class_bool>` unique **)** |
  29. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | :ref:`RID<class_RID>` | :ref:`create_texture_view<class_RenderSceneBuffersRD_method_create_texture_view>` **(** :ref:`StringName<class_StringName>` context, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` view_name, :ref:`RDTextureView<class_RDTextureView>` view **)** |
  31. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`RID<class_RID>` | :ref:`get_color_layer<class_RenderSceneBuffersRD_method_get_color_layer>` **(** :ref:`int<class_int>` layer **)** |
  33. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | :ref:`RID<class_RID>` | :ref:`get_color_texture<class_RenderSceneBuffersRD_method_get_color_texture>` **(** **)** |
  35. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | :ref:`RID<class_RID>` | :ref:`get_depth_layer<class_RenderSceneBuffersRD_method_get_depth_layer>` **(** :ref:`int<class_int>` layer **)** |
  37. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | :ref:`RID<class_RID>` | :ref:`get_depth_texture<class_RenderSceneBuffersRD_method_get_depth_texture>` **(** **)** |
  39. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`Vector2i<class_Vector2i>` | :ref:`get_internal_size<class_RenderSceneBuffersRD_method_get_internal_size>` **(** **)** |const| |
  41. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`RID<class_RID>` | :ref:`get_render_target<class_RenderSceneBuffersRD_method_get_render_target>` **(** **)** |const| |
  43. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | :ref:`RID<class_RID>` | :ref:`get_texture<class_RenderSceneBuffersRD_method_get_texture>` **(** :ref:`StringName<class_StringName>` context, :ref:`StringName<class_StringName>` name **)** |const| |
  45. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`RDTextureFormat<class_RDTextureFormat>` | :ref:`get_texture_format<class_RenderSceneBuffersRD_method_get_texture_format>` **(** :ref:`StringName<class_StringName>` context, :ref:`StringName<class_StringName>` name **)** |const| |
  47. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`RID<class_RID>` | :ref:`get_texture_slice<class_RenderSceneBuffersRD_method_get_texture_slice>` **(** :ref:`StringName<class_StringName>` context, :ref:`StringName<class_StringName>` name, :ref:`int<class_int>` layer, :ref:`int<class_int>` mipmap, :ref:`int<class_int>` layers, :ref:`int<class_int>` mipmaps **)** |
  49. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`Vector2i<class_Vector2i>` | :ref:`get_texture_slice_size<class_RenderSceneBuffersRD_method_get_texture_slice_size>` **(** :ref:`StringName<class_StringName>` context, :ref:`StringName<class_StringName>` name, :ref:`int<class_int>` mipmap **)** |
  51. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`RID<class_RID>` | :ref:`get_texture_slice_view<class_RenderSceneBuffersRD_method_get_texture_slice_view>` **(** :ref:`StringName<class_StringName>` context, :ref:`StringName<class_StringName>` name, :ref:`int<class_int>` layer, :ref:`int<class_int>` mipmap, :ref:`int<class_int>` layers, :ref:`int<class_int>` mipmaps, :ref:`RDTextureView<class_RDTextureView>` view **)** |
  53. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`bool<class_bool>` | :ref:`get_use_taa<class_RenderSceneBuffersRD_method_get_use_taa>` **(** **)** |const| |
  55. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :ref:`RID<class_RID>` | :ref:`get_velocity_layer<class_RenderSceneBuffersRD_method_get_velocity_layer>` **(** :ref:`int<class_int>` layer **)** |
  57. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`RID<class_RID>` | :ref:`get_velocity_texture<class_RenderSceneBuffersRD_method_get_velocity_texture>` **(** **)** |
  59. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`int<class_int>` | :ref:`get_view_count<class_RenderSceneBuffersRD_method_get_view_count>` **(** **)** |const| |
  61. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`bool<class_bool>` | :ref:`has_texture<class_RenderSceneBuffersRD_method_has_texture>` **(** :ref:`StringName<class_StringName>` context, :ref:`StringName<class_StringName>` name **)** |const| |
  63. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. .. rst-class:: classref-section-separator
  65. ----
  66. .. rst-class:: classref-descriptions-group
  67. Method Descriptions
  68. -------------------
  69. .. _class_RenderSceneBuffersRD_method_clear_context:
  70. .. rst-class:: classref-method
  71. void **clear_context** **(** :ref:`StringName<class_StringName>` context **)**
  72. Frees all buffers related to this context.
  73. .. rst-class:: classref-item-separator
  74. ----
  75. .. _class_RenderSceneBuffersRD_method_create_texture:
  76. .. rst-class:: classref-method
  77. :ref:`RID<class_RID>` **create_texture** **(** :ref:`StringName<class_StringName>` context, :ref:`StringName<class_StringName>` name, :ref:`DataFormat<enum_RenderingDevice_DataFormat>` data_format, :ref:`int<class_int>` usage_bits, :ref:`TextureSamples<enum_RenderingDevice_TextureSamples>` texture_samples, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` layers, :ref:`int<class_int>` mipmaps, :ref:`bool<class_bool>` unique **)**
  78. Create a new texture with the given definition and cache this under the given name. Will return the existing texture if it already exists.
  79. .. rst-class:: classref-item-separator
  80. ----
  81. .. _class_RenderSceneBuffersRD_method_create_texture_from_format:
  82. .. rst-class:: classref-method
  83. :ref:`RID<class_RID>` **create_texture_from_format** **(** :ref:`StringName<class_StringName>` context, :ref:`StringName<class_StringName>` name, :ref:`RDTextureFormat<class_RDTextureFormat>` format, :ref:`RDTextureView<class_RDTextureView>` view, :ref:`bool<class_bool>` unique **)**
  84. Create a new texture using the given format and view and cache this under the given name. Will return the existing texture if it already exists.
  85. .. rst-class:: classref-item-separator
  86. ----
  87. .. _class_RenderSceneBuffersRD_method_create_texture_view:
  88. .. rst-class:: classref-method
  89. :ref:`RID<class_RID>` **create_texture_view** **(** :ref:`StringName<class_StringName>` context, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` view_name, :ref:`RDTextureView<class_RDTextureView>` view **)**
  90. Create a new texture view for an existing texture and cache this under the given view_name. Will return the existing teture view if it already exists. Will error if the source texture doesn't exist.
  91. .. rst-class:: classref-item-separator
  92. ----
  93. .. _class_RenderSceneBuffersRD_method_get_color_layer:
  94. .. rst-class:: classref-method
  95. :ref:`RID<class_RID>` **get_color_layer** **(** :ref:`int<class_int>` layer **)**
  96. Returns the specified layer from the color texture we are rendering 3D content to.
  97. .. rst-class:: classref-item-separator
  98. ----
  99. .. _class_RenderSceneBuffersRD_method_get_color_texture:
  100. .. rst-class:: classref-method
  101. :ref:`RID<class_RID>` **get_color_texture** **(** **)**
  102. Returns the color texture we are rendering 3D content to. If multiview is used this will be a texture array with all views.
  103. .. rst-class:: classref-item-separator
  104. ----
  105. .. _class_RenderSceneBuffersRD_method_get_depth_layer:
  106. .. rst-class:: classref-method
  107. :ref:`RID<class_RID>` **get_depth_layer** **(** :ref:`int<class_int>` layer **)**
  108. Returns the specified layer from the depth texture we are rendering 3D content to.
  109. .. rst-class:: classref-item-separator
  110. ----
  111. .. _class_RenderSceneBuffersRD_method_get_depth_texture:
  112. .. rst-class:: classref-method
  113. :ref:`RID<class_RID>` **get_depth_texture** **(** **)**
  114. Returns the depth texture we are rendering 3D content to. If multiview is used this will be a texture array with all views.
  115. .. rst-class:: classref-item-separator
  116. ----
  117. .. _class_RenderSceneBuffersRD_method_get_internal_size:
  118. .. rst-class:: classref-method
  119. :ref:`Vector2i<class_Vector2i>` **get_internal_size** **(** **)** |const|
  120. Returns the internal size of the render buffer (size before upscaling) with which textures are created by default.
  121. .. rst-class:: classref-item-separator
  122. ----
  123. .. _class_RenderSceneBuffersRD_method_get_render_target:
  124. .. rst-class:: classref-method
  125. :ref:`RID<class_RID>` **get_render_target** **(** **)** |const|
  126. Returns the render target associated with this buffers object.
  127. .. rst-class:: classref-item-separator
  128. ----
  129. .. _class_RenderSceneBuffersRD_method_get_texture:
  130. .. rst-class:: classref-method
  131. :ref:`RID<class_RID>` **get_texture** **(** :ref:`StringName<class_StringName>` context, :ref:`StringName<class_StringName>` name **)** |const|
  132. Returns a cached texture with this name.
  133. .. rst-class:: classref-item-separator
  134. ----
  135. .. _class_RenderSceneBuffersRD_method_get_texture_format:
  136. .. rst-class:: classref-method
  137. :ref:`RDTextureFormat<class_RDTextureFormat>` **get_texture_format** **(** :ref:`StringName<class_StringName>` context, :ref:`StringName<class_StringName>` name **)** |const|
  138. Returns the texture format information with which a cached texture was created.
  139. .. rst-class:: classref-item-separator
  140. ----
  141. .. _class_RenderSceneBuffersRD_method_get_texture_slice:
  142. .. rst-class:: classref-method
  143. :ref:`RID<class_RID>` **get_texture_slice** **(** :ref:`StringName<class_StringName>` context, :ref:`StringName<class_StringName>` name, :ref:`int<class_int>` layer, :ref:`int<class_int>` mipmap, :ref:`int<class_int>` layers, :ref:`int<class_int>` mipmaps **)**
  144. Returns a specific slice (layer or mipmap) for a cached texture.
  145. .. rst-class:: classref-item-separator
  146. ----
  147. .. _class_RenderSceneBuffersRD_method_get_texture_slice_size:
  148. .. rst-class:: classref-method
  149. :ref:`Vector2i<class_Vector2i>` **get_texture_slice_size** **(** :ref:`StringName<class_StringName>` context, :ref:`StringName<class_StringName>` name, :ref:`int<class_int>` mipmap **)**
  150. Returns the texture size of a given slice of a cached texture.
  151. .. rst-class:: classref-item-separator
  152. ----
  153. .. _class_RenderSceneBuffersRD_method_get_texture_slice_view:
  154. .. rst-class:: classref-method
  155. :ref:`RID<class_RID>` **get_texture_slice_view** **(** :ref:`StringName<class_StringName>` context, :ref:`StringName<class_StringName>` name, :ref:`int<class_int>` layer, :ref:`int<class_int>` mipmap, :ref:`int<class_int>` layers, :ref:`int<class_int>` mipmaps, :ref:`RDTextureView<class_RDTextureView>` view **)**
  156. Returns a specific view of a slice (layer or mipmap) for a cached texture.
  157. .. rst-class:: classref-item-separator
  158. ----
  159. .. _class_RenderSceneBuffersRD_method_get_use_taa:
  160. .. rst-class:: classref-method
  161. :ref:`bool<class_bool>` **get_use_taa** **(** **)** |const|
  162. Returns ``true`` if TAA is enabled.
  163. .. rst-class:: classref-item-separator
  164. ----
  165. .. _class_RenderSceneBuffersRD_method_get_velocity_layer:
  166. .. rst-class:: classref-method
  167. :ref:`RID<class_RID>` **get_velocity_layer** **(** :ref:`int<class_int>` layer **)**
  168. Returns the specified layer from the velocity texture we are rendering 3D content to.
  169. .. rst-class:: classref-item-separator
  170. ----
  171. .. _class_RenderSceneBuffersRD_method_get_velocity_texture:
  172. .. rst-class:: classref-method
  173. :ref:`RID<class_RID>` **get_velocity_texture** **(** **)**
  174. Returns the velocity texture we are rendering 3D content to. If multiview is used this will be a texture array with all views.
  175. .. rst-class:: classref-item-separator
  176. ----
  177. .. _class_RenderSceneBuffersRD_method_get_view_count:
  178. .. rst-class:: classref-method
  179. :ref:`int<class_int>` **get_view_count** **(** **)** |const|
  180. Returns the view count for the associated viewport.
  181. .. rst-class:: classref-item-separator
  182. ----
  183. .. _class_RenderSceneBuffersRD_method_has_texture:
  184. .. rst-class:: classref-method
  185. :ref:`bool<class_bool>` **has_texture** **(** :ref:`StringName<class_StringName>` context, :ref:`StringName<class_StringName>` name **)** |const|
  186. Returns ``true`` if a cached texture exists for this name.
  187. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  188. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  189. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  190. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  191. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  192. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  193. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`