Skip to content

Latest commit

 

History

History
317 lines (185 loc) · 29.2 KB

class_renderscenebuffersrd.rst

File metadata and controls

317 lines (185 loc) · 29.2 KB
github_url:hide

RenderSceneBuffersRD

Inherits: :ref:`RenderSceneBuffers<class_RenderSceneBuffers>` < :ref:`RefCounted<class_RefCounted>` < :ref:`Object<class_Object>`

Abstract render scene buffer implementation for the RenderingDevice based renderers.

.. rst-class:: classref-introduction-group

Description

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.

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.

Buffers are only guaranteed to exist during rendering of the viewport.

Note: this is an internal rendering server object only exposed for GDExtension plugins.

.. rst-class:: classref-reftable-group

Methods

void :ref:`clear_context<class_RenderSceneBuffersRD_method_clear_context>` ( :ref:`StringName<class_StringName>` context )
: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 )
: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 )
: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 )
:ref:`RID<class_RID>` :ref:`get_color_layer<class_RenderSceneBuffersRD_method_get_color_layer>` ( :ref:`int<class_int>` layer )
:ref:`RID<class_RID>` :ref:`get_color_texture<class_RenderSceneBuffersRD_method_get_color_texture>` ( )
:ref:`RID<class_RID>` :ref:`get_depth_layer<class_RenderSceneBuffersRD_method_get_depth_layer>` ( :ref:`int<class_int>` layer )
:ref:`RID<class_RID>` :ref:`get_depth_texture<class_RenderSceneBuffersRD_method_get_depth_texture>` ( )
:ref:`Vector2i<class_Vector2i>` :ref:`get_internal_size<class_RenderSceneBuffersRD_method_get_internal_size>` ( ) |const|
:ref:`RID<class_RID>` :ref:`get_render_target<class_RenderSceneBuffersRD_method_get_render_target>` ( ) |const|
:ref:`RID<class_RID>` :ref:`get_texture<class_RenderSceneBuffersRD_method_get_texture>` ( :ref:`StringName<class_StringName>` context, :ref:`StringName<class_StringName>` name ) |const|
: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|
: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 )
: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 )
:ref:`bool<class_bool>` :ref:`get_use_taa<class_RenderSceneBuffersRD_method_get_use_taa>` ( ) |const|
:ref:`RID<class_RID>` :ref:`get_velocity_layer<class_RenderSceneBuffersRD_method_get_velocity_layer>` ( :ref:`int<class_int>` layer )
:ref:`RID<class_RID>` :ref:`get_velocity_texture<class_RenderSceneBuffersRD_method_get_velocity_texture>` ( )
:ref:`int<class_int>` :ref:`get_view_count<class_RenderSceneBuffersRD_method_get_view_count>` ( ) |const|
:ref:`bool<class_bool>` :ref:`has_texture<class_RenderSceneBuffersRD_method_has_texture>` ( :ref:`StringName<class_StringName>` context, :ref:`StringName<class_StringName>` name ) |const|
.. rst-class:: classref-section-separator


.. rst-class:: classref-descriptions-group

Method Descriptions

.. rst-class:: classref-method

void clear_context ( :ref:`StringName<class_StringName>` context )

Frees all buffers related to this context.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

: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 )

Create a new texture with the given definition and cache this under the given name. Will return the existing texture if it already exists.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

: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 )

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.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

: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 )

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.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`RID<class_RID>` get_color_layer ( :ref:`int<class_int>` layer )

Returns the specified layer from the color texture we are rendering 3D content to.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`RID<class_RID>` get_color_texture ( )

Returns the color texture we are rendering 3D content to. If multiview is used this will be a texture array with all views.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`RID<class_RID>` get_depth_layer ( :ref:`int<class_int>` layer )

Returns the specified layer from the depth texture we are rendering 3D content to.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`RID<class_RID>` get_depth_texture ( )

Returns the depth texture we are rendering 3D content to. If multiview is used this will be a texture array with all views.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`Vector2i<class_Vector2i>` get_internal_size ( ) |const|

Returns the internal size of the render buffer (size before upscaling) with which textures are created by default.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`RID<class_RID>` get_render_target ( ) |const|

Returns the render target associated with this buffers object.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`RID<class_RID>` get_texture ( :ref:`StringName<class_StringName>` context, :ref:`StringName<class_StringName>` name ) |const|

Returns a cached texture with this name.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`RDTextureFormat<class_RDTextureFormat>` get_texture_format ( :ref:`StringName<class_StringName>` context, :ref:`StringName<class_StringName>` name ) |const|

Returns the texture format information with which a cached texture was created.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

: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 )

Returns a specific slice (layer or mipmap) for a cached texture.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`Vector2i<class_Vector2i>` get_texture_slice_size ( :ref:`StringName<class_StringName>` context, :ref:`StringName<class_StringName>` name, :ref:`int<class_int>` mipmap )

Returns the texture size of a given slice of a cached texture.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`bool<class_bool>` get_use_taa ( ) |const|

Returns true if TAA is enabled.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`RID<class_RID>` get_velocity_layer ( :ref:`int<class_int>` layer )

Returns the specified layer from the velocity texture we are rendering 3D content to.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`RID<class_RID>` get_velocity_texture ( )

Returns the velocity texture we are rendering 3D content to. If multiview is used this will be a texture array with all views.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`int<class_int>` get_view_count ( ) |const|

Returns the view count for the associated viewport.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`bool<class_bool>` has_texture ( :ref:`StringName<class_StringName>` context, :ref:`StringName<class_StringName>` name ) |const|

Returns true if a cached texture exists for this name.