Path: blob/master/servers/rendering/rendering_server_default.h
20907 views
/**************************************************************************/1/* rendering_server_default.h */2/**************************************************************************/3/* This file is part of: */4/* GODOT ENGINE */5/* https://godotengine.org */6/**************************************************************************/7/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */8/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */9/* */10/* Permission is hereby granted, free of charge, to any person obtaining */11/* a copy of this software and associated documentation files (the */12/* "Software"), to deal in the Software without restriction, including */13/* without limitation the rights to use, copy, modify, merge, publish, */14/* distribute, sublicense, and/or sell copies of the Software, and to */15/* permit persons to whom the Software is furnished to do so, subject to */16/* the following conditions: */17/* */18/* The above copyright notice and this permission notice shall be */19/* included in all copies or substantial portions of the Software. */20/* */21/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */22/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */23/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */24/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */25/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */26/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */27/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */28/**************************************************************************/2930#pragma once3132#include "core/object/worker_thread_pool.h"33#include "core/os/thread.h"34#include "core/templates/command_queue_mt.h"35#include "core/templates/hash_map.h"36#include "renderer_canvas_cull.h"37#include "renderer_viewport.h"38#include "rendering_server_globals.h"39#include "servers/rendering/renderer_compositor.h"40#include "servers/rendering/rendering_server.h"41#include "servers/server_wrap_mt_common.h"4243class RenderingServerDefault : public RenderingServer {44GDSOFTCLASS(RenderingServerDefault, RenderingServer);4546enum {47MAX_INSTANCE_CULL = 8192,48MAX_INSTANCE_LIGHTS = 4,49LIGHT_CACHE_DIRTY = -1,50MAX_LIGHTS_CULLED = 256,51MAX_ROOM_CULL = 32,52MAX_EXTERIOR_PORTALS = 128,53MAX_LIGHT_SAMPLERS = 256,54INSTANCE_ROOMLESS_MASK = (1 << 20)5556};5758static int changes;59RID test_cube;6061List<Callable> frame_drawn_callbacks;6263static void _changes_changed() {}6465uint64_t frame_profile_frame = 0;66Vector<FrameProfileArea> frame_profile;6768double frame_setup_time = 0;6970//for printing71bool print_gpu_profile = false;72HashMap<String, float> print_gpu_profile_task_time;73uint64_t print_frame_profile_ticks_from = 0;74uint32_t print_frame_profile_frame_count = 0;7576mutable CommandQueueMT command_queue;7778Thread::ID server_thread = Thread::MAIN_ID;79WorkerThreadPool::TaskID server_task_id = WorkerThreadPool::INVALID_TASK_ID;80bool exit = false;81bool create_thread = false;8283void _assign_mt_ids(WorkerThreadPool::TaskID p_pump_task_id);84void _thread_exit();85void _thread_loop();8687void _draw(bool p_swap_buffers, double frame_step);88void _run_post_draw_steps();89void _init();90void _finish();9192void _free(RID p_rid);9394void _call_on_render_thread(const Callable &p_callable);9596public:97//if editor is redrawing when it shouldn't, enable this and put a breakpoint in _changes_changed()98//#define DEBUG_CHANGES99100#ifdef DEBUG_CHANGES101_FORCE_INLINE_ static void redraw_request() {102changes++;103_changes_changed();104}105106#else107_FORCE_INLINE_ static void redraw_request() {108changes++;109}110#endif111112#define WRITE_ACTION redraw_request();113#define ASYNC_COND_PUSH (Thread::get_caller_id() != server_thread)114#define ASYNC_COND_PUSH_AND_RET (Thread::get_caller_id() != server_thread)115#define ASYNC_COND_PUSH_AND_SYNC (Thread::get_caller_id() != server_thread)116117#ifdef DEBUG_SYNC118#define SYNC_DEBUG print_line("sync on: " + String(__FUNCTION__));119#else120#define SYNC_DEBUG121#endif122123#ifdef DEBUG_ENABLED124#define MAIN_THREAD_SYNC_WARN WARN_PRINT("Call to " + String(__FUNCTION__) + " causing RenderingServer synchronizations on every frame. This significantly affects performance.");125#endif126127/* TEXTURE API */128129#define ServerName RendererTextureStorage130#define server_name RSG::texture_storage131132#define FUNCRIDTEX0(m_type) \133virtual RID m_type##_create() override { \134RID ret = RSG::texture_storage->texture_allocate(); \135if (Thread::get_caller_id() == server_thread || RSG::rasterizer->can_create_resources_async()) { \136RSG::texture_storage->m_type##_initialize(ret); \137} else { \138command_queue.push(RSG::texture_storage, &RendererTextureStorage::m_type##_initialize, ret); \139} \140return ret; \141}142143#define FUNCRIDTEX1(m_type, m_type1) \144virtual RID m_type##_create(m_type1 p1) override { \145RID ret = RSG::texture_storage->texture_allocate(); \146if (Thread::get_caller_id() == server_thread || RSG::rasterizer->can_create_resources_async()) { \147RSG::texture_storage->m_type##_initialize(ret, p1); \148} else { \149command_queue.push(RSG::texture_storage, &RendererTextureStorage::m_type##_initialize, ret, p1); \150} \151return ret; \152}153154#define FUNCRIDTEX2(m_type, m_type1, m_type2) \155virtual RID m_type##_create(m_type1 p1, m_type2 p2) override { \156RID ret = RSG::texture_storage->texture_allocate(); \157if (Thread::get_caller_id() == server_thread || RSG::rasterizer->can_create_resources_async()) { \158RSG::texture_storage->m_type##_initialize(ret, p1, p2); \159} else { \160command_queue.push(RSG::texture_storage, &RendererTextureStorage::m_type##_initialize, ret, p1, p2); \161} \162return ret; \163}164165#define FUNCRIDTEX3(m_type, m_type1, m_type2, m_type3) \166virtual RID m_type##_create(m_type1 p1, m_type2 p2, m_type3 p3) override { \167RID ret = RSG::texture_storage->texture_allocate(); \168if (Thread::get_caller_id() == server_thread || RSG::rasterizer->can_create_resources_async()) { \169RSG::texture_storage->m_type##_initialize(ret, p1, p2, p3); \170} else { \171command_queue.push(RSG::texture_storage, &RendererTextureStorage::m_type##_initialize, ret, p1, p2, p3); \172} \173return ret; \174}175176#define FUNCRIDTEX4(m_type, m_type1, m_type2, m_type3, m_type4) \177virtual RID m_type##_create(m_type1 p1, m_type2 p2, m_type3 p3, m_type4 p4) override { \178RID ret = RSG::texture_storage->texture_allocate(); \179if (Thread::get_caller_id() == server_thread || RSG::rasterizer->can_create_resources_async()) { \180RSG::texture_storage->m_type##_initialize(ret, p1, p2, p3, p4); \181} else { \182command_queue.push(RSG::texture_storage, &RendererTextureStorage::m_type##_initialize, ret, p1, p2, p3, p4); \183} \184return ret; \185}186187#define FUNCRIDTEX5(m_type, m_type1, m_type2, m_type3, m_type4, m_type5) \188virtual RID m_type##_create(m_type1 p1, m_type2 p2, m_type3 p3, m_type4 p4, m_type5 p5) override { \189RID ret = RSG::texture_storage->texture_allocate(); \190if (Thread::get_caller_id() == server_thread || RSG::rasterizer->can_create_resources_async()) { \191RSG::texture_storage->m_type##_initialize(ret, p1, p2, p3, p4, p5); \192} else { \193command_queue.push(RSG::texture_storage, &RendererTextureStorage::m_type##_initialize, ret, p1, p2, p3, p4, p5); \194} \195return ret; \196}197198#define FUNCRIDTEX6(m_type, m_type1, m_type2, m_type3, m_type4, m_type5, m_type6) \199virtual RID m_type##_create(m_type1 p1, m_type2 p2, m_type3 p3, m_type4 p4, m_type5 p5, m_type6 p6) override { \200RID ret = RSG::texture_storage->texture_allocate(); \201if (Thread::get_caller_id() == server_thread || RSG::rasterizer->can_create_resources_async()) { \202RSG::texture_storage->m_type##_initialize(ret, p1, p2, p3, p4, p5, p6); \203} else { \204command_queue.push(RSG::texture_storage, &RendererTextureStorage::m_type##_initialize, ret, p1, p2, p3, p4, p5, p6); \205} \206return ret; \207}208209//these go pass-through, as they can be called from any thread210FUNCRIDTEX1(texture_2d, const Ref<Image> &)211FUNCRIDTEX2(texture_2d_layered, const Vector<Ref<Image>> &, TextureLayeredType)212FUNCRIDTEX6(texture_3d, Image::Format, int, int, int, bool, const Vector<Ref<Image>> &)213FUNCRIDTEX3(texture_external, int, int, uint64_t)214FUNCRIDTEX1(texture_proxy, RID)215FUNCRIDTEX5(texture_drawable, int, int, TextureDrawableFormat, const Color &, bool)216217// Called directly, not through the command queue.218virtual RID texture_create_from_native_handle(TextureType p_type, Image::Format p_format, uint64_t p_native_handle, int p_width, int p_height, int p_depth, int p_layers = 1, TextureLayeredType p_layered_type = TEXTURE_LAYERED_2D_ARRAY) override {219return RSG::texture_storage->texture_create_from_native_handle(p_type, p_format, p_native_handle, p_width, p_height, p_depth, p_layers, p_layered_type);220}221222//these go through command queue if they are in another thread223FUNC3(texture_2d_update, RID, const Ref<Image> &, int)224FUNC2(texture_3d_update, RID, const Vector<Ref<Image>> &)225FUNC4(texture_external_update, RID, int, int, uint64_t)226FUNC2(texture_proxy_update, RID, RID)227228FUNC6(texture_drawable_blit_rect, const TypedArray<RID> &, const Rect2i &, RID, const Color &, const TypedArray<RID> &, int)229230//these also go pass-through231FUNCRIDTEX0(texture_2d_placeholder)232FUNCRIDTEX1(texture_2d_layered_placeholder, TextureLayeredType)233FUNCRIDTEX0(texture_3d_placeholder)234235FUNC1RC(Ref<Image>, texture_2d_get, RID)236FUNC2RC(Ref<Image>, texture_2d_layer_get, RID, int)237FUNC1RC(Vector<Ref<Image>>, texture_3d_get, RID)238239FUNC1(texture_drawable_generate_mipmaps, RID)240FUNC0RC(RID, texture_drawable_get_default_material)241242FUNC2(texture_replace, RID, RID)243244FUNC3(texture_set_size_override, RID, int, int)245// FIXME: Disabled during Vulkan refactoring, should be ported.246#if 0247FUNC2(texture_bind, RID, uint32_t)248#endif249250FUNC3(texture_set_detect_3d_callback, RID, TextureDetectCallback, void *)251FUNC3(texture_set_detect_normal_callback, RID, TextureDetectCallback, void *)252FUNC3(texture_set_detect_roughness_callback, RID, TextureDetectRoughnessCallback, void *)253254FUNC2(texture_set_path, RID, const String &)255FUNC1RC(String, texture_get_path, RID)256257FUNC1RC(Image::Format, texture_get_format, RID)258259FUNC1(texture_debug_usage, List<TextureInfo> *)260261FUNC2(texture_set_force_redraw_if_visible, RID, bool)262FUNCRIDTEX2(texture_rd, const RID &, const RS::TextureLayeredType)263FUNC2RC(RID, texture_get_rd_texture, RID, bool)264FUNC2RC(uint64_t, texture_get_native_handle, RID, bool)265266/* SHADER API */267268#undef ServerName269#undef server_name270271#define ServerName RendererMaterialStorage272#define server_name RSG::material_storage273274virtual RID shader_create() override {275RID ret = RSG::material_storage->shader_allocate();276if (Thread::get_caller_id() == server_thread) {277RSG::material_storage->shader_initialize(ret, false);278} else {279command_queue.push(RSG::material_storage, &ServerName::shader_initialize, ret, false);280}281return ret;282}283284virtual RID shader_create_from_code(const String &p_code, const String &p_path_hint = String()) override {285RID shader = RSG::material_storage->shader_allocate();286bool using_server_thread = Thread::get_caller_id() == server_thread;287if (using_server_thread || RSG::rasterizer->can_create_resources_async()) {288if (using_server_thread) {289command_queue.flush_if_pending();290}291292RSG::material_storage->shader_initialize(shader, false);293RSG::material_storage->shader_set_path_hint(shader, p_path_hint);294RSG::material_storage->shader_set_code(shader, p_code);295} else {296command_queue.push(RSG::material_storage, &RendererMaterialStorage::shader_initialize, shader, false);297command_queue.push(RSG::material_storage, &RendererMaterialStorage::shader_set_code, shader, p_code);298command_queue.push(RSG::material_storage, &RendererMaterialStorage::shader_set_path_hint, shader, p_path_hint);299}300301return shader;302}303304FUNC2(shader_set_code, RID, const String &)305FUNC2(shader_set_path_hint, RID, const String &)306FUNC1RC(String, shader_get_code, RID)307308FUNC2SC(get_shader_parameter_list, RID, List<PropertyInfo> *)309310FUNC4(shader_set_default_texture_parameter, RID, const StringName &, RID, int)311FUNC3RC(RID, shader_get_default_texture_parameter, RID, const StringName &, int)312FUNC2RC(Variant, shader_get_parameter_default, RID, const StringName &)313314FUNC1RC(ShaderNativeSourceCode, shader_get_native_source_code, RID)315316/* COMMON MATERIAL API */317318FUNCRIDSPLIT(material)319320virtual RID material_create_from_shader(RID p_next_pass, int p_render_priority, RID p_shader) override {321RID material = RSG::material_storage->material_allocate();322bool using_server_thread = Thread::get_caller_id() == server_thread;323if (using_server_thread || RSG::rasterizer->can_create_resources_async()) {324if (using_server_thread) {325command_queue.flush_if_pending();326}327328RSG::material_storage->material_initialize(material);329RSG::material_storage->material_set_next_pass(material, p_next_pass);330RSG::material_storage->material_set_render_priority(material, p_render_priority);331RSG::material_storage->material_set_shader(material, p_shader);332} else {333command_queue.push(RSG::material_storage, &RendererMaterialStorage::material_initialize, material);334command_queue.push(RSG::material_storage, &RendererMaterialStorage::material_set_next_pass, material, p_next_pass);335command_queue.push(RSG::material_storage, &RendererMaterialStorage::material_set_render_priority, material, p_render_priority);336command_queue.push(RSG::material_storage, &RendererMaterialStorage::material_set_shader, material, p_shader);337}338339return material;340}341342FUNC2(material_set_shader, RID, RID)343344FUNC3(material_set_param, RID, const StringName &, const Variant &)345FUNC2RC(Variant, material_get_param, RID, const StringName &)346347FUNC2(material_set_render_priority, RID, int)348FUNC2(material_set_next_pass, RID, RID)349350/* MESH API */351352//from now on, calls forwarded to this singleton353#undef ServerName354#undef server_name355356#define ServerName RendererMeshStorage357#define server_name RSG::mesh_storage358359virtual RID mesh_create_from_surfaces(const Vector<SurfaceData> &p_surfaces, int p_blend_shape_count = 0) override {360RID mesh = RSG::mesh_storage->mesh_allocate();361362bool using_server_thread = Thread::get_caller_id() == server_thread;363if (using_server_thread || RSG::rasterizer->can_create_resources_async()) {364if (using_server_thread) {365command_queue.flush_if_pending();366}367RSG::mesh_storage->mesh_initialize(mesh);368RSG::mesh_storage->mesh_set_blend_shape_count(mesh, p_blend_shape_count);369for (int i = 0; i < p_surfaces.size(); i++) {370RSG::mesh_storage->mesh_add_surface(mesh, p_surfaces[i]);371}372RSG::scene->mesh_generate_pipelines(mesh, using_server_thread);373} else {374command_queue.push(RSG::mesh_storage, &RendererMeshStorage::mesh_initialize, mesh);375command_queue.push(RSG::mesh_storage, &RendererMeshStorage::mesh_set_blend_shape_count, mesh, p_blend_shape_count);376for (int i = 0; i < p_surfaces.size(); i++) {377command_queue.push(RSG::mesh_storage, &RendererMeshStorage::mesh_add_surface, mesh, p_surfaces[i]);378}379command_queue.push(RSG::scene, &RenderingMethod::mesh_generate_pipelines, mesh, true);380}381382return mesh;383}384385FUNC2(mesh_set_blend_shape_count, RID, int)386387FUNCRIDSPLIT(mesh)388389FUNC2(mesh_add_surface, RID, const SurfaceData &)390391FUNC1RC(int, mesh_get_blend_shape_count, RID)392393FUNC2(mesh_set_blend_shape_mode, RID, BlendShapeMode)394FUNC1RC(BlendShapeMode, mesh_get_blend_shape_mode, RID)395396FUNC4(mesh_surface_update_vertex_region, RID, int, int, const Vector<uint8_t> &)397FUNC4(mesh_surface_update_attribute_region, RID, int, int, const Vector<uint8_t> &)398FUNC4(mesh_surface_update_skin_region, RID, int, int, const Vector<uint8_t> &)399FUNC4(mesh_surface_update_index_region, RID, int, int, const Vector<uint8_t> &)400401FUNC3(mesh_surface_set_material, RID, int, RID)402FUNC2RC(RID, mesh_surface_get_material, RID, int)403404FUNC2RC(SurfaceData, mesh_get_surface, RID, int)405406FUNC1RC(int, mesh_get_surface_count, RID)407408FUNC2(mesh_set_custom_aabb, RID, const AABB &)409FUNC1RC(AABB, mesh_get_custom_aabb, RID)410411FUNC2(mesh_set_path, RID, const String &)412FUNC1RC(String, mesh_get_path, RID)413414FUNC2(mesh_set_shadow_mesh, RID, RID)415416FUNC2(mesh_surface_remove, RID, int)417FUNC1(mesh_clear, RID)418419FUNC1(mesh_debug_usage, List<MeshInfo> *)420421/* MULTIMESH API */422423FUNCRIDSPLIT(multimesh)424425FUNC6(multimesh_allocate_data, RID, int, MultimeshTransformFormat, bool, bool, bool)426FUNC1RC(int, multimesh_get_instance_count, RID)427428FUNC2(multimesh_set_mesh, RID, RID)429FUNC3(multimesh_instance_set_transform, RID, int, const Transform3D &)430FUNC3(multimesh_instance_set_transform_2d, RID, int, const Transform2D &)431FUNC3(multimesh_instance_set_color, RID, int, const Color &)432FUNC3(multimesh_instance_set_custom_data, RID, int, const Color &)433434FUNC2(multimesh_set_custom_aabb, RID, const AABB &)435FUNC1RC(AABB, multimesh_get_custom_aabb, RID)436437FUNC1RC(RID, multimesh_get_mesh, RID)438FUNC1RC(AABB, multimesh_get_aabb, RID)439440FUNC2RC(Transform3D, multimesh_instance_get_transform, RID, int)441FUNC2RC(Transform2D, multimesh_instance_get_transform_2d, RID, int)442FUNC2RC(Color, multimesh_instance_get_color, RID, int)443FUNC2RC(Color, multimesh_instance_get_custom_data, RID, int)444445FUNC2(multimesh_set_buffer, RID, const Vector<float> &)446FUNC1RC(RID, multimesh_get_command_buffer_rd_rid, RID)447FUNC1RC(RID, multimesh_get_buffer_rd_rid, RID)448FUNC1RC(Vector<float>, multimesh_get_buffer, RID)449450FUNC3(multimesh_set_buffer_interpolated, RID, const Vector<float> &, const Vector<float> &)451FUNC2(multimesh_set_physics_interpolated, RID, bool)452FUNC2(multimesh_set_physics_interpolation_quality, RID, MultimeshPhysicsInterpolationQuality)453FUNC2(multimesh_instance_reset_physics_interpolation, RID, int)454FUNC1(multimesh_instances_reset_physics_interpolation, RID)455456FUNC2(multimesh_set_visible_instances, RID, int)457FUNC1RC(int, multimesh_get_visible_instances, RID)458459/* SKELETON API */460461FUNCRIDSPLIT(skeleton)462FUNC3(skeleton_allocate_data, RID, int, bool)463FUNC1RC(int, skeleton_get_bone_count, RID)464FUNC3(skeleton_bone_set_transform, RID, int, const Transform3D &)465FUNC2RC(Transform3D, skeleton_bone_get_transform, RID, int)466FUNC3(skeleton_bone_set_transform_2d, RID, int, const Transform2D &)467FUNC2RC(Transform2D, skeleton_bone_get_transform_2d, RID, int)468FUNC2(skeleton_set_base_transform_2d, RID, const Transform2D &)469470/* Light API */471#undef ServerName472#undef server_name473474#define ServerName RendererLightStorage475#define server_name RSG::light_storage476477FUNCRIDSPLIT(directional_light)478FUNCRIDSPLIT(omni_light)479FUNCRIDSPLIT(spot_light)480481FUNC2(light_set_color, RID, const Color &)482FUNC3(light_set_param, RID, LightParam, float)483FUNC2(light_set_shadow, RID, bool)484FUNC2(light_set_projector, RID, RID)485FUNC2(light_set_negative, RID, bool)486FUNC2(light_set_cull_mask, RID, uint32_t)487FUNC5(light_set_distance_fade, RID, bool, float, float, float)488FUNC2(light_set_reverse_cull_face_mode, RID, bool)489FUNC2(light_set_shadow_caster_mask, RID, uint32_t)490FUNC2(light_set_bake_mode, RID, LightBakeMode)491FUNC2(light_set_max_sdfgi_cascade, RID, uint32_t)492493FUNC2(light_omni_set_shadow_mode, RID, LightOmniShadowMode)494495FUNC2(light_directional_set_shadow_mode, RID, LightDirectionalShadowMode)496FUNC2(light_directional_set_blend_splits, RID, bool)497FUNC2(light_directional_set_sky_mode, RID, LightDirectionalSkyMode)498499/* PROBE API */500501FUNCRIDSPLIT(reflection_probe)502503FUNC2(reflection_probe_set_update_mode, RID, ReflectionProbeUpdateMode)504FUNC2(reflection_probe_set_intensity, RID, float)505FUNC2(reflection_probe_set_blend_distance, RID, float)506FUNC2(reflection_probe_set_ambient_color, RID, const Color &)507FUNC2(reflection_probe_set_ambient_energy, RID, float)508FUNC2(reflection_probe_set_ambient_mode, RID, ReflectionProbeAmbientMode)509FUNC2(reflection_probe_set_max_distance, RID, float)510FUNC2(reflection_probe_set_size, RID, const Vector3 &)511FUNC2(reflection_probe_set_origin_offset, RID, const Vector3 &)512FUNC2(reflection_probe_set_as_interior, RID, bool)513FUNC2(reflection_probe_set_enable_box_projection, RID, bool)514FUNC2(reflection_probe_set_enable_shadows, RID, bool)515FUNC2(reflection_probe_set_cull_mask, RID, uint32_t)516FUNC2(reflection_probe_set_reflection_mask, RID, uint32_t)517FUNC2(reflection_probe_set_resolution, RID, int)518FUNC2(reflection_probe_set_mesh_lod_threshold, RID, float)519520/* LIGHTMAP */521522FUNCRIDSPLIT(lightmap)523524FUNC3(lightmap_set_textures, RID, RID, bool)525FUNC2(lightmap_set_probe_bounds, RID, const AABB &)526FUNC2(lightmap_set_probe_interior, RID, bool)527FUNC5(lightmap_set_probe_capture_data, RID, const PackedVector3Array &, const PackedColorArray &, const PackedInt32Array &, const PackedInt32Array &)528FUNC2(lightmap_set_baked_exposure_normalization, RID, float)529FUNC1RC(PackedVector3Array, lightmap_get_probe_capture_points, RID)530FUNC1RC(PackedColorArray, lightmap_get_probe_capture_sh, RID)531FUNC1RC(PackedInt32Array, lightmap_get_probe_capture_tetrahedra, RID)532FUNC1RC(PackedInt32Array, lightmap_get_probe_capture_bsp_tree, RID)533FUNC1(lightmap_set_probe_capture_update_speed, float)534535FUNC2(lightmap_set_shadowmask_textures, RID, RID)536FUNC1R(ShadowmaskMode, lightmap_get_shadowmask_mode, RID)537FUNC2(lightmap_set_shadowmask_mode, RID, ShadowmaskMode)538539/* Shadow Atlas */540FUNC0R(RID, shadow_atlas_create)541FUNC3(shadow_atlas_set_size, RID, int, bool)542FUNC3(shadow_atlas_set_quadrant_subdivision, RID, int, int)543544FUNC2(directional_shadow_atlas_set_size, int, bool)545546/* DECAL API */547548#undef ServerName549#undef server_name550551#define ServerName RendererTextureStorage552#define server_name RSG::texture_storage553554FUNCRIDSPLIT(decal)555556FUNC2(decal_set_size, RID, const Vector3 &)557FUNC3(decal_set_texture, RID, DecalTexture, RID)558FUNC2(decal_set_emission_energy, RID, float)559FUNC2(decal_set_albedo_mix, RID, float)560FUNC2(decal_set_modulate, RID, const Color &)561FUNC2(decal_set_cull_mask, RID, uint32_t)562FUNC4(decal_set_distance_fade, RID, bool, float, float)563FUNC3(decal_set_fade, RID, float, float)564FUNC2(decal_set_normal_fade, RID, float)565566/* BAKED LIGHT API */567568//from now on, calls forwarded to this singleton569#undef ServerName570#undef server_name571572#define ServerName RendererGI573#define server_name RSG::gi574575FUNCRIDSPLIT(voxel_gi)576577FUNC8(voxel_gi_allocate_data, RID, const Transform3D &, const AABB &, const Vector3i &, const Vector<uint8_t> &, const Vector<uint8_t> &, const Vector<uint8_t> &, const Vector<int> &)578579FUNC1RC(AABB, voxel_gi_get_bounds, RID)580FUNC1RC(Vector3i, voxel_gi_get_octree_size, RID)581FUNC1RC(Vector<uint8_t>, voxel_gi_get_octree_cells, RID)582FUNC1RC(Vector<uint8_t>, voxel_gi_get_data_cells, RID)583FUNC1RC(Vector<uint8_t>, voxel_gi_get_distance_field, RID)584FUNC1RC(Vector<int>, voxel_gi_get_level_counts, RID)585FUNC1RC(Transform3D, voxel_gi_get_to_cell_xform, RID)586587FUNC2(voxel_gi_set_dynamic_range, RID, float)588FUNC2(voxel_gi_set_propagation, RID, float)589FUNC2(voxel_gi_set_energy, RID, float)590FUNC2(voxel_gi_set_baked_exposure_normalization, RID, float)591FUNC2(voxel_gi_set_bias, RID, float)592FUNC2(voxel_gi_set_normal_bias, RID, float)593FUNC2(voxel_gi_set_interior, RID, bool)594FUNC2(voxel_gi_set_use_two_bounces, RID, bool)595596FUNC0(sdfgi_reset)597598/* PARTICLES */599600#undef ServerName601#undef server_name602603#define ServerName RendererParticlesStorage604#define server_name RSG::particles_storage605606FUNCRIDSPLIT(particles)607608FUNC2(particles_set_mode, RID, ParticlesMode)609FUNC2(particles_set_emitting, RID, bool)610FUNC1R(bool, particles_get_emitting, RID)611FUNC2(particles_set_amount, RID, int)612FUNC2(particles_set_amount_ratio, RID, float)613FUNC2(particles_set_lifetime, RID, double)614FUNC2(particles_set_one_shot, RID, bool)615FUNC2(particles_set_pre_process_time, RID, double)616FUNC2(particles_request_process_time, RID, real_t)617FUNC2(particles_set_explosiveness_ratio, RID, float)618FUNC2(particles_set_randomness_ratio, RID, float)619FUNC2(particles_set_seed, RID, uint32_t)620FUNC2(particles_set_custom_aabb, RID, const AABB &)621FUNC2(particles_set_speed_scale, RID, double)622FUNC2(particles_set_use_local_coordinates, RID, bool)623FUNC2(particles_set_process_material, RID, RID)624FUNC2(particles_set_fixed_fps, RID, int)625FUNC2(particles_set_interpolate, RID, bool)626FUNC2(particles_set_fractional_delta, RID, bool)627FUNC1R(bool, particles_is_inactive, RID)628FUNC3(particles_set_trails, RID, bool, float)629FUNC2(particles_set_trail_bind_poses, RID, const Vector<Transform3D> &)630631FUNC1(particles_request_process, RID)632FUNC1(particles_restart, RID)633FUNC6(particles_emit, RID, const Transform3D &, const Vector3 &, const Color &, const Color &, uint32_t)634FUNC2(particles_set_subemitter, RID, RID)635FUNC2(particles_set_collision_base_size, RID, float)636637FUNC2(particles_set_transform_align, RID, RS::ParticlesTransformAlign)638639FUNC2(particles_set_draw_order, RID, RS::ParticlesDrawOrder)640641FUNC2(particles_set_draw_passes, RID, int)642FUNC3(particles_set_draw_pass_mesh, RID, int, RID)643644FUNC1R(AABB, particles_get_current_aabb, RID)645FUNC2(particles_set_emission_transform, RID, const Transform3D &)646FUNC2(particles_set_emitter_velocity, RID, const Vector3 &)647FUNC2(particles_set_interp_to_end, RID, float)648649/* PARTICLES COLLISION */650651FUNCRIDSPLIT(particles_collision)652653FUNC2(particles_collision_set_collision_type, RID, ParticlesCollisionType)654FUNC2(particles_collision_set_cull_mask, RID, uint32_t)655FUNC2(particles_collision_set_sphere_radius, RID, real_t)656FUNC2(particles_collision_set_box_extents, RID, const Vector3 &)657FUNC2(particles_collision_set_attractor_strength, RID, real_t)658FUNC2(particles_collision_set_attractor_directionality, RID, real_t)659FUNC2(particles_collision_set_attractor_attenuation, RID, real_t)660FUNC2(particles_collision_set_field_texture, RID, RID)661FUNC1(particles_collision_height_field_update, RID)662FUNC2(particles_collision_set_height_field_mask, RID, uint32_t)663FUNC2(particles_collision_set_height_field_resolution, RID, ParticlesCollisionHeightfieldResolution)664665/* FOG VOLUME */666667#undef ServerName668#undef server_name669670#define ServerName RendererFog671#define server_name RSG::fog672673FUNCRIDSPLIT(fog_volume)674675FUNC2(fog_volume_set_shape, RID, FogVolumeShape)676FUNC2(fog_volume_set_size, RID, const Vector3 &)677FUNC2(fog_volume_set_material, RID, RID)678679/* VISIBILITY_NOTIFIER */680681#undef ServerName682#undef server_name683684#define ServerName RendererUtilities685#define server_name RSG::utilities686687FUNCRIDSPLIT(visibility_notifier)688FUNC2(visibility_notifier_set_aabb, RID, const AABB &)689FUNC3(visibility_notifier_set_callbacks, RID, const Callable &, const Callable &)690691#undef server_name692#undef ServerName693//from now on, calls forwarded to this singleton694#define ServerName RenderingMethod695#define server_name RSG::scene696697/* CAMERA API */698699FUNCRIDSPLIT(camera)700FUNC4(camera_set_perspective, RID, float, float, float)701FUNC4(camera_set_orthogonal, RID, float, float, float)702FUNC5(camera_set_frustum, RID, float, Vector2, float, float)703FUNC2(camera_set_transform, RID, const Transform3D &)704FUNC2(camera_set_cull_mask, RID, uint32_t)705FUNC2(camera_set_environment, RID, RID)706FUNC2(camera_set_camera_attributes, RID, RID)707FUNC2(camera_set_compositor, RID, RID)708FUNC2(camera_set_use_vertical_aspect, RID, bool)709710/* OCCLUDER */711FUNCRIDSPLIT(occluder)712FUNC3(occluder_set_mesh, RID, const PackedVector3Array &, const PackedInt32Array &)713714#undef server_name715#undef ServerName716//from now on, calls forwarded to this singleton717#define ServerName RendererViewport718#define server_name RSG::viewport719720/* VIEWPORT TARGET API */721722FUNCRIDSPLIT(viewport)723724#ifndef XR_DISABLED725FUNC2(viewport_set_use_xr, RID, bool)726#endif // XR_DISABLED727728FUNC3(viewport_set_size, RID, int, int)729730FUNC2(viewport_set_active, RID, bool)731FUNC2(viewport_set_parent_viewport, RID, RID)732733FUNC2(viewport_set_clear_mode, RID, ViewportClearMode)734735FUNC3(viewport_attach_to_screen, RID, const Rect2 &, int)736FUNC2(viewport_set_render_direct_to_screen, RID, bool)737738FUNC2(viewport_set_scaling_3d_mode, RID, ViewportScaling3DMode)739FUNC2(viewport_set_scaling_3d_scale, RID, float)740FUNC2(viewport_set_fsr_sharpness, RID, float)741FUNC2(viewport_set_texture_mipmap_bias, RID, float)742FUNC2(viewport_set_anisotropic_filtering_level, RID, ViewportAnisotropicFiltering)743744FUNC2(viewport_set_update_mode, RID, ViewportUpdateMode)745FUNC1RC(ViewportUpdateMode, viewport_get_update_mode, RID)746747FUNC1RC(RID, viewport_get_render_target, RID)748FUNC1RC(RID, viewport_get_texture, RID)749750FUNC2(viewport_set_disable_2d, RID, bool)751FUNC2(viewport_set_environment_mode, RID, ViewportEnvironmentMode)752FUNC2(viewport_set_disable_3d, RID, bool)753754FUNC2(viewport_set_canvas_cull_mask, RID, uint32_t)755756FUNC2(viewport_attach_camera, RID, RID)757FUNC2(viewport_set_scenario, RID, RID)758FUNC2(viewport_attach_canvas, RID, RID)759760FUNC2(viewport_remove_canvas, RID, RID)761FUNC3(viewport_set_canvas_transform, RID, RID, const Transform2D &)762FUNC2(viewport_set_transparent_background, RID, bool)763FUNC2(viewport_set_use_hdr_2d, RID, bool)764FUNC1RC(bool, viewport_is_using_hdr_2d, RID)765FUNC2(viewport_set_snap_2d_transforms_to_pixel, RID, bool)766FUNC2(viewport_set_snap_2d_vertices_to_pixel, RID, bool)767768FUNC2(viewport_set_default_canvas_item_texture_filter, RID, CanvasItemTextureFilter)769FUNC2(viewport_set_default_canvas_item_texture_repeat, RID, CanvasItemTextureRepeat)770771FUNC2(viewport_set_global_canvas_transform, RID, const Transform2D &)772FUNC4(viewport_set_canvas_stacking, RID, RID, int, int)773FUNC3(viewport_set_positional_shadow_atlas_size, RID, int, bool)774FUNC3(viewport_set_sdf_oversize_and_scale, RID, ViewportSDFOversize, ViewportSDFScale)775FUNC3(viewport_set_positional_shadow_atlas_quadrant_subdivision, RID, int, int)776FUNC2(viewport_set_msaa_2d, RID, ViewportMSAA)777FUNC2(viewport_set_msaa_3d, RID, ViewportMSAA)778FUNC2(viewport_set_screen_space_aa, RID, ViewportScreenSpaceAA)779FUNC2(viewport_set_use_taa, RID, bool)780FUNC2(viewport_set_use_debanding, RID, bool)781FUNC2(viewport_set_force_motion_vectors, RID, bool)782FUNC2(viewport_set_use_occlusion_culling, RID, bool)783FUNC1(viewport_set_occlusion_rays_per_thread, int)784FUNC1(viewport_set_occlusion_culling_build_quality, ViewportOcclusionCullingBuildQuality)785FUNC2(viewport_set_mesh_lod_threshold, RID, float)786787FUNC3R(int, viewport_get_render_info, RID, ViewportRenderInfoType, ViewportRenderInfo)788FUNC2(viewport_set_debug_draw, RID, ViewportDebugDraw)789790FUNC2(viewport_set_measure_render_time, RID, bool)791FUNC1RC(double, viewport_get_measured_render_time_cpu, RID)792FUNC1RC(double, viewport_get_measured_render_time_gpu, RID)793FUNC1RC(RID, viewport_find_from_screen_attachment, DisplayServer::WindowID)794795FUNC2(call_set_vsync_mode, DisplayServer::VSyncMode, DisplayServer::WindowID)796797FUNC2(viewport_set_vrs_mode, RID, ViewportVRSMode)798FUNC2(viewport_set_vrs_update_mode, RID, ViewportVRSUpdateMode)799FUNC2(viewport_set_vrs_texture, RID, RID)800801/* COMPOSITOR EFFECT */802803#undef server_name804#undef ServerName805//from now on, calls forwarded to this singleton806#define ServerName RenderingMethod807#define server_name RSG::scene808809FUNCRIDSPLIT(compositor_effect)810FUNC2(compositor_effect_set_enabled, RID, bool)811FUNC3(compositor_effect_set_callback, RID, CompositorEffectCallbackType, const Callable &)812FUNC3(compositor_effect_set_flag, RID, CompositorEffectFlags, bool)813814/* COMPOSITOR */815816FUNC2(compositor_set_compositor_effects, RID, const TypedArray<RID> &)817818FUNCRIDSPLIT(compositor)819820/* ENVIRONMENT API */821822FUNC1(voxel_gi_set_quality, VoxelGIQuality)823824/* SKY API */825826FUNCRIDSPLIT(sky)827FUNC2(sky_set_radiance_size, RID, int)828FUNC2(sky_set_mode, RID, SkyMode)829FUNC2(sky_set_material, RID, RID)830FUNC4R(Ref<Image>, sky_bake_panorama, RID, float, bool, const Size2i &)831832/* ENVIRONMENT */833834FUNCRIDSPLIT(environment)835836FUNC2(environment_set_background, RID, EnvironmentBG)837FUNC2(environment_set_sky, RID, RID)838FUNC2(environment_set_sky_custom_fov, RID, float)839FUNC2(environment_set_sky_orientation, RID, const Basis &)840FUNC2(environment_set_bg_color, RID, const Color &)841FUNC3(environment_set_bg_energy, RID, float, float)842FUNC2(environment_set_canvas_max_layer, RID, int)843FUNC6(environment_set_ambient_light, RID, const Color &, EnvironmentAmbientSource, float, float, EnvironmentReflectionSource)844845FUNC2(environment_set_camera_feed_id, RID, int)846847FUNC6(environment_set_ssr, RID, bool, int, float, float, float)848FUNC1(environment_set_ssr_half_size, bool)849FUNC1(environment_set_ssr_roughness_quality, EnvironmentSSRRoughnessQuality)850851FUNC10(environment_set_ssao, RID, bool, float, float, float, float, float, float, float, float)852FUNC6(environment_set_ssao_quality, EnvironmentSSAOQuality, bool, float, int, float, float)853854FUNC6(environment_set_ssil, RID, bool, float, float, float, float)855FUNC6(environment_set_ssil_quality, EnvironmentSSILQuality, bool, float, int, float, float)856857FUNC13(environment_set_glow, RID, bool, Vector<float>, float, float, float, float, EnvironmentGlowBlendMode, float, float, float, float, RID)858FUNC1(environment_glow_set_use_bicubic_upscale, bool)859860FUNC4(environment_set_tonemap, RID, EnvironmentToneMapper, float, float)861FUNC2(environment_set_tonemap_agx_contrast, RID, float)862863FUNC7(environment_set_adjustment, RID, bool, float, float, float, bool, RID)864865FUNC11(environment_set_fog, RID, bool, const Color &, float, float, float, float, float, float, float, EnvironmentFogMode)866867FUNC4(environment_set_fog_depth, RID, float, float, float)868FUNC14(environment_set_volumetric_fog, RID, bool, float, const Color &, const Color &, float, float, float, float, float, bool, float, float, float)869870FUNC2(environment_set_volumetric_fog_volume_size, int, int)871FUNC1(environment_set_volumetric_fog_filter_active, bool)872873FUNC11(environment_set_sdfgi, RID, bool, int, float, EnvironmentSDFGIYScale, bool, float, bool, float, float, float)874FUNC1(environment_set_sdfgi_ray_count, EnvironmentSDFGIRayCount)875FUNC1(environment_set_sdfgi_frames_to_converge, EnvironmentSDFGIFramesToConverge)876FUNC1(environment_set_sdfgi_frames_to_update_light, EnvironmentSDFGIFramesToUpdateLight)877878FUNC3R(Ref<Image>, environment_bake_panorama, RID, bool, const Size2i &)879880FUNC3(screen_space_roughness_limiter_set_active, bool, float, float)881FUNC1(sub_surface_scattering_set_quality, SubSurfaceScatteringQuality)882FUNC2(sub_surface_scattering_set_scale, float, float)883884FUNC1(positional_soft_shadow_filter_set_quality, ShadowQuality);885FUNC1(directional_soft_shadow_filter_set_quality, ShadowQuality);886FUNC1(decals_set_filter, RS::DecalFilter);887FUNC1(light_projectors_set_filter, RS::LightProjectorFilter);888FUNC1(lightmaps_set_bicubic_filter, bool);889FUNC1(material_set_use_debanding, bool);890891/* CAMERA ATTRIBUTES */892893#undef server_name894#undef ServerName895//from now on, calls forwarded to this singleton896#define ServerName RendererCameraAttributes897#define server_name RSG::camera_attributes898899FUNCRIDSPLIT(camera_attributes)900901FUNC2(camera_attributes_set_dof_blur_quality, DOFBlurQuality, bool)902FUNC1(camera_attributes_set_dof_blur_bokeh_shape, DOFBokehShape)903904FUNC8(camera_attributes_set_dof_blur, RID, bool, float, float, bool, float, float, float)905FUNC3(camera_attributes_set_exposure, RID, float, float)906FUNC6(camera_attributes_set_auto_exposure, RID, bool, float, float, float, float)907908/* SCENARIO API */909910#undef server_name911#undef ServerName912913#define ServerName RenderingMethod914#define server_name RSG::scene915916FUNCRIDSPLIT(scenario)917918FUNC2(scenario_set_environment, RID, RID)919FUNC2(scenario_set_camera_attributes, RID, RID)920FUNC2(scenario_set_fallback_environment, RID, RID)921FUNC2(scenario_set_compositor, RID, RID)922923/* INSTANCING API */924FUNCRIDSPLIT(instance)925926FUNC2(instance_set_base, RID, RID)927FUNC2(instance_set_scenario, RID, RID)928FUNC2(instance_set_layer_mask, RID, uint32_t)929FUNC3(instance_set_pivot_data, RID, float, bool)930FUNC2(instance_set_transform, RID, const Transform3D &)931FUNC2(instance_attach_object_instance_id, RID, ObjectID)932FUNC3(instance_set_blend_shape_weight, RID, int, float)933FUNC3(instance_set_surface_override_material, RID, int, RID)934FUNC2(instance_set_visible, RID, bool)935936FUNC1(instance_teleport, RID)937938FUNC2(instance_set_custom_aabb, RID, AABB)939940FUNC2(instance_attach_skeleton, RID, RID)941942FUNC2(instance_set_extra_visibility_margin, RID, real_t)943FUNC2(instance_set_visibility_parent, RID, RID)944945FUNC2(instance_set_ignore_culling, RID, bool)946947// don't use these in a game!948FUNC2RC(Vector<ObjectID>, instances_cull_aabb, const AABB &, RID)949FUNC3RC(Vector<ObjectID>, instances_cull_ray, const Vector3 &, const Vector3 &, RID)950FUNC2RC(Vector<ObjectID>, instances_cull_convex, const Vector<Plane> &, RID)951952FUNC3(instance_geometry_set_flag, RID, InstanceFlags, bool)953FUNC2(instance_geometry_set_cast_shadows_setting, RID, ShadowCastingSetting)954FUNC2(instance_geometry_set_material_override, RID, RID)955FUNC2(instance_geometry_set_material_overlay, RID, RID)956957FUNC6(instance_geometry_set_visibility_range, RID, float, float, float, float, VisibilityRangeFadeMode)958FUNC4(instance_geometry_set_lightmap, RID, RID, const Rect2 &, int)959FUNC2(instance_geometry_set_lod_bias, RID, float)960FUNC2(instance_geometry_set_transparency, RID, float)961FUNC3(instance_geometry_set_shader_parameter, RID, const StringName &, const Variant &)962FUNC2RC(Variant, instance_geometry_get_shader_parameter, RID, const StringName &)963FUNC2RC(Variant, instance_geometry_get_shader_parameter_default_value, RID, const StringName &)964FUNC2C(instance_geometry_get_shader_parameter_list, RID, List<PropertyInfo> *)965966FUNC3R(TypedArray<Image>, bake_render_uv2, RID, const TypedArray<RID> &, const Size2i &)967968FUNC1(gi_set_use_half_resolution, bool)969970#undef server_name971#undef ServerName972//from now on, calls forwarded to this singleton973#define ServerName RendererCanvasCull974#define server_name RSG::canvas975976/* CANVAS (2D) */977978FUNCRIDSPLIT(canvas)979FUNC3(canvas_set_item_mirroring, RID, RID, const Point2 &)980FUNC3(canvas_set_item_repeat, RID, const Point2 &, int)981FUNC2(canvas_set_modulate, RID, const Color &)982FUNC3(canvas_set_parent, RID, RID, float)983FUNC1(canvas_set_disable_scale, bool)984985FUNCRIDSPLIT(canvas_texture)986FUNC3(canvas_texture_set_channel, RID, CanvasTextureChannel, RID)987FUNC3(canvas_texture_set_shading_parameters, RID, const Color &, float)988989FUNC2(canvas_texture_set_texture_filter, RID, CanvasItemTextureFilter)990FUNC2(canvas_texture_set_texture_repeat, RID, CanvasItemTextureRepeat)991992FUNCRIDSPLIT(canvas_item)993FUNC2(canvas_item_set_parent, RID, RID)994995FUNC2(canvas_item_set_default_texture_filter, RID, CanvasItemTextureFilter)996FUNC2(canvas_item_set_default_texture_repeat, RID, CanvasItemTextureRepeat)997998FUNC2(canvas_item_set_visible, RID, bool)999FUNC2(canvas_item_set_light_mask, RID, int)10001001FUNC2(canvas_item_set_visibility_layer, RID, uint32_t)10021003FUNC2(canvas_item_set_update_when_visible, RID, bool)10041005FUNC2(canvas_item_set_transform, RID, const Transform2D &)1006FUNC2(canvas_item_set_clip, RID, bool)1007FUNC2(canvas_item_set_distance_field_mode, RID, bool)1008FUNC3(canvas_item_set_custom_rect, RID, bool, const Rect2 &)1009FUNC2(canvas_item_set_modulate, RID, const Color &)1010FUNC2(canvas_item_set_self_modulate, RID, const Color &)10111012FUNC2(canvas_item_set_draw_behind_parent, RID, bool)1013FUNC2(canvas_item_set_use_identity_transform, RID, bool)10141015FUNC6(canvas_item_add_line, RID, const Point2 &, const Point2 &, const Color &, float, bool)1016FUNC5(canvas_item_add_polyline, RID, const Vector<Point2> &, const Vector<Color> &, float, bool)1017FUNC5(canvas_item_add_multiline, RID, const Vector<Point2> &, const Vector<Color> &, float, bool)1018FUNC4(canvas_item_add_rect, RID, const Rect2 &, const Color &, bool)1019FUNC6(canvas_item_add_ellipse, RID, const Point2 &, float, float, const Color &, bool)1020FUNC5(canvas_item_add_circle, RID, const Point2 &, float, const Color &, bool)1021FUNC6(canvas_item_add_texture_rect, RID, const Rect2 &, RID, bool, const Color &, bool)1022FUNC7(canvas_item_add_texture_rect_region, RID, const Rect2 &, RID, const Rect2 &, const Color &, bool, bool)1023FUNC8(canvas_item_add_msdf_texture_rect_region, RID, const Rect2 &, RID, const Rect2 &, const Color &, int, float, float)1024FUNC5(canvas_item_add_lcd_texture_rect_region, RID, const Rect2 &, RID, const Rect2 &, const Color &)1025FUNC10(canvas_item_add_nine_patch, RID, const Rect2 &, const Rect2 &, RID, const Vector2 &, const Vector2 &, NinePatchAxisMode, NinePatchAxisMode, bool, const Color &)1026FUNC5(canvas_item_add_primitive, RID, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID)1027FUNC5(canvas_item_add_polygon, RID, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID)1028FUNC9(canvas_item_add_triangle_array, RID, const Vector<int> &, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, const Vector<int> &, const Vector<float> &, RID, int)1029FUNC5(canvas_item_add_mesh, RID, const RID &, const Transform2D &, const Color &, RID)1030FUNC3(canvas_item_add_multimesh, RID, RID, RID)1031FUNC3(canvas_item_add_particles, RID, RID, RID)1032FUNC2(canvas_item_add_set_transform, RID, const Transform2D &)1033FUNC2(canvas_item_add_clip_ignore, RID, bool)1034FUNC5(canvas_item_add_animation_slice, RID, double, double, double, double)10351036FUNC2(canvas_item_set_sort_children_by_y, RID, bool)1037FUNC2(canvas_item_set_z_index, RID, int)1038FUNC2(canvas_item_set_z_as_relative_to_parent, RID, bool)1039FUNC3(canvas_item_set_copy_to_backbuffer, RID, bool, const Rect2 &)1040FUNC2(canvas_item_attach_skeleton, RID, RID)10411042FUNC1(canvas_item_clear, RID)1043FUNC2(canvas_item_set_draw_index, RID, int)10441045FUNC2(canvas_item_set_material, RID, RID)10461047FUNC3(canvas_item_set_instance_shader_parameter, RID, const StringName &, const Variant &)1048FUNC2RC(Variant, canvas_item_get_instance_shader_parameter, RID, const StringName &)1049FUNC2RC(Variant, canvas_item_get_instance_shader_parameter_default_value, RID, const StringName &)1050FUNC2C(canvas_item_get_instance_shader_parameter_list, RID, List<PropertyInfo> *)10511052FUNC2(canvas_item_set_use_parent_material, RID, bool)10531054FUNC5(canvas_item_set_visibility_notifier, RID, bool, const Rect2 &, const Callable &, const Callable &)10551056FUNC6(canvas_item_set_canvas_group_mode, RID, CanvasGroupMode, float, bool, float, bool)10571058FUNC1(canvas_item_set_debug_redraw, bool)1059FUNC0RC(bool, canvas_item_get_debug_redraw)10601061FUNC2(canvas_item_set_interpolated, RID, bool)1062FUNC1(canvas_item_reset_physics_interpolation, RID)1063FUNC2(canvas_item_transform_physics_interpolation, RID, const Transform2D &)10641065FUNCRIDSPLIT(canvas_light)10661067FUNC2(canvas_light_set_mode, RID, CanvasLightMode)10681069FUNC2(canvas_light_attach_to_canvas, RID, RID)1070FUNC2(canvas_light_set_enabled, RID, bool)1071FUNC2(canvas_light_set_texture_scale, RID, float)1072FUNC2(canvas_light_set_transform, RID, const Transform2D &)1073FUNC2(canvas_light_set_texture, RID, RID)1074FUNC2(canvas_light_set_texture_offset, RID, const Vector2 &)1075FUNC2(canvas_light_set_color, RID, const Color &)1076FUNC2(canvas_light_set_height, RID, float)1077FUNC2(canvas_light_set_energy, RID, float)1078FUNC3(canvas_light_set_z_range, RID, int, int)1079FUNC3(canvas_light_set_layer_range, RID, int, int)1080FUNC2(canvas_light_set_item_cull_mask, RID, int)1081FUNC2(canvas_light_set_item_shadow_cull_mask, RID, int)1082FUNC2(canvas_light_set_directional_distance, RID, float)10831084FUNC2(canvas_light_set_blend_mode, RID, CanvasLightBlendMode)10851086FUNC2(canvas_light_set_shadow_enabled, RID, bool)1087FUNC2(canvas_light_set_shadow_filter, RID, CanvasLightShadowFilter)1088FUNC2(canvas_light_set_shadow_color, RID, const Color &)1089FUNC2(canvas_light_set_shadow_smooth, RID, float)10901091FUNC2(canvas_light_set_interpolated, RID, bool)1092FUNC1(canvas_light_reset_physics_interpolation, RID)1093FUNC2(canvas_light_transform_physics_interpolation, RID, const Transform2D &)10941095FUNCRIDSPLIT(canvas_light_occluder)1096FUNC2(canvas_light_occluder_attach_to_canvas, RID, RID)1097FUNC2(canvas_light_occluder_set_enabled, RID, bool)1098FUNC2(canvas_light_occluder_set_polygon, RID, RID)1099FUNC2(canvas_light_occluder_set_as_sdf_collision, RID, bool)1100FUNC2(canvas_light_occluder_set_transform, RID, const Transform2D &)1101FUNC2(canvas_light_occluder_set_light_mask, RID, int)11021103FUNC2(canvas_light_occluder_set_interpolated, RID, bool)1104FUNC1(canvas_light_occluder_reset_physics_interpolation, RID)1105FUNC2(canvas_light_occluder_transform_physics_interpolation, RID, const Transform2D &)11061107FUNCRIDSPLIT(canvas_occluder_polygon)1108FUNC3(canvas_occluder_polygon_set_shape, RID, const Vector<Vector2> &, bool)11091110FUNC2(canvas_occluder_polygon_set_cull_mode, RID, CanvasOccluderPolygonCullMode)11111112FUNC1(canvas_set_shadow_texture_size, int)11131114FUNC1R(Rect2, _debug_canvas_item_get_rect, RID)11151116/* GLOBAL SHADER UNIFORMS */11171118#undef server_name1119#undef ServerName1120//from now on, calls forwarded to this singleton1121#define ServerName RendererMaterialStorage1122#define server_name RSG::material_storage11231124FUNC3(global_shader_parameter_add, const StringName &, GlobalShaderParameterType, const Variant &)1125FUNC1(global_shader_parameter_remove, const StringName &)1126FUNC0RC(Vector<StringName>, global_shader_parameter_get_list)1127FUNC2(global_shader_parameter_set, const StringName &, const Variant &)1128FUNC2(global_shader_parameter_set_override, const StringName &, const Variant &)1129FUNC1RC(GlobalShaderParameterType, global_shader_parameter_get_type, const StringName &)1130FUNC1RC(Variant, global_shader_parameter_get, const StringName &)11311132FUNC1(global_shader_parameters_load_settings, bool)1133FUNC0(global_shader_parameters_clear)11341135/* COMPOSITOR */11361137#undef server_name1138#undef ServerName1139#define ServerName RendererCompositor1140#define server_name RSG::rasterizer11411142FUNC4S(set_boot_image_with_stretch, const Ref<Image> &, const Color &, RenderingServer::SplashStretchMode, bool)11431144/* STATUS INFORMATION */11451146#undef server_name1147#undef ServerName11481149/* UTILITIES */11501151#define ServerName RendererUtilities1152#define server_name RSG::utilities1153FUNC0RC(String, get_video_adapter_name)1154FUNC0RC(String, get_video_adapter_vendor)1155FUNC0RC(String, get_video_adapter_api_version)1156#undef server_name1157#undef ServerName1158#undef WRITE_ACTION1159#undef SYNC_DEBUG1160#ifdef DEBUG_ENABLED1161#undef MAIN_THREAD_SYNC_WARN1162#endif11631164virtual uint64_t get_rendering_info(RenderingInfo p_info) override;1165virtual RenderingDevice::DeviceType get_video_adapter_type() const override;11661167virtual void set_frame_profiling_enabled(bool p_enable) override;1168virtual Vector<FrameProfileArea> get_frame_profile() override;1169virtual uint64_t get_frame_profile_frame() override;11701171virtual RID get_test_cube() override;11721173/* FREE */11741175virtual void free_rid(RID p_rid) override {1176if (Thread::get_caller_id() == server_thread) {1177command_queue.flush_if_pending();1178_free(p_rid);1179} else {1180command_queue.push(this, &RenderingServerDefault::_free, p_rid);1181}1182}11831184/* INTERPOLATION */11851186virtual void set_physics_interpolation_enabled(bool p_enabled) override;11871188/* EVENT QUEUING */11891190virtual void request_frame_drawn_callback(const Callable &p_callable) override;11911192virtual void draw(bool p_present, double frame_step) override;1193virtual void sync() override;1194virtual bool has_changed() const override;1195virtual void init() override;1196virtual void finish() override;1197virtual void tick() override;1198virtual void pre_draw(bool p_will_draw) override;11991200virtual bool is_on_render_thread() override {1201return Thread::get_caller_id() == server_thread;1202}12031204virtual void call_on_render_thread(const Callable &p_callable) override {1205if (Thread::get_caller_id() == server_thread) {1206command_queue.flush_if_pending();1207p_callable.call();1208} else {1209command_queue.push(this, &RenderingServerDefault::_call_on_render_thread, p_callable);1210}1211}12121213/* TESTING */12141215virtual double get_frame_setup_time_cpu() const override;12161217virtual Color get_default_clear_color() override;1218virtual void set_default_clear_color(const Color &p_color) override;12191220#ifndef DISABLE_DEPRECATED1221virtual bool has_feature(Features p_feature) const override;1222#endif12231224virtual bool has_os_feature(const String &p_feature) const override;1225virtual void set_debug_generate_wireframes(bool p_generate) override;12261227virtual bool is_low_end() const override;12281229virtual void sdfgi_set_debug_probe_select(const Vector3 &p_position, const Vector3 &p_dir) override;12301231virtual void set_print_gpu_profile(bool p_enable) override;12321233virtual Size2i get_maximum_viewport_size() const override;12341235RenderingServerDefault(bool p_create_thread = false);1236~RenderingServerDefault();1237};123812391240