pub struct VisualServer { /* private fields */ }
Expand description

core singleton class VisualServer inherits Object (manually managed).

This class has related types in the visual_server module.

Official documentation

See the documentation of this class in the Godot engine’s official documentation. The method descriptions are generated from it and typically contain code samples in GDScript, not Rust.

Class hierarchy

VisualServer inherits methods from:

Safety

All types in the Godot API have interior mutability in Rust parlance. To enforce that the official thread-safety guidelines are followed, the typestate pattern is used in the Ref and TRef smart pointers, and the Instance API. The typestate Ownership in these types tracks whether ownership is unique, shared, or exclusive to the current thread. For more information, see the type-level documentation on Ref.

Implementations

Constants

Returns a reference to the singleton instance.

Safety

This singleton server is only safe to access from outside the main thread if thread-safe operations are enabled in the project settings. See the official thread-safety guidelines for more information.

Sets images to be rendered in the window margin.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

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

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets Transform of camera.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Default Arguments
  • width - 1.0
  • antialiased - false
Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Default Arguments
  • transform - Transform2D( 1, 0, 0, 1, 0, 0 )
  • modulate - Color( 1, 1, 1, 1 )
Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Default Arguments
  • x_axis_mode - 0
  • y_axis_mode - 0
  • draw_center - true
  • modulate - Color( 1, 1, 1, 1 )
Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Adds a polygon to the CanvasItem’s draw commands.

Default Arguments
  • uvs - PoolVector2Array( )
  • antialiased - false
Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Default Arguments
  • width - 1.0
  • antialiased - false
Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Adds a primitive to the CanvasItem’s draw commands.

Default Arguments
  • width - 1.0
Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Adds a rectangle to the CanvasItem’s draw commands.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Default Arguments
  • tile - false
  • modulate - Color( 1, 1, 1, 1 )
  • transpose - false
Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Default Arguments
  • modulate - Color( 1, 1, 1, 1 )
  • transpose - false
  • clip_uv - true
Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Default Arguments
  • uvs - PoolVector2Array( )
  • bones - PoolIntArray( )
  • weights - PoolRealArray( )
  • count - -1
  • antialiased - false
  • antialiasing_use_indices - false
Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Clears the CanvasItem and removes all commands in it.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Sets clipping for the CanvasItem.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the CanvasItem to copy a rect to the backbuffer.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Defines a custom drawing rectangle for the CanvasItem.

Default Arguments
  • rect - Rect2( 0, 0, 0, 0 )
Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets CanvasItem to be drawn behind its parent.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the index for the CanvasItem.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets a new material to the CanvasItem.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the color that modulates the CanvasItem and its children.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the color that modulates the CanvasItem without children.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the CanvasItem’s Transform2D.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets if the CanvasItem uses its parent’s material.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Enables or disables light occluder.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets a light occluder’s polygon.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets a light occluder’s Transform2D.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the color for a light.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Enables or disables a canvas light.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets a canvas light’s energy.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets a canvas light’s height.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

The layer range that gets rendered with this light.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

The mode of the light, see CanvasLightMode constants.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the texture’s scale factor of the light. Equivalent to Light2D.texture_scale.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the color of the canvas light’s shadow.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Enables or disables the canvas light’s shadow.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the canvas light’s shadow’s filter, see CanvasLightShadowFilter constants.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the length of the shadow’s gradient.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Smoothens the shadow. The lower, the smoother.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the offset of the light’s texture. Equivalent to [Light2D.offset][Light2D::offset].

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the canvas light’s Transform2D.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the Z range of objects that will be affected by this light. Equivalent to [Light2D.range_z_min][Light2D::range_z_min] and [Light2D.range_z_max][Light2D::range_z_max].

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Sets an occluder polygons cull mode. See CanvasOccluderPolygonCullMode constants.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the shape of the occluder polygon.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the shape of the occluder polygon as lines.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Modulates all colors in the given canvas.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

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

Default Arguments
  • swap_buffers - true
  • frame_step - 0.0

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

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Default Arguments
  • energy - 1.0
  • sky_contibution - 0.0
Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the BGMode of the environment. Equivalent to [Environment.background_mode][Environment::background_mode].

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the intensity of the background color.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the Sky to be used as the environment’s background when using BGMode sky. Equivalent to [Environment.background_sky][Environment::background_sky].

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets a custom field of view for the background Sky. Equivalent to [Environment.background_sky_custom_fov][Environment::background_sky_custom_fov].

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the rotation of the background Sky expressed as a Basis. Equivalent to [Environment.background_sky_orientation][Environment::background_sky_orientation].

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Removes buffers and clears testcubes.

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.

