RenderingServer

Inherits: Object

Server for anything visible.

Description

Server for anything visible. 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 system entirely.

Resources are created using the *_create functions.

All objects are drawn to a viewport. You can use the Viewport attached to the SceneTree or you can create one yourself with 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.

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 Node3D.get_world_3d. Otherwise, a scenario can be created with scenario_create.

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

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

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

Tutorials

Properties

bool

render_loop_enabled

Methods

Image[]

bake_render_uv2 ( RID base, RID[] material_overrides, Vector2i image_size )

RID

camera_attributes_create ( )

void

camera_attributes_set_auto_exposure ( RID camera_attributes, bool enable, float min_sensitivity, float max_sensitivity, float speed, float scale )

void

camera_attributes_set_dof_blur ( RID camera_attributes, bool far_enable, float far_distance, float far_transition, bool near_enable, float near_distance, float near_transition, float amount )

void

camera_attributes_set_dof_blur_bokeh_shape ( DOFBokehShape shape )

void

camera_attributes_set_dof_blur_quality ( DOFBlurQuality quality, bool use_jitter )

void

camera_attributes_set_exposure ( RID camera_attributes, float multiplier, float normalization )

RID

camera_create ( )

void

camera_set_camera_attributes ( RID camera, RID effects )

void

camera_set_cull_mask ( RID camera, int layers )

void

camera_set_environment ( RID camera, RID env )

void

camera_set_frustum ( RID camera, float size, Vector2 offset, float z_near, float z_far )

void

camera_set_orthogonal ( RID camera, float size, float z_near, float z_far )

void

camera_set_perspective ( RID camera, float fovy_degrees, float z_near, float z_far )

void

camera_set_transform ( RID camera, Transform3D transform )

void

camera_set_use_vertical_aspect ( RID camera, bool enable )

RID

canvas_create ( )

void

canvas_item_add_animation_slice ( RID item, float animation_length, float slice_begin, float slice_end, float offset=0.0 )

void

canvas_item_add_circle ( RID item, Vector2 pos, float radius, Color color )

void

canvas_item_add_clip_ignore ( RID item, bool ignore )

void

canvas_item_add_lcd_texture_rect_region ( RID item, Rect2 rect, RID texture, Rect2 src_rect, Color modulate )

void

canvas_item_add_line ( RID item, Vector2 from, Vector2 to, Color color, float width=1.0, bool antialiased=false )

void

canvas_item_add_mesh ( RID item, RID mesh, Transform2D transform=Transform2D(1, 0, 0, 1, 0, 0), Color modulate=Color(1, 1, 1, 1), RID texture )

void

canvas_item_add_msdf_texture_rect_region ( RID item, Rect2 rect, RID texture, Rect2 src_rect, Color modulate=Color(1, 1, 1, 1), int outline_size=0, float px_range=1.0 )

void

canvas_item_add_multimesh ( RID item, RID mesh, RID texture )

void

canvas_item_add_nine_patch ( RID item, Rect2 rect, Rect2 source, RID texture, Vector2 topleft, Vector2 bottomright, NinePatchAxisMode x_axis_mode=0, NinePatchAxisMode y_axis_mode=0, bool draw_center=true, Color modulate=Color(1, 1, 1, 1) )

void

canvas_item_add_particles ( RID item, RID particles, RID texture )

void

canvas_item_add_polygon ( RID item, PackedVector2Array points, PackedColorArray colors, PackedVector2Array uvs=PackedVector2Array(), RID texture )

void

canvas_item_add_polyline ( RID item, PackedVector2Array points, PackedColorArray colors, float width=1.0, bool antialiased=false )

void

canvas_item_add_primitive ( RID item, PackedVector2Array points, PackedColorArray colors, PackedVector2Array uvs, RID texture, float width=1.0 )

void

canvas_item_add_rect ( RID item, Rect2 rect, Color color )

void

canvas_item_add_set_transform ( RID item, Transform2D transform )

void

