reckfellENGINE

Viewport

Abstract base class for viewports. Encapsulates drawing and interaction with a game world.

On this page
class ViewportReckfellSharpInherits Entity

Abstract base class for viewports. Encapsulates drawing and interaction with a game world.

A Viewport creates a different view into the screen, or a sub-view inside another viewport. Child 2D nodes will display on it, and child Camera3D 3D nodes will render on it too. Optionally, a viewport can have its own 2D or 3D world, so it doesn't share what it draws with other viewports. Viewports can also choose to be audio listeners, so they generate positional audio depending on a 2D or 3D camera child of it. Also, viewports can be assigned to different screens in case the devices have multiple screens. Finally, viewports can also behave as render targets, in which case they will not be visible unless the associated texture is used to draw.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Properties50

AnisotropicFilteringLevelProperty
# AnisotropicFilteringLevel
C#
public Viewport.AnisotropicFiltering AnisotropicFilteringLevel { get; set; }

Sets the maximum number of samples to take when using anisotropic filtering on textures (as a power of two). A higher sample count will result in sharper textures at oblique angles, but is more expensive to compute. A value of 0 forcibly disables anisotropic filtering, even on materials where it is enabled. The anisotropic filtering level also affects decals and light projectors if they are configured to use anisotropic filtering. See ProjectSettings.rendering/textures/decals/filter and ProjectSettings.rendering/textures/light_projectors/filter. Note: In 3D, for this setting to have an effect, set BaseMaterial3D.TextureFilter to BaseMaterial3D.TextureFilterEnum.LinearWithMipmapsAnisotropic or BaseMaterial3D.TextureFilterEnum.NearestWithMipmapsAnisotropic on materials. Note: In 2D, for this setting to have an effect, set CanvasItem.TextureFilter to CanvasItem.TextureFilterEnum.LinearWithMipmapsAnisotropic or CanvasItem.TextureFilterEnum.NearestWithMipmapsAnisotropic on the CanvasItem node displaying the texture (or in CanvasTexture). However, anisotropic filtering is rarely useful in 2D, so only enable it for textures in 2D if it makes a meaningful visual difference.

AudioListenerEnable2DProperty
# AudioListenerEnable2D
C#
public bool AudioListenerEnable2D { get; set; }

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

AudioListenerEnable3DProperty
# AudioListenerEnable3D
C#
public bool AudioListenerEnable3D { get; set; }

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

CanvasCullMaskProperty
# CanvasCullMask
C#
public uint CanvasCullMask { get; set; }

The rendering layers in which this Viewport renders CanvasItem nodes. Note: A CanvasItem does not inherit its parents' visibility layers. See CanvasItem.VisibilityLayer's description for details.

CanvasItemDefaultTextureFilterProperty
# CanvasItemDefaultTextureFilter
C#
public Viewport.DefaultCanvasItemTextureFilter CanvasItemDefaultTextureFilter { get; set; }

The default filter mode used by CanvasItem nodes in this viewport.

CanvasItemDefaultTextureRepeatProperty
# CanvasItemDefaultTextureRepeat
C#
public Viewport.DefaultCanvasItemTextureRepeat CanvasItemDefaultTextureRepeat { get; set; }

The default repeat mode used by CanvasItem nodes in this viewport.

CanvasTransformProperty
# CanvasTransform
C#
public Transform2D CanvasTransform { get; set; }

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.

DebugDrawProperty
# DebugDraw
C#
public Viewport.DebugDrawEnum DebugDraw { get; set; }

The overlay mode for test rendered geometry in debug purposes.

Disable3DProperty
# Disable3D
C#
public bool Disable3D { get; set; }

Disable 3D rendering (but keep 2D rendering).

FsrSharpnessProperty
# FsrSharpness
C#
public float FsrSharpness { get; set; }

FSR sharpness parameter, separate from Scaling3DScale. Does not enable FSR or establish upscaler availability. Source replaces negative values with 0; quality across different sharpness values is not verified by this example.

GlobalCanvasTransformProperty
# GlobalCanvasTransform
C#
public Transform2D GlobalCanvasTransform { get; set; }

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

GuiDisableInputProperty
# GuiDisableInput
C#
public bool GuiDisableInput { get; set; }

Disables the viewport input entry path. Despite the property name, PushInput stops before _Input and GUI, not only for interface controls. Does not disable rendering or _Process.

GuiDragThresholdProperty
# GuiDragThreshold
C#
public int GuiDragThreshold { get; set; }

The minimum distance the mouse cursor must move while pressed before a drag operation begins.

GuiEmbedSubwindowsProperty
# GuiEmbedSubwindows
C#
public bool GuiEmbedSubwindows { get; set; }

If true, sub-windows (popups and dialogs) will be embedded inside application window as control-like nodes. If false, they will appear as separate windows handled by the operating system.

GuiSnapControlsToPixelsProperty
# GuiSnapControlsToPixels
C#
public bool GuiSnapControlsToPixels { get; set; }

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

HandleInputLocallyProperty
# HandleInputLocally
C#
public bool HandleInputLocally { get; set; }

If true, this viewport will mark incoming input events as handled by itself. If false, this is instead done by the first parent viewport that is set to handle input locally. A SubViewportContainer will automatically set this property to false for the Viewport contained inside of it. See also Viewport.SetInputAsHandled and Viewport.IsInputHandled.

MeshLodThresholdProperty
# MeshLodThreshold
C#
public float MeshLodThreshold { get; set; }

Screen-space automatic mesh-LOD selection threshold. Zero disables simplified-level selection; larger thresholds permit coarser geometry. Does not generate missing resource LOD data or disable entities. The example compares 0 and 1.

Msaa2DProperty
# Msaa2D
C#
public Viewport.Msaa Msaa2D { get; set; }

MSAA mode for this Viewport 2D/canvas geometry. It does not replace texture filtering or antialiasing shader-generated patterns. In the verified 1.0.0 build, Compatibility/OpenGL warns and leaves the 2D mesh edge unchanged even when the property reads Msaa4X. Msaa4X coverage was verified separately in Forward+/Vulkan. Msaa3D is a different setting.

Complete example and limits.

Msaa3DProperty
# Msaa3D
C#
public Viewport.Msaa Msaa3D { get; set; }

Requested 3D MSAA. Verified Msaa4X adds partial coverage to geometry edges in Compatibility/OpenGL and Forward+/Vulkan. Does not automatically smooth every shader or texture detail. Actual support/sample count depends on the device; the getter does not inspect GPU buffers.

OversamplingProperty
# Oversampling
C#
public bool Oversampling { get; set; }

If true and one of the following conditions are true: SubViewport.Size2DOverrideStretch and SubViewport.Size2DOverride are set, Window.ContentScaleFactor is set and scaling is enabled, Viewport.OversamplingOverride is set, font and DpiTexture oversampling are enabled.

OversamplingOverrideProperty
# OversamplingOverride
C#
public float OversamplingOverride { get; set; }

If greater than zero, this value is used as the font oversampling factor, otherwise oversampling is equal to viewport scale.

OwnWorld3DProperty
# OwnWorld3D
C#
public bool OwnWorld3D { get; set; }

Uses an owned effective 3D world instead of the assigned/inherited world. May duplicate an assigned World3D resource; the World3D property and FindWorld3D then differ. Does not clone Entities. Disabling restores the assigned/inherited world.

PhysicsObjectPickingProperty
# PhysicsObjectPicking
C#
public bool PhysicsObjectPicking { get; set; }

If true, the objects rendered by viewport become subjects of mouse picking process. Note: The number of CanvasItems pickable by a single input is limited to 64 and they are selected in a non-deterministic order. The number of pickable 3D objects is not limited.

PhysicsObjectPickingFirstOnlyProperty
# PhysicsObjectPickingFirstOnly
C#
public bool PhysicsObjectPickingFirstOnly { get; set; }

If true, the input_event signal will only be sent to one physics object in the mouse picking process. If you want to get the top object only, you must also enable Viewport.PhysicsObjectPickingSort. If false, an input_event signal will be sent to all physics objects in the mouse picking process. This applies to CanvasItem picking only.

PhysicsObjectPickingSortProperty
# PhysicsObjectPickingSort
C#
public bool PhysicsObjectPickingSort { get; set; }

If true, objects receive mouse picking events sorted primarily by their CanvasItem.ZIndex and secondarily by their position in the scene tree. If false, the order is non-deterministic. Note: This setting is disabled by default because of its potential expensive computational cost. Note: Sorting happens after selecting the pickable objects. If surpassing the maximum of 64 CanvasItems pickable by a single input, it is not guaranteed that the object with the highest CanvasItem.ZIndex receives the picking event.

