VisualServerSingleton

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 or viewportAttachCanvas. 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 Spatial.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. The instance must also be attached to the scenario using instanceSetScenario 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.

@GodotBaseClass
struct VisualServerSingleton {}

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Enums

ArrayFormat
enum ArrayFormat
ArrayType
enum ArrayType
BlendShapeMode
enum BlendShapeMode
CanvasLightMode
enum CanvasLightMode
CanvasLightShadowFilter
enum CanvasLightShadowFilter
CanvasOccluderPolygonCullMode
enum CanvasOccluderPolygonCullMode
Constants
enum Constants
CubeMapSide
enum CubeMapSide
EnvironmentBG
enum EnvironmentBG
EnvironmentDOFBlurQuality
enum EnvironmentDOFBlurQuality
EnvironmentGlowBlendMode
enum EnvironmentGlowBlendMode
EnvironmentSSAOBlur
enum EnvironmentSSAOBlur
EnvironmentSSAOQuality
enum EnvironmentSSAOQuality
EnvironmentToneMapper
enum EnvironmentToneMapper
Features
enum Features
InstanceFlags
enum InstanceFlags
InstanceType
enum InstanceType
LightBakeMode
enum LightBakeMode
LightDirectionalShadowDepthRangeMode
enum LightDirectionalShadowDepthRangeMode
LightDirectionalShadowMode
enum LightDirectionalShadowMode
LightOmniShadowDetail
enum LightOmniShadowDetail
LightOmniShadowMode
enum LightOmniShadowMode
LightParam
enum LightParam
LightType
enum LightType
MultimeshColorFormat
enum MultimeshColorFormat
MultimeshCustomDataFormat
enum MultimeshCustomDataFormat
MultimeshTransformFormat
enum MultimeshTransformFormat
NinePatchAxisMode
enum NinePatchAxisMode
ParticlesDrawOrder
enum ParticlesDrawOrder
PrimitiveType
enum PrimitiveType
ReflectionProbeUpdateMode
enum ReflectionProbeUpdateMode
RenderInfo
enum RenderInfo
ScenarioDebugMode
enum ScenarioDebugMode
ShaderMode
enum ShaderMode
ShadowCastingSetting
enum ShadowCastingSetting
TextureFlags
enum TextureFlags
TextureType
enum TextureType
ViewportClearMode
enum ViewportClearMode
ViewportDebugDraw
enum ViewportDebugDraw
ViewportMSAA
enum ViewportMSAA
ViewportRenderInfo
enum ViewportRenderInfo
ViewportUpdateMode
enum ViewportUpdateMode
ViewportUsage
enum ViewportUsage

Functions

_init
void _init()

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.

blackBarsSetImages
void blackBarsSetImages(RID left, RID top, RID right, RID bottom)

Sets images to be rendered in the window margin.

blackBarsSetMargins
void blackBarsSetMargins(long left, long top, long right, long bottom)

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

cameraCreate
RID cameraCreate()

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 static method.

cameraSetCullMask
void cameraSetCullMask(RID camera, long layers)

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

cameraSetEnvironment
void cameraSetEnvironment(RID camera, RID env)

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

cameraSetFrustum
void cameraSetFrustum(RID camera, double size, Vector2 offset, double z_near, double z_far)

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

cameraSetOrthogonal
void cameraSetOrthogonal(RID camera, double size, double z_near, double z_far)

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.

cameraSetPerspective
void cameraSetPerspective(RID camera, double fovy_degrees, double z_near, double z_far)

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

cameraSetTransform
void cameraSetTransform(RID camera, Transform transform)

Sets Transform of camera.

cameraSetUseVerticalAspect
void cameraSetUseVerticalAspect(RID camera, bool enable)

If true, preserves the horizontal aspect ratio which is equivalent to constant Camera.KEEP_WIDTH. If false, preserves the vertical aspect ratio which is equivalent to constant Camera.KEEP_HEIGHT.

canvasCreate
RID canvasCreate()

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 static method.

canvasItemAddCircle
void canvasItemAddCircle(RID item, Vector2 pos, double radius, Color color)

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

canvasItemAddClipIgnore
void canvasItemAddClipIgnore(RID item, bool ignore)

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

canvasItemAddLine
void canvasItemAddLine(RID item, Vector2 from, Vector2 to, Color color, double width, bool antialiased)

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

canvasItemAddMesh
void canvasItemAddMesh(RID item, RID mesh, Transform2D transform, Color modulate, RID texture, RID normal_map)

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

canvasItemAddMultimesh
void canvasItemAddMultimesh(RID item, RID mesh, RID texture, RID normal_map)

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

canvasItemAddNinePatch
void canvasItemAddNinePatch(RID item, Rect2 rect, Rect2 source, RID texture, Vector2 topleft, Vector2 bottomright, long x_axis_mode, long y_axis_mode, bool draw_center, Color modulate, RID normal_map)

Adds a nine patch image to the CanvasItem's draw commands. See NinePatchRect for more explanation.

canvasItemAddParticles
void canvasItemAddParticles(RID item, RID particles, RID texture, RID normal_map)

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

canvasItemAddPolygon
void canvasItemAddPolygon(RID item, PoolVector2Array points, PoolColorArray colors, PoolVector2Array uvs, RID texture, RID normal_map, bool antialiased)

Adds a polygon to the CanvasItem's draw commands.

canvasItemAddPolyline
void canvasItemAddPolyline(RID item, PoolVector2Array points, PoolColorArray colors, double width, bool antialiased)

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

canvasItemAddPrimitive
void canvasItemAddPrimitive(RID item, PoolVector2Array points, PoolColorArray colors, PoolVector2Array uvs, RID texture, double width, RID normal_map)

Adds a primitive to the CanvasItem's draw commands.

canvasItemAddRect
void canvasItemAddRect(RID item, Rect2 rect, Color color)

Adds a rectangle to the CanvasItem's draw commands.

canvasItemAddSetTransform
void canvasItemAddSetTransform(RID item, Transform2D transform)

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.

canvasItemAddTextureRect
void canvasItemAddTextureRect(RID item, Rect2 rect, RID texture, bool tile, Color modulate, bool transpose, RID normal_map)

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

canvasItemAddTextureRectRegion
void canvasItemAddTextureRectRegion(RID item, Rect2 rect, RID texture, Rect2 src_rect, Color modulate, bool transpose, RID normal_map, bool clip_uv)

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

