rendering_server_default.h 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903
  1. /*************************************************************************/
  2. /* rendering_server_default.h */
  3. /*************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /*************************************************************************/
  8. /* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
  9. /* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /*************************************************************************/
  30. #ifndef RENDERING_SERVER_DEFAULT_H
  31. #define RENDERING_SERVER_DEFAULT_H
  32. #include "core/math/octree.h"
  33. #include "core/templates/ordered_hash_map.h"
  34. #include "renderer_canvas_cull.h"
  35. #include "renderer_scene_cull.h"
  36. #include "renderer_viewport.h"
  37. #include "rendering_server_globals.h"
  38. #include "servers/rendering/renderer_compositor.h"
  39. #include "servers/rendering_server.h"
  40. class RenderingServerDefault : public RenderingServer {
  41. enum {
  42. MAX_INSTANCE_CULL = 8192,
  43. MAX_INSTANCE_LIGHTS = 4,
  44. LIGHT_CACHE_DIRTY = -1,
  45. MAX_LIGHTS_CULLED = 256,
  46. MAX_ROOM_CULL = 32,
  47. MAX_EXTERIOR_PORTALS = 128,
  48. MAX_LIGHT_SAMPLERS = 256,
  49. INSTANCE_ROOMLESS_MASK = (1 << 20)
  50. };
  51. static int changes;
  52. RID test_cube;
  53. int black_margin[4];
  54. RID black_image[4];
  55. struct FrameDrawnCallbacks {
  56. ObjectID object;
  57. StringName method;
  58. Variant param;
  59. };
  60. List<FrameDrawnCallbacks> frame_drawn_callbacks;
  61. void _draw_margins();
  62. static void _changes_changed() {}
  63. uint64_t frame_profile_frame;
  64. Vector<FrameProfileArea> frame_profile;
  65. float frame_setup_time = 0;
  66. //for printing
  67. bool print_gpu_profile = false;
  68. OrderedHashMap<String, float> print_gpu_profile_task_time;
  69. uint64_t print_frame_profile_ticks_from = 0;
  70. uint32_t print_frame_profile_frame_count = 0;
  71. public:
  72. //if editor is redrawing when it shouldn't, enable this and put a breakpoint in _changes_changed()
  73. //#define DEBUG_CHANGES
  74. #ifdef DEBUG_CHANGES
  75. _FORCE_INLINE_ static void redraw_request() {
  76. changes++;
  77. _changes_changed();
  78. }
  79. #define DISPLAY_CHANGED \
  80. changes++; \
  81. _changes_changed();
  82. #else
  83. _FORCE_INLINE_ static void redraw_request() { changes++; }
  84. #define DISPLAY_CHANGED \
  85. changes++;
  86. #endif
  87. #define BIND0R(m_r, m_name) \
  88. m_r m_name() { return BINDBASE->m_name(); }
  89. #define BIND0RC(m_r, m_name) \
  90. m_r m_name() const { return BINDBASE->m_name(); }
  91. #define BIND1R(m_r, m_name, m_type1) \
  92. m_r m_name(m_type1 arg1) { return BINDBASE->m_name(arg1); }
  93. #define BIND1RC(m_r, m_name, m_type1) \
  94. m_r m_name(m_type1 arg1) const { return BINDBASE->m_name(arg1); }
  95. #define BIND2R(m_r, m_name, m_type1, m_type2) \
  96. m_r m_name(m_type1 arg1, m_type2 arg2) { return BINDBASE->m_name(arg1, arg2); }
  97. #define BIND2RC(m_r, m_name, m_type1, m_type2) \
  98. m_r m_name(m_type1 arg1, m_type2 arg2) const { return BINDBASE->m_name(arg1, arg2); }
  99. #define BIND3R(m_r, m_name, m_type1, m_type2, m_type3) \
  100. m_r m_name(m_type1 arg1, m_type2 arg2, m_type3 arg3) { return BINDBASE->m_name(arg1, arg2, arg3); }
  101. #define BIND3RC(m_r, m_name, m_type1, m_type2, m_type3) \
  102. m_r m_name(m_type1 arg1, m_type2 arg2, m_type3 arg3) const { return BINDBASE->m_name(arg1, arg2, arg3); }
  103. #define BIND4R(m_r, m_name, m_type1, m_type2, m_type3, m_type4) \
  104. m_r m_name(m_type1 arg1, m_type2 arg2, m_type3 arg3, m_type4 arg4) { return BINDBASE->m_name(arg1, arg2, arg3, arg4); }
  105. #define BIND4RC(m_r, m_name, m_type1, m_type2, m_type3, m_type4) \
  106. m_r m_name(m_type1 arg1, m_type2 arg2, m_type3 arg3, m_type4 arg4) const { return BINDBASE->m_name(arg1, arg2, arg3, arg4); }
  107. #define BIND5R(m_r, m_name, m_type1, m_type2, m_type3, m_type4, m_type5) \
  108. m_r m_name(m_type1 arg1, m_type2 arg2, m_type3 arg3, m_type4 arg4, m_type5 arg5) { return BINDBASE->m_name(arg1, arg2, arg3, arg4, arg5); }
  109. #define BIND5RC(m_r, m_name, m_type1, m_type2, m_type3, m_type4, m_type5) \
  110. m_r m_name(m_type1 arg1, m_type2 arg2, m_type3 arg3, m_type4 arg4, m_type5 arg5) const { return BINDBASE->m_name(arg1, arg2, arg3, arg4, arg5); }
  111. #define BIND6R(m_r, m_name, m_type1, m_type2, m_type3, m_type4, m_type5, m_type6) \
  112. m_r m_name(m_type1 arg1, m_type2 arg2, m_type3 arg3, m_type4 arg4, m_type5 arg5, m_type6 arg6) { return BINDBASE->m_name(arg1, arg2, arg3, arg4, arg5, arg6); }
  113. #define BIND6RC(m_r, m_name, m_type1, m_type2, m_type3, m_type4, m_type5, m_type6) \
  114. m_r m_name(m_type1 arg1, m_type2 arg2, m_type3 arg3, m_type4 arg4, m_type5 arg5, m_type6 arg6) const { return BINDBASE->m_name(arg1, arg2, arg3, arg4, arg5, arg6); }
  115. #define BIND0(m_name) \
  116. void m_name() { DISPLAY_CHANGED BINDBASE->m_name(); }
  117. #define BIND1(m_name, m_type1) \
  118. void m_name(m_type1 arg1) { DISPLAY_CHANGED BINDBASE->m_name(arg1); }
  119. #define BIND1C(m_name, m_type1) \
  120. void m_name(m_type1 arg1) const { DISPLAY_CHANGED BINDBASE->m_name(arg1); }
  121. #define BIND2(m_name, m_type1, m_type2) \
  122. void m_name(m_type1 arg1, m_type2 arg2) { DISPLAY_CHANGED BINDBASE->m_name(arg1, arg2); }
  123. #define BIND2C(m_name, m_type1, m_type2) \
  124. void m_name(m_type1 arg1, m_type2 arg2) const { BINDBASE->m_name(arg1, arg2); }
  125. #define BIND3(m_name, m_type1, m_type2, m_type3) \
  126. void m_name(m_type1 arg1, m_type2 arg2, m_type3 arg3) { DISPLAY_CHANGED BINDBASE->m_name(arg1, arg2, arg3); }
  127. #define BIND4(m_name, m_type1, m_type2, m_type3, m_type4) \
  128. void m_name(m_type1 arg1, m_type2 arg2, m_type3 arg3, m_type4 arg4) { DISPLAY_CHANGED BINDBASE->m_name(arg1, arg2, arg3, arg4); }
  129. #define BIND5(m_name, m_type1, m_type2, m_type3, m_type4, m_type5) \
  130. void m_name(m_type1 arg1, m_type2 arg2, m_type3 arg3, m_type4 arg4, m_type5 arg5) { DISPLAY_CHANGED BINDBASE->m_name(arg1, arg2, arg3, arg4, arg5); }
  131. #define BIND6(m_name, m_type1, m_type2, m_type3, m_type4, m_type5, m_type6) \
  132. void m_name(m_type1 arg1, m_type2 arg2, m_type3 arg3, m_type4 arg4, m_type5 arg5, m_type6 arg6) { DISPLAY_CHANGED BINDBASE->m_name(arg1, arg2, arg3, arg4, arg5, arg6); }
  133. #define BIND7(m_name, m_type1, m_type2, m_type3, m_type4, m_type5, m_type6, m_type7) \
  134. void m_name(m_type1 arg1, m_type2 arg2, m_type3 arg3, m_type4 arg4, m_type5 arg5, m_type6 arg6, m_type7 arg7) { DISPLAY_CHANGED BINDBASE->m_name(arg1, arg2, arg3, arg4, arg5, arg6, arg7); }
  135. #define BIND8(m_name, m_type1, m_type2, m_type3, m_type4, m_type5, m_type6, m_type7, m_type8) \
  136. void m_name(m_type1 arg1, m_type2 arg2, m_type3 arg3, m_type4 arg4, m_type5 arg5, m_type6 arg6, m_type7 arg7, m_type8 arg8) { DISPLAY_CHANGED BINDBASE->m_name(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); }
  137. #define BIND9(m_name, m_type1, m_type2, m_type3, m_type4, m_type5, m_type6, m_type7, m_type8, m_type9) \
  138. void m_name(m_type1 arg1, m_type2 arg2, m_type3 arg3, m_type4 arg4, m_type5 arg5, m_type6 arg6, m_type7 arg7, m_type8 arg8, m_type9 arg9) { DISPLAY_CHANGED BINDBASE->m_name(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); }
  139. #define BIND10(m_name, m_type1, m_type2, m_type3, m_type4, m_type5, m_type6, m_type7, m_type8, m_type9, m_type10) \
  140. void m_name(m_type1 arg1, m_type2 arg2, m_type3 arg3, m_type4 arg4, m_type5 arg5, m_type6 arg6, m_type7 arg7, m_type8 arg8, m_type9 arg9, m_type10 arg10) { DISPLAY_CHANGED BINDBASE->m_name(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); }
  141. #define BIND11(m_name, m_type1, m_type2, m_type3, m_type4, m_type5, m_type6, m_type7, m_type8, m_type9, m_type10, m_type11) \
  142. void m_name(m_type1 arg1, m_type2 arg2, m_type3 arg3, m_type4 arg4, m_type5 arg5, m_type6 arg6, m_type7 arg7, m_type8 arg8, m_type9 arg9, m_type10 arg10, m_type11 arg11) { DISPLAY_CHANGED BINDBASE->m_name(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11); }
  143. #define BIND12(m_name, m_type1, m_type2, m_type3, m_type4, m_type5, m_type6, m_type7, m_type8, m_type9, m_type10, m_type11, m_type12) \
  144. void m_name(m_type1 arg1, m_type2 arg2, m_type3 arg3, m_type4 arg4, m_type5 arg5, m_type6 arg6, m_type7 arg7, m_type8 arg8, m_type9 arg9, m_type10 arg10, m_type11 arg11, m_type12 arg12) { DISPLAY_CHANGED BINDBASE->m_name(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12); }
  145. #define BIND13(m_name, m_type1, m_type2, m_type3, m_type4, m_type5, m_type6, m_type7, m_type8, m_type9, m_type10, m_type11, m_type12, m_type13) \
  146. void m_name(m_type1 arg1, m_type2 arg2, m_type3 arg3, m_type4 arg4, m_type5 arg5, m_type6 arg6, m_type7 arg7, m_type8 arg8, m_type9 arg9, m_type10 arg10, m_type11 arg11, m_type12 arg12, m_type13 arg13) { DISPLAY_CHANGED BINDBASE->m_name(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13); }
  147. #define BIND14(m_name, m_type1, m_type2, m_type3, m_type4, m_type5, m_type6, m_type7, m_type8, m_type9, m_type10, m_type11, m_type12, m_type13, m_type14) \
  148. void m_name(m_type1 arg1, m_type2 arg2, m_type3 arg3, m_type4 arg4, m_type5 arg5, m_type6 arg6, m_type7 arg7, m_type8 arg8, m_type9 arg9, m_type10 arg10, m_type11 arg11, m_type12 arg12, m_type13 arg13, m_type14 arg14) { DISPLAY_CHANGED BINDBASE->m_name(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14); }
  149. #define BIND15(m_name, m_type1, m_type2, m_type3, m_type4, m_type5, m_type6, m_type7, m_type8, m_type9, m_type10, m_type11, m_type12, m_type13, m_type14, m_type15) \
  150. void m_name(m_type1 arg1, m_type2 arg2, m_type3 arg3, m_type4 arg4, m_type5 arg5, m_type6 arg6, m_type7 arg7, m_type8 arg8, m_type9 arg9, m_type10 arg10, m_type11 arg11, m_type12 arg12, m_type13 arg13, m_type14 arg14, m_type15 arg15) { DISPLAY_CHANGED BINDBASE->m_name(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15); }
  151. //from now on, calls forwarded to this singleton
  152. #define BINDBASE RSG::storage
  153. /* TEXTURE API */
  154. //these go pass-through, as they can be called from any thread
  155. BIND1R(RID, texture_2d_create, const Ref<Image> &)
  156. BIND2R(RID, texture_2d_layered_create, const Vector<Ref<Image>> &, TextureLayeredType)
  157. BIND6R(RID, texture_3d_create, Image::Format, int, int, int, bool, const Vector<Ref<Image>> &)
  158. BIND1R(RID, texture_proxy_create, RID)
  159. //goes pass-through
  160. BIND3(texture_2d_update_immediate, RID, const Ref<Image> &, int)
  161. //these go through command queue if they are in another thread
  162. BIND3(texture_2d_update, RID, const Ref<Image> &, int)
  163. BIND2(texture_3d_update, RID, const Vector<Ref<Image>> &)
  164. BIND2(texture_proxy_update, RID, RID)
  165. //these also go pass-through
  166. BIND0R(RID, texture_2d_placeholder_create)
  167. BIND1R(RID, texture_2d_layered_placeholder_create, TextureLayeredType)
  168. BIND0R(RID, texture_3d_placeholder_create)
  169. BIND1RC(Ref<Image>, texture_2d_get, RID)
  170. BIND2RC(Ref<Image>, texture_2d_layer_get, RID, int)
  171. BIND1RC(Vector<Ref<Image>>, texture_3d_get, RID)
  172. BIND2(texture_replace, RID, RID)
  173. BIND3(texture_set_size_override, RID, int, int)
  174. // FIXME: Disabled during Vulkan refactoring, should be ported.
  175. #if 0
  176. BIND2(texture_bind, RID, uint32_t)
  177. #endif
  178. BIND3(texture_set_detect_3d_callback, RID, TextureDetectCallback, void *)
  179. BIND3(texture_set_detect_normal_callback, RID, TextureDetectCallback, void *)
  180. BIND3(texture_set_detect_roughness_callback, RID, TextureDetectRoughnessCallback, void *)
  181. BIND2(texture_set_path, RID, const String &)
  182. BIND1RC(String, texture_get_path, RID)
  183. BIND1(texture_debug_usage, List<TextureInfo> *)
  184. BIND2(texture_set_force_redraw_if_visible, RID, bool)
  185. /* SHADER API */
  186. BIND0R(RID, shader_create)
  187. BIND2(shader_set_code, RID, const String &)
  188. BIND1RC(String, shader_get_code, RID)
  189. BIND2C(shader_get_param_list, RID, List<PropertyInfo> *)
  190. BIND3(shader_set_default_texture_param, RID, const StringName &, RID)
  191. BIND2RC(RID, shader_get_default_texture_param, RID, const StringName &)
  192. BIND2RC(Variant, shader_get_param_default, RID, const StringName &)
  193. BIND1RC(ShaderNativeSourceCode, shader_get_native_source_code, RID)
  194. /* COMMON MATERIAL API */
  195. BIND0R(RID, material_create)
  196. BIND2(material_set_shader, RID, RID)
  197. BIND3(material_set_param, RID, const StringName &, const Variant &)
  198. BIND2RC(Variant, material_get_param, RID, const StringName &)
  199. BIND2(material_set_render_priority, RID, int)
  200. BIND2(material_set_next_pass, RID, RID)
  201. /* MESH API */
  202. virtual RID mesh_create_from_surfaces(const Vector<SurfaceData> &p_surfaces, int p_blend_shape_count = 0) {
  203. RID mesh = mesh_create();
  204. mesh_set_blend_shape_count(mesh, p_blend_shape_count);
  205. for (int i = 0; i < p_surfaces.size(); i++) {
  206. mesh_add_surface(mesh, p_surfaces[i]);
  207. }
  208. return mesh;
  209. }
  210. BIND2(mesh_set_blend_shape_count, RID, int)
  211. BIND0R(RID, mesh_create)
  212. BIND2(mesh_add_surface, RID, const SurfaceData &)
  213. BIND1RC(int, mesh_get_blend_shape_count, RID)
  214. BIND2(mesh_set_blend_shape_mode, RID, BlendShapeMode)
  215. BIND1RC(BlendShapeMode, mesh_get_blend_shape_mode, RID)
  216. BIND4(mesh_surface_update_region, RID, int, int, const Vector<uint8_t> &)
  217. BIND3(mesh_surface_set_material, RID, int, RID)
  218. BIND2RC(RID, mesh_surface_get_material, RID, int)
  219. BIND2RC(SurfaceData, mesh_get_surface, RID, int)
  220. BIND1RC(int, mesh_get_surface_count, RID)
  221. BIND2(mesh_set_custom_aabb, RID, const AABB &)
  222. BIND1RC(AABB, mesh_get_custom_aabb, RID)
  223. BIND2(mesh_set_shadow_mesh, RID, RID)
  224. BIND1(mesh_clear, RID)
  225. /* MULTIMESH API */
  226. BIND0R(RID, multimesh_create)
  227. BIND5(multimesh_allocate, RID, int, MultimeshTransformFormat, bool, bool)
  228. BIND1RC(int, multimesh_get_instance_count, RID)
  229. BIND2(multimesh_set_mesh, RID, RID)
  230. BIND3(multimesh_instance_set_transform, RID, int, const Transform &)
  231. BIND3(multimesh_instance_set_transform_2d, RID, int, const Transform2D &)
  232. BIND3(multimesh_instance_set_color, RID, int, const Color &)
  233. BIND3(multimesh_instance_set_custom_data, RID, int, const Color &)
  234. BIND1RC(RID, multimesh_get_mesh, RID)
  235. BIND1RC(AABB, multimesh_get_aabb, RID)
  236. BIND2RC(Transform, multimesh_instance_get_transform, RID, int)
  237. BIND2RC(Transform2D, multimesh_instance_get_transform_2d, RID, int)
  238. BIND2RC(Color, multimesh_instance_get_color, RID, int)
  239. BIND2RC(Color, multimesh_instance_get_custom_data, RID, int)
  240. BIND2(multimesh_set_buffer, RID, const Vector<float> &)
  241. BIND1RC(Vector<float>, multimesh_get_buffer, RID)
  242. BIND2(multimesh_set_visible_instances, RID, int)
  243. BIND1RC(int, multimesh_get_visible_instances, RID)
  244. /* IMMEDIATE API */
  245. BIND0R(RID, immediate_create)
  246. BIND3(immediate_begin, RID, PrimitiveType, RID)
  247. BIND2(immediate_vertex, RID, const Vector3 &)
  248. BIND2(immediate_normal, RID, const Vector3 &)
  249. BIND2(immediate_tangent, RID, const Plane &)
  250. BIND2(immediate_color, RID, const Color &)
  251. BIND2(immediate_uv, RID, const Vector2 &)
  252. BIND2(immediate_uv2, RID, const Vector2 &)
  253. BIND1(immediate_end, RID)
  254. BIND1(immediate_clear, RID)
  255. BIND2(immediate_set_material, RID, RID)
  256. BIND1RC(RID, immediate_get_material, RID)
  257. /* SKELETON API */
  258. BIND0R(RID, skeleton_create)
  259. BIND3(skeleton_allocate, RID, int, bool)
  260. BIND1RC(int, skeleton_get_bone_count, RID)
  261. BIND3(skeleton_bone_set_transform, RID, int, const Transform &)
  262. BIND2RC(Transform, skeleton_bone_get_transform, RID, int)
  263. BIND3(skeleton_bone_set_transform_2d, RID, int, const Transform2D &)
  264. BIND2RC(Transform2D, skeleton_bone_get_transform_2d, RID, int)
  265. BIND2(skeleton_set_base_transform_2d, RID, const Transform2D &)
  266. /* Light API */
  267. BIND0R(RID, directional_light_create)
  268. BIND0R(RID, omni_light_create)
  269. BIND0R(RID, spot_light_create)
  270. BIND2(light_set_color, RID, const Color &)
  271. BIND3(light_set_param, RID, LightParam, float)
  272. BIND2(light_set_shadow, RID, bool)
  273. BIND2(light_set_shadow_color, RID, const Color &)
  274. BIND2(light_set_projector, RID, RID)
  275. BIND2(light_set_negative, RID, bool)
  276. BIND2(light_set_cull_mask, RID, uint32_t)
  277. BIND2(light_set_reverse_cull_face_mode, RID, bool)
  278. BIND2(light_set_bake_mode, RID, LightBakeMode)
  279. BIND2(light_set_max_sdfgi_cascade, RID, uint32_t)
  280. BIND2(light_omni_set_shadow_mode, RID, LightOmniShadowMode)
  281. BIND2(light_directional_set_shadow_mode, RID, LightDirectionalShadowMode)
  282. BIND2(light_directional_set_blend_splits, RID, bool)
  283. BIND2(light_directional_set_sky_only, RID, bool)
  284. BIND2(light_directional_set_shadow_depth_range_mode, RID, LightDirectionalShadowDepthRangeMode)
  285. /* PROBE API */
  286. BIND0R(RID, reflection_probe_create)
  287. BIND2(reflection_probe_set_update_mode, RID, ReflectionProbeUpdateMode)
  288. BIND2(reflection_probe_set_intensity, RID, float)
  289. BIND2(reflection_probe_set_ambient_color, RID, const Color &)
  290. BIND2(reflection_probe_set_ambient_energy, RID, float)
  291. BIND2(reflection_probe_set_ambient_mode, RID, ReflectionProbeAmbientMode)
  292. BIND2(reflection_probe_set_max_distance, RID, float)
  293. BIND2(reflection_probe_set_extents, RID, const Vector3 &)
  294. BIND2(reflection_probe_set_origin_offset, RID, const Vector3 &)
  295. BIND2(reflection_probe_set_as_interior, RID, bool)
  296. BIND2(reflection_probe_set_enable_box_projection, RID, bool)
  297. BIND2(reflection_probe_set_enable_shadows, RID, bool)
  298. BIND2(reflection_probe_set_cull_mask, RID, uint32_t)
  299. BIND2(reflection_probe_set_resolution, RID, int)
  300. BIND2(reflection_probe_set_lod_threshold, RID, float)
  301. /* DECAL API */
  302. BIND0R(RID, decal_create)
  303. BIND2(decal_set_extents, RID, const Vector3 &)
  304. BIND3(decal_set_texture, RID, DecalTexture, RID)
  305. BIND2(decal_set_emission_energy, RID, float)
  306. BIND2(decal_set_albedo_mix, RID, float)
  307. BIND2(decal_set_modulate, RID, const Color &)
  308. BIND2(decal_set_cull_mask, RID, uint32_t)
  309. BIND4(decal_set_distance_fade, RID, bool, float, float)
  310. BIND3(decal_set_fade, RID, float, float)
  311. BIND2(decal_set_normal_fade, RID, float)
  312. /* BAKED LIGHT API */
  313. BIND0R(RID, gi_probe_create)
  314. BIND8(gi_probe_allocate, RID, const Transform &, const AABB &, const Vector3i &, const Vector<uint8_t> &, const Vector<uint8_t> &, const Vector<uint8_t> &, const Vector<int> &)
  315. BIND1RC(AABB, gi_probe_get_bounds, RID)
  316. BIND1RC(Vector3i, gi_probe_get_octree_size, RID)
  317. BIND1RC(Vector<uint8_t>, gi_probe_get_octree_cells, RID)
  318. BIND1RC(Vector<uint8_t>, gi_probe_get_data_cells, RID)
  319. BIND1RC(Vector<uint8_t>, gi_probe_get_distance_field, RID)
  320. BIND1RC(Vector<int>, gi_probe_get_level_counts, RID)
  321. BIND1RC(Transform, gi_probe_get_to_cell_xform, RID)
  322. BIND2(gi_probe_set_dynamic_range, RID, float)
  323. BIND1RC(float, gi_probe_get_dynamic_range, RID)
  324. BIND2(gi_probe_set_propagation, RID, float)
  325. BIND1RC(float, gi_probe_get_propagation, RID)
  326. BIND2(gi_probe_set_energy, RID, float)
  327. BIND1RC(float, gi_probe_get_energy, RID)
  328. BIND2(gi_probe_set_ao, RID, float)
  329. BIND1RC(float, gi_probe_get_ao, RID)
  330. BIND2(gi_probe_set_ao_size, RID, float)
  331. BIND1RC(float, gi_probe_get_ao_size, RID)
  332. BIND2(gi_probe_set_bias, RID, float)
  333. BIND1RC(float, gi_probe_get_bias, RID)
  334. BIND2(gi_probe_set_normal_bias, RID, float)
  335. BIND1RC(float, gi_probe_get_normal_bias, RID)
  336. BIND2(gi_probe_set_interior, RID, bool)
  337. BIND1RC(bool, gi_probe_is_interior, RID)
  338. BIND2(gi_probe_set_use_two_bounces, RID, bool)
  339. BIND1RC(bool, gi_probe_is_using_two_bounces, RID)
  340. BIND2(gi_probe_set_anisotropy_strength, RID, float)
  341. BIND1RC(float, gi_probe_get_anisotropy_strength, RID)
  342. /* LIGHTMAP */
  343. BIND0R(RID, lightmap_create)
  344. BIND3(lightmap_set_textures, RID, RID, bool)
  345. BIND2(lightmap_set_probe_bounds, RID, const AABB &)
  346. BIND2(lightmap_set_probe_interior, RID, bool)
  347. BIND5(lightmap_set_probe_capture_data, RID, const PackedVector3Array &, const PackedColorArray &, const PackedInt32Array &, const PackedInt32Array &)
  348. BIND1RC(PackedVector3Array, lightmap_get_probe_capture_points, RID)
  349. BIND1RC(PackedColorArray, lightmap_get_probe_capture_sh, RID)
  350. BIND1RC(PackedInt32Array, lightmap_get_probe_capture_tetrahedra, RID)
  351. BIND1RC(PackedInt32Array, lightmap_get_probe_capture_bsp_tree, RID)
  352. BIND1(lightmap_set_probe_capture_update_speed, float)
  353. /* PARTICLES */
  354. BIND0R(RID, particles_create)
  355. BIND2(particles_set_emitting, RID, bool)
  356. BIND1R(bool, particles_get_emitting, RID)
  357. BIND2(particles_set_amount, RID, int)
  358. BIND2(particles_set_lifetime, RID, float)
  359. BIND2(particles_set_one_shot, RID, bool)
  360. BIND2(particles_set_pre_process_time, RID, float)
  361. BIND2(particles_set_explosiveness_ratio, RID, float)
  362. BIND2(particles_set_randomness_ratio, RID, float)
  363. BIND2(particles_set_custom_aabb, RID, const AABB &)
  364. BIND2(particles_set_speed_scale, RID, float)
  365. BIND2(particles_set_use_local_coordinates, RID, bool)
  366. BIND2(particles_set_process_material, RID, RID)
  367. BIND2(particles_set_fixed_fps, RID, int)
  368. BIND2(particles_set_fractional_delta, RID, bool)
  369. BIND1R(bool, particles_is_inactive, RID)
  370. BIND1(particles_request_process, RID)
  371. BIND1(particles_restart, RID)
  372. BIND6(particles_emit, RID, const Transform &, const Vector3 &, const Color &, const Color &, uint32_t)
  373. BIND2(particles_set_subemitter, RID, RID)
  374. BIND2(particles_set_collision_base_size, RID, float)
  375. BIND2(particles_set_draw_order, RID, RS::ParticlesDrawOrder)
  376. BIND2(particles_set_draw_passes, RID, int)
  377. BIND3(particles_set_draw_pass_mesh, RID, int, RID)
  378. BIND1R(AABB, particles_get_current_aabb, RID)
  379. BIND2(particles_set_emission_transform, RID, const Transform &)
  380. /* PARTICLES COLLISION */
  381. BIND0R(RID, particles_collision_create)
  382. BIND2(particles_collision_set_collision_type, RID, ParticlesCollisionType)
  383. BIND2(particles_collision_set_cull_mask, RID, uint32_t)
  384. BIND2(particles_collision_set_sphere_radius, RID, float)
  385. BIND2(particles_collision_set_box_extents, RID, const Vector3 &)
  386. BIND2(particles_collision_set_attractor_strength, RID, float)
  387. BIND2(particles_collision_set_attractor_directionality, RID, float)
  388. BIND2(particles_collision_set_attractor_attenuation, RID, float)
  389. BIND2(particles_collision_set_field_texture, RID, RID)
  390. BIND1(particles_collision_height_field_update, RID)
  391. BIND2(particles_collision_set_height_field_resolution, RID, ParticlesCollisionHeightfieldResolution)
  392. #undef BINDBASE
  393. //from now on, calls forwarded to this singleton
  394. #define BINDBASE RSG::scene
  395. /* CAMERA API */
  396. BIND0R(RID, camera_create)
  397. BIND4(camera_set_perspective, RID, float, float, float)
  398. BIND4(camera_set_orthogonal, RID, float, float, float)
  399. BIND5(camera_set_frustum, RID, float, Vector2, float, float)
  400. BIND2(camera_set_transform, RID, const Transform &)
  401. BIND2(camera_set_cull_mask, RID, uint32_t)
  402. BIND2(camera_set_environment, RID, RID)
  403. BIND2(camera_set_camera_effects, RID, RID)
  404. BIND2(camera_set_use_vertical_aspect, RID, bool)
  405. #undef BINDBASE
  406. //from now on, calls forwarded to this singleton
  407. #define BINDBASE RSG::viewport
  408. /* VIEWPORT TARGET API */
  409. BIND0R(RID, viewport_create)
  410. BIND2(viewport_set_use_xr, RID, bool)
  411. BIND3(viewport_set_size, RID, int, int)
  412. BIND2(viewport_set_active, RID, bool)
  413. BIND2(viewport_set_parent_viewport, RID, RID)
  414. BIND2(viewport_set_clear_mode, RID, ViewportClearMode)
  415. BIND3(viewport_attach_to_screen, RID, const Rect2 &, int)
  416. BIND2(viewport_set_render_direct_to_screen, RID, bool)
  417. BIND2(viewport_set_update_mode, RID, ViewportUpdateMode)
  418. BIND2(viewport_set_vflip, RID, bool)
  419. BIND1RC(RID, viewport_get_texture, RID)
  420. BIND2(viewport_set_hide_scenario, RID, bool)
  421. BIND2(viewport_set_hide_canvas, RID, bool)
  422. BIND2(viewport_set_disable_environment, RID, bool)
  423. BIND2(viewport_attach_camera, RID, RID)
  424. BIND2(viewport_set_scenario, RID, RID)
  425. BIND2(viewport_attach_canvas, RID, RID)
  426. BIND2(viewport_remove_canvas, RID, RID)
  427. BIND3(viewport_set_canvas_transform, RID, RID, const Transform2D &)
  428. BIND2(viewport_set_transparent_background, RID, bool)
  429. BIND2(viewport_set_snap_2d_transforms_to_pixel, RID, bool)
  430. BIND2(viewport_set_snap_2d_vertices_to_pixel, RID, bool)
  431. BIND2(viewport_set_default_canvas_item_texture_filter, RID, CanvasItemTextureFilter)
  432. BIND2(viewport_set_default_canvas_item_texture_repeat, RID, CanvasItemTextureRepeat)
  433. BIND2(viewport_set_global_canvas_transform, RID, const Transform2D &)
  434. BIND4(viewport_set_canvas_stacking, RID, RID, int, int)
  435. BIND3(viewport_set_shadow_atlas_size, RID, int, bool)
  436. BIND3(viewport_set_sdf_oversize_and_scale, RID, ViewportSDFOversize, ViewportSDFScale)
  437. BIND3(viewport_set_shadow_atlas_quadrant_subdivision, RID, int, int)
  438. BIND2(viewport_set_msaa, RID, ViewportMSAA)
  439. BIND2(viewport_set_screen_space_aa, RID, ViewportScreenSpaceAA)
  440. BIND2(viewport_set_use_debanding, RID, bool)
  441. BIND2(viewport_set_lod_threshold, RID, float)
  442. BIND2R(int, viewport_get_render_info, RID, ViewportRenderInfo)
  443. BIND2(viewport_set_debug_draw, RID, ViewportDebugDraw)
  444. BIND2(viewport_set_measure_render_time, RID, bool)
  445. BIND1RC(float, viewport_get_measured_render_time_cpu, RID)
  446. BIND1RC(float, viewport_get_measured_render_time_gpu, RID)
  447. /* ENVIRONMENT API */
  448. #undef BINDBASE
  449. //from now on, calls forwarded to this singleton
  450. #define BINDBASE RSG::scene
  451. BIND2(directional_shadow_atlas_set_size, int, bool)
  452. BIND1(gi_probe_set_quality, GIProbeQuality)
  453. /* SKY API */
  454. BIND0R(RID, sky_create)
  455. BIND2(sky_set_radiance_size, RID, int)
  456. BIND2(sky_set_mode, RID, SkyMode)
  457. BIND2(sky_set_material, RID, RID)
  458. BIND4R(Ref<Image>, sky_bake_panorama, RID, float, bool, const Size2i &)
  459. BIND0R(RID, environment_create)
  460. BIND2(environment_set_background, RID, EnvironmentBG)
  461. BIND2(environment_set_sky, RID, RID)
  462. BIND2(environment_set_sky_custom_fov, RID, float)
  463. BIND2(environment_set_sky_orientation, RID, const Basis &)
  464. BIND2(environment_set_bg_color, RID, const Color &)
  465. BIND2(environment_set_bg_energy, RID, float)
  466. BIND2(environment_set_canvas_max_layer, RID, int)
  467. BIND7(environment_set_ambient_light, RID, const Color &, EnvironmentAmbientSource, float, float, EnvironmentReflectionSource, const Color &)
  468. // FIXME: Disabled during Vulkan refactoring, should be ported.
  469. #if 0
  470. BIND2(environment_set_camera_feed_id, RID, int)
  471. #endif
  472. BIND6(environment_set_ssr, RID, bool, int, float, float, float)
  473. BIND1(environment_set_ssr_roughness_quality, EnvironmentSSRRoughnessQuality)
  474. BIND10(environment_set_ssao, RID, bool, float, float, float, float, float, float, float, float)
  475. BIND6(environment_set_ssao_quality, EnvironmentSSAOQuality, bool, float, int, float, float)
  476. BIND11(environment_set_glow, RID, bool, Vector<float>, float, float, float, float, EnvironmentGlowBlendMode, float, float, float)
  477. BIND1(environment_glow_set_use_bicubic_upscale, bool)
  478. BIND1(environment_glow_set_use_high_quality, bool)
  479. BIND9(environment_set_tonemap, RID, EnvironmentToneMapper, float, float, bool, float, float, float, float)
  480. BIND7(environment_set_adjustment, RID, bool, float, float, float, bool, RID)
  481. BIND9(environment_set_fog, RID, bool, const Color &, float, float, float, float, float, float)
  482. BIND10(environment_set_volumetric_fog, RID, bool, float, const Color &, float, float, float, float, bool, float)
  483. BIND2(environment_set_volumetric_fog_volume_size, int, int)
  484. BIND1(environment_set_volumetric_fog_filter_active, bool)
  485. BIND11(environment_set_sdfgi, RID, bool, EnvironmentSDFGICascades, float, EnvironmentSDFGIYScale, bool, bool, bool, float, float, float)
  486. BIND1(environment_set_sdfgi_ray_count, EnvironmentSDFGIRayCount)
  487. BIND1(environment_set_sdfgi_frames_to_converge, EnvironmentSDFGIFramesToConverge)
  488. BIND1(environment_set_sdfgi_frames_to_update_light, EnvironmentSDFGIFramesToUpdateLight)
  489. BIND3R(Ref<Image>, environment_bake_panorama, RID, bool, const Size2i &)
  490. BIND3(screen_space_roughness_limiter_set_active, bool, float, float)
  491. BIND1(sub_surface_scattering_set_quality, SubSurfaceScatteringQuality)
  492. BIND2(sub_surface_scattering_set_scale, float, float)
  493. /* CAMERA EFFECTS */
  494. BIND0R(RID, camera_effects_create)
  495. BIND2(camera_effects_set_dof_blur_quality, DOFBlurQuality, bool)
  496. BIND1(camera_effects_set_dof_blur_bokeh_shape, DOFBokehShape)
  497. BIND8(camera_effects_set_dof_blur, RID, bool, float, float, bool, float, float, float)
  498. BIND3(camera_effects_set_custom_exposure, RID, bool, float)
  499. BIND1(shadows_quality_set, ShadowQuality);
  500. BIND1(directional_shadow_quality_set, ShadowQuality);
  501. /* SCENARIO API */
  502. #undef BINDBASE
  503. #define BINDBASE RSG::scene
  504. BIND0R(RID, scenario_create)
  505. BIND2(scenario_set_debug, RID, ScenarioDebugMode)
  506. BIND2(scenario_set_environment, RID, RID)
  507. BIND2(scenario_set_camera_effects, RID, RID)
  508. BIND2(scenario_set_fallback_environment, RID, RID)
  509. /* INSTANCING API */
  510. BIND0R(RID, instance_create)
  511. BIND2(instance_set_base, RID, RID)
  512. BIND2(instance_set_scenario, RID, RID)
  513. BIND2(instance_set_layer_mask, RID, uint32_t)
  514. BIND2(instance_set_transform, RID, const Transform &)
  515. BIND2(instance_attach_object_instance_id, RID, ObjectID)
  516. BIND3(instance_set_blend_shape_weight, RID, int, float)
  517. BIND3(instance_set_surface_material, RID, int, RID)
  518. BIND2(instance_set_visible, RID, bool)
  519. BIND2(instance_set_custom_aabb, RID, AABB)
  520. BIND2(instance_attach_skeleton, RID, RID)
  521. BIND2(instance_set_exterior, RID, bool)
  522. BIND2(instance_set_extra_visibility_margin, RID, real_t)
  523. // don't use these in a game!
  524. BIND2RC(Vector<ObjectID>, instances_cull_aabb, const AABB &, RID)
  525. BIND3RC(Vector<ObjectID>, instances_cull_ray, const Vector3 &, const Vector3 &, RID)
  526. BIND2RC(Vector<ObjectID>, instances_cull_convex, const Vector<Plane> &, RID)
  527. BIND3(instance_geometry_set_flag, RID, InstanceFlags, bool)
  528. BIND2(instance_geometry_set_cast_shadows_setting, RID, ShadowCastingSetting)
  529. BIND2(instance_geometry_set_material_override, RID, RID)
  530. BIND5(instance_geometry_set_draw_range, RID, float, float, float, float)
  531. BIND2(instance_geometry_set_as_instance_lod, RID, RID)
  532. BIND4(instance_geometry_set_lightmap, RID, RID, const Rect2 &, int)
  533. BIND2(instance_geometry_set_lod_bias, RID, float)
  534. BIND3(instance_geometry_set_shader_parameter, RID, const StringName &, const Variant &)
  535. BIND2RC(Variant, instance_geometry_get_shader_parameter, RID, const StringName &)
  536. BIND2RC(Variant, instance_geometry_get_shader_parameter_default_value, RID, const StringName &)
  537. BIND2C(instance_geometry_get_shader_parameter_list, RID, List<PropertyInfo> *)
  538. BIND3R(TypedArray<Image>, bake_render_uv2, RID, const Vector<RID> &, const Size2i &)
  539. BIND1(gi_set_use_half_resolution, bool)
  540. #undef BINDBASE
  541. //from now on, calls forwarded to this singleton
  542. #define BINDBASE RSG::canvas
  543. /* CANVAS (2D) */
  544. BIND0R(RID, canvas_create)
  545. BIND3(canvas_set_item_mirroring, RID, RID, const Point2 &)
  546. BIND2(canvas_set_modulate, RID, const Color &)
  547. BIND3(canvas_set_parent, RID, RID, float)
  548. BIND1(canvas_set_disable_scale, bool)
  549. BIND0R(RID, canvas_texture_create)
  550. BIND3(canvas_texture_set_channel, RID, CanvasTextureChannel, RID)
  551. BIND3(canvas_texture_set_shading_parameters, RID, const Color &, float)
  552. BIND2(canvas_texture_set_texture_filter, RID, CanvasItemTextureFilter)
  553. BIND2(canvas_texture_set_texture_repeat, RID, CanvasItemTextureRepeat)
  554. BIND0R(RID, canvas_item_create)
  555. BIND2(canvas_item_set_parent, RID, RID)
  556. BIND2(canvas_item_set_default_texture_filter, RID, CanvasItemTextureFilter)
  557. BIND2(canvas_item_set_default_texture_repeat, RID, CanvasItemTextureRepeat)
  558. BIND2(canvas_item_set_visible, RID, bool)
  559. BIND2(canvas_item_set_light_mask, RID, int)
  560. BIND2(canvas_item_set_update_when_visible, RID, bool)
  561. BIND2(canvas_item_set_transform, RID, const Transform2D &)
  562. BIND2(canvas_item_set_clip, RID, bool)
  563. BIND2(canvas_item_set_distance_field_mode, RID, bool)
  564. BIND3(canvas_item_set_custom_rect, RID, bool, const Rect2 &)
  565. BIND2(canvas_item_set_modulate, RID, const Color &)
  566. BIND2(canvas_item_set_self_modulate, RID, const Color &)
  567. BIND2(canvas_item_set_draw_behind_parent, RID, bool)
  568. BIND5(canvas_item_add_line, RID, const Point2 &, const Point2 &, const Color &, float)
  569. BIND5(canvas_item_add_polyline, RID, const Vector<Point2> &, const Vector<Color> &, float, bool)
  570. BIND4(canvas_item_add_multiline, RID, const Vector<Point2> &, const Vector<Color> &, float)
  571. BIND3(canvas_item_add_rect, RID, const Rect2 &, const Color &)
  572. BIND4(canvas_item_add_circle, RID, const Point2 &, float, const Color &)
  573. BIND6(canvas_item_add_texture_rect, RID, const Rect2 &, RID, bool, const Color &, bool)
  574. BIND7(canvas_item_add_texture_rect_region, RID, const Rect2 &, RID, const Rect2 &, const Color &, bool, bool)
  575. BIND10(canvas_item_add_nine_patch, RID, const Rect2 &, const Rect2 &, RID, const Vector2 &, const Vector2 &, NinePatchAxisMode, NinePatchAxisMode, bool, const Color &)
  576. BIND6(canvas_item_add_primitive, RID, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID, float)
  577. BIND5(canvas_item_add_polygon, RID, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID)
  578. BIND9(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)
  579. BIND5(canvas_item_add_mesh, RID, const RID &, const Transform2D &, const Color &, RID)
  580. BIND3(canvas_item_add_multimesh, RID, RID, RID)
  581. BIND3(canvas_item_add_particles, RID, RID, RID)
  582. BIND2(canvas_item_add_set_transform, RID, const Transform2D &)
  583. BIND2(canvas_item_add_clip_ignore, RID, bool)
  584. BIND2(canvas_item_set_sort_children_by_y, RID, bool)
  585. BIND2(canvas_item_set_z_index, RID, int)
  586. BIND2(canvas_item_set_z_as_relative_to_parent, RID, bool)
  587. BIND3(canvas_item_set_copy_to_backbuffer, RID, bool, const Rect2 &)
  588. BIND2(canvas_item_attach_skeleton, RID, RID)
  589. BIND1(canvas_item_clear, RID)
  590. BIND2(canvas_item_set_draw_index, RID, int)
  591. BIND2(canvas_item_set_material, RID, RID)
  592. BIND2(canvas_item_set_use_parent_material, RID, bool)
  593. BIND6(canvas_item_set_canvas_group_mode, RID, CanvasGroupMode, float, bool, float, bool)
  594. BIND0R(RID, canvas_light_create)
  595. BIND2(canvas_light_set_mode, RID, CanvasLightMode)
  596. BIND2(canvas_light_attach_to_canvas, RID, RID)
  597. BIND2(canvas_light_set_enabled, RID, bool)
  598. BIND2(canvas_light_set_texture_scale, RID, float)
  599. BIND2(canvas_light_set_transform, RID, const Transform2D &)
  600. BIND2(canvas_light_set_texture, RID, RID)
  601. BIND2(canvas_light_set_texture_offset, RID, const Vector2 &)
  602. BIND2(canvas_light_set_color, RID, const Color &)
  603. BIND2(canvas_light_set_height, RID, float)
  604. BIND2(canvas_light_set_energy, RID, float)
  605. BIND3(canvas_light_set_z_range, RID, int, int)
  606. BIND3(canvas_light_set_layer_range, RID, int, int)
  607. BIND2(canvas_light_set_item_cull_mask, RID, int)
  608. BIND2(canvas_light_set_item_shadow_cull_mask, RID, int)
  609. BIND2(canvas_light_set_directional_distance, RID, float)
  610. BIND2(canvas_light_set_blend_mode, RID, CanvasLightBlendMode)
  611. BIND2(canvas_light_set_shadow_enabled, RID, bool)
  612. BIND2(canvas_light_set_shadow_filter, RID, CanvasLightShadowFilter)
  613. BIND2(canvas_light_set_shadow_color, RID, const Color &)
  614. BIND2(canvas_light_set_shadow_smooth, RID, float)
  615. BIND0R(RID, canvas_light_occluder_create)
  616. BIND2(canvas_light_occluder_attach_to_canvas, RID, RID)
  617. BIND2(canvas_light_occluder_set_enabled, RID, bool)
  618. BIND2(canvas_light_occluder_set_polygon, RID, RID)
  619. BIND2(canvas_light_occluder_set_as_sdf_collision, RID, bool)
  620. BIND2(canvas_light_occluder_set_transform, RID, const Transform2D &)
  621. BIND2(canvas_light_occluder_set_light_mask, RID, int)
  622. BIND0R(RID, canvas_occluder_polygon_create)
  623. BIND3(canvas_occluder_polygon_set_shape, RID, const Vector<Vector2> &, bool)
  624. BIND2(canvas_occluder_polygon_set_cull_mode, RID, CanvasOccluderPolygonCullMode)
  625. BIND1(canvas_set_shadow_texture_size, int)
  626. /* GLOBAL VARIABLES */
  627. #undef BINDBASE
  628. //from now on, calls forwarded to this singleton
  629. #define BINDBASE RSG::storage
  630. BIND3(global_variable_add, const StringName &, GlobalVariableType, const Variant &)
  631. BIND1(global_variable_remove, const StringName &)
  632. BIND0RC(Vector<StringName>, global_variable_get_list)
  633. BIND2(global_variable_set, const StringName &, const Variant &)
  634. BIND2(global_variable_set_override, const StringName &, const Variant &)
  635. BIND1RC(GlobalVariableType, global_variable_get_type, const StringName &)
  636. BIND1RC(Variant, global_variable_get, const StringName &)
  637. BIND1(global_variables_load_settings, bool)
  638. BIND0(global_variables_clear)
  639. /* BLACK BARS */
  640. virtual void black_bars_set_margins(int p_left, int p_top, int p_right, int p_bottom);
  641. virtual void black_bars_set_images(RID p_left, RID p_top, RID p_right, RID p_bottom);
  642. /* FREE */
  643. virtual void free(RID p_rid); ///< free RIDs associated with the visual server
  644. /* EVENT QUEUING */
  645. virtual void request_frame_drawn_callback(Object *p_where, const StringName &p_method, const Variant &p_userdata);
  646. virtual void draw(bool p_swap_buffers, double frame_step);
  647. virtual void sync();
  648. virtual bool has_changed() const;
  649. virtual void init();
  650. virtual void finish();
  651. /* STATUS INFORMATION */
  652. virtual int get_render_info(RenderInfo p_info);
  653. virtual String get_video_adapter_name() const;
  654. virtual String get_video_adapter_vendor() const;
  655. virtual void set_frame_profiling_enabled(bool p_enable);
  656. virtual Vector<FrameProfileArea> get_frame_profile();
  657. virtual uint64_t get_frame_profile_frame();
  658. virtual RID get_test_cube();
  659. /* TESTING */
  660. virtual float get_frame_setup_time_cpu() const;
  661. virtual void set_boot_image(const Ref<Image> &p_image, const Color &p_color, bool p_scale, bool p_use_filter = true);
  662. virtual void set_default_clear_color(const Color &p_color);
  663. virtual bool has_feature(Features p_feature) const;
  664. virtual bool has_os_feature(const String &p_feature) const;
  665. virtual void set_debug_generate_wireframes(bool p_generate);
  666. virtual void call_set_use_vsync(bool p_enable);
  667. virtual bool is_low_end() const;
  668. virtual void sdfgi_set_debug_probe_select(const Vector3 &p_position, const Vector3 &p_dir);
  669. virtual void set_print_gpu_profile(bool p_enable);
  670. RenderingServerDefault();
  671. ~RenderingServerDefault();
  672. #undef DISPLAY_CHANGED
  673. #undef BIND0R
  674. #undef BIND1RC
  675. #undef BIND2RC
  676. #undef BIND3RC
  677. #undef BIND4RC
  678. #undef BIND1
  679. #undef BIND2
  680. #undef BIND3
  681. #undef BIND4
  682. #undef BIND5
  683. #undef BIND6
  684. #undef BIND7
  685. #undef BIND8
  686. #undef BIND9
  687. #undef BIND10
  688. };
  689. #endif