PositionalShadowAtlas16BitsProperty
# PositionalShadowAtlas16Bits
C#
public bool PositionalShadowAtlas16Bits { get; set; }

Use 16 bits for the omni/spot shadow depth map. Enabling this results in shadows having less precision and may result in shadow acne, but can lead to performance improvements on some devices.

PositionalShadowAtlasQuad0Property
# PositionalShadowAtlasQuad0
C#
public Viewport.PositionalShadowAtlasQuadrantSubdiv PositionalShadowAtlasQuad0 { get; set; }

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

PositionalShadowAtlasQuad1Property
# PositionalShadowAtlasQuad1
C#
public Viewport.PositionalShadowAtlasQuadrantSubdiv PositionalShadowAtlasQuad1 { get; set; }

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

PositionalShadowAtlasQuad2Property
# PositionalShadowAtlasQuad2
C#
public Viewport.PositionalShadowAtlasQuadrantSubdiv PositionalShadowAtlasQuad2 { get; set; }

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

PositionalShadowAtlasQuad3Property
# PositionalShadowAtlasQuad3
C#
public Viewport.PositionalShadowAtlasQuadrantSubdiv PositionalShadowAtlasQuad3 { get; set; }

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

PositionalShadowAtlasSizeProperty
# PositionalShadowAtlasSize
C#
public int PositionalShadowAtlasSize { get; set; }

Shared positional-light shadow atlas size for this viewport, covering OmniLight3D and SpotLight3D. Lights also need ShadowEnabled. The example sets 1024 and verifies reduced blue fill behind an opaque wall when shadows are enabled. Not each light’s individual map size or the directional-light atlas.

Scaling3DModeProperty
# Scaling3DMode
C#
public Viewport.Scaling3DModeEnum Scaling3DMode { get; set; }

Requested 3D scaling algorithm. Bilinear/Nearest are verified in OpenGL and Vulkan; Fsr/Fsr2 in Forward+. Current Compatibility rejects Fsr2 and preserves the previous renderer filter while the C# getter reports Fsr2. Do not present that as an applied algorithm.

Scaling3DScaleProperty
# Scaling3DScale
C#
public float Scaling3DScale { get; set; }

Linear internal 3D-resolution scale. For finite values Viewport clamps to 0.1..2. At 512×384 output, scale 0.5 renders internally at 256×192; output texture and canvas UI retain size. Scale 2 renders at 1024×768 before downsampling. Not an FPS guarantee.

ScreenSpaceAAProperty
# ScreenSpaceAA
C#
public Viewport.ScreenSpaceAAEnum ScreenSpaceAA { get; set; }

Requested screen-space AA: Disabled, Fxaa or Smaa. Current Compatibility rejects FXAA/SMAA while the C# property retains the request. Both modes change real example edges in Forward+/Vulkan. Check the renderer and output, not just the getter.

SdfOversizeProperty
# SdfOversize
C#
public Viewport.SdfOversizeEnum SdfOversize { get; set; }

Controls how much of the original viewport's size should be covered by the 2D signed distance field. This SDF can be sampled in CanvasItem shaders and is also used for GpuParticles2D collision. Higher values allow portions of occluders located outside the viewport to still be taken into account in the generated signed distance field, at the cost of performance. If you notice particles falling through LightOccluder2Ds as the occluders leave the viewport, increase this setting. The percentage is added on each axis and on both sides. For example, with the default Viewport.SdfOversizeEnum.Oversize120Percent, the signed distance field will cover 20% of the viewport's size outside the viewport on each side (top, right, bottom, left).

SdfScaleProperty
# SdfScale
C#
public Viewport.SdfScaleEnum SdfScale { get; set; }

The resolution scale to use for the 2D signed distance field. Higher values lead to a more precise and more stable signed distance field as the camera moves, at the cost of performance.

Snap2DTransformsToPixelProperty
# Snap2DTransformsToPixel
C#
public bool Snap2DTransformsToPixel { get; set; }

If true, CanvasItem nodes will internally snap to full pixels. Their position can still be sub-pixel, but the decimals will not have effect. This can lead to a crisper appearance at the cost of less smooth movement, especially when Camera2D smoothing is enabled.

Snap2DVerticesToPixelProperty
# Snap2DVerticesToPixel
C#
public bool Snap2DVerticesToPixel { get; set; }

If true, vertices of CanvasItem nodes will snap to full pixels. Only affects the final vertex positions, not the transforms. This can lead to a crisper appearance at the cost of less smooth movement, especially when Camera2D smoothing is enabled.

TextureMipmapBiasProperty
# TextureMipmapBias
C#
public float TextureMipmapBias { get; set; }

Additional texture mip-selection bias. Renderer also accounts for 3D scale when configuring effective bias. Not geometry AA or a substitute for proper mipmaps; this example uses solid meshes without testing texture aliasing.

TransparentBgProperty
# TransparentBg
C#
public bool TransparentBg { get; set; }

If true, the viewport should render its background as transparent. Note: Due to technical limitations, certain rendering features are disabled when a viewport has a transparent background. This currently applies to screen-space reflections, subsurface scattering, and depth of field.

UseDebandingProperty
# UseDebanding
C#
public bool UseDebanding { get; set; }

When using the Mobile or Forward+ renderers, set Viewport.UseDebanding to enable or disable the debanding feature of this Viewport. If Viewport.UseHdr2D is false, 2D rendering is not affected by debanding unless the Environment.BackgroundMode is Environment.BGMode.Canvas. If Viewport.UseHdr2D is true, debanding will only be applied if this is the root Viewport and will affect all 2D and 3D rendering, including canvas items. Viewport.UseDebanding has no effect when using the Compatibility rendering method. The Mobile renderer can also use material debanding, which can be set with RenderingServer.MaterialSetUseDebanding or configured with ProjectSettings.rendering/anti_aliasing/quality/use_debanding. See also ProjectSettings.rendering/anti_aliasing/quality/use_debanding, RenderingServer.MaterialSetUseDebanding, and RenderingServer.ViewportSetUseDebanding.

UseHdr2DProperty
# UseHdr2D
C#
public bool UseHdr2D { get; set; }

If true, 2D rendering will use a high dynamic range (HDR) RGBA16 format framebuffer. Additionally, 2D rendering will be performed on linear values and will be converted using the appropriate transfer function immediately before blitting to the screen (if the Viewport is attached to the screen). Practically speaking, this means that the end result of the Viewport will not be clamped to the 0-1 range and can be used in 3D rendering without color encoding adjustments. This allows 2D rendering to take advantage of effects requiring high dynamic range (e.g. 2D glow) as well as substantially improves the appearance of effects requiring highly detailed gradients.

UseOcclusionCullingProperty
# UseOcclusionCulling
C#
public bool UseOcclusionCulling { get; set; }

Enables fully occluded-object culling for this viewport when implemented. Requires an active OccluderInstance3D; an opaque MeshInstance3D wall alone does not automatically supply one. Verify render submission and image correctness, not just the boolean.

UseTaaProperty
# UseTaa
C#
public bool UseTaa { get; set; }

Temporal-AA request supported by current Forward+. Compatibility can report true without renderer effect. Static edges are verified after history accumulation; motion quality and ghosting are not. A temporal upscaler internally disables separate TAA.

UseXRProperty
# UseXR
C#
public bool UseXR { get; set; }

If true, the viewport will use the primary XR interface to render XR output. When applicable this can result in a stereoscopic image and the resulting render being output to a headset.

VrsModeProperty
# VrsMode
C#
public Viewport.VrsModeEnum VrsMode { get; set; }

The Variable Rate Shading (VRS) mode that is used for this viewport. Note, if hardware does not support VRS this property is ignored.

VrsTextureProperty
# VrsTexture
C#
public Texture2D VrsTexture { get; set; }

Texture to use when Viewport.VrsMode is set to Viewport.VrsTexture. The texture must use a lossless compression format so that colors can be matched precisely. The following VRS densities are mapped to various colors, with brighter colors representing a lower level of shading precision:

Text
- 1×1 = rgb(0, 0, 0)     - #000000
- 1×2 = rgb(0, 85, 0)    - #005500
- 2×1 = rgb(85, 0, 0)    - #550000
- 2×2 = rgb(85, 85, 0)   - #555500
- 2×4 = rgb(85, 170, 0)  - #55aa00
- 4×2 = rgb(170, 85, 0)  - #aa5500
- 4×4 = rgb(170, 170, 0) - #aaaa00
- 4×8 = rgb(170, 255, 0) - #aaff00 - Not supported on most hardware
- 8×4 = rgb(255, 170, 0) - #ffaa00 - Not supported on most hardware
- 8×8 = rgb(255, 255, 0) - #ffff00 - Not supported on most hardware
VrsUpdateModeProperty
# VrsUpdateMode
C#
public Viewport.VrsUpdateModeEnum VrsUpdateMode { get; set; }