canvasItemAddTriangleArray
void canvasItemAddTriangleArray(RID item, PoolIntArray indices, PoolVector2Array points, PoolColorArray colors, PoolVector2Array uvs, PoolIntArray bones, PoolRealArray weights, RID texture, long count, RID normal_map, bool antialiased, bool antialiasing_use_indices)

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

canvasItemClear
void canvasItemClear(RID item)

Clears the CanvasItem and removes all commands in it.

canvasItemCreate
RID canvasItemCreate()

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 static method.

canvasItemSetClip
void canvasItemSetClip(RID item, bool clip)

Sets clipping for the CanvasItem.

canvasItemSetCopyToBackbuffer
void canvasItemSetCopyToBackbuffer(RID item, bool enabled, Rect2 rect)

Sets the CanvasItem to copy a rect to the backbuffer.

canvasItemSetCustomRect
void canvasItemSetCustomRect(RID item, bool use_custom_rect, Rect2 rect)

Defines a custom drawing rectangle for the CanvasItem.

canvasItemSetDistanceFieldMode
void canvasItemSetDistanceFieldMode(RID item, bool enabled)

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

canvasItemSetDrawBehindParent
void canvasItemSetDrawBehindParent(RID item, bool enabled)

Sets CanvasItem to be drawn behind its parent.

canvasItemSetDrawIndex
void canvasItemSetDrawIndex(RID item, long index)

Sets the index for the CanvasItem.

canvasItemSetLightMask
void canvasItemSetLightMask(RID item, long mask)

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

canvasItemSetMaterial
void canvasItemSetMaterial(RID item, RID material)

Sets a new material to the CanvasItem.

canvasItemSetModulate
void canvasItemSetModulate(RID item, Color color)

Sets the color that modulates the CanvasItem and its children.

canvasItemSetParent
void canvasItemSetParent(RID item, RID parent)

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.

canvasItemSetSelfModulate
void canvasItemSetSelfModulate(RID item, Color color)

Sets the color that modulates the CanvasItem without children.

canvasItemSetSortChildrenByY
void canvasItemSetSortChildrenByY(RID item, bool enabled)

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

canvasItemSetTransform
void canvasItemSetTransform(RID item, Transform2D transform)

Sets the CanvasItem's Transform2D.

canvasItemSetUseParentMaterial
void canvasItemSetUseParentMaterial(RID item, bool enabled)

Sets if the CanvasItem uses its parent's material.

canvasItemSetVisible
void canvasItemSetVisible(RID item, bool visible)

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

canvasItemSetZAsRelativeToParent
void canvasItemSetZAsRelativeToParent(RID item, bool enabled)

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

canvasItemSetZIndex
void canvasItemSetZIndex(RID item, long z_index)

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

canvasLightAttachToCanvas
void canvasLightAttachToCanvas(RID light, RID canvas)

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

canvasLightCreate
RID canvasLightCreate()

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 static method.

canvasLightOccluderAttachToCanvas
void canvasLightOccluderAttachToCanvas(RID occluder, RID canvas)

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

canvasLightOccluderCreate
RID canvasLightOccluderCreate()

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 static method.

canvasLightOccluderSetEnabled
void canvasLightOccluderSetEnabled(RID occluder, bool enabled)

Enables or disables light occluder.

canvasLightOccluderSetLightMask
void canvasLightOccluderSetLightMask(RID occluder, long mask)

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

canvasLightOccluderSetPolygon
void canvasLightOccluderSetPolygon(RID occluder, RID polygon)

Sets a light occluder's polygon.

canvasLightOccluderSetTransform
void canvasLightOccluderSetTransform(RID occluder, Transform2D transform)

Sets a light occluder's Transform2D.

canvasLightSetColor
void canvasLightSetColor(RID light, Color color)

Sets the color for a light.

canvasLightSetEnabled
void canvasLightSetEnabled(RID light, bool enabled)

Enables or disables a canvas light.

canvasLightSetEnergy
void canvasLightSetEnergy(RID light, double energy)

Sets a canvas light's energy.

canvasLightSetHeight
void canvasLightSetHeight(RID light, double height)

Sets a canvas light's height.

canvasLightSetItemCullMask
void canvasLightSetItemCullMask(RID light, long mask)

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

canvasLightSetItemShadowCullMask
void canvasLightSetItemShadowCullMask(RID light, long mask)

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

canvasLightSetLayerRange
void canvasLightSetLayerRange(RID light, long min_layer, long max_layer)

The layer range that gets rendered with this light.

canvasLightSetMode
void canvasLightSetMode(RID light, long mode)

The mode of the light, see canvaslightmode constants.

canvasLightSetScale
void canvasLightSetScale(RID light, double scale)

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

canvasLightSetShadowBufferSize
void canvasLightSetShadowBufferSize(RID light, long size)

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

canvasLightSetShadowColor
void canvasLightSetShadowColor(RID light, Color color)

Sets the color of the canvas light's shadow.

canvasLightSetShadowEnabled
void canvasLightSetShadowEnabled(RID light, bool enabled)

Enables or disables the canvas light's shadow.

canvasLightSetShadowFilter
void canvasLightSetShadowFilter(RID light, long filter)

Sets the canvas light's shadow's filter, see canvaslightshadowfilter constants.

canvasLightSetShadowGradientLength
void canvasLightSetShadowGradientLength(RID light, double length)

Sets the length of the shadow's gradient.

canvasLightSetShadowSmooth
void canvasLightSetShadowSmooth(RID light, double smooth)

Smoothens the shadow. The lower, the smoother.

canvasLightSetTexture
void canvasLightSetTexture(RID light, RID texture)

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

canvasLightSetTextureOffset
void canvasLightSetTextureOffset(RID light, Vector2 offset)

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

canvasLightSetTransform
void canvasLightSetTransform(RID light, Transform2D transform)

Sets the canvas light's Transform2D.

canvasLightSetZRange
void canvasLightSetZRange(RID light, long min_z, long max_z)

Sets the Z range of objects that will be affected by this light. Equivalent to Light2D.rangeZMin and Light2D.rangeZMax.

canvasOccluderPolygonCreate
RID canvasOccluderPolygonCreate()

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 static method.

canvasOccluderPolygonSetCullMode
void canvasOccluderPolygonSetCullMode(RID occluder_polygon, long mode)

