Viewport
Abstract base class for viewports. Encapsulates drawing and interaction with a game world.
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
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
public bool AudioListenerEnable2D { get; set; }If true, the viewport will process 2D audio streams.
AudioListenerEnable3DProperty
public bool AudioListenerEnable3D { get; set; }If true, the viewport will process 3D audio streams.
CanvasCullMaskProperty
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
public Viewport.DefaultCanvasItemTextureFilter CanvasItemDefaultTextureFilter { get; set; }The default filter mode used by CanvasItem nodes in this viewport.
CanvasItemDefaultTextureRepeatProperty
public Viewport.DefaultCanvasItemTextureRepeat CanvasItemDefaultTextureRepeat { get; set; }The default repeat mode used by CanvasItem nodes in this viewport.
CanvasTransformProperty
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
public Viewport.DebugDrawEnum DebugDraw { get; set; }The overlay mode for test rendered geometry in debug purposes.
Disable3DProperty
public bool Disable3D { get; set; }Disable 3D rendering (but keep 2D rendering).
FsrSharpnessProperty
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
public Transform2D GlobalCanvasTransform { get; set; }The global canvas transform of the viewport. The canvas transform is relative to this.
GuiDisableInputProperty
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
public int GuiDragThreshold { get; set; }The minimum distance the mouse cursor must move while pressed before a drag operation begins.
GuiEmbedSubwindowsProperty
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
public bool GuiSnapControlsToPixels { get; set; }If true, the GUI controls on the viewport will lay pixel perfectly.
HandleInputLocallyProperty
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
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
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.
Msaa3DProperty
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
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
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
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
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
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
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
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
public Viewport.PositionalShadowAtlasQuadrantSubdiv PositionalShadowAtlasQuad0 { get; set; }The subdivision amount of the first quadrant on the shadow atlas.
PositionalShadowAtlasQuad1Property
public Viewport.PositionalShadowAtlasQuadrantSubdiv PositionalShadowAtlasQuad1 { get; set; }The subdivision amount of the second quadrant on the shadow atlas.
PositionalShadowAtlasQuad2Property
public Viewport.PositionalShadowAtlasQuadrantSubdiv PositionalShadowAtlasQuad2 { get; set; }The subdivision amount of the third quadrant on the shadow atlas.
PositionalShadowAtlasQuad3Property
public Viewport.PositionalShadowAtlasQuadrantSubdiv PositionalShadowAtlasQuad3 { get; set; }The subdivision amount of the fourth quadrant on the shadow atlas.
PositionalShadowAtlasSizeProperty
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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:
- 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 hardwareVrsUpdateModeProperty
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
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
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
public World2D FindWorld2D();Returns the viewport effective 2D world. New viewports have separate World2D resources by default; sharing content requires an explicit shared resource.
World2DWorld2D in use, not World3D or a scene resource.
FindWorld3DWorld3D
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().
World3DEffective World3D, or null if none is assigned and no parent world is available. Use it to inspect isolation and sharing.
GetAnisotropicFilteringLevelViewport.AnisotropicFiltering
public Viewport.AnisotropicFiltering GetAnisotropicFilteringLevel();Viewport.AnisotropicFilteringGetAudioListener2DAudioListener2D
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.
AudioListener2DGetAudioListener3DAudioListener3D
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.
AudioListener3DGetCamera2DCamera2D
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.
Camera2DGetCamera3DCamera3D
public Camera3D GetCamera3D();Returns this viewport current 3D camera. Current-camera selection is independent of another viewport even with a shared World3D.
Camera3DCurrent Camera3D, or null if none is selected.
GetCanvasCullMaskuint
public uint GetCanvasCullMask();uintGetCanvasCullMaskBitbool
public bool GetCanvasCullMaskBit(uint layer);Returns an individual bit on the rendering layer mask.
| Name | Type | Default |
|---|---|---|
layer | uint | — |
boolGetCanvasTransformTransform2D
public Transform2D GetCanvasTransform();Transform2DGetDebugDrawViewport.DebugDrawEnum
public Viewport.DebugDrawEnum GetDebugDraw();Viewport.DebugDrawEnumGetDefaultCanvasItemTextureFilterViewport.DefaultCanvasItemTextureFilter
public Viewport.DefaultCanvasItemTextureFilter GetDefaultCanvasItemTextureFilter();Viewport.DefaultCanvasItemTextureFilterGetDefaultCanvasItemTextureRepeatViewport.DefaultCanvasItemTextureRepeat
public Viewport.DefaultCanvasItemTextureRepeat GetDefaultCanvasItemTextureRepeat();Viewport.DefaultCanvasItemTextureRepeatGetDragThresholdint
public int GetDragThreshold();intGetEmbeddedSubwindowsReckfell.Collections.Array<Window>
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.
Reckfell.Collections.Array<Window>GetFinalTransformTransform2D
public Transform2D GetFinalTransform();Returns the transform from the viewport's coordinate system to the embedder's coordinate system.
Transform2DGetFsrSharpnessfloat
public float GetFsrSharpness();floatGetGlobalCanvasTransformTransform2D
public Transform2D GetGlobalCanvasTransform();Transform2DGetMeshLodThresholdfloat
public float GetMeshLodThreshold();floatGetMousePositionVector2
public Vector2 GetMousePosition();Returns the mouse's position in this Viewport using the coordinate system of this Viewport.
Vector2GetMsaa2DViewport.Msaa
public Viewport.Msaa GetMsaa2D();Reads the selected Msaa2D setting. This is not a renderer capability query or a pixel antialiasing measurement.
Viewport.MsaaStored Viewport.Msaa value. It may read Msaa4X in Compatibility/OpenGL without changing rendered 2D edges.
GetMsaa3DViewport.Msaa
public Viewport.Msaa GetMsaa3D();Reads the Viewport requested MSAA level. Verify actual GPU output and device capabilities separately.
Viewport.MsaaRequested Msaa, not the measured sample count of the current GPU buffer. The example confirms Msaa4X through actual partial-coverage pixels.
GetOversamplingfloat
public float GetOversampling();Returns viewport oversampling factor.
floatGetOversamplingOverridefloat
public float GetOversamplingOverride();floatGetPhysicsObjectPickingbool
public bool GetPhysicsObjectPicking();boolGetPhysicsObjectPickingFirstOnlybool
public bool GetPhysicsObjectPickingFirstOnly();boolGetPhysicsObjectPickingSortbool
public bool GetPhysicsObjectPickingSort();boolGetPositionalShadowAtlas16Bitsbool
public bool GetPositionalShadowAtlas16Bits();boolGetPositionalShadowAtlasQuadrantSubdivViewport.PositionalShadowAtlasQuadrantSubdiv
public Viewport.PositionalShadowAtlasQuadrantSubdiv GetPositionalShadowAtlasQuadrantSubdiv(int quadrant);Returns the positional shadow atlas quadrant subdivision of the specified quadrant.
| Name | Type | Default |
|---|---|---|
quadrant | int | — |
Viewport.PositionalShadowAtlasQuadrantSubdivGetPositionalShadowAtlasSizeint
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.
intRequested 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
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.
| Name | Type | Default |
|---|---|---|
type | Viewport.RenderInfoType | — |
info | Viewport.RenderInfo | — |
typePass, such as Visible for ordinary 3D rendering, Canvas for 2D or Shadow for shadows. Do not mix passes in one LOD comparison.
infoObjectsInFrame, PrimitivesInFrame or DrawCallsInFrame. The sample triangle meshes count triangles as primitives; account for other primitive types in general.
intLatest available counter. The fixture reduces Visible Objects from 2 to 1 through occlusion while scene pixels below the HUD remain identical.
GetScaling3DModeViewport.Scaling3DModeEnum
public Viewport.Scaling3DModeEnum GetScaling3DMode();Reads the Viewport object’s requested mode. Does not query the effective internal renderer algorithm after rejection or fallback.
Viewport.Scaling3DModeEnumStored Scaling3DModeEnum. Compatibility can return Fsr2 while output remains bilinear or nearest according to the previous configuration.
GetScaling3DScalefloat
public float GetScaling3DScale();floatGetScreenSpaceAAViewport.ScreenSpaceAAEnum
public Viewport.ScreenSpaceAAEnum GetScreenSpaceAA();Reads requested screen-space AA. The C# value does not prove renderer acceptance.
Viewport.ScreenSpaceAAEnumViewport ScreenSpaceAAEnum. Verified Compatibility reads back Fxaa while output remains unchanged without FXAA.
GetScreenTransformTransform2D
public Transform2D GetScreenTransform();Returns the transform from the Viewport's coordinates to the screen coordinates of the containing window manager window.
Transform2DGetSdfOversizeViewport.SdfOversizeEnum
public Viewport.SdfOversizeEnum GetSdfOversize();Viewport.SdfOversizeEnumGetSdfScaleViewport.SdfScaleEnum
public Viewport.SdfScaleEnum GetSdfScale();Viewport.SdfScaleEnumGetStretchTransformTransform2D
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.
Transform2DGetTextureViewportTexture
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.
ViewportTextureViewportTexture at output dimensions. The test retains 512×384 at 3D scales 0.5/1/2; a diagnostic spatial shader separately confirms internal dimensions.
GetTextureMipmapBiasfloat
public float GetTextureMipmapBias();floatGetViewportRidRid
public Rid GetViewportRid();Returns the viewport's RID from the RenderingServer.
RidGetVisibleRectRect2
public Rect2 GetVisibleRect();Returns the visible rectangle in global screen coordinates.
Rect2GetVrsModeViewport.VrsModeEnum
public Viewport.VrsModeEnum GetVrsMode();Viewport.VrsModeEnumGetVrsTextureTexture2D
public Texture2D GetVrsTexture();Texture2DGetVrsUpdateModeViewport.VrsUpdateModeEnum
public Viewport.VrsUpdateModeEnum GetVrsUpdateMode();Viewport.VrsUpdateModeEnumGetWorld2DWorld2D
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.
World2DValue of World2D; account for the documented distinction between a setting and its effective result.
GetWorld3DWorld3D
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.
World3DValue of World3D; account for the documented distinction between a setting and its effective result.
GuiCancelDragvoid
public void GuiCancelDrag();Cancels the drag operation that was previously started through Control._GetDragData or forced with Control.ForceDrag.
GuiGetDragDataVariant
public Variant GuiGetDragData();Returns the drag data from the GUI, that was previously returned by Control._GetDragData.
VariantGuiGetDragDescriptionstring
public string GuiGetDragDescription();Returns the human-readable description of the drag data, used for assistive apps.
stringGuiGetFocusOwnerControl
public Control GuiGetFocusOwner();Returns the currently focused Control within this viewport. If no Control is focused, returns null.
ControlGuiGetHoveredControlControl
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.
ControlGuiIsDragSuccessfulbool
public bool GuiIsDragSuccessful();Returns true if the drag operation is successful.
boolGuiIsDraggingbool
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.
boolGuiReleaseFocusvoid
public void GuiReleaseFocus();Removes the focus from the currently focused Control within this viewport. If no Control has the focus, does nothing.
GuiSetDragDescriptionvoid
public void GuiSetDragDescription(string description);Sets the human-readable description of the drag data to description, used for assistive apps.
| Name | Type | Default |
|---|---|---|
description | string | — |
HasTransparentBackgroundbool
public bool HasTransparentBackground();boolIs3DDisabledbool
public bool Is3DDisabled();boolIsAudioListener2Dbool
public bool IsAudioListener2D();boolIsAudioListener3Dbool
public bool IsAudioListener3D();boolIsEmbeddingSubwindowsbool
public bool IsEmbeddingSubwindows();boolIsHandlingInputLocallybool
public bool IsHandlingInputLocally();boolIsInputDisabledbool
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.
boolValue of GuiDisableInput; account for the documented distinction between a setting and its effective result.
IsInputHandledbool
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.
boolTrue if the current event is handled; false if it is not yet handled.
IsSnap2DTransformsToPixelEnabledbool
public bool IsSnap2DTransformsToPixelEnabled();boolIsSnap2DVerticesToPixelEnabledbool
public bool IsSnap2DVerticesToPixelEnabled();boolIsSnapControlsToPixelsEnabledbool
public bool IsSnapControlsToPixelsEnabled();boolIsUsingDebandingbool
public bool IsUsingDebanding();boolIsUsingHdr2Dbool
public bool IsUsingHdr2D();boolIsUsingOcclusionCullingbool
public bool IsUsingOcclusionCulling();boolIsUsingOversamplingbool
public bool IsUsingOversampling();boolIsUsingOwnWorld3Dbool
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.
boolValue of OwnWorld3D; account for the documented distinction between a setting and its effective result.
IsUsingTaabool
public bool IsUsingTaa();boolIsUsingXRbool
public bool IsUsingXR();boolNotifyMouseEnteredvoid
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
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
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.
| Name | Type | Default |
|---|---|---|
event | InputEvent | — |
inLocalCoords | bool | false |
eventNon-null InputEvent to forward; for pointer events account for the displayed texture rectangle, bars, cropping and scale.
inLocalCoordsTrue if positions are already local to the target viewport. False applies the engine screen-to-local transform, not an arbitrary mesh UV mapping.
PushTextInputvoid
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).
| Name | Type | Default |
|---|---|---|
text | string | — |
PushUnhandledInputvoid · Deprecated
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:
Entity._ShortcutInputEntity._UnhandledKeyInputEntity._UnhandledInputIf an earlier method marks the input as handled viaViewport.SetInputAsHandled, any later method in this list will not be called. If none of the methods handle the event andViewport.PhysicsObjectPickingistrue, the event is used for physics object picking. Note: This method doesn't propagate input events to embeddedWindows orSubViewports.
| Name | Type | Default |
|---|---|---|
event | InputEvent | — |
inLocalCoords | bool | false |
SetAnisotropicFilteringLevelvoid
public void SetAnisotropicFilteringLevel(Viewport.AnisotropicFiltering anisotropicFilteringLevel);| Name | Type | Default |
|---|---|---|
anisotropicFilteringLevel | Viewport.AnisotropicFiltering | — |
SetAsAudioListener2Dvoid
public void SetAsAudioListener2D(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |
SetAsAudioListener3Dvoid
public void SetAsAudioListener3D(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |
SetCanvasCullMaskvoid
public void SetCanvasCullMask(uint mask);| Name | Type | Default |
|---|---|---|
mask | uint | — |
SetCanvasCullMaskBitvoid
public void SetCanvasCullMaskBit(uint layer, bool enable);Set/clear individual bits on the rendering layer mask. This simplifies editing this Viewport's layers.
| Name | Type | Default |
|---|---|---|
layer | uint | — |
enable | bool | — |
SetCanvasTransformvoid
public void SetCanvasTransform(Transform2D xform);| Name | Type | Default |
|---|---|---|
xform | Transform2D | — |
SetDebugDrawvoid
public void SetDebugDraw(Viewport.DebugDrawEnum debugDraw);| Name | Type | Default |
|---|---|---|
debugDraw | Viewport.DebugDrawEnum | — |
SetDefaultCanvasItemTextureFiltervoid
public void SetDefaultCanvasItemTextureFilter(Viewport.DefaultCanvasItemTextureFilter mode);| Name | Type | Default |
|---|---|---|
mode | Viewport.DefaultCanvasItemTextureFilter | — |
SetDefaultCanvasItemTextureRepeatvoid
public void SetDefaultCanvasItemTextureRepeat(Viewport.DefaultCanvasItemTextureRepeat mode);| Name | Type | Default |
|---|---|---|
mode | Viewport.DefaultCanvasItemTextureRepeat | — |
SetDisable3Dvoid
public void SetDisable3D(bool disable);| Name | Type | Default |
|---|---|---|
disable | bool | — |
SetDisableInputvoid
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.
| Name | Type | Default |
|---|---|---|
disable | bool | — |
disableDisables 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
public void SetDragThreshold(int threshold);| Name | Type | Default |
|---|---|---|
threshold | int | — |
SetEmbeddingSubwindowsvoid
public void SetEmbeddingSubwindows(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |
SetFsrSharpnessvoid
public void SetFsrSharpness(float fsrSharpness);| Name | Type | Default |
|---|---|---|
fsrSharpness | float | — |
SetGlobalCanvasTransformvoid
public void SetGlobalCanvasTransform(Transform2D xform);| Name | Type | Default |
|---|---|---|
xform | Transform2D | — |
SetHandleInputLocallyvoid
public void SetHandleInputLocally(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |
SetInputAsHandledvoid
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
public void SetMeshLodThreshold(float pixels);| Name | Type | Default |
|---|---|---|
pixels | float | — |
SetMsaa2Dvoid
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.
| Name | Type | Default |
|---|---|---|
msaa | Viewport.Msaa | — |
msaaViewport.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
public void SetMsaa3D(Viewport.Msaa msaa);| Name | Type | Default |
|---|---|---|
msaa | Viewport.Msaa | — |
SetOversamplingOverridevoid
public void SetOversamplingOverride(float oversampling);| Name | Type | Default |
|---|---|---|
oversampling | float | — |
SetPhysicsObjectPickingvoid
public void SetPhysicsObjectPicking(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |
SetPhysicsObjectPickingFirstOnlyvoid
public void SetPhysicsObjectPickingFirstOnly(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |
SetPhysicsObjectPickingSortvoid
public void SetPhysicsObjectPickingSort(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |
SetPositionalShadowAtlas16Bitsvoid
public void SetPositionalShadowAtlas16Bits(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |
SetPositionalShadowAtlasQuadrantSubdivvoid
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.
| Name | Type | Default |
|---|---|---|
quadrant | int | — |
subdiv | Viewport.PositionalShadowAtlasQuadrantSubdiv | — |
SetPositionalShadowAtlasSizevoid
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.
| Name | Type | Default |
|---|---|---|
size | int | — |
sizeNonnegative 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
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.
| Name | Type | Default |
|---|---|---|
scaling3DMode | Viewport.Scaling3DModeEnum | — |
scaling3DModeScaling3DModeEnum value. Use Bilinear above scale 1; source falls back internally from FSR/MetalFX/Nearest to bilinear for downsampling.
SetScaling3DScalevoid
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.
| Name | Type | Default |
|---|---|---|
scale | float | — |
scaleFinite 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
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.
| Name | Type | Default |
|---|---|---|
screenSpaceAA | Viewport.ScreenSpaceAAEnum | — |
screenSpaceAADisabled, Fxaa or Smaa. Not an MSAA sample count or resolution-scaling mode.
SetSdfOversizevoid
public void SetSdfOversize(Viewport.SdfOversizeEnum oversize);| Name | Type | Default |
|---|---|---|
oversize | Viewport.SdfOversizeEnum | — |
SetSdfScalevoid
public void SetSdfScale(Viewport.SdfScaleEnum scale);| Name | Type | Default |
|---|---|---|
scale | Viewport.SdfScaleEnum | — |
SetSnap2DTransformsToPixelvoid
public void SetSnap2DTransformsToPixel(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
SetSnap2DVerticesToPixelvoid
public void SetSnap2DVerticesToPixel(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
SetSnapControlsToPixelsvoid
public void SetSnapControlsToPixels(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
SetTextureMipmapBiasvoid
public void SetTextureMipmapBias(float textureMipmapBias);| Name | Type | Default |
|---|---|---|
textureMipmapBias | float | — |
SetTransparentBackgroundvoid
public void SetTransparentBackground(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |
SetUseDebandingvoid
public void SetUseDebanding(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |
SetUseHdr2Dvoid
public void SetUseHdr2D(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |
SetUseOcclusionCullingvoid
public void SetUseOcclusionCulling(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |
SetUseOversamplingvoid
public void SetUseOversampling(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |
SetUseOwnWorld3Dvoid
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.
| Name | Type | Default |
|---|---|---|
enable | bool | — |
enableUses 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
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.
| Name | Type | Default |
|---|---|---|
enable | bool | — |
enabletrue requests TAA; false disables it. The example only sets this in Forward+ and does not promise ghosting-free motion.
SetUseXRvoid
public void SetUseXR(bool use);| Name | Type | Default |
|---|---|---|
use | bool | — |
SetVrsModevoid
public void SetVrsMode(Viewport.VrsModeEnum mode);| Name | Type | Default |
|---|---|---|
mode | Viewport.VrsModeEnum | — |
SetVrsTexturevoid
public void SetVrsTexture(Texture2D texture);| Name | Type | Default |
|---|---|---|
texture | Texture2D | — |
SetVrsUpdateModevoid
public void SetVrsUpdateMode(Viewport.VrsUpdateModeEnum mode);| Name | Type | Default |
|---|---|---|
mode | Viewport.VrsUpdateModeEnum | — |
SetWorld2Dvoid
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.
| Name | Type | Default |
|---|---|---|
world2D | World2D | — |
world2D2D 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
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.
| Name | Type | Default |
|---|---|---|
world3D | World3D | — |
world3DExplicitly 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
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
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.
| Name | Type | Default |
|---|---|---|
position | Vector2 | — |
Signals and events2
GuiFocusChangedEvent
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.
| Name | Type | Default |
|---|---|---|
node | Control | — |
SizeChangedEvent
public event Action SizeChanged;Emitted when the size of the viewport is changed, whether by resizing of window, or some other means.
Viewport.AnisotropicFiltering
| Value | Description |
|---|---|
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.DebugDrawEnum
| Value | Description |
|---|---|
AreaLightAtlas = 28 | Draws the atlas used by |
ClusterAreaLights = 27 | Draws the cluster used by |
ClusterDecals = 22 | Draws the cluster used by |
ClusterOmniLights = 20 | Draws the cluster used by |
ClusterReflectionProbes = 23 | Draws the cluster used by |
ClusterSpotLights = 21 | Draws the cluster used by |
DecalAtlas = 15 | Draws the decal atlas used by |
DirectionalShadowAtlas = 10 | Draws the shadow atlas that stores shadows from |
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 |
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 |
SceneLuminance = 11 | Draws the scene luminance buffer (if available) in the upper left quadrant of the |
Sdfgi = 16 | Draws the cascades used to render signed distance field global illumination (SDFGI).
Does nothing if the current environment's |
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 |
ShadowAtlas = 9 | Draws the shadow atlas that stores shadows from |
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 |
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 |
Unshaded = 1 | Objects are displayed without light information. |
VoxelGIAlbedo = 6 | Objects are displayed with only the albedo value from |
VoxelGIEmission = 8 | Objects are displayed with only the emission color from |
VoxelGILighting = 7 | Objects are displayed with only the lighting value from |
Wireframe = 4 | Objects are displayed as wireframe models.
Note: |
Viewport.DefaultCanvasItemTextureFilter
| Value | Description |
|---|---|
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 |
Max = 5 | Represents the size of the |
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 |
ParentNode = 4 | The |
Viewport.DefaultCanvasItemTextureRepeat
| Value | Description |
|---|---|
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 |
Mirror = 2 | Flip the texture when repeating so that the edge lines up instead of abruptly changing. |
ParentNode = 3 | The |
Viewport.Msaa
| Value | Description |
|---|---|
Disabled = 0 | Multisample antialiasing mode disabled. This is the default value, and is also the fastest setting. |
Max = 4 | Represents the size of the |
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
| Value | Description |
|---|---|
Disabled = 0 | This quadrant will not be used. |
Max = 7 | Represents the size of the |
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 |
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 |
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
| Value | Description |
|---|---|
DrawCallsInFrame = 2 | Amount of draw calls in frame. |
Max = 3 | Represents the size of the |
ObjectsInFrame = 0 | Amount of objects in frame. |
PrimitivesInFrame = 1 | Amount of vertices in frame. |
Viewport.RenderInfoType
| Value | Description |
|---|---|
Canvas = 2 | Canvas item rendering. This includes all 2D rendering. |
Max = 3 | Represents the size of the |
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
| Value | Description |
|---|---|
Bilinear = 0 | Use bilinear scaling for the viewport's 3D buffer. The amount of scaling can be set using |
Fsr = 1 | Use AMD FidelityFX Super Resolution 1.0 upscaling for the viewport's 3D buffer. The amount of scaling can be set using |
Fsr2 = 2 | Use AMD FidelityFX Super Resolution 2.2 upscaling for the viewport's 3D buffer. The amount of scaling can be set using |
Max = 6 | Represents the size of the |
MetalfxSpatial = 3 | Use the MetalFX spatial upscaler for the viewport's 3D buffer.
The amount of scaling can be set using |
MetalfxTemporal = 4 | Use the MetalFX temporal upscaler for the viewport's 3D buffer.
The amount of scaling can be set using |
Nearest = 5 | Use nearest-neighbor filtering for the viewport's 3D buffer. This looks crisper than |
Viewport.ScreenSpaceAAEnum
| Value | Description |
|---|---|
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 |
Smaa = 2 | Use subpixel morphological antialiasing. SMAA may produce clearer results than FXAA, but at a slightly higher performance cost. |
Viewport.SdfOversizeEnum
| Value | Description |
|---|---|
Max = 4 | Represents the size of the |
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
| Value | Description |
|---|---|
Max = 3 | Represents the size of the |
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
| Value | Description |
|---|---|
Disabled = 0 | Variable Rate Shading is disabled. |
Max = 3 | Represents the size of the |
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 |
Viewport.VrsUpdateModeEnum
| Value | Description |
|---|---|
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 |
Once = 1 | The input texture for variable rate shading will be processed once. |