Skip to main content

RenderingServer

Struct RenderingServer 

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

Godot class RenderingServer.

Inherits Object.

Related symbols:

See also Godot docs for RenderingServer.

§Singleton

This class is a singleton. You can get the one instance using Singleton::singleton().

§Final class

This class is final, meaning you cannot inherit from it, and it comes without I* interface trait. It is still possible that other Godot classes inherit from it, but that is limited to the engine itself.

§Godot docs

The rendering server is the API backend for everything visible. The whole scene system mounts on it to display. The rendering server is completely opaque: the internals are entirely implementation-specific and cannot be accessed.

The rendering server can be used to bypass the scene/Node system entirely. This can improve performance in cases where the scene system is the bottleneck, but won’t improve performance otherwise (for instance, if the GPU is already fully utilized).

Resources are created using the *_create functions. These functions return RIDs which are not references to the objects themselves, but opaque pointers towards these objects.

All objects are drawn to a viewport. You can use the Viewport attached to the SceneTree or you can create one yourself with viewport_create. When using a custom scenario or canvas, the scenario or canvas needs to be attached to the viewport using viewport_set_scenario or viewport_attach_canvas.

Scenarios: In 3D, all visual objects must be associated with a scenario. The scenario is a visual representation of the world. If accessing the rendering server from a running game, the scenario can be accessed from the scene tree from any Node3D node with get_world_3d. Otherwise, a scenario can be created with scenario_create.

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

3D: In 3D, all visible objects are comprised of a resource and an instance. A resource can be a mesh, a particle system, a light, or any other 3D object. In order to be visible resources must be attached to an instance using instance_set_base. The instance must also be attached to the scenario using instance_set_scenario in order to be visible. RenderingServer methods that don’t have a prefix are usually 3D-specific (but not always).

2D: In 2D, all visible objects are some form of canvas item. In order to be visible, a canvas item needs to be the child of a canvas attached to a viewport, or it needs to be the child of another canvas item that is eventually attached to the canvas. 2D-specific RenderingServer methods generally start with canvas_*.

Headless mode: Starting the engine with the --headless command line argument disables all rendering and window management functions. Most functions from RenderingServer will return dummy values in this case.

Implementations§

§

impl RenderingServer

pub const NO_INDEX_ARRAY: i32 = - 1i32

pub const ARRAY_WEIGHTS_SIZE: i32 = 4i32

pub const CANVAS_ITEM_Z_MIN: i32 = - 4096i32

pub const CANVAS_ITEM_Z_MAX: i32 = 4096i32

pub const CANVAS_LAYER_MIN: i32 = - 2147483648i32

pub const CANVAS_LAYER_MAX: i32 = 2147483647i32

pub const MAX_GLOW_LEVELS: i32 = 7i32

pub const MAX_CURSORS: i32 = 8i32

pub const MAX_2D_DIRECTIONAL_LIGHTS: i32 = 8i32

pub const MAX_MESH_SURFACES: i32 = 256i32

pub const MATERIAL_RENDER_PRIORITY_MIN: i32 = - 128i32

pub const MATERIAL_RENDER_PRIORITY_MAX: i32 = 127i32

pub const ARRAY_CUSTOM_COUNT: i32 = 4i32

pub const PARTICLES_EMIT_FLAG_POSITION: i32 = 1i32

pub const PARTICLES_EMIT_FLAG_ROTATION_SCALE: i32 = 2i32

pub const PARTICLES_EMIT_FLAG_VELOCITY: i32 = 4i32

pub const PARTICLES_EMIT_FLAG_COLOR: i32 = 8i32

pub const PARTICLES_EMIT_FLAG_CUSTOM: i32 = 16i32

pub fn texture_2d_create(&mut self, image: impl AsArg<Option<Gd<Image>>>) -> Rid

Creates a 2-dimensional texture and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all texture_2d_* RenderingServer functions.

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

Note: The equivalent resource is Texture2D.

Note: Not to be confused with texture_create, which creates the graphics API’s own texture type as opposed to the Godot-specific Texture2D resource.

pub fn texture_2d_layered_create( &mut self, layers: &Array<Gd<Image>>, layered_type: TextureLayeredType, ) -> Rid

Creates a 2-dimensional layered texture and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all texture_2d_layered_* RenderingServer functions.

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

Note: The equivalent resource is TextureLayered.

pub fn texture_3d_create( &mut self, format: Format, width: i32, height: i32, depth: i32, mipmaps: bool, data: &Array<Gd<Image>>, ) -> Rid

Note: The equivalent resource is Texture3D.

pub fn texture_proxy_create(&mut self, base: Rid) -> Rid

This method does nothing and always returns an invalid RID.

pub fn texture_create_from_native_handle( &mut self, type_: TextureType, format: Format, native_handle: u64, width: i32, height: i32, depth: i32, ) -> Rid

To set the default parameters, use texture_create_from_native_handle_ex and its builder methods. See the book for detailed usage instructions. Creates a texture based on a native handle that was created outside of Godot’s renderer.

Note: If using only the rendering device renderer, it’s recommend to use texture_create_from_extension together with texture_rd_create, rather than this method. This way, the texture’s format and usage can be controlled more effectively.

pub fn texture_create_from_native_handle_ex<'ex>( &'ex mut self, type_: TextureType, format: Format, native_handle: u64, width: i32, height: i32, depth: i32, ) -> ExTextureCreateFromNativeHandle<'ex>

Creates a texture based on a native handle that was created outside of Godot’s renderer.

Note: If using only the rendering device renderer, it’s recommend to use texture_create_from_extension together with texture_rd_create, rather than this method. This way, the texture’s format and usage can be controlled more effectively.

pub fn texture_2d_update( &mut self, texture: Rid, image: impl AsArg<Option<Gd<Image>>>, layer: i32, )

Updates the texture specified by the texture RID with the data in image. A layer must also be specified, which should be 0 when updating a single-layer texture (Texture2D).

Note: The image must have the same width, height and format as the current texture data. Otherwise, an error will be printed and the original texture won’t be modified. If you need to use different width, height or format, use texture_replace instead.

pub fn texture_3d_update(&mut self, texture: Rid, data: &Array<Gd<Image>>)

Updates the texture specified by the texture RID’s data with the data in data. All the texture’s layers must be replaced at once.

Note: The texture must have the same width, height, depth and format as the current texture data. Otherwise, an error will be printed and the original texture won’t be modified. If you need to use different width, height, depth or format, use texture_replace instead.

pub fn texture_proxy_update(&mut self, texture: Rid, proxy_to: Rid)

This method does nothing.

pub fn texture_2d_placeholder_create(&mut self) -> Rid

Creates a placeholder for a 2-dimensional layered texture and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all texture_2d_layered_* RenderingServer functions, although it does nothing when used. See also texture_2d_layered_placeholder_create.

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

Note: The equivalent resource is PlaceholderTexture2D.

pub fn texture_2d_layered_placeholder_create( &mut self, layered_type: TextureLayeredType, ) -> Rid

Creates a placeholder for a 2-dimensional layered texture and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all texture_2d_layered_* RenderingServer functions, although it does nothing when used. See also texture_2d_placeholder_create.

Note: The equivalent resource is PlaceholderTextureLayered.

pub fn texture_3d_placeholder_create(&mut self) -> Rid

Creates a placeholder for a 3-dimensional texture and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all texture_3d_* RenderingServer functions, although it does nothing when used.

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

Note: The equivalent resource is PlaceholderTexture3D.

pub fn texture_2d_get(&self, texture: Rid) -> Option<Gd<Image>>

Returns an Image instance from the given texture RID.

Example: Get the test texture from get_test_texture and apply it to a Sprite2D node:

var texture_rid = RenderingServer.get_test_texture()
var texture = ImageTexture.create_from_image(RenderingServer.texture_2d_get(texture_rid))
$Sprite2D.texture = texture

pub fn texture_2d_layer_get( &self, texture: Rid, layer: i32, ) -> Option<Gd<Image>>

Returns an Image instance from the given texture RID and layer.

pub fn texture_3d_get(&self, texture: Rid) -> Array<Gd<Image>>

Returns 3D texture data as an array of Images for the specified texture RID.

pub fn texture_replace(&mut self, texture: Rid, by_texture: Rid)

Replaces texture’s texture data by the texture specified by the by_texture RID, without changing texture’s RID.

pub fn texture_set_size_override( &mut self, texture: Rid, width: i32, height: i32, )

pub fn texture_set_path(&mut self, texture: Rid, path: impl AsArg<GString>)

pub fn texture_get_path(&self, texture: Rid) -> GString

pub fn texture_get_format(&self, texture: Rid) -> Format

Returns the format for the texture.

pub fn texture_set_force_redraw_if_visible( &mut self, texture: Rid, enable: bool, )

pub fn texture_rd_create(&mut self, rd_texture: Rid) -> Rid

To set the default parameters, use texture_rd_create_ex and its builder methods. See the book for detailed usage instructions. Creates a new texture object based on a texture created directly on the RenderingDevice. If the texture contains layers, layer_type is used to define the layer type.

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

Note: The RenderingServer’s free_rid won’t free the underlying rd_texture, you will want to free the rd_texture using free_rid.

pub fn texture_rd_create_ex<'ex>( &'ex mut self, rd_texture: Rid, ) -> ExTextureRdCreate<'ex>

Creates a new texture object based on a texture created directly on the RenderingDevice. If the texture contains layers, layer_type is used to define the layer type.

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

Note: The RenderingServer’s free_rid won’t free the underlying rd_texture, you will want to free the rd_texture using free_rid.

pub fn texture_get_rd_texture(&self, texture: Rid) -> Rid

To set the default parameters, use texture_get_rd_texture_ex and its builder methods. See the book for detailed usage instructions. Returns a texture RID that can be used with RenderingDevice.

srgb should be true when the texture uses nonlinear sRGB encoding and false when the texture uses linear encoding.

pub fn texture_get_rd_texture_ex<'ex>( &'ex self, texture: Rid, ) -> ExTextureGetRdTexture<'ex>

Returns a texture RID that can be used with RenderingDevice.

srgb should be true when the texture uses nonlinear sRGB encoding and false when the texture uses linear encoding.

pub fn texture_get_native_handle(&self, texture: Rid) -> u64

To set the default parameters, use texture_get_native_handle_ex and its builder methods. See the book for detailed usage instructions. Returns the internal graphics handle for this texture object. For use when communicating with third-party APIs mostly with GDExtension.

srgb should be true when the texture uses nonlinear sRGB encoding and false when the texture uses linear encoding.

Note: This function returns a uint64_t which internally maps to a GLuint (OpenGL) or VkImage (Vulkan).

pub fn texture_get_native_handle_ex<'ex>( &'ex self, texture: Rid, ) -> ExTextureGetNativeHandle<'ex>

Returns the internal graphics handle for this texture object. For use when communicating with third-party APIs mostly with GDExtension.

srgb should be true when the texture uses nonlinear sRGB encoding and false when the texture uses linear encoding.

Note: This function returns a uint64_t which internally maps to a GLuint (OpenGL) or VkImage (Vulkan).

pub fn shader_create(&mut self) -> Rid

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

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

Note: The equivalent resource is Shader.

pub fn shader_set_code(&mut self, shader: Rid, code: impl AsArg<GString>)

Sets the shader’s source code (which triggers recompilation after being changed).

pub fn shader_set_path_hint(&mut self, shader: Rid, path: impl AsArg<GString>)

Sets the path hint for the specified shader. This should generally match the Shader resource’s [member Resource.resource_path].

pub fn shader_get_code(&self, shader: Rid) -> GString

Returns a shader’s source code as a string.

pub fn get_shader_parameter_list( &self, shader: Rid, ) -> Array<Dictionary<Variant, Variant>>

Returns the parameters of a shader.

pub fn shader_get_parameter_default( &self, shader: Rid, name: impl AsArg<StringName>, ) -> Variant

Returns the default value for the specified shader uniform. This is usually the value written in the shader source code.

pub fn shader_set_default_texture_parameter( &mut self, shader: Rid, name: impl AsArg<StringName>, texture: Rid, )

To set the default parameters, use shader_set_default_texture_parameter_ex and its builder methods. See the book for detailed usage instructions. Sets a shader’s default texture. Overwrites the texture given by name.

Note: If the sampler array is used use index to access the specified texture.

pub fn shader_set_default_texture_parameter_ex<'ex>( &'ex mut self, shader: Rid, name: impl AsArg<StringName> + 'ex, texture: Rid, ) -> ExShaderSetDefaultTextureParameter<'ex>

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

Note: If the sampler array is used use index to access the specified texture.

pub fn shader_get_default_texture_parameter( &self, shader: Rid, name: impl AsArg<StringName>, ) -> Rid

To set the default parameters, use shader_get_default_texture_parameter_ex and its builder methods. See the book for detailed usage instructions. Returns a default texture from a shader searched by name.

Note: If the sampler array is used use index to access the specified texture.

pub fn shader_get_default_texture_parameter_ex<'ex>( &'ex self, shader: Rid, name: impl AsArg<StringName> + 'ex, ) -> ExShaderGetDefaultTextureParameter<'ex>

Returns a default texture from a shader searched by name.

Note: If the sampler array is used use index to access the specified texture.

pub fn material_create(&mut self) -> Rid

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

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

Note: The equivalent resource is Material.

pub fn material_set_shader(&mut self, shader_material: Rid, shader: Rid)

Sets a shader material’s shader.

pub fn material_set_param( &mut self, material: Rid, parameter: impl AsArg<StringName>, value: &Variant, )

Sets a material’s parameter.

pub fn material_get_param( &self, material: Rid, parameter: impl AsArg<StringName>, ) -> Variant

Returns the value of a certain material’s parameter.

pub fn material_set_render_priority(&mut self, material: Rid, priority: i32)

Sets a material’s render priority.

pub fn material_set_next_pass(&mut self, material: Rid, next_material: Rid)

Sets an object’s next material.

pub fn material_set_use_debanding(&mut self, enable: bool)

When using the Mobile renderer, material_set_use_debanding can be used to enable or disable the debanding feature of 3D materials (BaseMaterial3D and ShaderMaterial).

material_set_use_debanding has no effect when using the Compatibility or Forward+ renderer. In Forward+, Viewport debanding can be used instead.

See also [member ProjectSettings.rendering/anti_aliasing/quality/use_debanding] and viewport_set_use_debanding.

pub fn mesh_create_from_surfaces( &mut self, surfaces: &Array<AnyDictionary>, ) -> Rid

To set the default parameters, use mesh_create_from_surfaces_ex and its builder methods. See the book for detailed usage instructions.

pub fn mesh_create_from_surfaces_ex<'ex>( &'ex mut self, surfaces: &'ex Array<AnyDictionary>, ) -> ExMeshCreateFromSurfaces<'ex>

pub fn mesh_create(&mut self) -> Rid

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

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

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

Note: The equivalent resource is Mesh.

pub fn mesh_surface_get_format_offset( &self, format: ArrayFormat, vertex_count: i32, array_index: i32, ) -> u32

Returns the offset of a given attribute by array_index in the start of its respective buffer.

pub fn mesh_surface_get_format_vertex_stride( &self, format: ArrayFormat, vertex_count: i32, ) -> u32

Returns the stride of the vertex positions for a mesh with given format. Note importantly that vertex positions are stored consecutively and are not interleaved with the other attributes in the vertex buffer (normals and tangents).

pub fn mesh_surface_get_format_normal_tangent_stride( &self, format: ArrayFormat, vertex_count: i32, ) -> u32

Returns the stride of the combined normals and tangents for a mesh with given format. Note importantly that, while normals and tangents are in the vertex buffer with vertices, they are only interleaved with each other and so have a different stride than vertex positions.

pub fn mesh_surface_get_format_attribute_stride( &self, format: ArrayFormat, vertex_count: i32, ) -> u32

Returns the stride of the attribute buffer for a mesh with given format.

pub fn mesh_surface_get_format_skin_stride( &self, format: ArrayFormat, vertex_count: i32, ) -> u32

Returns the stride of the skin buffer for a mesh with given format.

pub fn mesh_surface_get_format_index_stride( &self, format: ArrayFormat, vertex_count: i32, ) -> u32

Returns the stride of the index buffer for a mesh with the given format.

pub fn mesh_add_surface(&mut self, mesh: Rid, surface: &AnyDictionary)

pub fn mesh_add_surface_from_arrays( &mut self, mesh: Rid, primitive: PrimitiveType, arrays: &AnyArray, )

To set the default parameters, use mesh_add_surface_from_arrays_ex and its builder methods. See the book for detailed usage instructions.

pub fn mesh_add_surface_from_arrays_ex<'ex>( &'ex mut self, mesh: Rid, primitive: PrimitiveType, arrays: &'ex AnyArray, ) -> ExMeshAddSurfaceFromArrays<'ex>

pub fn mesh_get_blend_shape_count(&self, mesh: Rid) -> i32

Returns a mesh’s blend shape count.

pub fn mesh_set_blend_shape_mode(&mut self, mesh: Rid, mode: BlendShapeMode)

Sets a mesh’s blend shape mode.

pub fn mesh_get_blend_shape_mode(&self, mesh: Rid) -> BlendShapeMode

Returns a mesh’s blend shape mode.

pub fn mesh_surface_set_material( &mut self, mesh: Rid, surface: i32, material: Rid, )

Sets a mesh’s surface’s material.

pub fn mesh_surface_get_material(&self, mesh: Rid, surface: i32) -> Rid

Returns a mesh’s surface’s material.

pub fn mesh_get_surface( &mut self, mesh: Rid, surface: i32, ) -> Dictionary<Variant, Variant>

pub fn mesh_surface_get_arrays(&self, mesh: Rid, surface: i32) -> Array<Variant>

Returns a mesh’s surface’s buffer arrays.

pub fn mesh_surface_get_blend_shape_arrays( &self, mesh: Rid, surface: i32, ) -> Array<Array<Variant>>

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

pub fn mesh_get_surface_count(&self, mesh: Rid) -> i32

Returns a mesh’s number of surfaces.

pub fn mesh_set_custom_aabb(&mut self, mesh: Rid, aabb: Aabb)

Sets a mesh’s custom aabb.

pub fn mesh_get_custom_aabb(&self, mesh: Rid) -> Aabb

Returns a mesh’s custom aabb.

pub fn mesh_surface_remove(&mut self, mesh: Rid, surface: i32)

Removes the surface at the given index from the Mesh, shifting surfaces with higher index down by one.

pub fn mesh_clear(&mut self, mesh: Rid)

Removes all surfaces from a mesh.

pub fn mesh_surface_update_vertex_region( &mut self, mesh: Rid, surface: i32, offset: i32, data: &PackedArray<u8>, )

pub fn mesh_surface_update_attribute_region( &mut self, mesh: Rid, surface: i32, offset: i32, data: &PackedArray<u8>, )

pub fn mesh_surface_update_skin_region( &mut self, mesh: Rid, surface: i32, offset: i32, data: &PackedArray<u8>, )

pub fn mesh_surface_update_index_region( &mut self, mesh: Rid, surface: i32, offset: i32, data: &PackedArray<u8>, )

Updates the index buffer of the mesh surface with the given data. The expected data are 16 or 32-bit unsigned integers, which can be determined with mesh_surface_get_format_index_stride.

pub fn mesh_set_shadow_mesh(&mut self, mesh: Rid, shadow_mesh: Rid)

pub fn multimesh_create(&mut self) -> Rid

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

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

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

Note: The equivalent resource is MultiMesh.

pub fn multimesh_allocate_data( &mut self, multimesh: Rid, instances: i32, transform_format: MultimeshTransformFormat, )

To set the default parameters, use multimesh_allocate_data_ex and its builder methods. See the book for detailed usage instructions.

pub fn multimesh_allocate_data_ex<'ex>( &'ex mut self, multimesh: Rid, instances: i32, transform_format: MultimeshTransformFormat, ) -> ExMultimeshAllocateData<'ex>