Sets an occluder polygons cull mode. See canvasoccluderpolygoncullmode constants.

canvasOccluderPolygonSetShape
void canvasOccluderPolygonSetShape(RID occluder_polygon, PoolVector2Array shape, bool closed)

Sets the shape of the occluder polygon.

canvasOccluderPolygonSetShapeAsLines
void canvasOccluderPolygonSetShapeAsLines(RID occluder_polygon, PoolVector2Array shape)

Sets the shape of the occluder polygon as lines.

canvasSetItemMirroring
void canvasSetItemMirroring(RID canvas, RID item, Vector2 mirroring)

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

canvasSetModulate
void canvasSetModulate(RID canvas, Color color)

Modulates all colors in the given canvas.

directionalLightCreate
RID directionalLightCreate()

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 static method. To place in a scene, attach this directional light to an instance using instanceSetBase using the returned RID.

draw
void draw(bool swap_buffers, double frame_step)

Draws a frame. This method is deprecated, please use forceDraw instead.

environmentCreate
RID environmentCreate()

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 static method.

environmentSetAdjustment
void environmentSetAdjustment(RID env, bool enable, double brightness, double contrast, double saturation, RID ramp)

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

environmentSetAmbientLight
void environmentSetAmbientLight(RID env, Color color, double energy, double sky_contibution)

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

environmentSetBackground
void environmentSetBackground(RID env, long bg)

Sets the BGMode of the environment. Equivalent to Environment.backgroundMode.

environmentSetBgColor
void environmentSetBgColor(RID env, Color color)

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

environmentSetBgEnergy
void environmentSetBgEnergy(RID env, double energy)

Sets the intensity of the background color.

environmentSetCanvasMaxLayer
void environmentSetCanvasMaxLayer(RID env, long max_layer)

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

environmentSetDofBlurFar
void environmentSetDofBlurFar(RID env, bool enable, double distance, double transition, double far_amount, long quality)

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

environmentSetDofBlurNear
void environmentSetDofBlurNear(RID env, bool enable, double distance, double transition, double far_amount, long quality)

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

environmentSetFog
void environmentSetFog(RID env, bool enable, Color color, Color sun_color, double sun_amount)

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

environmentSetFogDepth
void environmentSetFogDepth(RID env, bool enable, double depth_begin, double depth_end, double depth_curve, bool transmit, double transmit_curve)

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

environmentSetFogHeight
void environmentSetFogHeight(RID env, bool enable, double min_height, double max_height, double height_curve)

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

environmentSetGlow
void environmentSetGlow(RID env, bool enable, long level_flags, double intensity, double strength, double bloom_threshold, long blend_mode, double hdr_bleed_threshold, double hdr_bleed_scale, double hdr_luminance_cap, bool bicubic_upscale)

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

environmentSetSky
void environmentSetSky(RID env, RID sky)

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

environmentSetSkyCustomFov
void environmentSetSkyCustomFov(RID env, double scale)

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

environmentSetSkyOrientation
void environmentSetSkyOrientation(RID env, Basis orientation)

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

environmentSetSsao
void environmentSetSsao(RID env, bool enable, double radius, double intensity, double radius2, double intensity2, double bias, double light_affect, double ao_channel_affect, Color color, long quality, long blur, double bilateral_sharpness)

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

environmentSetSsr
void environmentSetSsr(RID env, bool enable, long max_steps, double fade_in, double fade_out, double depth_tolerance, bool roughness)

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

environmentSetTonemap
void environmentSetTonemap(RID env, long tone_mapper, double exposure, double white, bool auto_exposure, double min_luminance, double max_luminance, double auto_exp_speed, double auto_exp_grey)

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

finish
void finish()

Removes buffers and clears testcubes.

forceDraw
void forceDraw(bool swap_buffers, double frame_step)

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.

forceSync
void forceSync()

Synchronizes threads.

freeRid
void freeRid(RID rid)

Tries to free an object in the VisualServer.

getRenderInfo
long getRenderInfo(long info)

Returns a certain information, see renderinfo for options.

getTestCube
RID getTestCube()

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

getTestTexture
RID getTestTexture()

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

getVideoAdapterName
String getVideoAdapterName()

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.

getVideoAdapterVendor
String getVideoAdapterVendor()

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.

getWhiteTexture
RID getWhiteTexture()

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

giProbeCreate
RID giProbeCreate()

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 static method. To place in a scene, attach this GI probe to an instance using instanceSetBase using the returned RID.

giProbeGetBias
double giProbeGetBias(RID probe)

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

giProbeGetBounds
AABB giProbeGetBounds(RID probe)

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

giProbeGetCellSize
double giProbeGetCellSize(RID probe)

Returns the cell size set by giProbeSetCellSize.

giProbeGetDynamicData
PoolIntArray giProbeGetDynamicData(RID probe)

Returns the data used by the GI probe.

giProbeGetDynamicRange
long giProbeGetDynamicRange(RID probe)

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

giProbeGetEnergy
double giProbeGetEnergy(RID probe)

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

giProbeGetNormalBias
double giProbeGetNormalBias(RID probe)

Returns the normal bias for this GI probe. Equivalent to GIProbe.normalBias.

giProbeGetPropagation
double giProbeGetPropagation(RID probe)

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

giProbeGetToCellXform
Transform giProbeGetToCellXform(RID probe)

Returns the Transform set by giProbeSetToCellXform.

giProbeIsCompressed
bool giProbeIsCompressed(RID probe)

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

giProbeIsInterior
bool giProbeIsInterior(RID probe)

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

giProbeSetBias
void giProbeSetBias(RID probe, double bias)

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

giProbeSetBounds
void giProbeSetBounds(RID probe, AABB bounds)

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

giProbeSetCellSize
void giProbeSetCellSize(RID probe, double range)

Sets the size of individual cells within the GI probe.

giProbeSetCompress
void giProbeSetCompress(RID probe, bool enable)

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

giProbeSetDynamicData
void giProbeSetDynamicData(RID probe, PoolIntArray data)

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.

giProbeSetDynamicRange
void giProbeSetDynamicRange(RID probe, long range)

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 GIProbe.dynamicRange.

giProbeSetEnergy
void giProbeSetEnergy(RID probe, double energy)

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

giProbeSetInterior
void giProbeSetInterior(RID probe, bool enable)

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

giProbeSetNormalBias
void giProbeSetNormalBias(RID probe, double bias)

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 GIProbe.normalBias.

