Click or drag to resize

VisualServer Class

Server for anything visible. The visual server is the API backend for everything visible. The whole scene system mounts on it to display.

The visual server is completely opaque, the internals are entirely implementation specific and cannot be accessed.

The visual server can be used to bypass the scene system entirely.

Resources are created using the *_create functions.

All objects are drawn to a viewport. You can use the Viewport attached to the SceneTree or you can create one yourself with ViewportCreate. When using a custom scenario or canvas, the scenario or canvas needs to be attached to the viewport using ViewportSetScenario(RID, RID) or ViewportAttachCanvas(RID, RID).

In 3D, all visual objects must be associated with a scenario. The scenario is a visual representation of the world. If accessing the visual server from a running game, the scenario can be accessed from the scene tree from any Spatial node with GetWorld. Otherwise, a scenario can be created with ScenarioCreate.

Similarly, in 2D, a canvas is needed to draw all canvas items.

In 3D, all visible objects are comprised of a resource and an instance. A resource can be a mesh, a particle system, a light, or any other 3D object. In order to be visible resources must be attached to an instance using InstanceSetBase(RID, RID). The instance must also be attached to the scenario using InstanceSetScenario(RID, RID) in order to be visible.

In 2D, all visible objects are some form of canvas item. In order to be visible, a canvas item needs to be the child of a canvas attached to a viewport, or it needs to be the child of another canvas item that is eventually attached to the canvas.

Inheritance Hierarchy
SystemObject
  GodotVisualServer

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
public static class VisualServer

The VisualServer type exposes the following members.

Properties
  NameDescription
Public propertyStatic memberRenderLoopEnabled

If false, disables rendering completely, but the engine logic is still being processed. You can call ForceDraw(Boolean, Double) to draw a frame even with rendering disabled.

Public propertyStatic memberSingleton
Top
Methods
  NameDescription
Public methodStatic memberBlackBarsSetImages

Sets images to be rendered in the window margin.

Public methodStatic memberBlackBarsSetMargins

Sets margin size, where black bars (or images, if BlackBarsSetImages(RID, RID, RID, RID) was used) are rendered.

Public methodStatic memberCameraCreate

Creates a camera and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all camera_* VisualServer functions.

Once finished with your RID, you will want to free the RID using the VisualServer's FreeRid(RID) static method.

Public methodStatic memberCameraSetCullMask

Sets the cull mask associated with this camera. The cull mask describes which 3D layers are rendered by this camera. Equivalent to CullMask.

Public methodStatic memberCameraSetEnvironment

Sets the environment used by this camera. Equivalent to Environment.

Public methodStatic memberCameraSetFrustum

Sets camera to use frustum projection. This mode allows adjusting the offset argument to create "tilted frustum" effects.

Public methodStatic memberCameraSetOrthogonal

Sets camera to use orthogonal projection, also known as orthographic projection. Objects remain the same size on the screen no matter how far away they are.

Public methodStatic memberCameraSetPerspective

Sets camera to use perspective projection. Objects on the screen becomes smaller when they are far away.

Public methodStatic memberCameraSetTransform

Sets Transform of camera.

Public methodStatic memberCameraSetUseVerticalAspect

If true, preserves the horizontal aspect ratio which is equivalent to . If false, preserves the vertical aspect ratio which is equivalent to .

Public methodStatic memberCanvasCreate

Creates a canvas and returns the assigned RID. It can be accessed with the RID that is returned. This RID will be used in all canvas_* VisualServer functions.

Once finished with your RID, you will want to free the RID using the VisualServer's FreeRid(RID) static method.

Public methodStatic memberCanvasItemAddCircle

Adds a circle command to the CanvasItem's draw commands.

Public methodStatic memberCanvasItemAddClipIgnore

If ignore is true, the VisualServer does not perform clipping.

Public methodStatic memberCanvasItemAddLine

Adds a line command to the CanvasItem's draw commands.

Public methodStatic memberCanvasItemAddMesh

Adds a mesh command to the CanvasItem's draw commands.

Public methodStatic memberCanvasItemAddMultimesh

Adds a MultiMesh to the CanvasItem's draw commands. Only affects its aabb at the moment.

Public methodStatic memberCanvasItemAddNinePatch

Adds a nine patch image to the CanvasItem's draw commands.

See NinePatchRect for more explanation.

Public methodStatic memberCanvasItemAddParticles

Adds a particle system to the CanvasItem's draw commands.

Public methodStatic memberCanvasItemAddPolygon

Adds a polygon to the CanvasItem's draw commands.

Public methodStatic memberCanvasItemAddPolyline

Adds a polyline, which is a line from multiple points with a width, to the CanvasItem's draw commands.

Public methodStatic memberCanvasItemAddPrimitive

Adds a primitive to the CanvasItem's draw commands.

Public methodStatic memberCanvasItemAddRect

Adds a rectangle to the CanvasItem's draw commands.

Public methodStatic memberCanvasItemAddSetTransform

Adds a Transform2D command to the CanvasItem's draw commands.

This sets the extra_matrix uniform when executed. This affects the later commands of the canvas item.

Public methodStatic memberCanvasItemAddTextureRect

Adds a textured rect to the CanvasItem's draw commands.

Public methodStatic memberCanvasItemAddTextureRectRegion

Adds a texture rect with region setting to the CanvasItem's draw commands.

Public methodStatic memberCanvasItemAddTriangleArray

Adds a triangle array to the CanvasItem's draw commands.

Public methodStatic memberCanvasItemClear

Clears the CanvasItem and removes all commands in it.

Public methodStatic memberCanvasItemCreate

Creates a new CanvasItem and returns its RID. It can be accessed with the RID that is returned. This RID will be used in all canvas_item_* VisualServer functions.

Once finished with your RID, you will want to free the RID using the VisualServer's FreeRid(RID) static method.

Public methodStatic memberCanvasItemSetClip

Sets clipping for the CanvasItem.

Public methodStatic memberCanvasItemSetCopyToBackbuffer

Sets the CanvasItem to copy a rect to the backbuffer.

Public methodStatic memberCanvasItemSetCustomRect

Defines a custom drawing rectangle for the CanvasItem.

Public methodStatic memberCanvasItemSetDistanceFieldMode

Enables the use of distance fields for GUI elements that are rendering distance field based fonts.

Public methodStatic memberCanvasItemSetDrawBehindParent

Sets CanvasItem to be drawn behind its parent.

Public methodStatic memberCanvasItemSetDrawIndex

Sets the index for the CanvasItem.

Public methodStatic memberCanvasItemSetLightMask

The light mask. See LightOccluder2D for more information on light masks.

Public methodStatic memberCanvasItemSetMaterial

Sets a new material to the CanvasItem.

Public methodStatic memberCanvasItemSetModulate