pub fn multimesh_get_instance_count(&self, multimesh: Rid) -> i32

Returns the number of instances allocated for this multimesh.

pub fn multimesh_set_mesh(&mut self, multimesh: Rid, mesh: Rid)

Sets the mesh to be drawn by the multimesh. Equivalent to [member MultiMesh.mesh].

pub fn multimesh_instance_set_transform( &mut self, multimesh: Rid, index: i32, transform: Transform3D, )

Sets the Transform3D for this instance. Equivalent to set_instance_transform.

pub fn multimesh_instance_set_transform_2d( &mut self, multimesh: Rid, index: i32, transform: Transform2D, )

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

pub fn multimesh_instance_set_color( &mut self, multimesh: Rid, index: i32, color: Color, )

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

pub fn multimesh_instance_set_custom_data( &mut self, multimesh: Rid, index: i32, custom_data: Color, )

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

pub fn multimesh_get_mesh(&self, multimesh: Rid) -> Rid

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

pub fn multimesh_get_aabb(&self, multimesh: Rid) -> Aabb

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

pub fn multimesh_set_custom_aabb(&mut self, multimesh: Rid, aabb: Aabb)

Sets the custom AABB for this MultiMesh resource.

pub fn multimesh_get_custom_aabb(&self, multimesh: Rid) -> Aabb

Returns the custom AABB defined for this MultiMesh resource.

pub fn multimesh_instance_get_transform( &self, multimesh: Rid, index: i32, ) -> Transform3D

Returns the Transform3D of the specified instance.

pub fn multimesh_instance_get_transform_2d( &self, multimesh: Rid, index: i32, ) -> Transform2D

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

pub fn multimesh_instance_get_color(&self, multimesh: Rid, index: i32) -> Color

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

pub fn multimesh_instance_get_custom_data( &self, multimesh: Rid, index: i32, ) -> Color

Returns the custom data associated with the specified instance.

pub fn multimesh_set_visible_instances(&mut self, multimesh: Rid, visible: i32)

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

pub fn multimesh_get_visible_instances(&self, multimesh: Rid) -> i32

Returns the number of visible instances for this multimesh.

pub fn multimesh_set_buffer( &mut self, multimesh: Rid, buffer: &PackedArray<f32>, )

Set the entire data to use for drawing the multimesh at once to buffer (such as instance transforms and colors). buffer’s size must match the number of instances multiplied by the per-instance data size (which depends on the enabled MultiMesh fields). Otherwise, an error message is printed and nothing is rendered. See also multimesh_get_buffer.

The per-instance data size and expected data order is:

2D:
  - Position: 8 floats (8 floats for Transform2D)
  - Position + Vertex color: 12 floats (8 floats for Transform2D, 4 floats for Color)
  - Position + Custom data: 12 floats (8 floats for Transform2D, 4 floats of custom data)
  - Position + Vertex color + Custom data: 16 floats (8 floats for Transform2D, 4 floats for Color, 4 floats of custom data)
3D:
  - Position: 12 floats (12 floats for Transform3D)
  - Position + Vertex color: 16 floats (12 floats for Transform3D, 4 floats for Color)
  - Position + Custom data: 16 floats (12 floats for Transform3D, 4 floats of custom data)
  - Position + Vertex color + Custom data: 20 floats (12 floats for Transform3D, 4 floats for Color, 4 floats of custom data)

Instance transforms are in row-major order. Specifically:

  • For Transform2D the float-order is: (x.x, y.x, padding_float, origin.x, x.y, y.y, padding_float, origin.y).

  • For Transform3D the float-order is: (basis.x.x, basis.y.x, basis.z.x, origin.x, basis.x.y, basis.y.y, basis.z.y, origin.y, basis.x.z, basis.y.z, basis.z.z, origin.z).

pub fn multimesh_get_command_buffer_rd_rid(&self, multimesh: Rid) -> Rid

Returns the RenderingDevice RID handle of the MultiMesh command buffer. This RID is only valid if use_indirect is set to true when allocating data through multimesh_allocate_data. It can be used to directly modify the instance count via buffer.

The data structure is dependent on both how many surfaces the mesh contains and whether it is indexed or not, the buffer has 5 integers in it, with the last unused if the mesh is not indexed.

Each of the values in the buffer correspond to these options:

Indexed:
  0 - indexCount;
  1 - instanceCount;
  2 - firstIndex;
  3 - vertexOffset;
  4 - firstInstance;
Non Indexed:
  0 - vertexCount;
  1 - instanceCount;
  2 - firstVertex;
  3 - firstInstance;
  4 - unused;

pub fn multimesh_get_buffer_rd_rid(&self, multimesh: Rid) -> Rid

Returns the RenderingDevice RID handle of the MultiMesh, which can be used as any other buffer on the Rendering Device.

pub fn multimesh_get_buffer(&self, multimesh: Rid) -> PackedArray<f32>

Returns the MultiMesh data (such as instance transforms, colors, etc.). See multimesh_set_buffer for details on the returned data.

Note: If the buffer is in the engine’s internal cache, it will have to be fetched from GPU memory and possibly decompressed. This means multimesh_get_buffer is potentially a slow operation and should be avoided whenever possible.

pub fn multimesh_set_buffer_interpolated( &mut self, multimesh: Rid, buffer: &PackedArray<f32>, buffer_previous: &PackedArray<f32>, )

Alternative version of multimesh_set_buffer for use with physics interpolation.

Takes both an array of current data and an array of data for the previous physics tick.

pub fn multimesh_set_physics_interpolated( &mut self, multimesh: Rid, interpolated: bool, )

Turns on and off physics interpolation for this MultiMesh resource.

pub fn multimesh_set_physics_interpolation_quality( &mut self, multimesh: Rid, quality: MultimeshPhysicsInterpolationQuality, )

Sets the physics interpolation quality for the MultiMesh.

A value of MultimeshPhysicsInterpolationQuality::FAST gives fast but low quality interpolation, a value of MultimeshPhysicsInterpolationQuality::HIGH gives slower but higher quality interpolation.

pub fn multimesh_instance_reset_physics_interpolation( &mut self, multimesh: Rid, index: i32, )

Prevents physics interpolation for the specified instance during the current physics tick.

This is useful when moving an instance to a new location, to give an instantaneous change rather than interpolation from the previous location.

pub fn multimesh_instances_reset_physics_interpolation( &mut self, multimesh: Rid, )

Prevents physics interpolation for all instances during the current physics tick.

This is useful when moving all instances to new locations, to give instantaneous changes rather than interpolation from the previous locations.

pub fn skeleton_create(&mut self) -> Rid

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

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

pub fn skeleton_allocate_data(&mut self, skeleton: Rid, bones: i32)

To set the default parameters, use skeleton_allocate_data_ex and its builder methods. See the book for detailed usage instructions.

pub fn skeleton_allocate_data_ex<'ex>( &'ex mut self, skeleton: Rid, bones: i32, ) -> ExSkeletonAllocateData<'ex>

pub fn skeleton_get_bone_count(&self, skeleton: Rid) -> i32

Returns the number of bones allocated for this skeleton.

pub fn skeleton_bone_set_transform( &mut self, skeleton: Rid, bone: i32, transform: Transform3D, )

Sets the Transform3D for a specific bone of this skeleton.

pub fn skeleton_bone_get_transform( &self, skeleton: Rid, bone: i32, ) -> Transform3D

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

pub fn skeleton_bone_set_transform_2d( &mut self, skeleton: Rid, bone: i32, transform: Transform2D, )

Sets the Transform2D for a specific bone of this skeleton.

pub fn skeleton_bone_get_transform_2d( &self, skeleton: Rid, bone: i32, ) -> Transform2D

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

pub fn skeleton_set_base_transform_2d( &mut self, skeleton: Rid, base_transform: Transform2D, )

pub fn directional_light_create(&mut self) -> Rid

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

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

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

Note: The equivalent node is DirectionalLight3D.

pub fn omni_light_create(&mut self) -> Rid

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

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

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

Note: The equivalent node is OmniLight3D.

pub fn spot_light_create(&mut self) -> Rid

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

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

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

pub fn light_set_color(&mut self, light: Rid, color: Color)

Sets the color of the light. Equivalent to [member Light3D.light_color].

pub fn light_set_param(&mut self, light: Rid, param: LightParam, value: f32)

Sets the specified 3D light parameter. Equivalent to set_param.

pub fn light_set_shadow(&mut self, light: Rid, enabled: bool)

If true, light will cast shadows. Equivalent to [member Light3D.shadow_enabled].

pub fn light_set_projector(&mut self, light: Rid, texture: Rid)

Sets the projector texture to use for the specified 3D light. Equivalent to [member Light3D.light_projector].

pub fn light_set_negative(&mut self, light: Rid, enable: bool)

If true, the 3D light will subtract light instead of adding light. Equivalent to [member Light3D.light_negative].

pub fn light_set_cull_mask(&mut self, light: Rid, mask: u32)

Sets the cull mask for this 3D light. Lights only affect objects in the selected layers. Equivalent to [member Light3D.light_cull_mask].

pub fn light_set_distance_fade( &mut self, decal: Rid, enabled: bool, begin: f32, shadow: f32, length: f32, )

Sets the distance fade for this 3D light. This acts as a form of level of detail (LOD) and can be used to improve performance. Equivalent to [member Light3D.distance_fade_enabled], [member Light3D.distance_fade_begin], [member Light3D.distance_fade_shadow], and [member Light3D.distance_fade_length].

pub fn light_set_reverse_cull_face_mode(&mut self, light: Rid, enabled: bool)

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 [member Light3D.shadow_reverse_cull_face].

pub fn light_set_shadow_caster_mask(&mut self, light: Rid, mask: u32)

Sets the shadow caster mask for this 3D light. Shadows will only be cast using objects in the selected layers. Equivalent to [member Light3D.shadow_caster_mask].

pub fn light_set_bake_mode(&mut self, light: Rid, bake_mode: LightBakeMode)

Sets the bake mode to use for the specified 3D light. Equivalent to [member Light3D.light_bake_mode].

pub fn light_set_max_sdfgi_cascade(&mut self, light: Rid, cascade: u32)

Sets the maximum SDFGI cascade in which the 3D light’s indirect lighting is rendered. Higher values allow the light to be rendered in SDFGI further away from the camera.

pub fn light_omni_set_shadow_mode( &mut self, light: Rid, mode: LightOmniShadowMode, )

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 [member OmniLight3D.omni_shadow_mode].

pub fn light_directional_set_shadow_mode( &mut self, light: Rid, mode: LightDirectionalShadowMode, )

Sets the shadow mode for this directional light. Equivalent to [member DirectionalLight3D.directional_shadow_mode].

pub fn light_directional_set_blend_splits(&mut self, light: Rid, enable: bool)

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

pub fn light_directional_set_sky_mode( &mut self, light: Rid, mode: LightDirectionalSkyMode, )

If true, this light will not be used for anything except sky shaders. Use this for lights that impact your sky shader that you may want to hide from affecting the rest of the scene. For example, you may want to enable this when the sun in your sky shader falls below the horizon.

pub fn light_projectors_set_filter(&mut self, filter: LightProjectorFilter)

Sets the texture filter mode to use when rendering light projectors. This parameter is global and cannot be set on a per-light basis.

pub fn lightmaps_set_bicubic_filter(&mut self, enable: bool)

Toggles whether a bicubic filter should be used when lightmaps are sampled. This smoothens their appearance at a performance cost.

pub fn positional_soft_shadow_filter_set_quality( &mut self, quality: ShadowQuality, )

Sets the filter quality for omni and spot light shadows in 3D. See also [member ProjectSettings.rendering/lights_and_shadows/positional_shadow/soft_shadow_filter_quality]. This parameter is global and cannot be set on a per-viewport basis.

pub fn directional_soft_shadow_filter_set_quality( &mut self, quality: ShadowQuality, )

Sets the filter quality for directional light shadows in 3D. See also [member ProjectSettings.rendering/lights_and_shadows/directional_shadow/soft_shadow_filter_quality]. This parameter is global and cannot be set on a per-viewport basis.

pub fn directional_shadow_atlas_set_size(&mut self, size: i32, is_16bits: bool)

Sets the size of the directional light shadows in 3D. See also [member ProjectSettings.rendering/lights_and_shadows/directional_shadow/size]. This parameter is global and cannot be set on a per-viewport basis.

pub fn reflection_probe_create(&mut self) -> Rid

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

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

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

Note: The equivalent node is ReflectionProbe.

pub fn reflection_probe_set_update_mode( &mut self, probe: Rid, mode: ReflectionProbeUpdateMode, )

Sets how often the reflection probe updates. Can either be once or every frame.

pub fn reflection_probe_set_intensity(&mut self, probe: Rid, intensity: f32)

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

pub fn reflection_probe_set_blend_distance( &mut self, probe: Rid, blend_distance: f32, )

Sets the distance in meters over which a probe blends into the scene.

pub fn reflection_probe_set_ambient_mode( &mut self, probe: Rid, mode: ReflectionProbeAmbientMode, )

Sets the reflection probe’s ambient light mode. Equivalent to [member ReflectionProbe.ambient_mode].

pub fn reflection_probe_set_ambient_color(&mut self, probe: Rid, color: Color)

Sets the reflection probe’s custom ambient light color. Equivalent to [member ReflectionProbe.ambient_color].

pub fn reflection_probe_set_ambient_energy(&mut self, probe: Rid, energy: f32)

Sets the reflection probe’s custom ambient light energy. Equivalent to [member ReflectionProbe.ambient_color_energy].

pub fn reflection_probe_set_max_distance(&mut self, probe: Rid, distance: f32)

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

pub fn reflection_probe_set_size(&mut self, probe: Rid, size: Vector3)

Sets the size of the area that the reflection probe will capture. Equivalent to [member ReflectionProbe.size].

pub fn reflection_probe_set_origin_offset( &mut self, probe: Rid, offset: Vector3, )

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

pub fn reflection_probe_set_as_interior(&mut self, probe: Rid, enable: bool)

If true, reflections will ignore sky contribution. Equivalent to [member ReflectionProbe.interior].

pub fn reflection_probe_set_enable_box_projection( &mut self, probe: Rid, enable: bool, )

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

pub fn reflection_probe_set_enable_shadows(&mut self, probe: Rid, enable: bool)

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

pub fn reflection_probe_set_cull_mask(&mut self, probe: Rid, layers: u32)

Sets the render cull mask for this reflection probe. Only instances with a matching layer will be reflected by this probe. Equivalent to [member ReflectionProbe.cull_mask].

pub fn reflection_probe_set_reflection_mask(&mut self, probe: Rid, layers: u32)

Sets the render reflection mask for this reflection probe. Only instances with a matching layer will have reflections applied from this probe. Equivalent to [member ReflectionProbe.reflection_mask].

pub fn reflection_probe_set_resolution(&mut self, probe: Rid, resolution: i32)

Deprecated. This method does nothing.

pub fn reflection_probe_set_mesh_lod_threshold( &mut self, probe: Rid, pixels: f32, )

Sets the mesh level of detail to use in the reflection probe rendering. Higher values will use less detailed versions of meshes that have LOD variations generated, which can improve performance. Equivalent to [member ReflectionProbe.mesh_lod_threshold].

pub fn decal_create(&mut self) -> Rid

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

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

To place in a scene, attach this decal to an instance using instance_set_base using the returned RID.

Note: The equivalent node is Decal.

pub fn decal_set_size(&mut self, decal: Rid, size: Vector3)

Sets the size of the decal specified by the decal RID. Equivalent to [member Decal.size].

pub fn decal_set_texture( &mut self, decal: Rid, type_: DecalTexture, texture: Rid, )

Sets the texture in the given texture type slot for the specified decal. Equivalent to set_texture.

pub fn decal_set_emission_energy(&mut self, decal: Rid, energy: f32)

Sets the emission energy in the decal specified by the decal RID. Equivalent to [member Decal.emission_energy].

pub fn decal_set_albedo_mix(&mut self, decal: Rid, albedo_mix: f32)

Sets the albedo_mix in the decal specified by the decal RID. Equivalent to [member Decal.albedo_mix].

pub fn decal_set_modulate(&mut self, decal: Rid, color: Color)

Sets the color multiplier in the decal specified by the decal RID to color. Equivalent to [member Decal.modulate].

pub fn decal_set_cull_mask(&mut self, decal: Rid, mask: u32)

Sets the cull mask in the decal specified by the decal RID. Equivalent to [member Decal.cull_mask].

pub fn decal_set_distance_fade( &mut self, decal: Rid, enabled: bool, begin: f32, length: f32, )

Sets the distance fade parameters in the decal specified by the decal RID. Equivalent to [member Decal.distance_fade_enabled], [member Decal.distance_fade_begin] and [member Decal.distance_fade_length].

pub fn decal_set_fade(&mut self, decal: Rid, above: f32, below: f32)

Sets the upper fade (above) and lower fade (below) in the decal specified by the decal RID. Equivalent to [member Decal.upper_fade] and [member Decal.lower_fade].

pub fn decal_set_normal_fade(&mut self, decal: Rid, fade: f32)

Sets the normal fade in the decal specified by the decal RID. Equivalent to [member Decal.normal_fade].

pub fn decals_set_filter(&mut self, filter: DecalFilter)

Sets the texture filter mode to use when rendering decals. This parameter is global and cannot be set on a per-decal basis.

pub fn gi_set_use_half_resolution(&mut self, half_resolution: bool)

If half_resolution is true, renders VoxelGI and SDFGI ([member Environment.sdfgi_enabled]) buffers at halved resolution on each axis (e.g. 960×540 when the viewport size is 1920×1080). This improves performance significantly when VoxelGI or SDFGI is enabled, at the cost of artifacts that may be visible on polygon edges. The loss in quality becomes less noticeable as the viewport resolution increases. LightmapGI rendering is not affected by this setting. Equivalent to [member ProjectSettings.rendering/global_illumination/gi/use_half_resolution].

pub fn voxel_gi_create(&mut self) -> Rid

Creates a new voxel-based global illumination object and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all voxel_gi_* RenderingServer functions.

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

Note: The equivalent node is VoxelGI.

pub fn voxel_gi_allocate_data( &mut self, voxel_gi: Rid, to_cell_xform: Transform3D, aabb: Aabb, octree_size: Vector3i, octree_cells: &PackedArray<u8>, data_cells: &PackedArray<u8>, distance_field: &PackedArray<u8>, level_counts: &PackedArray<i32>, )

pub fn voxel_gi_get_octree_size(&self, voxel_gi: Rid) -> Vector3i

pub fn voxel_gi_get_octree_cells(&self, voxel_gi: Rid) -> PackedArray<u8>

pub fn voxel_gi_get_data_cells(&self, voxel_gi: Rid) -> PackedArray<u8>

pub fn voxel_gi_get_distance_field(&self, voxel_gi: Rid) -> PackedArray<u8>

pub fn voxel_gi_get_level_counts(&self, voxel_gi: Rid) -> PackedArray<i32>

pub fn voxel_gi_get_to_cell_xform(&self, voxel_gi: Rid) -> Transform3D

pub fn voxel_gi_set_dynamic_range(&mut self, voxel_gi: Rid, range: f32)

Sets the [member VoxelGIData.dynamic_range] value to use on the specified voxel_gi’s RID.

pub fn voxel_gi_set_propagation(&mut self, voxel_gi: Rid, amount: f32)

Sets the [member VoxelGIData.propagation] value to use on the specified voxel_gi’s RID.

pub fn voxel_gi_set_energy(&mut self, voxel_gi: Rid, energy: f32)

Sets the [member VoxelGIData.energy] value to use on the specified voxel_gi’s RID.

pub fn voxel_gi_set_baked_exposure_normalization( &mut self, voxel_gi: Rid, baked_exposure: f32, )

Used to inform the renderer what exposure normalization value was used while baking the voxel gi. This value will be used and modulated at run time to ensure that the voxel gi maintains a consistent level of exposure even if the scene-wide exposure normalization is changed at run time. For more information see camera_attributes_set_exposure.

