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
RenderingDevice 基于的渲染器的抽象渲染场景缓冲区实现。
描述¶
该对象管理基于渲染设备的渲染器的所有 3D 渲染缓冲区。为每个启用 3D 渲染的视口创建该对象的实例。
所有缓冲区都被组织在上下文中。默认上下文被称为 render_buffers,可以包含颜色缓冲区、深度缓冲区、速度缓冲区、VRS 密度图和这些缓冲区的 MSAA 变体等。
缓冲区仅保证在视口渲染期间存在。
注意:这是一个仅为 GDExtension 插件公开的内部渲染服务器对象。
方法¶
方法说明¶
void clear_context ( StringName context )
释放与这个上下文相关的所有缓冲。
RID create_texture ( StringName context, StringName name, DataFormat data_format, int usage_bits, TextureSamples texture_samples, Vector2i size, int layers, int mipmaps, bool unique )
使用给定的定义创建一个新纹理,并将其缓存在给定的名称下。如果已有纹理已经存在,则返回该已有纹理。
RID create_texture_from_format ( StringName context, StringName name, RDTextureFormat format, RDTextureView view, bool unique )
使用给定的格式创建一个新纹理,并在给定的名称下查看和缓存它。如果已有纹理已经存在,则返回该已有纹理。
RID create_texture_view ( StringName context, StringName name, StringName view_name, RDTextureView view )
为已有纹理创建一个新的纹理视图,并将其缓存在给定的 view_name 下。如果已有的纹理视图已经存在,则返回该视图。如果源纹理不存在,将会出错。
RID get_color_layer ( int layer )
从渲染 3D 内容的颜色纹理返回指定的图层。
RID get_color_texture ( )
返回渲染 3D 内容的颜色纹理。如果使用多视图,这将是一个包含所有视图的纹理数组。
RID get_depth_layer ( int layer )
从渲染 3D 内容的深度纹理返回指定的图层。
RID get_depth_texture ( )
返回渲染 3D 内容的深度纹理。如果使用多视图,这将是一个包含所有视图的纹理数组。
Vector2i get_internal_size ( ) const
返回默认情况下创建纹理的渲染缓冲区的内部大小(放大之前的大小)。
RID get_render_target ( ) const
返回与该缓冲区对象关联的渲染目标。
RID get_texture ( StringName context, StringName name ) const
返回具有该名称的缓存纹理。
RDTextureFormat get_texture_format ( StringName context, StringName name ) const
返回用于创建缓存纹理的纹理格式信息。
RID get_texture_slice ( StringName context, StringName name, int layer, int mipmap, int layers, int mipmaps )
返回缓存纹理的指定切片(层或 mipmap)。
Vector2i get_texture_slice_size ( StringName context, StringName name, int mipmap )
返回缓存纹理给定切片的纹理大小。
RID get_texture_slice_view ( StringName context, StringName name, int layer, int mipmap, int layers, int mipmaps, RDTextureView view )
返回缓存纹理的指定切片视图(层或 mipmap)。
bool get_use_taa ( ) const
如果启用 TAA,则返回 true
。
RID get_velocity_layer ( int layer )
从渲染 3D 内容的速度纹理返回指定的图层。
RID get_velocity_texture ( )
返回渲染 3D 内容的速度纹理。如果使用多视图,这将是一个包含所有视图的纹理数组。
int get_view_count ( ) const
返回关联视口的视图数。
bool has_texture ( StringName context, StringName name ) const
如果存在使用该名称的缓冲纹理,则返回 true
。