Viewport

package
v0.0.0-...-7325ca5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2025 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Package Viewport provides methods for working with Viewport object instances.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsViewport() Instance
}

type DebugDraw

type DebugDraw = gdclass.ViewportDebugDraw //gd:Viewport.DebugDraw
const (
	/*Objects are displayed normally.*/
	DebugDrawDisabled DebugDraw = 0
	/*Objects are displayed without light information.*/
	DebugDrawUnshaded DebugDraw = 1
	/*Objects are displayed without textures and only with lighting information.*/
	DebugDrawLighting DebugDraw = 2
	/*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.*/
	DebugDrawOverdraw DebugDraw = 3
	/*Objects are displayed as wireframe models.*/
	DebugDrawWireframe DebugDraw = 4
	/*Objects are displayed without lighting information and their textures replaced by normal mapping.*/
	DebugDrawNormalBuffer DebugDraw = 5
	/*Objects are displayed with only the albedo value from [VoxelGI]s.*/
	DebugDrawVoxelGiAlbedo DebugDraw = 6
	/*Objects are displayed with only the lighting value from [VoxelGI]s.*/
	DebugDrawVoxelGiLighting DebugDraw = 7
	/*Objects are displayed with only the emission color from [VoxelGI]s.*/
	DebugDrawVoxelGiEmission DebugDraw = 8
	/*Draws the shadow atlas that stores shadows from [OmniLight3D]s and [SpotLight3D]s in the upper left quadrant of the [Viewport].*/
	DebugDrawShadowAtlas DebugDraw = 9
	/*Draws the shadow atlas that stores shadows from [DirectionalLight3D]s in the upper left quadrant of the [Viewport].*/
	DebugDrawDirectionalShadowAtlas DebugDraw = 10
	/*Draws the scene luminance buffer (if available) in the upper left quadrant of the [Viewport].*/
	DebugDrawSceneLuminance DebugDraw = 11
	/*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 [member Environment.ssao_enabled] set in your [WorldEnvironment].*/
	DebugDrawSsao DebugDraw = 12
	/*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 [member Environment.ssil_enabled] set in your [WorldEnvironment].*/
	DebugDrawSsil DebugDraw = 13
	/*Colors each PSSM split for the [DirectionalLight3D]s in the scene a different color so you can see where the splits are. In order, they will be colored red, green, blue, and yellow.*/
	DebugDrawPssmSplits DebugDraw = 14
	/*Draws the decal atlas used by [Decal]s and light projector textures in the upper left quadrant of the [Viewport].*/
	DebugDrawDecalAtlas DebugDraw = 15
	/*Draws the cascades used to render signed distance field global illumination (SDFGI).
	  Does nothing if the current environment's [member Environment.sdfgi_enabled] is [code]false[/code] or SDFGI is not supported on the platform.*/
	DebugDrawSdfgi DebugDraw = 16
	/*Draws the probes used for signed distance field global illumination (SDFGI).
	  Does nothing if the current environment's [member Environment.sdfgi_enabled] is [code]false[/code] or SDFGI is not supported on the platform.*/
	DebugDrawSdfgiProbes DebugDraw = 17
	/*Draws the buffer used for global illumination (GI).*/
	DebugDrawGiBuffer DebugDraw = 18
	/*Draws all of the objects at their highest polycount, without low level of detail (LOD).*/
	DebugDrawDisableLod DebugDraw = 19
	/*Draws the cluster used by [OmniLight3D] nodes to optimize light rendering.*/
	DebugDrawClusterOmniLights DebugDraw = 20
	/*Draws the cluster used by [SpotLight3D] nodes to optimize light rendering.*/
	DebugDrawClusterSpotLights DebugDraw = 21
	/*Draws the cluster used by [Decal] nodes to optimize decal rendering.*/
	DebugDrawClusterDecals DebugDraw = 22
	/*Draws the cluster used by [ReflectionProbe] nodes to optimize decal rendering.*/
	DebugDrawClusterReflectionProbes DebugDraw = 23
	/*Draws the buffer used for occlusion culling.*/
	DebugDrawOccluders DebugDraw = 24
	/*Draws vector lines over the viewport to indicate the movement of pixels between frames.*/
	DebugDrawMotionVectors DebugDraw = 25
	/*Draws the internal resolution buffer of the scene before post-processing is applied.*/
	DebugDrawInternalBuffer DebugDraw = 26
)