Sets the color that modulates the CanvasItem and its children.

Public methodStatic memberCanvasItemSetParent

Sets the parent for the CanvasItem. The parent can be another canvas item, or it can be the root canvas that is attached to the viewport.

Public methodStatic memberCanvasItemSetSelfModulate

Sets the color that modulates the CanvasItem without children.

Public methodStatic memberCanvasItemSetSortChildrenByY

Sets if CanvasItem's children should be sorted by y-position.

Public methodStatic memberCanvasItemSetTransform
Public methodStatic memberCanvasItemSetUseParentMaterial

Sets if the CanvasItem uses its parent's material.

Public methodStatic memberCanvasItemSetVisible

Sets if the canvas item (including its children) is visible.

Public methodStatic memberCanvasItemSetZAsRelativeToParent

If this is enabled, the Z index of the parent will be added to the children's Z index.

Public methodStatic memberCanvasItemSetZIndex

Sets the CanvasItem's Z index, i.e. its draw order (lower indexes are drawn first).

Public methodStatic memberCanvasLightAttachToCanvas

Attaches the canvas light to the canvas. Removes it from its previous canvas.

Public methodStatic memberCanvasLightCreate

Creates a canvas light and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all canvas_light_* VisualServer functions.

Once finished with your RID, you will want to free the RID using the VisualServer's FreeRid(RID) static method.

Public methodStatic memberCanvasLightOccluderAttachToCanvas

Attaches a light occluder to the canvas. Removes it from its previous canvas.

Public methodStatic memberCanvasLightOccluderCreate

Creates a light occluder and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all canvas_light_ocluder_* VisualServer functions.

Once finished with your RID, you will want to free the RID using the VisualServer's FreeRid(RID) static method.

Public methodStatic memberCanvasLightOccluderSetEnabled

Enables or disables light occluder.

Public methodStatic memberCanvasLightOccluderSetLightMask

The light mask. See LightOccluder2D for more information on light masks.

Public methodStatic memberCanvasLightOccluderSetPolygon

Sets a light occluder's polygon.

Public methodStatic memberCanvasLightOccluderSetTransform

Sets a light occluder's Transform2D.

Public methodStatic memberCanvasLightSetColor

Sets the color for a light.

Public methodStatic memberCanvasLightSetEnabled

Enables or disables a canvas light.

Public methodStatic memberCanvasLightSetEnergy

Sets a canvas light's energy.

Public methodStatic memberCanvasLightSetHeight

Sets a canvas light's height.

Public methodStatic memberCanvasLightSetItemCullMask

The light mask. See LightOccluder2D for more information on light masks.

Public methodStatic memberCanvasLightSetItemShadowCullMask

The binary mask used to determine which layers this canvas light's shadows affects. See LightOccluder2D for more information on light masks.

Public methodStatic memberCanvasLightSetLayerRange

The layer range that gets rendered with this light.

Public methodStatic memberCanvasLightSetMode
Public methodStatic memberCanvasLightSetScale

Sets the texture's scale factor of the light. Equivalent to TextureScale.

Public methodStatic memberCanvasLightSetShadowBufferSize

Sets the width of the shadow buffer, size gets scaled to the next power of two for this.

Public methodStatic memberCanvasLightSetShadowColor

Sets the color of the canvas light's shadow.

Public methodStatic memberCanvasLightSetShadowEnabled

Enables or disables the canvas light's shadow.

Public methodStatic memberCanvasLightSetShadowFilter
Public methodStatic memberCanvasLightSetShadowGradientLength

Sets the length of the shadow's gradient.

Public methodStatic memberCanvasLightSetShadowSmooth

Smoothens the shadow. The lower, the smoother.

Public methodStatic memberCanvasLightSetTexture

Sets texture to be used by light. Equivalent to Texture.

Public methodStatic memberCanvasLightSetTextureOffset

Sets the offset of the light's texture. Equivalent to Offset.

Public methodStatic memberCanvasLightSetTransform

Sets the canvas light's Transform2D.

Public methodStatic memberCanvasLightSetZRange

Sets the Z range of objects that will be affected by this light. Equivalent to RangeZMin and RangeZMax.

Public methodStatic memberCanvasOccluderPolygonCreate

Creates a new light occluder polygon and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all canvas_occluder_polygon_* VisualServer functions.

Once finished with your RID, you will want to free the RID using the VisualServer's FreeRid(RID) static method.

Public methodStatic memberCanvasOccluderPolygonSetCullMode
Public methodStatic memberCanvasOccluderPolygonSetShape

Sets the shape of the occluder polygon.

Public methodStatic memberCanvasOccluderPolygonSetShapeAsLines

Sets the shape of the occluder polygon as lines.

Public methodStatic memberCanvasSetItemMirroring

A copy of the canvas item will be drawn with a local offset of the mirroring Vector2.

Public methodStatic memberCanvasSetModulate

Modulates all colors in the given canvas.

Public methodStatic memberDirectionalLightCreate

Creates a directional light and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID can be used in most light_* VisualServer functions.

Once finished with your RID, you will want to free the RID using the VisualServer's FreeRid(RID) static method.

To place in a scene, attach this directional light to an instance using InstanceSetBase(RID, RID) using the returned RID.

Public methodStatic memberDraw

Draws a frame. This method is deprecated, please use ForceDraw(Boolean, Double) instead.

Public methodStatic memberEnvironmentCreate

Creates an environment and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all environment_* VisualServer functions.

Once finished with your RID, you will want to free the RID using the VisualServer's FreeRid(RID) static method.

Public methodStatic memberEnvironmentSetAdjustment

Sets the values to be used with the "Adjustment" post-process effect. See Environment for more details.

Public methodStatic memberEnvironmentSetAmbientLight

Sets the ambient light parameters. See Environment for more details.

Public methodStatic memberEnvironmentSetBackground

Sets the BGMode of the environment. Equivalent to BackgroundMode.

Public methodStatic memberEnvironmentSetBgColor

Color displayed for clear areas of the scene (if using Custom color or Color+Sky background modes).

Public methodStatic memberEnvironmentSetBgEnergy

Sets the intensity of the background color.

Public methodStatic memberEnvironmentSetCanvasMaxLayer

Sets the maximum layer to use if using Canvas background mode.

Public methodStatic memberEnvironmentSetDofBlurFar

Sets the values to be used with the "DoF Far Blur" post-process effect. See Environment for more details.

Public methodStatic memberEnvironmentSetDofBlurNear

Sets the values to be used with the "DoF Near Blur" post-process effect. See Environment for more details.

Public methodStatic memberEnvironmentSetFog

Sets the variables to be used with the scene fog. See Environment for more details.

Public methodStatic memberEnvironmentSetFogDepth