Default Arguments
  • swap_buffers - true
  • frame_step - 0.0

Synchronizes threads.

Tries to free an object in the VisualServer.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns a certain information, see RenderInfo for options.

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

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

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.

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.

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

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

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns the cell size set by gi_probe_set_cell_size.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns the data used by the GI probe.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns the Transform set by gi_probe_set_to_cell_xform.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the size of individual cells within the GI probe.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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][GIProbe::interior].

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the to cell Transform for this GI probe.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Not yet implemented. Always returns false.

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.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Clears everything that was set up between immediate_begin and immediate_end. Equivalent to ImmediateGeometry.clear.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns the material assigned to the ImmediateGeometry.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the material to be used to draw the ImmediateGeometry.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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.

Attaches a unique Object ID to instance. Object ID must be attached to instance for proper culling with instances_cull_aabb, instances_cull_convex, and instances_cull_ray.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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 free_rid static method. An instance is a way of placing a 3D object in the scenario. Objects like particles, meshes, and reflection probes need to be associated with an instance to be visible in the scenario using instance_set_base.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Not implemented in Godot 3.x.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the shadow casting setting to one of ShadowCastingSetting. Equivalent to [GeometryInstance.cast_shadow][GeometryInstance::cast_shadow].

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Not implemented in Godot 3.x.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Function not implemented in Godot 3.x.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the lightmap to use with this instance.

Default Arguments
  • lightmap_slice - -1
  • lightmap_uv_rect - Rect2( 0, 0, 1, 1 )
Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns an array of object IDs intersecting with the provided AABB. Only visual 3D nodes are considered, such as MeshInstance or DirectionalLight. Use [method @GDScript.instance_from_id] to obtain the actual nodes. A scenario RID must be provided, which is available in the World you want to query. This forces an update for all resources queued to update. Warning: This function is primarily intended for editor usage. For in-game use cases, prefer physics collision.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns an array of object IDs intersecting with the provided convex shape. Only visual 3D nodes are considered, such as MeshInstance or DirectionalLight. Use [method @GDScript.instance_from_id] to obtain the actual nodes. A scenario RID must be provided, which is available in the World you want to query. This forces an update for all resources queued to update. Warning: This function is primarily intended for editor usage. For in-game use cases, prefer physics collision.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns an array of object IDs intersecting with the provided 3D ray. Only visual 3D nodes are considered, such as MeshInstance or DirectionalLight. Use [method @GDScript.instance_from_id] to obtain the actual nodes. A scenario RID must be provided, which is available in the World you want to query. This forces an update for all resources queued to update. Warning: This function is primarily intended for editor usage. For in-game use cases, prefer physics collision.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the shadow depth range mode for this directional light. Equivalent to [DirectionalLight.directional_shadow_depth_range][DirectionalLight::directional_shadow_depth_range]. See LightDirectionalShadowDepthRangeMode for options.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the shadow mode for this directional light. Equivalent to [DirectionalLight.directional_shadow_mode][DirectionalLight::directional_shadow_mode]. See LightDirectionalShadowMode for options.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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.omni_shadow_detail][OmniLight::omni_shadow_detail].

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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.omni_shadow_mode][OmniLight::omni_shadow_mode].

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the color of the light. Equivalent to [Light.light_color][Light::light_color].

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the cull mask for this Light. Lights only affect objects in the selected layers. Equivalent to [Light.light_cull_mask][Light::light_cull_mask].

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

If true, light will subtract light instead of adding light. Equivalent to [Light.light_negative][Light::light_negative].

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the specified light parameter. See LightParam for options. Equivalent to Light.set_param.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Not implemented in Godot 3.x.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

If true, light will cast shadows. Equivalent to [Light.shadow_enabled][Light::shadow_enabled].

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Returns the size of the lightmap capture area.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns the energy multiplier used by the lightmap capture.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns the octree used by the lightmap capture.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns true if capture is in “interior” mode.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the “interior” mode for this lightmap capture. Equivalent to [BakedLightmapData.interior][BakedLightmapData::interior].

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the subdivision level of this lightmap capture’s octree. Equivalent to BakedLightmapData.cell_subdiv.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the octree cell transform for this lightmap capture’s octree. Equivalent to BakedLightmapData.cell_space_transform.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

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