giProbeSetPropagation
void giProbeSetPropagation(RID probe, double propagation)

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

giProbeSetToCellXform
void giProbeSetToCellXform(RID probe, Transform xform)

Sets the to cell Transform for this GI probe.

hasChanged
bool hasChanged()

Returns true if changes have been made to the VisualServer's data. draw is usually called if this happens.

hasFeature
bool hasFeature(long feature)

Not yet implemented. Always returns false.

hasOsFeature
bool hasOsFeature(String feature)

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.

immediateBegin
void immediateBegin(RID immediate, long primitive, RID texture)

Sets up ImmediateGeometry internals to prepare for drawing. Equivalent to ImmediateGeometry.begin.

immediateClear
void immediateClear(RID immediate)

Clears everything that was set up between immediateBegin and immediateEnd. Equivalent to ImmediateGeometry.clear.

immediateColor
void immediateColor(RID immediate, Color color)

Sets the color to be used with next vertex. Equivalent to ImmediateGeometry.setColor.

immediateCreate
RID immediateCreate()

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 static method. To place in a scene, attach this immediate geometry to an instance using instanceSetBase using the returned RID.

immediateEnd
void immediateEnd(RID immediate)

Ends drawing the ImmediateGeometry and displays it. Equivalent to ImmediateGeometry.end.

immediateGetMaterial
RID immediateGetMaterial(RID immediate)

Returns the material assigned to the ImmediateGeometry.

immediateNormal
void immediateNormal(RID immediate, Vector3 normal)

Sets the normal to be used with next vertex. Equivalent to ImmediateGeometry.setNormal.

immediateSetMaterial
void immediateSetMaterial(RID immediate, RID material)

Sets the material to be used to draw the ImmediateGeometry.

immediateTangent
void immediateTangent(RID immediate, Plane tangent)

Sets the tangent to be used with next vertex. Equivalent to ImmediateGeometry.setTangent.

immediateUv
void immediateUv(RID immediate, Vector2 tex_uv)

Sets the UV to be used with next vertex. Equivalent to ImmediateGeometry.setUv.

immediateUv2
void immediateUv2(RID immediate, Vector2 tex_uv)

Sets the UV2 to be used with next vertex. Equivalent to ImmediateGeometry.setUv2.

immediateVertex
void immediateVertex(RID immediate, Vector3 vertex)

Adds the next vertex using the information provided in advance. Equivalent to ImmediateGeometry.addVertex.

immediateVertex2d
void immediateVertex2d(RID immediate, Vector2 vertex)

Adds the next vertex using the information provided in advance. This is a helper class that calls immediateVertex under the hood. Equivalent to ImmediateGeometry.addVertex.

instanceAttachObjectInstanceId
void instanceAttachObjectInstanceId(RID instance, long id)

Attaches a unique Object ID to instance. Object ID must be attached to instance for proper culling with instancesCullAabb, instancesCullConvex, and instancesCullRay.

instanceAttachSkeleton
void instanceAttachSkeleton(RID instance, RID skeleton)

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

instanceCreate
RID instanceCreate()

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

instanceCreate2
RID instanceCreate2(RID base, RID scenario)

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 static method.

instanceGeometrySetAsInstanceLod
void instanceGeometrySetAsInstanceLod(RID instance, RID as_lod_of_instance)

Not implemented in Godot 3.x.

instanceGeometrySetCastShadowsSetting
void instanceGeometrySetCastShadowsSetting(RID instance, long shadow_casting_setting)

Sets the shadow casting setting to one of shadowcastingsetting. Equivalent to GeometryInstance.castShadow.

instanceGeometrySetDrawRange
void instanceGeometrySetDrawRange(RID instance, double min, double max, double min_margin, double max_margin)

Not implemented in Godot 3.x.

instanceGeometrySetFlag
void instanceGeometrySetFlag(RID instance, long flag, bool enabled)

Sets the flag for a given instanceflags. See instanceflags for more details.

instanceGeometrySetMaterialOverride
void instanceGeometrySetMaterialOverride(RID instance, RID material)

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

instanceSetBase
void instanceSetBase(RID instance, RID base)

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.

instanceSetBlendShapeWeight
void instanceSetBlendShapeWeight(RID instance, long shape, double weight)

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

instanceSetCustomAabb
void instanceSetCustomAabb(RID instance, AABB aabb)

Sets a custom AABB to use when culling objects from the view frustum. Equivalent to GeometryInstance.setCustomAabb.

instanceSetExterior
void instanceSetExterior(RID instance, bool enabled)

Function not implemented in Godot 3.x.

instanceSetExtraVisibilityMargin
void instanceSetExtraVisibilityMargin(RID instance, double margin)

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 GeometryInstance.extraCullMargin.

instanceSetLayerMask
void instanceSetLayerMask(RID instance, long mask)

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

instanceSetScenario
void instanceSetScenario(RID instance, RID scenario)

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

instanceSetSurfaceMaterial
void instanceSetSurfaceMaterial(RID instance, long surface, RID material)

Sets the material of a specific surface. Equivalent to MeshInstance.setSurfaceMaterial.

instanceSetTransform
void instanceSetTransform(RID instance, Transform transform)

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

instanceSetUseLightmap
void instanceSetUseLightmap(RID instance, RID lightmap_instance, RID lightmap, long lightmap_slice, Rect2 lightmap_uv_rect)

Sets the lightmap to use with this instance.

instanceSetVisible
void instanceSetVisible(RID instance, bool visible)

Sets whether an instance is drawn or not. Equivalent to Spatial.visible.

instancesCullAabb
Array instancesCullAabb(AABB aabb, RID scenario)

Returns an array of object IDs intersecting with the provided AABB. Only visual 3D nodes are considered, such as MeshInstance or DirectionalLight. Use @GDScript.instanceFromId 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.

instancesCullConvex
Array instancesCullConvex(Array convex, RID scenario)

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

instancesCullRay
Array instancesCullRay(Vector3 from, Vector3 to, RID scenario)

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

isRenderLoopEnabled
bool isRenderLoopEnabled()
lightDirectionalSetBlendSplits
void lightDirectionalSetBlendSplits(RID light, bool enable)

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

lightDirectionalSetShadowDepthRangeMode
void lightDirectionalSetShadowDepthRangeMode(RID light, long range_mode)