type DefaultCanvasItemTextureFilter

type DefaultCanvasItemTextureFilter = gdclass.ViewportDefaultCanvasItemTextureFilter //gd:Viewport.DefaultCanvasItemTextureFilter
const (
	/*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).*/
	DefaultCanvasItemTextureFilterNearest DefaultCanvasItemTextureFilter = 0
	/*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).*/
	DefaultCanvasItemTextureFilterLinear DefaultCanvasItemTextureFilter = 1
	/*The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is [code]true[/code]). 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.*/
	DefaultCanvasItemTextureFilterLinearWithMipmaps DefaultCanvasItemTextureFilter = 2
	/*The texture filter reads from the nearest pixel and blends between the nearest 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is [code]true[/code]). 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.*/
	DefaultCanvasItemTextureFilterNearestWithMipmaps DefaultCanvasItemTextureFilter = 3
	/*Represents the size of the [enum DefaultCanvasItemTextureFilter] enum.*/
	DefaultCanvasItemTextureFilterMax DefaultCanvasItemTextureFilter = 4
)

type DefaultCanvasItemTextureRepeat

type DefaultCanvasItemTextureRepeat = gdclass.ViewportDefaultCanvasItemTextureRepeat //gd:Viewport.DefaultCanvasItemTextureRepeat
const (
	/*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.*/
	DefaultCanvasItemTextureRepeatDisabled DefaultCanvasItemTextureRepeat = 0
	/*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.*/
	DefaultCanvasItemTextureRepeatEnabled DefaultCanvasItemTextureRepeat = 1
	/*Flip the texture when repeating so that the edge lines up instead of abruptly changing.*/
	DefaultCanvasItemTextureRepeatMirror DefaultCanvasItemTextureRepeat = 2
	/*Represents the size of the [enum DefaultCanvasItemTextureRepeat] enum.*/
	DefaultCanvasItemTextureRepeatMax DefaultCanvasItemTextureRepeat = 3
)

type Instance

type Instance [1]gdclass.Viewport

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.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsViewport

func (self Instance) AsViewport() Instance

func (Instance) AudioListenerEnable2d

func (self Instance) AudioListenerEnable2d() bool

func (Instance) AudioListenerEnable3d

func (self Instance) AudioListenerEnable3d() bool

func (Instance) CanvasCullMask

func (self Instance) CanvasCullMask() int

func (Instance) CanvasItemDefaultTextureFilter

func (self Instance) CanvasItemDefaultTextureFilter() gdclass.ViewportDefaultCanvasItemTextureFilter

func (Instance) CanvasItemDefaultTextureRepeat

func (self Instance) CanvasItemDefaultTextureRepeat() gdclass.ViewportDefaultCanvasItemTextureRepeat

func (Instance) CanvasTransform

func (self Instance) CanvasTransform() Transform2D.OriginXY

func (Instance) DebugDraw

func (self Instance) DebugDraw() gdclass.ViewportDebugDraw

func (Instance) Disable3d

func (self Instance) Disable3d() bool

func (Instance) FindWorld2d

func (self Instance) FindWorld2d() [1]gdclass.World2D

Returns the first valid [World2D] for this viewport, searching the [member world_2d] property of itself and any Viewport ancestor.

func (Instance) FindWorld3d

func (self Instance) FindWorld3d() [1]gdclass.World3D

Returns the first valid [World3D] for this viewport, searching the [member world_3d] property of itself and any Viewport ancestor.

func (Instance) FsrSharpness

func (self Instance) FsrSharpness() Float.X

func (Instance) GetCamera2d

func (self Instance) GetCamera2d() [1]gdclass.Camera2D

Returns the currently active 2D camera. Returns null if there are no active cameras.

func (Instance) GetCamera3d

func (self Instance) GetCamera3d() [1]gdclass.Camera3D

Returns the currently active 3D camera.

func (Instance) GetCanvasCullMaskBit

