VisualServer

Inherits: Object

Category: Core

Brief Description

Server for anything visible.

Methods

voidblack_bars_set_images ( RID left, RID top, RID right, RID bottom )
voidblack_bars_set_margins ( int left, int top, int right, int bottom )
RIDcamera_create ( )
voidcamera_set_cull_mask ( RID camera, int layers )
voidcamera_set_environment ( RID camera, RID env )
voidcamera_set_orthogonal ( RID camera, float size, float z_near, float z_far )
voidcamera_set_perspective ( RID camera, float fovy_degrees, float z_near, float z_far )
voidcamera_set_transform ( RID camera, Transform transform )
voidcamera_set_use_vertical_aspect ( RID camera, bool enable )
RIDcanvas_create ( )
voidcanvas_item_add_circle ( RID item, Vector2 pos, float radius, Color color )
voidcanvas_item_add_clip_ignore ( RID item, bool ignore )
voidcanvas_item_add_line ( RID item, Vector2 from, Vector2 to, Color color, float width=1.0, bool antialiased=false )
voidcanvas_item_add_mesh ( RID item, RID mesh, RID texture, RID normal_map )
voidcanvas_item_add_multimesh ( RID item, RID mesh, RID texture, RID normal_map )
voidcanvas_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 ), RID normal_map )
voidcanvas_item_add_particles ( RID item, RID particles, RID texture, RID normal_map )
voidcanvas_item_add_polygon ( RID item, PoolVector2Array points, PoolColorArray colors, PoolVector2Array uvs=PoolVector2Array( ), RID texture, RID normal_map, bool antialiased=false )
voidcanvas_item_add_polyline ( RID item, PoolVector2Array points, PoolColorArray colors, float width=1.0, bool antialiased=false )
voidcanvas_item_add_primitive ( RID item, PoolVector2Array points, PoolColorArray colors, PoolVector2Array uvs, RID texture, float width=1.0, RID normal_map )
voidcanvas_item_add_rect ( RID item, Rect2 rect, Color color )
voidcanvas_item_add_set_transform ( RID item, Transform2D transform )
voidcanvas_item_add_texture_rect ( RID item, Rect2 rect, RID texture, bool tile=false, Color modulate=Color( 1, 1, 1, 1 ), bool transpose=false, RID normal_map )
voidcanvas_item_add_texture_rect_region ( RID item, Rect2 rect, RID texture, Rect2 src_rect, Color modulate=Color( 1, 1, 1, 1 ), bool transpose=false, RID normal_map, bool clip_uv=true )
voidcanvas_item_add_triangle_array ( RID item, PoolIntArray indices, PoolVector2Array points, PoolColorArray colors, PoolVector2Array uvs=PoolVector2Array( ), PoolIntArray bones=PoolIntArray( ), PoolRealArray weights=PoolRealArray( ), RID texture, int count=-1, RID normal_map )
voidcanvas_item_clear ( RID item )
RIDcanvas_item_create ( )
voidcanvas_item_set_clip ( RID item, bool clip )
voidcanvas_item_set_copy_to_backbuffer ( RID item, bool enabled, Rect2 rect )
voidcanvas_item_set_custom_rect ( RID item, bool use_custom_rect, Rect2 rect=Rect2( 0, 0, 0, 0 ) )
voidcanvas_item_set_distance_field_mode ( RID item, bool enabled )
voidcanvas_item_set_draw_behind_parent ( RID item, bool enabled )
voidcanvas_item_set_draw_index ( RID item, int index )
voidcanvas_item_set_light_mask ( RID item, int mask )
voidcanvas_item_set_material ( RID item, RID material )
voidcanvas_item_set_modulate ( RID item, Color color )
voidcanvas_item_set_parent ( RID item, RID parent )
voidcanvas_item_set_self_modulate ( RID item, Color color )
voidcanvas_item_set_sort_children_by_y ( RID item, bool enabled )
voidcanvas_item_set_transform ( RID item, Transform2D transform )
voidcanvas_item_set_use_parent_material ( RID item, bool enabled )
voidcanvas_item_set_visible ( RID item, bool visible )
voidcanvas_item_set_z_as_relative_to_parent ( RID item, bool enabled )
voidcanvas_item_set_z_index ( RID item, int z_index )
voidcanvas_light_attach_to_canvas ( RID light, RID canvas )
RIDcanvas_light_create ( )
voidcanvas_light_occluder_attach_to_canvas ( RID occluder, RID canvas )
RIDcanvas_light_occluder_create ( )
voidcanvas_light_occluder_set_enabled ( RID occluder, bool enabled )
voidcanvas_light_occluder_set_light_mask ( RID occluder, int mask )
voidcanvas_light_occluder_set_polygon ( RID occluder, RID polygon )
voidcanvas_light_occluder_set_transform ( RID occluder, Transform2D transform )
voidcanvas_light_set_color ( RID light, Color color )
voidcanvas_light_set_enabled ( RID light, bool enabled )
voidcanvas_light_set_energy ( RID light, float energy )
voidcanvas_light_set_height ( RID light, float height )
voidcanvas_light_set_item_cull_mask ( RID light, int mask )
voidcanvas_light_set_item_shadow_cull_mask ( RID light, int mask )
voidcanvas_light_set_layer_range ( RID light, int min_layer, int max_layer )
voidcanvas_light_set_mode ( RID light, CanvasLightMode mode )
voidcanvas_light_set_scale ( RID light, float scale )
voidcanvas_light_set_shadow_buffer_size ( RID light, int size )
voidcanvas_light_set_shadow_color ( RID light, Color color )
voidcanvas_light_set_shadow_enabled ( RID light, bool enabled )
voidcanvas_light_set_shadow_filter ( RID light, CanvasLightShadowFilter filter )
voidcanvas_light_set_shadow_gradient_length ( RID light, float length )
voidcanvas_light_set_shadow_smooth ( RID light, float smooth )
voidcanvas_light_set_texture ( RID light, RID texture )
voidcanvas_light_set_texture_offset ( RID light, Vector2 offset )
voidcanvas_light_set_transform ( RID light, Transform2D transform )
voidcanvas_light_set_z_range ( RID light, int min_z, int max_z )
RIDcanvas_occluder_polygon_create ( )
voidcanvas_occluder_polygon_set_cull_mode ( RID occluder_polygon, CanvasOccluderPolygonCullMode mode )
voidcanvas_occluder_polygon_set_shape ( RID occluder_polygon, PoolVector2Array shape, bool closed )
voidcanvas_occluder_polygon_set_shape_as_lines ( RID occluder_polygon, PoolVector2Array shape )
voidcanvas_set_item_mirroring ( RID canvas, RID item, Vector2 mirroring )
voidcanvas_set_modulate ( RID canvas, Color color )
RIDdirectional_light_create ( )
voiddraw ( bool swap_buffers=true, float frame_step=0.0 )
RIDenvironment_create ( )
voidenvironment_set_adjustment ( RID env, bool enable, float brightness, float contrast, float saturation, RID ramp )
voidenvironment_set_ambient_light ( RID env, Color color, float energy=1.0, float sky_contibution=0.0 )
voidenvironment_set_background ( RID env, EnvironmentBG bg )
voidenvironment_set_bg_color ( RID env, Color color )
voidenvironment_set_bg_energy ( RID env, float energy )
voidenvironment_set_canvas_max_layer ( RID env, int max_layer )
voidenvironment_set_dof_blur_far ( RID env, bool enable, float distance, float transition, float far_amount, EnvironmentDOFBlurQuality quality )
voidenvironment_set_dof_blur_near ( RID env, bool enable, float distance, float transition, float far_amount, EnvironmentDOFBlurQuality quality )
voidenvironment_set_fog ( RID env, bool enable, Color color, Color sun_color, float sun_amount )
voidenvironment_set_fog_depth ( RID env, bool enable, float depth_begin, float depth_end, float depth_curve, bool transmit, float transmit_curve )
voidenvironment_set_fog_height ( RID env, bool enable, float min_height, float max_height, float height_curve )
voidenvironment_set_glow ( RID env, bool enable, int level_flags, float intensity, float strength, float bloom_threshold, EnvironmentGlowBlendMode blend_mode, float hdr_bleed_threshold, float hdr_bleed_scale, float hdr_luminance_cap, bool bicubic_upscale )
voidenvironment_set_sky ( RID env, RID sky )
voidenvironment_set_sky_custom_fov ( RID env, float scale )
voidenvironment_set_sky_orientation ( RID env, Basis orientation )
voidenvironment_set_ssao ( RID env, bool enable, float radius, float intensity, float radius2, float intensity2, float bias, float light_affect, float ao_channel_affect, Color color, EnvironmentSSAOQuality quality, EnvironmentSSAOBlur blur, float bilateral_sharpness )
voidenvironment_set_ssr ( RID env, bool enable, int max_steps, float fade_in, float fade_out, float depth_tolerance, bool roughness )
voidenvironment_set_tonemap ( RID env, EnvironmentToneMapper tone_mapper, float exposure, float white, bool auto_exposure, float min_luminance, float max_luminance, float auto_exp_speed, float auto_exp_grey )
voidfinish ( )
voidforce_draw ( bool swap_buffers=true, float frame_step=0.0 )
voidforce_sync ( )
voidfree_rid ( RID rid )
intget_render_info ( RenderInfo info )
RIDget_test_cube ( )
RIDget_test_texture ( )
RIDget_white_texture ( )
RIDgi_probe_create ( )
floatgi_probe_get_bias ( RID probe ) const
AABBgi_probe_get_bounds ( RID probe ) const
floatgi_probe_get_cell_size ( RID probe ) const
PoolIntArraygi_probe_get_dynamic_data ( RID probe ) const
intgi_probe_get_dynamic_range ( RID probe ) const
floatgi_probe_get_energy ( RID probe ) const
floatgi_probe_get_normal_bias ( RID probe ) const
floatgi_probe_get_propagation ( RID probe ) const
Transformgi_probe_get_to_cell_xform ( RID probe ) const
boolgi_probe_is_compressed ( RID probe ) const
boolgi_probe_is_interior ( RID probe ) const
voidgi_probe_set_bias ( RID probe, float bias )
voidgi_probe_set_bounds ( RID probe, AABB bounds )
voidgi_probe_set_cell_size ( RID probe, float range )
voidgi_probe_set_compress ( RID probe, bool enable )
voidgi_probe_set_dynamic_data ( RID probe, PoolIntArray data )
voidgi_probe_set_dynamic_range ( RID probe, int range )
voidgi_probe_set_energy ( RID probe, float energy )
voidgi_probe_set_interior ( RID probe, bool enable )
voidgi_probe_set_normal_bias ( RID probe, float bias )
voidgi_probe_set_propagation ( RID probe, float propagation )
voidgi_probe_set_to_cell_xform ( RID probe, Transform xform )
boolhas_changed ( ) const
boolhas_feature ( Features feature ) const
boolhas_os_feature ( String feature ) const
voidimmediate_begin ( RID immediate, PrimitiveType primitive, RID texture )
voidimmediate_clear ( RID immediate )
voidimmediate_color ( RID immediate, Color color )
RIDimmediate_create ( )
voidimmediate_end ( RID immediate )
RIDimmediate_get_material ( RID immediate ) const
voidimmediate_normal ( RID immediate, Vector3 normal )
voidimmediate_set_material ( RID immediate, RID material )
voidimmediate_tangent ( RID immediate, Plane tangent )
voidimmediate_uv ( RID immediate, Vector2 tex_uv )
voidimmediate_uv2 ( RID immediate, Vector2 tex_uv )
voidimmediate_vertex ( RID immediate, Vector3 vertex )
voidimmediate_vertex_2d ( RID immediate, Vector2 vertex )
voidinit ( )
voidinstance_attach_object_instance_id ( RID instance, int id )
voidinstance_attach_skeleton ( RID instance, RID skeleton )
RIDinstance_create ( )
RIDinstance_create2 ( RID base, RID scenario )
voidinstance_geometry_set_as_instance_lod ( RID instance, RID as_lod_of_instance )
voidinstance_geometry_set_cast_shadows_setting ( RID instance, ShadowCastingSetting shadow_casting_setting )
voidinstance_geometry_set_draw_range ( RID instance, float min, float max, float min_margin, float max_margin )
voidinstance_geometry_set_flag ( RID instance, InstanceFlags flag, bool enabled )
voidinstance_geometry_set_material_override ( RID instance, RID material )
voidinstance_set_base ( RID instance, RID base )
voidinstance_set_blend_shape_weight ( RID instance, int shape, float weight )
voidinstance_set_custom_aabb ( RID instance, AABB aabb )
voidinstance_set_exterior ( RID instance, bool enabled )
voidinstance_set_extra_visibility_margin ( RID instance, float margin )
voidinstance_set_layer_mask ( RID instance, int mask )
voidinstance_set_scenario ( RID instance, RID scenario )
voidinstance_set_surface_material ( RID instance, int surface, RID material )
voidinstance_set_transform ( RID instance, Transform transform )
voidinstance_set_use_lightmap ( RID instance, RID lightmap_instance, RID lightmap )
voidinstance_set_visible ( RID instance, bool visible )
Arrayinstances_cull_aabb ( AABB aabb, RID scenario ) const
Arrayinstances_cull_convex ( Array convex, RID scenario ) const
Arrayinstances_cull_ray ( Vector3 from, Vector3 to, RID scenario ) const
voidlight_directional_set_blend_splits ( RID light, bool enable )
voidlight_directional_set_shadow_depth_range_mode ( RID light, LightDirectionalShadowDepthRangeMode range_mode )
voidlight_directional_set_shadow_mode ( RID light, LightDirectionalShadowMode mode )
voidlight_omni_set_shadow_detail ( RID light, LightOmniShadowDetail detail )
voidlight_omni_set_shadow_mode ( RID light, LightOmniShadowMode mode )
voidlight_set_color ( RID light, Color color )
voidlight_set_cull_mask ( RID light, int mask )
voidlight_set_negative ( RID light, bool enable )
voidlight_set_param ( RID light, LightParam param, float value )
voidlight_set_projector ( RID light, RID texture )
voidlight_set_reverse_cull_face_mode ( RID light, bool enabled )
voidlight_set_shadow ( RID light, bool enabled )
voidlight_set_shadow_color ( RID light, Color color )
RIDlightmap_capture_create ( )
AABBlightmap_capture_get_bounds ( RID capture ) const
floatlightmap_capture_get_energy ( RID capture ) const
PoolByteArraylightmap_capture_get_octree ( RID capture ) const
intlightmap_capture_get_octree_cell_subdiv ( RID capture ) const
Transformlightmap_capture_get_octree_cell_transform ( RID capture ) const
voidlightmap_capture_set_bounds ( RID capture, AABB bounds )
voidlightmap_capture_set_energy ( RID capture, float energy )
voidlightmap_capture_set_octree ( RID capture, PoolByteArray octree )
voidlightmap_capture_set_octree_cell_subdiv ( RID capture, int subdiv )
voidlightmap_capture_set_octree_cell_transform ( RID capture, Transform xform )
RIDmake_sphere_mesh ( int latitudes, int longitudes, float radius )
RIDmaterial_create ( )
Variantmaterial_get_param ( RID material, String parameter ) const
Variantmaterial_get_param_default ( RID material, String parameter ) const
RIDmaterial_get_shader ( RID shader_material ) const
voidmaterial_set_line_width ( RID material, float width )
voidmaterial_set_next_pass ( RID material, RID next_material )
voidmaterial_set_param ( RID material, String parameter, Variant value )
voidmaterial_set_render_priority ( RID material, int priority )
voidmaterial_set_shader ( RID shader_material, RID shader )
voidmesh_add_surface_from_arrays ( RID mesh, PrimitiveType primtive, Array arrays, Array blend_shapes=[ ], int compress_format=97280 )
voidmesh_clear ( RID mesh )
RIDmesh_create ( )
intmesh_get_blend_shape_count ( RID mesh ) const
BlendShapeModemesh_get_blend_shape_mode ( RID mesh ) const
AABBmesh_get_custom_aabb ( RID mesh ) const
intmesh_get_surface_count ( RID mesh ) const
voidmesh_remove_surface ( RID mesh, int index )
voidmesh_set_blend_shape_count ( RID mesh, int amount )
voidmesh_set_blend_shape_mode ( RID mesh, BlendShapeMode mode )
voidmesh_set_custom_aabb ( RID mesh, AABB aabb )
AABBmesh_surface_get_aabb ( RID mesh, int surface ) const
PoolByteArraymesh_surface_get_array ( RID mesh, int surface ) const
intmesh_surface_get_array_index_len ( RID mesh, int surface ) const
intmesh_surface_get_array_len ( RID mesh, int surface ) const
Arraymesh_surface_get_arrays ( RID mesh, int surface ) const
Arraymesh_surface_get_blend_shape_arrays ( RID mesh, int surface ) const
intmesh_surface_get_format ( RID mesh, int surface ) const
intmesh_surface_get_format_offset ( int format, int vertex_len, int index_len, int array_index ) const
intmesh_surface_get_format_stride ( int format, int vertex_len, int index_len ) const
PoolByteArraymesh_surface_get_index_array ( RID mesh, int surface ) const
RIDmesh_surface_get_material ( RID mesh, int surface ) const
PrimitiveTypemesh_surface_get_primitive_type ( RID mesh, int surface ) const
Arraymesh_surface_get_skeleton_aabb ( RID mesh, int surface ) const
voidmesh_surface_set_material ( RID mesh, int surface, RID material )
voidmesh_surface_update_region ( RID mesh, int surface, int offset, PoolByteArray data )
voidmultimesh_allocate ( RID multimesh, int instances, MultimeshTransformFormat transform_format, MultimeshColorFormat color_format, MultimeshCustomDataFormat custom_data_format=0 )
AABBmultimesh_get_aabb ( RID multimesh ) const
intmultimesh_get_instance_count ( RID multimesh ) const
RIDmultimesh_get_mesh ( RID multimesh ) const
intmultimesh_get_visible_instances ( RID multimesh ) const
Colormultimesh_instance_get_color ( RID multimesh, int index ) const
Colormultimesh_instance_get_custom_data ( RID multimesh, int index ) const
Transformmultimesh_instance_get_transform ( RID multimesh, int index ) const
Transform2Dmultimesh_instance_get_transform_2d ( RID multimesh, int index ) const
voidmultimesh_instance_set_color ( RID multimesh, int index, Color color )
voidmultimesh_instance_set_custom_data ( RID multimesh, int index, Color custom_data )
voidmultimesh_instance_set_transform ( RID multimesh, int index, Transform transform )
voidmultimesh_instance_set_transform_2d ( RID multimesh, int index, Transform2D transform )
voidmultimesh_set_as_bulk_array ( RID multimesh, PoolRealArray array )
voidmultimesh_set_mesh ( RID multimesh, RID mesh )
voidmultimesh_set_visible_instances ( RID multimesh, int visible )
RIDomni_light_create ( )
RIDparticles_create ( )
AABBparticles_get_current_aabb ( RID particles )
boolparticles_get_emitting ( RID particles )
voidparticles_restart ( RID particles )
voidparticles_set_amount ( RID particles, int amount )
voidparticles_set_custom_aabb ( RID particles, AABB aabb )
voidparticles_set_draw_order ( RID particles, ParticlesDrawOrder order )
voidparticles_set_draw_pass_mesh ( RID particles, int pass, RID mesh )
voidparticles_set_draw_passes ( RID particles, int count )
voidparticles_set_emission_transform ( RID particles, Transform transform )
voidparticles_set_emitting ( RID particles, bool emitting )
voidparticles_set_explosiveness_ratio ( RID particles, float ratio )
voidparticles_set_fixed_fps ( RID particles, int fps )
voidparticles_set_fractional_delta ( RID particles, bool enable )
voidparticles_set_lifetime ( RID particles, float lifetime )
voidparticles_set_one_shot ( RID particles, bool one_shot )
voidparticles_set_pre_process_time ( RID particles, float time )
voidparticles_set_process_material ( RID particles, RID material )
voidparticles_set_randomness_ratio ( RID particles, float ratio )
voidparticles_set_speed_scale ( RID particles, float scale )
voidparticles_set_use_local_coordinates ( RID particles, bool enable )
RIDreflection_probe_create ( )
voidreflection_probe_set_as_interior ( RID probe, bool enable )
voidreflection_probe_set_cull_mask ( RID probe, int layers )
voidreflection_probe_set_enable_box_projection ( RID probe, bool enable )
voidreflection_probe_set_enable_shadows ( RID probe, bool enable )
voidreflection_probe_set_extents ( RID probe, Vector3 extents )
voidreflection_probe_set_intensity ( RID probe, float intensity )
voidreflection_probe_set_interior_ambient ( RID probe, Color color )
voidreflection_probe_set_interior_ambient_energy ( RID probe, float energy )
voidreflection_probe_set_interior_ambient_probe_contribution ( RID probe, float contrib )
voidreflection_probe_set_max_distance ( RID probe, float distance )
voidreflection_probe_set_origin_offset ( RID probe, Vector3 offset )
voidreflection_probe_set_update_mode ( RID probe, ReflectionProbeUpdateMode mode )
voidrequest_frame_drawn_callback ( Object where, String method, Variant userdata )
RIDscenario_create ( )
voidscenario_set_debug ( RID scenario, ScenarioDebugMode debug_mode )
voidscenario_set_environment ( RID scenario, RID environment )
voidscenario_set_fallback_environment ( RID scenario, RID environment )
voidscenario_set_reflection_atlas_size ( RID scenario, int size, int subdiv )
voidset_boot_image ( Image image, Color color, bool scale )
voidset_debug_generate_wireframes ( bool generate )
voidset_default_clear_color ( Color color )
RIDshader_create ( )
Stringshader_get_code ( RID shader ) const
RIDshader_get_default_texture_param ( RID shader, String name ) const
Arrayshader_get_param_list ( RID shader ) const
voidshader_set_code ( RID shader, String code )
voidshader_set_default_texture_param ( RID shader, String name, RID texture )
voidskeleton_allocate ( RID skeleton, int bones, bool is_2d_skeleton=false )
Transformskeleton_bone_get_transform ( RID skeleton, int bone ) const
Transform2Dskeleton_bone_get_transform_2d ( RID skeleton, int bone ) const
voidskeleton_bone_set_transform ( RID skeleton, int bone, Transform transform )
voidskeleton_bone_set_transform_2d ( RID skeleton, int bone, Transform2D transform )
RIDskeleton_create ( )
intskeleton_get_bone_count ( RID skeleton ) const
RIDsky_create ( )
voidsky_set_texture ( RID sky, RID cube_map, int radiance_size )
RIDspot_light_create ( )
voidsync ( )
voidtexture_allocate ( RID texture, int width, int height, int depth_3d, Format format, TextureType type, int flags=7 )
RIDtexture_create ( )
RIDtexture_create_from_image ( Image image, int flags=7 )
Arraytexture_debug_usage ( )
Imagetexture_get_data ( RID texture, int cube_side=0 ) const
inttexture_get_depth ( RID texture ) const
inttexture_get_flags ( RID texture ) const
Formattexture_get_format ( RID texture ) const
inttexture_get_height ( RID texture ) const
Stringtexture_get_path ( RID texture ) const
inttexture_get_texid ( RID texture ) const
TextureTypetexture_get_type ( RID texture ) const
inttexture_get_width ( RID texture ) const
voidtexture_set_data ( RID texture, Image image, int layer=0 )
voidtexture_set_data_partial ( RID texture, Image image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_mip, int layer=0 )
voidtexture_set_flags ( RID texture, int flags )
voidtexture_set_path ( RID texture, String path )
voidtexture_set_shrink_all_x2_on_set_data ( bool shrink )
voidtexture_set_size_override ( RID texture, int width, int height, int depth )
voidtextures_keep_original ( bool enable )
voidviewport_attach_camera ( RID viewport, RID camera )
voidviewport_attach_canvas ( RID viewport, RID canvas )
voidviewport_attach_to_screen ( RID viewport, Rect2 rect=Rect2( 0, 0, 0, 0 ), int screen=0 )
RIDviewport_create ( )
voidviewport_detach ( RID viewport )
intviewport_get_render_info ( RID viewport, ViewportRenderInfo info )
RIDviewport_get_texture ( RID viewport ) const
voidviewport_remove_canvas ( RID viewport, RID canvas )
voidviewport_set_active ( RID viewport, bool active )
voidviewport_set_canvas_stacking ( RID viewport, RID canvas, int layer, int sublayer )
voidviewport_set_canvas_transform ( RID viewport, RID canvas, Transform2D offset )
voidviewport_set_clear_mode ( RID viewport, ViewportClearMode clear_mode )
voidviewport_set_debug_draw ( RID viewport, ViewportDebugDraw draw )
voidviewport_set_disable_3d ( RID viewport, bool disabled )
voidviewport_set_disable_environment ( RID viewport, bool disabled )
voidviewport_set_global_canvas_transform ( RID viewport, Transform2D transform )
voidviewport_set_hdr ( RID viewport, bool enabled )
voidviewport_set_hide_canvas ( RID viewport, bool hidden )
voidviewport_set_hide_scenario ( RID viewport, bool hidden )
voidviewport_set_msaa ( RID viewport, ViewportMSAA msaa )
voidviewport_set_parent_viewport ( RID viewport, RID parent_viewport )
voidviewport_set_scenario ( RID viewport, RID scenario )
voidviewport_set_shadow_atlas_quadrant_subdivision ( RID viewport, int quadrant, int subdivision )
voidviewport_set_shadow_atlas_size ( RID viewport, int size )
voidviewport_set_size ( RID viewport, int width, int height )
voidviewport_set_transparent_background ( RID viewport, bool enabled )
voidviewport_set_update_mode ( RID viewport, ViewportUpdateMode update_mode )
voidviewport_set_usage ( RID viewport, ViewportUsage usage )
voidviewport_set_use_arvr ( RID viewport, bool use_arvr )
voidviewport_set_vflip ( RID viewport, bool enabled )

