Path: blob/master/servers/rendering/rendering_server_default.h
10277 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_server.h"41#include "servers/server_wrap_mt_common.h"4243class RenderingServerDefault : public RenderingServer {44enum {45MAX_INSTANCE_CULL = 8192,46MAX_INSTANCE_LIGHTS = 4,47LIGHT_CACHE_DIRTY = -1,48MAX_LIGHTS_CULLED = 256,49MAX_ROOM_CULL = 32,50MAX_EXTERIOR_PORTALS = 128,51MAX_LIGHT_SAMPLERS = 256,52INSTANCE_ROOMLESS_MASK = (1 << 20)5354};5556static int changes;57RID test_cube;5859List<Callable> frame_drawn_callbacks;6061static void _changes_changed() {}6263uint64_t frame_profile_frame = 0;64Vector<FrameProfileArea> frame_profile;6566double frame_setup_time = 0;6768//for printing69bool print_gpu_profile = false;70HashMap<String, float> print_gpu_profile_task_time;71uint64_t print_frame_profile_ticks_from = 0;72uint32_t print_frame_profile_frame_count = 0;7374mutable CommandQueueMT command_queue;7576Thread::ID server_thread = Thread::MAIN_ID;77WorkerThreadPool::TaskID server_task_id = WorkerThreadPool::INVALID_TASK_ID;78bool exit = false;79bool create_thread = false;8081void _assign_mt_ids(WorkerThreadPool::TaskID p_pump_task_id);82void _thread_exit();83void _thread_loop();8485void _draw(bool p_swap_buffers, double frame_step);86void _run_post_draw_steps();87void _init();88void _finish();8990void _free(RID p_rid);9192void _call_on_render_thread(const Callable &p_callable);9394public:95//if editor is redrawing when it shouldn't, enable this and put a breakpoint in _changes_changed()96//#define DEBUG_CHANGES9798#ifdef DEBUG_CHANGES99_FORCE_INLINE_ static void redraw_request() {100changes++;101_changes_changed();102}103104#else105_FORCE_INLINE_ static void redraw_request() {106changes++;107}108#endif109110#define WRITE_ACTION redraw_request();111#define ASYNC_COND_PUSH (Thread::get_caller_id() != server_thread)112#define ASYNC_COND_PUSH_AND_RET (Thread::get_caller_id() != server_thread)113#define ASYNC_COND_PUSH_AND_SYNC (Thread::get_caller_id() != server_thread)114115#ifdef DEBUG_SYNC116#define SYNC_DEBUG print_line("sync on: " + String(__FUNCTION__));117#else118#define SYNC_DEBUG119#endif120121#ifdef DEBUG_ENABLED122#define MAIN_THREAD_SYNC_WARN WARN_PRINT("Call to " + String(__FUNCTION__) + " causing RenderingServer synchronizations on every frame. This significantly affects performance.");123#endif124125#include "servers/server_wrap_mt_common.h"126127/* 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 FUNCRIDTEX6(m_type, m_type1, m_type2, m_type3, m_type4, m_type5, m_type6) \177virtual RID m_type##_create(m_type1 p1, m_type2 p2, m_type3 p3, m_type4 p4, m_type5 p5, m_type6 p6) 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, p5, p6); \181} else { \182command_queue.push(RSG::texture_storage, &RendererTextureStorage::m_type##_initialize, ret, p1, p2, p3, p4, p5, p6); \183} \184return ret; \185}186187//these go pass-through, as they can be called from any thread188FUNCRIDTEX1(texture_2d, const Ref<Image> &)189FUNCRIDTEX2(texture_2d_layered, const Vector<Ref<Image>> &, TextureLayeredType)190FUNCRIDTEX6(texture_3d, Image::Format, int, int, int, bool, const Vector<Ref<Image>> &)191FUNCRIDTEX3(texture_external, int, int, uint64_t)192FUNCRIDTEX1(texture_proxy, RID)193194// Called directly, not through the command queue.195virtual 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 {196return 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);197}198199//these go through command queue if they are in another thread200FUNC3(texture_2d_update, RID, const Ref<Image> &, int)201FUNC2(texture_3d_update, RID, const Vector<Ref<Image>> &)202FUNC4(texture_external_update, RID, int, int, uint64_t)203FUNC2(texture_proxy_update, RID, RID)204205//these also go pass-through206FUNCRIDTEX0(texture_2d_placeholder)207FUNCRIDTEX1(texture_2d_layered_placeholder, TextureLayeredType)208FUNCRIDTEX0(texture_3d_placeholder)209210FUNC1RC(Ref<Image>, texture_2d_get, RID)211FUNC2RC(Ref<Image>, texture_2d_layer_get, RID, int)212FUNC1RC(Vector<Ref<Image>>, texture_3d_get, RID)213214FUNC2(texture_replace, RID, RID)215216FUNC3(texture_set_size_override, RID, int, int)217// FIXME: Disabled during Vulkan refactoring, should be ported.218#if 0219FUNC2(texture_bind, RID, uint32_t)220#endif221222FUNC3(texture_set_detect_3d_callback, RID, TextureDetectCallback, void *)223FUNC3(texture_set_detect_normal_callback, RID, TextureDetectCallback, void *)224FUNC3(texture_set_detect_roughness_callback, RID, TextureDetectRoughnessCallback, void *)225226FUNC2(texture_set_path, RID, const String &)227FUNC1RC(String, texture_get_path, RID)228229FUNC1RC(Image::Format, texture_get_format, RID)230231FUNC1(texture_debug_usage, List<TextureInfo> *)232233FUNC2(texture_set_force_redraw_if_visible, RID, bool)234FUNCRIDTEX2(texture_rd, const RID &, const RS::TextureLayeredType)235FUNC2RC(RID, texture_get_rd_texture, RID, bool)236FUNC2RC(uint64_t, texture_get_native_handle, RID, bool)237238/* SHADER API */239240#undef ServerName241#undef server_name242243#define ServerName RendererMaterialStorage244#define server_name RSG::material_storage245246virtual RID shader_create() override {247RID ret = RSG::material_storage->shader_allocate();248if (Thread::get_caller_id() == server_thread) {249RSG::material_storage->shader_initialize(ret, false);250} else {251command_queue.push(RSG::material_storage, &ServerName::shader_initialize, ret, false);252}253return ret;254}255256virtual RID shader_create_from_code(const String &p_code, const String &p_path_hint = String()) override {257RID shader = RSG::material_storage->shader_allocate();258bool using_server_thread = Thread::get_caller_id() == server_thread;259if (using_server_thread || RSG::rasterizer->can_create_resources_async()) {260if (using_server_thread) {261command_queue.flush_if_pending();262}263264RSG::material_storage->shader_initialize(shader, false);265RSG::material_storage->shader_set_code(shader, p_code);266RSG::material_storage->shader_set_path_hint(shader, p_path_hint);267} else {268command_queue.push(RSG::material_storage, &RendererMaterialStorage::shader_initialize, shader, false);269command_queue.push(RSG::material_storage, &RendererMaterialStorage::shader_set_code, shader, p_code);270command_queue.push(RSG::material_storage, &RendererMaterialStorage::shader_set_path_hint, shader, p_path_hint);271}272273return shader;274}275276FUNC2(shader_set_code, RID, const String &)277FUNC2(shader_set_path_hint, RID, const String &)278FUNC1RC(String, shader_get_code, RID)279280FUNC2SC(get_shader_parameter_list, RID, List<PropertyInfo> *)281282FUNC4(shader_set_default_texture_parameter, RID, const StringName &, RID, int)283FUNC3RC(RID, shader_get_default_texture_parameter, RID, const StringName &, int)284FUNC2RC(Variant, shader_get_parameter_default, RID, const StringName &)285286FUNC1RC(ShaderNativeSourceCode, shader_get_native_source_code, RID)287288/* COMMON MATERIAL API */289290FUNCRIDSPLIT(material)291292virtual RID material_create_from_shader(RID p_next_pass, int p_render_priority, RID p_shader) override {293RID material = RSG::material_storage->material_allocate();294bool using_server_thread = Thread::get_caller_id() == server_thread;295if (using_server_thread || RSG::rasterizer->can_create_resources_async()) {296if (using_server_thread) {297command_queue.flush_if_pending();298}299300RSG::material_storage->material_initialize(material);301RSG::material_storage->material_set_next_pass(material, p_next_pass);302RSG::material_storage->material_set_render_priority(material, p_render_priority);303RSG::material_storage->material_set_shader(material, p_shader);304} else {305command_queue.push(RSG::material_storage, &RendererMaterialStorage::material_initialize, material);306command_queue.push(RSG::material_storage, &RendererMaterialStorage::material_set_next_pass, material, p_next_pass);307command_queue.push(RSG::material_storage, &RendererMaterialStorage::material_set_render_priority, material, p_render_priority);308command_queue.push(RSG::material_storage, &RendererMaterialStorage::material_set_shader, material, p_shader);309}310311return material;312}313314FUNC2(material_set_shader, RID, RID)315316FUNC3(material_set_param, RID, const StringName &, const Variant &)317FUNC2RC(Variant, material_get_param, RID, const StringName &)318319FUNC2(material_set_render_priority, RID, int)320FUNC2(material_set_next_pass, RID, RID)321322/* MESH API */323324//from now on, calls forwarded to this singleton325#undef ServerName326#undef server_name327328#define ServerName RendererMeshStorage329#define server_name RSG::mesh_storage330331virtual RID mesh_create_from_surfaces(const Vector<SurfaceData> &p_surfaces, int p_blend_shape_count = 0) override {332RID mesh = RSG::mesh_storage->mesh_allocate();333334bool using_server_thread = Thread::get_caller_id() == server_thread;335if (using_server_thread || RSG::rasterizer->can_create_resources_async()) {336if (using_server_thread) {337command_queue.flush_if_pending();338}339RSG::mesh_storage->mesh_initialize(mesh);340RSG::mesh_storage->mesh_set_blend_shape_count(mesh, p_blend_shape_count);341for (int i = 0; i < p_surfaces.size(); i++) {342RSG::mesh_storage->mesh_add_surface(mesh, p_surfaces[i]);343}344RSG::scene->mesh_generate_pipelines(mesh, using_server_thread);345} else {346command_queue.push(RSG::mesh_storage, &RendererMeshStorage::mesh_initialize, mesh);347command_queue.push(RSG::mesh_storage, &RendererMeshStorage::mesh_set_blend_shape_count, mesh, p_blend_shape_count);348for (int i = 0; i < p_surfaces.size(); i++) {349command_queue.push(RSG::mesh_storage, &RendererMeshStorage::mesh_add_surface, mesh, p_surfaces[i]);350}351command_queue.push(RSG::scene, &RenderingMethod::mesh_generate_pipelines, mesh, true);352}353354return mesh;355}356357FUNC2(mesh_set_blend_shape_count, RID, int)358359FUNCRIDSPLIT(mesh)360361FUNC2(mesh_add_surface, RID, const SurfaceData &)362363FUNC1RC(int, mesh_get_blend_shape_count, RID)364365FUNC2(mesh_set_blend_shape_mode, RID, BlendShapeMode)366FUNC1RC(BlendShapeMode, mesh_get_blend_shape_mode, RID)367368FUNC4(mesh_surface_update_vertex_region, RID, int, int, const Vector<uint8_t> &)369FUNC4(mesh_surface_update_attribute_region, RID, int, int, const Vector<uint8_t> &)370FUNC4(mesh_surface_update_skin_region, RID, int, int, const Vector<uint8_t> &)371FUNC4(mesh_surface_update_index_region, RID, int, int, const Vector<uint8_t> &)372373FUNC3(mesh_surface_set_material, RID, int, RID)374FUNC2RC(RID, mesh_surface_get_material, RID, int)375376FUNC2RC(SurfaceData, mesh_get_surface, RID, int)377378FUNC1RC(int, mesh_get_surface_count, RID)379380FUNC2(mesh_set_custom_aabb, RID, const AABB &)381FUNC1RC(AABB, mesh_get_custom_aabb, RID)382383FUNC2(mesh_set_path, RID, const String &)384FUNC1RC(String, mesh_get_path, RID)385386FUNC2(mesh_set_shadow_mesh, RID, RID)387388FUNC2(mesh_surface_remove, RID, int)389FUNC1(mesh_clear, RID)390391FUNC1(mesh_debug_usage, List<MeshInfo> *)392393/* MULTIMESH API */394395FUNCRIDSPLIT(multimesh)396397FUNC6(multimesh_allocate_data, RID, int, MultimeshTransformFormat, bool, bool, bool)398FUNC1RC(int, multimesh_get_instance_count, RID)399400FUNC2(multimesh_set_mesh, RID, RID)401FUNC3(multimesh_instance_set_transform, RID, int, const Transform3D &)402FUNC3(multimesh_instance_set_transform_2d, RID, int, const Transform2D &)403FUNC3(multimesh_instance_set_color, RID, int, const Color &)404FUNC3(multimesh_instance_set_custom_data, RID, int, const Color &)405406FUNC2(multimesh_set_custom_aabb, RID, const AABB &)407FUNC1RC(AABB, multimesh_get_custom_aabb, RID)408409FUNC1RC(RID, multimesh_get_mesh, RID)410FUNC1RC(AABB, multimesh_get_aabb, RID)411412FUNC2RC(Transform3D, multimesh_instance_get_transform, RID, int)413FUNC2RC(Transform2D, multimesh_instance_get_transform_2d, RID, int)414FUNC2RC(Color, multimesh_instance_get_color, RID, int)415FUNC2RC(Color, multimesh_instance_get_custom_data, RID, int)416417FUNC2(multimesh_set_buffer, RID, const Vector<float> &)418FUNC1RC(RID, multimesh_get_command_buffer_rd_rid, RID)419FUNC1RC(RID, multimesh_get_buffer_rd_rid, RID)420FUNC1RC(Vector<float>, multimesh_get_buffer, RID)421422FUNC3(multimesh_set_buffer_interpolated, RID, const Vector<float> &, const Vector<float> &)423FUNC2(multimesh_set_physics_interpolated, RID, bool)424FUNC2(multimesh_set_physics_interpolation_quality, RID, MultimeshPhysicsInterpolationQuality)425FUNC2(multimesh_instance_reset_physics_interpolation, RID, int)426427FUNC2(multimesh_set_visible_instances, RID, int)428FUNC1RC(int, multimesh_get_visible_instances, RID)429430/* SKELETON API */431432FUNCRIDSPLIT(skeleton)433FUNC3(skeleton_allocate_data, RID, int, bool)434FUNC1RC(int, skeleton_get_bone_count, RID)435FUNC3(skeleton_bone_set_transform, RID, int, const Transform3D &)436FUNC2RC(Transform3D, skeleton_bone_get_transform, RID, int)437FUNC3(skeleton_bone_set_transform_2d, RID, int, const Transform2D &)438FUNC2RC(Transform2D, skeleton_bone_get_transform_2d, RID, int)439FUNC2(skeleton_set_base_transform_2d, RID, const Transform2D &)440441/* Light API */442#undef ServerName443#undef server_name444445#define ServerName RendererLightStorage446#define server_name RSG::light_storage447448FUNCRIDSPLIT(directional_light)449FUNCRIDSPLIT(omni_light)450FUNCRIDSPLIT(spot_light)451452FUNC2(light_set_color, RID, const Color &)453FUNC3(light_set_param, RID, LightParam, float)454FUNC2(light_set_shadow, RID, bool)455FUNC2(light_set_projector, RID, RID)456FUNC2(light_set_negative, RID, bool)457FUNC2(light_set_cull_mask, RID, uint32_t)458FUNC5(light_set_distance_fade, RID, bool, float, float, float)459FUNC2(light_set_reverse_cull_face_mode, RID, bool)460FUNC2(light_set_shadow_caster_mask, RID, uint32_t)461FUNC2(light_set_bake_mode, RID, LightBakeMode)462FUNC2(light_set_max_sdfgi_cascade, RID, uint32_t)463464FUNC2(light_omni_set_shadow_mode, RID, LightOmniShadowMode)465466FUNC2(light_directional_set_shadow_mode, RID, LightDirectionalShadowMode)467FUNC2(light_directional_set_blend_splits, RID, bool)468FUNC2(light_directional_set_sky_mode, RID, LightDirectionalSkyMode)469470/* PROBE API */471472FUNCRIDSPLIT(reflection_probe)473474FUNC2(reflection_probe_set_update_mode, RID, ReflectionProbeUpdateMode)475FUNC2(reflection_probe_set_intensity, RID, float)476FUNC2(reflection_probe_set_blend_distance, RID, float)477FUNC2(reflection_probe_set_ambient_color, RID, const Color &)478FUNC2(reflection_probe_set_ambient_energy, RID, float)479FUNC2(reflection_probe_set_ambient_mode, RID, ReflectionProbeAmbientMode)480FUNC2(reflection_probe_set_max_distance, RID, float)481FUNC2(reflection_probe_set_size, RID, const Vector3 &)482FUNC2(reflection_probe_set_origin_offset, RID, const Vector3 &)483FUNC2(reflection_probe_set_as_interior, RID, bool)484FUNC2(reflection_probe_set_enable_box_projection, RID, bool)485FUNC2(reflection_probe_set_enable_shadows, RID, bool)486FUNC2(reflection_probe_set_cull_mask, RID, uint32_t)487FUNC2(reflection_probe_set_reflection_mask, RID, uint32_t)488FUNC2(reflection_probe_set_resolution, RID, int)489FUNC2(reflection_probe_set_mesh_lod_threshold, RID, float)490491/* LIGHTMAP */492493FUNCRIDSPLIT(lightmap)494495FUNC3(lightmap_set_textures, RID, RID, bool)496FUNC2(lightmap_set_probe_bounds, RID, const AABB &)497FUNC2(lightmap_set_probe_interior, RID, bool)498FUNC5(lightmap_set_probe_capture_data, RID, const PackedVector3Array &, const PackedColorArray &, const PackedInt32Array &, const PackedInt32Array &)499FUNC2(lightmap_set_baked_exposure_normalization, RID, float)500FUNC1RC(PackedVector3Array, lightmap_get_probe_capture_points, RID)501FUNC1RC(PackedColorArray, lightmap_get_probe_capture_sh, RID)502FUNC1RC(PackedInt32Array, lightmap_get_probe_capture_tetrahedra, RID)503FUNC1RC(PackedInt32Array, lightmap_get_probe_capture_bsp_tree, RID)504FUNC1(lightmap_set_probe_capture_update_speed, float)505506FUNC2(lightmap_set_shadowmask_textures, RID, RID)507FUNC1R(ShadowmaskMode, lightmap_get_shadowmask_mode, RID)508FUNC2(lightmap_set_shadowmask_mode, RID, ShadowmaskMode)509510/* Shadow Atlas */511FUNC0R(RID, shadow_atlas_create)512FUNC3(shadow_atlas_set_size, RID, int, bool)513FUNC3(shadow_atlas_set_quadrant_subdivision, RID, int, int)514515FUNC2(directional_shadow_atlas_set_size, int, bool)516517/* DECAL API */518519#undef ServerName520#undef server_name521522#define ServerName RendererTextureStorage523#define server_name RSG::texture_storage524525FUNCRIDSPLIT(decal)526527FUNC2(decal_set_size, RID, const Vector3 &)528FUNC3(decal_set_texture, RID, DecalTexture, RID)529FUNC2(decal_set_emission_energy, RID, float)530FUNC2(decal_set_albedo_mix, RID, float)531FUNC2(decal_set_modulate, RID, const Color &)532FUNC2(decal_set_cull_mask, RID, uint32_t)533FUNC4(decal_set_distance_fade, RID, bool, float, float)534FUNC3(decal_set_fade, RID, float, float)535FUNC2(decal_set_normal_fade, RID, float)536537/* BAKED LIGHT API */538539//from now on, calls forwarded to this singleton540#undef ServerName541#undef server_name542543#define ServerName RendererGI544#define server_name RSG::gi545546FUNCRIDSPLIT(voxel_gi)547548FUNC8(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> &)549550FUNC1RC(AABB, voxel_gi_get_bounds, RID)551FUNC1RC(Vector3i, voxel_gi_get_octree_size, RID)552FUNC1RC(Vector<uint8_t>, voxel_gi_get_octree_cells, RID)553FUNC1RC(Vector<uint8_t>, voxel_gi_get_data_cells, RID)554FUNC1RC(Vector<uint8_t>, voxel_gi_get_distance_field, RID)555FUNC1RC(Vector<int>, voxel_gi_get_level_counts, RID)556FUNC1RC(Transform3D, voxel_gi_get_to_cell_xform, RID)557558FUNC2(voxel_gi_set_dynamic_range, RID, float)559FUNC2(voxel_gi_set_propagation, RID, float)560FUNC2(voxel_gi_set_energy, RID, float)561FUNC2(voxel_gi_set_baked_exposure_normalization, RID, float)562FUNC2(voxel_gi_set_bias, RID, float)563FUNC2(voxel_gi_set_normal_bias, RID, float)564FUNC2(voxel_gi_set_interior, RID, bool)565FUNC2(voxel_gi_set_use_two_bounces, RID, bool)566567FUNC0(sdfgi_reset)568569/* PARTICLES */570571#undef ServerName572#undef server_name573574#define ServerName RendererParticlesStorage575#define server_name RSG::particles_storage576577FUNCRIDSPLIT(particles)578579FUNC2(particles_set_mode, RID, ParticlesMode)580FUNC2(particles_set_emitting, RID, bool)581FUNC1R(bool, particles_get_emitting, RID)582FUNC2(particles_set_amount, RID, int)583FUNC2(particles_set_amount_ratio, RID, float)584FUNC2(particles_set_lifetime, RID, double)585FUNC2(particles_set_one_shot, RID, bool)586FUNC2(particles_set_pre_process_time, RID, double)587FUNC2(particles_request_process_time, RID, real_t)588FUNC2(particles_set_explosiveness_ratio, RID, float)589FUNC2(particles_set_randomness_ratio, RID, float)590FUNC2(particles_set_seed, RID, uint32_t)591FUNC2(particles_set_custom_aabb, RID, const AABB &)592FUNC2(particles_set_speed_scale, RID, double)593FUNC2(particles_set_use_local_coordinates, RID, bool)594FUNC2(particles_set_process_material, RID, RID)595FUNC2(particles_set_fixed_fps, RID, int)596FUNC2(particles_set_interpolate, RID, bool)597FUNC2(particles_set_fractional_delta, RID, bool)598FUNC1R(bool, particles_is_inactive, RID)599FUNC3(particles_set_trails, RID, bool, float)600FUNC2(particles_set_trail_bind_poses, RID, const Vector<Transform3D> &)601602FUNC1(particles_request_process, RID)603FUNC1(particles_restart, RID)604FUNC6(particles_emit, RID, const Transform3D &, const Vector3 &, const Color &, const Color &, uint32_t)605FUNC2(particles_set_subemitter, RID, RID)606FUNC2(particles_set_collision_base_size, RID, float)607608FUNC2(particles_set_transform_align, RID, RS::ParticlesTransformAlign)609610FUNC2(particles_set_draw_order, RID, RS::ParticlesDrawOrder)611612FUNC2(particles_set_draw_passes, RID, int)613FUNC3(particles_set_draw_pass_mesh, RID, int, RID)614615FUNC1R(AABB, particles_get_current_aabb, RID)616FUNC2(particles_set_emission_transform, RID, const Transform3D &)617FUNC2(particles_set_emitter_velocity, RID, const Vector3 &)618FUNC2(particles_set_interp_to_end, RID, float)619620/* PARTICLES COLLISION */621622FUNCRIDSPLIT(particles_collision)623624FUNC2(particles_collision_set_collision_type, RID, ParticlesCollisionType)625FUNC2(particles_collision_set_cull_mask, RID, uint32_t)626FUNC2(particles_collision_set_sphere_radius, RID, real_t)627FUNC2(particles_collision_set_box_extents, RID, const Vector3 &)628FUNC2(particles_collision_set_attractor_strength, RID, real_t)629FUNC2(particles_collision_set_attractor_directionality, RID, real_t)630FUNC2(particles_collision_set_attractor_attenuation, RID, real_t)631FUNC2(particles_collision_set_field_texture, RID, RID)632FUNC1(particles_collision_height_field_update, RID)633FUNC2(particles_collision_set_height_field_mask, RID, uint32_t)634FUNC2(particles_collision_set_height_field_resolution, RID, ParticlesCollisionHeightfieldResolution)635636/* FOG VOLUME */637638#undef ServerName639#undef server_name640641#define ServerName RendererFog642#define server_name RSG::fog643644FUNCRIDSPLIT(fog_volume)645646FUNC2(fog_volume_set_shape, RID, FogVolumeShape)647FUNC2(fog_volume_set_size, RID, const Vector3 &)648FUNC2(fog_volume_set_material, RID, RID)649650/* VISIBILITY_NOTIFIER */651652#undef ServerName653#undef server_name654655#define ServerName RendererUtilities656#define server_name RSG::utilities657658FUNCRIDSPLIT(visibility_notifier)659FUNC2(visibility_notifier_set_aabb, RID, const AABB &)660FUNC3(visibility_notifier_set_callbacks, RID, const Callable &, const Callable &)661662#undef server_name663#undef ServerName664//from now on, calls forwarded to this singleton665#define ServerName RenderingMethod666#define server_name RSG::scene667668/* CAMERA API */669670FUNCRIDSPLIT(camera)671FUNC4(camera_set_perspective, RID, float, float, float)672FUNC4(camera_set_orthogonal, RID, float, float, float)673FUNC5(camera_set_frustum, RID, float, Vector2, float, float)674FUNC2(camera_set_transform, RID, const Transform3D &)675FUNC2(camera_set_cull_mask, RID, uint32_t)676FUNC2(camera_set_environment, RID, RID)677FUNC2(camera_set_camera_attributes, RID, RID)678FUNC2(camera_set_compositor, RID, RID)679FUNC2(camera_set_use_vertical_aspect, RID, bool)680681/* OCCLUDER */682FUNCRIDSPLIT(occluder)683FUNC3(occluder_set_mesh, RID, const PackedVector3Array &, const PackedInt32Array &)684685#undef server_name686#undef ServerName687//from now on, calls forwarded to this singleton688#define ServerName RendererViewport689#define server_name RSG::viewport690691/* VIEWPORT TARGET API */692693FUNCRIDSPLIT(viewport)694695FUNC2(viewport_set_use_xr, RID, bool)696FUNC3(viewport_set_size, RID, int, int)697698FUNC2(viewport_set_active, RID, bool)699FUNC2(viewport_set_parent_viewport, RID, RID)700701FUNC2(viewport_set_clear_mode, RID, ViewportClearMode)702703FUNC3(viewport_attach_to_screen, RID, const Rect2 &, int)704FUNC2(viewport_set_render_direct_to_screen, RID, bool)705706FUNC2(viewport_set_scaling_3d_mode, RID, ViewportScaling3DMode)707FUNC2(viewport_set_scaling_3d_scale, RID, float)708FUNC2(viewport_set_fsr_sharpness, RID, float)709FUNC2(viewport_set_texture_mipmap_bias, RID, float)710FUNC2(viewport_set_anisotropic_filtering_level, RID, ViewportAnisotropicFiltering)711712FUNC2(viewport_set_update_mode, RID, ViewportUpdateMode)713FUNC1RC(ViewportUpdateMode, viewport_get_update_mode, RID)714715FUNC1RC(RID, viewport_get_render_target, RID)716FUNC1RC(RID, viewport_get_texture, RID)717718FUNC2(viewport_set_disable_2d, RID, bool)719FUNC2(viewport_set_environment_mode, RID, ViewportEnvironmentMode)720FUNC2(viewport_set_disable_3d, RID, bool)721722FUNC2(viewport_set_canvas_cull_mask, RID, uint32_t)723724FUNC2(viewport_attach_camera, RID, RID)725FUNC2(viewport_set_scenario, RID, RID)726FUNC2(viewport_attach_canvas, RID, RID)727728FUNC2(viewport_remove_canvas, RID, RID)729FUNC3(viewport_set_canvas_transform, RID, RID, const Transform2D &)730FUNC2(viewport_set_transparent_background, RID, bool)731FUNC2(viewport_set_use_hdr_2d, RID, bool)732FUNC1RC(bool, viewport_is_using_hdr_2d, RID)733FUNC2(viewport_set_snap_2d_transforms_to_pixel, RID, bool)734FUNC2(viewport_set_snap_2d_vertices_to_pixel, RID, bool)735736FUNC2(viewport_set_default_canvas_item_texture_filter, RID, CanvasItemTextureFilter)737FUNC2(viewport_set_default_canvas_item_texture_repeat, RID, CanvasItemTextureRepeat)738739FUNC2(viewport_set_global_canvas_transform, RID, const Transform2D &)740FUNC4(viewport_set_canvas_stacking, RID, RID, int, int)741FUNC3(viewport_set_positional_shadow_atlas_size, RID, int, bool)742FUNC3(viewport_set_sdf_oversize_and_scale, RID, ViewportSDFOversize, ViewportSDFScale)743FUNC3(viewport_set_positional_shadow_atlas_quadrant_subdivision, RID, int, int)744FUNC2(viewport_set_msaa_2d, RID, ViewportMSAA)745FUNC2(viewport_set_msaa_3d, RID, ViewportMSAA)746FUNC2(viewport_set_screen_space_aa, RID, ViewportScreenSpaceAA)747FUNC2(viewport_set_use_taa, RID, bool)748FUNC2(viewport_set_use_debanding, RID, bool)749FUNC2(viewport_set_force_motion_vectors, RID, bool)750FUNC2(viewport_set_use_occlusion_culling, RID, bool)751FUNC1(viewport_set_occlusion_rays_per_thread, int)752FUNC1(viewport_set_occlusion_culling_build_quality, ViewportOcclusionCullingBuildQuality)753FUNC2(viewport_set_mesh_lod_threshold, RID, float)754755FUNC3R(int, viewport_get_render_info, RID, ViewportRenderInfoType, ViewportRenderInfo)756FUNC2(viewport_set_debug_draw, RID, ViewportDebugDraw)757758FUNC2(viewport_set_measure_render_time, RID, bool)759FUNC1RC(double, viewport_get_measured_render_time_cpu, RID)760FUNC1RC(double, viewport_get_measured_render_time_gpu, RID)761FUNC1RC(RID, viewport_find_from_screen_attachment, DisplayServer::WindowID)762763FUNC2(call_set_vsync_mode, DisplayServer::VSyncMode, DisplayServer::WindowID)764765FUNC2(viewport_set_vrs_mode, RID, ViewportVRSMode)766FUNC2(viewport_set_vrs_update_mode, RID, ViewportVRSUpdateMode)767FUNC2(viewport_set_vrs_texture, RID, RID)768769/* COMPOSITOR EFFECT */770771#undef server_name772#undef ServerName773//from now on, calls forwarded to this singleton774#define ServerName RenderingMethod775#define server_name RSG::scene776777FUNCRIDSPLIT(compositor_effect)778FUNC2(compositor_effect_set_enabled, RID, bool)779FUNC3(compositor_effect_set_callback, RID, CompositorEffectCallbackType, const Callable &)780FUNC3(compositor_effect_set_flag, RID, CompositorEffectFlags, bool)781782/* COMPOSITOR */783784FUNC2(compositor_set_compositor_effects, RID, const TypedArray<RID> &)785786FUNCRIDSPLIT(compositor)787788/* ENVIRONMENT API */789790FUNC1(voxel_gi_set_quality, VoxelGIQuality)791792/* SKY API */793794FUNCRIDSPLIT(sky)795FUNC2(sky_set_radiance_size, RID, int)796FUNC2(sky_set_mode, RID, SkyMode)797FUNC2(sky_set_material, RID, RID)798FUNC4R(Ref<Image>, sky_bake_panorama, RID, float, bool, const Size2i &)799800/* ENVIRONMENT */801802FUNCRIDSPLIT(environment)803804FUNC2(environment_set_background, RID, EnvironmentBG)805FUNC2(environment_set_sky, RID, RID)806FUNC2(environment_set_sky_custom_fov, RID, float)807FUNC2(environment_set_sky_orientation, RID, const Basis &)808FUNC2(environment_set_bg_color, RID, const Color &)809FUNC3(environment_set_bg_energy, RID, float, float)810FUNC2(environment_set_canvas_max_layer, RID, int)811FUNC6(environment_set_ambient_light, RID, const Color &, EnvironmentAmbientSource, float, float, EnvironmentReflectionSource)812813FUNC2(environment_set_camera_feed_id, RID, int)814815FUNC6(environment_set_ssr, RID, bool, int, float, float, float)816FUNC1(environment_set_ssr_roughness_quality, EnvironmentSSRRoughnessQuality)817818FUNC10(environment_set_ssao, RID, bool, float, float, float, float, float, float, float, float)819FUNC6(environment_set_ssao_quality, EnvironmentSSAOQuality, bool, float, int, float, float)820821FUNC6(environment_set_ssil, RID, bool, float, float, float, float)822FUNC6(environment_set_ssil_quality, EnvironmentSSILQuality, bool, float, int, float, float)823824FUNC13(environment_set_glow, RID, bool, Vector<float>, float, float, float, float, EnvironmentGlowBlendMode, float, float, float, float, RID)825FUNC1(environment_glow_set_use_bicubic_upscale, bool)826827FUNC4(environment_set_tonemap, RID, EnvironmentToneMapper, float, float)828829FUNC7(environment_set_adjustment, RID, bool, float, float, float, bool, RID)830831FUNC11(environment_set_fog, RID, bool, const Color &, float, float, float, float, float, float, float, EnvironmentFogMode)832833FUNC4(environment_set_fog_depth, RID, float, float, float)834FUNC14(environment_set_volumetric_fog, RID, bool, float, const Color &, const Color &, float, float, float, float, float, bool, float, float, float)835836FUNC2(environment_set_volumetric_fog_volume_size, int, int)837FUNC1(environment_set_volumetric_fog_filter_active, bool)838839FUNC11(environment_set_sdfgi, RID, bool, int, float, EnvironmentSDFGIYScale, bool, float, bool, float, float, float)840FUNC1(environment_set_sdfgi_ray_count, EnvironmentSDFGIRayCount)841FUNC1(environment_set_sdfgi_frames_to_converge, EnvironmentSDFGIFramesToConverge)842FUNC1(environment_set_sdfgi_frames_to_update_light, EnvironmentSDFGIFramesToUpdateLight)843844FUNC3R(Ref<Image>, environment_bake_panorama, RID, bool, const Size2i &)845846FUNC3(screen_space_roughness_limiter_set_active, bool, float, float)847FUNC1(sub_surface_scattering_set_quality, SubSurfaceScatteringQuality)848FUNC2(sub_surface_scattering_set_scale, float, float)849850FUNC1(positional_soft_shadow_filter_set_quality, ShadowQuality);851FUNC1(directional_soft_shadow_filter_set_quality, ShadowQuality);852FUNC1(decals_set_filter, RS::DecalFilter);853FUNC1(light_projectors_set_filter, RS::LightProjectorFilter);854FUNC1(lightmaps_set_bicubic_filter, bool);855856/* CAMERA ATTRIBUTES */857858#undef server_name859#undef ServerName860//from now on, calls forwarded to this singleton861#define ServerName RendererCameraAttributes862#define server_name RSG::camera_attributes863864FUNCRIDSPLIT(camera_attributes)865866FUNC2(camera_attributes_set_dof_blur_quality, DOFBlurQuality, bool)867FUNC1(camera_attributes_set_dof_blur_bokeh_shape, DOFBokehShape)868869FUNC8(camera_attributes_set_dof_blur, RID, bool, float, float, bool, float, float, float)870FUNC3(camera_attributes_set_exposure, RID, float, float)871FUNC6(camera_attributes_set_auto_exposure, RID, bool, float, float, float, float)872873/* SCENARIO API */874875#undef server_name876#undef ServerName877878#define ServerName RenderingMethod879#define server_name RSG::scene880881FUNCRIDSPLIT(scenario)882883FUNC2(scenario_set_environment, RID, RID)884FUNC2(scenario_set_camera_attributes, RID, RID)885FUNC2(scenario_set_fallback_environment, RID, RID)886FUNC2(scenario_set_compositor, RID, RID)887888/* INSTANCING API */889FUNCRIDSPLIT(instance)890891FUNC2(instance_set_base, RID, RID)892FUNC2(instance_set_scenario, RID, RID)893FUNC2(instance_set_layer_mask, RID, uint32_t)894FUNC3(instance_set_pivot_data, RID, float, bool)895FUNC2(instance_set_transform, RID, const Transform3D &)896FUNC2(instance_attach_object_instance_id, RID, ObjectID)897FUNC3(instance_set_blend_shape_weight, RID, int, float)898FUNC3(instance_set_surface_override_material, RID, int, RID)899FUNC2(instance_set_visible, RID, bool)900901FUNC1(instance_teleport, RID)902903FUNC2(instance_set_custom_aabb, RID, AABB)904905FUNC2(instance_attach_skeleton, RID, RID)906907FUNC2(instance_set_extra_visibility_margin, RID, real_t)908FUNC2(instance_set_visibility_parent, RID, RID)909910FUNC2(instance_set_ignore_culling, RID, bool)911912// don't use these in a game!913FUNC2RC(Vector<ObjectID>, instances_cull_aabb, const AABB &, RID)914FUNC3RC(Vector<ObjectID>, instances_cull_ray, const Vector3 &, const Vector3 &, RID)915FUNC2RC(Vector<ObjectID>, instances_cull_convex, const Vector<Plane> &, RID)916917FUNC3(instance_geometry_set_flag, RID, InstanceFlags, bool)918FUNC2(instance_geometry_set_cast_shadows_setting, RID, ShadowCastingSetting)919FUNC2(instance_geometry_set_material_override, RID, RID)920FUNC2(instance_geometry_set_material_overlay, RID, RID)921922FUNC6(instance_geometry_set_visibility_range, RID, float, float, float, float, VisibilityRangeFadeMode)923FUNC4(instance_geometry_set_lightmap, RID, RID, const Rect2 &, int)924FUNC2(instance_geometry_set_lod_bias, RID, float)925FUNC2(instance_geometry_set_transparency, RID, float)926FUNC3(instance_geometry_set_shader_parameter, RID, const StringName &, const Variant &)927FUNC2RC(Variant, instance_geometry_get_shader_parameter, RID, const StringName &)928FUNC2RC(Variant, instance_geometry_get_shader_parameter_default_value, RID, const StringName &)929FUNC2C(instance_geometry_get_shader_parameter_list, RID, List<PropertyInfo> *)930931FUNC3R(TypedArray<Image>, bake_render_uv2, RID, const TypedArray<RID> &, const Size2i &)932933FUNC1(gi_set_use_half_resolution, bool)934935#undef server_name936#undef ServerName937//from now on, calls forwarded to this singleton938#define ServerName RendererCanvasCull939#define server_name RSG::canvas940941/* CANVAS (2D) */942943FUNCRIDSPLIT(canvas)944FUNC3(canvas_set_item_mirroring, RID, RID, const Point2 &)945FUNC3(canvas_set_item_repeat, RID, const Point2 &, int)946FUNC2(canvas_set_modulate, RID, const Color &)947FUNC3(canvas_set_parent, RID, RID, float)948FUNC1(canvas_set_disable_scale, bool)949950FUNCRIDSPLIT(canvas_texture)951FUNC3(canvas_texture_set_channel, RID, CanvasTextureChannel, RID)952FUNC3(canvas_texture_set_shading_parameters, RID, const Color &, float)953954FUNC2(canvas_texture_set_texture_filter, RID, CanvasItemTextureFilter)955FUNC2(canvas_texture_set_texture_repeat, RID, CanvasItemTextureRepeat)956957FUNCRIDSPLIT(canvas_item)958FUNC2(canvas_item_set_parent, RID, RID)959960FUNC2(canvas_item_set_default_texture_filter, RID, CanvasItemTextureFilter)961FUNC2(canvas_item_set_default_texture_repeat, RID, CanvasItemTextureRepeat)962963FUNC2(canvas_item_set_visible, RID, bool)964FUNC2(canvas_item_set_light_mask, RID, int)965966FUNC2(canvas_item_set_visibility_layer, RID, uint32_t)967968FUNC2(canvas_item_set_update_when_visible, RID, bool)969970FUNC2(canvas_item_set_transform, RID, const Transform2D &)971FUNC2(canvas_item_set_clip, RID, bool)972FUNC2(canvas_item_set_distance_field_mode, RID, bool)973FUNC3(canvas_item_set_custom_rect, RID, bool, const Rect2 &)974FUNC2(canvas_item_set_modulate, RID, const Color &)975FUNC2(canvas_item_set_self_modulate, RID, const Color &)976977FUNC2(canvas_item_set_draw_behind_parent, RID, bool)978FUNC2(canvas_item_set_use_identity_transform, RID, bool)979980FUNC6(canvas_item_add_line, RID, const Point2 &, const Point2 &, const Color &, float, bool)981FUNC5(canvas_item_add_polyline, RID, const Vector<Point2> &, const Vector<Color> &, float, bool)982FUNC5(canvas_item_add_multiline, RID, const Vector<Point2> &, const Vector<Color> &, float, bool)983FUNC4(canvas_item_add_rect, RID, const Rect2 &, const Color &, bool)984FUNC5(canvas_item_add_circle, RID, const Point2 &, float, const Color &, bool)985FUNC6(canvas_item_add_texture_rect, RID, const Rect2 &, RID, bool, const Color &, bool)986FUNC7(canvas_item_add_texture_rect_region, RID, const Rect2 &, RID, const Rect2 &, const Color &, bool, bool)987FUNC8(canvas_item_add_msdf_texture_rect_region, RID, const Rect2 &, RID, const Rect2 &, const Color &, int, float, float)988FUNC5(canvas_item_add_lcd_texture_rect_region, RID, const Rect2 &, RID, const Rect2 &, const Color &)989FUNC10(canvas_item_add_nine_patch, RID, const Rect2 &, const Rect2 &, RID, const Vector2 &, const Vector2 &, NinePatchAxisMode, NinePatchAxisMode, bool, const Color &)990FUNC5(canvas_item_add_primitive, RID, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID)991FUNC5(canvas_item_add_polygon, RID, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID)992FUNC9(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)993FUNC5(canvas_item_add_mesh, RID, const RID &, const Transform2D &, const Color &, RID)994FUNC3(canvas_item_add_multimesh, RID, RID, RID)995FUNC3(canvas_item_add_particles, RID, RID, RID)996FUNC2(canvas_item_add_set_transform, RID, const Transform2D &)997FUNC2(canvas_item_add_clip_ignore, RID, bool)998FUNC5(canvas_item_add_animation_slice, RID, double, double, double, double)9991000FUNC2(canvas_item_set_sort_children_by_y, RID, bool)1001FUNC2(canvas_item_set_z_index, RID, int)1002FUNC2(canvas_item_set_z_as_relative_to_parent, RID, bool)1003FUNC3(canvas_item_set_copy_to_backbuffer, RID, bool, const Rect2 &)1004FUNC2(canvas_item_attach_skeleton, RID, RID)10051006FUNC1(canvas_item_clear, RID)1007FUNC2(canvas_item_set_draw_index, RID, int)10081009FUNC2(canvas_item_set_material, RID, RID)10101011FUNC3(canvas_item_set_instance_shader_parameter, RID, const StringName &, const Variant &)1012FUNC2RC(Variant, canvas_item_get_instance_shader_parameter, RID, const StringName &)1013FUNC2RC(Variant, canvas_item_get_instance_shader_parameter_default_value, RID, const StringName &)1014FUNC2C(canvas_item_get_instance_shader_parameter_list, RID, List<PropertyInfo> *)10151016FUNC2(canvas_item_set_use_parent_material, RID, bool)10171018FUNC5(canvas_item_set_visibility_notifier, RID, bool, const Rect2 &, const Callable &, const Callable &)10191020FUNC6(canvas_item_set_canvas_group_mode, RID, CanvasGroupMode, float, bool, float, bool)10211022FUNC1(canvas_item_set_debug_redraw, bool)1023FUNC0RC(bool, canvas_item_get_debug_redraw)10241025FUNC2(canvas_item_set_interpolated, RID, bool)1026FUNC1(canvas_item_reset_physics_interpolation, RID)1027FUNC2(canvas_item_transform_physics_interpolation, RID, const Transform2D &)10281029FUNCRIDSPLIT(canvas_light)10301031FUNC2(canvas_light_set_mode, RID, CanvasLightMode)10321033FUNC2(canvas_light_attach_to_canvas, RID, RID)1034FUNC2(canvas_light_set_enabled, RID, bool)1035FUNC2(canvas_light_set_texture_scale, RID, float)1036FUNC2(canvas_light_set_transform, RID, const Transform2D &)1037FUNC2(canvas_light_set_texture, RID, RID)1038FUNC2(canvas_light_set_texture_offset, RID, const Vector2 &)1039FUNC2(canvas_light_set_color, RID, const Color &)1040FUNC2(canvas_light_set_height, RID, float)1041FUNC2(canvas_light_set_energy, RID, float)1042FUNC3(canvas_light_set_z_range, RID, int, int)1043FUNC3(canvas_light_set_layer_range, RID, int, int)1044FUNC2(canvas_light_set_item_cull_mask, RID, int)1045FUNC2(canvas_light_set_item_shadow_cull_mask, RID, int)1046FUNC2(canvas_light_set_directional_distance, RID, float)10471048FUNC2(canvas_light_set_blend_mode, RID, CanvasLightBlendMode)10491050FUNC2(canvas_light_set_shadow_enabled, RID, bool)1051FUNC2(canvas_light_set_shadow_filter, RID, CanvasLightShadowFilter)1052FUNC2(canvas_light_set_shadow_color, RID, const Color &)1053FUNC2(canvas_light_set_shadow_smooth, RID, float)10541055FUNC2(canvas_light_set_interpolated, RID, bool)1056FUNC1(canvas_light_reset_physics_interpolation, RID)1057FUNC2(canvas_light_transform_physics_interpolation, RID, const Transform2D &)10581059FUNCRIDSPLIT(canvas_light_occluder)1060FUNC2(canvas_light_occluder_attach_to_canvas, RID, RID)1061FUNC2(canvas_light_occluder_set_enabled, RID, bool)1062FUNC2(canvas_light_occluder_set_polygon, RID, RID)1063FUNC2(canvas_light_occluder_set_as_sdf_collision, RID, bool)1064FUNC2(canvas_light_occluder_set_transform, RID, const Transform2D &)1065FUNC2(canvas_light_occluder_set_light_mask, RID, int)10661067FUNC2(canvas_light_occluder_set_interpolated, RID, bool)1068FUNC1(canvas_light_occluder_reset_physics_interpolation, RID)1069FUNC2(canvas_light_occluder_transform_physics_interpolation, RID, const Transform2D &)10701071FUNCRIDSPLIT(canvas_occluder_polygon)1072FUNC3(canvas_occluder_polygon_set_shape, RID, const Vector<Vector2> &, bool)10731074FUNC2(canvas_occluder_polygon_set_cull_mode, RID, CanvasOccluderPolygonCullMode)10751076FUNC1(canvas_set_shadow_texture_size, int)10771078FUNC1R(Rect2, _debug_canvas_item_get_rect, RID)10791080/* GLOBAL SHADER UNIFORMS */10811082#undef server_name1083#undef ServerName1084//from now on, calls forwarded to this singleton1085#define ServerName RendererMaterialStorage1086#define server_name RSG::material_storage10871088FUNC3(global_shader_parameter_add, const StringName &, GlobalShaderParameterType, const Variant &)1089FUNC1(global_shader_parameter_remove, const StringName &)1090FUNC0RC(Vector<StringName>, global_shader_parameter_get_list)1091FUNC2(global_shader_parameter_set, const StringName &, const Variant &)1092FUNC2(global_shader_parameter_set_override, const StringName &, const Variant &)1093FUNC1RC(GlobalShaderParameterType, global_shader_parameter_get_type, const StringName &)1094FUNC1RC(Variant, global_shader_parameter_get, const StringName &)10951096FUNC1(global_shader_parameters_load_settings, bool)1097FUNC0(global_shader_parameters_clear)10981099/* COMPOSITOR */11001101#undef server_name1102#undef ServerName1103#define ServerName RendererCompositor1104#define server_name RSG::rasterizer11051106FUNC4S(set_boot_image, const Ref<Image> &, const Color &, bool, bool)11071108/* STATUS INFORMATION */11091110#undef server_name1111#undef ServerName11121113/* UTILITIES */11141115#define ServerName RendererUtilities1116#define server_name RSG::utilities1117FUNC0RC(String, get_video_adapter_name)1118FUNC0RC(String, get_video_adapter_vendor)1119FUNC0RC(String, get_video_adapter_api_version)1120#undef server_name1121#undef ServerName1122#undef WRITE_ACTION1123#undef SYNC_DEBUG1124#ifdef DEBUG_ENABLED1125#undef MAIN_THREAD_SYNC_WARN1126#endif11271128virtual uint64_t get_rendering_info(RenderingInfo p_info) override;1129virtual RenderingDevice::DeviceType get_video_adapter_type() const override;11301131virtual void set_frame_profiling_enabled(bool p_enable) override;1132virtual Vector<FrameProfileArea> get_frame_profile() override;1133virtual uint64_t get_frame_profile_frame() override;11341135virtual RID get_test_cube() override;11361137/* FREE */11381139virtual void free(RID p_rid) override {1140if (Thread::get_caller_id() == server_thread) {1141command_queue.flush_if_pending();1142_free(p_rid);1143} else {1144command_queue.push(this, &RenderingServerDefault::_free, p_rid);1145}1146}11471148/* INTERPOLATION */11491150virtual void set_physics_interpolation_enabled(bool p_enabled) override;11511152/* EVENT QUEUING */11531154virtual void request_frame_drawn_callback(const Callable &p_callable) override;11551156virtual void draw(bool p_present, double frame_step) override;1157virtual void sync() override;1158virtual bool has_changed() const override;1159virtual void init() override;1160virtual void finish() override;1161virtual void tick() override;1162virtual void pre_draw(bool p_will_draw) override;11631164virtual bool is_on_render_thread() override {1165return Thread::get_caller_id() == server_thread;1166}11671168virtual void call_on_render_thread(const Callable &p_callable) override {1169if (Thread::get_caller_id() == server_thread) {1170command_queue.flush_if_pending();1171p_callable.call();1172} else {1173command_queue.push(this, &RenderingServerDefault::_call_on_render_thread, p_callable);1174}1175}11761177/* TESTING */11781179virtual double get_frame_setup_time_cpu() const override;11801181virtual Color get_default_clear_color() override;1182virtual void set_default_clear_color(const Color &p_color) override;11831184#ifndef DISABLE_DEPRECATED1185virtual bool has_feature(Features p_feature) const override;1186#endif11871188virtual bool has_os_feature(const String &p_feature) const override;1189virtual void set_debug_generate_wireframes(bool p_generate) override;11901191virtual bool is_low_end() const override;11921193virtual void sdfgi_set_debug_probe_select(const Vector3 &p_position, const Vector3 &p_dir) override;11941195virtual void set_print_gpu_profile(bool p_enable) override;11961197virtual Size2i get_maximum_viewport_size() const override;11981199RenderingServerDefault(bool p_create_thread = false);1200~RenderingServerDefault();1201};120212031204