RenderSceneBuffersRD

继承: RenderSceneBuffers < RefCounted < Object

渲染场景缓冲的实现,适用于基于 RenderingDevice 的渲染器。

描述

该对象管理基于渲染设备的渲染器的所有 3D 渲染缓冲区。为每个启用 3D 渲染的视口创建该对象的实例。

所有缓冲区都被组织在上下文中。默认上下文被称为 render_buffers,可以包含颜色缓冲区、深度缓冲区、速度缓冲区、VRS 密度图和这些缓冲区的 MSAA 变体等。

缓冲区仅保证在视口渲染期间存在。

注意:这是内部渲染服务器对象,请勿在脚本中实例化。

方法

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)

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)

RID

get_color_layer(layer: int, msaa: bool = false)

RID

get_color_texture(msaa: bool = false)

RID

get_depth_layer(layer: int, msaa: bool = false)

RID

get_depth_texture(msaa: bool = false)

float

get_fsr_sharpness() const

Vector2i

get_internal_size() const

ViewportMSAA

get_msaa_3d() const

RID

get_render_target() const

ViewportScaling3DMode

get_scaling_3d_mode() const

ViewportScreenSpaceAA

get_screen_space_aa() const

Vector2i

get_target_size() const

RID

get_texture(context: StringName, name: StringName) const

RDTextureFormat

get_texture_format(context: StringName, name: StringName) const

TextureSamples

get_texture_samples() const

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)

bool

get_use_debanding() const

bool

get_use_taa() const

RID

get_velocity_layer(layer: int, msaa: bool = false)

RID

get_velocity_texture(msaa: bool = false)

int

get_view_count() const

bool

has_texture(context: StringName, name: StringName) const


方法说明

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

使用给定的定义创建一个新纹理,并将其缓存在给定的名称下。如果已有纹理已经存在,则返回该已有纹理。


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

为已有纹理创建一个新的纹理视图,并将其缓存在给定的 view_name 下。如果已有的纹理视图已经存在,则返回该视图。如果源纹理不存在,将会出错。


RID get_color_layer(layer: int, msaa: bool = false) 🔗

从渲染 3D 内容的颜色纹理返回指定的图层。

如果 msaatrue 并且启用了 MSAA,则会返回缓冲的 MSAA 变种。


RID get_color_texture(msaa: bool = false) 🔗

返回渲染 3D 内容的颜色纹理。如果使用多视图,这将是一个包含所有视图的纹理数组。

如果 msaatrue 并且启用了 MSAA,则会返回缓冲的 MSAA 变种。


RID get_depth_layer(layer: int, msaa: bool = false) 🔗

从渲染 3D 内容的深度纹理返回指定的图层。

如果 msaatrue 并且启用了 MSAA,则会返回缓冲的 MSAA 变种。


RID get_depth_texture(msaa: bool = false) 🔗

返回渲染 3D 内容的深度纹理。如果使用多视图,这将是一个包含所有视图的纹理数组。

如果 msaatrue 并且启用了 MSAA,则会返回缓冲的 MSAA 变种。


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 🔗

返回该视口应用的 3D MSAA 模式。


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

返回缓存纹理的指定切片(层或 mipmap)。


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.


bool get_use_taa() const 🔗

如果启用 TAA,则返回 true


RID get_velocity_layer(layer: int, msaa: bool = false) 🔗

从渲染 3D 内容的速度纹理返回指定的图层。


RID get_velocity_texture(msaa: bool = false) 🔗

返回渲染 3D 内容的速度纹理。如果使用多视图,这将是一个包含所有视图的纹理数组。

如果 msaatrue 并且启用了 MSAA,则会返回缓冲的 MSAA 变种。


int get_view_count() const 🔗

返回关联视口的视图数。


bool has_texture(context: StringName, name: StringName) const 🔗

如果存在使用该名称的缓冲纹理,则返回 true