pub fn voxel_gi_set_bias(&mut self, voxel_gi: Rid, bias: f32)

Sets the [member VoxelGIData.bias] value to use on the specified voxel_gi’s RID.

pub fn voxel_gi_set_normal_bias(&mut self, voxel_gi: Rid, bias: f32)

Sets the [member VoxelGIData.normal_bias] value to use on the specified voxel_gi’s RID.

pub fn voxel_gi_set_interior(&mut self, voxel_gi: Rid, enable: bool)

Sets the [member VoxelGIData.interior] value to use on the specified voxel_gi’s RID.

pub fn voxel_gi_set_use_two_bounces(&mut self, voxel_gi: Rid, enable: bool)

Sets the [member VoxelGIData.use_two_bounces] value to use on the specified voxel_gi’s RID.

pub fn voxel_gi_set_quality(&mut self, quality: VoxelGiQuality)

Sets the [member ProjectSettings.rendering/global_illumination/voxel_gi/quality] value to use when rendering. This parameter is global and cannot be set on a per-VoxelGI basis.

pub fn lightmap_create(&mut self) -> Rid

Creates a new lightmap global illumination instance and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all lightmap_* RenderingServer functions.

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

Note: The equivalent node is LightmapGI.

pub fn lightmap_set_textures( &mut self, lightmap: Rid, light: Rid, uses_sh: bool, )

Set the textures on the given lightmap GI instance to the texture array pointed to by the light RID. If the lightmap texture was baked with [member LightmapGI.directional] set to true, then uses_sh must also be true.

pub fn lightmap_set_probe_bounds(&mut self, lightmap: Rid, bounds: Aabb)

pub fn lightmap_set_probe_interior(&mut self, lightmap: Rid, interior: bool)

pub fn lightmap_set_probe_capture_data( &mut self, lightmap: Rid, points: &PackedArray<Vector3>, point_sh: &PackedArray<Color>, tetrahedra: &PackedArray<i32>, bsp_tree: &PackedArray<i32>, )

pub fn lightmap_get_probe_capture_points( &self, lightmap: Rid, ) -> PackedArray<Vector3>

pub fn lightmap_get_probe_capture_sh(&self, lightmap: Rid) -> PackedArray<Color>

pub fn lightmap_get_probe_capture_tetrahedra( &self, lightmap: Rid, ) -> PackedArray<i32>

pub fn lightmap_get_probe_capture_bsp_tree( &self, lightmap: Rid, ) -> PackedArray<i32>

pub fn lightmap_set_baked_exposure_normalization( &mut self, lightmap: Rid, baked_exposure: f32, )

Used to inform the renderer what exposure normalization value was used while baking the lightmap. This value will be used and modulated at run time to ensure that the lightmap maintains a consistent level of exposure even if the scene-wide exposure normalization is changed at run time. For more information see camera_attributes_set_exposure.

pub fn lightmap_set_probe_capture_update_speed(&mut self, speed: f32)

pub fn particles_create(&mut self) -> Rid

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

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

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

Note: The equivalent nodes are GPUParticles2D and GPUParticles3D.

Note: All particles_* methods only apply to GPU-based particles, not CPU-based particles. CPUParticles2D and CPUParticles3D do not have equivalent RenderingServer functions available, as these use MultiMeshInstance2D and MultiMeshInstance3D under the hood (see multimesh_* methods).

pub fn particles_set_mode(&mut self, particles: Rid, mode: ParticlesMode)

Sets whether the GPU particles specified by the particles RID should be rendered in 2D or 3D according to mode.

pub fn particles_set_emitting(&mut self, particles: Rid, emitting: bool)

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

pub fn particles_get_emitting(&mut self, particles: Rid) -> bool

Returns true if particles are currently set to emitting.

pub fn particles_set_amount(&mut self, particles: Rid, amount: i32)

Sets the number of particles to be drawn and allocates the memory for them. Equivalent to [member GPUParticles3D.amount].

pub fn particles_set_amount_ratio(&mut self, particles: Rid, ratio: f32)

Sets the amount ratio for particles to be emitted. Equivalent to [member GPUParticles3D.amount_ratio].

pub fn particles_set_lifetime(&mut self, particles: Rid, lifetime: f64)

Sets the lifetime of each particle in the system. Equivalent to [member GPUParticles3D.lifetime].

pub fn particles_set_one_shot(&mut self, particles: Rid, one_shot: bool)

If true, particles will emit once and then stop. Equivalent to [member GPUParticles3D.one_shot].

pub fn particles_set_pre_process_time(&mut self, particles: Rid, time: f64)

Sets the preprocess time for the particles’ animation. This lets you delay starting an animation until after the particles have begun emitting. Equivalent to [member GPUParticles3D.preprocess].

pub fn particles_request_process_time(&mut self, particles: Rid, time: f32)

Requests particles to process for extra process time during a single frame.

pub fn particles_set_explosiveness_ratio(&mut self, particles: Rid, ratio: f32)

Sets the explosiveness ratio. Equivalent to [member GPUParticles3D.explosiveness].

pub fn particles_set_randomness_ratio(&mut self, particles: Rid, ratio: f32)

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

pub fn particles_set_interp_to_end(&mut self, particles: Rid, factor: f32)

Sets the value that informs a ParticleProcessMaterial to rush all particles towards the end of their lifetime.

pub fn particles_set_emitter_velocity( &mut self, particles: Rid, velocity: Vector3, )

Sets the velocity of a particle node, that will be used by [member ParticleProcessMaterial.inherit_velocity_ratio].

pub fn particles_set_custom_aabb(&mut self, particles: Rid, aabb: Aabb)

Sets a custom axis-aligned bounding box for the particle system. Equivalent to [member GPUParticles3D.visibility_aabb].

pub fn particles_set_speed_scale(&mut self, particles: Rid, scale: f64)

Sets the speed scale of the particle system. Equivalent to [member GPUParticles3D.speed_scale].

pub fn particles_set_use_local_coordinates( &mut self, particles: Rid, enable: bool, )

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

pub fn particles_set_process_material(&mut self, particles: Rid, material: Rid)

Sets the material for processing the particles.

Note: This is not the material used to draw the materials. Equivalent to [member GPUParticles3D.process_material].

pub fn particles_set_fixed_fps(&mut self, particles: Rid, fps: i32)

Sets the frame rate that the particle system rendering will be fixed to. Equivalent to [member GPUParticles3D.fixed_fps].

pub fn particles_set_interpolate(&mut self, particles: Rid, enable: bool)

pub fn particles_set_fractional_delta(&mut self, particles: Rid, enable: bool)

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

pub fn particles_set_collision_base_size(&mut self, particles: Rid, size: f32)

pub fn particles_set_transform_align( &mut self, particles: Rid, align: ParticlesTransformAlign, )

pub fn particles_set_trails( &mut self, particles: Rid, enable: bool, length_sec: f32, )

If enable is true, enables trails for the particles with the specified length_sec in seconds. Equivalent to [member GPUParticles3D.trail_enabled] and [member GPUParticles3D.trail_lifetime].

pub fn particles_set_trail_bind_poses( &mut self, particles: Rid, bind_poses: &Array<Transform3D>, )

pub fn particles_is_inactive(&mut self, particles: Rid) -> bool

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

pub fn particles_request_process(&mut self, particles: Rid)

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.

pub fn particles_restart(&mut self, particles: Rid)

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

pub fn particles_set_subemitter( &mut self, particles: Rid, subemitter_particles: Rid, )

pub fn particles_emit( &mut self, particles: Rid, transform: Transform3D, velocity: Vector3, color: Color, custom: Color, emit_flags: u32, )

Manually emits particles from the particles instance.

pub fn particles_set_draw_order( &mut self, particles: Rid, order: ParticlesDrawOrder, )

Sets the draw order of the particles. Equivalent to [member GPUParticles3D.draw_order].

pub fn particles_set_draw_passes(&mut self, particles: Rid, count: i32)

Sets the number of draw passes to use. Equivalent to [member GPUParticles3D.draw_passes].

pub fn particles_set_draw_pass_mesh( &mut self, particles: Rid, pass: i32, mesh: Rid, )

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

pub fn particles_get_current_aabb(&mut self, particles: Rid) -> Aabb

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

pub fn particles_set_emission_transform( &mut self, particles: Rid, transform: Transform3D, )

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

pub fn particles_collision_create(&mut self) -> Rid

Creates a new 3D GPU particle collision or attractor and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID can be used in most particles_collision_* RenderingServer functions.

Note: The equivalent nodes are GPUParticlesCollision3D and GPUParticlesAttractor3D.

pub fn particles_collision_set_collision_type( &mut self, particles_collision: Rid, type_: ParticlesCollisionType, )

Sets the collision or attractor shape type for the 3D GPU particles collision or attractor specified by the particles_collision RID.

pub fn particles_collision_set_cull_mask( &mut self, particles_collision: Rid, mask: u32, )

Sets the cull mask for the 3D GPU particles collision or attractor specified by the particles_collision RID. Equivalent to [member GPUParticlesCollision3D.cull_mask] or [member GPUParticlesAttractor3D.cull_mask] depending on the particles_collision type.

pub fn particles_collision_set_sphere_radius( &mut self, particles_collision: Rid, radius: f32, )

Sets the radius for the 3D GPU particles sphere collision or attractor specified by the particles_collision RID. Equivalent to [member GPUParticlesCollisionSphere3D.radius] or [member GPUParticlesAttractorSphere3D.radius] depending on the particles_collision type.

pub fn particles_collision_set_box_extents( &mut self, particles_collision: Rid, extents: Vector3, )

Sets the extents for the 3D GPU particles collision by the particles_collision RID. Equivalent to [member GPUParticlesCollisionBox3D.size], [member GPUParticlesCollisionSDF3D.size], [member GPUParticlesCollisionHeightField3D.size], [member GPUParticlesAttractorBox3D.size] or [member GPUParticlesAttractorVectorField3D.size] depending on the particles_collision type.

pub fn particles_collision_set_attractor_strength( &mut self, particles_collision: Rid, strength: f32, )

Sets the strength for the 3D GPU particles attractor specified by the particles_collision RID. Only used for attractors, not colliders. Equivalent to [member GPUParticlesAttractor3D.strength].

pub fn particles_collision_set_attractor_directionality( &mut self, particles_collision: Rid, amount: f32, )

Sets the directionality amount for the 3D GPU particles attractor specified by the particles_collision RID. Only used for attractors, not colliders. Equivalent to [member GPUParticlesAttractor3D.directionality].

pub fn particles_collision_set_attractor_attenuation( &mut self, particles_collision: Rid, curve: f32, )

Sets the attenuation curve for the 3D GPU particles attractor specified by the particles_collision RID. Only used for attractors, not colliders. Equivalent to [member GPUParticlesAttractor3D.attenuation].

pub fn particles_collision_set_field_texture( &mut self, particles_collision: Rid, texture: Rid, )

Sets the signed distance field texture for the 3D GPU particles collision specified by the particles_collision RID. Equivalent to [member GPUParticlesCollisionSDF3D.texture] or [member GPUParticlesAttractorVectorField3D.texture] depending on the particles_collision type.

pub fn particles_collision_height_field_update( &mut self, particles_collision: Rid, )

Requests an update for the 3D GPU particle collision heightfield. This may be automatically called by the 3D GPU particle collision heightfield depending on its [member GPUParticlesCollisionHeightField3D.update_mode].

pub fn particles_collision_set_height_field_resolution( &mut self, particles_collision: Rid, resolution: ParticlesCollisionHeightfieldResolution, )

Sets the heightmap resolution for the 3D GPU particles heightfield collision specified by the particles_collision RID. Equivalent to [member GPUParticlesCollisionHeightField3D.resolution].

pub fn particles_collision_set_height_field_mask( &mut self, particles_collision: Rid, mask: u32, )

Sets the heightfield mask for the 3D GPU particles heightfield collision specified by the particles_collision RID. Equivalent to [member GPUParticlesCollisionHeightField3D.heightfield_mask].

pub fn fog_volume_create(&mut self) -> Rid

Creates a new fog volume and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all fog_volume_* RenderingServer functions.

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

Note: The equivalent node is FogVolume.

pub fn fog_volume_set_shape(&mut self, fog_volume: Rid, shape: FogVolumeShape)

pub fn fog_volume_set_size(&mut self, fog_volume: Rid, size: Vector3)

pub fn fog_volume_set_material(&mut self, fog_volume: Rid, material: Rid)

Sets the Material of the fog volume. Can be either a FogMaterial or a custom ShaderMaterial.

pub fn visibility_notifier_create(&mut self) -> Rid

Creates a new 3D visibility notifier object and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all visibility_notifier_* RenderingServer functions.

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

To place in a scene, attach this notifier to an instance using instance_set_base using the returned RID.

Note: The equivalent node is VisibleOnScreenNotifier3D.

pub fn visibility_notifier_set_aabb(&mut self, notifier: Rid, aabb: Aabb)

pub fn visibility_notifier_set_callbacks( &mut self, notifier: Rid, enter_callable: &Callable, exit_callable: &Callable, )

pub fn occluder_create(&mut self) -> Rid

Creates an occluder instance and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all occluder_* RenderingServer functions.

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

Note: The equivalent resource is Occluder3D (not to be confused with the OccluderInstance3D node).

pub fn occluder_set_mesh( &mut self, occluder: Rid, vertices: &PackedArray<Vector3>, indices: &PackedArray<i32>, )

Sets the mesh data for the given occluder RID, which controls the shape of the occlusion culling that will be performed.

pub fn camera_create(&mut self) -> Rid

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

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

Note: The equivalent node is Camera3D.

pub fn camera_set_perspective( &mut self, camera: Rid, fovy_degrees: f32, z_near: f32, z_far: f32, )

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

pub fn camera_set_orthogonal( &mut self, camera: Rid, size: f32, z_near: f32, z_far: f32, )

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.

pub fn camera_set_frustum( &mut self, camera: Rid, size: f32, offset: Vector2, z_near: f32, z_far: f32, )

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

pub fn camera_set_transform(&mut self, camera: Rid, transform: Transform3D)

Sets Transform3D of camera.

pub fn camera_set_cull_mask(&mut self, camera: Rid, layers: u32)

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

pub fn camera_set_environment(&mut self, camera: Rid, env: Rid)

Sets the environment used by this camera. Equivalent to [member Camera3D.environment].

pub fn camera_set_camera_attributes(&mut self, camera: Rid, effects: Rid)

Sets the camera_attributes created with camera_attributes_create to the given camera.

pub fn camera_set_compositor(&mut self, camera: Rid, compositor: Rid)

Sets the compositor used by this camera. Equivalent to [member Camera3D.compositor].

pub fn camera_set_use_vertical_aspect(&mut self, camera: Rid, enable: bool)

If true, preserves the horizontal aspect ratio which is equivalent to KeepAspect::WIDTH. If false, preserves the vertical aspect ratio which is equivalent to KeepAspect::HEIGHT.

pub fn viewport_create(&mut self) -> Rid

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

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

Note: The equivalent node is Viewport.

pub fn viewport_set_use_xr(&mut self, viewport: Rid, use_xr: bool)

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

pub fn viewport_set_size(&mut self, viewport: Rid, width: i32, height: i32)

Sets the viewport’s width and height in pixels.

pub fn viewport_set_active(&mut self, viewport: Rid, active: bool)

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

pub fn viewport_set_parent_viewport( &mut self, viewport: Rid, parent_viewport: Rid, )

Sets the viewport’s parent to the viewport specified by the parent_viewport RID.

pub fn viewport_attach_to_screen(&mut self, viewport: Rid)

To set the default parameters, use viewport_attach_to_screen_ex and its builder methods. See the book for detailed usage instructions. Copies the viewport to a region of the screen specified by rect. If viewport_set_render_direct_to_screen is true, then the 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():
	RenderingServer.viewport_attach_to_screen(get_viewport().get_viewport_rid(), Rect2())
	RenderingServer.viewport_attach_to_screen($Viewport.get_viewport_rid(), 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 further optimization, see viewport_set_render_direct_to_screen.

pub fn viewport_attach_to_screen_ex<'ex>( &'ex mut self, viewport: Rid, ) -> ExViewportAttachToScreen<'ex>