Signals

  • frame_post_draw ( )

  • frame_pre_draw ( )

Enumerations

enum CubeMapSide:

  • CUBEMAP_LEFT = 0 — Marks the left side of a cubemap.
  • CUBEMAP_RIGHT = 1 — Marks the right side of a cubemap.
  • CUBEMAP_BOTTOM = 2 — Marks the bottom side of a cubemap.
  • CUBEMAP_TOP = 3 — Marks the top side of a cubemap.
  • CUBEMAP_FRONT = 4 — Marks the front side of a cubemap.
  • CUBEMAP_BACK = 5 — Marks the back side of a cubemap.

enum TextureType:

  • TEXTURE_TYPE_2D = 0
  • TEXTURE_TYPE_CUBEMAP = 1
  • TEXTURE_TYPE_2D_ARRAY = 2
  • TEXTURE_TYPE_3D = 3

enum TextureFlags:

  • TEXTURE_FLAG_MIPMAPS = 1 — Generate mipmaps, which are smaller versions of the same texture to use when zoomed out, keeping the aspect ratio.
  • TEXTURE_FLAG_REPEAT = 2 — Repeat (instead of clamp to edge).
  • TEXTURE_FLAG_FILTER = 4 — Turn on magnifying filter, to enable smooth zooming in of the texture.
  • TEXTURE_FLAG_ANISOTROPIC_FILTER = 8 — Anisotropic mipmap filtering. Generates smaller versions of the same texture with different aspect ratios.

