Class RenderSceneBuffersRD
Render scene buffer implementation for the RenderingDevice based renderers.
- Inheritance
-
RenderSceneBuffersRD
Remarks
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, do not instantiate this from script.
Methods
clear_context(StringName)
Frees all buffers related to this context.
void clear_context(StringName context)
Parameters
context
StringName
create_texture(StringName, StringName, int, int, int, Vector2i, int, int, bool, bool)
Create a new texture with the given definition and cache this under the given name. Will return the existing texture if it already exists.
RID create_texture(StringName context, StringName name, int data_format, int usage_bits, int texture_samples, Vector2i size, int layers, int mipmaps, bool unique, bool discardable)
Parameters
context
StringNamename
StringNamedata_format
intusage_bits
inttexture_samples
intsize
Vector2ilayers
intmipmaps
intunique
booldiscardable
bool
create_texture_from_format(StringName, StringName, RDTextureFormat, RDTextureView, bool)
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.
RID create_texture_from_format(StringName context, StringName name, RDTextureFormat format, RDTextureView view, bool unique)
Parameters
context
StringNamename
StringNameformat
RDTextureFormatview
RDTextureViewunique
bool
create_texture_view(StringName, StringName, StringName, RDTextureView)
Create a new texture view for an existing texture and cache this under the given view_name
. Will return the existing texture view if it already exists. Will error if the source texture doesn't exist.
RID create_texture_view(StringName context, StringName name, StringName view_name, RDTextureView view)
Parameters
context
StringNamename
StringNameview_name
StringNameview
RDTextureView
get_color_layer(int, bool)
Returns the specified layer from the color texture we are rendering 3D content to.
If msaa
is true
and MSAA is enabled, this returns the MSAA variant of the buffer.
RID get_color_layer(int layer, bool msaa)
Parameters
get_color_texture(bool)
Returns the color texture we are rendering 3D content to. If multiview is used this will be a texture array with all views.
If msaa
is true
and MSAA is enabled, this returns the MSAA variant of the buffer.
RID get_color_texture(bool msaa)
Parameters
msaa
bool
get_depth_layer(int, bool)
Returns the specified layer from the depth texture we are rendering 3D content to.
If msaa
is true
and MSAA is enabled, this returns the MSAA variant of the buffer.
RID get_depth_layer(int layer, bool msaa)
Parameters
get_depth_texture(bool)
Returns the depth texture we are rendering 3D content to. If multiview is used this will be a texture array with all views.
If msaa
is true
and MSAA is enabled, this returns the MSAA variant of the buffer.
RID get_depth_texture(bool msaa)
Parameters
msaa
bool
get_fsr_sharpness
Qualifiers: const
Returns the FSR sharpness value used while rendering the 3D content (if get_scaling_3d_mode is an FSR mode).
float get_fsr_sharpness
get_internal_size
Qualifiers: const
Returns the internal size of the render buffer (size before upscaling) with which textures are created by default.
Vector2i get_internal_size
get_msaa_3d
Qualifiers: const
Returns the applied 3D MSAA mode for this viewport.
int get_msaa_3d
get_render_target
Qualifiers: const
Returns the render target associated with this buffers object.
RID get_render_target
get_scaling_3d_mode
Qualifiers: const
Returns the scaling mode used for upscaling.
int get_scaling_3d_mode
get_screen_space_aa
Qualifiers: const
Returns the screen-space antialiasing method applied.
int get_screen_space_aa
get_target_size
Qualifiers: const
Returns the target size of the render buffer (size after upscaling).
Vector2i get_target_size
get_texture(StringName, StringName)
Qualifiers: const
Returns a cached texture with this name.
RID get_texture(StringName context, StringName name)
Parameters
context
StringNamename
StringName
get_texture_format(StringName, StringName)
Qualifiers: const
Returns the texture format information with which a cached texture was created.
RDTextureFormat get_texture_format(StringName context, StringName name)
Parameters
context
StringNamename
StringName
get_texture_samples
Qualifiers: const
Returns the number of MSAA samples used.
int get_texture_samples
get_texture_slice(StringName, StringName, int, int, int, int)
Returns a specific slice (layer or mipmap) for a cached texture.
RID get_texture_slice(StringName context, StringName name, int layer, int mipmap, int layers, int mipmaps)
Parameters
context
StringNamename
StringNamelayer
intmipmap
intlayers
intmipmaps
int
get_texture_slice_size(StringName, StringName, int)
Returns the texture size of a given slice of a cached texture.
Vector2i get_texture_slice_size(StringName context, StringName name, int mipmap)
Parameters
context
StringNamename
StringNamemipmap
int
get_texture_slice_view(StringName, StringName, int, int, int, int, RDTextureView)
Returns a specific view of a slice (layer or mipmap) for a cached texture.
RID get_texture_slice_view(StringName context, StringName name, int layer, int mipmap, int layers, int mipmaps, RDTextureView view)
Parameters
context
StringNamename
StringNamelayer
intmipmap
intlayers
intmipmaps
intview
RDTextureView
get_use_debanding
Qualifiers: const
Returns true
if debanding is enabled.
bool get_use_debanding
get_use_taa
Qualifiers: const
Returns true
if TAA is enabled.
bool get_use_taa
get_velocity_layer(int, bool)
Returns the specified layer from the velocity texture we are rendering 3D content to.
RID get_velocity_layer(int layer, bool msaa)
Parameters
get_velocity_texture(bool)
Returns the velocity texture we are rendering 3D content to. If multiview is used this will be a texture array with all views.
If msaa
is true and MSAA is enabled, this returns the MSAA variant of the buffer.
RID get_velocity_texture(bool msaa)
Parameters
msaa
bool
get_view_count
Qualifiers: const
Returns the view count for the associated viewport.
int get_view_count
has_texture(StringName, StringName)
Qualifiers: const
Returns true
if a cached texture exists for this name.
bool has_texture(StringName context, StringName name)
Parameters
context
StringNamename
StringName