Click or drag to resize

Viewport Properties

The Viewport type exposes the following members.

Properties
  NameDescription
Public property_ImportPath (Inherited from Node.)
Public propertyArvr

If true, the viewport will be used in AR/VR process.

Public propertyAudioListenerEnable2d

If true, the viewport will process 2D audio streams.

Public propertyAudioListenerEnable3d

If true, the viewport will process 3D audio streams.

Public propertyCanvasTransform

The canvas transform of the viewport, useful for changing the on-screen positions of all child CanvasItems. This is relative to the global canvas transform of the viewport.

Public propertyCustomMultiplayer

The override to the default MultiplayerAPI. Set to null to use the default SceneTree one.

(Inherited from Node.)
Public propertyDebanding

If true, uses a fast post-processing filter to make banding significantly less visible. In some cases, debanding may introduce a slightly noticeable dithering pattern. It's recommended to enable debanding only when actually needed since the dithering pattern will make lossless-compressed screenshots larger.

Note: Only available on the GLES3 backend. Hdr must also be true for debanding to be effective.

Public propertyDebugDraw

The overlay mode for test rendered geometry in debug purposes.

Public propertyDisable3d

If true, the viewport will disable 3D rendering. For actual disabling use usage.

Public propertyDynamicObject
Gets a new DynamicGodotObject associated with this instance.
(Inherited from Object.)
Public propertyEditorDescription (Inherited from Node.)
Public propertyFilename

When a scene is instanced from a file, its topmost node contains the filename from which it was loaded.

(Inherited from Node.)
Public propertyFxaa

Enables fast approximate antialiasing. FXAA is a popular screen-space antialiasing method, which is fast but will make the image look blurry, especially at lower resolutions. It can still work relatively well at large resolutions such as 1440p and 4K.

Public propertyGlobalCanvasTransform

The global canvas transform of the viewport. The canvas transform is relative to this.

Public propertyGuiDisableInput

If true, the viewport will not receive input events.

Public propertyGuiSnapControlsToPixels

If true, the GUI controls on the viewport will lay pixel perfectly.

Public propertyHandleInputLocally
Public propertyHdr

If true, the viewport rendering will receive benefits from High Dynamic Range algorithm. High Dynamic Range allows the viewport to receive values that are outside the 0-1 range. In Godot HDR uses 16 bits, meaning it does not store the full range of a floating point number.

Note: Requires Usage to be set to or , since HDR is not supported for 2D.

Public propertyKeep3dLinear

If true, the result after 3D rendering will not have a linear to sRGB color conversion applied. This is important when the viewport is used as a render target where the result is used as a texture on a 3D object rendered in another viewport. It is also important if the viewport is used to create data that is not color based (noise, heightmaps, pickmaps, etc.). Do not enable this when the viewport is used as a texture on a 2D object or if the viewport is your final output.

Public propertyMsaa

The multisample anti-aliasing mode. A higher number results in smoother edges at the cost of significantly worse performance. A value of 4 is best unless targeting very high-end systems.

Public propertyMultiplayer

The MultiplayerAPI instance associated with this node. Either the CustomMultiplayer, or the default SceneTree one (if inside tree).

(Inherited from Node.)
Public propertyName

The name of the node. This name is unique among the siblings (other child nodes from the same parent). When set to an existing name, the node will be automatically renamed.

Note: Auto-generated names might include the @ character, which is reserved for unique names when using AddChild(Node, Boolean). When setting the name manually, any @ will be removed.

(Inherited from Node.)
Public propertyNativeInstance (Inherited from Object.)
Public propertyOwner

The node owner. A node can have any other node as owner (as long as it is a valid parent, grandparent, etc. ascending in the tree). When saving a node (using PackedScene), all the nodes it owns will be saved with it. This allows for the creation of complex SceneTrees, with instancing and subinstancing.

(Inherited from Node.)
Public propertyOwnWorld

If true, the viewport will use World defined in world property.

Public propertyPauseMode

Pause mode. How the node will behave if the SceneTree is paused.

(Inherited from Node.)
Public propertyPhysicsObjectPicking

If true, the objects rendered by viewport become subjects of mouse picking process.

Public propertyProcessPriority

The node's priority in the execution order of the enabled processing callbacks (i.e. , and their internal counterparts). Nodes whose process priority value is lower will have their processing callbacks executed first.

(Inherited from Node.)
Public propertyRenderDirectToScreen

If true, renders the Viewport directly to the screen instead of to the root viewport. Only available in GLES2. This is a low-level optimization and should not be used in most cases. If used, reading from the Viewport or from SCREEN_TEXTURE becomes unavailable. For more information see ViewportSetRenderDirectToScreen(RID, Boolean).

Public propertyRenderTargetClearMode

The clear mode when viewport used as a render target.

Note: This property is intended for 2D usage.

Public propertyRenderTargetUpdateMode

The update mode when viewport used as a render target.

Public propertyRenderTargetVFlip

If true, the result of rendering will be flipped vertically.

Public propertyShadowAtlasQuad0

The subdivision amount of the first quadrant on the shadow atlas.

Public propertyShadowAtlasQuad1

The subdivision amount of the second quadrant on the shadow atlas.

Public propertyShadowAtlasQuad2

The subdivision amount of the third quadrant on the shadow atlas.

Public propertyShadowAtlasQuad3

The subdivision amount of the fourth quadrant on the shadow atlas.

Public propertyShadowAtlasSize

The shadow atlas' resolution (used for omni and spot lights). The value will be rounded up to the nearest power of 2.

Note: If this is set to 0, shadows won't be visible. Since user-created viewports default to a value of 0, this value must be set above 0 manually.

Public propertySize

The width and height of viewport.

Public propertySizeOverrideStretch

If true, the size override affects stretch as well.

Public propertyTransparentBg

If true, the viewport should render its background as transparent.

Public propertyUsage

The rendering mode of viewport.

Public propertyWorld

The custom World which can be used as 3D environment source.

Public propertyWorld2d

The custom World2D which can be used as 2D environment source.

Top
See Also