Sets the update mode for Variable Rate Shading (VRS) for the viewport. VRS requires the input texture to be converted to the format usable by the VRS method supported by the hardware. The update mode defines how often this happens. If the GPU does not support VRS, or VRS is not enabled, this property is ignored.

World2DProperty
# World2D
C#
public World2D World2D { get; set; }

2D world resource. New viewports have separate World2D resources by default; assign one resource explicitly to share 2D content. A shared World2D does not merge camera selection or 3D worlds.

World3DProperty
# World3D
C#
public World3D World3D { get; set; }

Explicitly assigned 3D world for the viewport. The example gives a SubViewport a new World3D to isolate its camera and environment from the parent world. Use FindWorld3D to obtain the resolved world, which may also be found through viewport ancestors.

Methods130

FindWorld2DWorld2D
# FindWorld2D
C#
public World2D FindWorld2D();

Returns the viewport effective 2D world. New viewports have separate World2D resources by default; sharing content requires an explicit shared resource.

Returns World2D

World2D in use, not World3D or a scene resource.

FindWorld3DWorld3D
# FindWorld3D
C#
public World3D FindWorld3D();

Resolves an available World3D from this viewport and its viewport ancestors. This finds a usable world; it does not create an independent one. Assign SubViewport.World3D explicitly to isolate a separate camera; the accepted example uses new World3D().

Returns World3D

Effective World3D, or null if none is assigned and no parent world is available. Use it to inspect isolation and sharing.

GetAnisotropicFilteringLevelViewport.AnisotropicFiltering
# GetAnisotropicFilteringLevel
C#
public Viewport.AnisotropicFiltering GetAnisotropicFilteringLevel();
Returns Viewport.AnisotropicFiltering
GetAudioListener2DAudioListener2D
# GetAudioListener2D
C#
public AudioListener2D GetAudioListener2D();

Returns the currently active 2D audio listener. Returns null if there are no active 2D audio listeners, in which case the active 2D camera will be treated as listener.

Returns AudioListener2D
GetAudioListener3DAudioListener3D
# GetAudioListener3D
C#
public AudioListener3D GetAudioListener3D();

Returns the currently active 3D audio listener. Returns null if there are no active 3D audio listeners, in which case the active 3D camera will be treated as listener.

Returns AudioListener3D
GetCamera2DCamera2D
# GetCamera2D
C#
public Camera2D GetCamera2D();

Returns the currently active 2D camera. Returns null if there are no active cameras. Note: If called while the Camera Override system is active in editor, this will return the internally managed override camera. It is therefore advised to avoid caching the return value, or to check that the cached value is still a valid instance and is the current camera before use. See @GlobalScope.is_instance_valid and Camera2D.IsCurrent.

Returns Camera2D
GetCamera3DCamera3D
# GetCamera3D
C#
public Camera3D GetCamera3D();

Returns this viewport current 3D camera. Current-camera selection is independent of another viewport even with a shared World3D.

Returns Camera3D

Current Camera3D, or null if none is selected.

GetCanvasCullMaskuint
# GetCanvasCullMask
C#
public uint GetCanvasCullMask();
Returns uint
GetCanvasCullMaskBitbool
# GetCanvasCullMaskBit
C#
public bool GetCanvasCullMaskBit(uint layer);

Returns an individual bit on the rendering layer mask.

Parameters
NameTypeDefault
layeruint—
Returns bool
GetCanvasTransformTransform2D
# GetCanvasTransform
C#
public Transform2D GetCanvasTransform();
Returns Transform2D
GetDebugDrawViewport.DebugDrawEnum
# GetDebugDraw
C#
public Viewport.DebugDrawEnum GetDebugDraw();
Returns Viewport.DebugDrawEnum
GetDefaultCanvasItemTextureFilterViewport.DefaultCanvasItemTextureFilter
# GetDefaultCanvasItemTextureFilter
C#
public Viewport.DefaultCanvasItemTextureFilter GetDefaultCanvasItemTextureFilter();
Returns Viewport.DefaultCanvasItemTextureFilter
GetDefaultCanvasItemTextureRepeatViewport.DefaultCanvasItemTextureRepeat
# GetDefaultCanvasItemTextureRepeat
C#
public Viewport.DefaultCanvasItemTextureRepeat GetDefaultCanvasItemTextureRepeat();
Returns Viewport.DefaultCanvasItemTextureRepeat
GetDragThresholdint
# GetDragThreshold
C#
public int GetDragThreshold();
Returns int
GetEmbeddedSubwindowsReckfell.Collections.Array<Window>
# GetEmbeddedSubwindows
C#
public Reckfell.Collections.Array<Window> GetEmbeddedSubwindows();

Returns a list of the visible embedded Windows inside the viewport. Note: Windows inside other viewports will not be listed.

Returns Reckfell.Collections.Array<Window>
GetFinalTransformTransform2D
# GetFinalTransform
C#
public Transform2D GetFinalTransform();

Returns the transform from the viewport's coordinate system to the embedder's coordinate system.

Returns Transform2D
GetFsrSharpnessfloat
# GetFsrSharpness
C#
public float GetFsrSharpness();
Returns float
GetGlobalCanvasTransformTransform2D
# GetGlobalCanvasTransform
C#
public Transform2D GetGlobalCanvasTransform();
Returns Transform2D
GetMeshLodThresholdfloat
# GetMeshLodThreshold
C#
public float GetMeshLodThreshold();
Returns float
GetMousePositionVector2
# GetMousePosition
C#
public Vector2 GetMousePosition();

Returns the mouse's position in this Viewport using the coordinate system of this Viewport.

Returns Vector2
GetMsaa2DViewport.Msaa
# GetMsaa2D
C#
public Viewport.Msaa GetMsaa2D();

Reads the selected Msaa2D setting. This is not a renderer capability query or a pixel antialiasing measurement.

Returns Viewport.Msaa

Stored Viewport.Msaa value. It may read Msaa4X in Compatibility/OpenGL without changing rendered 2D edges.

GetMsaa3DViewport.Msaa
# GetMsaa3D
C#
public Viewport.Msaa GetMsaa3D();

Reads the Viewport requested MSAA level. Verify actual GPU output and device capabilities separately.

Returns Viewport.Msaa

Requested Msaa, not the measured sample count of the current GPU buffer. The example confirms Msaa4X through actual partial-coverage pixels.

GetOversamplingfloat
# GetOversampling
C#
public float GetOversampling();

Returns viewport oversampling factor.

Returns float
GetOversamplingOverridefloat
# GetOversamplingOverride
C#
public float GetOversamplingOverride();
Returns float
GetPhysicsObjectPickingbool
# GetPhysicsObjectPicking
C#
public bool GetPhysicsObjectPicking();
Returns bool
GetPhysicsObjectPickingFirstOnlybool
# GetPhysicsObjectPickingFirstOnly
C#
public bool GetPhysicsObjectPickingFirstOnly();
Returns bool
GetPhysicsObjectPickingSortbool
# GetPhysicsObjectPickingSort
C#
public bool GetPhysicsObjectPickingSort();
Returns bool
GetPositionalShadowAtlas16Bitsbool
# GetPositionalShadowAtlas16Bits
C#
public bool GetPositionalShadowAtlas16Bits();
Returns bool
GetPositionalShadowAtlasQuadrantSubdivViewport.PositionalShadowAtlasQuadrantSubdiv
# GetPositionalShadowAtlasQuadrantSubdiv
C#
public Viewport.PositionalShadowAtlasQuadrantSubdiv GetPositionalShadowAtlasQuadrantSubdiv(int quadrant);

Returns the positional shadow atlas quadrant subdivision of the specified quadrant.

Parameters
NameTypeDefault
quadrantint—
Returns Viewport.PositionalShadowAtlasQuadrantSubdiv
GetPositionalShadowAtlasSizeint
# GetPositionalShadowAtlasSize
C#
public int GetPositionalShadowAtlasSize();

Reads the Viewport stored atlas-size setting. Does not establish that a light casts shadows or that the GPU allocated exactly that buffer size.

Returns int

Requested atlas size in pixels. Verify output with a ShadowEnabled light and correct geometry; the native example compares the same light with shadows off/on.

GetRenderInfoint
# GetRenderInfo
C#
public int GetRenderInfo(Viewport.RenderInfoType type, Viewport.RenderInfo info);

Reads render statistics for the selected viewport/pass. Counters update per frame; compare stable configurations after updates. Not an FPS measurement, entity-tree count or whole-game cost.