Copies the viewport to a region of the screen specified by rect. If viewport_set_render_direct_to_screen is true, then the 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():
	RenderingServer.viewport_attach_to_screen(get_viewport().get_viewport_rid(), Rect2())
	RenderingServer.viewport_attach_to_screen($Viewport.get_viewport_rid(), 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 further optimization, see viewport_set_render_direct_to_screen.

pub fn viewport_set_render_direct_to_screen( &mut self, viewport: Rid, enabled: bool, )

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.

pub fn viewport_set_canvas_cull_mask( &mut self, viewport: Rid, canvas_cull_mask: u32, )

Sets the rendering mask associated with this Viewport. Only CanvasItem nodes with a matching rendering visibility layer will be rendered by this Viewport.

pub fn viewport_set_scaling_3d_mode( &mut self, viewport: Rid, scaling_3d_mode: ViewportScaling3DMode, )

Sets the 3D resolution scaling mode. Bilinear scaling renders at different resolution to either undersample or supersample the viewport. FidelityFX Super Resolution 1.0, abbreviated to FSR, is an upscaling technology that produces high quality images at fast framerates by using a spatially aware upscaling algorithm. FSR is slightly more expensive than bilinear, but it produces significantly higher image quality. FSR should be used where possible.

pub fn viewport_set_scaling_3d_scale(&mut self, viewport: Rid, scale: f32)

Scales the 3D render buffer based on the viewport size uses an image filter specified in [enum ViewportScaling3DMode] to scale the output image to the full viewport size. Values lower than 1.0 can be used to speed up 3D rendering at the cost of quality (undersampling). Values greater than 1.0 are only valid for bilinear mode and can be used to improve 3D rendering quality at a high performance cost (supersampling). See also [enum ViewportMSAA] for multi-sample antialiasing, which is significantly cheaper but only smoothens the edges of polygons.

When using FSR upscaling, AMD recommends exposing the following values as preset options to users “Ultra Quality: 0.77”, “Quality: 0.67”, “Balanced: 0.59”, “Performance: 0.5” instead of exposing the entire scale.

pub fn viewport_set_fsr_sharpness(&mut self, viewport: Rid, sharpness: f32)

Determines how sharp the upscaled image will be when using the FSR upscaling mode. Sharpness halves with every whole number. Values go from 0.0 (sharpest) to 2.0. Values above 2.0 won’t make a visible difference.

pub fn viewport_set_texture_mipmap_bias( &mut self, viewport: Rid, mipmap_bias: f32, )

Affects the final texture sharpness by reading from a lower or higher mipmap (also called “texture LOD bias”). Negative values make mipmapped textures sharper but grainier when viewed at a distance, while positive values make mipmapped textures blurrier (even when up close). To get sharper textures at a distance without introducing too much graininess, set this between -0.75 and 0.0. Enabling temporal antialiasing ([member ProjectSettings.rendering/anti_aliasing/quality/use_taa]) can help reduce the graininess visible when using negative mipmap bias.

Note: When the 3D scaling mode is set to FSR 1.0, this value is used to adjust the automatic mipmap bias which is calculated internally based on the scale factor. The formula for this is -log2(1.0 / scale) + mipmap_bias.

pub fn viewport_set_anisotropic_filtering_level( &mut self, viewport: Rid, anisotropic_filtering_level: ViewportAnisotropicFiltering, )

Sets the maximum number of samples to take when using anisotropic filtering on textures (as a power of two). A higher sample count will result in sharper textures at oblique angles, but is more expensive to compute. A value of 0 forcibly disables anisotropic filtering, even on materials where it is enabled.

The anisotropic filtering level also affects decals and light projectors if they are configured to use anisotropic filtering. See [member ProjectSettings.rendering/textures/decals/filter] and [member ProjectSettings.rendering/textures/light_projectors/filter].

Note: In 3D, for this setting to have an effect, set [member BaseMaterial3D.texture_filter] to TextureFilter::LINEAR_WITH_MIPMAPS_ANISOTROPIC or TextureFilter::NEAREST_WITH_MIPMAPS_ANISOTROPIC on materials.

Note: In 2D, for this setting to have an effect, set [member CanvasItem.texture_filter] to TextureFilter::LINEAR_WITH_MIPMAPS_ANISOTROPIC or TextureFilter::NEAREST_WITH_MIPMAPS_ANISOTROPIC on the CanvasItem node displaying the texture (or in CanvasTexture). However, anisotropic filtering is rarely useful in 2D, so only enable it for textures in 2D if it makes a meaningful visual difference.

pub fn viewport_set_update_mode( &mut self, viewport: Rid, update_mode: ViewportUpdateMode, )

Sets when the viewport should be updated.

pub fn viewport_get_update_mode(&self, viewport: Rid) -> ViewportUpdateMode

Returns the viewport’s update mode.

Warning: Calling this from any thread other than the rendering thread will be detrimental to performance.

pub fn viewport_set_clear_mode( &mut self, viewport: Rid, clear_mode: ViewportClearMode, )

Sets the clear mode of a viewport.

pub fn viewport_get_render_target(&self, viewport: Rid) -> Rid

Returns the render target for the viewport.

pub fn viewport_get_texture(&self, viewport: Rid) -> Rid

Returns the viewport’s last rendered frame.

pub fn viewport_set_disable_3d(&mut self, viewport: Rid, disable: bool)

If true, the viewport’s 3D elements are not rendered.

pub fn viewport_set_disable_2d(&mut self, viewport: Rid, disable: bool)

If true, the viewport’s canvas (i.e. 2D and GUI elements) is not rendered.

pub fn viewport_set_environment_mode( &mut self, viewport: Rid, mode: ViewportEnvironmentMode, )

Sets the viewport’s environment mode which allows enabling or disabling rendering of 3D environment over 2D canvas. When disabled, 2D will not be affected by the environment. When enabled, 2D will be affected by the environment if the environment background mode is EnvironmentBg::CANVAS. The default behavior is to inherit the setting from the viewport’s parent. If the topmost parent is also set to ViewportEnvironmentMode::INHERIT, then the behavior will be the same as if it was set to ViewportEnvironmentMode::ENABLED.

pub fn viewport_attach_camera(&mut self, viewport: Rid, camera: Rid)

Sets a viewport’s camera.

pub fn viewport_set_scenario(&mut self, viewport: Rid, scenario: Rid)

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

pub fn viewport_attach_canvas(&mut self, viewport: Rid, canvas: Rid)

Sets a viewport’s canvas.

pub fn viewport_remove_canvas(&mut self, viewport: Rid, canvas: Rid)

Detaches a viewport from a canvas.

pub fn viewport_set_snap_2d_transforms_to_pixel( &mut self, viewport: Rid, enabled: bool, )

If true, canvas item transforms (i.e. origin position) are snapped to the nearest pixel when rendering. This can lead to a crisper appearance at the cost of less smooth movement, especially when Camera2D smoothing is enabled. Equivalent to [member ProjectSettings.rendering/2d/snap/snap_2d_transforms_to_pixel].

pub fn viewport_set_snap_2d_vertices_to_pixel( &mut self, viewport: Rid, enabled: bool, )

If true, canvas item vertices (i.e. polygon points) are snapped to the nearest pixel when rendering. This can lead to a crisper appearance at the cost of less smooth movement, especially when Camera2D smoothing is enabled. Equivalent to [member ProjectSettings.rendering/2d/snap/snap_2d_vertices_to_pixel].

pub fn viewport_set_default_canvas_item_texture_filter( &mut self, viewport: Rid, filter: CanvasItemTextureFilter, )

Sets the default texture filtering mode for the specified viewport RID.

pub fn viewport_set_default_canvas_item_texture_repeat( &mut self, viewport: Rid, repeat: CanvasItemTextureRepeat, )

Sets the default texture repeat mode for the specified viewport RID.

pub fn viewport_set_canvas_transform( &mut self, viewport: Rid, canvas: Rid, offset: Transform2D, )

Sets the transformation of a viewport’s canvas.

pub fn viewport_set_canvas_stacking( &mut self, viewport: Rid, canvas: Rid, layer: i32, sublayer: i32, )

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.

Note: layer should be between CANVAS_LAYER_MIN and CANVAS_LAYER_MAX (inclusive). Any other value will wrap around.

pub fn viewport_set_transparent_background( &mut self, viewport: Rid, enabled: bool, )

If true, the viewport renders its background as transparent.

pub fn viewport_set_global_canvas_transform( &mut self, viewport: Rid, transform: Transform2D, )

Sets the viewport’s global transformation matrix.

pub fn viewport_set_sdf_oversize_and_scale( &mut self, viewport: Rid, oversize: ViewportSdfOversize, scale: ViewportSdfScale, )

Sets the viewport’s 2D signed distance field [member ProjectSettings.rendering/2d/sdf/oversize] and [member ProjectSettings.rendering/2d/sdf/scale]. This is used when sampling the signed distance field in CanvasItem shaders as well as GPUParticles2D collision. This is not used by SDFGI in 3D rendering.

pub fn viewport_set_positional_shadow_atlas_size( &mut self, viewport: Rid, size: i32, )

To set the default parameters, use viewport_set_positional_shadow_atlas_size_ex and its builder methods. See the book for detailed usage instructions. Sets the size of the shadow atlas’s images (used for omni and spot lights) on the viewport specified by the viewport RID. The value is rounded up to the nearest power of 2. If use_16_bits is true, use 16 bits for the omni/spot shadow depth map. Enabling this results in shadows having less precision and may result in shadow acne, but can lead to performance improvements on some devices.

Note: If this is set to 0, no positional shadows will be visible at all. This can improve performance significantly on low-end systems by reducing both the CPU and GPU load (as fewer draw calls are needed to draw the scene without shadows).

pub fn viewport_set_positional_shadow_atlas_size_ex<'ex>( &'ex mut self, viewport: Rid, size: i32, ) -> ExViewportSetPositionalShadowAtlasSize<'ex>

Sets the size of the shadow atlas’s images (used for omni and spot lights) on the viewport specified by the viewport RID. The value is rounded up to the nearest power of 2. If use_16_bits is true, use 16 bits for the omni/spot shadow depth map. Enabling this results in shadows having less precision and may result in shadow acne, but can lead to performance improvements on some devices.

Note: If this is set to 0, no positional shadows will be visible at all. This can improve performance significantly on low-end systems by reducing both the CPU and GPU load (as fewer draw calls are needed to draw the scene without shadows).

pub fn viewport_set_positional_shadow_atlas_quadrant_subdivision( &mut self, viewport: Rid, quadrant: i32, subdivision: i32, )

Sets the number of subdivisions to use in the specified shadow atlas quadrant for omni and spot shadows. See also set_positional_shadow_atlas_quadrant_subdiv.

pub fn viewport_set_msaa_3d(&mut self, viewport: Rid, msaa: ViewportMsaa)

Sets the multisample antialiasing mode for 3D on the specified viewport RID. Equivalent to [member ProjectSettings.rendering/anti_aliasing/quality/msaa_3d] or [member Viewport.msaa_3d].

pub fn viewport_set_msaa_2d(&mut self, viewport: Rid, msaa: ViewportMsaa)

Sets the multisample antialiasing mode for 2D/Canvas on the specified viewport RID. Equivalent to [member ProjectSettings.rendering/anti_aliasing/quality/msaa_2d] or [member Viewport.msaa_2d].

pub fn viewport_set_use_hdr_2d(&mut self, viewport: Rid, enabled: bool)

If true, 2D rendering will use a high dynamic range (HDR) RGBA16 format framebuffer. Additionally, 2D rendering will be performed on linear values and will be converted using the appropriate transfer function immediately before blitting to the screen (if the Viewport is attached to the screen).

Practically speaking, this means that the end result of the Viewport will not be clamped to the 0-1 range and can be used in 3D rendering without color encoding adjustments. This allows 2D rendering to take advantage of effects requiring high dynamic range (e.g. 2D glow) as well as substantially improves the appearance of effects requiring highly detailed gradients. This setting has the same effect as [member Viewport.use_hdr_2d].

pub fn viewport_set_screen_space_aa( &mut self, viewport: Rid, mode: ViewportScreenSpaceAa, )

Sets the viewport’s screen-space antialiasing mode. Equivalent to [member ProjectSettings.rendering/anti_aliasing/quality/screen_space_aa] or [member Viewport.screen_space_aa].

pub fn viewport_set_use_taa(&mut self, viewport: Rid, enable: bool)

If true, use temporal antialiasing. Equivalent to [member ProjectSettings.rendering/anti_aliasing/quality/use_taa] or [member Viewport.use_taa].

pub fn viewport_set_use_debanding(&mut self, viewport: Rid, enable: bool)

Equivalent to [member Viewport.use_debanding]. See also [member ProjectSettings.rendering/anti_aliasing/quality/use_debanding].

pub fn viewport_set_use_occlusion_culling( &mut self, viewport: Rid, enable: bool, )

If true, enables occlusion culling on the specified viewport. Equivalent to [member ProjectSettings.rendering/occlusion_culling/use_occlusion_culling].

pub fn viewport_set_occlusion_rays_per_thread(&mut self, rays_per_thread: i32)

Sets the [member ProjectSettings.rendering/occlusion_culling/occlusion_rays_per_thread] to use for occlusion culling. This parameter is global and cannot be set on a per-viewport basis.

pub fn viewport_set_occlusion_culling_build_quality( &mut self, quality: ViewportOcclusionCullingBuildQuality, )

Sets the [member ProjectSettings.rendering/occlusion_culling/bvh_build_quality] to use for occlusion culling. This parameter is global and cannot be set on a per-viewport basis.

pub fn viewport_get_render_info( &mut self, viewport: Rid, type_: ViewportRenderInfoType, info: ViewportRenderInfo, ) -> i32

Returns a statistic about the rendering engine which can be used for performance profiling. This is separated into render pass types, each of them having the same infos you can query (different passes will return different values).

See also get_rendering_info, which returns global information across all viewports.

Note: Viewport rendering information is not available until at least 2 frames have been rendered by the engine. If rendering information is not available, viewport_get_render_info returns 0. To print rendering information in _ready() successfully, use the following:

func _ready():
	for _i in 2:
		await get_tree().process_frame

	print(
			RenderingServer.viewport_get_render_info(get_viewport().get_viewport_rid(),
			RenderingServer.VIEWPORT_RENDER_INFO_TYPE_VISIBLE,
			RenderingServer.VIEWPORT_RENDER_INFO_DRAW_CALLS_IN_FRAME)
	)

pub fn viewport_set_debug_draw( &mut self, viewport: Rid, draw: ViewportDebugDraw, )

Sets the debug draw mode of a viewport.

pub fn viewport_set_measure_render_time(&mut self, viewport: Rid, enable: bool)

Sets the measurement for the given viewport RID (obtained using get_viewport_rid). Once enabled, viewport_get_measured_render_time_cpu and viewport_get_measured_render_time_gpu will return values greater than 0.0 when queried with the given viewport.

pub fn viewport_get_measured_render_time_cpu(&self, viewport: Rid) -> f64

Returns the CPU time taken to render the last frame in milliseconds. This only includes time spent in rendering-related operations; scripts’ _process functions and other engine subsystems are not included in this readout. To get a complete readout of CPU time spent to render the scene, sum the render times of all viewports that are drawn every frame plus get_frame_setup_time_cpu. Unlike get_frames_per_second, this method will accurately reflect CPU utilization even if framerate is capped via V-Sync or [member Engine.max_fps]. See also viewport_get_measured_render_time_gpu.

Note: Requires measurements to be enabled on the specified viewport using viewport_set_measure_render_time. Otherwise, this method returns 0.0.

pub fn viewport_get_measured_render_time_gpu(&self, viewport: Rid) -> f64

Returns the GPU time taken to render the last frame in milliseconds. To get a complete readout of GPU time spent to render the scene, sum the render times of all viewports that are drawn every frame. Unlike get_frames_per_second, this method accurately reflects GPU utilization even if framerate is capped via V-Sync or [member Engine.max_fps]. See also viewport_get_measured_render_time_cpu.

Note: Requires measurements to be enabled on the specified viewport using viewport_set_measure_render_time. Otherwise, this method returns 0.0.

Note: When GPU utilization is low enough during a certain period of time, GPUs will decrease their power state (which in turn decreases core and memory clock speeds). This can cause the reported GPU time to increase if GPU utilization is kept low enough by a framerate cap (compared to what it would be at the GPU’s highest power state). Keep this in mind when benchmarking using viewport_get_measured_render_time_gpu. This behavior can be overridden in the graphics driver settings at the cost of higher power usage.

pub fn viewport_set_vrs_mode(&mut self, viewport: Rid, mode: ViewportVrsMode)

Sets the Variable Rate Shading (VRS) mode for the viewport. If the GPU does not support VRS, this property is ignored. Equivalent to [member ProjectSettings.rendering/vrs/mode].

pub fn viewport_set_vrs_update_mode( &mut self, viewport: Rid, mode: ViewportVrsUpdateMode, )

Sets the update mode for Variable Rate Shading (VRS) for the viewport. VRS requires the input texture to be converted to the format usable by the VRS method supported by the hardware. The update mode defines how often this happens. If the GPU does not support VRS, or VRS is not enabled, this property is ignored.

If set to ViewportVrsUpdateMode::ONCE, the input texture is copied once and the mode is changed to ViewportVrsUpdateMode::DISABLED.

pub fn viewport_set_vrs_texture(&mut self, viewport: Rid, texture: Rid)

The texture to use when the VRS mode is set to ViewportVrsMode::TEXTURE. Equivalent to [member ProjectSettings.rendering/vrs/texture].

pub fn sky_create(&mut self) -> Rid

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

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

pub fn sky_set_radiance_size(&mut self, sky: Rid, radiance_size: i32)

Sets the radiance_size of the sky specified by the sky RID (in pixels). Equivalent to [member Sky.radiance_size].

pub fn sky_set_mode(&mut self, sky: Rid, mode: SkyMode)

Sets the process mode of the sky specified by the sky RID. Equivalent to [member Sky.process_mode].

pub fn sky_set_material(&mut self, sky: Rid, material: Rid)

Sets the material that the sky uses to render the background, ambient and reflection maps.

pub fn sky_bake_panorama( &mut self, sky: Rid, energy: f32, bake_irradiance: bool, size: Vector2i, ) -> Option<Gd<Image>>

Generates and returns an Image containing the radiance map for the specified sky RID. This supports built-in sky material and custom sky shaders. If bake_irradiance is true, the irradiance map is saved instead of the radiance map. The radiance map is used to render reflected light, while the irradiance map is used to render ambient light. See also environment_bake_panorama.

Note: The image is saved using linear encoding without any tonemapping performed, which means it will look too dark if viewed directly in an image editor. energy values above 1.0 can be used to brighten the resulting image.

Note: size should be a 2:1 aspect ratio for the generated panorama to have square pixels. For radiance maps, there is no point in using a height greater than [member Sky.radiance_size], as it won’t increase detail. Irradiance maps only contain low-frequency data, so there is usually no point in going past a size of 128×64 pixels when saving an irradiance map.

pub fn compositor_effect_create(&mut self) -> Rid

Creates a new rendering effect and adds it to the RenderingServer. It can be accessed with the RID that is returned.

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

pub fn compositor_effect_set_enabled(&mut self, effect: Rid, enabled: bool)

Enables/disables this rendering effect.

pub fn compositor_effect_set_callback( &mut self, effect: Rid, callback_type: CompositorEffectCallbackType, callback: &Callable, )

Sets the callback type (callback_type) and callback method(callback) for this rendering effect.

pub fn compositor_effect_set_flag( &mut self, effect: Rid, flag: CompositorEffectFlags, set: bool, )

Sets the flag (flag) for this rendering effect to true or false (set).

pub fn compositor_create(&mut self) -> Rid

Creates a new compositor and adds it to the RenderingServer. It can be accessed with the RID that is returned.

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

pub fn compositor_set_compositor_effects( &mut self, compositor: Rid, effects: &Array<Rid>, )

Sets the compositor effects for the specified compositor RID. effects should be an array containing RIDs created with compositor_effect_create.

pub fn environment_create(&mut self) -> Rid

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

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

Note: The equivalent resource is Environment.

pub fn environment_set_background(&mut self, env: Rid, bg: EnvironmentBg)

Sets the environment’s background mode. Equivalent to [member Environment.background_mode].

pub fn environment_set_camera_id(&mut self, env: Rid, id: i32)

Sets the camera ID to be used as environment background.

pub fn environment_set_sky(&mut self, env: Rid, sky: Rid)

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

pub fn environment_set_sky_custom_fov(&mut self, env: Rid, scale: f32)

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

pub fn environment_set_sky_orientation(&mut self, env: Rid, orientation: Basis)

Sets the rotation of the background Sky expressed as a Basis. Equivalent to [member Environment.sky_rotation], where the rotation vector is used to construct the Basis.

pub fn environment_set_bg_color(&mut self, env: Rid, color: Color)

Color displayed for clear areas of the scene. Only effective if using the EnvironmentBg::COLOR background mode.

pub fn environment_set_bg_energy( &mut self, env: Rid, multiplier: f32, exposure_value: f32, )

Sets the intensity of the background color.

pub fn environment_set_canvas_max_layer(&mut self, env: Rid, max_layer: i32)

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

pub fn environment_set_ambient_light(&mut self, env: Rid, color: Color)

To set the default parameters, use environment_set_ambient_light_ex and its builder methods. See the book for detailed usage instructions. Sets the values to be used for ambient light rendering. See Environment for more details.

pub fn environment_set_ambient_light_ex<'ex>( &'ex mut self, env: Rid, color: Color, ) -> ExEnvironmentSetAmbientLight<'ex>

Sets the values to be used for ambient light rendering. See Environment for more details.

pub fn environment_set_glow( &mut self, env: Rid, enable: bool, levels: &PackedArray<f32>, intensity: f32, strength: f32, mix: f32, bloom_threshold: f32, blend_mode: EnvironmentGlowBlendMode, hdr_bleed_threshold: f32, hdr_bleed_scale: f32, hdr_luminance_cap: f32, glow_map_strength: f32, glow_map: Rid, )

Configures glow for the specified environment RID. See glow_* properties in Environment for more information.

pub fn environment_set_tonemap( &mut self, env: Rid, tone_mapper: EnvironmentToneMapper, exposure: f32, white: f32, )

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

pub fn environment_set_tonemap_agx_contrast( &mut self, env: Rid, agx_contrast: f32, )

See [member Environment.tonemap_agx_contrast] for more details.

pub fn environment_set_adjustment( &mut self, env: Rid, enable: bool, brightness: f32, contrast: f32, saturation: f32, use_1d_color_correction: bool, color_correction: Rid, )

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

pub fn environment_set_ssr( &mut self, env: Rid, enable: bool, max_steps: i32, fade_in: f32, fade_out: f32, depth_tolerance: f32, )

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

pub fn environment_set_ssao( &mut self, env: Rid, enable: bool, radius: f32, intensity: f32, power: f32, detail: f32, horizon: f32, sharpness: f32, light_affect: f32, ao_channel_affect: f32, )

Sets the variables to be used with the screen-space ambient occlusion (SSAO) post-process effect. See Environment for more details.

pub fn environment_set_fog( &mut self, env: Rid, enable: bool, light_color: Color, light_energy: f32, sun_scatter: f32, density: f32, height: f32, height_density: f32, aerial_perspective: f32, sky_affect: f32, )

To set the default parameters, use environment_set_fog_ex and its builder methods. See the book for detailed usage instructions. Configures fog for the specified environment RID. See fog_* properties in Environment for more information.