Sets the variables to be used with the fog depth effect. See Environment for more details.

Public methodStatic memberEnvironmentSetFogHeight

Sets the variables to be used with the fog height effect. See Environment for more details.

Public methodStatic memberEnvironmentSetGlow

Sets the variables to be used with the "glow" post-process effect. See Environment for more details.

Public methodStatic memberEnvironmentSetSky

Sets the Sky to be used as the environment's background when using BGMode sky. Equivalent to BackgroundSky.

Public methodStatic memberEnvironmentSetSkyCustomFov

Sets a custom field of view for the background Sky. Equivalent to BackgroundSkyCustomFov.

Public methodStatic memberEnvironmentSetSkyOrientation

Sets the rotation of the background Sky expressed as a Basis. Equivalent to BackgroundSkyOrientation.

Public methodStatic memberEnvironmentSetSsao

Sets the variables to be used with the "Screen Space Ambient Occlusion (SSAO)" post-process effect. See Environment for more details.

Public methodStatic memberEnvironmentSetSsr

Sets the variables to be used with the "screen space reflections" post-process effect. See Environment for more details.

Public methodStatic memberEnvironmentSetTonemap

Sets the variables to be used with the "tonemap" post-process effect. See Environment for more details.

Public methodStatic memberFinish

Removes buffers and clears testcubes.

Public methodStatic memberForceDraw

Forces a frame to be drawn when the function is called. Drawing a frame updates all Viewports that are set to update. Use with extreme caution.

Public methodStatic memberForceSync

Synchronizes threads.

Public methodStatic memberFreeRid

Tries to free an object in the VisualServer.

Public methodStatic memberGetRenderInfo
Public methodStatic memberGetTestCube

Returns the id of the test cube. Creates one if none exists.

Public methodStatic memberGetTestTexture

Returns the id of the test texture. Creates one if none exists.

Public methodStatic memberGetVideoAdapterName

Returns the name of the video adapter (e.g. "GeForce GTX 1080/PCIe/SSE2").

Note: When running a headless or server binary, this function returns an empty string.

Public methodStatic memberGetVideoAdapterVendor

Returns the vendor of the video adapter (e.g. "NVIDIA Corporation").

Note: When running a headless or server binary, this function returns an empty string.

Public methodStatic memberGetWhiteTexture

Returns the id of a white texture. Creates one if none exists.

Public methodStatic memberGiProbeCreate

Creates a GI probe and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all gi_probe_* VisualServer functions.

Once finished with your RID, you will want to free the RID using the VisualServer's FreeRid(RID) static method.

To place in a scene, attach this GI probe to an instance using InstanceSetBase(RID, RID) using the returned RID.

Public methodStatic memberGiProbeGetBias

Returns the bias value for the GI probe. Bias is used to avoid self occlusion. Equivalent to Bias.

Public methodStatic memberGiProbeGetBounds

Returns the axis-aligned bounding box that covers the full extent of the GI probe.

Public methodStatic memberGiProbeGetCellSize

Returns the cell size set by GiProbeSetCellSize(RID, Single).

Public methodStatic memberGiProbeGetDynamicData

Returns the data used by the GI probe.

Public methodStatic memberGiProbeGetDynamicRange

Returns the dynamic range set for this GI probe. Equivalent to DynamicRange.

Public methodStatic memberGiProbeGetEnergy

Returns the energy multiplier for this GI probe. Equivalent to Energy.

Public methodStatic memberGiProbeGetNormalBias

Returns the normal bias for this GI probe. Equivalent to NormalBias.

Public methodStatic memberGiProbeGetPropagation

Returns the propagation value for this GI probe. Equivalent to Propagation.

Public methodStatic memberGiProbeGetToCellXform

Returns the Transform set by GiProbeSetToCellXform(RID, Transform).

Public methodStatic memberGiProbeIsCompressed

Returns true if the GI probe data associated with this GI probe is compressed. Equivalent to Compress.

Public methodStatic memberGiProbeIsInterior

Returns true if the GI probe is set to interior, meaning it does not account for sky light. Equivalent to Interior.

Public methodStatic memberGiProbeSetBias

Sets the bias value to avoid self-occlusion. Equivalent to Bias.

Public methodStatic memberGiProbeSetBounds

Sets the axis-aligned bounding box that covers the extent of the GI probe.

Public methodStatic memberGiProbeSetCellSize

Sets the size of individual cells within the GI probe.

Public methodStatic memberGiProbeSetCompress

Sets the compression setting for the GI probe data. Compressed data will take up less space but may look worse. Equivalent to Compress.

Public methodStatic memberGiProbeSetDynamicData

Sets the data to be used in the GI probe for lighting calculations. Normally this is created and called internally within the GIProbe node. You should not try to set this yourself.

Public methodStatic memberGiProbeSetDynamicRange

Sets the dynamic range of the GI probe. Dynamic range sets the limit for how bright lights can be. A smaller range captures greater detail but limits how bright lights can be. Equivalent to DynamicRange.

Public methodStatic memberGiProbeSetEnergy

Sets the energy multiplier for this GI probe. A higher energy makes the indirect light from the GI probe brighter. Equivalent to Energy.

Public methodStatic memberGiProbeSetInterior

Sets the interior value of this GI probe. A GI probe set to interior does not include the sky when calculating lighting. Equivalent to Interior.

Public methodStatic memberGiProbeSetNormalBias

Sets the normal bias for this GI probe. Normal bias behaves similar to the other form of bias and may help reduce self-occlusion. Equivalent to NormalBias.

Public methodStatic memberGiProbeSetPropagation

Sets the propagation of light within this GI probe. Equivalent to Propagation.

Public methodStatic memberGiProbeSetToCellXform

Sets the to cell Transform for this GI probe.

Public methodStatic memberHasChanged

Returns true if changes have been made to the VisualServer's data. Draw(Boolean, Double) is usually called if this happens.

Public methodStatic memberHasFeature

Not yet implemented. Always returns false.

Public methodStatic memberHasOsFeature

Returns true if the OS supports a certain feature. Features might be s3tc, etc, etc2, pvrtc and skinning_fallback.

When rendering with GLES2, returns true with skinning_fallback in case the hardware doesn't support the default GPU skinning process.

Public methodStatic memberImmediateBegin
Public methodStatic memberImmediateClear
Public methodStatic memberImmediateColor

Sets the color to be used with next vertex. Equivalent to SetColor(Color).

Public methodStatic memberImmediateCreate

Creates an immediate geometry and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all immediate_* VisualServer functions.

Once finished with your RID, you will want to free the RID using the VisualServer's FreeRid(RID) static method.

To place in a scene, attach this immediate geometry to an instance using InstanceSetBase(RID, RID) using the returned RID.

Public methodStatic memberImmediateEnd
Public methodStatic memberImmediateGetMaterial