Parameters
NameTypeDefault
typeViewport.RenderInfoType—
infoViewport.RenderInfo—
type

Pass, such as Visible for ordinary 3D rendering, Canvas for 2D or Shadow for shadows. Do not mix passes in one LOD comparison.

info

ObjectsInFrame, PrimitivesInFrame or DrawCallsInFrame. The sample triangle meshes count triangles as primitives; account for other primitive types in general.

Returns int

Latest available counter. The fixture reduces Visible Objects from 2 to 1 through occlusion while scene pixels below the HUD remain identical.

GetScaling3DModeViewport.Scaling3DModeEnum
# GetScaling3DMode
C#
public Viewport.Scaling3DModeEnum GetScaling3DMode();

Reads the Viewport object’s requested mode. Does not query the effective internal renderer algorithm after rejection or fallback.

Returns Viewport.Scaling3DModeEnum

Stored Scaling3DModeEnum. Compatibility can return Fsr2 while output remains bilinear or nearest according to the previous configuration.

GetScaling3DScalefloat
# GetScaling3DScale
C#
public float GetScaling3DScale();
Returns float
GetScreenSpaceAAViewport.ScreenSpaceAAEnum
# GetScreenSpaceAA
C#
public Viewport.ScreenSpaceAAEnum GetScreenSpaceAA();

Reads requested screen-space AA. The C# value does not prove renderer acceptance.

Returns Viewport.ScreenSpaceAAEnum

Viewport ScreenSpaceAAEnum. Verified Compatibility reads back Fxaa while output remains unchanged without FXAA.

GetScreenTransformTransform2D
# GetScreenTransform
C#
public Transform2D GetScreenTransform();

Returns the transform from the Viewport's coordinates to the screen coordinates of the containing window manager window.

Returns Transform2D
GetSdfOversizeViewport.SdfOversizeEnum
# GetSdfOversize
C#
public Viewport.SdfOversizeEnum GetSdfOversize();
Returns Viewport.SdfOversizeEnum
GetSdfScaleViewport.SdfScaleEnum
# GetSdfScale
C#
public Viewport.SdfScaleEnum GetSdfScale();
Returns Viewport.SdfScaleEnum
GetStretchTransformTransform2D
# GetStretchTransform
C#
public Transform2D GetStretchTransform();

Returns the automatically computed 2D stretch transform, taking the Viewport's stretch settings into account. The final value is multiplied by Window.ContentScaleFactor, but only for the root viewport. If this method is called on a SubViewport (e.g., in a scene tree with SubViewportContainer and SubViewport), the scale factor of the root window will not be applied. Using Transform2D.get_scale on the returned value, this can be used to compensate for scaling when zooming a Camera2D node, or to scale down a TextureRect to be pixel-perfect regardless of the automatically computed scale factor. Note: Due to how pixel scaling works, the returned transform's X and Y scale may differ slightly, even when Window.ContentScaleAspect is set to a mode that preserves the pixels' aspect ratio. If Window.ContentScaleAspect is Window.ContentScaleAspectEnum.Ignore, the X and Y scale may differ significantly.

Returns Transform2D
GetTextureViewportTexture
# GetTexture
C#
public ViewportTexture GetTexture();

Gets the viewport output texture, not the raw internal 3D buffer. Wait for a completed frame before readback; its dimensions do not prove internal resolution scale.

Returns ViewportTexture

ViewportTexture at output dimensions. The test retains 512×384 at 3D scales 0.5/1/2; a diagnostic spatial shader separately confirms internal dimensions.

GetTextureMipmapBiasfloat
# GetTextureMipmapBias
C#
public float GetTextureMipmapBias();
Returns float
GetViewportRidRid
# GetViewportRid
C#
public Rid GetViewportRid();

Returns the viewport's RID from the RenderingServer.

Returns Rid
GetVisibleRectRect2
# GetVisibleRect
C#
public Rect2 GetVisibleRect();

Returns the visible rectangle in global screen coordinates.

Returns Rect2
GetVrsModeViewport.VrsModeEnum
# GetVrsMode
C#
public Viewport.VrsModeEnum GetVrsMode();
Returns Viewport.VrsModeEnum
GetVrsTextureTexture2D
# GetVrsTexture
C#
public Texture2D GetVrsTexture();
Returns Texture2D
GetVrsUpdateModeViewport.VrsUpdateModeEnum
# GetVrsUpdateMode
C#
public Viewport.VrsUpdateModeEnum GetVrsUpdateMode();
Returns Viewport.VrsUpdateModeEnum
GetWorld2DWorld2D
# GetWorld2D
C#
public World2D GetWorld2D();

Returns the requested World2D value. 2D world resource. New viewports have separate World2D resources by default; assign one resource explicitly to share 2D content. A shared World2D does not merge camera selection or 3D worlds.

Returns World2D

Value of World2D; account for the documented distinction between a setting and its effective result.

GetWorld3DWorld3D
# GetWorld3D
C#
public World3D GetWorld3D();

Returns the requested World3D value. Explicitly assigned 3D world resource. May be null while the effective world is inherited from a parent; resolve it with FindWorld3D. OwnWorld3D can take precedence over this source. Not a scene hierarchy resource.

Returns World3D

Value of World3D; account for the documented distinction between a setting and its effective result.

GuiCancelDragvoid
# GuiCancelDrag
C#
public void GuiCancelDrag();

Cancels the drag operation that was previously started through Control._GetDragData or forced with Control.ForceDrag.

GuiGetDragDataVariant
# GuiGetDragData
C#
public Variant GuiGetDragData();

Returns the drag data from the GUI, that was previously returned by Control._GetDragData.

Returns Variant
GuiGetDragDescriptionstring
# GuiGetDragDescription
C#
public string GuiGetDragDescription();

Returns the human-readable description of the drag data, used for assistive apps.

Returns string
GuiGetFocusOwnerControl
# GuiGetFocusOwner
C#
public Control GuiGetFocusOwner();

Returns the currently focused Control within this viewport. If no Control is focused, returns null.

Returns Control
GuiGetHoveredControlControl
# GuiGetHoveredControl
C#
public Control GuiGetHoveredControl();

Returns the Control that the mouse is currently hovering over in this viewport. If no Control has the cursor, returns null. Typically the leaf Control node or deepest level of the subtree which claims hover. This is very useful when used together with Entity.IsAncestorOf to find if the mouse is within a control tree.

Returns Control
GuiIsDragSuccessfulbool
# GuiIsDragSuccessful
C#
public bool GuiIsDragSuccessful();

Returns true if the drag operation is successful.

Returns bool
GuiIsDraggingbool
# GuiIsDragging
C#
public bool GuiIsDragging();

Returns true if a drag operation is currently ongoing and where the drop action could happen in this viewport. Alternative to Entity.NotificationDragBegin and Entity.NotificationDragEnd when you prefer polling the value.

Returns bool
GuiReleaseFocusvoid
# GuiReleaseFocus
C#
public void GuiReleaseFocus();

Removes the focus from the currently focused Control within this viewport. If no Control has the focus, does nothing.

GuiSetDragDescriptionvoid
# GuiSetDragDescription
C#
public void GuiSetDragDescription(string description);

Sets the human-readable description of the drag data to description, used for assistive apps.

Parameters
NameTypeDefault
descriptionstring—
HasTransparentBackgroundbool
# HasTransparentBackground
C#
public bool HasTransparentBackground();
Returns bool
Is3DDisabledbool
# Is3DDisabled
C#
public bool Is3DDisabled();
Returns bool
IsAudioListener2Dbool
# IsAudioListener2D
C#
public bool IsAudioListener2D();
Returns bool
IsAudioListener3Dbool
# IsAudioListener3D
C#
public bool IsAudioListener3D();
Returns bool
IsEmbeddingSubwindowsbool
# IsEmbeddingSubwindows
C#
public bool IsEmbeddingSubwindows();
Returns bool
IsHandlingInputLocallybool
# IsHandlingInputLocally
C#
public bool IsHandlingInputLocally();
Returns bool
IsInputDisabledbool
# IsInputDisabled
C#
public bool IsInputDisabled();

Returns the requested GuiDisableInput value. Disables the viewport input entry path. Despite the property name, PushInput stops before _Input and GUI, not only for interface controls. Does not disable rendering or _Process.

Returns bool

Value of GuiDisableInput; account for the documented distinction between a setting and its effective result.

IsInputHandledbool
# IsInputHandled
C#
public bool IsInputHandled();

Checks whether the current event is handled in the active input pipeline. With HandleInputLocally=false, state can resolve through the parent viewport; this is not a history of previous events.

Returns bool

True if the current event is handled; false if it is not yet handled.