Sets the shadow depth range mode for this directional light. Equivalent to DirectionalLight.directionalShadowDepthRange. See lightdirectionalshadowdepthrangemode for options.

lightDirectionalSetShadowMode
void lightDirectionalSetShadowMode(RID light, long mode)

Sets the shadow mode for this directional light. Equivalent to DirectionalLight.directionalShadowMode. See lightdirectionalshadowmode for options.

lightOmniSetShadowDetail
void lightOmniSetShadowDetail(RID light, long detail)

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 OmniLight.omniShadowDetail.

lightOmniSetShadowMode
void lightOmniSetShadowMode(RID light, long mode)

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 OmniLight.omniShadowMode.

lightSetBakeMode
void lightSetBakeMode(RID light, long bake_mode)

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

lightSetColor
void lightSetColor(RID light, Color color)

Sets the color of the light. Equivalent to Light.lightColor.

lightSetCullMask
void lightSetCullMask(RID light, long mask)

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

lightSetNegative
void lightSetNegative(RID light, bool enable)

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

lightSetParam
void lightSetParam(RID light, long param, double value)

Sets the specified light parameter. See lightparam for options. Equivalent to Light.setParam.

lightSetProjector
void lightSetProjector(RID light, RID texture)

Not implemented in Godot 3.x.

lightSetReverseCullFaceMode
void lightSetReverseCullFaceMode(RID light, bool enabled)

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. Equivalent to Light.shadowReverseCullFace.

lightSetShadow
void lightSetShadow(RID light, bool enabled)

If true, light will cast shadows. Equivalent to Light.shadowEnabled.

lightSetShadowColor
void lightSetShadowColor(RID light, Color color)

Sets the color of the shadow cast by the light. Equivalent to Light.shadowColor.

lightSetUseGi
void lightSetUseGi(RID light, bool enabled)

Sets whether GI probes capture light information from this light. Deprecated method. Use lightSetBakeMode instead. This method is only kept for compatibility reasons and calls lightSetBakeMode internally, setting the bake mode to constant LIGHT_BAKE_DISABLED or constant LIGHT_BAKE_INDIRECT depending on the given parameter.

lightmapCaptureCreate
RID lightmapCaptureCreate()

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 static method. To place in a scene, attach this lightmap capture to an instance using instanceSetBase using the returned RID.

lightmapCaptureGetBounds
AABB lightmapCaptureGetBounds(RID capture)

Returns the size of the lightmap capture area.

lightmapCaptureGetEnergy
double lightmapCaptureGetEnergy(RID capture)

Returns the energy multiplier used by the lightmap capture.

lightmapCaptureGetOctree
PoolByteArray lightmapCaptureGetOctree(RID capture)

Returns the octree used by the lightmap capture.

lightmapCaptureGetOctreeCellSubdiv
long lightmapCaptureGetOctreeCellSubdiv(RID capture)

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

lightmapCaptureGetOctreeCellTransform
Transform lightmapCaptureGetOctreeCellTransform(RID capture)

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

lightmapCaptureIsInterior
bool lightmapCaptureIsInterior(RID capture)

Returns true if capture is in "interior" mode.

lightmapCaptureSetBounds
void lightmapCaptureSetBounds(RID capture, AABB bounds)

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

lightmapCaptureSetEnergy
void lightmapCaptureSetEnergy(RID capture, double energy)

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

lightmapCaptureSetInterior
void lightmapCaptureSetInterior(RID capture, bool interior)

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

lightmapCaptureSetOctree
void lightmapCaptureSetOctree(RID capture, PoolByteArray octree)

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

lightmapCaptureSetOctreeCellSubdiv
void lightmapCaptureSetOctreeCellSubdiv(RID capture, long subdiv)

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

lightmapCaptureSetOctreeCellTransform
void lightmapCaptureSetOctreeCellTransform(RID capture, Transform xform)

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

makeSphereMesh
RID makeSphereMesh(long latitudes, long longitudes, double radius)

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

materialCreate
RID materialCreate()

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 static method.

materialGetParam
Variant materialGetParam(RID material, String parameter)

Returns the value of a certain material's parameter.

materialGetParamDefault
Variant materialGetParamDefault(RID material, String parameter)

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

materialGetShader
RID materialGetShader(RID shader_material)

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

materialSetLineWidth
void materialSetLineWidth(RID material, double width)

Sets a material's line width.

materialSetNextPass
void materialSetNextPass(RID material, RID next_material)

Sets an object's next material.

materialSetParam
void materialSetParam(RID material, String parameter, VariantArg2 value)

Sets a material's parameter.

materialSetRenderPriority
void materialSetRenderPriority(RID material, long priority)

Sets a material's render priority.

materialSetShader
void materialSetShader(RID shader_material, RID shader)

Sets a shader material's shader.

meshAddSurfaceFromArrays
void meshAddSurfaceFromArrays(RID mesh, long primitive, Array arrays, Array blend_shapes, long compress_format)

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

meshClear
void meshClear(RID mesh)

Removes all surfaces from a mesh.

meshCreate
RID meshCreate()

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 static method. To place in a scene, attach this mesh to an instance using instanceSetBase using the returned RID.

meshGetBlendShapeCount
long meshGetBlendShapeCount(RID mesh)

Returns a mesh's blend shape count.

meshGetBlendShapeMode
VisualServer.BlendShapeMode meshGetBlendShapeMode(RID mesh)

Returns a mesh's blend shape mode.

meshGetCustomAabb
AABB meshGetCustomAabb(RID mesh)

Returns a mesh's custom aabb.

meshGetSurfaceCount
long meshGetSurfaceCount(RID mesh)

Returns a mesh's number of surfaces.

meshRemoveSurface
void meshRemoveSurface(RID mesh, long index)

Removes a mesh's surface.

meshSetBlendShapeCount
void meshSetBlendShapeCount(RID mesh, long amount)

Sets a mesh's blend shape count.

meshSetBlendShapeMode
void meshSetBlendShapeMode(RID mesh, long mode)

Sets a mesh's blend shape mode.

meshSetCustomAabb
void meshSetCustomAabb(RID mesh, AABB aabb)

Sets a mesh's custom aabb.

meshSurfaceGetAabb
AABB meshSurfaceGetAabb(RID mesh, long surface)

Returns a mesh's surface's aabb.

meshSurfaceGetArray
PoolByteArray meshSurfaceGetArray(RID mesh, long surface)