func (self Instance) GetCanvasCullMaskBit(layer int) bool

Returns an individual bit on the rendering layer mask.

func (Instance) GetEmbeddedSubwindows

func (self Instance) GetEmbeddedSubwindows() [][1]gdclass.Window

Returns a list of the visible embedded [Window]s inside the viewport. [b]Note:[/b] [Window]s inside other viewports will not be listed.

func (Instance) GetFinalTransform

func (self Instance) GetFinalTransform() Transform2D.OriginXY

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

func (Instance) GetMousePosition

func (self Instance) GetMousePosition() Vector2.XY

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

func (Instance) GetRenderInfo

func (self Instance) GetRenderInfo(atype gdclass.ViewportRenderInfoType, info gdclass.ViewportRenderInfo) int

Returns rendering statistics of the given type. See [enum RenderInfoType] and [enum RenderInfo] for options.

func (Instance) GetScreenTransform

func (self Instance) GetScreenTransform() Transform2D.OriginXY

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

func (Instance) GetTexture

func (self Instance) GetTexture() [1]gdclass.ViewportTexture

Returns the viewport's texture. [b]Note:[/b] When trying to store the current texture (e.g. in a file), it might be completely black or outdated if used too early, especially when used in e.g. [method Node._ready]. To make sure the texture you get is correct, you can await [signal RenderingServer.frame_post_draw] signal. [codeblock] func _ready():

await RenderingServer.frame_post_draw
$Viewport.get_texture().get_image().save_png("user://Screenshot.png")

[/codeblock]

func (Instance) GetViewportRid

func (self Instance) GetViewportRid() RID.Viewport

Returns the viewport's RID from the [RenderingServer].

func (Instance) GetVisibleRect

func (self Instance) GetVisibleRect() Rect2.PositionSize

Returns the visible rectangle in global screen coordinates.

func (Instance) GlobalCanvasTransform

func (self Instance) GlobalCanvasTransform() Transform2D.OriginXY

func (Instance) GuiDisableInput

func (self Instance) GuiDisableInput() bool

func (Instance) GuiEmbedSubwindows

func (self Instance) GuiEmbedSubwindows() bool

func (Instance) GuiGetDragData

func (self Instance) GuiGetDragData() any

Returns the drag data from the GUI, that was previously returned by [method Control._get_drag_data].

func (Instance) GuiGetFocusOwner

func (self Instance) GuiGetFocusOwner() [1]gdclass.Control

Returns the [Control] having the focus within this viewport. If no [Control] has the focus, returns null.

func (Instance) GuiGetHoveredControl

func (self Instance) GuiGetHoveredControl() [1]gdclass.Control

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 [method Node.is_ancestor_of] to find if the mouse is within a control tree.

func (Instance) GuiIsDragSuccessful

func (self Instance) GuiIsDragSuccessful() bool

Returns [code]true[/code] if the drag operation is successful.

func (Instance) GuiIsDragging

func (self Instance) GuiIsDragging() bool

Returns [code]true[/code] if the viewport is currently performing a drag operation. Alternative to [constant Node.NOTIFICATION_DRAG_BEGIN] and [constant Node.NOTIFICATION_DRAG_END] when you prefer polling the value.

func (Instance) GuiReleaseFocus

func (self Instance) GuiReleaseFocus()

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

func (Instance) GuiSnapControlsToPixels

func (self Instance) GuiSnapControlsToPixels() bool

func (Instance) HandleInputLocally

func (self Instance) HandleInputLocally() bool

func (Instance) IsInputHandled

func (self Instance) IsInputHandled() bool

Returns whether the current [InputEvent] has been handled. Input events are not handled until [method set_input_as_handled] has been called during the lifetime of an [InputEvent]. This is usually done as part of input handling methods like [method Node._input], [method Control._gui_input] or others, as well as in corresponding signal handlers. If [member handle_input_locally] is set to [code]false[/code], this method will try finding the first parent viewport that is set to handle input locally, and return its value for [method is_input_handled] instead.

func (Instance) MeshLodThreshold

func (self Instance) MeshLodThreshold() Float.X

func (Instance) Msaa2d