pub fn environment_set_fog_ex<'ex>( &'ex mut self, env: Rid, enable: bool, light_color: Color, light_energy: f32, sun_scatter: f32, density: f32, height: f32, height_density: f32, aerial_perspective: f32, sky_affect: f32, ) -> ExEnvironmentSetFog<'ex>

Configures fog for the specified environment RID. See fog_* properties in Environment for more information.

pub fn environment_set_fog_depth( &mut self, env: Rid, curve: f32, begin: f32, end: f32, )

Configures fog depth for the specified environment RID. Only has an effect when the fog mode of the environment is EnvironmentFogMode::DEPTH. See fog_depth_* properties in Environment for more information.

pub fn environment_set_sdfgi( &mut self, env: Rid, enable: bool, cascades: i32, min_cell_size: f32, y_scale: EnvironmentSdfgiYScale, use_occlusion: bool, bounce_feedback: f32, read_sky: bool, energy: f32, normal_bias: f32, probe_bias: f32, )

Configures signed distance field global illumination for the specified environment RID. See sdfgi_* properties in Environment for more information.

pub fn environment_set_volumetric_fog( &mut self, env: Rid, enable: bool, density: f32, albedo: Color, emission: Color, emission_energy: f32, anisotropy: f32, length: f32, p_detail_spread: f32, gi_inject: f32, temporal_reprojection: bool, temporal_reprojection_amount: f32, ambient_inject: f32, sky_affect: f32, )

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

pub fn environment_glow_set_use_bicubic_upscale(&mut self, enable: bool)

If enable is true, enables bicubic upscaling for glow which improves quality at the cost of performance. Equivalent to [member ProjectSettings.rendering/environment/glow/upscale_mode].

Note: This setting is only effective when using the Forward+ or Mobile rendering methods, as Compatibility uses a different glow implementation.

pub fn environment_set_ssr_half_size(&mut self, half_size: bool)

Sets whether screen-space reflections will be rendered at full or half size. Half size is faster, but may look pixelated or cause flickering.

pub fn environment_set_ssr_roughness_quality( &mut self, quality: EnvironmentSsrRoughnessQuality, )

pub fn environment_set_ssao_quality( &mut self, quality: EnvironmentSsaoQuality, half_size: bool, adaptive_target: f32, blur_passes: i32, fadeout_from: f32, fadeout_to: f32, )

Sets the quality level of the screen-space ambient occlusion (SSAO) post-process effect. See Environment for more details.

pub fn environment_set_ssil_quality( &mut self, quality: EnvironmentSsilQuality, half_size: bool, adaptive_target: f32, blur_passes: i32, fadeout_from: f32, fadeout_to: f32, )

Sets the quality level of the screen-space indirect lighting (SSIL) post-process effect. See Environment for more details.

pub fn environment_set_sdfgi_ray_count( &mut self, ray_count: EnvironmentSdfgiRayCount, )

Sets the number of rays to throw per frame when computing signed distance field global illumination. Equivalent to [member ProjectSettings.rendering/global_illumination/sdfgi/probe_ray_count].

pub fn environment_set_sdfgi_frames_to_converge( &mut self, frames: EnvironmentSdfgiFramesToConverge, )

Sets the number of frames to use for converging signed distance field global illumination. Equivalent to [member ProjectSettings.rendering/global_illumination/sdfgi/frames_to_converge].

pub fn environment_set_sdfgi_frames_to_update_light( &mut self, frames: EnvironmentSdfgiFramesToUpdateLight, )

Sets the update speed for dynamic lights’ indirect lighting when computing signed distance field global illumination. Equivalent to [member ProjectSettings.rendering/global_illumination/sdfgi/frames_to_update_lights].

pub fn environment_set_volumetric_fog_volume_size( &mut self, size: i32, depth: i32, )

Sets the resolution of the volumetric fog’s froxel buffer. size is modified by the screen’s aspect ratio and then used to set the width and height of the buffer. While depth is directly used to set the depth of the buffer.

pub fn environment_set_volumetric_fog_filter_active(&mut self, active: bool)

Enables filtering of the volumetric fog scattering buffer. This results in much smoother volumes with very few under-sampling artifacts.

pub fn environment_bake_panorama( &mut self, environment: Rid, bake_irradiance: bool, size: Vector2i, ) -> Option<Gd<Image>>

Generates and returns an Image containing the radiance map for the specified environment RID’s sky. This supports built-in sky material and custom sky shaders. If bake_irradiance is true, the irradiance map is saved instead of the radiance map. The radiance map is used to render reflected light, while the irradiance map is used to render ambient light. See also sky_bake_panorama.

Note: The image is saved using linear encoding without any tonemapping performed, which means it will look too dark if viewed directly in an image editor.

Note: size should be a 2:1 aspect ratio for the generated panorama to have square pixels. For radiance maps, there is no point in using a height greater than [member Sky.radiance_size], as it won’t increase detail. Irradiance maps only contain low-frequency data, so there is usually no point in going past a size of 128×64 pixels when saving an irradiance map.

pub fn screen_space_roughness_limiter_set_active( &mut self, enable: bool, amount: f32, limit: f32, )

Sets the screen-space roughness limiter parameters, such as whether it should be enabled and its thresholds. Equivalent to [member ProjectSettings.rendering/anti_aliasing/screen_space_roughness_limiter/enabled], [member ProjectSettings.rendering/anti_aliasing/screen_space_roughness_limiter/amount] and [member ProjectSettings.rendering/anti_aliasing/screen_space_roughness_limiter/limit].

pub fn sub_surface_scattering_set_quality( &mut self, quality: SubSurfaceScatteringQuality, )

Sets [member ProjectSettings.rendering/environment/subsurface_scattering/subsurface_scattering_quality] to use when rendering materials that have subsurface scattering enabled.

pub fn sub_surface_scattering_set_scale(&mut self, scale: f32, depth_scale: f32)

Sets the [member ProjectSettings.rendering/environment/subsurface_scattering/subsurface_scattering_scale] and [member ProjectSettings.rendering/environment/subsurface_scattering/subsurface_scattering_depth_scale] to use when rendering materials that have subsurface scattering enabled.

pub fn camera_attributes_create(&mut self) -> Rid

Creates a camera attributes object and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all camera_attributes_ RenderingServer functions.

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

Note: The equivalent resource is CameraAttributes.

pub fn camera_attributes_set_dof_blur_quality( &mut self, quality: DofBlurQuality, use_jitter: bool, )

Sets the quality level of the DOF blur effect to quality. use_jitter can be used to jitter samples taken during the blur pass to hide artifacts at the cost of looking more fuzzy.

pub fn camera_attributes_set_dof_blur_bokeh_shape( &mut self, shape: DofBokehShape, )

Sets the shape of the DOF bokeh pattern to shape. Different shapes may be used to achieve artistic effect, or to meet performance targets.

pub fn camera_attributes_set_dof_blur( &mut self, camera_attributes: Rid, far_enable: bool, far_distance: f32, far_transition: f32, near_enable: bool, near_distance: f32, near_transition: f32, amount: f32, )

Sets the parameters to use with the DOF blur effect. These parameters take on the same meaning as their counterparts in CameraAttributesPractical.

pub fn camera_attributes_set_exposure( &mut self, camera_attributes: Rid, multiplier: f32, normalization: f32, )

Sets the exposure values that will be used by the renderers. The normalization amount is used to bake a given Exposure Value (EV) into rendering calculations to reduce the dynamic range of the scene.

The normalization factor can be calculated from exposure value (EV100) as follows:

func get_exposure_normalization(ev100: float):
	return 1.0 / (pow(2.0, ev100) * 1.2)

The exposure value can be calculated from aperture (in f-stops), shutter speed (in seconds), and sensitivity (in ISO) as follows:

func get_exposure(aperture: float, shutter_speed: float, sensitivity: float):
	return log((aperture * aperture) / shutter_speed * (100.0 / sensitivity)) / log(2)

pub fn camera_attributes_set_auto_exposure( &mut self, camera_attributes: Rid, enable: bool, min_sensitivity: f32, max_sensitivity: f32, speed: f32, scale: f32, )

Sets the parameters to use with the auto-exposure effect. These parameters take on the same meaning as their counterparts in CameraAttributes and CameraAttributesPractical.

pub fn scenario_create(&mut self) -> Rid

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

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

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

pub fn scenario_set_environment(&mut self, scenario: Rid, environment: Rid)

Sets the environment that will be used with this scenario. See also Environment.

pub fn scenario_set_fallback_environment( &mut self, scenario: Rid, environment: Rid, )

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.

pub fn scenario_set_camera_attributes(&mut self, scenario: Rid, effects: Rid)

Sets the camera attributes (effects) that will be used with this scenario. See also CameraAttributes.

pub fn scenario_set_compositor(&mut self, scenario: Rid, compositor: Rid)

Sets the compositor (compositor) that will be used with this scenario. See also Compositor.

pub fn instance_create2(&mut self, base: Rid, scenario: Rid) -> Rid

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

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method. This is a shorthand for using instance_create and setting the base and scenario manually.

pub fn instance_create(&mut self) -> Rid

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

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

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

Note: The equivalent node is VisualInstance3D.

pub fn instance_set_base(&mut self, instance: Rid, base: Rid)

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

pub fn instance_set_scenario(&mut self, instance: Rid, scenario: Rid)

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

pub fn instance_set_layer_mask(&mut self, instance: Rid, mask: u32)

Sets the render layers that this instance will be drawn to. Equivalent to [member VisualInstance3D.layers].

pub fn instance_set_pivot_data( &mut self, instance: Rid, sorting_offset: f32, use_aabb_center: bool, )

Sets the sorting offset and switches between using the bounding box or instance origin for depth sorting.

pub fn instance_set_transform(&mut self, instance: Rid, transform: Transform3D)

Sets the world space transform of the instance. Equivalent to [member Node3D.global_transform].

pub fn instance_attach_object_instance_id(&mut self, instance: Rid, id: u64)

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.

pub fn instance_set_blend_shape_weight( &mut self, instance: Rid, shape: i32, weight: f32, )

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

pub fn instance_set_surface_override_material( &mut self, instance: Rid, surface: i32, material: Rid, )

Sets the override material of a specific surface. Equivalent to set_surface_override_material.

pub fn instance_set_visible(&mut self, instance: Rid, visible: bool)

Sets whether an instance is drawn or not. Equivalent to [member Node3D.visible].

pub fn instance_geometry_set_transparency( &mut self, instance: Rid, transparency: f32, )

Sets the transparency for the given geometry instance. Equivalent to [member GeometryInstance3D.transparency].

A transparency of 0.0 is fully opaque, while 1.0 is fully transparent. Values greater than 0.0 (exclusive) will force the geometry’s materials to go through the transparent pipeline, which is slower to render and can exhibit rendering issues due to incorrect transparency sorting. However, unlike using a transparent material, setting transparency to a value greater than 0.0 (exclusive) will not disable shadow rendering.

In spatial shaders, 1.0 - transparency is set as the default value of the ALPHA built-in.

Note: transparency is clamped between 0.0 and 1.0, so this property cannot be used to make transparent materials more opaque than they originally are.

pub fn instance_teleport(&mut self, instance: Rid)

Resets motion vectors and other interpolated values. Use this after teleporting a mesh from one position to another to avoid ghosting artifacts.

pub fn instance_set_custom_aabb(&mut self, instance: Rid, aabb: Aabb)

Sets a custom AABB to use when culling objects from the view frustum. Equivalent to setting [member GeometryInstance3D.custom_aabb].

pub fn instance_attach_skeleton(&mut self, instance: Rid, skeleton: Rid)

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

pub fn instance_set_extra_visibility_margin( &mut self, instance: Rid, margin: f32, )

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 [member GeometryInstance3D.extra_cull_margin].

pub fn instance_set_visibility_parent(&mut self, instance: Rid, parent: Rid)

Sets the visibility parent for the given instance. Equivalent to [member Node3D.visibility_parent].

pub fn instance_set_ignore_culling(&mut self, instance: Rid, enabled: bool)

If true, ignores both frustum and occlusion culling on the specified 3D geometry instance. This is not the same as [member GeometryInstance3D.ignore_occlusion_culling], which only ignores occlusion culling and leaves frustum culling intact.

pub fn instance_geometry_set_flag( &mut self, instance: Rid, flag: InstanceFlags, enabled: bool, )

Sets the flag for a given instance to enabled.

pub fn instance_geometry_set_cast_shadows_setting( &mut self, instance: Rid, shadow_casting_setting: ShadowCastingSetting, )

Sets the shadow casting setting. Equivalent to [member GeometryInstance3D.cast_shadow].

pub fn instance_geometry_set_material_override( &mut self, instance: Rid, material: Rid, )

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

pub fn instance_geometry_set_material_overlay( &mut self, instance: Rid, material: Rid, )

Sets a material that will be rendered for all surfaces on top of active materials for the mesh associated with this instance. Equivalent to [member GeometryInstance3D.material_overlay].

pub fn instance_geometry_set_visibility_range( &mut self, instance: Rid, min: f32, max: f32, min_margin: f32, max_margin: f32, fade_mode: VisibilityRangeFadeMode, )

Sets the visibility range values for the given geometry instance. Equivalent to [member GeometryInstance3D.visibility_range_begin] and related properties.

pub fn instance_geometry_set_lightmap( &mut self, instance: Rid, lightmap: Rid, lightmap_uv_scale: Rect2, lightmap_slice: i32, )

Sets the lightmap GI instance to use for the specified 3D geometry instance. The lightmap UV scale for the specified instance (equivalent to [member GeometryInstance3D.gi_lightmap_scale]) and lightmap atlas slice must also be specified.

pub fn instance_geometry_set_lod_bias(&mut self, instance: Rid, lod_bias: f32)

Sets the level of detail bias to use when rendering the specified 3D geometry instance. Higher values result in higher detail from further away. Equivalent to [member GeometryInstance3D.lod_bias].

pub fn instance_geometry_set_shader_parameter( &mut self, instance: Rid, parameter: impl AsArg<StringName>, value: &Variant, )

Sets the per-instance shader uniform on the specified 3D geometry instance. Equivalent to set_instance_shader_parameter.

pub fn instance_geometry_get_shader_parameter( &self, instance: Rid, parameter: impl AsArg<StringName>, ) -> Variant

Returns the value of the per-instance shader uniform from the specified 3D geometry instance. Equivalent to get_instance_shader_parameter.

Note: Per-instance shader parameter names are case-sensitive.

pub fn instance_geometry_get_shader_parameter_default_value( &self, instance: Rid, parameter: impl AsArg<StringName>, ) -> Variant

Returns the default value of the per-instance shader uniform from the specified 3D geometry instance. Equivalent to get_instance_shader_parameter.

pub fn instance_geometry_get_shader_parameter_list( &self, instance: Rid, ) -> Array<Dictionary<Variant, Variant>>

Returns a dictionary of per-instance shader uniform names of the per-instance shader uniform from the specified 3D geometry instance. The returned dictionary is in PropertyInfo format, with the keys name, class_name, type, hint, hint_string and usage. Equivalent to get_instance_shader_parameter.

pub fn instances_cull_aabb(&self, aabb: Aabb) -> PackedArray<i64>

To set the default parameters, use instances_cull_aabb_ex and its builder methods. See the book for detailed usage instructions. Returns an array of object IDs intersecting with the provided AABB. Only 3D nodes that inherit from VisualInstance3D are considered, such as MeshInstance3D or DirectionalLight3D. Use from_instance_id to obtain the actual nodes. A scenario RID must be provided, which is available in the World3D 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.

pub fn instances_cull_aabb_ex<'ex>( &'ex self, aabb: Aabb, ) -> ExInstancesCullAabb<'ex>

Returns an array of object IDs intersecting with the provided AABB. Only 3D nodes that inherit from VisualInstance3D are considered, such as MeshInstance3D or DirectionalLight3D. Use from_instance_id to obtain the actual nodes. A scenario RID must be provided, which is available in the World3D 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.

pub fn instances_cull_ray(&self, from: Vector3, to: Vector3) -> PackedArray<i64>

To set the default parameters, use instances_cull_ray_ex and its builder methods. See the book for detailed usage instructions. Returns an array of object IDs intersecting with the provided 3D ray. Only 3D nodes that inherit from VisualInstance3D are considered, such as MeshInstance3D or DirectionalLight3D. Use from_instance_id to obtain the actual nodes. A scenario RID must be provided, which is available in the World3D 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.

pub fn instances_cull_ray_ex<'ex>( &'ex self, from: Vector3, to: Vector3, ) -> ExInstancesCullRay<'ex>

Returns an array of object IDs intersecting with the provided 3D ray. Only 3D nodes that inherit from VisualInstance3D are considered, such as MeshInstance3D or DirectionalLight3D. Use from_instance_id to obtain the actual nodes. A scenario RID must be provided, which is available in the World3D 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.

pub fn instances_cull_convex(&self, convex: &Array<Plane>) -> PackedArray<i64>

To set the default parameters, use instances_cull_convex_ex and its builder methods. See the book for detailed usage instructions. Returns an array of object IDs intersecting with the provided convex shape. Only 3D nodes that inherit from VisualInstance3D are considered, such as MeshInstance3D or DirectionalLight3D. Use from_instance_id to obtain the actual nodes. A scenario RID must be provided, which is available in the World3D 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.

pub fn instances_cull_convex_ex<'ex>( &'ex self, convex: &'ex Array<Plane>, ) -> ExInstancesCullConvex<'ex>

Returns an array of object IDs intersecting with the provided convex shape. Only 3D nodes that inherit from VisualInstance3D are considered, such as MeshInstance3D or DirectionalLight3D. Use from_instance_id to obtain the actual nodes. A scenario RID must be provided, which is available in the World3D 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.

pub fn bake_render_uv2( &mut self, base: Rid, material_overrides: &Array<Rid>, image_size: Vector2i, ) -> Array<Gd<Image>>

Bakes the material data of the Mesh passed in the base parameter with optional material_overrides to a set of Images of size image_size. Returns an array of Images containing material properties as specified in [enum BakeChannels].

pub fn canvas_create(&mut self) -> Rid

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_* RenderingServer functions.

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

Canvas has no Resource or Node equivalent.

pub fn canvas_set_item_mirroring( &mut self, canvas: Rid, item: Rid, mirroring: Vector2, )

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

Note: This is equivalent to calling canvas_set_item_repeat like canvas_set_item_repeat(item, mirroring, 1), with an additional check ensuring canvas is a parent of item.

pub fn canvas_set_item_repeat( &mut self, item: Rid, repeat_size: Vector2, repeat_times: i32, )

A copy of the canvas item will be drawn with a local offset of the repeat_size by the number of times of the repeat_times. As the repeat_times increases, the copies will spread away from the origin texture.

pub fn canvas_set_modulate(&mut self, canvas: Rid, color: Color)

Modulates all colors in the given canvas.

pub fn canvas_set_disable_scale(&mut self, disable: bool)

pub fn canvas_texture_create(&mut self) -> Rid

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

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method. See also texture_2d_create.

Note: The equivalent resource is CanvasTexture and is only meant to be used in 2D rendering, not 3D.

pub fn canvas_texture_set_channel( &mut self, canvas_texture: Rid, channel: CanvasTextureChannel, texture: Rid, )

Sets the channel’s texture for the canvas texture specified by the canvas_texture RID. Equivalent to [member CanvasTexture.diffuse_texture], [member CanvasTexture.normal_texture] and [member CanvasTexture.specular_texture].

pub fn canvas_texture_set_shading_parameters( &mut self, canvas_texture: Rid, base_color: Color, shininess: f32, )

Sets the base_color and shininess to use for the canvas texture specified by the canvas_texture RID. Equivalent to [member CanvasTexture.specular_color] and [member CanvasTexture.specular_shininess].

pub fn canvas_texture_set_texture_filter( &mut self, canvas_texture: Rid, filter: CanvasItemTextureFilter, )