Returns the value of a certain material’s parameter.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets a material’s line width.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets an object’s next material.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets a material’s parameter.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets a material’s render priority.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets a shader material’s shader.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Default Arguments
  • blend_shapes - [ ]
  • compress_format - 2194432
Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Removes all surfaces from a mesh.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Returns a mesh’s blend shape count.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns a mesh’s blend shape mode.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns a mesh’s custom aabb.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns a mesh’s number of surfaces.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Removes a mesh’s surface.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets a mesh’s blend shape count.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets a mesh’s blend shape mode.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets a mesh’s custom aabb.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns a mesh’s surface’s aabb.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns a mesh’s surface’s vertex buffer.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns a mesh’s surface’s buffer arrays.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns the format of a mesh’s surface.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Function is unused in Godot 3.x.

Returns a mesh’s surface’s index buffer.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns a mesh’s surface’s material.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns the primitive type of a mesh’s surface.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets a mesh’s surface’s material.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Default Arguments
  • custom_data_format - 0
Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns the number of instances allocated for this multimesh.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns the number of visible instances for this multimesh.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns the custom data associated with the specified instance.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns the Transform of the specified instance.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

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

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

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

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns true if particles are currently set to emitting.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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 instances_cull_aabb, instances_cull_convex, or instances_cull_ray.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the mesh to be used for the specified draw pass. Equivalent to [Particles.draw_pass_1][Particles::draw_pass_1], [Particles.draw_pass_2][Particles::draw_pass_2], [Particles.draw_pass_3][Particles::draw_pass_3], and [Particles.draw_pass_4][Particles::draw_pass_4].

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the explosiveness ratio. Equivalent to [Particles.explosiveness][Particles::explosiveness].

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

If true, uses fractional delta which smooths the movement of the particles. Equivalent to [Particles.fract_delta][Particles::fract_delta].

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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][Particles::preprocess].

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

If true, particles use local coordinates. If false they use global coordinates. Equivalent to [Particles.local_coords][Particles::local_coords].

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

If true, reflections will ignore sky contribution. Equivalent to [ReflectionProbe.interior_enable][ReflectionProbe::interior_enable].

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

If true, computes shadows in the reflection probe. This makes the reflection much slower to compute. Equivalent to [ReflectionProbe.enable_shadows][ReflectionProbe::enable_shadows].

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the ambient light color for this reflection probe when set to interior mode. Equivalent to [ReflectionProbe.interior_ambient_color][ReflectionProbe::interior_ambient_color].

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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.interior_ambient_contrib][ReflectionProbe::interior_ambient_contrib].

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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.

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

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the environment that will be used with this scenario.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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.

Default Arguments
  • use_filter - true

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

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

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

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.

Enables or disables occlusion culling.

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

Returns a shader’s code.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns a default texture from a shader searched by name.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns the parameters of a shader.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets a shader’s code.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Allocates the GPU buffers for this skeleton.

Default Arguments
  • is_2d_skeleton - false
Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the Transform for a specific bone of this skeleton.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the Transform2D for a specific bone of this skeleton.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Returns the number of bones allocated for this skeleton.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Sets a sky’s texture.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Not implemented in Godot 3.x.

Allocates the GPU memory for the texture.

Default Arguments
  • flags - 7
Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Binds the texture to a texture slot.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

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

Default Arguments
  • flags - 7

Returns a list of all the textures and their information.

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.

Default Arguments
  • cube_side - 0
Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns the depth of the texture.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns the flags of a texture.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns the format of the texture’s image.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns the texture’s height.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns the texture’s path.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns the opengl id of the texture’s image.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns the texture’s width.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Default Arguments
  • layer - 0
Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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.

Default Arguments
  • layer - 0
Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the texture’s flags. See TextureFlags for options.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the texture’s path.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Resizes the texture to the specified dimensions.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Sets a viewport’s camera.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets a viewport’s canvas.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sample code is GDScript unless otherwise noted.

Copies viewport to a region of the screen specified by rect. If [Viewport.render_direct_to_screen][Viewport::render_direct_to_screen] is true, then viewport does not use a framebuffer and the contents of the viewport are rendered directly to screen. However, note that the root viewport is drawn last, therefore it will draw over the screen. Accordingly, you must set the root viewport to an area that does not cover the area that you have attached this viewport to. For example, you can set the root viewport to not render at all with the following code:

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

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

Default Arguments
  • rect - Rect2( 0, 0, 0, 0 )
  • screen - 0
Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Detaches the viewport from the screen.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns a viewport’s render information. For options, see the ViewportRenderInfo constants.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Returns the viewport’s last rendered frame.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Detaches a viewport from a canvas and vice versa.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the transformation of a viewport’s canvas.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the viewport’s global transformation matrix.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