func (self Instance) Msaa2d() gdclass.ViewportMSAA

func (Instance) Msaa3d

func (self Instance) Msaa3d() gdclass.ViewportMSAA

func (Instance) OnGuiFocusChanged

func (self Instance) OnGuiFocusChanged(cb func(node [1]gdclass.Control))

func (Instance) OnSizeChanged

func (self Instance) OnSizeChanged(cb func())

func (Instance) OwnWorld3d

func (self Instance) OwnWorld3d() bool

func (Instance) PhysicsObjectPicking

func (self Instance) PhysicsObjectPicking() bool

func (Instance) PhysicsObjectPickingFirstOnly

func (self Instance) PhysicsObjectPickingFirstOnly() bool

func (Instance) PhysicsObjectPickingSort

func (self Instance) PhysicsObjectPickingSort() bool

func (Instance) PositionalShadowAtlas16Bits

func (self Instance) PositionalShadowAtlas16Bits() bool

func (Instance) PositionalShadowAtlasQuad0

func (self Instance) PositionalShadowAtlasQuad0() gdclass.ViewportPositionalShadowAtlasQuadrantSubdiv

func (Instance) PositionalShadowAtlasQuad1

func (self Instance) PositionalShadowAtlasQuad1() gdclass.ViewportPositionalShadowAtlasQuadrantSubdiv

func (Instance) PositionalShadowAtlasQuad2

func (self Instance) PositionalShadowAtlasQuad2() gdclass.ViewportPositionalShadowAtlasQuadrantSubdiv

func (Instance) PositionalShadowAtlasQuad3

func (self Instance) PositionalShadowAtlasQuad3() gdclass.ViewportPositionalShadowAtlasQuadrantSubdiv

func (Instance) PositionalShadowAtlasSize

func (self Instance) PositionalShadowAtlasSize() int

func (Instance) PushInput

func (self Instance) PushInput(event [1]gdclass.InputEvent)