Sets the texture filter mode to use for the canvas texture specified by the canvas_texture RID.

pub fn canvas_texture_set_texture_repeat( &mut self, canvas_texture: Rid, repeat: CanvasItemTextureRepeat, )

Sets the texture repeat mode to use for the canvas texture specified by the canvas_texture RID.

pub fn canvas_item_create(&mut self) -> Rid

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

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

Note: The equivalent node is CanvasItem.

pub fn canvas_item_set_parent(&mut self, item: Rid, parent: Rid)

Sets a parent CanvasItem to the CanvasItem. The item will inherit transform, modulation and visibility from its parent, like CanvasItem nodes in the scene tree.

pub fn canvas_item_set_default_texture_filter( &mut self, item: Rid, filter: CanvasItemTextureFilter, )

Sets the default texture filter mode for the canvas item specified by the item RID. Equivalent to [member CanvasItem.texture_filter].

pub fn canvas_item_set_default_texture_repeat( &mut self, item: Rid, repeat: CanvasItemTextureRepeat, )

Sets the default texture repeat mode for the canvas item specified by the item RID. Equivalent to [member CanvasItem.texture_repeat].

pub fn canvas_item_set_visible(&mut self, item: Rid, visible: bool)

Sets the visibility of the CanvasItem.

pub fn canvas_item_set_light_mask(&mut self, item: Rid, mask: i32)

Sets the light mask for the canvas item specified by the item RID. Equivalent to [member CanvasItem.light_mask].

pub fn canvas_item_set_visibility_layer( &mut self, item: Rid, visibility_layer: u32, )

Sets the rendering visibility layer associated with this CanvasItem. Only Viewport nodes with a matching rendering mask will render this CanvasItem.

pub fn canvas_item_set_transform(&mut self, item: Rid, transform: Transform2D)

Sets the transform of the canvas item specified by the item RID. This affects where and how the item will be drawn. Child canvas items’ transforms are multiplied by their parent’s transform. Equivalent to [member Node2D.transform].

pub fn canvas_item_set_clip(&mut self, item: Rid, clip: bool)

If clip is true, makes the canvas item specified by the item RID not draw anything outside of its rect’s coordinates. This clipping is fast, but works only with axis-aligned rectangles. This means that rotation is ignored by the clipping rectangle. For more advanced clipping shapes, use canvas_item_set_canvas_group_mode instead.

Note: The equivalent node functionality is found in [member Label.clip_text], RichTextLabel (always enabled) and more.

pub fn canvas_item_set_distance_field_mode(&mut self, item: Rid, enabled: bool)

If enabled is true, enables multichannel signed distance field rendering mode for the canvas item specified by the item RID. This is meant to be used for font rendering, or with specially generated images using msdfgen.

pub fn canvas_item_set_custom_rect(&mut self, item: Rid, use_custom_rect: bool)

To set the default parameters, use canvas_item_set_custom_rect_ex and its builder methods. See the book for detailed usage instructions. If use_custom_rect is true, sets the custom visibility rectangle (used for culling) to rect for the canvas item specified by item. Setting a custom visibility rect can reduce CPU load when drawing lots of 2D instances. If use_custom_rect is false, automatically computes a visibility rectangle based on the canvas item’s draw commands.

pub fn canvas_item_set_custom_rect_ex<'ex>( &'ex mut self, item: Rid, use_custom_rect: bool, ) -> ExCanvasItemSetCustomRect<'ex>

If use_custom_rect is true, sets the custom visibility rectangle (used for culling) to rect for the canvas item specified by item. Setting a custom visibility rect can reduce CPU load when drawing lots of 2D instances. If use_custom_rect is false, automatically computes a visibility rectangle based on the canvas item’s draw commands.

pub fn canvas_item_set_modulate(&mut self, item: Rid, color: Color)

Multiplies the color of the canvas item specified by the item RID, while affecting its children. See also canvas_item_set_self_modulate. Equivalent to [member CanvasItem.modulate].

pub fn canvas_item_set_self_modulate(&mut self, item: Rid, color: Color)

Multiplies the color of the canvas item specified by the item RID, without affecting its children. See also canvas_item_set_modulate. Equivalent to [member CanvasItem.self_modulate].

pub fn canvas_item_set_draw_behind_parent(&mut self, item: Rid, enabled: bool)

If enabled is true, draws the canvas item specified by the item RID behind its parent. Equivalent to [member CanvasItem.show_behind_parent].

pub fn canvas_item_set_interpolated(&mut self, item: Rid, interpolated: bool)

If interpolated is true, turns on physics interpolation for the canvas item.

pub fn canvas_item_reset_physics_interpolation(&mut self, item: Rid)

Prevents physics interpolation for the current physics tick.

This is useful when moving a canvas item to a new location, to give an instantaneous change rather than interpolation from the previous location.

pub fn canvas_item_transform_physics_interpolation( &mut self, item: Rid, transform: Transform2D, )

Transforms both the current and previous stored transform for a canvas item.

This allows transforming a canvas item without creating a “glitch” in the interpolation, which is particularly useful for large worlds utilizing a shifting origin.

pub fn canvas_item_add_line( &mut self, item: Rid, from: Vector2, to: Vector2, color: Color, )

To set the default parameters, use canvas_item_add_line_ex and its builder methods. See the book for detailed usage instructions. Draws a line on the CanvasItem pointed to by the item RID. See also draw_line.

pub fn canvas_item_add_line_ex<'ex>( &'ex mut self, item: Rid, from: Vector2, to: Vector2, color: Color, ) -> ExCanvasItemAddLine<'ex>

Draws a line on the CanvasItem pointed to by the item RID. See also draw_line.

pub fn canvas_item_add_polyline( &mut self, item: Rid, points: &PackedArray<Vector2>, colors: &PackedArray<Color>, )

To set the default parameters, use canvas_item_add_polyline_ex and its builder methods. See the book for detailed usage instructions. Draws a 2D polyline on the CanvasItem pointed to by the item RID. See also draw_polyline and draw_polyline_colors.

pub fn canvas_item_add_polyline_ex<'ex>( &'ex mut self, item: Rid, points: &'ex PackedArray<Vector2>, colors: &'ex PackedArray<Color>, ) -> ExCanvasItemAddPolyline<'ex>

Draws a 2D polyline on the CanvasItem pointed to by the item RID. See also draw_polyline and draw_polyline_colors.

pub fn canvas_item_add_multiline( &mut self, item: Rid, points: &PackedArray<Vector2>, colors: &PackedArray<Color>, )

To set the default parameters, use canvas_item_add_multiline_ex and its builder methods. See the book for detailed usage instructions. Draws a 2D multiline on the CanvasItem pointed to by the item RID. See also draw_multiline and draw_multiline_colors.

pub fn canvas_item_add_multiline_ex<'ex>( &'ex mut self, item: Rid, points: &'ex PackedArray<Vector2>, colors: &'ex PackedArray<Color>, ) -> ExCanvasItemAddMultiline<'ex>

Draws a 2D multiline on the CanvasItem pointed to by the item RID. See also draw_multiline and draw_multiline_colors.

pub fn canvas_item_add_rect(&mut self, item: Rid, rect: Rect2, color: Color)

To set the default parameters, use canvas_item_add_rect_ex and its builder methods. See the book for detailed usage instructions. Draws a rectangle on the CanvasItem pointed to by the item RID. See also draw_rect.

pub fn canvas_item_add_rect_ex<'ex>( &'ex mut self, item: Rid, rect: Rect2, color: Color, ) -> ExCanvasItemAddRect<'ex>

Draws a rectangle on the CanvasItem pointed to by the item RID. See also draw_rect.

pub fn canvas_item_add_circle( &mut self, item: Rid, pos: Vector2, radius: f32, color: Color, )

To set the default parameters, use canvas_item_add_circle_ex and its builder methods. See the book for detailed usage instructions. Draws a circle on the CanvasItem pointed to by the item RID. See also draw_circle.

pub fn canvas_item_add_circle_ex<'ex>( &'ex mut self, item: Rid, pos: Vector2, radius: f32, color: Color, ) -> ExCanvasItemAddCircle<'ex>

Draws a circle on the CanvasItem pointed to by the item RID. See also draw_circle.

pub fn canvas_item_add_ellipse( &mut self, item: Rid, pos: Vector2, major: f32, minor: f32, color: Color, )

To set the default parameters, use canvas_item_add_ellipse_ex and its builder methods. See the book for detailed usage instructions. Draws an ellipse with semi-major axis major and semi-minor axis minor on the CanvasItem pointed to by the item RID. See also draw_ellipse.

pub fn canvas_item_add_ellipse_ex<'ex>( &'ex mut self, item: Rid, pos: Vector2, major: f32, minor: f32, color: Color, ) -> ExCanvasItemAddEllipse<'ex>

Draws an ellipse with semi-major axis major and semi-minor axis minor on the CanvasItem pointed to by the item RID. See also draw_ellipse.

pub fn canvas_item_add_texture_rect( &mut self, item: Rid, rect: Rect2, texture: Rid, )

To set the default parameters, use canvas_item_add_texture_rect_ex and its builder methods. See the book for detailed usage instructions. Draws a 2D textured rectangle on the CanvasItem pointed to by the item RID. See also draw_texture_rect and draw_rect.

pub fn canvas_item_add_texture_rect_ex<'ex>( &'ex mut self, item: Rid, rect: Rect2, texture: Rid, ) -> ExCanvasItemAddTextureRect<'ex>

Draws a 2D textured rectangle on the CanvasItem pointed to by the item RID. See also draw_texture_rect and draw_rect.

pub fn canvas_item_add_msdf_texture_rect_region( &mut self, item: Rid, rect: Rect2, texture: Rid, src_rect: Rect2, )

To set the default parameters, use canvas_item_add_msdf_texture_rect_region_ex and its builder methods. See the book for detailed usage instructions. See also draw_msdf_texture_rect_region.

pub fn canvas_item_add_msdf_texture_rect_region_ex<'ex>( &'ex mut self, item: Rid, rect: Rect2, texture: Rid, src_rect: Rect2, ) -> ExCanvasItemAddMsdfTextureRectRegion<'ex>

pub fn canvas_item_add_lcd_texture_rect_region( &mut self, item: Rid, rect: Rect2, texture: Rid, src_rect: Rect2, modulate: Color, )

pub fn canvas_item_add_texture_rect_region( &mut self, item: Rid, rect: Rect2, texture: Rid, src_rect: Rect2, )

To set the default parameters, use canvas_item_add_texture_rect_region_ex and its builder methods. See the book for detailed usage instructions. Draws the specified region of a 2D textured rectangle on the CanvasItem pointed to by the item RID. See also draw_texture_rect_region and draw_rect_region.

pub fn canvas_item_add_texture_rect_region_ex<'ex>( &'ex mut self, item: Rid, rect: Rect2, texture: Rid, src_rect: Rect2, ) -> ExCanvasItemAddTextureRectRegion<'ex>

Draws the specified region of a 2D textured rectangle on the CanvasItem pointed to by the item RID. See also draw_texture_rect_region and draw_rect_region.

pub fn canvas_item_add_nine_patch( &mut self, item: Rid, rect: Rect2, source: Rect2, texture: Rid, topleft: Vector2, bottomright: Vector2, )

To set the default parameters, use canvas_item_add_nine_patch_ex and its builder methods. See the book for detailed usage instructions. Draws a nine-patch rectangle on the CanvasItem pointed to by the item RID.

pub fn canvas_item_add_nine_patch_ex<'ex>( &'ex mut self, item: Rid, rect: Rect2, source: Rect2, texture: Rid, topleft: Vector2, bottomright: Vector2, ) -> ExCanvasItemAddNinePatch<'ex>

Draws a nine-patch rectangle on the CanvasItem pointed to by the item RID.

pub fn canvas_item_add_primitive( &mut self, item: Rid, points: &PackedArray<Vector2>, colors: &PackedArray<Color>, uvs: &PackedArray<Vector2>, texture: Rid, )

Draws a 2D primitive on the CanvasItem pointed to by the item RID. See also draw_primitive.

pub fn canvas_item_add_polygon( &mut self, item: Rid, points: &PackedArray<Vector2>, colors: &PackedArray<Color>, )

To set the default parameters, use canvas_item_add_polygon_ex and its builder methods. See the book for detailed usage instructions. Draws a 2D polygon on the CanvasItem pointed to by the item RID. If you need more flexibility (such as being able to use bones), use canvas_item_add_triangle_array instead. See also draw_polygon.

Note: If you frequently redraw the same polygon with a large number of vertices, consider pre-calculating the triangulation with triangulate_polygon and using draw_mesh, draw_multimesh, or canvas_item_add_triangle_array.

pub fn canvas_item_add_polygon_ex<'ex>( &'ex mut self, item: Rid, points: &'ex PackedArray<Vector2>, colors: &'ex PackedArray<Color>, ) -> ExCanvasItemAddPolygon<'ex>

Draws a 2D polygon on the CanvasItem pointed to by the item RID. If you need more flexibility (such as being able to use bones), use canvas_item_add_triangle_array instead. See also draw_polygon.

Note: If you frequently redraw the same polygon with a large number of vertices, consider pre-calculating the triangulation with triangulate_polygon and using draw_mesh, draw_multimesh, or canvas_item_add_triangle_array.

pub fn canvas_item_add_triangle_array( &mut self, item: Rid, indices: &PackedArray<i32>, points: &PackedArray<Vector2>, colors: &PackedArray<Color>, )

To set the default parameters, use canvas_item_add_triangle_array_ex and its builder methods. See the book for detailed usage instructions. Draws a triangle array on the CanvasItem pointed to by the item RID. This is internally used by Line2D and StyleBoxFlat for rendering. canvas_item_add_triangle_array is highly flexible, but more complex to use than canvas_item_add_polygon.

Note: If count is set to a non-negative value, only the first count * 3 indices (corresponding to count triangles) will be drawn. Otherwise, all indices are drawn.

pub fn canvas_item_add_triangle_array_ex<'ex>( &'ex mut self, item: Rid, indices: &'ex PackedArray<i32>, points: &'ex PackedArray<Vector2>, colors: &'ex PackedArray<Color>, ) -> ExCanvasItemAddTriangleArray<'ex>

Draws a triangle array on the CanvasItem pointed to by the item RID. This is internally used by Line2D and StyleBoxFlat for rendering. canvas_item_add_triangle_array is highly flexible, but more complex to use than canvas_item_add_polygon.

Note: If count is set to a non-negative value, only the first count * 3 indices (corresponding to count triangles) will be drawn. Otherwise, all indices are drawn.

pub fn canvas_item_add_mesh(&mut self, item: Rid, mesh: Rid)

To set the default parameters, use canvas_item_add_mesh_ex and its builder methods. See the book for detailed usage instructions. Draws a mesh created with mesh_create with given transform, modulate color, and texture. This is used internally by MeshInstance2D.

pub fn canvas_item_add_mesh_ex<'ex>( &'ex mut self, item: Rid, mesh: Rid, ) -> ExCanvasItemAddMesh<'ex>

Draws a mesh created with mesh_create with given transform, modulate color, and texture. This is used internally by MeshInstance2D.

pub fn canvas_item_add_multimesh(&mut self, item: Rid, mesh: Rid)

To set the default parameters, use canvas_item_add_multimesh_ex and its builder methods. See the book for detailed usage instructions. Draws a 2D MultiMesh on the CanvasItem pointed to by the item RID. See also draw_multimesh.

pub fn canvas_item_add_multimesh_ex<'ex>( &'ex mut self, item: Rid, mesh: Rid, ) -> ExCanvasItemAddMultimesh<'ex>

Draws a 2D MultiMesh on the CanvasItem pointed to by the item RID. See also draw_multimesh.

pub fn canvas_item_add_particles( &mut self, item: Rid, particles: Rid, texture: Rid, )

Draws particles on the CanvasItem pointed to by the item RID.

pub fn canvas_item_add_set_transform( &mut self, item: Rid, transform: Transform2D, )

Sets a Transform2D that will be used to transform subsequent canvas item commands.

pub fn canvas_item_add_clip_ignore(&mut self, item: Rid, ignore: bool)

If ignore is true, ignore clipping on items drawn with this canvas item until this is called again with ignore set to false.

pub fn canvas_item_add_animation_slice( &mut self, item: Rid, animation_length: f64, slice_begin: f64, slice_end: f64, )

To set the default parameters, use canvas_item_add_animation_slice_ex and its builder methods. See the book for detailed usage instructions. Subsequent drawing commands will be ignored unless they fall within the specified animation slice. This is a faster way to implement animations that loop on background rather than redrawing constantly.

pub fn canvas_item_add_animation_slice_ex<'ex>( &'ex mut self, item: Rid, animation_length: f64, slice_begin: f64, slice_end: f64, ) -> ExCanvasItemAddAnimationSlice<'ex>

Subsequent drawing commands will be ignored unless they fall within the specified animation slice. This is a faster way to implement animations that loop on background rather than redrawing constantly.

pub fn canvas_item_set_sort_children_by_y(&mut self, item: Rid, enabled: bool)

If enabled is true, child nodes with the lowest Y position are drawn before those with a higher Y position. Y-sorting only affects children that inherit from the canvas item specified by the item RID, not the canvas item itself. Equivalent to [member CanvasItem.y_sort_enabled].

pub fn canvas_item_set_z_index(&mut self, item: Rid, z_index: i32)

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

pub fn canvas_item_set_z_as_relative_to_parent( &mut self, item: Rid, enabled: bool, )

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

pub fn canvas_item_set_copy_to_backbuffer( &mut self, item: Rid, enabled: bool, rect: Rect2, )

Sets the CanvasItem to copy a rect to the backbuffer.

pub fn canvas_item_attach_skeleton(&mut self, item: Rid, skeleton: Rid)

Attaches a skeleton to the CanvasItem. Removes the previous skeleton.

pub fn canvas_item_clear(&mut self, item: Rid)

Clears the CanvasItem and removes all commands in it.

pub fn canvas_item_set_draw_index(&mut self, item: Rid, index: i32)

Sets the index for the CanvasItem.

pub fn canvas_item_set_material(&mut self, item: Rid, material: Rid)

Sets a new material to the canvas item specified by the item RID. Equivalent to [member CanvasItem.material].

pub fn canvas_item_set_use_parent_material(&mut self, item: Rid, enabled: bool)

Sets if the CanvasItem uses its parent’s material.

pub fn canvas_item_set_instance_shader_parameter( &mut self, instance: Rid, parameter: impl AsArg<StringName>, value: &Variant, )

Sets the per-instance shader uniform on the specified canvas item instance. Equivalent to set_instance_shader_parameter.

pub fn canvas_item_get_instance_shader_parameter( &self, instance: Rid, parameter: impl AsArg<StringName>, ) -> Variant

Returns the value of the per-instance shader uniform from the specified canvas item instance. Equivalent to get_instance_shader_parameter.

pub fn canvas_item_get_instance_shader_parameter_default_value( &self, instance: Rid, parameter: impl AsArg<StringName>, ) -> Variant

Returns the default value of the per-instance shader uniform from the specified canvas item instance. Equivalent to get_instance_shader_parameter.

pub fn canvas_item_get_instance_shader_parameter_list( &self, instance: Rid, ) -> Array<Dictionary<Variant, Variant>>

Returns a dictionary of per-instance shader uniform names of the per-instance shader uniform from the specified canvas item instance.

The returned dictionary is in PropertyInfo format, with the keys name, class_name, type, hint, hint_string, and usage.

pub fn canvas_item_set_visibility_notifier( &mut self, item: Rid, enable: bool, area: Rect2, enter_callable: &Callable, exit_callable: &Callable, )

Sets the given CanvasItem as visibility notifier. area defines the area of detecting visibility. enter_callable is called when the CanvasItem enters the screen, exit_callable is called when the CanvasItem exits the screen. If enable is false, the item will no longer function as notifier.

This method can be used to manually mimic VisibleOnScreenNotifier2D.