More effective on planes often shown going to the horrizon as those textures (Walls or Ground for example) get squashed in the viewport to different aspect ratios and regular mipmaps keep the aspect ratio so they don’t optimize storage that well in those cases.

  • TEXTURE_FLAG_CONVERT_TO_LINEAR = 16 — Converts texture to SRGB color space.
  • TEXTURE_FLAG_MIRRORED_REPEAT = 32 — Repeat texture with alternate sections mirrored.
  • TEXTURE_FLAG_USED_FOR_STREAMING = 2048 — Texture is a video surface.
  • TEXTURE_FLAGS_DEFAULT = 7 — Default flags. Generate mipmaps, repeat, and filter are enabled.

enum ShaderMode:

  • SHADER_SPATIAL = 0 — Shader is a 3D shader.
  • SHADER_CANVAS_ITEM = 1 — Shader is a 2D shader.
  • SHADER_PARTICLES = 2 — Shader is a particle shader.
  • SHADER_MAX = 3 — Represents the size of the ShaderMode enum.

enum ArrayType:

  • ARRAY_VERTEX = 0 — Array is a vertex array.
  • ARRAY_NORMAL = 1 — Array is a normal array.
  • ARRAY_TANGENT = 2 — Array is a tangent array.
  • ARRAY_COLOR = 3 — Array is a color array.
  • ARRAY_TEX_UV = 4 — Array is a uv coordinates array.
  • ARRAY_TEX_UV2 = 5 — Array is a uv coordinates array for the second uv coordinates.
  • ARRAY_BONES = 6 — Array contains bone information.
  • ARRAY_WEIGHTS = 7 — Array is weight information.
  • ARRAY_INDEX = 8 — Array is index array.
  • ARRAY_MAX = 9 — Represents the size of the ArrayType enum.