Returns the material assigned to the ImmediateGeometry.

Public methodStatic memberImmediateNormal

Sets the normal to be used with next vertex. Equivalent to SetNormal(Vector3).

Public methodStatic memberImmediateSetMaterial

Sets the material to be used to draw the ImmediateGeometry.

Public methodStatic memberImmediateTangent

Sets the tangent to be used with next vertex. Equivalent to SetTangent(Plane).

Public methodStatic memberImmediateUv

Sets the UV to be used with next vertex. Equivalent to SetUv(Vector2).

Public methodStatic memberImmediateUv2

Sets the UV2 to be used with next vertex. Equivalent to SetUv2(Vector2).

Public methodStatic memberImmediateVertex

Adds the next vertex using the information provided in advance. Equivalent to AddVertex(Vector3).

Public methodStatic memberImmediateVertex2d

Adds the next vertex using the information provided in advance. This is a helper class that calls ImmediateVertex(RID, Vector3) under the hood. Equivalent to AddVertex(Vector3).

Public methodStatic memberInit

Initializes the visual server. This function is called internally by platform-dependent code during engine initialization. If called from a running game, it will not do anything.

Public methodStatic memberInstanceAttachObjectInstanceId

Attaches a unique Object ID to instance. Object ID must be attached to instance for proper culling with InstancesCullAabb(AABB, RID), InstancesCullConvex(Array, RID), and InstancesCullRay(Vector3, Vector3, RID).

Public methodStatic memberInstanceAttachSkeleton

Attaches a skeleton to an instance. Removes the previous skeleton from the instance.

Public methodStatic memberInstanceCreate

Creates a visual instance and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all instance_* VisualServer functions.

Once finished with your RID, you will want to free the RID using the VisualServer's FreeRid(RID) static method.

An instance is a way of placing a 3D object in the scenario. Objects like particles, meshes, and reflection probes need to be associated with an instance to be visible in the scenario using InstanceSetBase(RID, RID).

Public methodStatic memberInstanceCreate2

Creates a visual instance, adds it to the VisualServer, and sets both base and scenario. It can be accessed with the RID that is returned. This RID will be used in all instance_* VisualServer functions.

Once finished with your RID, you will want to free the RID using the VisualServer's FreeRid(RID) static method.

Public methodStatic memberInstanceGeometrySetAsInstanceLod

Not implemented in Godot 3.x.

Public methodStatic memberInstanceGeometrySetCastShadowsSetting
Public methodStatic memberInstanceGeometrySetDrawRange

Not implemented in Godot 3.x.

Public methodStatic memberInstanceGeometrySetFlag
Public methodStatic memberInstanceGeometrySetMaterialOverride

Sets a material that will override the material for all surfaces on the mesh associated with this instance. Equivalent to MaterialOverride.

Public methodStatic memberInstancesCullAabb

Returns an array of object IDs intersecting with the provided AABB. Only visual 3D nodes are considered, such as MeshInstance or DirectionalLight. Use @GDScript.instance_from_id to obtain the actual nodes. A scenario RID must be provided, which is available in the World you want to query. This forces an update for all resources queued to update.

Warning: This function is primarily intended for editor usage. For in-game use cases, prefer physics collision.

Public methodStatic memberInstancesCullConvex

Returns an array of object IDs intersecting with the provided convex shape. Only visual 3D nodes are considered, such as MeshInstance or DirectionalLight. Use @GDScript.instance_from_id to obtain the actual nodes. A scenario RID must be provided, which is available in the World you want to query. This forces an update for all resources queued to update.

Warning: This function is primarily intended for editor usage. For in-game use cases, prefer physics collision.

Public methodStatic memberInstancesCullRay

Returns an array of object IDs intersecting with the provided 3D ray. Only visual 3D nodes are considered, such as MeshInstance or DirectionalLight. Use @GDScript.instance_from_id to obtain the actual nodes. A scenario RID must be provided, which is available in the World you want to query. This forces an update for all resources queued to update.

Warning: This function is primarily intended for editor usage. For in-game use cases, prefer physics collision.

Public methodStatic memberInstanceSetBase

Sets the base of the instance. A base can be any of the 3D objects that are created in the VisualServer that can be displayed. For example, any of the light types, mesh, multimesh, immediate geometry, particle system, reflection probe, lightmap capture, and the GI probe are all types that can be set as the base of an instance in order to be displayed in the scenario.

Public methodStatic memberInstanceSetBlendShapeWeight

Sets the weight for a given blend shape associated with this instance.

Public methodStatic memberInstanceSetCustomAabb

Sets a custom AABB to use when culling objects from the view frustum. Equivalent to SetCustomAabb(AABB).

Public methodStatic memberInstanceSetExterior

Function not implemented in Godot 3.x.

Public methodStatic memberInstanceSetExtraVisibilityMargin

Sets a margin to increase the size of the AABB when culling objects from the view frustum. This allows you to avoid culling objects that fall outside the view frustum. Equivalent to ExtraCullMargin.

Public methodStatic memberInstanceSetLayerMask

Sets the render layers that this instance will be drawn to. Equivalent to Layers.

Public methodStatic memberInstanceSetScenario

Sets the scenario that the instance is in. The scenario is the 3D world that the objects will be displayed in.

Public methodStatic memberInstanceSetSurfaceMaterial

Sets the material of a specific surface. Equivalent to SetSurfaceMaterial(Int32, Material).

Public methodStatic memberInstanceSetTransform

Sets the world space transform of the instance. Equivalent to Transform.

Public methodStatic memberInstanceSetUseLightmap

Sets the lightmap to use with this instance.

Public methodStatic memberInstanceSetVisible

Sets whether an instance is drawn or not. Equivalent to Visible.

Public methodStatic memberIsRenderLoopEnabled Obsolete.
Public methodStatic memberLightDirectionalSetBlendSplits

If true, this directional light will blend between shadow map splits resulting in a smoother transition between them. Equivalent to DirectionalShadowBlendSplits.

Public methodStatic memberLightDirectionalSetShadowDepthRangeMode
Public methodStatic memberLightDirectionalSetShadowMode
Public methodStatic memberLightmapCaptureCreate

Creates a lightmap capture and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all lightmap_capture_* VisualServer functions.

Once finished with your RID, you will want to free the RID using the VisualServer's FreeRid(RID) static method.

To place in a scene, attach this lightmap capture to an instance using InstanceSetBase(RID, RID) using the returned RID.

Public methodStatic memberLightmapCaptureGetBounds

Returns the size of the lightmap capture area.

Public methodStatic memberLightmapCaptureGetEnergy

Returns the energy multiplier used by the lightmap capture.

Public methodStatic memberLightmapCaptureGetOctree

Returns the octree used by the lightmap capture.

