Click or drag to resize

VisualServerViewportSetRenderDirectToScreen Method

If true, render the contents of the viewport directly to screen. This allows a low-level optimization where you can skip drawing a viewport to the root viewport. While this optimization can result in a significant increase in speed (especially on older devices), it comes at a cost of usability. When this is enabled, you cannot read from the viewport or from the SCREEN_TEXTURE. You also lose the benefit of certain window settings, such as the various stretch modes. Another consequence to be aware of is that in 2D the rendering happens in window coordinates, so if you have a viewport that is double the size of the window, and you set this, then only the portion that fits within the window will be drawn, no automatic scaling is possible, even if your game scene is significantly larger than the window size.

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
public static void ViewportSetRenderDirectToScreen(
	RID viewport,
	bool enabled
)

Parameters

viewport
Type: GodotRID

[Missing <param name="viewport"/> documentation for "M:Godot.VisualServer.ViewportSetRenderDirectToScreen(Godot.RID,System.Boolean)"]

enabled
Type: SystemBoolean

[Missing <param name="enabled"/> documentation for "M:Godot.VisualServer.ViewportSetRenderDirectToScreen(Godot.RID,System.Boolean)"]

See Also