enum ArrayFormat:

  • ARRAY_FORMAT_VERTEX = 1 — Flag used to mark a vertex array.
  • ARRAY_FORMAT_NORMAL = 2 — Flag used to mark a normal array.
  • ARRAY_FORMAT_TANGENT = 4 — Flag used to mark a tangent array.
  • ARRAY_FORMAT_COLOR = 8 — Flag used to mark a color array.
  • ARRAY_FORMAT_TEX_UV = 16 — Flag used to mark a uv coordinates array.
  • ARRAY_FORMAT_TEX_UV2 = 32 — Flag used to mark a uv coordinates array for the second uv coordinates.
  • ARRAY_FORMAT_BONES = 64 — Flag used to mark a bone information array.
  • ARRAY_FORMAT_WEIGHTS = 128 — Flag used to mark a weights array.
  • ARRAY_FORMAT_INDEX = 256 — Flag used to mark a index array.
  • ARRAY_COMPRESS_VERTEX = 512 — Flag used to mark a compressed (half float) vertex array.
  • ARRAY_COMPRESS_NORMAL = 1024 — Flag used to mark a compressed (half float) normal array.
  • ARRAY_COMPRESS_TANGENT = 2048 — Flag used to mark a compressed (half float) tangent array.
  • ARRAY_COMPRESS_COLOR = 4096 — Flag used to mark a compressed (half float) color array.
  • ARRAY_COMPRESS_TEX_UV = 8192 — Flag used to mark a compressed (half float) uv coordinates array.
  • ARRAY_COMPRESS_TEX_UV2 = 16384 — Flag used to mark a compressed (half float) uv coordinates array for the second uv coordinates.
  • ARRAY_COMPRESS_BONES = 32768
  • ARRAY_COMPRESS_WEIGHTS = 65536 — Flag used to mark a compressed (half float) weight array.
  • ARRAY_COMPRESS_INDEX = 131072
  • ARRAY_FLAG_USE_2D_VERTICES = 262144 — Flag used to mark that the array contains 2D vertices.
  • ARRAY_FLAG_USE_16_BIT_BONES = 524288 — Flag used to mark that the array uses 16 bit bones instead of 8 bit.
  • ARRAY_COMPRESS_DEFAULT = 97280 — Used to set flags ARRAY_COMPRESS_VERTEX, ARRAY_COMPRESS_NORMAL, ARRAY_COMPRESS_TANGENT, ARRAY_COMPRESS_COLOR, ARRAY_COMPRESS_TEX_UV, ARRAY_COMPRESS_TEX_UV2 and ARRAY_COMPRESS_WEIGHTS quickly.

enum PrimitiveType:

  • PRIMITIVE_POINTS = 0 — Primitive to draw consists of points.
  • PRIMITIVE_LINES = 1 — Primitive to draw consists of lines.
  • PRIMITIVE_LINE_STRIP = 2 — Primitive to draw consists of a line strip from start to end.
  • PRIMITIVE_LINE_LOOP = 3 — Primitive to draw consists of a line loop (a line strip with a line between the last and the first vertex).
  • PRIMITIVE_TRIANGLES = 4 — Primitive to draw consists of triangles.
  • PRIMITIVE_TRIANGLE_STRIP = 5 — Primitive to draw consists of a triangle strip (the last 3 vertices are always combined to make a triangle).
  • PRIMITIVE_TRIANGLE_FAN = 6 — Primitive to draw consists of a triangle strip (the last 2 vertices are always combined with the first to make a triangle).
  • PRIMITIVE_MAX = 7 — Represents the size of the PrimitiveType enum.

enum BlendShapeMode:

  • BLEND_SHAPE_MODE_NORMALIZED = 0
  • BLEND_SHAPE_MODE_RELATIVE = 1

enum LightType:

  • LIGHT_DIRECTIONAL = 0 — Is a directional (sun) light.
  • LIGHT_OMNI = 1 — is an omni light.
  • LIGHT_SPOT = 2 — is an spot light.

enum LightParam:

  • LIGHT_PARAM_ENERGY = 0 — The light’s energy.
  • LIGHT_PARAM_SPECULAR = 2 — The light’s influence on specularity.
  • LIGHT_PARAM_RANGE = 3 — The light’s range.
  • LIGHT_PARAM_ATTENUATION = 4 — The light’s attenuation.
  • LIGHT_PARAM_SPOT_ANGLE = 5 — The spotlight’s angle.
  • LIGHT_PARAM_SPOT_ATTENUATION = 6 — The spotlight’s attenuation.
  • LIGHT_PARAM_CONTACT_SHADOW_SIZE = 7 — Scales the shadow color.
  • LIGHT_PARAM_SHADOW_MAX_DISTANCE = 8
  • LIGHT_PARAM_SHADOW_SPLIT_1_OFFSET = 9
  • LIGHT_PARAM_SHADOW_SPLIT_2_OFFSET = 10
  • LIGHT_PARAM_SHADOW_SPLIT_3_OFFSET = 11
  • LIGHT_PARAM_SHADOW_NORMAL_BIAS = 12
  • LIGHT_PARAM_SHADOW_BIAS = 13
  • LIGHT_PARAM_SHADOW_BIAS_SPLIT_SCALE = 14
  • LIGHT_PARAM_MAX = 15 — Represents the size of the LightParam enum.

