RenderSceneBuffersRD
Render scene buffer implementation for the RenderingDevice based renderers.
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.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
RenderSceneBuffersRDConstructor
public RenderSceneBuffersRD();Methods34
ClearContextvoid
public void ClearContext(StringName context);Frees all buffers related to this context.
| Name | Type | Default |
|---|---|---|
context | StringName | — |
CreateTexture2 overloads
public Rid CreateTexture(StringName context, StringName name, RenderingDevice.DataFormat dataFormat, uint usageBits, RenderingDevice.TextureSamples textureSamples, Vector2I size, uint layers, uint mipmaps, 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.
| Name | Type | Default |
|---|---|---|
context | StringName | — |
name | StringName | — |
dataFormat | RenderingDevice.DataFormat | — |
usageBits | uint | — |
textureSamples | RenderingDevice.TextureSamples | — |
size | Vector2I | — |
layers | uint | — |
mipmaps | uint | — |
unique | bool | — |
Ridpublic Rid CreateTexture(StringName context, StringName name, RenderingDevice.DataFormat dataFormat, uint usageBits, RenderingDevice.TextureSamples textureSamples, Vector2I size, uint layers, uint mipmaps, bool unique, bool discardable);Create a new texture with the given definition and cache this under the given name. Will return the existing texture if it already exists.
| Name | Type | Default |
|---|---|---|
context | StringName | — |
name | StringName | — |
dataFormat | RenderingDevice.DataFormat | — |
usageBits | uint | — |
textureSamples | RenderingDevice.TextureSamples | — |
size | Vector2I | — |
layers | uint | — |
mipmaps | uint | — |
unique | bool | — |
discardable | bool | — |
RidCreateTextureFromFormatRid
public Rid CreateTextureFromFormat(StringName context, StringName name, RDTextureFormat format, RDTextureView view, 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.
| Name | Type | Default |
|---|---|---|
context | StringName | — |
name | StringName | — |
format | RDTextureFormat | — |
view | RDTextureView | — |
unique | bool | — |
RidCreateTextureViewRid
public Rid CreateTextureView(StringName context, StringName name, StringName viewName, RDTextureView view);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.
| Name | Type | Default |
|---|---|---|
context | StringName | — |
name | StringName | — |
viewName | StringName | — |
view | RDTextureView | — |
RidGetColorLayer2 overloads
public Rid GetColorLayer(uint layer);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.
| Name | Type | Default |
|---|---|---|
layer | uint | — |
Ridpublic Rid GetColorLayer(uint layer, bool msaa = 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.
| Name | Type | Default |
|---|---|---|
layer | uint | — |
msaa | bool | false |
RidGetColorTexture2 overloads
public Rid GetColorTexture();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.
Ridpublic Rid GetColorTexture(bool msaa = 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.
| Name | Type | Default |
|---|---|---|
msaa | bool | false |
RidGetDepthLayer2 overloads
public Rid GetDepthLayer(uint layer);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.
| Name | Type | Default |
|---|---|---|
layer | uint | — |
Ridpublic Rid GetDepthLayer(uint layer, bool msaa = 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.
| Name | Type | Default |
|---|---|---|
layer | uint | — |
msaa | bool | false |
RidGetDepthTexture2 overloads
public Rid GetDepthTexture();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.
Ridpublic Rid GetDepthTexture(bool msaa = 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.
| Name | Type | Default |
|---|---|---|
msaa | bool | false |
RidGetFsrSharpnessfloat
public float GetFsrSharpness();Returns the FSR sharpness value used while rendering the 3D content (if RenderSceneBuffersRD.GetScaling3DMode is an FSR mode).
floatGetInternalSizeVector2I
public Vector2I GetInternalSize();Returns the internal size of the render buffer (size before upscaling) with which textures are created by default.
Vector2IGetMsaa3DRenderingServer.ViewportMsaa
public RenderingServer.ViewportMsaa GetMsaa3D();Returns the applied 3D MSAA mode for this viewport.
RenderingServer.ViewportMsaaGetRenderTargetRid
public Rid GetRenderTarget();Returns the render target associated with this buffers object.
RidGetScaling3DModeRenderingServer.ViewportScaling3DMode
public RenderingServer.ViewportScaling3DMode GetScaling3DMode();Returns the scaling mode used for upscaling.
RenderingServer.ViewportScaling3DModeGetScreenSpaceAARenderingServer.ViewportScreenSpaceAA
public RenderingServer.ViewportScreenSpaceAA GetScreenSpaceAA();Returns the screen-space antialiasing method applied.
RenderingServer.ViewportScreenSpaceAAGetTargetSizeVector2I
public Vector2I GetTargetSize();Returns the target size of the render buffer (size after upscaling).
Vector2IGetTextureRid
public Rid GetTexture(StringName context, StringName name);Returns a cached texture with this name.
| Name | Type | Default |
|---|---|---|
context | StringName | — |
name | StringName | — |
RidGetTextureFormatRDTextureFormat
public RDTextureFormat GetTextureFormat(StringName context, StringName name);Returns the texture format information with which a cached texture was created.
| Name | Type | Default |
|---|---|---|
context | StringName | — |
name | StringName | — |
RDTextureFormatGetTextureSamplesRenderingDevice.TextureSamples
public RenderingDevice.TextureSamples GetTextureSamples();Returns the number of MSAA samples used.
RenderingDevice.TextureSamplesGetTextureSliceRid
public Rid GetTextureSlice(StringName context, StringName name, uint layer, uint mipmap, uint layers, uint mipmaps);Returns a specific slice (layer or mipmap) for a cached texture.
| Name | Type | Default |
|---|---|---|
context | StringName | — |
name | StringName | — |
layer | uint | — |
mipmap | uint | — |
layers | uint | — |
mipmaps | uint | — |
RidGetTextureSliceSizeVector2I
public Vector2I GetTextureSliceSize(StringName context, StringName name, uint mipmap);Returns the texture size of a given slice of a cached texture.
| Name | Type | Default |
|---|---|---|
context | StringName | — |
name | StringName | — |
mipmap | uint | — |
Vector2IGetTextureSliceViewRid
public Rid GetTextureSliceView(StringName context, StringName name, uint layer, uint mipmap, uint layers, uint mipmaps, RDTextureView view);Returns a specific view of a slice (layer or mipmap) for a cached texture.
| Name | Type | Default |
|---|---|---|
context | StringName | — |
name | StringName | — |
layer | uint | — |
mipmap | uint | — |
layers | uint | — |
mipmaps | uint | — |
view | RDTextureView | — |
RidGetUseDebandingbool
public bool GetUseDebanding();Returns true if debanding is enabled.
boolGetUseTaabool
public bool GetUseTaa();Returns true if TAA is enabled.
boolGetVelocityLayer2 overloads
public Rid GetVelocityLayer(uint layer);Returns the specified layer from the velocity texture we are rendering 3D content to.
| Name | Type | Default |
|---|---|---|
layer | uint | — |
Ridpublic Rid GetVelocityLayer(uint layer, bool msaa = false);Returns the specified layer from the velocity texture we are rendering 3D content to.
| Name | Type | Default |
|---|---|---|
layer | uint | — |
msaa | bool | false |
RidGetVelocityTexture2 overloads
public Rid GetVelocityTexture();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.
Ridpublic Rid GetVelocityTexture(bool msaa = 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.
| Name | Type | Default |
|---|---|---|
msaa | bool | false |
RidGetViewCountuint
public uint GetViewCount();Returns the view count for the associated viewport.
uintHasTexturebool
public bool HasTexture(StringName context, StringName name);Returns true if a cached texture exists for this name.
| Name | Type | Default |
|---|---|---|
context | StringName | — |
name | StringName | — |
bool