pub fn canvas_item_set_canvas_group_mode( &mut self, item: Rid, mode: CanvasGroupMode, )

To set the default parameters, use canvas_item_set_canvas_group_mode_ex and its builder methods. See the book for detailed usage instructions. Sets the canvas group mode used during 2D rendering for the canvas item specified by the item RID. For faster but more limited clipping, use canvas_item_set_clip instead.

Note: The equivalent node functionality is found in CanvasGroup and [member CanvasItem.clip_children].

pub fn canvas_item_set_canvas_group_mode_ex<'ex>( &'ex mut self, item: Rid, mode: CanvasGroupMode, ) -> ExCanvasItemSetCanvasGroupMode<'ex>

Sets the canvas group mode used during 2D rendering for the canvas item specified by the item RID. For faster but more limited clipping, use canvas_item_set_clip instead.

Note: The equivalent node functionality is found in CanvasGroup and [member CanvasItem.clip_children].

pub fn debug_canvas_item_get_rect(&mut self, item: Rid) -> Rect2

Returns the bounding rectangle for a canvas item in local space, as calculated by the renderer. This bound is used internally for culling.

Warning: This function is intended for debugging in the editor, and will pass through and return a zero Rect2 in exported projects.

pub fn canvas_light_create(&mut self) -> Rid

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

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

Note: The equivalent node is Light2D.

pub fn canvas_light_attach_to_canvas(&mut self, light: Rid, canvas: Rid)

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

pub fn canvas_light_set_enabled(&mut self, light: Rid, enabled: bool)

Enables or disables a canvas light.

pub fn canvas_light_set_texture_scale(&mut self, light: Rid, scale: f32)

Sets the scale factor of a PointLight2D’s texture. Equivalent to [member PointLight2D.texture_scale].

pub fn canvas_light_set_transform(&mut self, light: Rid, transform: Transform2D)

Sets the canvas light’s Transform2D.

pub fn canvas_light_set_texture(&mut self, light: Rid, texture: Rid)

Sets the texture to be used by a PointLight2D. Equivalent to [member PointLight2D.texture].

pub fn canvas_light_set_texture_offset(&mut self, light: Rid, offset: Vector2)

Sets the offset of a PointLight2D’s texture. Equivalent to [member PointLight2D.offset].

pub fn canvas_light_set_color(&mut self, light: Rid, color: Color)

Sets the color for a light.

pub fn canvas_light_set_height(&mut self, light: Rid, height: f32)

Sets a canvas light’s height.

pub fn canvas_light_set_energy(&mut self, light: Rid, energy: f32)

Sets a canvas light’s energy.

pub fn canvas_light_set_z_range(&mut self, light: Rid, min_z: i32, max_z: i32)

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

pub fn canvas_light_set_layer_range( &mut self, light: Rid, min_layer: i32, max_layer: i32, )

The layer range that gets rendered with this light.

pub fn canvas_light_set_item_cull_mask(&mut self, light: Rid, mask: i32)

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

pub fn canvas_light_set_item_shadow_cull_mask(&mut self, light: Rid, mask: i32)

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

pub fn canvas_light_set_mode(&mut self, light: Rid, mode: CanvasLightMode)

Sets the mode of the canvas light.

pub fn canvas_light_set_shadow_enabled(&mut self, light: Rid, enabled: bool)

Enables or disables the canvas light’s shadow.

pub fn canvas_light_set_shadow_filter( &mut self, light: Rid, filter: CanvasLightShadowFilter, )

Sets the canvas light’s shadow’s filter.

pub fn canvas_light_set_shadow_color(&mut self, light: Rid, color: Color)

Sets the color of the canvas light’s shadow.

pub fn canvas_light_set_shadow_smooth(&mut self, light: Rid, smooth: f32)

Smoothens the shadow. The lower, the smoother.

pub fn canvas_light_set_blend_mode( &mut self, light: Rid, mode: CanvasLightBlendMode, )

Sets the blend mode for the given canvas light to mode. Equivalent to [member Light2D.blend_mode].

pub fn canvas_light_set_interpolated(&mut self, light: Rid, interpolated: bool)

If interpolated is true, turns on physics interpolation for the canvas light.

pub fn canvas_light_reset_physics_interpolation(&mut self, light: Rid)

Prevents physics interpolation for the current physics tick.

This is useful when moving a canvas item to a new location, to give an instantaneous change rather than interpolation from the previous location.

pub fn canvas_light_transform_physics_interpolation( &mut self, light: Rid, transform: Transform2D, )

Transforms both the current and previous stored transform for a canvas light.

This allows transforming a light without creating a “glitch” in the interpolation, which is particularly useful for large worlds utilizing a shifting origin.

pub fn canvas_light_occluder_create(&mut self) -> Rid

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

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

Note: The equivalent node is LightOccluder2D.

pub fn canvas_light_occluder_attach_to_canvas( &mut self, occluder: Rid, canvas: Rid, )

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

pub fn canvas_light_occluder_set_enabled( &mut self, occluder: Rid, enabled: bool, )

Enables or disables light occluder.

pub fn canvas_light_occluder_set_polygon(&mut self, occluder: Rid, polygon: Rid)

Sets a light occluder’s polygon.

pub fn canvas_light_occluder_set_as_sdf_collision( &mut self, occluder: Rid, enable: bool, )

pub fn canvas_light_occluder_set_transform( &mut self, occluder: Rid, transform: Transform2D, )

Sets a light occluder’s Transform2D.

pub fn canvas_light_occluder_set_light_mask(&mut self, occluder: Rid, mask: i32)

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

pub fn canvas_light_occluder_set_interpolated( &mut self, occluder: Rid, interpolated: bool, )

If interpolated is true, turns on physics interpolation for the light occluder.

pub fn canvas_light_occluder_reset_physics_interpolation( &mut self, occluder: Rid, )

Prevents physics interpolation for the current physics tick.

This is useful when moving an occluder to a new location, to give an instantaneous change rather than interpolation from the previous location.

pub fn canvas_light_occluder_transform_physics_interpolation( &mut self, occluder: Rid, transform: Transform2D, )

Transforms both the current and previous stored transform for a light occluder.

This allows transforming an occluder without creating a “glitch” in the interpolation, which is particularly useful for large worlds utilizing a shifting origin.

pub fn canvas_occluder_polygon_create(&mut self) -> Rid

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

Once finished with your RID, you will want to free the RID using the RenderingServer’s free_rid method.

Note: The equivalent resource is OccluderPolygon2D.

pub fn canvas_occluder_polygon_set_shape( &mut self, occluder_polygon: Rid, shape: &PackedArray<Vector2>, closed: bool, )

Sets the shape of the occluder polygon.

pub fn canvas_occluder_polygon_set_cull_mode( &mut self, occluder_polygon: Rid, mode: CanvasOccluderPolygonCullMode, )

Sets an occluder polygon’s cull mode.

pub fn canvas_set_shadow_texture_size(&mut self, size: i32)

Sets the [member ProjectSettings.rendering/2d/shadow_atlas/size] to use for Light2D shadow rendering (in pixels). The value is rounded up to the nearest power of 2.

pub fn global_shader_parameter_add( &mut self, name: impl AsArg<StringName>, type_: GlobalShaderParameterType, default_value: &Variant, )

Creates a new global shader uniform.

Note: Global shader parameter names are case-sensitive.

pub fn global_shader_parameter_remove(&mut self, name: impl AsArg<StringName>)

Removes the global shader uniform specified by name.

pub fn global_shader_parameter_get_list(&self) -> Array<StringName>

Returns the list of global shader uniform names.

Note: global_shader_parameter_get has a large performance penalty as the rendering thread needs to synchronize with the calling thread, which is slow. Do not use this method during gameplay to avoid stuttering. If you need to read values in a script after setting them, consider creating an autoload where you store the values you need to query at the same time you’re setting them as global parameters.

pub fn global_shader_parameter_set( &mut self, name: impl AsArg<StringName>, value: &Variant, )

Sets the global shader uniform name to value.

pub fn global_shader_parameter_set_override( &mut self, name: impl AsArg<StringName>, value: &Variant, )

Overrides the global shader uniform name with value. Equivalent to the ShaderGlobalsOverride node.

pub fn global_shader_parameter_get( &self, name: impl AsArg<StringName>, ) -> Variant

Returns the value of the global shader uniform specified by name.

Note: global_shader_parameter_get has a large performance penalty as the rendering thread needs to synchronize with the calling thread, which is slow. Do not use this method during gameplay to avoid stuttering. If you need to read values in a script after setting them, consider creating an autoload where you store the values you need to query at the same time you’re setting them as global parameters.

pub fn global_shader_parameter_get_type( &self, name: impl AsArg<StringName>, ) -> GlobalShaderParameterType

Returns the type associated to the global shader uniform specified by name.

Note: global_shader_parameter_get has a large performance penalty as the rendering thread needs to synchronize with the calling thread, which is slow. Do not use this method during gameplay to avoid stuttering. If you need to read values in a script after setting them, consider creating an autoload where you store the values you need to query at the same time you’re setting them as global parameters.

pub fn free_rid(&mut self, rid: Rid)

Tries to free an object in the RenderingServer. To avoid memory leaks, this should be called after using an object as memory management does not occur automatically when using RenderingServer directly.

pub fn request_frame_drawn_callback(&mut self, callable: &Callable)

Schedules a callback to the given callable after a frame has been drawn.

pub fn has_changed(&self) -> bool

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

pub fn get_rendering_info(&self, info: RenderingInfo) -> u64

Returns a statistic about the rendering engine which can be used for performance profiling. See also viewport_get_render_info, which returns information specific to a viewport.

Note: Only 3D rendering is currently taken into account by some of these values, such as the number of draw calls.

Note: Rendering information is not available until at least 2 frames have been rendered by the engine. If rendering information is not available, get_rendering_info returns 0. To print rendering information in _ready() successfully, use the following:

func _ready():
	for _i in 2:
		await get_tree().process_frame

	print(RenderingServer.get_rendering_info(RENDERING_INFO_TOTAL_DRAW_CALLS_IN_FRAME))

pub fn get_video_adapter_name(&self) -> GString

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.

Note: On the web platform, some browsers such as Firefox may report a different, fixed GPU name such as “GeForce GTX 980” (regardless of the user’s actual GPU model). This is done to make fingerprinting more difficult.

pub fn get_video_adapter_vendor(&self) -> GString

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.

pub fn get_video_adapter_type(&self) -> DeviceType

Returns the type of the video adapter. Since dedicated graphics cards from a given generation will usually be significantly faster than integrated graphics made in the same generation, the device type can be used as a basis for automatic graphics settings adjustment. However, this is not always true, so make sure to provide users with a way to manually override graphics settings.

Note: When using the OpenGL rendering driver or when running in headless mode, this function always returns DeviceType::OTHER.

pub fn get_video_adapter_api_version(&self) -> GString

Returns the version of the graphics video adapter currently in use (e.g. “1.2.189” for Vulkan, “3.3.0 NVIDIA 510.60.02” for OpenGL). This version may be different from the actual latest version supported by the hardware, as Godot may not always request the latest version. See also get_video_adapter_driver_info.

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

pub fn get_current_rendering_driver_name(&self) -> GString

Returns the name of the current rendering driver. This can be vulkan, d3d12, metal, opengl3, opengl3_es, or opengl3_angle. See also get_current_rendering_method.

When [member ProjectSettings.rendering/renderer/rendering_method] is forward_plus or mobile, the rendering driver is determined by [member ProjectSettings.rendering/rendering_device/driver].

When [member ProjectSettings.rendering/renderer/rendering_method] is gl_compatibility, the rendering driver is determined by [member ProjectSettings.rendering/gl_compatibility/driver].

The rendering driver is also determined by the --rendering-driver command line argument that overrides this project setting, or an automatic fallback that is applied depending on the hardware.

pub fn get_current_rendering_method(&self) -> GString

Returns the name of the current rendering method. This can be forward_plus, mobile, or gl_compatibility. See also get_current_rendering_driver_name.

The rendering method is determined by [member ProjectSettings.rendering/renderer/rendering_method], the --rendering-method command line argument that overrides this project setting, or an automatic fallback that is applied depending on the hardware.

pub fn make_sphere_mesh( &mut self, latitudes: i32, longitudes: i32, radius: f32, ) -> Rid

Returns a mesh of a sphere with the given number of horizontal subdivisions, vertical subdivisions and radius. See also get_test_cube.

pub fn get_test_cube(&self) -> Rid

Returns the RID of the test cube. This mesh will be created and returned on the first call to get_test_cube, then it will be cached for subsequent calls. See also make_sphere_mesh.

pub fn get_test_texture(&self) -> Rid

Returns the RID of a 256×256 texture with a testing pattern on it (in Format::RGB8 format). This texture will be created and returned on the first call to get_test_texture, then it will be cached for subsequent calls. See also get_white_texture.

Example: Get the test texture and apply it to a Sprite2D node:

var texture_rid = RenderingServer.get_test_texture()
var texture = ImageTexture.create_from_image(RenderingServer.texture_2d_get(texture_rid))
$Sprite2D.texture = texture

pub fn get_white_texture(&self) -> Rid

Returns the ID of a 4×4 white texture (in Format::RGB8 format). This texture will be created and returned on the first call to get_white_texture, then it will be cached for subsequent calls. See also get_test_texture.

Example: Get the white texture and apply it to a Sprite2D node:

var texture_rid = RenderingServer.get_white_texture()
var texture = ImageTexture.create_from_image(RenderingServer.texture_2d_get(texture_rid))
$Sprite2D.texture = texture

pub fn set_boot_image_with_stretch( &mut self, image: impl AsArg<Option<Gd<Image>>>, color: Color, stretch_mode: SplashStretchMode, )

To set the default parameters, use set_boot_image_with_stretch_ex and its builder methods. See the book for detailed usage instructions. Sets a boot image. The color defines the background color. The value of stretch_mode indicates how the image will be stretched (see [enum SplashStretchMode] for possible values). 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.

pub fn set_boot_image_with_stretch_ex<'ex>( &'ex mut self, image: impl AsArg<Option<Gd<Image>>> + 'ex, color: Color, stretch_mode: SplashStretchMode, ) -> ExSetBootImageWithStretch<'ex>

Sets a boot image. The color defines the background color. The value of stretch_mode indicates how the image will be stretched (see [enum SplashStretchMode] for possible values). 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.

pub fn set_boot_image( &mut self, image: impl AsArg<Option<Gd<Image>>>, color: Color, scale: bool, )

To set the default parameters, use set_boot_image_ex and its builder methods. See the book for detailed usage instructions. Sets a boot image. The color defines the background color. The value of scale indicates if 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.

pub fn set_boot_image_ex<'ex>( &'ex mut self, image: impl AsArg<Option<Gd<Image>>> + 'ex, color: Color, scale: bool, ) -> ExSetBootImage<'ex>

Sets a boot image. The color defines the background color. The value of scale indicates if 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.

pub fn get_default_clear_color(&self) -> Color

Returns the default clear color which is used when a specific clear color has not been selected. See also set_default_clear_color.

pub fn set_default_clear_color(&mut self, color: Color)

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

pub fn has_os_feature(&self, feature: impl AsArg<GString>) -> bool

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

pub fn set_debug_generate_wireframes(&mut self, generate: bool)

If generate is true, generates debug wireframes for all meshes that are loaded when using the Compatibility renderer. By default, the engine does not generate debug wireframes at runtime, since they slow down loading of assets and take up VRAM.

Note: You must call this method before loading any meshes when using the Compatibility renderer, otherwise wireframes will not be used.

pub fn is_render_loop_enabled(&self) -> bool

pub fn set_render_loop_enabled(&mut self, enabled: bool)

pub fn get_frame_setup_time_cpu(&self) -> f64

Returns the time taken to setup rendering on the CPU in milliseconds. This value is shared across all viewports and does not require viewport_set_measure_render_time to be enabled on a viewport to be queried. See also viewport_get_measured_render_time_cpu.

pub fn force_sync(&mut self)

Forces a synchronization between the CPU and GPU, which may be required in certain cases. Only call this when needed, as CPU-GPU synchronization has a performance cost.

pub fn force_draw(&mut self)

To set the default parameters, use force_draw_ex and its builder methods. See the book for detailed usage instructions. Forces redrawing of all viewports at once. Must be called from the main thread.

pub fn force_draw_ex<'ex>(&'ex mut self) -> ExForceDraw<'ex>

Forces redrawing of all viewports at once. Must be called from the main thread.

pub fn get_rendering_device(&self) -> Option<Gd<RenderingDevice>>

Returns the global RenderingDevice.

Note: When using the OpenGL rendering driver or when running in headless mode, this function always returns null.

pub fn create_local_rendering_device(&self) -> Option<Gd<RenderingDevice>>

Creates a RenderingDevice that can be used to do draw and compute operations on a separate thread. Cannot draw to the screen nor share data with the global RenderingDevice.

Note: When using the OpenGL rendering driver or when running in headless mode, this function always returns null.

pub fn is_on_render_thread(&self) -> bool

Returns true if our code is currently executing on the rendering thread.

pub fn call_on_render_thread(&mut self, callable: &Callable)

As the RenderingServer actual logic may run on a separate thread, accessing its internals from the main (or any other) thread will result in errors. To make it easier to run code that can safely access the rendering internals (such as RenderingDevice and similar RD classes), push a callable via this function so it will be executed on the render thread.

pub fn has_feature(&self, feature: Features) -> bool

This method does nothing and always returns false.

Methods from Deref<Target = Object>§

pub fn get_script(&self) -> Option<Gd<Script>>

pub fn set_script(&mut self, script: impl AsArg<Option<Gd<Script>>>)

pub fn connect( &mut self, signal: impl AsArg<StringName>, callable: &Callable, ) -> Error

pub fn connect_flags( &mut self, signal: impl AsArg<StringName>, callable: &Callable, flags: ConnectFlags, ) -> Error

pub fn get_class(&self) -> GString

Returns the object’s built-in class name, as a String. See also is_class.

Note: This method ignores class_name declarations. If this object’s script has defined a class_name, the base, built-in class name is returned instead.

pub fn is_class(&self, class: impl AsArg<GString>) -> bool

Returns true if the object inherits from the given class. See also get_class.

var sprite2d = Sprite2D.new()
sprite2d.is_class("Sprite2D") # Returns true
sprite2d.is_class("Node")     # Returns true
sprite2d.is_class("Node3D")   # Returns false

Note: This method ignores class_name declarations in the object’s script.

pub fn set(&mut self, property: impl AsArg<StringName>, value: &Variant)

Assigns value to the given property. If the property does not exist or the given value’s type doesn’t match, nothing happens.

var node = Node2D.new()
node.set("global_scale", Vector2(8, 2.5))
print(node.global_scale) # Prints (8.0, 2.5)

Note: In C#, property must be in snake_case when referring to built-in Godot properties. Prefer using the names exposed in the PropertyName class to avoid allocating a new StringName on each call.

pub fn get(&self, property: impl AsArg<StringName>) -> Variant

Returns the Variant value of the given property. If the property does not exist, this method returns null.

var node = Node2D.new()
node.rotation = 1.5
var a = node.get("rotation") # a is 1.5

Note: In C#, property must be in snake_case when referring to built-in Godot properties. Prefer using the names exposed in the PropertyName class to avoid allocating a new StringName on each call.

pub fn set_indexed( &mut self, property_path: impl AsArg<NodePath>, value: &Variant, )

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

var node = Node2D.new()
node.set_indexed("position", Vector2(42, 0))
node.set_indexed("position:y", -10)
print(node.position) # Prints (42.0, -10.0)

Note: In C#, property_path must be in snake_case when referring to built-in Godot properties. Prefer using the names exposed in the PropertyName class to avoid allocating a new StringName on each call.

pub fn get_indexed(&self, property_path: impl AsArg<NodePath>) -> Variant