enum LightOmniShadowMode:

  • LIGHT_OMNI_SHADOW_DUAL_PARABOLOID = 0
  • LIGHT_OMNI_SHADOW_CUBE = 1

enum LightOmniShadowDetail:

  • LIGHT_OMNI_SHADOW_DETAIL_VERTICAL = 0
  • LIGHT_OMNI_SHADOW_DETAIL_HORIZONTAL = 1

enum LightDirectionalShadowMode:

  • LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL = 0
  • LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS = 1
  • LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS = 2

enum LightDirectionalShadowDepthRangeMode:

  • LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE = 0
  • LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_OPTIMIZED = 1

enum ViewportUpdateMode:

  • VIEWPORT_UPDATE_DISABLED = 0
  • VIEWPORT_UPDATE_ONCE = 1
  • VIEWPORT_UPDATE_WHEN_VISIBLE = 2
  • VIEWPORT_UPDATE_ALWAYS = 3

enum ViewportClearMode:

  • VIEWPORT_CLEAR_ALWAYS = 0 — The viewport is always cleared before drawing.
  • VIEWPORT_CLEAR_NEVER = 1 — The viewport is never cleared before drawing.
  • VIEWPORT_CLEAR_ONLY_NEXT_FRAME = 2 — The viewport is cleared once, then the clear mode is set to VIEWPORT_CLEAR_NEVER.

enum ViewportMSAA:

  • VIEWPORT_MSAA_DISABLED = 0 — Multisample antialiasing is disabled.
  • VIEWPORT_MSAA_2X = 1 — Multisample antialiasing is set to 2X.
  • VIEWPORT_MSAA_4X = 2 — Multisample antialiasing is set to 4X.
  • VIEWPORT_MSAA_8X = 3 — Multisample antialiasing is set to 8X.
  • VIEWPORT_MSAA_16X = 4 — Multisample antialiasing is set to 16X.

enum ViewportUsage:

  • VIEWPORT_USAGE_2D = 0 — The Viewport does not render 3D but samples.
  • VIEWPORT_USAGE_2D_NO_SAMPLING = 1 — The Viewport does not render 3D and does not sample.
  • VIEWPORT_USAGE_3D = 2 — The Viewport renders 3D with effects.
  • VIEWPORT_USAGE_3D_NO_EFFECTS = 3 — The Viewport renders 3D but without effects.

enum ViewportRenderInfo:

  • VIEWPORT_RENDER_INFO_OBJECTS_IN_FRAME = 0
  • VIEWPORT_RENDER_INFO_VERTICES_IN_FRAME = 1
  • VIEWPORT_RENDER_INFO_MATERIAL_CHANGES_IN_FRAME = 2
  • VIEWPORT_RENDER_INFO_SHADER_CHANGES_IN_FRAME = 3
  • VIEWPORT_RENDER_INFO_SURFACE_CHANGES_IN_FRAME = 4
  • VIEWPORT_RENDER_INFO_DRAW_CALLS_IN_FRAME = 5
  • VIEWPORT_RENDER_INFO_MAX = 6 — Represents the size of the ViewportRenderInfo enum.

enum ViewportDebugDraw:

  • VIEWPORT_DEBUG_DRAW_DISABLED = 0 — Debug draw is disabled. Default setting.
  • VIEWPORT_DEBUG_DRAW_UNSHADED = 1 — Debug draw sets objects to unshaded.
  • VIEWPORT_DEBUG_DRAW_OVERDRAW = 2 — Overwrites clear color to (0,0,0,0).
  • VIEWPORT_DEBUG_DRAW_WIREFRAME = 3 — Debug draw draws objects in wireframe.

enum ScenarioDebugMode:

  • SCENARIO_DEBUG_DISABLED = 0
  • SCENARIO_DEBUG_WIREFRAME = 1
  • SCENARIO_DEBUG_OVERDRAW = 2
  • SCENARIO_DEBUG_SHADELESS = 3

enum InstanceType:

  • INSTANCE_NONE = 0 — The instance does not have a type.
  • INSTANCE_MESH = 1 — The instance is a mesh.
  • INSTANCE_MULTIMESH = 2 — The instance is a multimesh.
  • INSTANCE_IMMEDIATE = 3 — The instance is an immediate geometry.
  • INSTANCE_PARTICLES = 4 — The instance is a particle emitter.
  • INSTANCE_LIGHT = 5 — The instance is a light.
  • INSTANCE_REFLECTION_PROBE = 6
  • INSTANCE_GI_PROBE = 7
  • INSTANCE_LIGHTMAP_CAPTURE = 8
  • INSTANCE_MAX = 9 — Represents the size of the InstanceType enum.
  • INSTANCE_GEOMETRY_MASK = 30 — A combination of the flags of geometry instances (mesh, multimesh, immediate and particles).

enum InstanceFlags:

  • INSTANCE_FLAG_USE_BAKED_LIGHT = 0
  • INSTANCE_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE = 1
  • INSTANCE_FLAG_MAX = 2 — Represents the size of the InstanceFlags enum.

enum ShadowCastingSetting:

  • SHADOW_CASTING_SETTING_OFF = 0
  • SHADOW_CASTING_SETTING_ON = 1
  • SHADOW_CASTING_SETTING_DOUBLE_SIDED = 2
  • SHADOW_CASTING_SETTING_SHADOWS_ONLY = 3

enum NinePatchAxisMode:

  • NINE_PATCH_STRETCH = 0 — The nine patch gets stretched where needed.
  • NINE_PATCH_TILE = 1 — The nine patch gets filled with tiles where needed.
  • NINE_PATCH_TILE_FIT = 2 — The nine patch gets filled with tiles where needed and stretches them a bit if needed.

enum CanvasLightMode:

  • CANVAS_LIGHT_MODE_ADD = 0 — Adds light color additive to the canvas.
  • CANVAS_LIGHT_MODE_SUB = 1 — Adds light color subtractive to the canvas.
  • CANVAS_LIGHT_MODE_MIX = 2 — The light adds color depending on transparency.
  • CANVAS_LIGHT_MODE_MASK = 3 — The light adds color depending on mask.

enum CanvasLightShadowFilter:

  • CANVAS_LIGHT_FILTER_NONE = 0
  • CANVAS_LIGHT_FILTER_PCF3 = 1
  • CANVAS_LIGHT_FILTER_PCF5 = 2
  • CANVAS_LIGHT_FILTER_PCF7 = 3
  • CANVAS_LIGHT_FILTER_PCF9 = 4
  • CANVAS_LIGHT_FILTER_PCF13 = 5

enum CanvasOccluderPolygonCullMode:

  • CANVAS_OCCLUDER_POLYGON_CULL_DISABLED = 0 — Culling of the canvas occluder is disabled.
  • CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE = 1 — Culling of the canvas occluder is clockwise.
  • CANVAS_OCCLUDER_POLYGON_CULL_COUNTER_CLOCKWISE = 2 — Culling of the canvas occluder is counterclockwise.

enum RenderInfo:

  • INFO_OBJECTS_IN_FRAME = 0 — The amount of objects in the frame.
  • INFO_VERTICES_IN_FRAME = 1 — The amount of vertices in the frame.
  • INFO_MATERIAL_CHANGES_IN_FRAME = 2 — The amount of modified materials in the frame.
  • INFO_SHADER_CHANGES_IN_FRAME = 3 — The amount of shader rebinds in the frame.
  • INFO_SURFACE_CHANGES_IN_FRAME = 4 — The amount of surface changes in the frame.
  • INFO_DRAW_CALLS_IN_FRAME = 5 — The amount of draw calls in frame.
  • INFO_USAGE_VIDEO_MEM_TOTAL = 6 — Unimplemented in the GLES2 and GLES3 rendering backends, always returns 0.
  • INFO_VIDEO_MEM_USED = 7 — The amount of video memory used, i.e. texture and vertex memory combined.
  • INFO_TEXTURE_MEM_USED = 8 — The amount of texture memory used.
  • INFO_VERTEX_MEM_USED = 9 — The amount of vertex memory used.

enum Features:

  • FEATURE_SHADERS = 0
  • FEATURE_MULTITHREADED = 1

enum MultimeshTransformFormat:

  • MULTIMESH_TRANSFORM_2D = 0
  • MULTIMESH_TRANSFORM_3D = 1

enum MultimeshColorFormat:

  • MULTIMESH_COLOR_NONE = 0
  • MULTIMESH_COLOR_8BIT = 1
  • MULTIMESH_COLOR_FLOAT = 2

enum MultimeshCustomDataFormat:

  • MULTIMESH_CUSTOM_DATA_NONE = 0
  • MULTIMESH_CUSTOM_DATA_8BIT = 1
  • MULTIMESH_CUSTOM_DATA_FLOAT = 2