Public methodStatic memberLightmapCaptureGetOctreeCellSubdiv

Returns the cell subdivision amount used by this lightmap capture's octree.

Public methodStatic memberLightmapCaptureGetOctreeCellTransform

Returns the cell transform for this lightmap capture's octree.

Public methodStatic memberLightmapCaptureIsInterior

Returns true if capture is in "interior" mode.

Public methodStatic memberLightmapCaptureSetBounds

Sets the size of the area covered by the lightmap capture. Equivalent to Bounds.

Public methodStatic memberLightmapCaptureSetEnergy

Sets the energy multiplier for this lightmap capture. Equivalent to Energy.

Public methodStatic memberLightmapCaptureSetInterior

Sets the "interior" mode for this lightmap capture. Equivalent to Interior.

Public methodStatic memberLightmapCaptureSetOctree

Sets the octree to be used by this lightmap capture. This function is normally used by the BakedLightmap node. Equivalent to Octree.

Public methodStatic memberLightmapCaptureSetOctreeCellSubdiv

Sets the subdivision level of this lightmap capture's octree. Equivalent to CellSubdiv.

Public methodStatic memberLightmapCaptureSetOctreeCellTransform

Sets the octree cell transform for this lightmap capture's octree. Equivalent to CellSpaceTransform.

Public methodStatic memberLightOmniSetShadowDetail

Sets whether to use vertical or horizontal detail for this omni light. This can be used to alleviate artifacts in the shadow map. Equivalent to OmniShadowDetail.

Public methodStatic memberLightOmniSetShadowMode

Sets whether to use a dual paraboloid or a cubemap for the shadow map. Dual paraboloid is faster but may suffer from artifacts. Equivalent to OmniShadowMode.

Public methodStatic memberLightSetBakeMode

Sets the bake mode for this light, see VisualServerLightBakeMode for options. The bake mode affects how the light will be baked in BakedLightmaps and GIProbes.

Public methodStatic memberLightSetColor

Sets the color of the light. Equivalent to LightColor.

Public methodStatic memberLightSetCullMask

Sets the cull mask for this Light. Lights only affect objects in the selected layers. Equivalent to LightCullMask.

Public methodStatic memberLightSetNegative

If true, light will subtract light instead of adding light. Equivalent to LightNegative.

Public methodStatic memberLightSetParam
Public methodStatic memberLightSetProjector

Not implemented in Godot 3.x.

Public methodStatic memberLightSetReverseCullFaceMode

If true, reverses the backface culling of the mesh. This can be useful when you have a flat mesh that has a light behind it. If you need to cast a shadow on both sides of the mesh, set the mesh to use double sided shadows with InstanceGeometrySetCastShadowsSetting(RID, VisualServerShadowCastingSetting). Equivalent to ShadowReverseCullFace.

Public methodStatic memberLightSetShadow

If true, light will cast shadows. Equivalent to ShadowEnabled.

Public methodStatic memberLightSetShadowColor

Sets the color of the shadow cast by the light. Equivalent to ShadowColor.

Public methodStatic memberLightSetUseGi

Sets whether GI probes capture light information from this light. Deprecated method. Use LightSetBakeMode(RID, VisualServerLightBakeMode) instead. This method is only kept for compatibility reasons and calls LightSetBakeMode(RID, VisualServerLightBakeMode) internally, setting the bake mode to or depending on the given parameter.

Public methodStatic memberMakeSphereMesh

Returns a mesh of a sphere with the given amount of horizontal and vertical subdivisions.

Public methodStatic memberMaterialCreate

Creates an empty material and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all material_* VisualServer functions.

Once finished with your RID, you will want to free the RID using the VisualServer's FreeRid(RID) static method.

Public methodStatic memberMaterialGetParam

Returns the value of a certain material's parameter.

Public methodStatic memberMaterialGetParamDefault

Returns the default value for the param if available. Otherwise returns an empty Variant.

Public methodStatic memberMaterialGetShader

Returns the shader of a certain material's shader. Returns an empty RID if the material doesn't have a shader.

Public methodStatic memberMaterialSetLineWidth

Sets a material's line width.

Public methodStatic memberMaterialSetNextPass

Sets an object's next material.

Public methodStatic memberMaterialSetParam

Sets a material's parameter.

Public methodStatic memberMaterialSetRenderPriority

Sets a material's render priority.

Public methodStatic memberMaterialSetShader

Sets a shader material's shader.

Public methodStatic memberMeshAddSurfaceFromArrays

Adds a surface generated from the Arrays to a mesh. See VisualServerPrimitiveType constants for types.

Public methodStatic memberMeshClear

Removes all surfaces from a mesh.

Public methodStatic memberMeshCreate

Creates a new mesh and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all mesh_* VisualServer functions.

Once finished with your RID, you will want to free the RID using the VisualServer's FreeRid(RID) static method.

To place in a scene, attach this mesh to an instance using InstanceSetBase(RID, RID) using the returned RID.

Public methodStatic memberMeshGetBlendShapeCount

Returns a mesh's blend shape count.

Public methodStatic memberMeshGetBlendShapeMode

Returns a mesh's blend shape mode.

Public methodStatic memberMeshGetCustomAabb

Returns a mesh's custom aabb.

Public methodStatic memberMeshGetSurfaceCount

Returns a mesh's number of surfaces.

Public methodStatic memberMeshRemoveSurface

Removes a mesh's surface.

Public methodStatic memberMeshSetBlendShapeCount

Sets a mesh's blend shape count.

Public methodStatic memberMeshSetBlendShapeMode

Sets a mesh's blend shape mode.

Public methodStatic memberMeshSetCustomAabb

Sets a mesh's custom aabb.

Public methodStatic memberMeshSurfaceGetAabb

Returns a mesh's surface's aabb.

Public methodStatic memberMeshSurfaceGetArray

Returns a mesh's surface's vertex buffer.

Public methodStatic memberMeshSurfaceGetArrayIndexLen

Returns a mesh's surface's amount of indices.

Public methodStatic memberMeshSurfaceGetArrayLen

Returns a mesh's surface's amount of vertices.

Public methodStatic memberMeshSurfaceGetArrays

Returns a mesh's surface's buffer arrays.

Public methodStatic memberMeshSurfaceGetBlendShapeArrays

Returns a mesh's surface's arrays for blend shapes.

Public methodStatic memberMeshSurfaceGetFormat

Returns the format of a mesh's surface.

Public methodStatic memberMeshSurfaceGetFormatOffset

Function is unused in Godot 3.x.

Public methodStatic memberMeshSurfaceGetFormatStride

Function is unused in Godot 3.x.

Public methodStatic memberMeshSurfaceGetIndexArray

Returns a mesh's surface's index buffer.