Gets the object’s property indexed by the given property_path. The path should be a NodePath relative to the current object and can use the colon character (:) to access nested properties.

Examples: "position:x" or "material:next_pass:blend_mode".

var node = Node2D.new()
node.position = Vector2(5, -10)
var a = node.get_indexed("position")   # a is Vector2(5, -10)
var b = node.get_indexed("position:y") # b is -10

Note: In C#, property_path must be in snake_case when referring to built-in Godot properties. Prefer using the names exposed in the PropertyName class to avoid allocating a new StringName on each call.

Note: This method does not support actual paths to nodes in the SceneTree, only sub-property paths. In the context of nodes, use get_node_and_resource instead.

pub fn get_property_list(&self) -> Array<Dictionary<Variant, Variant>>

Returns the object’s property list as an Array of dictionaries. Each Dictionary contains the following entries:

  • name is the property’s name, as a String;

  • class_name is an empty StringName, unless the property is VariantType::OBJECT and it inherits from a class;

  • type is the property’s type, as an int (see [enum Variant.Type]);

  • hint is how the property is meant to be edited (see [enum PropertyHint]);

  • hint_string depends on the hint (see [enum PropertyHint]);

  • usage is a combination of [enum PropertyUsageFlags].

Note: In GDScript, all class members are treated as properties. In C# and GDExtension, it may be necessary to explicitly mark class members as Godot properties using decorators or attributes.

pub fn get_method_list(&self) -> Array<Dictionary<Variant, Variant>>

Returns this object’s methods and their signatures as an Array of dictionaries. Each Dictionary contains the following entries:

  • name is the name of the method, as a String;

  • args is an Array of dictionaries representing the arguments;

  • default_args is the default arguments as an Array of variants;

  • flags is a combination of [enum MethodFlags];

  • id is the method’s internal identifier int;

  • return is the returned value, as a Dictionary;

Note: The dictionaries of args and return are formatted identically to the results of get_property_list, although not all entries are used.

pub fn property_can_revert(&self, property: impl AsArg<StringName>) -> bool

Returns true if the given property has a custom default value. Use property_get_revert to get the property’s default value.

Note: This method is used by the Inspector dock to display a revert icon. The object must implement [method _property_can_revert] to customize the default value. If [method _property_can_revert] is not implemented, this method returns false.

pub fn property_get_revert(&self, property: impl AsArg<StringName>) -> Variant

Returns the custom default value of the given property. Use property_can_revert to check if the property has a custom default value.

Note: This method is used by the Inspector dock to display a revert icon. The object must implement [method _property_get_revert] to customize the default value. If [method _property_get_revert] is not implemented, this method returns null.

pub fn set_meta(&mut self, name: impl AsArg<StringName>, value: &Variant)

Adds or changes the entry name inside the object’s metadata. The metadata value can be any Variant, although some types cannot be serialized correctly.

If value is null, the entry is removed. This is the equivalent of using remove_meta. See also has_meta and get_meta.

Note: A metadata’s name must be a valid identifier as per is_valid_identifier method.

Note: Metadata that has a name starting with an underscore (_) is considered editor-only. Editor-only metadata is not displayed in the Inspector and should not be edited, although it can still be found by this method.

pub fn remove_meta(&mut self, name: impl AsArg<StringName>)

Removes the given entry name from the object’s metadata. See also has_meta, get_meta and set_meta.

Note: A metadata’s name must be a valid identifier as per is_valid_identifier method.

Note: Metadata that has a name starting with an underscore (_) is considered editor-only. Editor-only metadata is not displayed in the Inspector and should not be edited, although it can still be found by this method.

pub fn get_meta(&self, name: impl AsArg<StringName>) -> Variant

To set the default parameters, use get_meta_ex and its builder methods. See the book for detailed usage instructions. Returns the object’s metadata value for the given entry name. If the entry does not exist, returns default. If default is null, an error is also generated.

Note: A metadata’s name must be a valid identifier as per is_valid_identifier method.

Note: Metadata that has a name starting with an underscore (_) is considered editor-only. Editor-only metadata is not displayed in the Inspector and should not be edited, although it can still be found by this method.

pub fn get_meta_ex<'ex>( &'ex self, name: impl AsArg<StringName> + 'ex, ) -> ExGetMeta<'ex>

Returns the object’s metadata value for the given entry name. If the entry does not exist, returns default. If default is null, an error is also generated.

Note: A metadata’s name must be a valid identifier as per is_valid_identifier method.

Note: Metadata that has a name starting with an underscore (_) is considered editor-only. Editor-only metadata is not displayed in the Inspector and should not be edited, although it can still be found by this method.

pub fn has_meta(&self, name: impl AsArg<StringName>) -> bool

Returns true if a metadata entry is found with the given name. See also get_meta, set_meta and remove_meta.

Note: A metadata’s name must be a valid identifier as per is_valid_identifier method.

Note: Metadata that has a name starting with an underscore (_) is considered editor-only. Editor-only metadata is not displayed in the Inspector and should not be edited, although it can still be found by this method.

pub fn get_meta_list(&self) -> Array<StringName>

Returns the object’s metadata entry names as an Array of StringNames.

pub fn add_user_signal(&mut self, signal: impl AsArg<GString>)

To set the default parameters, use add_user_signal_ex and its builder methods. See the book for detailed usage instructions. Adds a user-defined signal named signal. Optional arguments for the signal can be added as an Array of dictionaries, each defining a name String and a type int (see [enum Variant.Type]). See also has_user_signal and remove_user_signal.

add_user_signal("hurt", [
	{ "name": "damage", "type": TYPE_INT },
	{ "name": "source", "type": TYPE_OBJECT }
])

pub fn add_user_signal_ex<'ex>( &'ex mut self, signal: impl AsArg<GString> + 'ex, ) -> ExAddUserSignal<'ex>

Adds a user-defined signal named signal. Optional arguments for the signal can be added as an Array of dictionaries, each defining a name String and a type int (see [enum Variant.Type]). See also has_user_signal and remove_user_signal.

add_user_signal("hurt", [
	{ "name": "damage", "type": TYPE_INT },
	{ "name": "source", "type": TYPE_OBJECT }
])

pub fn has_user_signal(&self, signal: impl AsArg<StringName>) -> bool

Returns true if the given user-defined signal name exists. Only signals added with add_user_signal are included. See also remove_user_signal.

pub fn remove_user_signal(&mut self, signal: impl AsArg<StringName>)

Removes the given user signal signal from the object. See also add_user_signal and has_user_signal.

pub fn emit_signal( &mut self, signal: impl AsArg<StringName>, varargs: &[Variant], ) -> Error

Emits the given signal by name. The signal must exist, so it should be a built-in signal of this class or one of its inherited classes, or a user-defined signal (see add_user_signal). This method supports a variable number of arguments, so parameters can be passed as a comma separated list.

Returns Error::ERR_UNAVAILABLE if signal does not exist or the parameters are invalid.

emit_signal("hit", "sword", 100)
emit_signal("game_over")

Note: In C#, signal must be in snake_case when referring to built-in Godot signals. Prefer using the names exposed in the SignalName class to avoid allocating a new StringName on each call.

§Panics

This is a varcall method, meaning parameters and return values are passed as Variant. It can detect call failures and will panic in such a case.

pub fn try_emit_signal( &mut self, signal: impl AsArg<StringName>, varargs: &[Variant], ) -> Result<Error, CallError>

§Return type

This is a varcall method, meaning parameters and return values are passed as Variant. It can detect call failures and will return Err in such a case.

pub fn call( &mut self, method: impl AsArg<StringName>, varargs: &[Variant], ) -> Variant

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

var node = Node3D.new()
node.call("rotate", Vector3(1.0, 0.0, 0.0), 1.571)

Note: In C#, method must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the MethodName class to avoid allocating a new StringName on each call.

§Panics

This is a varcall method, meaning parameters and return values are passed as Variant. It can detect call failures and will panic in such a case.

pub fn try_call( &mut self, method: impl AsArg<StringName>, varargs: &[Variant], ) -> Result<Variant, CallError>

§Return type

This is a varcall method, meaning parameters and return values are passed as Variant. It can detect call failures and will return Err in such a case.

pub fn call_deferred( &mut self, method: impl AsArg<StringName>, varargs: &[Variant], ) -> Variant

Calls the method on the object during idle time. Always returns null, not the method’s result.

Idle time happens mainly at the end of process and physics frames. In it, deferred calls will be run until there are none left, which means you can defer calls from other deferred calls and they’ll still be run in the current idle time cycle. This means you should not call a method deferred from itself (or from a method called by it), as this causes infinite recursion the same way as if you had called the method directly.

This method supports a variable number of arguments, so parameters can be passed as a comma separated list.

var node = Node3D.new()
node.call_deferred("rotate", Vector3(1.0, 0.0, 0.0), 1.571)

For methods that are deferred from the same thread, the order of execution at idle time is identical to the order in which call_deferred was called.

See also call_deferred.

Note: In C#, method must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the MethodName class to avoid allocating a new StringName on each call.

Note: If you’re looking to delay the function call by a frame, refer to the SceneTree.process_frame and SceneTree.physics_frame signals.

var node = Node3D.new()
# Make a Callable and bind the arguments to the node's rotate() call.
var callable = node.rotate.bind(Vector3(1.0, 0.0, 0.0), 1.571)
# Connect the callable to the process_frame signal, so it gets called in the next process frame.
# CONNECT_ONE_SHOT makes sure it only gets called once instead of every frame.
get_tree().process_frame.connect(callable, CONNECT_ONE_SHOT)
§Panics

This is a varcall method, meaning parameters and return values are passed as Variant. It can detect call failures and will panic in such a case.

pub fn try_call_deferred( &mut self, method: impl AsArg<StringName>, varargs: &[Variant], ) -> Result<Variant, CallError>

§Return type

This is a varcall method, meaning parameters and return values are passed as Variant. It can detect call failures and will return Err in such a case.

pub fn set_deferred( &mut self, property: impl AsArg<StringName>, value: &Variant, )

Assigns value to the given property, at the end of the current frame. This is equivalent to calling set through call_deferred.

var node = Node2D.new()
add_child(node)

node.rotation = 1.5
node.set_deferred("rotation", 3.0)
print(node.rotation) # Prints 1.5

await get_tree().process_frame
print(node.rotation) # Prints 3.0

Note: In C#, property must be in snake_case when referring to built-in Godot properties. Prefer using the names exposed in the PropertyName class to avoid allocating a new StringName on each call.

pub fn callv( &mut self, method: impl AsArg<StringName>, arg_array: &AnyArray, ) -> Variant

Calls the method on the object and returns the result. Unlike call, this method expects all parameters to be contained inside arg_array.

var node = Node3D.new()
node.callv("rotate", [Vector3(1.0, 0.0, 0.0), 1.571])

Note: In C#, method must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the MethodName class to avoid allocating a new StringName on each call.

pub fn has_method(&self, method: impl AsArg<StringName>) -> bool

Returns true if the given method name exists in the object.

Note: In C#, method must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the MethodName class to avoid allocating a new StringName on each call.

pub fn get_method_argument_count(&self, method: impl AsArg<StringName>) -> i32

Returns the number of arguments of the given method by name.

Note: In C#, method must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the MethodName class to avoid allocating a new StringName on each call.

pub fn has_signal(&self, signal: impl AsArg<StringName>) -> bool

Returns true if the given signal name exists in the object.

Note: In C#, signal must be in snake_case when referring to built-in Godot signals. Prefer using the names exposed in the SignalName class to avoid allocating a new StringName on each call.

pub fn get_signal_list(&self) -> Array<Dictionary<Variant, Variant>>

Returns the list of existing signals as an Array of dictionaries.

Note: Due to the implementation, each Dictionary is formatted very similarly to the returned values of get_method_list.

pub fn get_signal_connection_list( &self, signal: impl AsArg<StringName>, ) -> Array<Dictionary<Variant, Variant>>

Returns an Array of connections for the given signal name. Each connection is represented as a Dictionary that contains three entries:

  • signal is a reference to the Signal;

  • callable is a reference to the connected Callable;

  • flags is a combination of [enum ConnectFlags].

pub fn get_incoming_connections(&self) -> Array<Dictionary<Variant, Variant>>

Returns an Array of signal connections received by this object. Each connection is represented as a Dictionary that contains three entries:

  • signal is a reference to the Signal;

  • callable is a reference to the Callable;

  • flags is a combination of [enum ConnectFlags].

pub fn disconnect( &mut self, signal: impl AsArg<StringName>, callable: &Callable, )

Disconnects a signal by name from a given callable. If the connection does not exist, generates an error. Use is_connected to make sure that the connection exists.

pub fn is_connected( &self, signal: impl AsArg<StringName>, callable: &Callable, ) -> bool

Returns true if a connection exists between the given signal name and callable.

Note: In C#, signal must be in snake_case when referring to built-in Godot signals. Prefer using the names exposed in the SignalName class to avoid allocating a new StringName on each call.

pub fn has_connections(&self, signal: impl AsArg<StringName>) -> bool

Returns true if any connection exists on the given signal name.

Note: In C#, signal must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the SignalName class to avoid allocating a new StringName on each call.

pub fn set_block_signals(&mut self, enable: bool)

If set to true, the object becomes unable to emit signals. As such, emit_signal and signal connections will not work, until it is set to false.

pub fn is_blocking_signals(&self) -> bool

Returns true if the object is blocking its signals from being emitted. See set_block_signals.

pub fn notify_property_list_changed(&mut self)

Emits the property_list_changed signal. This is mainly used to refresh the editor, so that the Inspector and editor plugins are properly updated.

pub fn set_message_translation(&mut self, enable: bool)

If set to true, allows the object to translate messages with tr and tr_n. Enabled by default. See also can_translate_messages.

pub fn can_translate_messages(&self) -> bool

Returns true if the object is allowed to translate messages with tr and tr_n. See also set_message_translation.

pub fn tr(&self, message: impl AsArg<StringName>) -> GString

To set the default parameters, use tr_ex and its builder methods. See the book for detailed usage instructions. Translates a message, using the translation catalogs configured in the Project Settings. Further context can be specified to help with the translation. Note that most Control nodes automatically translate their strings, so this method is mostly useful for formatted strings or custom drawn text.

If can_translate_messages is false, or no translation is available, this method returns the message without changes. See set_message_translation.

For detailed examples, see Internationalizing games.

Note: This method can’t be used without an Object instance, as it requires the can_translate_messages method. To translate strings in a static context, use translate.

pub fn tr_ex<'ex>(&'ex self, message: impl AsArg<StringName> + 'ex) -> ExTr<'ex>

Translates a message, using the translation catalogs configured in the Project Settings. Further context can be specified to help with the translation. Note that most Control nodes automatically translate their strings, so this method is mostly useful for formatted strings or custom drawn text.

If can_translate_messages is false, or no translation is available, this method returns the message without changes. See set_message_translation.

For detailed examples, see Internationalizing games.

Note: This method can’t be used without an Object instance, as it requires the can_translate_messages method. To translate strings in a static context, use translate.

pub fn tr_n( &self, message: impl AsArg<StringName>, plural_message: impl AsArg<StringName>, n: i32, ) -> GString

To set the default parameters, use tr_n_ex and its builder methods. See the book for detailed usage instructions. Translates a message or plural_message, using the translation catalogs configured in the Project Settings. Further context can be specified to help with the translation.

If can_translate_messages is false, or no translation is available, this method returns message or plural_message, without changes. See set_message_translation.

The n is the number, or amount, of the message’s subject. It is used by the translation system to fetch the correct plural form for the current language.

For detailed examples, see Localization using gettext.

Note: Negative and float numbers may not properly apply to some countable subjects. It’s recommended to handle these cases with tr.

Note: This method can’t be used without an Object instance, as it requires the can_translate_messages method. To translate strings in a static context, use translate_plural.

pub fn tr_n_ex<'ex>( &'ex self, message: impl AsArg<StringName> + 'ex, plural_message: impl AsArg<StringName> + 'ex, n: i32, ) -> ExTrN<'ex>

Translates a message or plural_message, using the translation catalogs configured in the Project Settings. Further context can be specified to help with the translation.

If can_translate_messages is false, or no translation is available, this method returns message or plural_message, without changes. See set_message_translation.

The n is the number, or amount, of the message’s subject. It is used by the translation system to fetch the correct plural form for the current language.

For detailed examples, see Localization using gettext.

Note: Negative and float numbers may not properly apply to some countable subjects. It’s recommended to handle these cases with tr.

Note: This method can’t be used without an Object instance, as it requires the can_translate_messages method. To translate strings in a static context, use translate_plural.

pub fn get_translation_domain(&self) -> StringName

Returns the name of the translation domain used by tr and tr_n. See also TranslationServer.

pub fn set_translation_domain(&mut self, domain: impl AsArg<StringName>)

Sets the name of the translation domain used by tr and tr_n. See also TranslationServer.

pub fn is_queued_for_deletion(&self) -> bool

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

pub fn cancel_free(&mut self)

If this method is called during ObjectNotification::PREDELETE, this object will reject being freed and will remain allocated. This is mostly an internal function used for error handling to avoid the user from freeing objects when they are not intended to.

pub fn notify(&mut self, what: ObjectNotification)

⚠️ Sends a Godot notification to all classes inherited by the object.

Triggers calls to on_notification(), and depending on the notification, also to Godot’s lifecycle callbacks such as ready().

Starts from the highest ancestor (the Object class) and goes down the hierarchy. See also Godot docs for Object::notification().

§Panics

If you call this method on a user-defined object while holding a GdRef or GdMut guard on the instance, you will encounter a panic. The reason is that the receiving virtual method on_notification() acquires a GdMut lock dynamically, which must be exclusive.

pub fn notify_reversed(&mut self, what: ObjectNotification)

⚠️ Like Self::notify(), but starts at the most-derived class and goes up the hierarchy.

See docs of that method, including the panics.

Trait Implementations§

§

impl Bounds for RenderingServer

§

type Memory = MemManual

Defines the memory strategy of the static type.
§

type Declarer = DeclEngine

Whether this class is a core Godot class provided by the engine, or declared by the user as a Rust struct.
§

impl Debug for RenderingServer

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Deref for RenderingServer

§

type Target = Object

The resulting type after dereferencing.
§

fn deref(&self) -> &<RenderingServer as Deref>::Target

Dereferences the value.
§

impl DerefMut for RenderingServer

§

fn deref_mut(&mut self) -> &mut <RenderingServer as Deref>::Target

Mutably dereferences the value.
§

impl GodotClass for RenderingServer

§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Servers

Initialization level, during which this class should be initialized with Godot. Read more
§

type Base = Object

The immediate superclass of T. This is always a Godot engine class.
§

fn class_id() -> ClassId

Globally unique class ID, linked to the name under which the class is registered in Godot. Read more
§

fn inherits<Base>() -> bool
where Base: GodotClass,

Returns whether Self inherits from Base. Read more
§

impl Inherits<Object> for RenderingServer

§

const IS_SAME_CLASS: bool = false

True iff Self == Base. Read more
§

impl Singleton for RenderingServer

§

fn singleton() -> Gd<RenderingServer>

Returns the singleton instance. Read more
§

impl WithSignals for RenderingServer

§

type SignalCollection<'c, C: WithSignals> = SignalsOfRenderingServer<'c, C>

The associated struct listing all signals of this class. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Inherits<T> for T
where T: GodotClass,

§

const IS_SAME_CLASS: bool = true

True iff Self == Base. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> UniformObjectDeref<DeclEngine> for T
where T: GodotClass<Declarer = DeclEngine>,

§

type TargetRef<'a> = Gd<T>

§

type TargetMut<'a> = Gd<T>

§

fn object_as_ref<'a>( gd: &'a Gd<T>, ) -> <T as UniformObjectDeref<DeclEngine>>::TargetRef<'a>

§

fn object_as_mut<'a>( gd: &'a mut Gd<T>, ) -> <T as UniformObjectDeref<DeclEngine>>::TargetMut<'a>