canvas_item_add_texture_rect ( RID item, Rect2 rect, RID texture, bool tile=false, Color modulate=Color(1, 1, 1, 1), bool transpose=false )

void

canvas_item_add_texture_rect_region ( RID item, Rect2 rect, RID texture, Rect2 src_rect, Color modulate=Color(1, 1, 1, 1), bool transpose=false, bool clip_uv=true )

void

canvas_item_add_triangle_array ( RID item, PackedInt32Array indices, PackedVector2Array points, PackedColorArray colors, PackedVector2Array uvs=PackedVector2Array(), PackedInt32Array bones=PackedInt32Array(), PackedFloat32Array weights=PackedFloat32Array(), RID texture, int count=-1 )

void

canvas_item_clear ( RID item )

RID

canvas_item_create ( )

void

canvas_item_set_canvas_group_mode ( RID item, CanvasGroupMode mode, float clear_margin=5.0, bool fit_empty=false, float fit_margin=0.0, bool blur_mipmaps=false )

void

canvas_item_set_clip ( RID item, bool clip )

void

canvas_item_set_copy_to_backbuffer ( RID item, bool enabled, Rect2 rect )

void

canvas_item_set_custom_rect ( RID item, bool use_custom_rect, Rect2 rect=Rect2(0, 0, 0, 0) )

void

canvas_item_set_default_texture_filter ( RID item, CanvasItemTextureFilter filter )

void

canvas_item_set_default_texture_repeat ( RID item, CanvasItemTextureRepeat repeat )

void

canvas_item_set_distance_field_mode ( RID item, bool enabled )

void

canvas_item_set_draw_behind_parent ( RID item, bool enabled )

void

canvas_item_set_draw_index ( RID item, int index )

void

canvas_item_set_light_mask ( RID item, int mask )

void

canvas_item_set_material ( RID item, RID material )

void

canvas_item_set_modulate ( RID item, Color color )

void

canvas_item_set_parent ( RID item, RID parent )

void

canvas_item_set_self_modulate ( RID item, Color color )

void

canvas_item_set_sort_children_by_y ( RID item, bool enabled )

void

canvas_item_set_transform ( RID item, Transform2D transform )

void

canvas_item_set_use_parent_material ( RID item, bool enabled )

void

canvas_item_set_visibility_notifier ( RID item, bool enable, Rect2 area, Callable enter_callable, Callable exit_callable )

void

canvas_item_set_visible ( RID item, bool visible )

void

canvas_item_set_z_as_relative_to_parent ( RID item, bool enabled )

void

canvas_item_set_z_index ( RID item, int z_index )

void

canvas_light_attach_to_canvas ( RID light, RID canvas )

RID

canvas_light_create ( )

void

canvas_light_occluder_attach_to_canvas ( RID occluder, RID canvas )

RID

canvas_light_occluder_create ( )

void

canvas_light_occluder_set_as_sdf_collision ( RID occluder, bool enable )

void

canvas_light_occluder_set_enabled ( RID occluder, bool enabled )

void

canvas_light_occluder_set_light_mask ( RID occluder, int mask )

void

canvas_light_occluder_set_polygon ( RID occluder, RID polygon )

void

canvas_light_occluder_set_transform ( RID occluder, Transform2D transform )

void

canvas_light_set_color ( RID light, Color color )

void

canvas_light_set_enabled ( RID light, bool enabled )

void

canvas_light_set_energy ( RID light, float energy )

void

canvas_light_set_height ( RID light, float height )

void

canvas_light_set_item_cull_mask ( RID light, int mask )

void

canvas_light_set_item_shadow_cull_mask ( RID light, int mask )

void

canvas_light_set_layer_range ( RID light, int min_layer, int max_layer )

void

canvas_light_set_mode ( RID light, CanvasLightMode mode )

void

canvas_light_set_shadow_color ( RID light, Color color )

void

canvas_light_set_shadow_enabled ( RID light, bool enabled )

void

