Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
RenderSceneBuffersRD
繼承: RenderSceneBuffers < RefCounted < Object
Render scene buffer implementation for the RenderingDevice based renderers.
說明
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. See also RenderSceneBuffers.
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 class from a script.
方法
方法說明
void clear_context(context: StringName) 🔗
釋放與這個本文相關的所有緩衝。
RID create_texture(context: StringName, name: StringName, data_format: DataFormat, usage_bits: int, texture_samples: TextureSamples, size: Vector2i, layers: int, mipmaps: int, unique: bool, discardable: bool) 🔗
使用給定的定義建立新紋理,並將其快取在給定的名稱下。如果現有紋理已存在,則將傳回該紋理。
RID create_texture_from_format(context: StringName, name: StringName, format: RDTextureFormat, view: RDTextureView, unique: bool) 🔗
使用給定格式建立新紋理,並在給定名稱下檢視並快取該紋理。如果現有紋理已存在,則傳回該紋理。
RID create_texture_view(context: StringName, name: StringName, view_name: StringName, view: 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 get_color_layer(layer: int, msaa: bool = false) 🔗
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_texture(msaa: bool = false) 🔗
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_depth_layer(layer: int, msaa: bool = false) 🔗
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_texture(msaa: bool = false) 🔗
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.
float get_fsr_sharpness() const 🔗
Returns the FSR sharpness value used while rendering the 3D content (if get_scaling_3d_mode() is an FSR mode).
Vector2i get_internal_size() const 🔗
傳回預設建立紋理的算繪緩衝區的內部大小(放大前的大小)。
ViewportMSAA get_msaa_3d() const 🔗
Returns the applied 3D MSAA mode for this viewport.
RID get_render_target() const 🔗
返回與給定頂點關聯的中繼資料。
ViewportScaling3DMode get_scaling_3d_mode() const 🔗
Returns the scaling mode used for upscaling.
ViewportScreenSpaceAA get_screen_space_aa() const 🔗
Returns the screen-space antialiasing method applied.
Vector2i get_target_size() const 🔗
Returns the target size of the render buffer (size after upscaling).
RID get_texture(context: StringName, name: StringName) const 🔗
返回該紋理的寬度,單位為圖元。
RDTextureFormat get_texture_format(context: StringName, name: StringName) const 🔗
傳回建立快取紋理所使用的紋理格式資訊。
TextureSamples get_texture_samples() const 🔗
Returns the number of MSAA samples used.
RID get_texture_slice(context: StringName, name: StringName, layer: int, mipmap: int, layers: int, mipmaps: int) 🔗
將指定的字元算繪到字形快取紋理。
Vector2i get_texture_slice_size(context: StringName, name: StringName, mipmap: int) 🔗
返回該紋理的大小,單位為圖元。
RID get_texture_slice_view(context: StringName, name: StringName, layer: int, mipmap: int, layers: int, mipmaps: int, view: RDTextureView) 🔗
傳回快取紋理的切片(圖層或 mipmap)的特定視圖。
bool get_use_debanding() const 🔗
Returns true if debanding is enabled.
如果啟用 TAA,則返回 true。
RID get_velocity_layer(layer: int, msaa: bool = false) 🔗
從我們算繪 3D 內容的速度紋理傳回指定圖層。
RID get_velocity_texture(msaa: bool = false) 🔗
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.
返回關聯視口的視圖數。
bool has_texture(context: StringName, name: StringName) const 🔗
如果存在使用該名稱的緩衝紋理,則返回 true。