Returns a mesh's surface's vertex buffer.

meshSurfaceGetArrayIndexLen
long meshSurfaceGetArrayIndexLen(RID mesh, long surface)

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

meshSurfaceGetArrayLen
long meshSurfaceGetArrayLen(RID mesh, long surface)

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

meshSurfaceGetArrays
Array meshSurfaceGetArrays(RID mesh, long surface)

Returns a mesh's surface's buffer arrays.

meshSurfaceGetBlendShapeArrays
Array meshSurfaceGetBlendShapeArrays(RID mesh, long surface)

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

meshSurfaceGetFormat
long meshSurfaceGetFormat(RID mesh, long surface)

Returns the format of a mesh's surface.

meshSurfaceGetFormatOffset
long meshSurfaceGetFormatOffset(long format, long vertex_len, long index_len, long array_index)

Function is unused in Godot 3.x.

meshSurfaceGetFormatStride
long meshSurfaceGetFormatStride(long format, long vertex_len, long index_len)

Function is unused in Godot 3.x.

meshSurfaceGetIndexArray
PoolByteArray meshSurfaceGetIndexArray(RID mesh, long surface)

Returns a mesh's surface's index buffer.

meshSurfaceGetMaterial
RID meshSurfaceGetMaterial(RID mesh, long surface)

Returns a mesh's surface's material.

meshSurfaceGetPrimitiveType
VisualServer.PrimitiveType meshSurfaceGetPrimitiveType(RID mesh, long surface)

Returns the primitive type of a mesh's surface.

meshSurfaceGetSkeletonAabb
Array meshSurfaceGetSkeletonAabb(RID mesh, long surface)

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

meshSurfaceSetMaterial
void meshSurfaceSetMaterial(RID mesh, long surface, RID material)

Sets a mesh's surface's material.

meshSurfaceUpdateRegion
void meshSurfaceUpdateRegion(RID mesh, long surface, long offset, PoolByteArray data)

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.

multimeshAllocate
void multimeshAllocate(RID multimesh, long instances, long transform_format, long color_format, long custom_data_format)

Allocates space for the multimesh data. Format parameters determine how the data will be stored by OpenGL. See multimeshtransformformat, multimeshcolorformat, and multimeshcustomdataformat for usage. Equivalent to MultiMesh.instanceCount.

multimeshCreate
RID multimeshCreate()

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 static method. To place in a scene, attach this multimesh to an instance using instanceSetBase using the returned RID.

multimeshGetAabb
AABB multimeshGetAabb(RID multimesh)

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

multimeshGetInstanceCount
long multimeshGetInstanceCount(RID multimesh)

Returns the number of instances allocated for this multimesh.

multimeshGetMesh
RID multimeshGetMesh(RID multimesh)

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

multimeshGetVisibleInstances
long multimeshGetVisibleInstances(RID multimesh)

Returns the number of visible instances for this multimesh.

multimeshInstanceGetColor
Color multimeshInstanceGetColor(RID multimesh, long index)

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

multimeshInstanceGetCustomData
Color multimeshInstanceGetCustomData(RID multimesh, long index)

Returns the custom data associated with the specified instance.

multimeshInstanceGetTransform
Transform multimeshInstanceGetTransform(RID multimesh, long index)

Returns the Transform of the specified instance.

multimeshInstanceGetTransform2d
Transform2D multimeshInstanceGetTransform2d(RID multimesh, long index)

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

multimeshInstanceSetColor
void multimeshInstanceSetColor(RID multimesh, long index, Color color)

Sets the color by which this instance will be modulated. Equivalent to MultiMesh.setInstanceColor.

multimeshInstanceSetCustomData
void multimeshInstanceSetCustomData(RID multimesh, long index, Color custom_data)

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 MultiMesh.setInstanceCustomData.

multimeshInstanceSetTransform
void multimeshInstanceSetTransform(RID multimesh, long index, Transform transform)

Sets the Transform for this instance. Equivalent to MultiMesh.setInstanceTransform.

multimeshInstanceSetTransform2d
void multimeshInstanceSetTransform2d(RID multimesh, long index, Transform2D transform)

Sets the Transform2D for this instance. For use when multimesh is used in 2D. Equivalent to MultiMesh.setInstanceTransform2d.

multimeshSetAsBulkArray
void multimeshSetAsBulkArray(RID multimesh, PoolRealArray array)

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.

multimeshSetMesh
void multimeshSetMesh(RID multimesh, RID mesh)

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

multimeshSetVisibleInstances
void multimeshSetVisibleInstances(RID multimesh, long visible)

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

omniLightCreate
RID omniLightCreate()

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 static method. To place in a scene, attach this omni light to an instance using instanceSetBase using the returned RID.

opAssign
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(typeof(null) n)
opEquals
bool opEquals(VisualServerSingleton other)
particlesCreate
RID particlesCreate()

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 static method. To place in a scene, attach these particles to an instance using instanceSetBase using the returned RID.

particlesGetCurrentAabb
AABB particlesGetCurrentAabb(RID particles)

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

particlesGetEmitting
bool particlesGetEmitting(RID particles)

Returns true if particles are currently set to emitting.

particlesIsInactive
bool particlesIsInactive(RID particles)

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

particlesRequestProcess
void particlesRequestProcess(RID particles)

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, instancesCullConvex, or instancesCullRay.

particlesRestart
void particlesRestart(RID particles)

Reset the particles on the next update. Equivalent to Particles.restart.

particlesSetAmount
void particlesSetAmount(RID particles, long amount)

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

particlesSetCustomAabb
void particlesSetCustomAabb(RID particles, AABB aabb)

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

particlesSetDrawOrder
void particlesSetDrawOrder(RID particles, long order)

Sets the draw order of the particles to one of the named enums from particlesdraworder. See particlesdraworder for options. Equivalent to Particles.drawOrder.

particlesSetDrawPassMesh
void particlesSetDrawPassMesh(RID particles, long pass, RID mesh)

Sets the mesh to be used for the specified draw pass. Equivalent to Particles.drawPass1, Particles.drawPass2, Particles.drawPass3, and Particles.drawPass4.

particlesSetDrawPasses
void particlesSetDrawPasses(RID particles, long count)

Sets the number of draw passes to use. Equivalent to Particles.drawPasses.

particlesSetEmissionTransform
void particlesSetEmissionTransform(RID particles, Transform transform)

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