IsSnap2DTransformsToPixelEnabledbool
# IsSnap2DTransformsToPixelEnabled
C#
public bool IsSnap2DTransformsToPixelEnabled();
Returns bool
IsSnap2DVerticesToPixelEnabledbool
# IsSnap2DVerticesToPixelEnabled
C#
public bool IsSnap2DVerticesToPixelEnabled();
Returns bool
IsSnapControlsToPixelsEnabledbool
# IsSnapControlsToPixelsEnabled
C#
public bool IsSnapControlsToPixelsEnabled();
Returns bool
IsUsingDebandingbool
# IsUsingDebanding
C#
public bool IsUsingDebanding();
Returns bool
IsUsingHdr2Dbool
# IsUsingHdr2D
C#
public bool IsUsingHdr2D();
Returns bool
IsUsingOcclusionCullingbool
# IsUsingOcclusionCulling
C#
public bool IsUsingOcclusionCulling();
Returns bool
IsUsingOversamplingbool
# IsUsingOversampling
C#
public bool IsUsingOversampling();
Returns bool
IsUsingOwnWorld3Dbool
# IsUsingOwnWorld3D
C#
public bool IsUsingOwnWorld3D();

Returns the requested OwnWorld3D value. Uses an owned effective 3D world instead of the assigned/inherited world. May duplicate an assigned World3D resource; the World3D property and FindWorld3D then differ. Does not clone Entities. Disabling restores the assigned/inherited world.

Returns bool

Value of OwnWorld3D; account for the documented distinction between a setting and its effective result.

IsUsingTaabool
# IsUsingTaa
C#
public bool IsUsingTaa();
Returns bool
IsUsingXRbool
# IsUsingXR
C#
public bool IsUsingXR();
Returns bool
NotifyMouseEnteredvoid
# NotifyMouseEntered
C#
public void NotifyMouseEntered();

Inform the Viewport that the mouse has entered its area. Use this function before sending an InputEventMouseButton or InputEventMouseMotion to the Viewport with Viewport.PushInput. See also Viewport.NotifyMouseExited. Note: In most cases, it is not necessary to call this function because SubViewport nodes that are children of SubViewportContainer are notified automatically. This is only necessary when interacting with viewports in non-default ways, for example as textures in TextureRect or with an Area3D that forwards input events.

NotifyMouseExitedvoid
# NotifyMouseExited
C#
public void NotifyMouseExited();

Inform the Viewport that the mouse has left its area. Use this function when the node that displays the viewport notices the mouse has left the area of the displayed viewport. See also Viewport.NotifyMouseEntered. Note: In most cases, it is not necessary to call this function because SubViewport nodes that are children of SubViewportContainer are notified automatically. This is only necessary when interacting with viewports in non-default ways, for example as textures in TextureRect or with an Area3D that forwards input events.

PushInputvoid
# PushInput
C#
public void PushInput(InputEvent @event, bool inLocalCoords = false);

Pushes an event through the viewport input pipeline: _Input, GUI and unhandled stages until consumed. The viewport must be in the tree; GuiDisableInput blocks this entry. For a texture on a mesh, the caller performs UV/screen-coordinate mapping.

Parameters
NameTypeDefault
eventInputEvent—
inLocalCoordsboolfalse
event

Non-null InputEvent to forward; for pointer events account for the displayed texture rectangle, bars, cropping and scale.

inLocalCoords

True if positions are already local to the target viewport. False applies the engine screen-to-local transform, not an arbitrary mesh UV mapping.

PushTextInputvoid
# PushTextInput
C#
public void PushTextInput(string text);

Helper method which calls the set_text() method on the currently focused Control, provided that it is defined (e.g. if the focused Control is Button or LineEdit).

Parameters
NameTypeDefault
textstring—
PushUnhandledInputvoid · Deprecated
# PushUnhandledInput
C#
public void PushUnhandledInput(InputEvent @event, bool inLocalCoords = false);

Triggers the given event in this Viewport. This can be used to pass an InputEvent between viewports, or to locally apply inputs that were sent over the network or saved to a file. If in_local_coords is false, the event's position is in the embedder's coordinates and will be converted to viewport coordinates. If in_local_coords is true, the event's position is in viewport coordinates. Calling this method will propagate calls to child nodes for following methods in the given order:

Parameters
NameTypeDefault
eventInputEvent—
inLocalCoordsboolfalse
SetAnisotropicFilteringLevelvoid
# SetAnisotropicFilteringLevel
C#
public void SetAnisotropicFilteringLevel(Viewport.AnisotropicFiltering anisotropicFilteringLevel);
Parameters
NameTypeDefault
anisotropicFilteringLevelViewport.AnisotropicFiltering—
SetAsAudioListener2Dvoid
# SetAsAudioListener2D
C#
public void SetAsAudioListener2D(bool enable);
Parameters
NameTypeDefault
enablebool—
SetAsAudioListener3Dvoid
# SetAsAudioListener3D
C#
public void SetAsAudioListener3D(bool enable);
Parameters
NameTypeDefault
enablebool—
SetCanvasCullMaskvoid
# SetCanvasCullMask
C#
public void SetCanvasCullMask(uint mask);
Parameters
NameTypeDefault
maskuint—
SetCanvasCullMaskBitvoid
# SetCanvasCullMaskBit
C#
public void SetCanvasCullMaskBit(uint layer, bool enable);

Set/clear individual bits on the rendering layer mask. This simplifies editing this Viewport's layers.

Parameters
NameTypeDefault
layeruint—
enablebool—
SetCanvasTransformvoid
# SetCanvasTransform
C#
public void SetCanvasTransform(Transform2D xform);
Parameters
NameTypeDefault
xformTransform2D—
SetDebugDrawvoid
# SetDebugDraw
C#
public void SetDebugDraw(Viewport.DebugDrawEnum debugDraw);
Parameters
NameTypeDefault
debugDrawViewport.DebugDrawEnum—
SetDefaultCanvasItemTextureFiltervoid
# SetDefaultCanvasItemTextureFilter
C#
public void SetDefaultCanvasItemTextureFilter(Viewport.DefaultCanvasItemTextureFilter mode);
Parameters
NameTypeDefault
modeViewport.DefaultCanvasItemTextureFilter—
SetDefaultCanvasItemTextureRepeatvoid
# SetDefaultCanvasItemTextureRepeat
C#
public void SetDefaultCanvasItemTextureRepeat(Viewport.DefaultCanvasItemTextureRepeat mode);
Parameters
NameTypeDefault
modeViewport.DefaultCanvasItemTextureRepeat—
SetDisable3Dvoid
# SetDisable3D
C#
public void SetDisable3D(bool disable);
Parameters
NameTypeDefault
disablebool—
SetDisableInputvoid
# SetDisableInput
C#
public void SetDisableInput(bool disable);

Sets GuiDisableInput. Disables the viewport input entry path. Despite the property name, PushInput stops before _Input and GUI, not only for interface controls. Does not disable rendering or _Process.

Parameters
NameTypeDefault
disablebool—
disable

Disables the viewport input entry path. Despite the property name, PushInput stops before _Input and GUI, not only for interface controls. Does not disable rendering or _Process.

SetDragThresholdvoid
# SetDragThreshold
C#
public void SetDragThreshold(int threshold);
Parameters
NameTypeDefault
thresholdint—
SetEmbeddingSubwindowsvoid
# SetEmbeddingSubwindows
C#
public void SetEmbeddingSubwindows(bool enable);
Parameters
NameTypeDefault
enablebool—
SetFsrSharpnessvoid
# SetFsrSharpness
C#
public void SetFsrSharpness(float fsrSharpness);
Parameters
NameTypeDefault
fsrSharpnessfloat—
SetGlobalCanvasTransformvoid
# SetGlobalCanvasTransform
C#
public void SetGlobalCanvasTransform(Transform2D xform);
Parameters
NameTypeDefault
xformTransform2D—
SetHandleInputLocallyvoid
# SetHandleInputLocally
C#
public void SetHandleInputLocally(bool enable);
Parameters
NameTypeDefault
enablebool—
SetInputAsHandledvoid
# SetInputAsHandled
C#
public void SetInputAsHandled();

Marks the current event handled so later unhandled stages of this pipeline do not run. Does not undo handlers that already ran. Account for HandleInputLocally and the parent viewport.

SetMeshLodThresholdvoid
# SetMeshLodThreshold
C#
public void SetMeshLodThreshold(float pixels);
Parameters
NameTypeDefault
pixelsfloat—
SetMsaa2Dvoid
# SetMsaa2D
C#
public void SetMsaa2D(Viewport.Msaa msaa);

Sets this Viewport Msaa2D. An accepted setting does not prove renderer support: Compatibility/OpenGL in the verified build reports that it is unsupported. Forward+/Vulkan was used for the positive Msaa4X check.

