BackBufferCopy
A node that copies a region of the screen to a buffer for access in shader code.
A node that copies a region of the screen to a buffer for access in shader code.
Entity for back-buffering the currently-displayed screen. The region defined in the BackBufferCopy node is buffered with the content of the screen it covers, or the entire screen according to the BackBufferCopy.CopyMode. It can be accessed in shader scripts using the screen texture (i.e. a uniform sampler with hint_screen_texture).
Note: Since this node inherits from Entity2D (and not Control), anchors and margins won't apply to child Control-derived nodes. This can be problematic when resizing the window. To avoid this, add Control-derived nodes as siblings to the BackBufferCopy node instead of adding them as children.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
BackBufferCopyConstructor
public BackBufferCopy();Properties2
CopyModeProperty
public BackBufferCopy.CopyModeEnum CopyMode { get; set; }Disabled turns off the explicit copy; Viewport copies the whole current screen; Rect copies the Rect region. To make a second canvas_item shader read the first pass’s result, place the copy between their draws. Without a new copy, screen-reading shaders can read the same previously captured screen.
RectProperty
public Rect2 Rect { get; set; }Copy region in the BackBufferCopy’s local coordinates, used with CopyMode=Rect. Sample within the region actually copied. If a shader offsets SCREEN_UV, expand the region to cover its full sampling range. CopyMode=Viewport copies the whole screen rather than limiting the copy to this Rect.
Methods4
GetCopyModeBackBufferCopy.CopyModeEnum
public BackBufferCopy.CopyModeEnum GetCopyMode();BackBufferCopy.CopyModeEnumGetRectRect2
public Rect2 GetRect();Rect2SetCopyModevoid
public void SetCopyMode(BackBufferCopy.CopyModeEnum copyMode);| Name | Type | Default |
|---|---|---|
copyMode | BackBufferCopy.CopyModeEnum | — |
SetRectvoid
public void SetRect(Rect2 rect);| Name | Type | Default |
|---|---|---|
rect | Rect2 | — |
BackBufferCopy.CopyModeEnum
| Value | Description |
|---|---|
Disabled = 0 | Disables the buffering mode. This means the |
Rect = 1 |
|
Viewport = 2 |
|