Public methodStatic memberMeshSurfaceGetMaterial

Returns a mesh's surface's material.

Public methodStatic memberMeshSurfaceGetPrimitiveType

Returns the primitive type of a mesh's surface.

Public methodStatic memberMeshSurfaceGetSkeletonAabb

Returns the aabb of a mesh's surface's skeleton.

Public methodStatic memberMeshSurfaceSetMaterial

Sets a mesh's surface's material.

Public methodStatic memberMeshSurfaceUpdateRegion

Updates a specific region of a vertex buffer for the specified surface. Warning: this function alters the vertex buffer directly with no safety mechanisms, you can easily corrupt your mesh.

Public methodStatic memberMultimeshAllocate
Public methodStatic memberMultimeshCreate

Creates a new multimesh on the VisualServer and returns an RID handle. This RID will be used in all multimesh_* VisualServer functions.

Once finished with your RID, you will want to free the RID using the VisualServer's FreeRid(RID) static method.

To place in a scene, attach this multimesh to an instance using InstanceSetBase(RID, RID) using the returned RID.

Public methodStatic memberMultimeshGetAabb

Calculates and returns the axis-aligned bounding box that encloses all instances within the multimesh.

Public methodStatic memberMultimeshGetInstanceCount

Returns the number of instances allocated for this multimesh.

Public methodStatic memberMultimeshGetMesh

Returns the RID of the mesh that will be used in drawing this multimesh.

Public methodStatic memberMultimeshGetVisibleInstances

Returns the number of visible instances for this multimesh.

Public methodStatic memberMultimeshInstanceGetColor

Returns the color by which the specified instance will be modulated.

Public methodStatic memberMultimeshInstanceGetCustomData

Returns the custom data associated with the specified instance.

Public methodStatic memberMultimeshInstanceGetTransform

Returns the Transform of the specified instance.

Public methodStatic memberMultimeshInstanceGetTransform2d

Returns the Transform2D of the specified instance. For use when the multimesh is set to use 2D transforms.

Public methodStatic memberMultimeshInstanceSetColor

Sets the color by which this instance will be modulated. Equivalent to SetInstanceColor(Int32, Color).

Public methodStatic memberMultimeshInstanceSetCustomData

Sets the custom data for this instance. Custom data is passed as a Color, but is interpreted as a vec4 in the shader. Equivalent to SetInstanceCustomData(Int32, Color).

Public methodStatic memberMultimeshInstanceSetTransform

Sets the Transform for this instance. Equivalent to SetInstanceTransform(Int32, Transform).

Public methodStatic memberMultimeshInstanceSetTransform2d

Sets the Transform2D for this instance. For use when multimesh is used in 2D. Equivalent to SetInstanceTransform2d(Int32, Transform2D).

Public methodStatic memberMultimeshSetAsBulkArray

Sets all data related to the instances in one go. This is especially useful when loading the data from disk or preparing the data from GDNative.

All data is packed in one large float array. An array may look like this: Transform for instance 1, color data for instance 1, custom data for instance 1, transform for instance 2, color data for instance 2, etc.

Transform is stored as 12 floats, Transform2D is stored as 8 floats, COLOR_8BIT / CUSTOM_DATA_8BIT is stored as 1 float (4 bytes as is) and COLOR_FLOAT / CUSTOM_DATA_FLOAT is stored as 4 floats.

Public methodStatic memberMultimeshSetMesh

Sets the mesh to be drawn by the multimesh. Equivalent to Mesh.

Public methodStatic memberMultimeshSetVisibleInstances

Sets the number of instances visible at a given time. If -1, all instances that have been allocated are drawn. Equivalent to VisibleInstanceCount.

Public methodStatic memberOmniLightCreate

Creates a new omni light and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID can be used in most light_* VisualServer functions.

Once finished with your RID, you will want to free the RID using the VisualServer's FreeRid(RID) static method.

To place in a scene, attach this omni light to an instance using InstanceSetBase(RID, RID) using the returned RID.

Public methodStatic memberParticlesCreate

Creates a particle system and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all particles_* VisualServer functions.

Once finished with your RID, you will want to free the RID using the VisualServer's FreeRid(RID) static method.

To place in a scene, attach these particles to an instance using InstanceSetBase(RID, RID) using the returned RID.

Public methodStatic memberParticlesGetCurrentAabb

Calculates and returns the axis-aligned bounding box that contains all the particles. Equivalent to CaptureAabb.

Public methodStatic memberParticlesGetEmitting

Returns true if particles are currently set to emitting.

Public methodStatic memberParticlesIsInactive

Returns true if particles are not emitting and particles are set to inactive.

Public methodStatic memberParticlesRequestProcess

Add particle system to list of particle systems that need to be updated. Update will take place on the next frame, or on the next call to InstancesCullAabb(AABB, RID), InstancesCullConvex(Array, RID), or InstancesCullRay(Vector3, Vector3, RID).

Public methodStatic memberParticlesRestart

Reset the particles on the next update. Equivalent to Restart.

Public methodStatic memberParticlesSetAmount

Sets the number of particles to be drawn and allocates the memory for them. Equivalent to Amount.

Public methodStatic memberParticlesSetCustomAabb

Sets a custom axis-aligned bounding box for the particle system. Equivalent to VisibilityAabb.

Public methodStatic memberParticlesSetDrawOrder
Public methodStatic memberParticlesSetDrawPasses

Sets the number of draw passes to use. Equivalent to DrawPasses.

Public methodStatic memberParticlesSetDrawPassMesh

Sets the mesh to be used for the specified draw pass. Equivalent to DrawPass1, DrawPass2, DrawPass3, and DrawPass4.

Public methodStatic memberParticlesSetEmissionTransform

Sets the Transform that will be used by the particles when they first emit.

Public methodStatic memberParticlesSetEmitting

If true, particles will emit over time. Setting to false does not reset the particles, but only stops their emission. Equivalent to Emitting.

Public methodStatic memberParticlesSetExplosivenessRatio

Sets the explosiveness ratio. Equivalent to Explosiveness.

Public methodStatic memberParticlesSetFixedFps

Sets the frame rate that the particle system rendering will be fixed to. Equivalent to FixedFps.

Public methodStatic memberParticlesSetFractionalDelta

If true, uses fractional delta which smooths the movement of the particles. Equivalent to FractDelta.

Public methodStatic memberParticlesSetLifetime

Sets the lifetime of each particle in the system. Equivalent to Lifetime.

Public methodStatic memberParticlesSetOneShot

If true, particles will emit once and then stop. Equivalent to OneShot.

Public methodStatic memberParticlesSetPreProcessTime

Sets the preprocess time for the particles' animation. This lets you delay starting an animation until after the particles have begun emitting. Equivalent to Preprocess.

Public methodStatic memberParticlesSetProcessMaterial