Triggers the given [param 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 [param in_local_coords] is [code]false[/code], the event's position is in the embedder's coordinates and will be converted to viewport coordinates. If [param in_local_coords] is [code]true[/code], the event's position is in viewport coordinates. While this method serves a similar purpose as [method Input.parse_input_event], it does not remap the specified [param event] based on project settings like [member ProjectSettings.input_devices/pointing/emulate_touch_from_mouse]. Calling this method will propagate calls to child nodes for following methods in the given order: - [method Node._input] - [method Control._gui_input] for [Control] nodes - [method Node._shortcut_input] - [method Node._unhandled_key_input] - [method Node._unhandled_input] If an earlier method marks the input as handled via [method set_input_as_handled], any later method in this list will not be called. If none of the methods handle the event and [member physics_object_picking] is [code]true[/code], the event is used for physics object picking.

func (Instance) PushTextInput

func (self Instance) PushTextInput(text string)

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

func (Instance) PushUnhandledInput

func (self Instance) PushUnhandledInput(event [1]gdclass.InputEvent)

Triggers the given [param 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 [param in_local_coords] is [code]false[/code], the event's position is in the embedder's coordinates and will be converted to viewport coordinates. If [param in_local_coords] is [code]true[/code], the event's position is in viewport coordinates. Calling this method will propagate calls to child nodes for following methods in the given order: - [method Node._shortcut_input] - [method Node._unhandled_key_input] - [method Node._unhandled_input] If an earlier method marks the input as handled via [method set_input_as_handled], any later method in this list will not be called. If none of the methods handle the event and [member physics_object_picking] is [code]true[/code], the event is used for physics object picking. [b]Note:[/b] This method doesn't propagate input events to embedded [Window]s or [SubViewport]s.

func (Instance) Scaling3dMode

func (self Instance) Scaling3dMode() gdclass.ViewportScaling3DMode

func (Instance) Scaling3dScale

func (self Instance) Scaling3dScale() Float.X

func (Instance) ScreenSpaceAa

func (self Instance) ScreenSpaceAa() gdclass.ViewportScreenSpaceAA

func (Instance) SdfOversize

func (self Instance) SdfOversize() gdclass.ViewportSDFOversize

func (Instance) SdfScale

func (self Instance) SdfScale() gdclass.ViewportSDFScale

func (Instance) SetAudioListenerEnable2d

func (self Instance) SetAudioListenerEnable2d(value bool)

func (Instance) SetAudioListenerEnable3d

func (self Instance) SetAudioListenerEnable3d(value bool)

func (Instance) SetCanvasCullMask

func (self Instance) SetCanvasCullMask(value int)

func (Instance) SetCanvasCullMaskBit

func (self Instance) SetCanvasCullMaskBit(layer int, enable bool)

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

func (Instance) SetCanvasItemDefaultTextureFilter

func (self Instance) SetCanvasItemDefaultTextureFilter(value gdclass.ViewportDefaultCanvasItemTextureFilter)

func (Instance) SetCanvasItemDefaultTextureRepeat

func (self Instance) SetCanvasItemDefaultTextureRepeat(value gdclass.ViewportDefaultCanvasItemTextureRepeat)

func (Instance) SetCanvasTransform

func (self Instance) SetCanvasTransform(value Transform2D.OriginXY)

func (Instance) SetDebugDraw

func (self Instance) SetDebugDraw(value gdclass.ViewportDebugDraw)

func (Instance) SetDisable3d

func (self Instance) SetDisable3d(value bool)

func (Instance) SetFsrSharpness

func (self Instance) SetFsrSharpness(value Float.X)

func (Instance) SetGlobalCanvasTransform

func (self Instance) SetGlobalCanvasTransform(value Transform2D.OriginXY)

func (Instance) SetGuiDisableInput

func (self Instance) SetGuiDisableInput(value bool)

func (Instance) SetGuiEmbedSubwindows

func (self Instance) SetGuiEmbedSubwindows(value bool)

func (Instance) SetGuiSnapControlsToPixels

func (self Instance) SetGuiSnapControlsToPixels(value bool)

func (Instance) SetHandleInputLocally

func (self Instance) SetHandleInputLocally(value bool)

func (Instance) SetInputAsHandled

func (self Instance) SetInputAsHandled()

Stops the input from propagating further down the [SceneTree]. [b]Note:[/b] This does not affect the methods in [Input], only the way events are propagated.

func (Instance) SetMeshLodThreshold

func (self Instance) SetMeshLodThreshold(value Float.X)

func (Instance) SetMsaa2d

func (self Instance) SetMsaa2d(value gdclass.ViewportMSAA)

func (Instance) SetMsaa3d

func (self Instance) SetMsaa3d(value gdclass.ViewportMSAA)

func (Instance) SetOwnWorld3d

func (self Instance) SetOwnWorld3d(value bool)

func (Instance) SetPhysicsObjectPicking

func (self Instance) SetPhysicsObjectPicking(value bool)

func (Instance) SetPhysicsObjectPickingFirstOnly

func (self Instance) SetPhysicsObjectPickingFirstOnly(value bool)

func (Instance) SetPhysicsObjectPickingSort

func (self Instance) SetPhysicsObjectPickingSort(value bool)

func (Instance) SetPositionalShadowAtlas16Bits

func (self Instance) SetPositionalShadowAtlas16Bits(value bool)

func (Instance) SetPositionalShadowAtlasQuad0

func (self Instance) SetPositionalShadowAtlasQuad0(value gdclass.ViewportPositionalShadowAtlasQuadrantSubdiv)

func (Instance) SetPositionalShadowAtlasQuad1

func (self Instance) SetPositionalShadowAtlasQuad1(value gdclass.ViewportPositionalShadowAtlasQuadrantSubdiv)

func (Instance) SetPositionalShadowAtlasQuad2

func (self Instance) SetPositionalShadowAtlasQuad2(value gdclass.ViewportPositionalShadowAtlasQuadrantSubdiv)

func (Instance) SetPositionalShadowAtlasQuad3

func (self Instance) SetPositionalShadowAtlasQuad3(value gdclass.ViewportPositionalShadowAtlasQuadrantSubdiv)

func (Instance) SetPositionalShadowAtlasSize

func (self Instance) SetPositionalShadowAtlasSize(value int)

func (Instance) SetScaling3dMode

func (self Instance) SetScaling3dMode(value gdclass.ViewportScaling3DMode)

func (Instance) SetScaling3dScale

func (self Instance) SetScaling3dScale(value Float.X)

func (Instance) SetScreenSpaceAa

func (self Instance) SetScreenSpaceAa(value gdclass.ViewportScreenSpaceAA)

func (Instance) SetSdfOversize

func (self Instance) SetSdfOversize(value gdclass.ViewportSDFOversize)

func (Instance) SetSdfScale

func (self Instance) SetSdfScale(value gdclass.ViewportSDFScale)

func (Instance) SetSnap2dTransformsToPixel

func (self Instance) SetSnap2dTransformsToPixel(value bool)

func (Instance) SetSnap2dVerticesToPixel

func (self Instance) SetSnap2dVerticesToPixel(value bool)

func (Instance) SetTextureMipmapBias

func (self Instance) SetTextureMipmapBias(value Float.X)

func (Instance) SetTransparentBg

func (self Instance) SetTransparentBg(value bool)

func (Instance) SetUseDebanding

func (self Instance) SetUseDebanding(value bool)

func (Instance) SetUseHdr2d

func (self Instance) SetUseHdr2d(value bool)

func (Instance) SetUseOcclusionCulling

func (self Instance) SetUseOcclusionCulling(value bool)

func (Instance) SetUseTaa

func (self Instance) SetUseTaa(value bool)

func (Instance) SetUseXr

func (self Instance) SetUseXr(value bool)

func (Instance) SetVrsMode

func (self Instance) SetVrsMode(value gdclass.ViewportVRSMode)

func (Instance) SetVrsTexture

func (self Instance) SetVrsTexture(value [1]gdclass.Texture2D)

func (Instance) SetVrsUpdateMode

func (self Instance) SetVrsUpdateMode(value gdclass.ViewportVRSUpdateMode)

func (Instance) SetWorld2d

func (self Instance) SetWorld2d(value [1]gdclass.World2D)

func (Instance) SetWorld3d

func (self Instance) SetWorld3d(value [1]gdclass.World3D)

func (Instance) Snap2dTransformsToPixel

func (self Instance) Snap2dTransformsToPixel() bool

func (Instance) Snap2dVerticesToPixel

func (self Instance) Snap2dVerticesToPixel() bool

func (Instance) TextureMipmapBias

func (self Instance) TextureMipmapBias() Float.X

func (Instance) TransparentBg

func (self Instance) TransparentBg() bool

func (*Instance) UnsafePointer

func (self *Instance) UnsafePointer() unsafe.Pointer

func (Instance) UpdateMouseCursorState

func (self Instance) UpdateMouseCursorState()

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

func (Instance) UseDebanding

func (self Instance) UseDebanding() bool

func (Instance) UseHdr2d

func (self Instance) UseHdr2d() bool

func (Instance) UseOcclusionCulling

func (self Instance) UseOcclusionCulling() bool

func (Instance) UseTaa

func (self Instance) UseTaa() bool

func (Instance) UseXr

func (self Instance) UseXr() bool

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

func (Instance) VrsMode

func (self Instance) VrsMode() gdclass.ViewportVRSMode

func (Instance) VrsTexture

func (self Instance) VrsTexture() [1]gdclass.Texture2D

func (Instance) VrsUpdateMode

func (self Instance) VrsUpdateMode() gdclass.ViewportVRSUpdateMode

func (Instance) WarpMouse

func (self Instance) WarpMouse(position Vector2.XY)

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

func (Instance) World2d

func (self Instance) World2d() [1]gdclass.World2D

func (Instance) World3d

func (self Instance) World3d() [1]gdclass.World3D

type MSAA

type MSAA = gdclass.ViewportMSAA //gd:Viewport.MSAA
const (
	/*Multisample antialiasing mode disabled. This is the default value, and is also the fastest setting.*/
	MsaaDisabled MSAA = 0
	/*Use 2× Multisample Antialiasing. This has a moderate performance cost. It helps reduce aliasing noticeably, but 4× MSAA still looks substantially better.*/
	Msaa2x MSAA = 1
	/*Use 4× Multisample Antialiasing. This has a significant performance cost, and is generally a good compromise between performance and quality.*/
	Msaa4x MSAA = 2
	/*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.*/
	Msaa8x MSAA = 3
	/*Represents the size of the [enum MSAA] enum.*/
	MsaaMax MSAA = 4
)

type PositionalShadowAtlasQuadrantSubdiv

type PositionalShadowAtlasQuadrantSubdiv = gdclass.ViewportPositionalShadowAtlasQuadrantSubdiv //gd:Viewport.PositionalShadowAtlasQuadrantSubdiv
const (
	/*This quadrant will not be used.*/
	ShadowAtlasQuadrantSubdivDisabled PositionalShadowAtlasQuadrantSubdiv = 0
	/*This quadrant will only be used by one shadow map.*/
	ShadowAtlasQuadrantSubdiv1 PositionalShadowAtlasQuadrantSubdiv = 1
	/*This quadrant will be split in 4 and used by up to 4 shadow maps.*/
	ShadowAtlasQuadrantSubdiv4 PositionalShadowAtlasQuadrantSubdiv = 2
	/*This quadrant will be split 16 ways and used by up to 16 shadow maps.*/
	ShadowAtlasQuadrantSubdiv16 PositionalShadowAtlasQuadrantSubdiv = 3
	/*This quadrant will be split 64 ways and used by up to 64 shadow maps.*/
	ShadowAtlasQuadrantSubdiv64 PositionalShadowAtlasQuadrantSubdiv = 4
	/*This quadrant will be split 256 ways and used by up to 256 shadow maps. Unless the [member positional_shadow_atlas_size] is very high, the shadows in this quadrant will be very low resolution.*/
	ShadowAtlasQuadrantSubdiv256 PositionalShadowAtlasQuadrantSubdiv = 5
	/*This quadrant will be split 1024 ways and used by up to 1024 shadow maps. Unless the [member positional_shadow_atlas_size] is very high, the shadows in this quadrant will be very low resolution.*/
	ShadowAtlasQuadrantSubdiv1024 PositionalShadowAtlasQuadrantSubdiv = 6
	/*Represents the size of the [enum PositionalShadowAtlasQuadrantSubdiv] enum.*/
	ShadowAtlasQuadrantSubdivMax PositionalShadowAtlasQuadrantSubdiv = 7
)

type RenderInfo

type RenderInfo = gdclass.ViewportRenderInfo //gd:Viewport.RenderInfo
const (
	/*Amount of objects in frame.*/
	RenderInfoObjectsInFrame RenderInfo = 0
	/*Amount of vertices in frame.*/
	RenderInfoPrimitivesInFrame RenderInfo = 1
	/*Amount of draw calls in frame.*/
	RenderInfoDrawCallsInFrame RenderInfo = 2
	/*Represents the size of the [enum RenderInfo] enum.*/
	RenderInfoMax RenderInfo = 3
)

type RenderInfoType

type RenderInfoType = gdclass.ViewportRenderInfoType //gd:Viewport.RenderInfoType
const (
	/*Visible render pass (excluding shadows).*/
	RenderInfoTypeVisible RenderInfoType = 0
	/*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.*/
	RenderInfoTypeShadow RenderInfoType = 1
	/*Canvas item rendering. This includes all 2D rendering.*/
	RenderInfoTypeCanvas RenderInfoType = 2
	/*Represents the size of the [enum RenderInfoType] enum.*/
	RenderInfoTypeMax RenderInfoType = 3
)

type SDFOversize

type SDFOversize = gdclass.ViewportSDFOversize //gd:Viewport.SDFOversize
const (
	/*The signed distance field only covers the viewport's own rectangle.*/
	SdfOversize100Percent SDFOversize = 0
	/*The signed distance field is expanded to cover 20% of the viewport's size around the borders.*/
	SdfOversize120Percent SDFOversize = 1
	/*The signed distance field is expanded to cover 50% of the viewport's size around the borders.*/
	SdfOversize150Percent SDFOversize = 2
	/*The signed distance field is expanded to cover 100% (double) of the viewport's size around the borders.*/
	SdfOversize200Percent SDFOversize = 3
	/*Represents the size of the [enum SDFOversize] enum.*/
	SdfOversizeMax SDFOversize = 4
)

type SDFScale

type SDFScale = gdclass.ViewportSDFScale //gd:Viewport.SDFScale
const (
	/*The signed distance field is rendered at full resolution.*/
	SdfScale100Percent SDFScale = 0
	/*The signed distance field is rendered at half the resolution of this viewport.*/
	SdfScale50Percent SDFScale = 1
	/*The signed distance field is rendered at a quarter the resolution of this viewport.*/
	SdfScale25Percent SDFScale = 2
	/*Represents the size of the [enum SDFScale] enum.*/
	SdfScaleMax SDFScale = 3
)

type Scaling3DMode

type Scaling3DMode = gdclass.ViewportScaling3DMode //gd:Viewport.Scaling3DMode
const (
	/*Use bilinear scaling for the viewport's 3D buffer. The amount of scaling can be set using [member scaling_3d_scale]. Values less than [code]1.0[/code] will result in undersampling while values greater than [code]1.0[/code] will result in supersampling. A value of [code]1.0[/code] disables scaling.*/
	Scaling3dModeBilinear Scaling3DMode = 0
	/*Use AMD FidelityFX Super Resolution 1.0 upscaling for the viewport's 3D buffer. The amount of scaling can be set using [member scaling_3d_scale]. Values less than [code]1.0[/code] will be result in the viewport being upscaled using FSR. Values greater than [code]1.0[/code] are not supported and bilinear downsampling will be used instead. A value of [code]1.0[/code] disables scaling.*/
	Scaling3dModeFsr Scaling3DMode = 1
	/*Use AMD FidelityFX Super Resolution 2.2 upscaling for the viewport's 3D buffer. The amount of scaling can be set using [member Viewport.scaling_3d_scale]. Values less than [code]1.0[/code] will be result in the viewport being upscaled using FSR2. Values greater than [code]1.0[/code] are not supported and bilinear downsampling will be used instead. A value of [code]1.0[/code] will use FSR2 at native resolution as a TAA solution.*/
	Scaling3dModeFsr2 Scaling3DMode = 2
	/*Represents the size of the [enum Scaling3DMode] enum.*/
	Scaling3dModeMax Scaling3DMode = 3
)

type ScreenSpaceAA

type ScreenSpaceAA = gdclass.ViewportScreenSpaceAA //gd:Viewport.ScreenSpaceAA
const (
	/*Do not perform any antialiasing in the full screen post-process.*/
	ScreenSpaceAaDisabled ScreenSpaceAA = 0
	/*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.*/
	ScreenSpaceAaFxaa ScreenSpaceAA = 1
	/*Represents the size of the [enum ScreenSpaceAA] enum.*/
	ScreenSpaceAaMax ScreenSpaceAA = 2
)

type VRSMode

type VRSMode = gdclass.ViewportVRSMode //gd:Viewport.VRSMode
const (
	/*Variable Rate Shading is disabled.*/
	VrsDisabled VRSMode = 0
	/*Variable Rate Shading uses a texture. Note, for stereoscopic use a texture atlas with a texture for each view.*/
	VrsTexture VRSMode = 1
	/*Variable Rate Shading's texture is supplied by the primary [XRInterface].*/
	VrsXr VRSMode = 2
	/*Represents the size of the [enum VRSMode] enum.*/
	VrsMax VRSMode = 3
)

type VRSUpdateMode

type VRSUpdateMode = gdclass.ViewportVRSUpdateMode //gd:Viewport.VRSUpdateMode
const (
	/*The input texture for variable rate shading will not be processed.*/
	VrsUpdateDisabled VRSUpdateMode = 0
	/*The input texture for variable rate shading will be processed once.*/
	VrsUpdateOnce VRSUpdateMode = 1
	/*The input texture for variable rate shading will be processed each frame.*/
	VrsUpdateAlways VRSUpdateMode = 2
	/*Represents the size of the [enum VRSUpdateMode] enum.*/
	VrsUpdateMax VRSUpdateMode = 3
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL