rendering_server_raster.h 37 KB

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