Sets the material for processing the particles. Note: this is not the material used to draw the materials. Equivalent to ProcessMaterial.

Public methodStatic memberParticlesSetRandomnessRatio

Sets the emission randomness ratio. This randomizes the emission of particles within their phase. Equivalent to Randomness.

Public methodStatic memberParticlesSetSpeedScale

Sets the speed scale of the particle system. Equivalent to SpeedScale.

Public methodStatic memberParticlesSetUseLocalCoordinates

If true, particles use local coordinates. If false they use global coordinates. Equivalent to LocalCoords.

Public methodStatic memberReflectionProbeCreate

Creates a reflection probe and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all reflection_probe_* VisualServer functions.

Once finished with your RID, you will want to free the RID using the VisualServer's FreeRid(RID) static method.

To place in a scene, attach this reflection probe to an instance using InstanceSetBase(RID, RID) using the returned RID.

Public methodStatic memberReflectionProbeSetAsInterior

If true, reflections will ignore sky contribution. Equivalent to InteriorEnable.

Public methodStatic memberReflectionProbeSetCullMask

Sets the render cull mask for this reflection probe. Only instances with a matching cull mask will be rendered by this probe. Equivalent to CullMask.

Public methodStatic memberReflectionProbeSetEnableBoxProjection

If true, uses box projection. This can make reflections look more correct in certain situations. Equivalent to BoxProjection.

Public methodStatic memberReflectionProbeSetEnableShadows

If true, computes shadows in the reflection probe. This makes the reflection much slower to compute. Equivalent to EnableShadows.

Public methodStatic memberReflectionProbeSetExtents

Sets the size of the area that the reflection probe will capture. Equivalent to Extents.

Public methodStatic memberReflectionProbeSetIntensity

Sets the intensity of the reflection probe. Intensity modulates the strength of the reflection. Equivalent to Intensity.

Public methodStatic memberReflectionProbeSetInteriorAmbient

Sets the ambient light color for this reflection probe when set to interior mode. Equivalent to InteriorAmbientColor.

Public methodStatic memberReflectionProbeSetInteriorAmbientEnergy

Sets the energy multiplier for this reflection probes ambient light contribution when set to interior mode. Equivalent to InteriorAmbientEnergy.

Public methodStatic memberReflectionProbeSetInteriorAmbientProbeContribution

Sets the contribution value for how much the reflection affects the ambient light for this reflection probe when set to interior mode. Useful so that ambient light matches the color of the room. Equivalent to InteriorAmbientContrib.

Public methodStatic memberReflectionProbeSetMaxDistance

Sets the max distance away from the probe an object can be before it is culled. Equivalent to MaxDistance.

Public methodStatic memberReflectionProbeSetOriginOffset

Sets the origin offset to be used when this reflection probe is in box project mode. Equivalent to OriginOffset.

Public methodStatic memberReflectionProbeSetUpdateMode

Sets how often the reflection probe updates. Can either be once or every frame. See VisualServerReflectionProbeUpdateMode for options.

Public methodStatic memberRequestFrameDrawnCallback

Schedules a callback to the corresponding named method on where after a frame has been drawn.

The callback method must use only 1 argument which will be called with userdata.

Public methodStatic memberScenarioCreate

Creates a scenario and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all scenario_* VisualServer functions.

Once finished with your RID, you will want to free the RID using the VisualServer's FreeRid(RID) static method.

The scenario is the 3D world that all the visual instances exist in.

Public methodStatic memberScenarioSetDebug
Public methodStatic memberScenarioSetEnvironment

Sets the environment that will be used with this scenario.

Public methodStatic memberScenarioSetFallbackEnvironment

Sets the fallback environment to be used by this scenario. The fallback environment is used if no environment is set. Internally, this is used by the editor to provide a default environment.

Public methodStatic memberScenarioSetReflectionAtlasSize

Sets the size of the reflection atlas shared by all reflection probes in this scenario.

Public methodStatic memberSetBootImage

Sets a boot image. The color defines the background color. If scale is true, the image will be scaled to fit the screen size. If use_filter is true, the image will be scaled with linear interpolation. If use_filter is false, the image will be scaled with nearest-neighbor interpolation.

Public methodStatic memberSetDebugGenerateWireframes

If true, the engine will generate wireframes for use with the wireframe debug mode.

Public methodStatic memberSetDefaultClearColor

Sets the default clear color which is used when a specific clear color has not been selected.

Public methodStatic memberSetRenderLoopEnabled Obsolete.
Public methodStatic memberSetShaderTimeScale

Sets the scale to apply to the passage of time for the shaders' TIME builtin.

The default value is 1.0, which means TIME will count the real time as it goes by, without narrowing or stretching it.

Public methodStatic memberShaderCreate

Creates an empty shader and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all shader_* VisualServer functions.

Once finished with your RID, you will want to free the RID using the VisualServer's FreeRid(RID) static method.

Public methodStatic memberShaderGetCode

Returns a shader's code.

Public methodStatic memberShaderGetDefaultTextureParam

Returns a default texture from a shader searched by name.

Public methodStatic memberShaderGetParamList

Returns the parameters of a shader.

Public methodStatic memberShaderSetCode

Sets a shader's code.

Public methodStatic memberShaderSetDefaultTextureParam

Sets a shader's default texture. Overwrites the texture given by name.

Public methodStatic memberSkeletonAllocate

Allocates the GPU buffers for this skeleton.

Public methodStatic memberSkeletonBoneGetTransform

Returns the Transform set for a specific bone of this skeleton.

Public methodStatic memberSkeletonBoneGetTransform2d

Returns the Transform2D set for a specific bone of this skeleton.

Public methodStatic memberSkeletonBoneSetTransform

Sets the Transform for a specific bone of this skeleton.

Public methodStatic memberSkeletonBoneSetTransform2d

Sets the Transform2D for a specific bone of this skeleton.

Public methodStatic memberSkeletonCreate

Creates a skeleton and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all skeleton_* VisualServer functions.

Once finished with your RID, you will want to free the RID using the VisualServer's FreeRid(RID) static method.

Public methodStatic memberSkeletonGetBoneCount

Returns the number of bones allocated for this skeleton.

Public methodStatic memberSkyCreate

Creates an empty sky and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all sky_* VisualServer functions.

Once finished with your RID, you will want to free the RID using the VisualServer's FreeRid(RID) static method.

Public methodStatic memberSkySetTexture

Sets a sky's texture.

Public methodStatic memberSpotLightCreate

Creates a spot light and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID can be used in most light_* VisualServer functions.

Once finished with your RID, you will want to free the RID using the VisualServer's FreeRid(RID) static method.

To place in a scene, attach this spot light to an instance using InstanceSetBase(RID, RID) using the returned RID.