particlesSetEmitting
void particlesSetEmitting(RID particles, bool emitting)

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

particlesSetExplosivenessRatio
void particlesSetExplosivenessRatio(RID particles, double ratio)

Sets the explosiveness ratio. Equivalent to Particles.explosiveness.

particlesSetFixedFps
void particlesSetFixedFps(RID particles, long fps)

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

particlesSetFractionalDelta
void particlesSetFractionalDelta(RID particles, bool enable)

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

particlesSetLifetime
void particlesSetLifetime(RID particles, double lifetime)

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

particlesSetOneShot
void particlesSetOneShot(RID particles, bool one_shot)

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

particlesSetPreProcessTime
void particlesSetPreProcessTime(RID particles, double time)

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

particlesSetProcessMaterial
void particlesSetProcessMaterial(RID particles, RID material)

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

particlesSetRandomnessRatio
void particlesSetRandomnessRatio(RID particles, double ratio)

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

particlesSetSpeedScale
void particlesSetSpeedScale(RID particles, double scale)

Sets the speed scale of the particle system. Equivalent to Particles.speedScale.

particlesSetUseLocalCoordinates
void particlesSetUseLocalCoordinates(RID particles, bool enable)

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

reflectionProbeCreate
RID reflectionProbeCreate()

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 static method. To place in a scene, attach this reflection probe to an instance using instanceSetBase using the returned RID.

reflectionProbeSetAsInterior
void reflectionProbeSetAsInterior(RID probe, bool enable)

If true, reflections will ignore sky contribution. Equivalent to ReflectionProbe.interiorEnable.

reflectionProbeSetCullMask
void reflectionProbeSetCullMask(RID probe, long layers)

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

reflectionProbeSetEnableBoxProjection
void reflectionProbeSetEnableBoxProjection(RID probe, bool enable)

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

reflectionProbeSetEnableShadows
void reflectionProbeSetEnableShadows(RID probe, bool enable)

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

reflectionProbeSetExtents
void reflectionProbeSetExtents(RID probe, Vector3 extents)

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

reflectionProbeSetIntensity
void reflectionProbeSetIntensity(RID probe, double intensity)

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

reflectionProbeSetInteriorAmbient
void reflectionProbeSetInteriorAmbient(RID probe, Color color)

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

reflectionProbeSetInteriorAmbientEnergy
void reflectionProbeSetInteriorAmbientEnergy(RID probe, double energy)

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

reflectionProbeSetInteriorAmbientProbeContribution
void reflectionProbeSetInteriorAmbientProbeContribution(RID probe, double contrib)

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 ReflectionProbe.interiorAmbientContrib.

reflectionProbeSetMaxDistance
void reflectionProbeSetMaxDistance(RID probe, double distance)

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

reflectionProbeSetOriginOffset
void reflectionProbeSetOriginOffset(RID probe, Vector3 offset)

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

reflectionProbeSetUpdateMode
void reflectionProbeSetUpdateMode(RID probe, long mode)

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

requestFrameDrawnCallback
void requestFrameDrawnCallback(GodotObject where, String method, VariantArg2 userdata)

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.

scenarioCreate
RID scenarioCreate()

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 static method. The scenario is the 3D world that all the visual instances exist in.

scenarioSetDebug
void scenarioSetDebug(RID scenario, long debug_mode)

Sets the scenariodebugmode for this scenario. See scenariodebugmode for options.

scenarioSetEnvironment
void scenarioSetEnvironment(RID scenario, RID environment)

Sets the environment that will be used with this scenario.

scenarioSetFallbackEnvironment
void scenarioSetFallbackEnvironment(RID scenario, RID environment)

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.

scenarioSetReflectionAtlasSize
void scenarioSetReflectionAtlasSize(RID scenario, long size, long subdiv)

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

setBootImage
void setBootImage(Image image, Color color, bool scale, bool use_filter)

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.

setDebugGenerateWireframes
void setDebugGenerateWireframes(bool generate)

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

setDefaultClearColor
void setDefaultClearColor(Color color)

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

setRenderLoopEnabled
void setRenderLoopEnabled(bool enabled)
setShaderTimeScale
void setShaderTimeScale(double scale)

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.

shaderCreate
RID shaderCreate()

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 static method.

shaderGetCode
String shaderGetCode(RID shader)

Returns a shader's code.

shaderGetDefaultTextureParam
RID shaderGetDefaultTextureParam(RID shader, String name)

Returns a default texture from a shader searched by name.

shaderGetParamList
Array shaderGetParamList(RID shader)

Returns the parameters of a shader.

shaderSetCode
void shaderSetCode(RID shader, String code)

Sets a shader's code.

shaderSetDefaultTextureParam
void shaderSetDefaultTextureParam(RID shader, String name, RID texture)

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

skeletonAllocate
void skeletonAllocate(RID skeleton, long bones, bool is_2d_skeleton)

Allocates the GPU buffers for this skeleton.

skeletonBoneGetTransform
Transform skeletonBoneGetTransform(RID skeleton, long bone)

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

skeletonBoneGetTransform2d
Transform2D skeletonBoneGetTransform2d(RID skeleton, long bone)

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

skeletonBoneSetTransform
void skeletonBoneSetTransform(RID skeleton, long bone, Transform transform)

Sets the Transform for a specific bone of this skeleton.

skeletonBoneSetTransform2d
void skeletonBoneSetTransform2d(RID skeleton, long bone, Transform2D transform)

Sets the Transform2D for a specific bone of this skeleton.

skeletonCreate
RID skeletonCreate()

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 static method.

skeletonGetBoneCount
long skeletonGetBoneCount(RID skeleton)

Returns the number of bones allocated for this skeleton.

skyCreate
RID skyCreate()

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 static method.

skySetTexture
void skySetTexture(RID sky, RID cube_map, long radiance_size)

Sets a sky's texture.

spotLightCreate
RID spotLightCreate()

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 static method. To place in a scene, attach this spot light to an instance using instanceSetBase using the returned RID.

sync
void sync()

Not implemented in Godot 3.x.

textureAllocate
void textureAllocate(RID texture, long width, long height, long depth_3d, long format, long type, long flags)

Allocates the GPU memory for the texture.

textureBind
void textureBind(RID texture, long number)

Binds the texture to a texture slot.

textureCreate
RID textureCreate()

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 static method.