enum ReflectionProbeUpdateMode:

  • REFLECTION_PROBE_UPDATE_ONCE = 0
  • REFLECTION_PROBE_UPDATE_ALWAYS = 1

enum ParticlesDrawOrder:

  • PARTICLES_DRAW_ORDER_INDEX = 0
  • PARTICLES_DRAW_ORDER_LIFETIME = 1
  • PARTICLES_DRAW_ORDER_VIEW_DEPTH = 2

enum EnvironmentBG:

  • ENV_BG_CLEAR_COLOR = 0
  • ENV_BG_COLOR = 1
  • ENV_BG_SKY = 2
  • ENV_BG_COLOR_SKY = 3
  • ENV_BG_CANVAS = 4
  • ENV_BG_KEEP = 5
  • ENV_BG_MAX = 6 — Represents the size of the EnvironmentBG enum.

enum EnvironmentDOFBlurQuality:

  • ENV_DOF_BLUR_QUALITY_LOW = 0
  • ENV_DOF_BLUR_QUALITY_MEDIUM = 1
  • ENV_DOF_BLUR_QUALITY_HIGH = 2

enum EnvironmentGlowBlendMode:

  • GLOW_BLEND_MODE_ADDITIVE = 0
  • GLOW_BLEND_MODE_SCREEN = 1
  • GLOW_BLEND_MODE_SOFTLIGHT = 2
  • GLOW_BLEND_MODE_REPLACE = 3

enum EnvironmentToneMapper:

  • ENV_TONE_MAPPER_LINEAR = 0
  • ENV_TONE_MAPPER_REINHARD = 1
  • ENV_TONE_MAPPER_FILMIC = 2
  • ENV_TONE_MAPPER_ACES = 3

enum EnvironmentSSAOQuality:

  • ENV_SSAO_QUALITY_LOW = 0
  • ENV_SSAO_QUALITY_MEDIUM = 1
  • ENV_SSAO_QUALITY_HIGH = 2

enum EnvironmentSSAOBlur:

  • ENV_SSAO_BLUR_DISABLED = 0
  • ENV_SSAO_BLUR_1x1 = 1
  • ENV_SSAO_BLUR_2x2 = 2
  • ENV_SSAO_BLUR_3x3 = 3

Constants

  • NO_INDEX_ARRAY = -1 — Marks an error that shows that the index array is empty.
  • ARRAY_WEIGHTS_SIZE = 4
  • CANVAS_ITEM_Z_MIN = -4096 — The minimum Z-layer for canvas items.
  • CANVAS_ITEM_Z_MAX = 4096 — The maximum Z-layer for canvas items.
  • MAX_GLOW_LEVELS = 7
  • MAX_CURSORS = 8
  • MATERIAL_RENDER_PRIORITY_MIN = -128 — The minimum renderpriority of all materials.
  • MATERIAL_RENDER_PRIORITY_MAX = 127 — The maximum renderpriority of all materials.

Description

Server for anything visible. The visual server is the API backend for everything visible. The whole scene system mounts on it to display.

The visual server is completely opaque, the internals are entirely implementation specific and cannot be accessed.

Method Descriptions

  • void black_bars_set_images ( RID left, RID top, RID right, RID bottom )

Sets images to be rendered in the window margin.


  • void black_bars_set_margins ( int left, int top, int right, int bottom )

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


  • RID camera_create ( )

  • void camera_set_cull_mask ( RID camera, int layers )

  • void camera_set_environment ( RID camera, RID env )


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

  • void camera_set_transform ( RID camera, Transform transform )

  • void camera_set_use_vertical_aspect ( RID camera, bool enable )

  • RID canvas_create ( )

Creates a canvas and returns the assigned RID.


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


  • void canvas_item_add_clip_ignore ( RID item, bool ignore )

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


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


  • void canvas_item_add_mesh ( RID item, RID mesh, RID texture, RID normal_map )

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


  • void canvas_item_add_multimesh ( RID item, RID mesh, RID texture, RID normal_map )

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


Adds a nine patch image to the CanvasItem’s draw commands.

See NinePatchRect for more explanation.


  • void canvas_item_add_particles ( RID item, RID particles, RID texture, RID normal_map )

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


Adds a polygon to the CanvasItem’s draw commands.


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


Adds a primitive to the CanvasItem’s draw commands.


Adds a rectangle to the CanvasItem’s draw commands.


  • void canvas_item_add_set_transform ( RID item, Transform2D transform )

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

This sets the extra_matrix uniform when executed. This affects the later commands of the canvas item.


  • 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, RID normal_map )

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


  • 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, RID normal_map, bool clip_uv=true )

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



  • void canvas_item_clear ( RID item )

Clears the CanvasItem and removes all commands in it.


  • RID canvas_item_create ( )

Creates a new CanvasItem and returns its RID.


  • void canvas_item_set_clip ( RID item, bool clip )

Sets clipping for the CanvasItem.


  • void canvas_item_set_copy_to_backbuffer ( RID item, bool enabled, Rect2 rect )

Sets the CanvasItem to copy a rect to the backbuffer.


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

Defines a custom drawing rectangle for the CanvasItem.


  • void canvas_item_set_distance_field_mode ( RID item, bool enabled )

  • void canvas_item_set_draw_behind_parent ( RID item, bool enabled )

Sets CanvasItem to be drawn behind its parent.


  • void canvas_item_set_draw_index ( RID item, int index )

Sets the index for the CanvasItem.


  • void canvas_item_set_light_mask ( RID item, int mask )

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


  • void canvas_item_set_material ( RID item, RID material )

Sets a new material to the CanvasItem.


  • void canvas_item_set_modulate ( RID item, Color color )

Sets the color that modulates the CanvasItem and its children.


  • void canvas_item_set_parent ( RID item, RID parent )

Sets the parent for the CanvasItem.


  • void canvas_item_set_self_modulate ( RID item, Color color )

Sets the color that modulates the CanvasItem without children.


  • void canvas_item_set_sort_children_by_y ( RID item, bool enabled )

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


Sets the CanvasItem’s Transform2D.


  • void canvas_item_set_use_parent_material ( RID item, bool enabled )

Sets if the CanvasItem uses its parent’s material.


  • void canvas_item_set_visible ( RID item, bool visible )

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


  • void canvas_item_set_z_as_relative_to_parent ( RID item, bool enabled )

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


  • void canvas_item_set_z_index ( RID item, int z_index )

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


  • void canvas_light_attach_to_canvas ( RID light, RID canvas )

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


  • RID canvas_light_create ( )

Creates a canvas light.


  • void canvas_light_occluder_attach_to_canvas ( RID occluder, RID canvas )

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


  • RID canvas_light_occluder_create ( )

Creates a light occluder.


  • void canvas_light_occluder_set_enabled ( RID occluder, bool enabled )

Enables or disables light occluder.


  • void canvas_light_occluder_set_light_mask ( RID occluder, int mask )

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


  • void canvas_light_occluder_set_polygon ( RID occluder, RID polygon )

Sets a light occluder’s polygon.


  • void canvas_light_occluder_set_transform ( RID occluder, Transform2D transform )

Sets a light occluder’s Transform2D.


  • void canvas_light_set_color ( RID light, Color color )

Sets the color for a light.


  • void canvas_light_set_enabled ( RID light, bool enabled )

Enables or disables a canvas light.


  • void canvas_light_set_energy ( RID light, float energy )

Sets a canvas light’s energy.


  • void canvas_light_set_height ( RID light, float height )

Sets a canvas light’s height.


  • void canvas_light_set_item_cull_mask ( RID light, int mask )

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


  • void canvas_light_set_item_shadow_cull_mask ( RID light, int mask )

The shadow mask. binary about which layers this canvas light affects which canvas item’s shadows. See LightOccluder2D for more information on light masks.


  • void canvas_light_set_layer_range ( RID light, int min_layer, int max_layer )

The layer range that gets rendered with this light.


The mode of the light, see CANVAS_LIGHT_MODE_* constants.


  • void canvas_light_set_scale ( RID light, float scale )

  • void canvas_light_set_shadow_buffer_size ( RID light, int size )

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


  • void canvas_light_set_shadow_color ( RID light, Color color )

Sets the color of the canvas light’s shadow.


  • void canvas_light_set_shadow_enabled ( RID light, bool enabled )

Enables or disables the canvas light’s shadow.


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


  • void canvas_light_set_shadow_gradient_length ( RID light, float length )

Sets the length of the shadow’s gradient.


  • void canvas_light_set_shadow_smooth ( RID light, float smooth )

Smoothens the shadow. The lower, the more smooth.


  • void canvas_light_set_texture ( RID light, RID texture )

  • void canvas_light_set_texture_offset ( RID light, Vector2 offset )

Sets the canvas light’s Transform2D.


  • void canvas_light_set_z_range ( RID light, int min_z, int max_z )

  • RID canvas_occluder_polygon_create ( )