Public methodStatic memberSync

Not implemented in Godot 3.x.

Public methodStatic memberTextureAllocate

Allocates the GPU memory for the texture.

Public methodStatic memberTextureBind

Binds the texture to a texture slot.

Public methodStatic memberTextureCreate

Creates an empty texture and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all texture_* VisualServer functions.

Once finished with your RID, you will want to free the RID using the VisualServer's FreeRid(RID) static method.

Public methodStatic memberTextureCreateFromImage

Creates a texture, allocates the space for an image, and fills in the image.

Public methodStatic memberTextureDebugUsage

Returns a list of all the textures and their information.

Public methodStatic memberTextureGetData

Returns a copy of a texture's image unless it's a CubeMap, in which case it returns the RID of the image at one of the cubes sides.

Public methodStatic memberTextureGetDepth

Returns the depth of the texture.

Public methodStatic memberTextureGetFlags

Returns the flags of a texture.

Public methodStatic memberTextureGetFormat

Returns the format of the texture's image.

Public methodStatic memberTextureGetHeight

Returns the texture's height.

Public methodStatic memberTextureGetPath

Returns the texture's path.

Public methodStatic memberTextureGetTexid

Returns the opengl id of the texture's image.

Public methodStatic memberTextureGetType
Public methodStatic memberTextureGetWidth

Returns the texture's width.

Public methodStatic memberTextureSetData

Sets the texture's image data. If it's a CubeMap, it sets the image data at a cube side.

Public methodStatic memberTextureSetDataPartial

Sets a part of the data for a texture. Warning: this function calls the underlying graphics API directly and may corrupt your texture if used improperly.

Public methodStatic memberTextureSetFlags
Public methodStatic memberTextureSetPath

Sets the texture's path.

Public methodStatic memberTextureSetShrinkAllX2OnSetData

If true, sets internal processes to shrink all image data to half the size.

Public methodStatic memberTextureSetSizeOverride

Resizes the texture to the specified dimensions.

Public methodStatic memberTexturesKeepOriginal

If true, the image will be stored in the texture's images array if overwritten.

Public methodStatic memberViewportAttachCamera

Sets a viewport's camera.

Public methodStatic memberViewportAttachCanvas

Sets a viewport's canvas.

Public methodStatic memberViewportAttachToScreen

Copies viewport to a region of the screen specified by rect. If RenderDirectToScreen is true, then viewport does not use a framebuffer and the contents of the viewport are rendered directly to screen. However, note that the root viewport is drawn last, therefore it will draw over the screen. Accordingly, you must set the root viewport to an area that does not cover the area that you have attached this viewport to.

For example, you can set the root viewport to not render at all with the following code:

func _ready():
    get_viewport().set_attach_to_screen_rect(Rect2())
    $Viewport.set_attach_to_screen_rect(Rect2(0, 0, 600, 600))

Using this can result in significant optimization, especially on lower-end devices. However, it comes at the cost of having to manage your viewports manually. For a further optimization see, ViewportSetRenderDirectToScreen(RID, Boolean).

Public methodStatic memberViewportCreate

Creates an empty viewport and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all viewport_* VisualServer functions.

Once finished with your RID, you will want to free the RID using the VisualServer's FreeRid(RID) static method.

Public methodStatic memberViewportDetach

Detaches the viewport from the screen.

Public methodStatic memberViewportGetRenderInfo

Returns a viewport's render information. For options, see the VisualServerViewportRenderInfo constants.

Public methodStatic memberViewportGetTexture

Returns the viewport's last rendered frame.

Public methodStatic memberViewportRemoveCanvas

Detaches a viewport from a canvas and vice versa.

Public methodStatic memberViewportSetActive

If true, sets the viewport active, else sets it inactive.

Public methodStatic memberViewportSetCanvasStacking

Sets the stacking order for a viewport's canvas.

layer is the actual canvas layer, while sublayer specifies the stacking order of the canvas among those in the same layer.

Public methodStatic memberViewportSetCanvasTransform

Sets the transformation of a viewport's canvas.

Public methodStatic memberViewportSetClearMode
Public methodStatic memberViewportSetDebugDraw
Public methodStatic memberViewportSetDisable3d

If true, a viewport's 3D rendering is disabled.

Public methodStatic memberViewportSetDisableEnvironment

If true, rendering of a viewport's environment is disabled.

Public methodStatic memberViewportSetGlobalCanvasTransform

Sets the viewport's global transformation matrix.

Public methodStatic memberViewportSetHdr

If true, the viewport renders to hdr.

Public methodStatic memberViewportSetHideCanvas

If true, the viewport's canvas is not rendered.

Public methodStatic memberViewportSetHideScenario

Currently unimplemented in Godot 3.x.

Public methodStatic memberViewportSetMsaa
Public methodStatic memberViewportSetParentViewport

Sets the viewport's parent to another viewport.

Public methodStatic memberViewportSetRenderDirectToScreen

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

Public methodStatic memberViewportSetScenario

Sets a viewport's scenario.

The scenario contains information about the VisualServerScenarioDebugMode, environment information, reflection atlas etc.

Public methodStatic memberViewportSetShadowAtlasQuadrantSubdivision

Sets the shadow atlas quadrant's subdivision.

Public methodStatic memberViewportSetShadowAtlasSize

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

Public methodStatic memberViewportSetSize

Sets the viewport's width and height.

Public methodStatic memberViewportSetTransparentBackground

If true, the viewport renders its background as transparent.

Public methodStatic memberViewportSetUpdateMode

Sets when the viewport should be updated. See VisualServerViewportUpdateMode constants for options.

Public methodStatic memberViewportSetUsage
Public methodStatic memberViewportSetUseArvr

If true, the viewport uses augmented or virtual reality technologies. See ARVRInterface.

Public methodStatic memberViewportSetUseDebanding

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

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

Public methodStatic memberViewportSetUseFxaa

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

Public methodStatic memberViewportSetVflip

If true, the viewport's rendering is flipped vertically.

Top
Fields
  NameDescription
Public fieldStatic memberArrayWeightsSize

Number of weights/bones per vertex.

Public fieldStatic memberCanvasItemZMax

The maximum Z-layer for canvas items.

Public fieldStatic memberCanvasItemZMin

The minimum Z-layer for canvas items.

Public fieldStatic memberMaterialRenderPriorityMax

The maximum renderpriority of all materials.

Public fieldStatic memberMaterialRenderPriorityMin

The minimum renderpriority of all materials.

Public fieldStatic memberMaxCursors

Unused enum in Godot 3.x.

Public fieldStatic memberMaxGlowLevels

Max number of glow levels that can be used with glow post-process effect.

Public fieldStatic memberNoIndexArray

Marks an error that shows that the index array is empty.

Top
See Also