Parameters
NameTypeDefault
msaaViewport.Msaa—
msaa

Viewport.Msaa value for 2D. Disabled turns MSAA off; Msaa2X/Msaa4X/Msaa8X request the corresponding renderer mode. Verify support and cost for the selected backend and device.

SetMsaa3Dvoid
# SetMsaa3D
C#
public void SetMsaa3D(Viewport.Msaa msaa);
Parameters
NameTypeDefault
msaaViewport.Msaa—
SetOversamplingOverridevoid
# SetOversamplingOverride
C#
public void SetOversamplingOverride(float oversampling);
Parameters
NameTypeDefault
oversamplingfloat—
SetPhysicsObjectPickingvoid
# SetPhysicsObjectPicking
C#
public void SetPhysicsObjectPicking(bool enable);
Parameters
NameTypeDefault
enablebool—
SetPhysicsObjectPickingFirstOnlyvoid
# SetPhysicsObjectPickingFirstOnly
C#
public void SetPhysicsObjectPickingFirstOnly(bool enable);
Parameters
NameTypeDefault
enablebool—
SetPhysicsObjectPickingSortvoid
# SetPhysicsObjectPickingSort
C#
public void SetPhysicsObjectPickingSort(bool enable);
Parameters
NameTypeDefault
enablebool—
SetPositionalShadowAtlas16Bitsvoid
# SetPositionalShadowAtlas16Bits
C#
public void SetPositionalShadowAtlas16Bits(bool enable);
Parameters
NameTypeDefault
enablebool—
SetPositionalShadowAtlasQuadrantSubdivvoid
# SetPositionalShadowAtlasQuadrantSubdiv
C#
public void SetPositionalShadowAtlasQuadrantSubdiv(int quadrant, Viewport.PositionalShadowAtlasQuadrantSubdiv subdiv);

Sets the number of subdivisions to use in the specified quadrant. A higher number of subdivisions allows you to have more shadows in the scene at once, but reduces the quality of the shadows. A good practice is to have quadrants with a varying number of subdivisions and to have as few subdivisions as possible.

Parameters
NameTypeDefault
quadrantint—
subdivViewport.PositionalShadowAtlasQuadrantSubdiv—
SetPositionalShadowAtlasSizevoid
# SetPositionalShadowAtlasSize
C#
public void SetPositionalShadowAtlasSize(int size);

Sets shared positional-shadow atlas size. Zero disables it; larger values can improve available detail but cost resources and do not fix LightCullMask, CastShadow or an incorrectly positioned light.

Parameters
NameTypeDefault
sizeint—
size

Nonnegative pixel size. Use a power of two such as 1024 for a predictable setup; backend can normalize it. Do not treat the value as an exact measurement of allocated GPU buffers.

SetScaling3DModevoid
# SetScaling3DMode
C#
public void SetScaling3DMode(Viewport.Scaling3DModeEnum scaling3DMode);

Requests a scaling algorithm. The current renderer setter can reject unsupported FSR without changing its previous mode, while the C# object stores the new request. Check availability before updating the game UI.

Parameters
NameTypeDefault
scaling3DModeViewport.Scaling3DModeEnum—
scaling3DMode

Scaling3DModeEnum value. Use Bilinear above scale 1; source falls back internally from FSR/MetalFX/Nearest to bilinear for downsampling.

SetScaling3DScalevoid
# SetScaling3DScale
C#
public void SetScaling3DScale(float scale);

Sets internal 3D render scale, not window size or canvas scale. Renderer updates subsequently reconfigure buffers; do not read a frame before updates complete.

Parameters
NameTypeDefault
scalefloat—
scale

Finite value. Values below 0.1 or above 2 are clamped. 0.5 halves each axis and roughly quarters internal pixels, without guaranteeing four times the FPS.

SetScreenSpaceAAvoid
# SetScreenSpaceAA
C#
public void SetScreenSpaceAA(Viewport.ScreenSpaceAAEnum screenSpaceAA);

Selects screen-space AA for this viewport. Current Compatibility accepts Disabled but rejects FXAA/SMAA. Both methods produce real geometric-edge changes in Forward+/Vulkan.

Parameters
NameTypeDefault
screenSpaceAAViewport.ScreenSpaceAAEnum—
screenSpaceAA

Disabled, Fxaa or Smaa. Not an MSAA sample count or resolution-scaling mode.