Creates a new light occluder polygon.


Sets an occluder polygons cull mode. See CANVAS_OCCLUDER_POLYGON_CULL_MODE_* constants.


Sets the shape of the occluder polygon.


  • void canvas_occluder_polygon_set_shape_as_lines ( RID occluder_polygon, PoolVector2Array shape )

Sets the shape of the occluder polygon as lines.


  • void canvas_set_item_mirroring ( RID canvas, RID item, Vector2 mirroring )

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


  • void canvas_set_modulate ( RID canvas, Color color )

Modulates all colors in the given canvas.


  • RID directional_light_create ( )

  • void draw ( bool swap_buffers=true, float frame_step=0.0 )

  • RID environment_create ( )


  • void environment_set_ambient_light ( RID env, Color color, float energy=1.0, float sky_contibution=0.0 )


  • void environment_set_bg_color ( RID env, Color color )

  • void environment_set_bg_energy ( RID env, float energy )

  • void environment_set_canvas_max_layer ( RID env, int max_layer )





  • void environment_set_fog_height ( RID env, bool enable, float min_height, float max_height, float height_curve )


  • 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 finish ( )

Removes buffers and clears testcubes.


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

  • void force_sync ( )

Synchronizes threads.


  • void free_rid ( RID rid )

Tries to free an object in the VisualServer.


Returns a certain information, see RENDER_INFO_* for options.


  • RID get_test_cube ( )

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


  • RID get_test_texture ( )

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


  • RID get_white_texture ( )

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


  • RID gi_probe_create ( )

  • float gi_probe_get_bias ( RID probe ) const

  • AABB gi_probe_get_bounds ( RID probe ) const

  • float gi_probe_get_cell_size ( RID probe ) const


  • int gi_probe_get_dynamic_range ( RID probe ) const

  • float gi_probe_get_energy ( RID probe ) const

  • float gi_probe_get_normal_bias ( RID probe ) const

  • float gi_probe_get_propagation ( RID probe ) const


  • bool gi_probe_is_compressed ( RID probe ) const

  • bool gi_probe_is_interior ( RID probe ) const

  • void gi_probe_set_bias ( RID probe, float bias )

  • void gi_probe_set_bounds ( RID probe, AABB bounds )

  • void gi_probe_set_cell_size ( RID probe, float range )

  • void gi_probe_set_compress ( RID probe, bool enable )


  • void gi_probe_set_dynamic_range ( RID probe, int range )

  • void gi_probe_set_energy ( RID probe, float energy )

  • void gi_probe_set_interior ( RID probe, bool enable )

  • void gi_probe_set_normal_bias ( RID probe, float bias )

  • void gi_probe_set_propagation ( RID probe, float propagation )

  • void gi_probe_set_to_cell_xform ( RID probe, Transform xform )

  • bool has_changed ( ) const

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



Returns true if the OS supports a certain feature. Features might be s3tc, etc, etc2 and pvrtc,



  • void immediate_clear ( RID immediate )

  • void immediate_color ( RID immediate, Color color )

  • RID immediate_create ( )

  • void immediate_end ( RID immediate )

  • RID immediate_get_material ( RID immediate ) const

  • void immediate_normal ( RID immediate, Vector3 normal )

  • void immediate_set_material ( RID immediate, RID material )

  • void immediate_tangent ( RID immediate, Plane tangent )

  • void immediate_uv ( RID immediate, Vector2 tex_uv )

  • void immediate_uv2 ( RID immediate, Vector2 tex_uv )

  • void immediate_vertex ( RID immediate, Vector3 vertex )

  • void immediate_vertex_2d ( RID immediate, Vector2 vertex )

  • void init ( )

Initializes the visual server.


  • 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 )

  • void instance_geometry_set_as_instance_lod ( RID instance, RID as_lod_of_instance )




  • void instance_geometry_set_material_override ( RID instance, RID material )

  • 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_exterior ( RID instance, bool enabled )

  • void instance_set_extra_visibility_margin ( RID instance, float margin )

  • void instance_set_layer_mask ( RID instance, int mask )

  • void instance_set_scenario ( RID instance, RID scenario )

  • void instance_set_surface_material ( RID instance, int surface, RID material )

  • void instance_set_transform ( RID instance, Transform transform )

  • void instance_set_use_lightmap ( RID instance, RID lightmap_instance, RID lightmap )

  • void instance_set_visible ( RID instance, bool visible )

  • Array instances_cull_aabb ( AABB aabb, RID scenario ) const

  • Array instances_cull_convex ( Array convex, RID scenario ) const

Returns an array of object IDs intersecting with the provided 3D ray. Only visual 3D nodes are considered, such as MeshInstance or DirectionalLight. Use @GDScript.instance_from_id to obtain the actual nodes. A scenario RID must be provided, which is available in the World you want to query.

Warning: this function is primarily intended for editor usage. For in-game use cases, prefer physics collision.


  • void light_directional_set_blend_splits ( RID light, bool enable )





  • void light_set_color ( RID light, Color color )

  • void light_set_cull_mask ( RID light, int mask )

  • void light_set_negative ( RID light, bool enable )


  • 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 )

  • void light_set_shadow_color ( RID light, Color color )

  • RID lightmap_capture_create ( )

  • AABB lightmap_capture_get_bounds ( RID capture ) const

  • float lightmap_capture_get_energy ( RID capture ) const


  • int lightmap_capture_get_octree_cell_subdiv ( RID capture ) const

  • Transform lightmap_capture_get_octree_cell_transform ( RID capture ) const

  • void lightmap_capture_set_bounds ( RID capture, AABB bounds )

  • void lightmap_capture_set_energy ( RID capture, float energy )


  • void lightmap_capture_set_octree_cell_subdiv ( RID capture, int subdiv )

  • void lightmap_capture_set_octree_cell_transform ( RID capture, Transform xform )

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


  • RID material_create ( )

Returns an empty material.


Returns the value of a certain material’s parameter.



  • RID material_get_shader ( RID shader_material ) const

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


  • void material_set_line_width ( RID material, float width )

Sets a materials line width.


  • void material_set_next_pass ( RID material, RID next_material )

Sets an objects next material.


Sets a materials parameter.


  • void material_set_render_priority ( RID material, int priority )

Sets a material’s render priority.


  • void material_set_shader ( RID shader_material, RID shader )

Sets a shader material’s shader.


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


  • void mesh_clear ( RID mesh )

Removes all surfaces from a mesh.


  • RID mesh_create ( )

Creates a new mesh.


  • int mesh_get_blend_shape_count ( RID mesh ) const

Returns a mesh’s blend shape count.


Returns a mesh’s blend shape mode.


  • AABB mesh_get_custom_aabb ( RID mesh ) const

Returns a mesh’s custom aabb.


  • int mesh_get_surface_count ( RID mesh ) const

Returns a mesh’s number of surfaces.


  • void mesh_remove_surface ( RID mesh, int index )

Removes a mesh’s surface.


  • void mesh_set_blend_shape_count ( RID mesh, int amount )

Sets a mesh’s blend shape count.


Sets a mesh’s blend shape mode.


  • void mesh_set_custom_aabb ( RID mesh, AABB aabb )

Sets a mesh’s custom aabb.


  • AABB mesh_surface_get_aabb ( RID mesh, int surface ) const

Returns a mesh’s surface’s aabb.


Returns a mesh’s surface’s vertex buffer.


  • int mesh_surface_get_array_index_len ( RID mesh, int surface ) const

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


  • int mesh_surface_get_array_len ( RID mesh, int surface ) const

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


  • Array mesh_surface_get_arrays ( RID mesh, int surface ) const

Returns a mesh’s surface’s buffer arrays.


  • Array mesh_surface_get_blend_shape_arrays ( RID mesh, int surface ) const

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


  • int mesh_surface_get_format ( RID mesh, int surface ) const

Returns the format of a mesh’s surface.


  • int mesh_surface_get_format_offset ( int format, int vertex_len, int index_len, int array_index ) const

  • int mesh_surface_get_format_stride ( int format, int vertex_len, int index_len ) const

Returns a mesh’s surface’s index buffer.


  • RID mesh_surface_get_material ( RID mesh, int surface ) const

Returns a mesh’s surface’s material.


Returns the primitive type of a mesh’s surface.


  • Array mesh_surface_get_skeleton_aabb ( RID mesh, int surface ) const

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


  • void mesh_surface_set_material ( RID mesh, int surface, RID material )

Sets a mesh’s surface’s material.




  • AABB multimesh_get_aabb ( RID multimesh ) const

  • int multimesh_get_instance_count ( RID multimesh ) const

  • RID multimesh_get_mesh ( RID multimesh ) const

  • int multimesh_get_visible_instances ( RID multimesh ) const

  • Color multimesh_instance_get_color ( RID multimesh, int index ) const

  • Color multimesh_instance_get_custom_data ( RID multimesh, int index ) const

  • Transform multimesh_instance_get_transform ( RID multimesh, int index ) const


  • void multimesh_instance_set_color ( RID multimesh, int index, Color color )

  • void multimesh_instance_set_custom_data ( RID multimesh, int index, Color custom_data )

  • void multimesh_instance_set_transform ( RID multimesh, int index, Transform transform )

  • void multimesh_instance_set_transform_2d ( RID multimesh, int index, Transform2D transform )


  • void multimesh_set_mesh ( RID multimesh, RID mesh )

  • void multimesh_set_visible_instances ( RID multimesh, int visible )

  • RID omni_light_create ( )

  • RID particles_create ( )

  • AABB particles_get_current_aabb ( RID particles )

  • bool particles_get_emitting ( RID particles )

  • void particles_restart ( RID particles )

  • void particles_set_amount ( RID particles, int amount )

  • void particles_set_custom_aabb ( RID particles, AABB aabb )


  • void particles_set_draw_pass_mesh ( RID particles, int pass, RID mesh )

  • void particles_set_draw_passes ( RID particles, int count )

  • void particles_set_emission_transform ( RID particles, Transform transform )

  • void particles_set_emitting ( RID particles, bool emitting )

  • void particles_set_explosiveness_ratio ( RID particles, float ratio )

  • void particles_set_fixed_fps ( RID particles, int fps )

  • void particles_set_fractional_delta ( RID particles, bool enable )

  • void particles_set_lifetime ( RID particles, float lifetime )

  • void particles_set_one_shot ( RID particles, bool one_shot )

  • void particles_set_pre_process_time ( RID particles, float time )

  • void particles_set_process_material ( RID particles, RID material )

  • void particles_set_randomness_ratio ( RID particles, float ratio )

  • void particles_set_speed_scale ( RID particles, float scale )

  • void particles_set_use_local_coordinates ( RID particles, bool enable )

  • RID reflection_probe_create ( )

  • void reflection_probe_set_as_interior ( RID probe, bool enable )

  • void reflection_probe_set_cull_mask ( RID probe, int layers )

  • void reflection_probe_set_enable_box_projection ( RID probe, bool enable )

  • void reflection_probe_set_enable_shadows ( RID probe, bool enable )

  • void reflection_probe_set_extents ( RID probe, Vector3 extents )

  • void reflection_probe_set_intensity ( RID probe, float intensity )

  • void reflection_probe_set_interior_ambient ( RID probe, Color color )

  • void reflection_probe_set_interior_ambient_energy ( RID probe, float energy )

  • void reflection_probe_set_interior_ambient_probe_contribution ( RID probe, float contrib )

  • void reflection_probe_set_max_distance ( RID probe, float distance )

  • void reflection_probe_set_origin_offset ( RID probe, Vector3 offset )


Schedules a callback to the corresponding named ‘method’ on ‘where’ after a frame has been drawn.

The callback method must use only 1 argument which will be called with ‘userdata’.


  • RID scenario_create ( )


  • void scenario_set_environment ( RID scenario, RID environment )

  • void scenario_set_fallback_environment ( RID scenario, RID environment )

  • void scenario_set_reflection_atlas_size ( RID scenario, int size, int subdiv )

Sets a boot image. The color defines the background color and if scale is true the image will be scaled to fit the screen size.


  • void set_debug_generate_wireframes ( bool generate )

  • void set_default_clear_color ( Color color )

  • RID shader_create ( )

Creates an empty shader.


Returns a shader’s code.


  • RID shader_get_default_texture_param ( RID shader, String name ) const

Returns a default texture from a shader searched by name.


  • Array shader_get_param_list ( RID shader ) const

Returns the parameters of a shader.


  • void shader_set_code ( RID shader, String code )

Sets a shader’s code.


  • void shader_set_default_texture_param ( RID shader, String name, RID texture )

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


  • void skeleton_allocate ( RID skeleton, int bones, bool is_2d_skeleton=false )



  • void skeleton_bone_set_transform ( RID skeleton, int bone, Transform transform )

  • void skeleton_bone_set_transform_2d ( RID skeleton, int bone, Transform2D transform )

  • RID skeleton_create ( )

  • int skeleton_get_bone_count ( RID skeleton ) const

  • RID sky_create ( )

Creates an empty sky.


  • void sky_set_texture ( RID sky, RID cube_map, int radiance_size )

Sets a sky’s texture.


  • RID spot_light_create ( )

  • void sync ( )


  • RID texture_create ( )

Creates an empty texture.


  • RID texture_create_from_image ( Image image, int flags=7 )

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


  • Array texture_debug_usage ( )

Returns a list of all the textures and their information.


  • Image texture_get_data ( RID texture, int cube_side=0 ) const

Returns a copy of a texture’s image unless it’s a CubeMap, in which case it returns the RID of the image at one of the cubes sides.


  • int texture_get_depth ( RID texture ) const

  • int texture_get_flags ( RID texture ) const

Returns the flags of a texture.


  • Format texture_get_format ( RID texture ) const

Returns the format of the texture’s image.


  • int texture_get_height ( RID texture ) const

Returns the texture’s height.


  • String texture_get_path ( RID texture ) const

Returns the texture’s path.


  • int texture_get_texid ( RID texture ) const

Returns the opengl id of the texture’s image.



  • int texture_get_width ( RID texture ) const

Returns the texture’s width.


  • void texture_set_data ( RID texture, Image image, int layer=0 )

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



  • void texture_set_flags ( RID texture, int flags )

Sets the texture’s flags. See TextureFlags for options


  • void texture_set_path ( RID texture, String path )

Sets the texture’s path.


  • void texture_set_shrink_all_x2_on_set_data ( bool shrink )

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


  • void texture_set_size_override ( RID texture, int width, int height, int depth )

  • void textures_keep_original ( bool enable )

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


  • void viewport_attach_camera ( RID viewport, RID camera )

Sets a viewport’s camera.


  • void viewport_attach_canvas ( RID viewport, RID canvas )

Sets a viewport’s canvas.


  • void viewport_attach_to_screen ( RID viewport, Rect2 rect=Rect2( 0, 0, 0, 0 ), int screen=0 )

Attaches a viewport to a screen.


  • RID viewport_create ( )

Creates an empty viewport.


  • void viewport_detach ( RID viewport )

Detaches the viewport from the screen.


Returns a viewport’s render info. for options see VIEWPORT_RENDER_INFO* constants.


  • RID viewport_get_texture ( RID viewport ) const

Returns the viewport’s last rendered frame.


  • void viewport_remove_canvas ( RID viewport, RID canvas )

Detaches a viewport from a canvas and vice versa.


  • void viewport_set_active ( RID viewport, bool active )

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


  • void viewport_set_canvas_stacking ( RID viewport, RID canvas, int layer, int sublayer )

Sets the stacking order for a viewport’s canvas.

layer is the actual canvas layer, while sublayer specifies the stacking order of the canvas among those in the same layer.


Sets the transformation of a viewport’s canvas.


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


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


  • void viewport_set_disable_3d ( RID viewport, bool disabled )

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


  • void viewport_set_disable_environment ( RID viewport, bool disabled )

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


  • void viewport_set_global_canvas_transform ( RID viewport, Transform2D transform )

Sets the viewport’s global transformation matrix.


  • void viewport_set_hdr ( RID viewport, bool enabled )

If true, the viewport renders to hdr.


  • void viewport_set_hide_canvas ( RID viewport, bool hidden )

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


  • void viewport_set_hide_scenario ( RID viewport, bool hidden )

Sets the anti-aliasing mode. see ViewportMSAA for options.


  • void viewport_set_parent_viewport ( RID viewport, RID parent_viewport )

Sets the viewport’s parent to another viewport.


  • void viewport_set_scenario ( RID viewport, RID scenario )

Sets a viewport’s scenario.

The scenario contains information about the ScenarioDebugMode, environment information, reflection atlas etc.


  • void viewport_set_shadow_atlas_quadrant_subdivision ( RID viewport, int quadrant, int subdivision )

Sets the shadow atlas quadrant’s subdivision.


  • void viewport_set_shadow_atlas_size ( RID viewport, int size )

Sets the size of the shadow atlas’s images.


  • void viewport_set_size ( RID viewport, int width, int height )

Sets the viewport’s width and height.


  • void viewport_set_transparent_background ( RID viewport, bool enabled )

If true, the viewport renders its background as transparent.


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


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


  • void viewport_set_use_arvr ( RID viewport, bool use_arvr )

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


  • void viewport_set_vflip ( RID viewport, bool enabled )

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