If true, the viewport renders to hdr.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Currently unimplemented in Godot 3.x.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the anti-aliasing mode. See [ViewportMSAA][ViewportMSAA] for options.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the viewport’s parent to another viewport.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the shadow atlas quadrant’s subdivision.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the sharpening intensity for the viewport. If set to a value greater than 0.0, contrast-adaptive sharpening will be applied to the 3D viewport. This has a low performance cost and can be used to recover some of the sharpness lost from using FXAA. Values around 0.5 generally give the best results. See also viewport_set_use_fxaa.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the viewport’s width and height.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

If true, the viewport renders its background as transparent.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Sets the viewport’s 2D/3D mode. See ViewportUsage constants for options.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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.

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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. Some of the lost sharpness can be recovered by enabling contrast-adaptive sharpening (see viewport_set_sharpen_intensity).

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

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

Safety

This function has parameters of type Rid (resource ID). RIDs are untyped and interpreted as raw pointers by the engine, so passing an incorrect RID can cause UB.

Methods from Deref<Target = Object>

Adds a user-defined signal. Arguments are optional, but can be added as an Array of dictionaries, each containing name: String and type: int (see [enum Variant.Type]) entries.

Default Arguments
  • arguments - [ ]

Sample code is GDScript unless otherwise noted.

Calls the method on the object and returns the result. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example:

call("set", "position", Vector2(42.0, 0.0))

Note: In C#, the method name must be specified as snake_case if it is defined by a built-in Godot node. This doesn’t apply to user-defined methods where you should use the same convention as in the C# source (typically PascalCase).

Safety

This function bypasses Rust’s static type checks (aliasing, thread boundaries, calls to free(), …).

Sample code is GDScript unless otherwise noted.

Calls the method on the object during idle time. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example:

call_deferred("set", "position", Vector2(42.0, 0.0))

Note: In C#, the method name must be specified as snake_case if it is defined by a built-in Godot node. This doesn’t apply to user-defined methods where you should use the same convention as in the C# source (typically PascalCase).

Safety

This function bypasses Rust’s static type checks (aliasing, thread boundaries, calls to free(), …).

Sample code is GDScript unless otherwise noted.

Calls the method on the object and returns the result. Contrarily to call, this method does not support a variable number of arguments but expects all parameters to be via a single Array.

callv("set", [ "position", Vector2(42.0, 0.0) ])
Safety

This function bypasses Rust’s static type checks (aliasing, thread boundaries, calls to free(), …).

Returns true if the object can translate strings. See set_message_translation and tr.

Sample code is GDScript unless otherwise noted.

Connects a signal to a method on a target object. Pass optional binds to the call as an Array of parameters. These parameters will be passed to the method after any parameter used in the call to emit_signal. Use flags to set deferred or one-shot connections. See ConnectFlags constants. A signal can only be connected once to a method. It will throw an error if already connected, unless the signal was connected with CONNECT_REFERENCE_COUNTED. To avoid this, first, use is_connected to check for existing connections. If the target is destroyed in the game’s lifecycle, the connection will be lost. Examples:

connect("pressed", self, "_on_Button_pressed") # BaseButton signal
connect("text_entered", self, "_on_LineEdit_text_entered") # LineEdit signal
connect("hit", self, "_on_Player_hit", [ weapon_type, damage ]) # User-defined signal

An example of the relationship between binds passed to connect and parameters used when calling emit_signal:

connect("hit", self, "_on_Player_hit", [ weapon_type, damage ]) # weapon_type and damage are passed last
emit_signal("hit", "Dark lord", 5) # "Dark lord" and 5 are passed first
func _on_Player_hit(hit_by, level, weapon_type, damage):
    print("Hit by %s (lvl %d) with weapon %s for %d damage" % [hit_by, level, weapon_type, damage])
Default Arguments
  • binds - [ ]
  • flags - 0

Disconnects a signal from a method on the given target. If you try to disconnect a connection that does not exist, the method will throw an error. Use is_connected to ensure that the connection exists.

Sample code is GDScript unless otherwise noted.

Emits the given signal. The signal must exist, so it should be a built-in signal of this class or one of its parent classes, or a user-defined signal. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example:

emit_signal("hit", weapon_type, damage)
emit_signal("game_over")

Returns the Variant value of the given property. If the property doesn’t exist, this will return null. Note: In C#, the property name must be specified as snake_case if it is defined by a built-in Godot node. This doesn’t apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase).

Returns the object’s class as a String. See also is_class. Note: get_class does not take class_name declarations into account. If the object has a class_name defined, the base class name will be returned instead.

Returns an Array of dictionaries with information about signals that are connected to the object. Each Dictionary contains three String entries:

  • source is a reference to the signal emitter.
  • signal_name is the name of the connected signal.
  • method_name is the name of the method to which the signal is connected.