SetSdfOversizevoid
# SetSdfOversize
C#
public void SetSdfOversize(Viewport.SdfOversizeEnum oversize);
Parameters
NameTypeDefault
oversizeViewport.SdfOversizeEnum—
SetSdfScalevoid
# SetSdfScale
C#
public void SetSdfScale(Viewport.SdfScaleEnum scale);
Parameters
NameTypeDefault
scaleViewport.SdfScaleEnum—
SetSnap2DTransformsToPixelvoid
# SetSnap2DTransformsToPixel
C#
public void SetSnap2DTransformsToPixel(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetSnap2DVerticesToPixelvoid
# SetSnap2DVerticesToPixel
C#
public void SetSnap2DVerticesToPixel(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetSnapControlsToPixelsvoid
# SetSnapControlsToPixels
C#
public void SetSnapControlsToPixels(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetTextureMipmapBiasvoid
# SetTextureMipmapBias
C#
public void SetTextureMipmapBias(float textureMipmapBias);
Parameters
NameTypeDefault
textureMipmapBiasfloat—
SetTransparentBackgroundvoid
# SetTransparentBackground
C#
public void SetTransparentBackground(bool enable);
Parameters
NameTypeDefault
enablebool—
SetUseDebandingvoid
# SetUseDebanding
C#
public void SetUseDebanding(bool enable);
Parameters
NameTypeDefault
enablebool—
SetUseHdr2Dvoid
# SetUseHdr2D
C#
public void SetUseHdr2D(bool enable);
Parameters
NameTypeDefault
enablebool—
SetUseOcclusionCullingvoid
# SetUseOcclusionCulling
C#
public void SetUseOcclusionCulling(bool enable);
Parameters
NameTypeDefault
enablebool—
SetUseOversamplingvoid
# SetUseOversampling
C#
public void SetUseOversampling(bool enable);
Parameters
NameTypeDefault
enablebool—
SetUseOwnWorld3Dvoid
# SetUseOwnWorld3D
C#
public void SetUseOwnWorld3D(bool enable);

Sets OwnWorld3D. Uses an owned effective 3D world instead of the assigned/inherited world. May duplicate an assigned World3D resource; the World3D property and FindWorld3D then differ. Does not clone Entities. Disabling restores the assigned/inherited world.

Parameters
NameTypeDefault
enablebool—
enable

Uses an owned effective 3D world instead of the assigned/inherited world. May duplicate an assigned World3D resource; the World3D property and FindWorld3D then differ. Does not clone Entities. Disabling restores the assigned/inherited world.

SetUseTaavoid
# SetUseTaa
C#
public void SetUseTaa(bool enable);

Requests TAA. Current renderer applies it only in Forward+; the C# getter can retain true after rejection elsewhere. FSR2 uses its own temporal reconstruction rather than separate TAA on top.

Parameters
NameTypeDefault
enablebool—
enable

true requests TAA; false disables it. The example only sets this in Forward+ and does not promise ghosting-free motion.

SetUseXRvoid
# SetUseXR
C#
public void SetUseXR(bool use);
Parameters
NameTypeDefault
usebool—
SetVrsModevoid
# SetVrsMode
C#
public void SetVrsMode(Viewport.VrsModeEnum mode);
Parameters
NameTypeDefault
modeViewport.VrsModeEnum—
SetVrsTexturevoid
# SetVrsTexture
C#
public void SetVrsTexture(Texture2D texture);
Parameters
NameTypeDefault
textureTexture2D—
SetVrsUpdateModevoid
# SetVrsUpdateMode
C#
public void SetVrsUpdateMode(Viewport.VrsUpdateModeEnum mode);
Parameters
NameTypeDefault
modeViewport.VrsUpdateModeEnum—
SetWorld2Dvoid
# SetWorld2D
C#
public void SetWorld2D(World2D world2D);

Sets World2D. 2D world resource. New viewports have separate World2D resources by default; assign one resource explicitly to share 2D content. A shared World2D does not merge camera selection or 3D worlds.

Parameters
NameTypeDefault
world2DWorld2D—
world2D

2D world resource. New viewports have separate World2D resources by default; assign one resource explicitly to share 2D content. A shared World2D does not merge camera selection or 3D worlds.

SetWorld3Dvoid
# SetWorld3D
C#
public void SetWorld3D(World3D world3D);

Sets World3D. Explicitly assigned 3D world resource. May be null while the effective world is inherited from a parent; resolve it with FindWorld3D. OwnWorld3D can take precedence over this source. Not a scene hierarchy resource.

Parameters
NameTypeDefault
world3DWorld3D—
world3D

Explicitly assigned 3D world resource. May be null while the effective world is inherited from a parent; resolve it with FindWorld3D. OwnWorld3D can take precedence over this source. Not a scene hierarchy resource.

UpdateMouseCursorStatevoid
# UpdateMouseCursorState
C#
public void UpdateMouseCursorState();

Force instantly updating the display based on the current mouse cursor position. This includes updating the mouse cursor shape and sending necessary Control.MouseEntered, CollisionObject2D.MouseEntered, CollisionObject3D.MouseEntered and Window.MouseEntered signals and their respective mouse_exited counterparts.

WarpMousevoid
# WarpMouse
C#
public void WarpMouse(Vector2 position);

Moves the mouse pointer to the specified position in this Viewport using the coordinate system of this Viewport. Note: Viewport.WarpMouse is only supported on Windows, macOS and Linux. It has no effect on Android, iOS and Web.

Parameters
NameTypeDefault
positionVector2—

Signals and events2

GuiFocusChangedEvent
# GuiFocusChanged
C#
public event Viewport.GuiFocusChangedEventHandler GuiFocusChanged;

Emitted when a Control node grabs keyboard focus. Note: A Control node losing focus doesn't cause this signal to be emitted.

Handler parameters
NameTypeDefault
nodeControl—
SizeChangedEvent
# SizeChanged
C#
public event Action SizeChanged;

Emitted when the size of the viewport is changed, whether by resizing of window, or some other means.

Viewport.AnisotropicFiltering

ValueDescription
Anisotropy16X = 4

Use 16× anisotropic filtering.

Anisotropy2X = 1

Use 2× anisotropic filtering.

Anisotropy4X = 2

Use 4× anisotropic filtering. This is the default value.

Anisotropy8X = 3

Use 8× anisotropic filtering.

Disabled = 0

Anisotropic filtering is disabled.

Max = 5

Represents the size of the Viewport.AnisotropicFiltering enum.

Viewport.DebugDrawEnum

ValueDescription
AreaLightAtlas = 28

Draws the atlas used by AreaLight3D nodes in the upper left quadrant of the Viewport. Note: Only supported when using the Forward+ or Mobile rendering method.

ClusterAreaLights = 27

Draws the cluster used by AreaLight3D nodes to optimize light rendering. Note: Only supported when using the Forward+ rendering method.

ClusterDecals = 22

Draws the cluster used by Decal nodes to optimize decal rendering. Note: Only supported when using the Forward+ rendering method.

ClusterOmniLights = 20

Draws the cluster used by OmniLight3D nodes to optimize light rendering. Note: Only supported when using the Forward+ rendering method.

ClusterReflectionProbes = 23

Draws the cluster used by ReflectionProbe nodes to optimize reflection probes. Note: Only supported when using the Forward+ rendering method.

ClusterSpotLights = 21

Draws the cluster used by SpotLight3D nodes to optimize light rendering. Note: Only supported when using the Forward+ rendering method.

DecalAtlas = 15

Draws the decal atlas used by Decals and light projector textures in the upper left quadrant of the Viewport. Note: Only supported when using the Forward+ or Mobile rendering methods.

DirectionalShadowAtlas = 10

Draws the shadow atlas that stores shadows from DirectionalLight3Ds in the upper left quadrant of the Viewport.

DisableLod = 19

Draws all of the objects at their highest polycount regardless of their distance from the camera. No low level of detail (LOD) is applied.

Disabled = 0

Objects are displayed normally.

GIBuffer = 18

Draws the buffer used for global illumination from VoxelGI or SDFGI. Requires VoxelGI (at least one visible baked VoxelGI node) or SDFGI (Environment.SdfgiEnabled) to be enabled to have a visible effect. Note: Only supported when using the Forward+ rendering method.

InternalBuffer = 26

Draws the internal resolution buffer of the scene in linear colorspace before tonemapping or post-processing is applied. Note: Only supported when using the Forward+ or Mobile rendering methods.

Lighting = 2

Objects are displayed without textures and only with lighting information. Note: When using this debug draw mode, custom shaders are ignored since all materials in the scene temporarily use a debug material. This means the result from custom shader functions (such as vertex displacement) won't be visible anymore when using this debug draw mode.

MotionVectors = 25

Draws vector lines over the viewport to indicate the movement of pixels between frames. Note: Only supported when using the Forward+ rendering method.

NormalBuffer = 5

Objects are displayed without lighting information and their textures replaced by normal mapping. Note: Only supported when using the Forward+ rendering method.

Occluders = 24

Draws the buffer used for occlusion culling. Note: Only supported when using the Forward+ or Mobile rendering methods.

Overdraw = 3

Objects are displayed semi-transparent with additive blending so you can see where they are drawing over top of one another. A higher overdraw means you are wasting performance on drawing pixels that are being hidden behind others. Note: When using this debug draw mode, custom shaders are ignored since all materials in the scene temporarily use a debug material. This means the result from custom shader functions (such as vertex displacement) won't be visible anymore when using this debug draw mode.

PssmSplits = 14

Colors each PSSM split for the DirectionalLight3Ds in the scene a different color so you can see where the splits are. In order (from closest to furthest from the camera), they are colored red, green, blue, and yellow. Note: When using this debug draw mode, custom shaders are ignored since all materials in the scene temporarily use a debug material. This means the result from custom shader functions (such as vertex displacement) won't be visible anymore when using this debug draw mode. Note: Only supported when using the Forward+ or Mobile rendering methods.

SceneLuminance = 11

Draws the scene luminance buffer (if available) in the upper left quadrant of the Viewport. Note: Only supported when using the Forward+ or Mobile rendering methods.

Sdfgi = 16

Draws the cascades used to render signed distance field global illumination (SDFGI). Does nothing if the current environment's Environment.SdfgiEnabled is false. Note: Only supported when using the Forward+ rendering method.

SdfgiProbes = 17

Draws the probes used for signed distance field global illumination (SDFGI). When in the editor, left-clicking a probe will display additional bright dots that show its occlusion information. A white dot means the light is not occluded at all at the dot's position, while a red dot means the light is fully occluded. Intermediate values are possible. Does nothing if the current environment's Environment.SdfgiEnabled is false. Note: Only supported when using the Forward+ rendering method.

ShadowAtlas = 9

Draws the shadow atlas that stores shadows from OmniLight3Ds and SpotLight3Ds in the upper left quadrant of the Viewport.

Ssao = 12

Draws the screen-space ambient occlusion texture instead of the scene so that you can clearly see how it is affecting objects. In order for this display mode to work, you must have Environment.SsaoEnabled set in your WorldEnvironment. Note: Only supported when using the Forward+ rendering method.

Ssil = 13

Draws the screen-space indirect lighting texture instead of the scene so that you can clearly see how it is affecting objects. In order for this display mode to work, you must have Environment.SsilEnabled set in your WorldEnvironment. Note: Only supported when using the Forward+ rendering method.

Unshaded = 1

Objects are displayed without light information.

VoxelGIAlbedo = 6

Objects are displayed with only the albedo value from VoxelGIs. Requires at least one visible VoxelGI node that has been baked to have a visible effect. Note: Only supported when using the Forward+ rendering method.

VoxelGIEmission = 8

Objects are displayed with only the emission color from VoxelGIs. Requires at least one visible VoxelGI node that has been baked to have a visible effect. Note: Only supported when using the Forward+ rendering method.

VoxelGILighting = 7

Objects are displayed with only the lighting value from VoxelGIs. Requires at least one visible VoxelGI node that has been baked to have a visible effect. Note: Only supported when using the Forward+ rendering method.

Wireframe = 4

Objects are displayed as wireframe models. Note: RenderingServer.SetDebugGenerateWireframes must be called before loading any meshes for wireframes to be visible when using the Compatibility renderer. Note: In the Compatibility renderer, backfaces are always visible when using wireframe rendering. In the Forward+ and Mobile renderers, wireframes follow the material's backface culling properties instead.

Viewport.DefaultCanvasItemTextureFilter

ValueDescription
Linear = 1

The texture filter blends between the nearest 4 pixels. This makes the texture look smooth from up close, and grainy from a distance (due to mipmaps not being sampled).

LinearWithMipmaps = 2

The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps (or uses the nearest mipmap if ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter is true). This makes the texture look smooth from up close, and smooth from a distance. Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to Camera2D zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels.

Max = 5

Represents the size of the Viewport.DefaultCanvasItemTextureFilter enum.

Nearest = 0

The texture filter reads from the nearest pixel only. This makes the texture look pixelated from up close, and grainy from a distance (due to mipmaps not being sampled).

NearestWithMipmaps = 3

The texture filter reads from the nearest pixel and blends between the nearest 2 mipmaps (or uses the nearest mipmap if ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter is true). This makes the texture look pixelated from up close, and smooth from a distance. Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to Camera2D zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels.

ParentNode = 4

The Viewport will inherit the filter from its parent CanvasItem or Viewport.

Viewport.DefaultCanvasItemTextureRepeat

ValueDescription
Disabled = 0

Disables textures repeating. Instead, when reading UVs outside the 0-1 range, the value will be clamped to the edge of the texture, resulting in a stretched out look at the borders of the texture.

Enabled = 1

Enables the texture to repeat when UV coordinates are outside the 0-1 range. If using one of the linear filtering modes, this can result in artifacts at the edges of a texture when the sampler filters across the edges of the texture.

Max = 4

Represents the size of the Viewport.DefaultCanvasItemTextureRepeat enum.

Mirror = 2

Flip the texture when repeating so that the edge lines up instead of abruptly changing.

ParentNode = 3

The Viewport will inherit the repeat mode from its parent CanvasItem or Viewport.

Viewport.Msaa

ValueDescription
Disabled = 0

Multisample antialiasing mode disabled. This is the default value, and is also the fastest setting.

Max = 4

Represents the size of the Viewport.Msaa enum.

Msaa2X = 1

Use 2× Multisample Antialiasing. This has a moderate performance cost. It helps reduce aliasing noticeably, but 4× MSAA still looks substantially better.

Msaa4X = 2

Use 4× Multisample Antialiasing. This has a significant performance cost, and is generally a good compromise between performance and quality.

Msaa8X = 3

Use 8× Multisample Antialiasing. This has a very high performance cost. The difference between 4× and 8× MSAA may not always be visible in real gameplay conditions. Likely unsupported on low-end and older hardware.

Viewport.PositionalShadowAtlasQuadrantSubdiv

ValueDescription
Disabled = 0

This quadrant will not be used.

Max = 7

Represents the size of the Viewport.PositionalShadowAtlasQuadrantSubdiv enum.

Subdiv1 = 1

This quadrant will only be used by one shadow map.

Subdiv1024 = 6

This quadrant will be split 1024 ways and used by up to 1024 shadow maps. Unless the Viewport.PositionalShadowAtlasSize is very high, the shadows in this quadrant will be very low resolution.

Subdiv16 = 3

This quadrant will be split 16 ways and used by up to 16 shadow maps.

Subdiv256 = 5

This quadrant will be split 256 ways and used by up to 256 shadow maps. Unless the Viewport.PositionalShadowAtlasSize is very high, the shadows in this quadrant will be very low resolution.

Subdiv4 = 2

This quadrant will be split in 4 and used by up to 4 shadow maps.

Subdiv64 = 4

This quadrant will be split 64 ways and used by up to 64 shadow maps.

Viewport.RenderInfo

ValueDescription
DrawCallsInFrame = 2

Amount of draw calls in frame.

Max = 3

Represents the size of the Viewport.RenderInfo enum.

ObjectsInFrame = 0

Amount of objects in frame.

PrimitivesInFrame = 1

Amount of vertices in frame.

Viewport.RenderInfoType

ValueDescription
Canvas = 2

Canvas item rendering. This includes all 2D rendering.

Max = 3

Represents the size of the Viewport.RenderInfoType enum.

Shadow = 1

Shadow render pass. Objects will be rendered several times depending on the number of amounts of lights with shadows and the number of directional shadow splits.

Visible = 0

Visible render pass (excluding shadows).

Viewport.Scaling3DModeEnum

ValueDescription
Bilinear = 0

Use bilinear scaling for the viewport's 3D buffer. The amount of scaling can be set using Viewport.Scaling3DScale. Values less than 1.0 will result in undersampling while values greater than 1.0 will result in supersampling. A value of 1.0 disables scaling.

Fsr = 1

Use AMD FidelityFX Super Resolution 1.0 upscaling for the viewport's 3D buffer. The amount of scaling can be set using Viewport.Scaling3DScale. Values less than 1.0 will result in the viewport being upscaled using FSR. Values greater than 1.0 are not supported and bilinear downsampling will be used instead. A value of 1.0 disables scaling.

Fsr2 = 2

Use AMD FidelityFX Super Resolution 2.2 upscaling for the viewport's 3D buffer. The amount of scaling can be set using Viewport.Scaling3DScale. Values less than 1.0 will result in the viewport being upscaled using FSR2. Values greater than 1.0 are not supported and bilinear downsampling will be used instead. A value of 1.0 will use FSR2 at native resolution as a TAA solution.

Max = 6

Represents the size of the Viewport.Scaling3DModeEnum enum.

MetalfxSpatial = 3

Use the MetalFX spatial upscaler for the viewport's 3D buffer. The amount of scaling can be set using Viewport.Scaling3DScale. Values less than 1.0 will result in the viewport being upscaled using MetalFX. Values greater than 1.0 are not supported and bilinear downsampling will be used instead. A value of 1.0 disables scaling. More information: MetalFX(https://developer.apple.com/documentation/metalfx). Note: Only supported when the Metal rendering driver is in use, which limits this scaling mode to macOS and iOS.

MetalfxTemporal = 4

Use the MetalFX temporal upscaler for the viewport's 3D buffer. The amount of scaling can be set using Viewport.Scaling3DScale. To determine the minimum input scale, use the RenderingDevice.LimitGet method with RenderingDevice.Limit.MetalfxTemporalScalerMinScale. Values less than 1.0 will result in the viewport being upscaled using MetalFX. Values greater than 1.0 are not supported and bilinear downsampling will be used instead. A value of 1.0 will use MetalFX at native resolution as a TAA solution. More information: MetalFX(https://developer.apple.com/documentation/metalfx). Note: Only supported when the Metal rendering driver is in use, which limits this scaling mode to macOS and iOS.

Nearest = 5

Use nearest-neighbor filtering for the viewport's 3D buffer. This looks crisper than Viewport.Scaling3DModeEnum.Bilinear and has no additional rendering cost. The amount of scaling can be set using Viewport.Scaling3DScale. Values greater than 1.0 are not supported and bilinear downsampling will be used instead. A value of 1.0 disables scaling. Note: When using the Nearest scaling mode, to avoid uneven pixel scaling, it's highly recommended to use a value equal to an integer divisor with a dividend of 1. For example, it's best to use a scale of 0.5 (1/2), 0.3333 (1/3), 0.25 (1/4), 0.2 (1/5), and so on.

Viewport.ScreenSpaceAAEnum

ValueDescription
Disabled = 0

Do not perform any antialiasing in the full screen post-process.

Fxaa = 1

Use 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.

Max = 3

Represents the size of the Viewport.ScreenSpaceAAEnum enum.

Smaa = 2

Use subpixel morphological antialiasing. SMAA may produce clearer results than FXAA, but at a slightly higher performance cost.

Viewport.SdfOversizeEnum

ValueDescription
Max = 4

Represents the size of the Viewport.SdfOversizeEnum enum.

Oversize100Percent = 0

The signed distance field only covers the viewport's own rectangle.

Oversize120Percent = 1

The signed distance field is expanded to cover 20% of the viewport's size around the borders.

Oversize150Percent = 2

The signed distance field is expanded to cover 50% of the viewport's size around the borders.

Oversize200Percent = 3

The signed distance field is expanded to cover 100% (double) of the viewport's size around the borders.

Viewport.SdfScaleEnum

ValueDescription
Max = 3

Represents the size of the Viewport.SdfScaleEnum enum.

Scale100Percent = 0

The signed distance field is rendered at full resolution.

Scale25Percent = 2

The signed distance field is rendered at a quarter the resolution of this viewport.

Scale50Percent = 1

The signed distance field is rendered at half the resolution of this viewport.

Viewport.VrsModeEnum

ValueDescription
Disabled = 0

Variable Rate Shading is disabled.

Max = 3

Represents the size of the Viewport.VrsModeEnum enum.

Texture = 1

Variable Rate Shading uses a texture. Note, for stereoscopic use a texture atlas with a texture for each view.

XR = 2

Variable Rate Shading's texture is supplied by the primary XRInterface.

Viewport.VrsUpdateModeEnum

ValueDescription
Always = 2

The input texture for variable rate shading will be processed each frame.

Disabled = 0

The input texture for variable rate shading will not be processed.

Max = 3

Represents the size of the Viewport.VrsUpdateModeEnum enum.

Once = 1

The input texture for variable rate shading will be processed once.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.