Struct VisualServerSingleton

Server for anything visible.

struct VisualServerSingleton ;

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.

Methods

NameDescription
_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 Sets images to be rendered in the window margin.
blackBarsSetMargins Sets margin size, where black bars (or images, if blackBarsSetImages was used) are rendered.
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 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 Sets the environment used by this camera. Equivalent to Camera.environment.
cameraSetFrustum Sets camera to use frustum projection. This mode allows adjusting the offset argument to create "tilted frustum" effects.
cameraSetOrthogonal 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 Sets camera to use perspective projection. Objects on the screen becomes smaller when they are far away.
cameraSetTransform Sets Transform of camera.
cameraSetUseVerticalAspect 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 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 Adds a circle command to the CanvasItem's draw commands.
canvasItemAddClipIgnore If ignore is true, the VisualServer does not perform clipping.
canvasItemAddLine Adds a line command to the CanvasItem's draw commands.
canvasItemAddMesh Adds a mesh command to the CanvasItem's draw commands.
canvasItemAddMultimesh Adds a MultiMesh to the CanvasItem's draw commands. Only affects its aabb at the moment.
canvasItemAddNinePatch Adds a nine patch image to the CanvasItem's draw commands. See NinePatchRect for more explanation.
canvasItemAddParticles Adds a particle system to the CanvasItem's draw commands.
canvasItemAddPolygon Adds a polygon to the CanvasItem's draw commands.
canvasItemAddPolyline Adds a polyline, which is a line from multiple points with a width, to the CanvasItem's draw commands.
canvasItemAddPrimitive Adds a primitive to the CanvasItem's draw commands.
canvasItemAddRect Adds a rectangle to the CanvasItem's draw commands.
canvasItemAddSetTransform 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 Adds a textured rect to the CanvasItem's draw commands.
canvasItemAddTextureRectRegion Adds a texture rect with region setting to the CanvasItem's draw commands.
canvasItemAddTriangleArray Adds a triangle array to the CanvasItem's draw commands.
canvasItemClear Clears the CanvasItem and removes all commands in it.
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 Sets clipping for the CanvasItem.
canvasItemSetCopyToBackbuffer Sets the CanvasItem to copy a rect to the backbuffer.
canvasItemSetCustomRect Defines a custom drawing rectangle for the CanvasItem.
canvasItemSetDistanceFieldMode Enables the use of distance fields for GUI elements that are rendering distance field based fonts.
canvasItemSetDrawBehindParent Sets CanvasItem to be drawn behind its parent.
canvasItemSetDrawIndex Sets the index for the CanvasItem.
canvasItemSetLightMask The light mask. See LightOccluder2D for more information on light masks.
canvasItemSetMaterial Sets a new material to the CanvasItem.
canvasItemSetModulate Sets the color that modulates the CanvasItem and its children.
canvasItemSetParent 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 Sets the color that modulates the CanvasItem without children.
canvasItemSetSortChildrenByY Sets if CanvasItem's children should be sorted by y-position.
canvasItemSetTransform Sets the CanvasItem's Transform2D.
canvasItemSetUseParentMaterial Sets if the CanvasItem uses its parent's material.
canvasItemSetVisible Sets if the canvas item (including its children) is visible.
canvasItemSetZAsRelativeToParent If this is enabled, the Z index of the parent will be added to the children's Z index.
canvasItemSetZIndex Sets the CanvasItem's Z index, i.e. its draw order (lower indexes are drawn first).
canvasLightAttachToCanvas Attaches the canvas light to the canvas. Removes it from its previous canvas.
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 Attaches a light occluder to the canvas. Removes it from its previous canvas.
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 Enables or disables light occluder.
canvasLightOccluderSetLightMask The light mask. See LightOccluder2D for more information on light masks.
canvasLightOccluderSetPolygon Sets a light occluder's polygon.
canvasLightOccluderSetTransform Sets a light occluder's Transform2D.
canvasLightSetColor Sets the color for a light.
canvasLightSetEnabled Enables or disables a canvas light.
canvasLightSetEnergy Sets a canvas light's energy.
canvasLightSetHeight Sets a canvas light's height.
canvasLightSetItemCullMask The light mask. See LightOccluder2D for more information on light masks.
canvasLightSetItemShadowCullMask The binary mask used to determine which layers this canvas light's shadows affects. See LightOccluder2D for more information on light masks.
canvasLightSetLayerRange The layer range that gets rendered with this light.
canvasLightSetMode The mode of the light, see canvaslightmode constants.
canvasLightSetScale Sets the texture's scale factor of the light. Equivalent to Light2D.textureScale.
canvasLightSetShadowBufferSize Sets the width of the shadow buffer, size gets scaled to the next power of two for this.
canvasLightSetShadowColor Sets the color of the canvas light's shadow.
canvasLightSetShadowEnabled Enables or disables the canvas light's shadow.
canvasLightSetShadowFilter Sets the canvas light's shadow's filter, see canvaslightshadowfilter constants.
canvasLightSetShadowGradientLength Sets the length of the shadow's gradient.
canvasLightSetShadowSmooth Smoothens the shadow. The lower, the smoother.
canvasLightSetTexture Sets texture to be used by light. Equivalent to Light2D.texture.
canvasLightSetTextureOffset Sets the offset of the light's texture. Equivalent to Light2D.offset.
canvasLightSetTransform Sets the canvas light's Transform2D.
canvasLightSetZRange Sets the Z range of objects that will be affected by this light. Equivalent to Light2D.rangeZMin and Light2D.rangeZMax.
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 Sets an occluder polygons cull mode. See canvasoccluderpolygoncullmode constants.
canvasOccluderPolygonSetShape Sets the shape of the occluder polygon.
canvasOccluderPolygonSetShapeAsLines Sets the shape of the occluder polygon as lines.
canvasSetItemMirroring A copy of the canvas item will be drawn with a local offset of the mirroring Vector2.
canvasSetModulate Modulates all colors in the given canvas.
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 Draws a frame. This method is deprecated, please use forceDraw instead.
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 Sets the values to be used with the "Adjustment" post-process effect. See Environment for more details.
environmentSetAmbientLight Sets the ambient light parameters. See Environment for more details.
environmentSetBackground Sets the BGMode of the environment. Equivalent to Environment.backgroundMode.
environmentSetBgColor Color displayed for clear areas of the scene (if using Custom color or Color+Sky background modes).
environmentSetBgEnergy Sets the intensity of the background color.
environmentSetCanvasMaxLayer Sets the maximum layer to use if using Canvas background mode.
environmentSetDofBlurFar Sets the values to be used with the "DoF Far Blur" post-process effect. See Environment for more details.
environmentSetDofBlurNear Sets the values to be used with the "DoF Near Blur" post-process effect. See Environment for more details.
environmentSetFog Sets the variables to be used with the scene fog. See Environment for more details.
environmentSetFogDepth Sets the variables to be used with the fog depth effect. See Environment for more details.
environmentSetFogHeight Sets the variables to be used with the fog height effect. See Environment for more details.
environmentSetGlow Sets the variables to be used with the "glow" post-process effect. See Environment for more details.
environmentSetSky Sets the Sky to be used as the environment's background when using BGMode sky. Equivalent to Environment.backgroundSky.
environmentSetSkyCustomFov Sets a custom field of view for the background Sky. Equivalent to Environment.backgroundSkyCustomFov.
environmentSetSkyOrientation Sets the rotation of the background Sky expressed as a Basis. Equivalent to Environment.backgroundSkyOrientation.
environmentSetSsao Sets the variables to be used with the "Screen Space Ambient Occlusion (SSAO)" post-process effect. See Environment for more details.
environmentSetSsr Sets the variables to be used with the "screen space reflections" post-process effect. See Environment for more details.
environmentSetTonemap Sets the variables to be used with the "tonemap" post-process effect. See Environment for more details.
finish Removes buffers and clears testcubes.
forceDraw 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 Synchronizes threads.
freeRid Tries to free an object in the VisualServer.
getRenderInfo Returns a certain information, see renderinfo for options.
getTestCube Returns the id of the test cube. Creates one if none exists.
getTestTexture Returns the id of the test texture. Creates one if none exists.
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 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 Returns the id of a white texture. Creates one if none exists.
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 Returns the bias value for the GI probe. Bias is used to avoid self occlusion. Equivalent to GIProbeData.bias.
giProbeGetBounds Returns the axis-aligned bounding box that covers the full extent of the GI probe.
giProbeGetCellSize Returns the cell size set by giProbeSetCellSize.
giProbeGetDynamicData Returns the data used by the GI probe.
giProbeGetDynamicRange Returns the dynamic range set for this GI probe. Equivalent to GIProbe.dynamicRange.
giProbeGetEnergy Returns the energy multiplier for this GI probe. Equivalent to GIProbe.energy.
giProbeGetNormalBias Returns the normal bias for this GI probe. Equivalent to GIProbe.normalBias.
giProbeGetPropagation Returns the propagation value for this GI probe. Equivalent to GIProbe.propagation.
giProbeGetToCellXform Returns the Transform set by giProbeSetToCellXform.
giProbeIsCompressed Returns true if the GI probe data associated with this GI probe is compressed. Equivalent to GIProbe.compress.
giProbeIsInterior Returns true if the GI probe is set to interior, meaning it does not account for sky light. Equivalent to GIProbe.interior.
giProbeSetBias Sets the bias value to avoid self-occlusion. Equivalent to GIProbe.bias.
giProbeSetBounds Sets the axis-aligned bounding box that covers the extent of the GI probe.
giProbeSetCellSize Sets the size of individual cells within the GI probe.
giProbeSetCompress 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 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 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 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 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 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 Sets the propagation of light within this GI probe. Equivalent to GIProbe.propagation.
giProbeSetToCellXform Sets the to cell Transform for this GI probe.
hasChanged Returns true if changes have been made to the VisualServer's data. draw is usually called if this happens.
hasFeature Not yet implemented. Always returns false.
hasOsFeature Returns true if the OS supports a certain feature. Features might be s3tc, etc, etc2 and pvrtc.
immediateBegin Sets up ImmediateGeometry internals to prepare for drawing. Equivalent to ImmediateGeometry.begin.
immediateClear Clears everything that was set up between immediateBegin and immediateEnd. Equivalent to ImmediateGeometry.clear.
immediateColor Sets the color to be used with next vertex. Equivalent to ImmediateGeometry.setColor.
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 Ends drawing the ImmediateGeometry and displays it. Equivalent to ImmediateGeometry.end.
immediateGetMaterial Returns the material assigned to the ImmediateGeometry.
immediateNormal Sets the normal to be used with next vertex. Equivalent to ImmediateGeometry.setNormal.
immediateSetMaterial Sets the material to be used to draw the ImmediateGeometry.
immediateTangent Sets the tangent to be used with next vertex. Equivalent to ImmediateGeometry.setTangent.
immediateUv Sets the UV to be used with next vertex. Equivalent to ImmediateGeometry.setUv.
immediateUv2 Sets the UV2 to be used with next vertex. Equivalent to ImmediateGeometry.setUv2.
immediateVertex Adds the next vertex using the information provided in advance. Equivalent to ImmediateGeometry.addVertex.
immediateVertex2d 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 Attaches a unique Object ID to instance. Object ID must be attached to instance for proper culling with instancesCullAabb, instancesCullConvex, and instancesCullRay.
instanceAttachSkeleton Attaches a skeleton to an instance. Removes the previous skeleton from the instance.
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 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 Not implemented in Godot 3.x.
instanceGeometrySetCastShadowsSetting Sets the shadow casting setting to one of shadowcastingsetting. Equivalent to GeometryInstance.castShadow.
instanceGeometrySetDrawRange Not implemented in Godot 3.x.
instanceGeometrySetFlag Sets the flag for a given instanceflags. See instanceflags for more details.
instanceGeometrySetMaterialOverride Sets a material that will override the material for all surfaces on the mesh associated with this instance. Equivalent to GeometryInstance.materialOverride.
instancesCullAabb 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 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 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.
instanceSetBase 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 Sets the weight for a given blend shape associated with this instance.
instanceSetCustomAabb Sets a custom AABB to use when culling objects from the view frustum. Equivalent to GeometryInstance.setCustomAabb.
instanceSetExterior Function not implemented in Godot 3.x.
instanceSetExtraVisibilityMargin Sets a margin to increase the size of the AABB when culling objects from the view frustum. This allows you avoid culling objects that fall outside the view frustum. Equivalent to GeometryInstance.extraCullMargin.
instanceSetLayerMask Sets the render layers that this instance will be drawn to. Equivalent to VisualInstance.layers.
instanceSetScenario Sets the scenario that the instance is in. The scenario is the 3D world that the objects will be displayed in.
instanceSetSurfaceMaterial Sets the material of a specific surface. Equivalent to MeshInstance.setSurfaceMaterial.
instanceSetTransform Sets the world space transform of the instance. Equivalent to Spatial.transform.
instanceSetUseLightmap Sets the lightmap to use with this instance.
instanceSetVisible Sets whether an instance is drawn or not. Equivalent to Spatial.visible.
lightDirectionalSetBlendSplits If true, this directional light will blend between shadow map splits resulting in a smoother transition between them. Equivalent to DirectionalLight.directionalShadowBlendSplits.
lightDirectionalSetShadowDepthRangeMode Sets the shadow depth range mode for this directional light. Equivalent to DirectionalLight.directionalShadowDepthRange. See lightdirectionalshadowdepthrangemode for options.
lightDirectionalSetShadowMode Sets the shadow mode for this directional light. Equivalent to DirectionalLight.directionalShadowMode. See lightdirectionalshadowmode for options.
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 Returns the size of the lightmap capture area.
lightmapCaptureGetEnergy Returns the energy multiplier used by the lightmap capture.
lightmapCaptureGetOctree Returns the octree used by the lightmap capture.
lightmapCaptureGetOctreeCellSubdiv Returns the cell subdivision amount used by this lightmap capture's octree.
lightmapCaptureGetOctreeCellTransform Returns the cell transform for this lightmap capture's octree.
lightmapCaptureSetBounds Sets the size of the area covered by the lightmap capture. Equivalent to BakedLightmapData.bounds.
lightmapCaptureSetEnergy Sets the energy multiplier for this lightmap capture. Equivalent to BakedLightmapData.energy.
lightmapCaptureSetOctree Sets the octree to be used by this lightmap capture. This function is normally used by the BakedLightmap node. Equivalent to BakedLightmapData.octree.
lightmapCaptureSetOctreeCellSubdiv Sets the subdivision level of this lightmap capture's octree. Equivalent to BakedLightmapData.cellSubdiv.
lightmapCaptureSetOctreeCellTransform Sets the octree cell transform for this lightmap capture's octree. Equivalent to BakedLightmapData.cellSpaceTransform.
lightOmniSetShadowDetail 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 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.
lightSetColor Sets the color of the light. Equivalent to Light.lightColor.
lightSetCullMask Sets the cull mask for this Light. Lights only affect objects in the selected layers. Equivalent to Light.lightCullMask.
lightSetNegative If true, light will subtract light instead of adding light. Equivalent to Light.lightNegative.
lightSetParam Sets the specified light parameter. See lightparam for options. Equivalent to Light.setParam.
lightSetProjector Not implemented in Godot 3.x.
lightSetReverseCullFaceMode 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 If true, light will cast shadows. Equivalent to Light.shadowEnabled.
lightSetShadowColor Sets the color of the shadow cast by the light. Equivalent to Light.shadowColor.
lightSetUseGi Sets whether GI probes capture light information from this light.
makeSphereMesh Returns a mesh of a sphere with the given amount of horizontal and vertical subdivisions.
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 Returns the value of a certain material's parameter.
materialGetParamDefault Returns the default value for the param if available. Otherwise returns an empty Variant.
materialGetShader Returns the shader of a certain material's shader. Returns an empty RID if the material doesn't have a shader.
materialSetLineWidth Sets a material's line width.
materialSetNextPass Sets an object's next material.
materialSetParam Sets a material's parameter.
materialSetRenderPriority Sets a material's render priority.
materialSetShader Sets a shader material's shader.
meshAddSurfaceFromArrays Adds a surface generated from the Arrays to a mesh. See primitivetype constants for types.
meshClear Removes all surfaces from a mesh.
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 Returns a mesh's blend shape count.
meshGetBlendShapeMode Returns a mesh's blend shape mode.
meshGetCustomAabb Returns a mesh's custom aabb.
meshGetSurfaceCount Returns a mesh's number of surfaces.
meshRemoveSurface Removes a mesh's surface.
meshSetBlendShapeCount Sets a mesh's blend shape count.
meshSetBlendShapeMode Sets a mesh's blend shape mode.
meshSetCustomAabb Sets a mesh's custom aabb.
meshSurfaceGetAabb Returns a mesh's surface's aabb.
meshSurfaceGetArray Returns a mesh's surface's vertex buffer.
meshSurfaceGetArrayIndexLen Returns a mesh's surface's amount of indices.
meshSurfaceGetArrayLen Returns a mesh's surface's amount of vertices.
meshSurfaceGetArrays Returns a mesh's surface's buffer arrays.
meshSurfaceGetBlendShapeArrays Returns a mesh's surface's arrays for blend shapes.
meshSurfaceGetFormat Returns the format of a mesh's surface.
meshSurfaceGetFormatOffset Function is unused in Godot 3.x.
meshSurfaceGetFormatStride Function is unused in Godot 3.x.
meshSurfaceGetIndexArray Returns a mesh's surface's index buffer.
meshSurfaceGetMaterial Returns a mesh's surface's material.
meshSurfaceGetPrimitiveType Returns the primitive type of a mesh's surface.
meshSurfaceGetSkeletonAabb Returns the aabb of a mesh's surface's skeleton.
meshSurfaceSetMaterial Sets a mesh's surface's material.
meshSurfaceUpdateRegion 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 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 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 Calculates and returns the axis-aligned bounding box that encloses all instances within the multimesh.
multimeshGetInstanceCount Returns the number of instances allocated for this multimesh.
multimeshGetMesh Returns the RID of the mesh that will be used in drawing this multimesh.
multimeshGetVisibleInstances Returns the number of visible instances for this multimesh.
multimeshInstanceGetColor Returns the color by which the specified instance will be modulated.
multimeshInstanceGetCustomData Returns the custom data associated with the specified instance.
multimeshInstanceGetTransform Returns the Transform of the specified instance.
multimeshInstanceGetTransform2d Returns the Transform2D of the specified instance. For use when the multimesh is set to use 2D transforms.
multimeshInstanceSetColor Sets the color by which this instance will be modulated. Equivalent to MultiMesh.setInstanceColor.
multimeshInstanceSetCustomData 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 Sets the Transform for this instance. Equivalent to MultiMesh.setInstanceTransform.
multimeshInstanceSetTransform2d Sets the Transform2D for this instance. For use when multimesh is used in 2D. Equivalent to MultiMesh.setInstanceTransform2d.
multimeshSetAsBulkArray 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 Sets the mesh to be drawn by the multimesh. Equivalent to MultiMesh.mesh.
multimeshSetVisibleInstances 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 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.
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 Calculates and returns the axis-aligned bounding box that contains all the particles. Equivalent to Particles.captureAabb.
particlesGetEmitting Returns true if particles are currently set to emitting.
particlesIsInactive Returns true if particles are not emitting and particles are set to inactive.
particlesRequestProcess 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 Reset the particles on the next update. Equivalent to Particles.restart.
particlesSetAmount Sets the number of particles to be drawn and allocates the memory for them. Equivalent to Particles.amount.
particlesSetCustomAabb Sets a custom axis-aligned bounding box for the particle system. Equivalent to Particles.visibilityAabb.
particlesSetDrawOrder Sets the draw order of the particles to one of the named enums from particlesdraworder. See particlesdraworder for options. Equivalent to Particles.drawOrder.
particlesSetDrawPasses Sets the number of draw passes to use. Equivalent to Particles.drawPasses.
particlesSetDrawPassMesh Sets the mesh to be used for the specified draw pass. Equivalent to Particles.drawPass1, Particles.drawPass2, Particles.drawPass3, and Particles.drawPass4.
particlesSetEmissionTransform Sets the Transform that will be used by the particles when they first emit.
particlesSetEmitting 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 Sets the explosiveness ratio. Equivalent to Particles.explosiveness.
particlesSetFixedFps Sets the frame rate that the particle system rendering will be fixed to. Equivalent to Particles.fixedFps.
particlesSetFractionalDelta If true, uses fractional delta which smooths the movement of the particles. Equivalent to Particles.fractDelta.
particlesSetLifetime Sets the lifetime of each particle in the system. Equivalent to Particles.lifetime.
particlesSetOneShot If true, particles will emit once and then stop. Equivalent to Particles.oneShot.
particlesSetPreProcessTime 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 Sets the material for processing the particles. Note: this is not the material used to draw the materials. Equivalent to Particles.processMaterial.
particlesSetRandomnessRatio Sets the emission randomness ratio. This randomizes the emission of particles within their phase. Equivalent to Particles.randomness.
particlesSetSpeedScale Sets the speed scale of the particle system. Equivalent to Particles.speedScale.
particlesSetUseLocalCoordinates If true, particles use local coordinates. If false they use global coordinates. Equivalent to Particles.localCoords.
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 If true, reflections will ignore sky contribution. Equivalent to ReflectionProbe.interiorEnable.
reflectionProbeSetCullMask 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 If true, uses box projection. This can make reflections look more correct in certain situations. Equivalent to ReflectionProbe.boxProjection.
reflectionProbeSetEnableShadows If true, computes shadows in the reflection probe. This makes the reflection much slower to compute. Equivalent to ReflectionProbe.enableShadows.
reflectionProbeSetExtents Sets the size of the area that the reflection probe will capture. Equivalent to ReflectionProbe.extents.
reflectionProbeSetIntensity Sets the intensity of the reflection probe. Intensity modulates the strength of the reflection. Equivalent to ReflectionProbe.intensity.
reflectionProbeSetInteriorAmbient Sets the ambient light color for this reflection probe when set to interior mode. Equivalent to ReflectionProbe.interiorAmbientColor.
reflectionProbeSetInteriorAmbientEnergy Sets the energy multiplier for this reflection probes ambient light contribution when set to interior mode. Equivalent to ReflectionProbe.interiorAmbientEnergy.
reflectionProbeSetInteriorAmbientProbeContribution 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 Sets the max distance away from the probe an object can be before it is culled. Equivalent to ReflectionProbe.maxDistance.
reflectionProbeSetOriginOffset Sets the origin offset to be used when this reflection probe is in box project mode. Equivalent to ReflectionProbe.originOffset.
reflectionProbeSetUpdateMode Sets how often the reflection probe updates. Can either be once or every frame. See reflectionprobeupdatemode for options.
requestFrameDrawnCallback 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 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 Sets the scenariodebugmode for this scenario. See scenariodebugmode for options.
scenarioSetEnvironment Sets the environment that will be used with this scenario.
scenarioSetFallbackEnvironment 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 Sets the size of the reflection atlas shared by all reflection probes in this scenario.
setBootImage 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 If true, the engine will generate wireframes for use with the wireframe debug mode.
setDefaultClearColor Sets the default clear color which is used when a specific clear color has not been selected.
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 Returns a shader's code.
shaderGetDefaultTextureParam Returns a default texture from a shader searched by name.
shaderGetParamList Returns the parameters of a shader.
shaderSetCode Sets a shader's code.
shaderSetDefaultTextureParam Sets a shader's default texture. Overwrites the texture given by name.
skeletonAllocate Allocates the GPU buffers for this skeleton.
skeletonBoneGetTransform Returns the Transform set for a specific bone of this skeleton.
skeletonBoneGetTransform2d Returns the Transform2D set for a specific bone of this skeleton.
skeletonBoneSetTransform Sets the Transform for a specific bone of this skeleton.
skeletonBoneSetTransform2d Sets the Transform2D for a specific bone of this skeleton.
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 Returns the number of bones allocated for this skeleton.
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 Sets a sky's texture.
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 Not implemented in Godot 3.x.
textureAllocate Allocates the GPU memory for the texture.
textureBind Binds the texture to a texture slot.
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 Creates a texture, allocates the space for an image, and fills in the image.
textureDebugUsage Returns a list of all the textures and their information.
textureGetData 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 Returns the depth of the texture.
textureGetFlags Returns the flags of a texture.
textureGetFormat Returns the format of the texture's image.
textureGetHeight Returns the texture's height.
textureGetPath Returns the texture's path.
textureGetTexid Returns the opengl id of the texture's image.
textureGetType Returns the type of the texture, can be any of the texturetype.
textureGetWidth Returns the texture's width.
textureSetData Sets the texture's image data. If it's a CubeMap, it sets the image data at a cube side.
textureSetDataPartial 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 Sets the texture's flags. See textureflags for options.
textureSetPath Sets the texture's path.
textureSetShrinkAllX2OnSetData If true, sets internal processes to shrink all image data to half the size.
textureSetSizeOverride Resizes the texture to the specified dimensions.
texturesKeepOriginal If true, the image will be stored in the texture's images array if overwritten.
viewportAttachCamera Sets a viewport's camera.
viewportAttachCanvas Sets a viewport's canvas.
viewportAttachToScreen 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 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 Detaches the viewport from the screen.
viewportGetRenderInfo Returns a viewport's render information. For options, see the viewportrenderinfo constants.
viewportGetTexture Returns the viewport's last rendered frame.
viewportRemoveCanvas Detaches a viewport from a canvas and vice versa.
viewportSetActive If true, sets the viewport active, else sets it inactive.
viewportSetCanvasStacking 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 Sets the transformation of a viewport's canvas.
viewportSetClearMode Sets the clear mode of a viewport. See viewportclearmode for options.
viewportSetDebugDraw Sets the debug draw mode of a viewport. See viewportdebugdraw for options.
viewportSetDisable3d If true, a viewport's 3D rendering is disabled.
viewportSetDisableEnvironment If true, rendering of a viewport's environment is disabled.
viewportSetGlobalCanvasTransform Sets the viewport's global transformation matrix.
viewportSetHdr If true, the viewport renders to hdr.
viewportSetHideCanvas If true, the viewport's canvas is not rendered.
viewportSetHideScenario Currently unimplemented in Godot 3.x.
viewportSetMsaa Sets the anti-aliasing mode. See viewportmsaa for options.
viewportSetParentViewport Sets the viewport's parent to another viewport.
viewportSetRenderDirectToScreen 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 Sets a viewport's scenario. The scenario contains information about the scenariodebugmode, environment information, reflection atlas etc.
viewportSetShadowAtlasQuadrantSubdivision Sets the shadow atlas quadrant's subdivision.
viewportSetShadowAtlasSize 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 Sets the viewport's width and height.
viewportSetTransparentBackground If true, the viewport renders its background as transparent.
viewportSetUpdateMode Sets when the viewport should be updated. See viewportupdatemode constants for options.
viewportSetUsage Sets the viewport's 2D/3D mode. See viewportusage constants for options.
viewportSetUseArvr If true, the viewport uses augmented or virtual reality technologies. See ARVRInterface.
viewportSetVflip If true, the viewport's rendering is flipped vertically.

Enums

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