canvas_light_set_shadow_filter ( RID light, CanvasLightShadowFilter filter )

void

canvas_light_set_shadow_smooth ( RID light, float smooth )

void

canvas_light_set_texture ( RID light, RID texture )

void

canvas_light_set_texture_offset ( RID light, Vector2 offset )

void

canvas_light_set_texture_scale ( RID light, float scale )

void

canvas_light_set_transform ( RID light, Transform2D transform )

void

canvas_light_set_z_range ( RID light, int min_z, int max_z )

RID

canvas_occluder_polygon_create ( )

void

canvas_occluder_polygon_set_cull_mode ( RID occluder_polygon, CanvasOccluderPolygonCullMode mode )

void

canvas_occluder_polygon_set_shape ( RID occluder_polygon, PackedVector2Array shape, bool closed )

void

canvas_set_disable_scale ( bool disable )

void

canvas_set_item_mirroring ( RID canvas, RID item, Vector2 mirroring )

void

canvas_set_modulate ( RID canvas, Color color )

void

canvas_set_shadow_texture_size ( int size )

RID

canvas_texture_create ( )

void

canvas_texture_set_channel ( RID canvas_texture, CanvasTextureChannel channel, RID texture )

void

canvas_texture_set_shading_parameters ( RID canvas_texture, Color base_color, float shininess )

void

canvas_texture_set_texture_filter ( RID canvas_texture, CanvasItemTextureFilter filter )

void

canvas_texture_set_texture_repeat ( RID canvas_texture, CanvasItemTextureRepeat repeat )

RenderingDevice

create_local_rendering_device ( ) const

RID

decal_create ( )

void

decal_set_albedo_mix ( RID decal, float albedo_mix )

void

decal_set_cull_mask ( RID decal, int mask )

void

decal_set_distance_fade ( RID decal, bool enabled, float begin, float length )

void

decal_set_emission_energy ( RID decal, float energy )

void

decal_set_extents ( RID decal, Vector3 extents )

void

decal_set_fade ( RID decal, float above, float below )

void

decal_set_modulate ( RID decal, Color color )

void

decal_set_normal_fade ( RID decal, float fade )

void

decal_set_texture ( RID decal, DecalTexture type, RID texture )

void

decals_set_filter ( DecalFilter filter )

RID

directional_light_create ( )

void

directional_shadow_atlas_set_size ( int size, bool is_16bits )

void

directional_soft_shadow_filter_set_quality ( ShadowQuality quality )

Image

environment_bake_panorama ( RID environment, bool bake_irradiance, Vector2i size )

RID

environment_create ( )

void

environment_glow_set_use_bicubic_upscale ( bool enable )

void

environment_glow_set_use_high_quality ( bool enable )

void

environment_set_adjustment ( RID env, bool enable, float brightness, float contrast, float saturation, bool use_1d_color_correction, RID color_correction )

void

environment_set_ambient_light ( RID env, Color color, EnvironmentAmbientSource ambient=0, float energy=1.0, float sky_contibution=0.0, EnvironmentReflectionSource reflection_source=0 )

void

environment_set_background ( RID env, EnvironmentBG bg )

void

environment_set_bg_color ( RID env, Color color )

void

environment_set_bg_energy ( RID env, float multiplier, float exposure_value )

void

environment_set_canvas_max_layer ( RID env, int max_layer )

void

environment_set_fog ( RID env, bool enable, Color light_color, float light_energy, float sun_scatter, float density, float height, float height_density, float aerial_perspective, float sky_affect )

void

environment_set_glow ( RID env, bool enable, PackedFloat32Array levels, float intensity, float strength, float mix, float bloom_threshold, EnvironmentGlowBlendMode blend_mode, float hdr_bleed_threshold, float hdr_bleed_scale, float hdr_luminance_cap, float glow_map_strength, RID glow_map )

void

environment_set_sdfgi ( RID env, bool enable, int cascades, float min_cell_size, EnvironmentSDFGIYScale y_scale, bool use_occlusion, float bounce_feedback, bool read_sky, float energy, float normal_bias, float probe_bias )

void

environment_set_sdfgi_frames_to_converge ( EnvironmentSDFGIFramesToConverge frames )

void

environment_set_sdfgi_frames_to_update_light ( EnvironmentSDFGIFramesToUpdateLight frames )

void

environment_set_sdfgi_ray_count ( EnvironmentSDFGIRayCount ray_count )

void

environment_set_sky ( RID env, RID sky )

void

environment_set_sky_custom_fov ( RID env, float scale )

void

environment_set_sky_orientation ( RID env, Basis orientation )

void

environment_set_ssao ( RID env, bool enable, float radius, float intensity, float power, float detail, float horizon, float sharpness, float light_affect, float ao_channel_affect )

void

environment_set_ssao_quality ( EnvironmentSSAOQuality quality, bool half_size, float adaptive_target, int blur_passes, float fadeout_from, float fadeout_to )

void

environment_set_ssil_quality ( EnvironmentSSILQuality quality, bool half_size, float adaptive_target, int blur_passes, float fadeout_from, float fadeout_to )

void

environment_set_ssr ( RID env, bool enable, int max_steps, float fade_in, float fade_out, float depth_tolerance )

void

environment_set_ssr_roughness_quality ( EnvironmentSSRRoughnessQuality quality )

void

environment_set_tonemap ( RID env, EnvironmentToneMapper tone_mapper, float exposure, float white )

void

environment_set_volumetric_fog ( RID env, bool enable, float density, Color albedo, Color emission, float emission_energy, float anisotropy, float length, float p_detail_spread, float gi_inject, bool temporal_reprojection, float temporal_reprojection_amount, float ambient_inject, float sky_affect )

void

environment_set_volumetric_fog_filter_active ( bool active )

void

environment_set_volumetric_fog_volume_size ( int size, int depth )

RID

fog_volume_create ( )

void

fog_volume_set_extents ( RID fog_volume, Vector3 extents )

void

fog_volume_set_material ( RID fog_volume, RID material )

void

fog_volume_set_shape ( RID fog_volume, FogVolumeShape shape )

void

force_draw ( bool swap_buffers=true, float frame_step=0.0 )

void

force_sync ( )

void

free_rid ( RID rid )

float

get_frame_setup_time_cpu ( ) const

RenderingDevice

get_rendering_device ( ) const

int

get_rendering_info ( RenderingInfo info )

Dictionary[]

get_shader_parameter_list ( RID shader ) const

RID

get_test_cube ( )

RID

get_test_texture ( )

String

get_video_adapter_api_version ( ) const

String

get_video_adapter_name ( ) const

DeviceType

get_video_adapter_type ( ) const

String

get_video_adapter_vendor ( ) const

RID

get_white_texture ( )

void

gi_set_use_half_resolution ( bool half_resolution )

void

global_shader_parameter_add ( StringName name, GlobalShaderParameterType type, Variant default_value )

Variant

global_shader_parameter_get ( StringName name ) const

PackedStringArray

global_shader_parameter_get_list ( ) const

GlobalShaderParameterType

global_shader_parameter_get_type ( StringName name ) const

void

global_shader_parameter_remove ( StringName name )

void

global_shader_parameter_set ( StringName name, Variant value )

void

global_shader_parameter_set_override ( StringName name, Variant value )

bool

has_changed ( ) const

bool

has_feature ( Features feature ) const

bool

has_os_feature ( String feature ) const

void

instance_attach_object_instance_id ( RID instance, int id )

void

instance_attach_skeleton ( RID instance, RID skeleton )

RID

instance_create ( )

RID

instance_create2 ( RID base, RID scenario )

Variant

instance_geometry_get_shader_parameter ( RID instance, StringName parameter ) const

Variant

instance_geometry_get_shader_parameter_default_value ( RID instance, StringName parameter ) const

Dictionary[]

instance_geometry_get_shader_parameter_list ( RID instance ) const

void

instance_geometry_set_cast_shadows_setting ( RID instance, ShadowCastingSetting shadow_casting_setting )

void

instance_geometry_set_flag ( RID instance, InstanceFlags flag, bool enabled )

void

instance_geometry_set_lightmap ( RID instance, RID lightmap, Rect2 lightmap_uv_scale, int lightmap_slice )

void

instance_geometry_set_lod_bias ( RID instance, float lod_bias )

void

instance_geometry_set_material_overlay ( RID instance, RID material )

void

instance_geometry_set_material_override ( RID instance, RID material )

void

instance_geometry_set_shader_parameter ( RID instance, StringName parameter, Variant value )

void

instance_geometry_set_transparency ( RID instance, float transparency )

void

instance_geometry_set_visibility_range ( RID instance, float min, float max, float min_margin, float max_margin, VisibilityRangeFadeMode fade_mode )

void

instance_set_base ( RID instance, RID base )

void

instance_set_blend_shape_weight ( RID instance, int shape, float weight )

void

instance_set_custom_aabb ( RID instance, AABB aabb )

void

instance_set_extra_visibility_margin ( RID instance, float margin )

void

instance_set_ignore_culling ( RID instance, bool enabled )

void

instance_set_layer_mask ( RID instance, int mask )

void

instance_set_scenario ( RID instance, RID scenario )

void

instance_set_surface_override_material ( RID instance, int surface, RID material )

void

instance_set_transform ( RID instance, Transform3D transform )

void

instance_set_visibility_parent ( RID instance, RID parent )

void

instance_set_visible ( RID instance, bool visible )

PackedInt64Array

instances_cull_aabb ( AABB aabb, RID scenario ) const

PackedInt64Array

instances_cull_convex ( Plane[] convex, RID scenario ) const

PackedInt64Array

instances_cull_ray ( Vector3 from, Vector3 to, RID scenario ) const

void

light_directional_set_blend_splits ( RID light, bool enable )

void

light_directional_set_shadow_mode ( RID light, LightDirectionalShadowMode mode )

void

light_directional_set_sky_mode ( RID light, LightDirectionalSkyMode mode )

void

light_omni_set_shadow_mode ( RID light, LightOmniShadowMode mode )

void

light_projectors_set_filter ( LightProjectorFilter filter )

void

light_set_bake_mode ( RID light, LightBakeMode bake_mode )

void

light_set_color ( RID light, Color color )

void

light_set_cull_mask ( RID light, int mask )

void

light_set_distance_fade ( RID decal, bool enabled, float begin, float shadow, float length )

void

light_set_max_sdfgi_cascade ( RID light, int cascade )

void

light_set_negative ( RID light, bool enable )

void

light_set_param ( RID light, LightParam param, float value )

void

light_set_projector ( RID light, RID texture )

void

light_set_reverse_cull_face_mode ( RID light, bool enabled )

void

light_set_shadow ( RID light, bool enabled )

RID

lightmap_create ( )

PackedInt32Array

lightmap_get_probe_capture_bsp_tree ( RID lightmap ) const

PackedVector3Array

lightmap_get_probe_capture_points ( RID lightmap ) const

PackedColorArray

lightmap_get_probe_capture_sh ( RID lightmap ) const

PackedInt32Array

lightmap_get_probe_capture_tetrahedra ( RID lightmap ) const

void

lightmap_set_baked_exposure_normalization ( RID lightmap, float baked_exposure )

void

lightmap_set_probe_bounds ( RID lightmap, AABB bounds )

void

lightmap_set_probe_capture_data ( RID lightmap, PackedVector3Array points, PackedColorArray point_sh, PackedInt32Array tetrahedra, PackedInt32Array bsp_tree )

void

lightmap_set_probe_capture_update_speed ( float speed )

void

lightmap_set_probe_interior ( RID lightmap, bool interior )

void

lightmap_set_textures ( RID lightmap, RID light,