Gets the object’s property indexed by the given NodePath. The node path should be relative to the current object and can use the colon character (:) to access nested properties. Examples: "position:x" or "material:next_pass:blend_mode".

Returns the object’s unique instance ID. This ID can be saved in EncodedObjectAsID, and can be used to retrieve the object instance with [method @GDScript.instance_from_id].

Returns the object’s metadata entry for the given name.

Returns the object’s metadata as a PoolStringArray.

Returns the object’s methods and their signatures as an Array.

Returns the object’s property list as an Array of dictionaries. Each property’s Dictionary contain at least name: String and type: int (see [enum Variant.Type]) entries. Optionally, it can also include hint: int (see [PropertyHint][PropertyHint]), hint_string: String, and usage: int (see [PropertyUsageFlags][PropertyUsageFlags]).

Returns the object’s Script instance, or null if none is assigned.

Returns an Array of connections for the given signal.

Returns the list of signals as an Array of dictionaries.

Returns true if a metadata entry is found with the given name.

Returns true if the object contains the given method.

Returns true if the given signal exists.

Returns true if the given user-defined signal exists. Only signals added using add_user_signal are taken into account.

Returns true if signal emission blocking is enabled.

Returns true if the object inherits from the given class. See also get_class. Note: is_class does not take class_name declarations into account. If the object has a class_name defined, is_class will return false for that name.

Returns true if a connection exists for a given signal, target, and method.

Returns true if the Node.queue_free method was called for the object.

Send a given notification to the object, which will also trigger a call to the [_notification][Self::_notification] method of all classes that the object inherits from. If reversed is true, [_notification][Self::_notification] is called first on the object’s own class, and then up to its successive parent classes. If reversed is false, [_notification][Self::_notification] is called first on the highest ancestor (Object itself), and then down to its successive inheriting classes.

Default Arguments
  • reversed - false

Notify the editor that the property list has changed, so that editor plugins can take the new values into account. Does nothing on export builds.

Removes a given entry from the object’s metadata. See also set_meta.

Assigns a new value to the given property. If the property does not exist, nothing will happen. Note: In C#, the property name must be specified as snake_case if it is defined by a built-in Godot node. This doesn’t apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase).

If set to true, signal emission is blocked.

Assigns a new value to the given property, after the current frame’s physics step. This is equivalent to calling set via call_deferred, i.e. call_deferred("set", property, value). Note: In C#, the property name must be specified as snake_case if it is defined by a built-in Godot node. This doesn’t apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase).

Sample code is GDScript unless otherwise noted.

Assigns a new value to the property identified by the NodePath. The node path should be relative to the current object and can use the colon character (:) to access nested properties. Example:

set_indexed("position", Vector2(42, 0))
set_indexed("position:y", -10)
print(position) # (42, -10)

Defines whether the object can translate strings (with calls to tr). Enabled by default.

Adds, changes or removes a given entry in the object’s metadata. Metadata are serialized and can take any Variant value. To remove a given entry from the object’s metadata, use remove_meta. Metadata is also removed if its value is set to null. This means you can also use set_meta("name", null) to remove metadata for "name".

Assigns a script to the object. Each object can have a single script assigned to it, which are used to extend its functionality. If the object already had a script, the previous script instance will be freed and its variables and state will be lost. The new script’s [_init][Self::_init] method will be called.

Returns a String representing the object. If not overridden, defaults to "[ClassName:RID]". Override the method [_to_string][Self::_to_string] to customize the String representation.

Translates a message using translation catalogs configured in the Project Settings. Only works if message translation is enabled (which it is by default), otherwise it returns the message unchanged. See set_message_translation.

Trait Implementations

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

The memory management kind of this type. This modifies the behavior of the Ref smart pointer. See its type-level documentation for more information. Read more

Creates an explicitly null reference of Self as a method argument. This makes type inference easier for the compiler compared to Option. Read more

Creates a new instance of Self using a zero-argument constructor, as a Unique reference. Read more

Performs a dynamic reference downcast to target type. Read more

Performs a static reference upcast to a supertype that is guaranteed to be valid. Read more

Creates a persistent reference to the same Godot object with shared thread access. Read more

Creates a persistent reference to the same Godot object with thread-local thread access. Read more

Creates a persistent reference to the same Godot object with unique access. Read more

Recovers a instance ID previously returned by Object::get_instance_id if the object is still alive. See also TRef::try_from_instance_id. Read more

Recovers a instance ID previously returned by Object::get_instance_id if the object is still alive, and panics otherwise. This does NOT guarantee that the resulting reference is safe to use. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.