textureCreateFromImage
RID textureCreateFromImage(Image image, long flags)

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

textureDebugUsage
Array textureDebugUsage()

Returns a list of all the textures and their information.

textureGetData
Ref!Image textureGetData(RID texture, long cube_side)

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.

textureGetDepth
long textureGetDepth(RID texture)

Returns the depth of the texture.

textureGetFlags
long textureGetFlags(RID texture)

Returns the flags of a texture.

textureGetFormat
Image.Format textureGetFormat(RID texture)

Returns the format of the texture's image.

textureGetHeight
long textureGetHeight(RID texture)

Returns the texture's height.

textureGetPath
String textureGetPath(RID texture)

Returns the texture's path.

textureGetTexid
long textureGetTexid(RID texture)

Returns the opengl id of the texture's image.

textureGetType
VisualServer.TextureType textureGetType(RID texture)

Returns the type of the texture, can be any of the texturetype.

textureGetWidth
long textureGetWidth(RID texture)

Returns the texture's width.

textureSetData
void textureSetData(RID texture, Image image, long layer)

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

textureSetDataPartial
void textureSetDataPartial(RID texture, Image image, long src_x, long src_y, long src_w, long src_h, long dst_x, long dst_y, long dst_mip, long layer)

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.

textureSetFlags
void textureSetFlags(RID texture, long flags)

Sets the texture's flags. See textureflags for options.

textureSetPath
void textureSetPath(RID texture, String path)

Sets the texture's path.

textureSetShrinkAllX2OnSetData
void textureSetShrinkAllX2OnSetData(bool shrink)

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

textureSetSizeOverride
void textureSetSizeOverride(RID texture, long width, long height, long depth)

Resizes the texture to the specified dimensions.

texturesKeepOriginal
void texturesKeepOriginal(bool enable)

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

toHash
size_t toHash()
viewportAttachCamera
void viewportAttachCamera(RID viewport, RID camera)

Sets a viewport's camera.

viewportAttachCanvas
void viewportAttachCanvas(RID viewport, RID canvas)

Sets a viewport's canvas.

viewportAttachToScreen
void viewportAttachToScreen(RID viewport, Rect2 rect, long screen)

Copies viewport to a region of the screen specified by rect. If Viewport.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:

viewportCreate
RID viewportCreate()

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 static method.

viewportDetach
void viewportDetach(RID viewport)

Detaches the viewport from the screen.

viewportGetRenderInfo
long viewportGetRenderInfo(RID viewport, long info)

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

viewportGetTexture
RID viewportGetTexture(RID viewport)

Returns the viewport's last rendered frame.

viewportRemoveCanvas
void viewportRemoveCanvas(RID viewport, RID canvas)

Detaches a viewport from a canvas and vice versa.

viewportSetActive
void viewportSetActive(RID viewport, bool active)

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

viewportSetCanvasStacking
void viewportSetCanvasStacking(RID viewport, RID canvas, long layer, long sublayer)

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.

viewportSetCanvasTransform
void viewportSetCanvasTransform(RID viewport, RID canvas, Transform2D offset)

Sets the transformation of a viewport's canvas.

viewportSetClearMode
void viewportSetClearMode(RID viewport, long clear_mode)

Sets the clear mode of a viewport. See viewportclearmode for options.

viewportSetDebugDraw
void viewportSetDebugDraw(RID viewport, long draw)

Sets the debug draw mode of a viewport. See viewportdebugdraw for options.

viewportSetDisable3d
void viewportSetDisable3d(RID viewport, bool disabled)

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

viewportSetDisableEnvironment
void viewportSetDisableEnvironment(RID viewport, bool disabled)

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

viewportSetGlobalCanvasTransform
void viewportSetGlobalCanvasTransform(RID viewport, Transform2D transform)

Sets the viewport's global transformation matrix.

viewportSetHdr
void viewportSetHdr(RID viewport, bool enabled)

If true, the viewport renders to hdr.

viewportSetHideCanvas
void viewportSetHideCanvas(RID viewport, bool hidden)

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

viewportSetHideScenario
void viewportSetHideScenario(RID viewport, bool hidden)

Currently unimplemented in Godot 3.x.

viewportSetMsaa
void viewportSetMsaa(RID viewport, long msaa)

Sets the anti-aliasing mode. See viewportmsaa for options.

viewportSetParentViewport
void viewportSetParentViewport(RID viewport, RID parent_viewport)

Sets the viewport's parent to another viewport.

viewportSetRenderDirectToScreen
void viewportSetRenderDirectToScreen(RID viewport, bool enabled)

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.

viewportSetScenario
void viewportSetScenario(RID viewport, RID scenario)

Sets a viewport's scenario. The scenario contains information about the scenariodebugmode, environment information, reflection atlas etc.

viewportSetShadowAtlasQuadrantSubdivision
void viewportSetShadowAtlasQuadrantSubdivision(RID viewport, long quadrant, long subdivision)

Sets the shadow atlas quadrant's subdivision.

viewportSetShadowAtlasSize
void viewportSetShadowAtlasSize(RID viewport, long size)

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.

viewportSetSize
void viewportSetSize(RID viewport, long width, long height)

Sets the viewport's width and height.

viewportSetTransparentBackground
void viewportSetTransparentBackground(RID viewport, bool enabled)

If true, the viewport renders its background as transparent.

viewportSetUpdateMode
void viewportSetUpdateMode(RID viewport, long update_mode)

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

viewportSetUsage
void viewportSetUsage(RID viewport, long usage)

Sets the viewport's 2D/3D mode. See viewportusage constants for options.

viewportSetUseArvr
void viewportSetUseArvr(RID viewport, bool use_arvr)

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

viewportSetUseDebanding
void viewportSetUseDebanding(RID viewport, bool debanding)

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. Viewport.hdr must also be true for debanding to be effective.

viewportSetUseFxaa
void viewportSetUseFxaa(RID viewport, bool fxaa)

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.

viewportSetVflip
void viewportSetVflip(RID viewport, bool enabled)

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

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

renderLoopEnabled
bool renderLoopEnabled [@property getter]
bool renderLoopEnabled [@property setter]

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

Static functions

_new
VisualServerSingleton _new()

Construct a new instance of VisualServerSingleton. Note: use memnew!VisualServerSingleton instead.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

GDNativeClassBinding
struct GDNativeClassBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(ToRef) as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta