Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/servers/rendering/rendering_server_default.h
10277 views
1
/**************************************************************************/
2
/* rendering_server_default.h */
3
/**************************************************************************/
4
/* This file is part of: */
5
/* GODOT ENGINE */
6
/* https://godotengine.org */
7
/**************************************************************************/
8
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
9
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
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
31
#pragma once
32
33
#include "core/object/worker_thread_pool.h"
34
#include "core/os/thread.h"
35
#include "core/templates/command_queue_mt.h"
36
#include "core/templates/hash_map.h"
37
#include "renderer_canvas_cull.h"
38
#include "renderer_viewport.h"
39
#include "rendering_server_globals.h"
40
#include "servers/rendering/renderer_compositor.h"
41
#include "servers/rendering_server.h"
42
#include "servers/server_wrap_mt_common.h"
43
44
class RenderingServerDefault : public RenderingServer {
45
enum {
46
MAX_INSTANCE_CULL = 8192,
47
MAX_INSTANCE_LIGHTS = 4,
48
LIGHT_CACHE_DIRTY = -1,
49
MAX_LIGHTS_CULLED = 256,
50
MAX_ROOM_CULL = 32,
51
MAX_EXTERIOR_PORTALS = 128,
52
MAX_LIGHT_SAMPLERS = 256,
53
INSTANCE_ROOMLESS_MASK = (1 << 20)
54
55
};
56
57
static int changes;
58
RID test_cube;
59
60
List<Callable> frame_drawn_callbacks;
61
62
static void _changes_changed() {}
63
64
uint64_t frame_profile_frame = 0;
65
Vector<FrameProfileArea> frame_profile;
66
67
double frame_setup_time = 0;
68
69
//for printing
70
bool print_gpu_profile = false;
71
HashMap<String, float> print_gpu_profile_task_time;
72
uint64_t print_frame_profile_ticks_from = 0;
73
uint32_t print_frame_profile_frame_count = 0;
74
75
mutable CommandQueueMT command_queue;
76
77
Thread::ID server_thread = Thread::MAIN_ID;
78
WorkerThreadPool::TaskID server_task_id = WorkerThreadPool::INVALID_TASK_ID;
79
bool exit = false;
80
bool create_thread = false;
81
82
void _assign_mt_ids(WorkerThreadPool::TaskID p_pump_task_id);
83
void _thread_exit();
84
void _thread_loop();
85
86
void _draw(bool p_swap_buffers, double frame_step);
87
void _run_post_draw_steps();
88
void _init();
89
void _finish();
90
91
void _free(RID p_rid);
92
93
void _call_on_render_thread(const Callable &p_callable);
94
95
public:
96
//if editor is redrawing when it shouldn't, enable this and put a breakpoint in _changes_changed()
97
//#define DEBUG_CHANGES
98
99
#ifdef DEBUG_CHANGES
100
_FORCE_INLINE_ static void redraw_request() {
101
changes++;
102
_changes_changed();
103
}
104
105
#else
106
_FORCE_INLINE_ static void redraw_request() {
107
changes++;
108
}
109
#endif
110
111
#define WRITE_ACTION redraw_request();
112
#define ASYNC_COND_PUSH (Thread::get_caller_id() != server_thread)
113
#define ASYNC_COND_PUSH_AND_RET (Thread::get_caller_id() != server_thread)
114
#define ASYNC_COND_PUSH_AND_SYNC (Thread::get_caller_id() != server_thread)
115
116
#ifdef DEBUG_SYNC
117
#define SYNC_DEBUG print_line("sync on: " + String(__FUNCTION__));
118
#else
119
#define SYNC_DEBUG
120
#endif
121
122
#ifdef DEBUG_ENABLED
123
#define MAIN_THREAD_SYNC_WARN WARN_PRINT("Call to " + String(__FUNCTION__) + " causing RenderingServer synchronizations on every frame. This significantly affects performance.");
124
#endif
125
126
#include "servers/server_wrap_mt_common.h"
127
128
/* TEXTURE API */
129
130
#define ServerName RendererTextureStorage
131
#define server_name RSG::texture_storage
132
133
#define FUNCRIDTEX0(m_type) \
134
virtual RID m_type##_create() override { \
135
RID ret = RSG::texture_storage->texture_allocate(); \
136
if (Thread::get_caller_id() == server_thread || RSG::rasterizer->can_create_resources_async()) { \
137
RSG::texture_storage->m_type##_initialize(ret); \
138
} else { \
139
command_queue.push(RSG::texture_storage, &RendererTextureStorage::m_type##_initialize, ret); \
140
} \
141
return ret; \
142
}
143
144
#define FUNCRIDTEX1(m_type, m_type1) \
145
virtual RID m_type##_create(m_type1 p1) override { \
146
RID ret = RSG::texture_storage->texture_allocate(); \
147
if (Thread::get_caller_id() == server_thread || RSG::rasterizer->can_create_resources_async()) { \
148
RSG::texture_storage->m_type##_initialize(ret, p1); \
149
} else { \
150
command_queue.push(RSG::texture_storage, &RendererTextureStorage::m_type##_initialize, ret, p1); \
151
} \
152
return ret; \
153
}
154
155
#define FUNCRIDTEX2(m_type, m_type1, m_type2) \
156
virtual RID m_type##_create(m_type1 p1, m_type2 p2) override { \
157
RID ret = RSG::texture_storage->texture_allocate(); \
158
if (Thread::get_caller_id() == server_thread || RSG::rasterizer->can_create_resources_async()) { \
159
RSG::texture_storage->m_type##_initialize(ret, p1, p2); \
160
} else { \
161
command_queue.push(RSG::texture_storage, &RendererTextureStorage::m_type##_initialize, ret, p1, p2); \
162
} \
163
return ret; \
164
}
165
166
#define FUNCRIDTEX3(m_type, m_type1, m_type2, m_type3) \
167
virtual RID m_type##_create(m_type1 p1, m_type2 p2, m_type3 p3) override { \
168
RID ret = RSG::texture_storage->texture_allocate(); \
169
if (Thread::get_caller_id() == server_thread || RSG::rasterizer->can_create_resources_async()) { \
170
RSG::texture_storage->m_type##_initialize(ret, p1, p2, p3); \
171
} else { \
172
command_queue.push(RSG::texture_storage, &RendererTextureStorage::m_type##_initialize, ret, p1, p2, p3); \
173
} \
174
return ret; \
175
}
176
177
#define FUNCRIDTEX6(m_type, m_type1, m_type2, m_type3, m_type4, m_type5, m_type6) \
178
virtual RID m_type##_create(m_type1 p1, m_type2 p2, m_type3 p3, m_type4 p4, m_type5 p5, m_type6 p6) override { \
179
RID ret = RSG::texture_storage->texture_allocate(); \
180
if (Thread::get_caller_id() == server_thread || RSG::rasterizer->can_create_resources_async()) { \
181
RSG::texture_storage->m_type##_initialize(ret, p1, p2, p3, p4, p5, p6); \
182
} else { \
183
command_queue.push(RSG::texture_storage, &RendererTextureStorage::m_type##_initialize, ret, p1, p2, p3, p4, p5, p6); \
184
} \
185
return ret; \
186
}
187
188
//these go pass-through, as they can be called from any thread
189
FUNCRIDTEX1(texture_2d, const Ref<Image> &)
190
FUNCRIDTEX2(texture_2d_layered, const Vector<Ref<Image>> &, TextureLayeredType)
191
FUNCRIDTEX6(texture_3d, Image::Format, int, int, int, bool, const Vector<Ref<Image>> &)
192
FUNCRIDTEX3(texture_external, int, int, uint64_t)
193
FUNCRIDTEX1(texture_proxy, RID)
194
195
// Called directly, not through the command queue.
196
virtual 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 {
197
return 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);
198
}
199
200
//these go through command queue if they are in another thread
201
FUNC3(texture_2d_update, RID, const Ref<Image> &, int)
202
FUNC2(texture_3d_update, RID, const Vector<Ref<Image>> &)
203
FUNC4(texture_external_update, RID, int, int, uint64_t)
204
FUNC2(texture_proxy_update, RID, RID)
205
206
//these also go pass-through
207
FUNCRIDTEX0(texture_2d_placeholder)
208
FUNCRIDTEX1(texture_2d_layered_placeholder, TextureLayeredType)
209
FUNCRIDTEX0(texture_3d_placeholder)
210
211
FUNC1RC(Ref<Image>, texture_2d_get, RID)
212
FUNC2RC(Ref<Image>, texture_2d_layer_get, RID, int)
213
FUNC1RC(Vector<Ref<Image>>, texture_3d_get, RID)
214
215
FUNC2(texture_replace, RID, RID)
216
217
FUNC3(texture_set_size_override, RID, int, int)
218
// FIXME: Disabled during Vulkan refactoring, should be ported.
219
#if 0
220
FUNC2(texture_bind, RID, uint32_t)
221
#endif
222
223
FUNC3(texture_set_detect_3d_callback, RID, TextureDetectCallback, void *)
224
FUNC3(texture_set_detect_normal_callback, RID, TextureDetectCallback, void *)
225
FUNC3(texture_set_detect_roughness_callback, RID, TextureDetectRoughnessCallback, void *)
226
227
FUNC2(texture_set_path, RID, const String &)
228
FUNC1RC(String, texture_get_path, RID)
229
230
FUNC1RC(Image::Format, texture_get_format, RID)
231
232
FUNC1(texture_debug_usage, List<TextureInfo> *)
233
234
FUNC2(texture_set_force_redraw_if_visible, RID, bool)
235
FUNCRIDTEX2(texture_rd, const RID &, const RS::TextureLayeredType)
236
FUNC2RC(RID, texture_get_rd_texture, RID, bool)
237
FUNC2RC(uint64_t, texture_get_native_handle, RID, bool)
238
239
/* SHADER API */
240
241
#undef ServerName
242
#undef server_name
243
244
#define ServerName RendererMaterialStorage
245
#define server_name RSG::material_storage
246
247
virtual RID shader_create() override {
248
RID ret = RSG::material_storage->shader_allocate();
249
if (Thread::get_caller_id() == server_thread) {
250
RSG::material_storage->shader_initialize(ret, false);
251
} else {
252
command_queue.push(RSG::material_storage, &ServerName::shader_initialize, ret, false);
253
}
254
return ret;
255
}
256
257
virtual RID shader_create_from_code(const String &p_code, const String &p_path_hint = String()) override {
258
RID shader = RSG::material_storage->shader_allocate();
259
bool using_server_thread = Thread::get_caller_id() == server_thread;
260
if (using_server_thread || RSG::rasterizer->can_create_resources_async()) {
261
if (using_server_thread) {
262
command_queue.flush_if_pending();
263
}
264
265
RSG::material_storage->shader_initialize(shader, false);
266
RSG::material_storage->shader_set_code(shader, p_code);
267
RSG::material_storage->shader_set_path_hint(shader, p_path_hint);
268
} else {
269
command_queue.push(RSG::material_storage, &RendererMaterialStorage::shader_initialize, shader, false);
270
command_queue.push(RSG::material_storage, &RendererMaterialStorage::shader_set_code, shader, p_code);
271
command_queue.push(RSG::material_storage, &RendererMaterialStorage::shader_set_path_hint, shader, p_path_hint);
272
}
273
274
return shader;
275
}
276
277
FUNC2(shader_set_code, RID, const String &)
278
FUNC2(shader_set_path_hint, RID, const String &)
279
FUNC1RC(String, shader_get_code, RID)
280
281
FUNC2SC(get_shader_parameter_list, RID, List<PropertyInfo> *)
282
283
FUNC4(shader_set_default_texture_parameter, RID, const StringName &, RID, int)
284
FUNC3RC(RID, shader_get_default_texture_parameter, RID, const StringName &, int)
285
FUNC2RC(Variant, shader_get_parameter_default, RID, const StringName &)
286
287
FUNC1RC(ShaderNativeSourceCode, shader_get_native_source_code, RID)
288
289
/* COMMON MATERIAL API */
290
291
FUNCRIDSPLIT(material)
292
293
virtual RID material_create_from_shader(RID p_next_pass, int p_render_priority, RID p_shader) override {
294
RID material = RSG::material_storage->material_allocate();
295
bool using_server_thread = Thread::get_caller_id() == server_thread;
296
if (using_server_thread || RSG::rasterizer->can_create_resources_async()) {
297
if (using_server_thread) {
298
command_queue.flush_if_pending();
299
}
300
301
RSG::material_storage->material_initialize(material);
302
RSG::material_storage->material_set_next_pass(material, p_next_pass);
303
RSG::material_storage->material_set_render_priority(material, p_render_priority);
304
RSG::material_storage->material_set_shader(material, p_shader);
305
} else {
306
command_queue.push(RSG::material_storage, &RendererMaterialStorage::material_initialize, material);
307
command_queue.push(RSG::material_storage, &RendererMaterialStorage::material_set_next_pass, material, p_next_pass);
308
command_queue.push(RSG::material_storage, &RendererMaterialStorage::material_set_render_priority, material, p_render_priority);
309
command_queue.push(RSG::material_storage, &RendererMaterialStorage::material_set_shader, material, p_shader);
310
}
311
312
return material;
313
}
314
315
FUNC2(material_set_shader, RID, RID)
316
317
FUNC3(material_set_param, RID, const StringName &, const Variant &)
318
FUNC2RC(Variant, material_get_param, RID, const StringName &)
319
320
FUNC2(material_set_render_priority, RID, int)
321
FUNC2(material_set_next_pass, RID, RID)
322
323
/* MESH API */
324
325
//from now on, calls forwarded to this singleton
326
#undef ServerName
327
#undef server_name
328
329
#define ServerName RendererMeshStorage
330
#define server_name RSG::mesh_storage
331
332
virtual RID mesh_create_from_surfaces(const Vector<SurfaceData> &p_surfaces, int p_blend_shape_count = 0) override {
333
RID mesh = RSG::mesh_storage->mesh_allocate();
334
335
bool using_server_thread = Thread::get_caller_id() == server_thread;
336
if (using_server_thread || RSG::rasterizer->can_create_resources_async()) {
337
if (using_server_thread) {
338
command_queue.flush_if_pending();
339
}
340
RSG::mesh_storage->mesh_initialize(mesh);
341
RSG::mesh_storage->mesh_set_blend_shape_count(mesh, p_blend_shape_count);
342
for (int i = 0; i < p_surfaces.size(); i++) {
343
RSG::mesh_storage->mesh_add_surface(mesh, p_surfaces[i]);
344
}
345
RSG::scene->mesh_generate_pipelines(mesh, using_server_thread);
346
} else {
347
command_queue.push(RSG::mesh_storage, &RendererMeshStorage::mesh_initialize, mesh);
348
command_queue.push(RSG::mesh_storage, &RendererMeshStorage::mesh_set_blend_shape_count, mesh, p_blend_shape_count);
349
for (int i = 0; i < p_surfaces.size(); i++) {
350
command_queue.push(RSG::mesh_storage, &RendererMeshStorage::mesh_add_surface, mesh, p_surfaces[i]);
351
}
352
command_queue.push(RSG::scene, &RenderingMethod::mesh_generate_pipelines, mesh, true);
353
}
354
355
return mesh;
356
}
357
358
FUNC2(mesh_set_blend_shape_count, RID, int)
359
360
FUNCRIDSPLIT(mesh)
361
362
FUNC2(mesh_add_surface, RID, const SurfaceData &)
363
364
FUNC1RC(int, mesh_get_blend_shape_count, RID)
365
366
FUNC2(mesh_set_blend_shape_mode, RID, BlendShapeMode)
367
FUNC1RC(BlendShapeMode, mesh_get_blend_shape_mode, RID)
368
369
FUNC4(mesh_surface_update_vertex_region, RID, int, int, const Vector<uint8_t> &)
370
FUNC4(mesh_surface_update_attribute_region, RID, int, int, const Vector<uint8_t> &)
371
FUNC4(mesh_surface_update_skin_region, RID, int, int, const Vector<uint8_t> &)
372
FUNC4(mesh_surface_update_index_region, RID, int, int, const Vector<uint8_t> &)
373
374
FUNC3(mesh_surface_set_material, RID, int, RID)
375
FUNC2RC(RID, mesh_surface_get_material, RID, int)
376
377
FUNC2RC(SurfaceData, mesh_get_surface, RID, int)
378
379
FUNC1RC(int, mesh_get_surface_count, RID)
380
381
FUNC2(mesh_set_custom_aabb, RID, const AABB &)
382
FUNC1RC(AABB, mesh_get_custom_aabb, RID)
383
384
FUNC2(mesh_set_path, RID, const String &)
385
FUNC1RC(String, mesh_get_path, RID)
386
387
FUNC2(mesh_set_shadow_mesh, RID, RID)
388
389
FUNC2(mesh_surface_remove, RID, int)
390
FUNC1(mesh_clear, RID)
391
392
FUNC1(mesh_debug_usage, List<MeshInfo> *)
393
394
/* MULTIMESH API */
395
396
FUNCRIDSPLIT(multimesh)
397
398
FUNC6(multimesh_allocate_data, RID, int, MultimeshTransformFormat, bool, bool, bool)
399
FUNC1RC(int, multimesh_get_instance_count, RID)
400
401
FUNC2(multimesh_set_mesh, RID, RID)
402
FUNC3(multimesh_instance_set_transform, RID, int, const Transform3D &)
403
FUNC3(multimesh_instance_set_transform_2d, RID, int, const Transform2D &)
404
FUNC3(multimesh_instance_set_color, RID, int, const Color &)
405
FUNC3(multimesh_instance_set_custom_data, RID, int, const Color &)
406
407
FUNC2(multimesh_set_custom_aabb, RID, const AABB &)
408
FUNC1RC(AABB, multimesh_get_custom_aabb, RID)
409
410
FUNC1RC(RID, multimesh_get_mesh, RID)
411
FUNC1RC(AABB, multimesh_get_aabb, RID)
412
413
FUNC2RC(Transform3D, multimesh_instance_get_transform, RID, int)
414
FUNC2RC(Transform2D, multimesh_instance_get_transform_2d, RID, int)
415
FUNC2RC(Color, multimesh_instance_get_color, RID, int)
416
FUNC2RC(Color, multimesh_instance_get_custom_data, RID, int)
417
418
FUNC2(multimesh_set_buffer, RID, const Vector<float> &)
419
FUNC1RC(RID, multimesh_get_command_buffer_rd_rid, RID)
420
FUNC1RC(RID, multimesh_get_buffer_rd_rid, RID)
421
FUNC1RC(Vector<float>, multimesh_get_buffer, RID)
422
423
FUNC3(multimesh_set_buffer_interpolated, RID, const Vector<float> &, const Vector<float> &)
424
FUNC2(multimesh_set_physics_interpolated, RID, bool)
425
FUNC2(multimesh_set_physics_interpolation_quality, RID, MultimeshPhysicsInterpolationQuality)
426
FUNC2(multimesh_instance_reset_physics_interpolation, RID, int)
427
428
FUNC2(multimesh_set_visible_instances, RID, int)
429
FUNC1RC(int, multimesh_get_visible_instances, RID)
430
431
/* SKELETON API */
432
433
FUNCRIDSPLIT(skeleton)
434
FUNC3(skeleton_allocate_data, RID, int, bool)
435
FUNC1RC(int, skeleton_get_bone_count, RID)
436
FUNC3(skeleton_bone_set_transform, RID, int, const Transform3D &)
437
FUNC2RC(Transform3D, skeleton_bone_get_transform, RID, int)
438
FUNC3(skeleton_bone_set_transform_2d, RID, int, const Transform2D &)
439
FUNC2RC(Transform2D, skeleton_bone_get_transform_2d, RID, int)
440
FUNC2(skeleton_set_base_transform_2d, RID, const Transform2D &)
441
442
/* Light API */
443
#undef ServerName
444
#undef server_name
445
446
#define ServerName RendererLightStorage
447
#define server_name RSG::light_storage
448
449
FUNCRIDSPLIT(directional_light)
450
FUNCRIDSPLIT(omni_light)
451
FUNCRIDSPLIT(spot_light)
452
453
FUNC2(light_set_color, RID, const Color &)
454
FUNC3(light_set_param, RID, LightParam, float)
455
FUNC2(light_set_shadow, RID, bool)
456
FUNC2(light_set_projector, RID, RID)
457
FUNC2(light_set_negative, RID, bool)
458
FUNC2(light_set_cull_mask, RID, uint32_t)
459
FUNC5(light_set_distance_fade, RID, bool, float, float, float)
460
FUNC2(light_set_reverse_cull_face_mode, RID, bool)
461
FUNC2(light_set_shadow_caster_mask, RID, uint32_t)
462
FUNC2(light_set_bake_mode, RID, LightBakeMode)
463
FUNC2(light_set_max_sdfgi_cascade, RID, uint32_t)
464
465
FUNC2(light_omni_set_shadow_mode, RID, LightOmniShadowMode)
466
467
FUNC2(light_directional_set_shadow_mode, RID, LightDirectionalShadowMode)
468
FUNC2(light_directional_set_blend_splits, RID, bool)
469
FUNC2(light_directional_set_sky_mode, RID, LightDirectionalSkyMode)
470
471
/* PROBE API */
472
473
FUNCRIDSPLIT(reflection_probe)
474
475
FUNC2(reflection_probe_set_update_mode, RID, ReflectionProbeUpdateMode)
476
FUNC2(reflection_probe_set_intensity, RID, float)
477
FUNC2(reflection_probe_set_blend_distance, RID, float)
478
FUNC2(reflection_probe_set_ambient_color, RID, const Color &)
479
FUNC2(reflection_probe_set_ambient_energy, RID, float)
480
FUNC2(reflection_probe_set_ambient_mode, RID, ReflectionProbeAmbientMode)
481
FUNC2(reflection_probe_set_max_distance, RID, float)
482
FUNC2(reflection_probe_set_size, RID, const Vector3 &)
483
FUNC2(reflection_probe_set_origin_offset, RID, const Vector3 &)
484
FUNC2(reflection_probe_set_as_interior, RID, bool)
485
FUNC2(reflection_probe_set_enable_box_projection, RID, bool)
486
FUNC2(reflection_probe_set_enable_shadows, RID, bool)
487
FUNC2(reflection_probe_set_cull_mask, RID, uint32_t)
488
FUNC2(reflection_probe_set_reflection_mask, RID, uint32_t)
489
FUNC2(reflection_probe_set_resolution, RID, int)
490
FUNC2(reflection_probe_set_mesh_lod_threshold, RID, float)
491
492
/* LIGHTMAP */
493
494
FUNCRIDSPLIT(lightmap)
495
496
FUNC3(lightmap_set_textures, RID, RID, bool)
497
FUNC2(lightmap_set_probe_bounds, RID, const AABB &)
498
FUNC2(lightmap_set_probe_interior, RID, bool)
499
FUNC5(lightmap_set_probe_capture_data, RID, const PackedVector3Array &, const PackedColorArray &, const PackedInt32Array &, const PackedInt32Array &)
500
FUNC2(lightmap_set_baked_exposure_normalization, RID, float)
501
FUNC1RC(PackedVector3Array, lightmap_get_probe_capture_points, RID)
502
FUNC1RC(PackedColorArray, lightmap_get_probe_capture_sh, RID)
503
FUNC1RC(PackedInt32Array, lightmap_get_probe_capture_tetrahedra, RID)
504
FUNC1RC(PackedInt32Array, lightmap_get_probe_capture_bsp_tree, RID)
505
FUNC1(lightmap_set_probe_capture_update_speed, float)
506
507
FUNC2(lightmap_set_shadowmask_textures, RID, RID)
508
FUNC1R(ShadowmaskMode, lightmap_get_shadowmask_mode, RID)
509
FUNC2(lightmap_set_shadowmask_mode, RID, ShadowmaskMode)
510
511
/* Shadow Atlas */
512
FUNC0R(RID, shadow_atlas_create)
513
FUNC3(shadow_atlas_set_size, RID, int, bool)
514
FUNC3(shadow_atlas_set_quadrant_subdivision, RID, int, int)
515
516
FUNC2(directional_shadow_atlas_set_size, int, bool)
517
518
/* DECAL API */
519
520
#undef ServerName
521
#undef server_name
522
523
#define ServerName RendererTextureStorage
524
#define server_name RSG::texture_storage
525
526
FUNCRIDSPLIT(decal)
527
528
FUNC2(decal_set_size, RID, const Vector3 &)
529
FUNC3(decal_set_texture, RID, DecalTexture, RID)
530
FUNC2(decal_set_emission_energy, RID, float)
531
FUNC2(decal_set_albedo_mix, RID, float)
532
FUNC2(decal_set_modulate, RID, const Color &)
533
FUNC2(decal_set_cull_mask, RID, uint32_t)
534
FUNC4(decal_set_distance_fade, RID, bool, float, float)
535
FUNC3(decal_set_fade, RID, float, float)
536
FUNC2(decal_set_normal_fade, RID, float)
537
538
/* BAKED LIGHT API */
539
540
//from now on, calls forwarded to this singleton
541
#undef ServerName
542
#undef server_name
543
544
#define ServerName RendererGI
545
#define server_name RSG::gi
546
547
FUNCRIDSPLIT(voxel_gi)
548
549
FUNC8(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> &)
550
551
FUNC1RC(AABB, voxel_gi_get_bounds, RID)
552
FUNC1RC(Vector3i, voxel_gi_get_octree_size, RID)
553
FUNC1RC(Vector<uint8_t>, voxel_gi_get_octree_cells, RID)
554
FUNC1RC(Vector<uint8_t>, voxel_gi_get_data_cells, RID)
555
FUNC1RC(Vector<uint8_t>, voxel_gi_get_distance_field, RID)
556
FUNC1RC(Vector<int>, voxel_gi_get_level_counts, RID)
557
FUNC1RC(Transform3D, voxel_gi_get_to_cell_xform, RID)
558
559
FUNC2(voxel_gi_set_dynamic_range, RID, float)
560
FUNC2(voxel_gi_set_propagation, RID, float)
561
FUNC2(voxel_gi_set_energy, RID, float)
562
FUNC2(voxel_gi_set_baked_exposure_normalization, RID, float)
563
FUNC2(voxel_gi_set_bias, RID, float)
564
FUNC2(voxel_gi_set_normal_bias, RID, float)
565
FUNC2(voxel_gi_set_interior, RID, bool)
566
FUNC2(voxel_gi_set_use_two_bounces, RID, bool)
567
568
FUNC0(sdfgi_reset)
569
570
/* PARTICLES */
571
572
#undef ServerName
573
#undef server_name
574
575
#define ServerName RendererParticlesStorage
576
#define server_name RSG::particles_storage
577
578
FUNCRIDSPLIT(particles)
579
580
FUNC2(particles_set_mode, RID, ParticlesMode)
581
FUNC2(particles_set_emitting, RID, bool)
582
FUNC1R(bool, particles_get_emitting, RID)
583
FUNC2(particles_set_amount, RID, int)
584
FUNC2(particles_set_amount_ratio, RID, float)
585
FUNC2(particles_set_lifetime, RID, double)
586
FUNC2(particles_set_one_shot, RID, bool)
587
FUNC2(particles_set_pre_process_time, RID, double)
588
FUNC2(particles_request_process_time, RID, real_t)
589
FUNC2(particles_set_explosiveness_ratio, RID, float)
590
FUNC2(particles_set_randomness_ratio, RID, float)
591
FUNC2(particles_set_seed, RID, uint32_t)
592
FUNC2(particles_set_custom_aabb, RID, const AABB &)
593
FUNC2(particles_set_speed_scale, RID, double)
594
FUNC2(particles_set_use_local_coordinates, RID, bool)
595
FUNC2(particles_set_process_material, RID, RID)
596
FUNC2(particles_set_fixed_fps, RID, int)
597
FUNC2(particles_set_interpolate, RID, bool)
598
FUNC2(particles_set_fractional_delta, RID, bool)
599
FUNC1R(bool, particles_is_inactive, RID)
600
FUNC3(particles_set_trails, RID, bool, float)
601
FUNC2(particles_set_trail_bind_poses, RID, const Vector<Transform3D> &)
602
603
FUNC1(particles_request_process, RID)
604
FUNC1(particles_restart, RID)
605
FUNC6(particles_emit, RID, const Transform3D &, const Vector3 &, const Color &, const Color &, uint32_t)
606
FUNC2(particles_set_subemitter, RID, RID)
607
FUNC2(particles_set_collision_base_size, RID, float)
608
609
FUNC2(particles_set_transform_align, RID, RS::ParticlesTransformAlign)
610
611
FUNC2(particles_set_draw_order, RID, RS::ParticlesDrawOrder)
612
613
FUNC2(particles_set_draw_passes, RID, int)
614
FUNC3(particles_set_draw_pass_mesh, RID, int, RID)
615
616
FUNC1R(AABB, particles_get_current_aabb, RID)
617
FUNC2(particles_set_emission_transform, RID, const Transform3D &)
618
FUNC2(particles_set_emitter_velocity, RID, const Vector3 &)
619
FUNC2(particles_set_interp_to_end, RID, float)
620
621
/* PARTICLES COLLISION */
622
623
FUNCRIDSPLIT(particles_collision)
624
625
FUNC2(particles_collision_set_collision_type, RID, ParticlesCollisionType)
626
FUNC2(particles_collision_set_cull_mask, RID, uint32_t)
627
FUNC2(particles_collision_set_sphere_radius, RID, real_t)
628
FUNC2(particles_collision_set_box_extents, RID, const Vector3 &)
629
FUNC2(particles_collision_set_attractor_strength, RID, real_t)
630
FUNC2(particles_collision_set_attractor_directionality, RID, real_t)
631
FUNC2(particles_collision_set_attractor_attenuation, RID, real_t)
632
FUNC2(particles_collision_set_field_texture, RID, RID)
633
FUNC1(particles_collision_height_field_update, RID)
634
FUNC2(particles_collision_set_height_field_mask, RID, uint32_t)
635
FUNC2(particles_collision_set_height_field_resolution, RID, ParticlesCollisionHeightfieldResolution)
636
637
/* FOG VOLUME */
638
639
#undef ServerName
640
#undef server_name
641
642
#define ServerName RendererFog
643
#define server_name RSG::fog
644
645
FUNCRIDSPLIT(fog_volume)
646
647
FUNC2(fog_volume_set_shape, RID, FogVolumeShape)
648
FUNC2(fog_volume_set_size, RID, const Vector3 &)
649
FUNC2(fog_volume_set_material, RID, RID)
650
651
/* VISIBILITY_NOTIFIER */
652
653
#undef ServerName
654
#undef server_name
655
656
#define ServerName RendererUtilities
657
#define server_name RSG::utilities
658
659
FUNCRIDSPLIT(visibility_notifier)
660
FUNC2(visibility_notifier_set_aabb, RID, const AABB &)
661
FUNC3(visibility_notifier_set_callbacks, RID, const Callable &, const Callable &)
662
663
#undef server_name
664
#undef ServerName
665
//from now on, calls forwarded to this singleton
666
#define ServerName RenderingMethod
667
#define server_name RSG::scene
668
669
/* CAMERA API */
670
671
FUNCRIDSPLIT(camera)
672
FUNC4(camera_set_perspective, RID, float, float, float)
673
FUNC4(camera_set_orthogonal, RID, float, float, float)
674
FUNC5(camera_set_frustum, RID, float, Vector2, float, float)
675
FUNC2(camera_set_transform, RID, const Transform3D &)
676
FUNC2(camera_set_cull_mask, RID, uint32_t)
677
FUNC2(camera_set_environment, RID, RID)
678
FUNC2(camera_set_camera_attributes, RID, RID)
679
FUNC2(camera_set_compositor, RID, RID)
680
FUNC2(camera_set_use_vertical_aspect, RID, bool)
681
682
/* OCCLUDER */
683
FUNCRIDSPLIT(occluder)
684
FUNC3(occluder_set_mesh, RID, const PackedVector3Array &, const PackedInt32Array &)
685
686
#undef server_name
687
#undef ServerName
688
//from now on, calls forwarded to this singleton
689
#define ServerName RendererViewport
690
#define server_name RSG::viewport
691
692
/* VIEWPORT TARGET API */
693
694
FUNCRIDSPLIT(viewport)
695
696
FUNC2(viewport_set_use_xr, RID, bool)
697
FUNC3(viewport_set_size, RID, int, int)
698
699
FUNC2(viewport_set_active, RID, bool)
700
FUNC2(viewport_set_parent_viewport, RID, RID)
701
702
FUNC2(viewport_set_clear_mode, RID, ViewportClearMode)
703
704
FUNC3(viewport_attach_to_screen, RID, const Rect2 &, int)
705
FUNC2(viewport_set_render_direct_to_screen, RID, bool)
706
707
FUNC2(viewport_set_scaling_3d_mode, RID, ViewportScaling3DMode)
708
FUNC2(viewport_set_scaling_3d_scale, RID, float)
709
FUNC2(viewport_set_fsr_sharpness, RID, float)
710
FUNC2(viewport_set_texture_mipmap_bias, RID, float)
711
FUNC2(viewport_set_anisotropic_filtering_level, RID, ViewportAnisotropicFiltering)
712
713
FUNC2(viewport_set_update_mode, RID, ViewportUpdateMode)
714
FUNC1RC(ViewportUpdateMode, viewport_get_update_mode, RID)
715
716
FUNC1RC(RID, viewport_get_render_target, RID)
717
FUNC1RC(RID, viewport_get_texture, RID)
718
719
FUNC2(viewport_set_disable_2d, RID, bool)
720
FUNC2(viewport_set_environment_mode, RID, ViewportEnvironmentMode)
721
FUNC2(viewport_set_disable_3d, RID, bool)
722
723
FUNC2(viewport_set_canvas_cull_mask, RID, uint32_t)
724
725
FUNC2(viewport_attach_camera, RID, RID)
726
FUNC2(viewport_set_scenario, RID, RID)
727
FUNC2(viewport_attach_canvas, RID, RID)
728
729
FUNC2(viewport_remove_canvas, RID, RID)
730
FUNC3(viewport_set_canvas_transform, RID, RID, const Transform2D &)
731
FUNC2(viewport_set_transparent_background, RID, bool)
732
FUNC2(viewport_set_use_hdr_2d, RID, bool)
733
FUNC1RC(bool, viewport_is_using_hdr_2d, RID)
734
FUNC2(viewport_set_snap_2d_transforms_to_pixel, RID, bool)
735
FUNC2(viewport_set_snap_2d_vertices_to_pixel, RID, bool)
736
737
FUNC2(viewport_set_default_canvas_item_texture_filter, RID, CanvasItemTextureFilter)
738
FUNC2(viewport_set_default_canvas_item_texture_repeat, RID, CanvasItemTextureRepeat)
739
740
FUNC2(viewport_set_global_canvas_transform, RID, const Transform2D &)
741
FUNC4(viewport_set_canvas_stacking, RID, RID, int, int)
742
FUNC3(viewport_set_positional_shadow_atlas_size, RID, int, bool)
743
FUNC3(viewport_set_sdf_oversize_and_scale, RID, ViewportSDFOversize, ViewportSDFScale)
744
FUNC3(viewport_set_positional_shadow_atlas_quadrant_subdivision, RID, int, int)
745
FUNC2(viewport_set_msaa_2d, RID, ViewportMSAA)
746
FUNC2(viewport_set_msaa_3d, RID, ViewportMSAA)
747
FUNC2(viewport_set_screen_space_aa, RID, ViewportScreenSpaceAA)
748
FUNC2(viewport_set_use_taa, RID, bool)
749
FUNC2(viewport_set_use_debanding, RID, bool)
750
FUNC2(viewport_set_force_motion_vectors, RID, bool)
751
FUNC2(viewport_set_use_occlusion_culling, RID, bool)
752
FUNC1(viewport_set_occlusion_rays_per_thread, int)
753
FUNC1(viewport_set_occlusion_culling_build_quality, ViewportOcclusionCullingBuildQuality)
754
FUNC2(viewport_set_mesh_lod_threshold, RID, float)
755
756
FUNC3R(int, viewport_get_render_info, RID, ViewportRenderInfoType, ViewportRenderInfo)
757
FUNC2(viewport_set_debug_draw, RID, ViewportDebugDraw)
758
759
FUNC2(viewport_set_measure_render_time, RID, bool)
760
FUNC1RC(double, viewport_get_measured_render_time_cpu, RID)
761
FUNC1RC(double, viewport_get_measured_render_time_gpu, RID)
762
FUNC1RC(RID, viewport_find_from_screen_attachment, DisplayServer::WindowID)
763
764
FUNC2(call_set_vsync_mode, DisplayServer::VSyncMode, DisplayServer::WindowID)
765
766
FUNC2(viewport_set_vrs_mode, RID, ViewportVRSMode)
767
FUNC2(viewport_set_vrs_update_mode, RID, ViewportVRSUpdateMode)
768
FUNC2(viewport_set_vrs_texture, RID, RID)
769
770
/* COMPOSITOR EFFECT */
771
772
#undef server_name
773
#undef ServerName
774
//from now on, calls forwarded to this singleton
775
#define ServerName RenderingMethod
776
#define server_name RSG::scene
777
778
FUNCRIDSPLIT(compositor_effect)
779
FUNC2(compositor_effect_set_enabled, RID, bool)
780
FUNC3(compositor_effect_set_callback, RID, CompositorEffectCallbackType, const Callable &)
781
FUNC3(compositor_effect_set_flag, RID, CompositorEffectFlags, bool)
782
783
/* COMPOSITOR */
784
785
FUNC2(compositor_set_compositor_effects, RID, const TypedArray<RID> &)
786
787
FUNCRIDSPLIT(compositor)
788
789
/* ENVIRONMENT API */
790
791
FUNC1(voxel_gi_set_quality, VoxelGIQuality)
792
793
/* SKY API */
794
795
FUNCRIDSPLIT(sky)
796
FUNC2(sky_set_radiance_size, RID, int)
797
FUNC2(sky_set_mode, RID, SkyMode)
798
FUNC2(sky_set_material, RID, RID)
799
FUNC4R(Ref<Image>, sky_bake_panorama, RID, float, bool, const Size2i &)
800
801
/* ENVIRONMENT */
802
803
FUNCRIDSPLIT(environment)
804
805
FUNC2(environment_set_background, RID, EnvironmentBG)
806
FUNC2(environment_set_sky, RID, RID)
807
FUNC2(environment_set_sky_custom_fov, RID, float)
808
FUNC2(environment_set_sky_orientation, RID, const Basis &)
809
FUNC2(environment_set_bg_color, RID, const Color &)
810
FUNC3(environment_set_bg_energy, RID, float, float)
811
FUNC2(environment_set_canvas_max_layer, RID, int)
812
FUNC6(environment_set_ambient_light, RID, const Color &, EnvironmentAmbientSource, float, float, EnvironmentReflectionSource)
813
814
FUNC2(environment_set_camera_feed_id, RID, int)
815
816
FUNC6(environment_set_ssr, RID, bool, int, float, float, float)
817
FUNC1(environment_set_ssr_roughness_quality, EnvironmentSSRRoughnessQuality)
818
819
FUNC10(environment_set_ssao, RID, bool, float, float, float, float, float, float, float, float)
820
FUNC6(environment_set_ssao_quality, EnvironmentSSAOQuality, bool, float, int, float, float)
821
822
FUNC6(environment_set_ssil, RID, bool, float, float, float, float)
823
FUNC6(environment_set_ssil_quality, EnvironmentSSILQuality, bool, float, int, float, float)
824
825
FUNC13(environment_set_glow, RID, bool, Vector<float>, float, float, float, float, EnvironmentGlowBlendMode, float, float, float, float, RID)
826
FUNC1(environment_glow_set_use_bicubic_upscale, bool)
827
828
FUNC4(environment_set_tonemap, RID, EnvironmentToneMapper, float, float)
829
830
FUNC7(environment_set_adjustment, RID, bool, float, float, float, bool, RID)
831
832
FUNC11(environment_set_fog, RID, bool, const Color &, float, float, float, float, float, float, float, EnvironmentFogMode)
833
834
FUNC4(environment_set_fog_depth, RID, float, float, float)
835
FUNC14(environment_set_volumetric_fog, RID, bool, float, const Color &, const Color &, float, float, float, float, float, bool, float, float, float)
836
837
FUNC2(environment_set_volumetric_fog_volume_size, int, int)
838
FUNC1(environment_set_volumetric_fog_filter_active, bool)
839
840
FUNC11(environment_set_sdfgi, RID, bool, int, float, EnvironmentSDFGIYScale, bool, float, bool, float, float, float)
841
FUNC1(environment_set_sdfgi_ray_count, EnvironmentSDFGIRayCount)
842
FUNC1(environment_set_sdfgi_frames_to_converge, EnvironmentSDFGIFramesToConverge)
843
FUNC1(environment_set_sdfgi_frames_to_update_light, EnvironmentSDFGIFramesToUpdateLight)
844
845
FUNC3R(Ref<Image>, environment_bake_panorama, RID, bool, const Size2i &)
846
847
FUNC3(screen_space_roughness_limiter_set_active, bool, float, float)
848
FUNC1(sub_surface_scattering_set_quality, SubSurfaceScatteringQuality)
849
FUNC2(sub_surface_scattering_set_scale, float, float)
850
851
FUNC1(positional_soft_shadow_filter_set_quality, ShadowQuality);
852
FUNC1(directional_soft_shadow_filter_set_quality, ShadowQuality);
853
FUNC1(decals_set_filter, RS::DecalFilter);
854
FUNC1(light_projectors_set_filter, RS::LightProjectorFilter);
855
FUNC1(lightmaps_set_bicubic_filter, bool);
856
857
/* CAMERA ATTRIBUTES */
858
859
#undef server_name
860
#undef ServerName
861
//from now on, calls forwarded to this singleton
862
#define ServerName RendererCameraAttributes
863
#define server_name RSG::camera_attributes
864
865
FUNCRIDSPLIT(camera_attributes)
866
867
FUNC2(camera_attributes_set_dof_blur_quality, DOFBlurQuality, bool)
868
FUNC1(camera_attributes_set_dof_blur_bokeh_shape, DOFBokehShape)
869
870
FUNC8(camera_attributes_set_dof_blur, RID, bool, float, float, bool, float, float, float)
871
FUNC3(camera_attributes_set_exposure, RID, float, float)
872
FUNC6(camera_attributes_set_auto_exposure, RID, bool, float, float, float, float)
873
874
/* SCENARIO API */
875
876
#undef server_name
877
#undef ServerName
878
879
#define ServerName RenderingMethod
880
#define server_name RSG::scene
881
882
FUNCRIDSPLIT(scenario)
883
884
FUNC2(scenario_set_environment, RID, RID)
885
FUNC2(scenario_set_camera_attributes, RID, RID)
886
FUNC2(scenario_set_fallback_environment, RID, RID)
887
FUNC2(scenario_set_compositor, RID, RID)
888
889
/* INSTANCING API */
890
FUNCRIDSPLIT(instance)
891
892
FUNC2(instance_set_base, RID, RID)
893
FUNC2(instance_set_scenario, RID, RID)
894
FUNC2(instance_set_layer_mask, RID, uint32_t)
895
FUNC3(instance_set_pivot_data, RID, float, bool)
896
FUNC2(instance_set_transform, RID, const Transform3D &)
897
FUNC2(instance_attach_object_instance_id, RID, ObjectID)
898
FUNC3(instance_set_blend_shape_weight, RID, int, float)
899
FUNC3(instance_set_surface_override_material, RID, int, RID)
900
FUNC2(instance_set_visible, RID, bool)
901
902
FUNC1(instance_teleport, RID)
903
904
FUNC2(instance_set_custom_aabb, RID, AABB)
905
906
FUNC2(instance_attach_skeleton, RID, RID)
907
908
FUNC2(instance_set_extra_visibility_margin, RID, real_t)
909
FUNC2(instance_set_visibility_parent, RID, RID)
910
911
FUNC2(instance_set_ignore_culling, RID, bool)
912
913
// don't use these in a game!
914
FUNC2RC(Vector<ObjectID>, instances_cull_aabb, const AABB &, RID)
915
FUNC3RC(Vector<ObjectID>, instances_cull_ray, const Vector3 &, const Vector3 &, RID)
916
FUNC2RC(Vector<ObjectID>, instances_cull_convex, const Vector<Plane> &, RID)
917
918
FUNC3(instance_geometry_set_flag, RID, InstanceFlags, bool)
919
FUNC2(instance_geometry_set_cast_shadows_setting, RID, ShadowCastingSetting)
920
FUNC2(instance_geometry_set_material_override, RID, RID)
921
FUNC2(instance_geometry_set_material_overlay, RID, RID)
922
923
FUNC6(instance_geometry_set_visibility_range, RID, float, float, float, float, VisibilityRangeFadeMode)
924
FUNC4(instance_geometry_set_lightmap, RID, RID, const Rect2 &, int)
925
FUNC2(instance_geometry_set_lod_bias, RID, float)
926
FUNC2(instance_geometry_set_transparency, RID, float)
927
FUNC3(instance_geometry_set_shader_parameter, RID, const StringName &, const Variant &)
928
FUNC2RC(Variant, instance_geometry_get_shader_parameter, RID, const StringName &)
929
FUNC2RC(Variant, instance_geometry_get_shader_parameter_default_value, RID, const StringName &)
930
FUNC2C(instance_geometry_get_shader_parameter_list, RID, List<PropertyInfo> *)
931
932
FUNC3R(TypedArray<Image>, bake_render_uv2, RID, const TypedArray<RID> &, const Size2i &)
933
934
FUNC1(gi_set_use_half_resolution, bool)
935
936
#undef server_name
937
#undef ServerName
938
//from now on, calls forwarded to this singleton
939
#define ServerName RendererCanvasCull
940
#define server_name RSG::canvas
941
942
/* CANVAS (2D) */
943
944
FUNCRIDSPLIT(canvas)
945
FUNC3(canvas_set_item_mirroring, RID, RID, const Point2 &)
946
FUNC3(canvas_set_item_repeat, RID, const Point2 &, int)
947
FUNC2(canvas_set_modulate, RID, const Color &)
948
FUNC3(canvas_set_parent, RID, RID, float)
949
FUNC1(canvas_set_disable_scale, bool)
950
951
FUNCRIDSPLIT(canvas_texture)
952
FUNC3(canvas_texture_set_channel, RID, CanvasTextureChannel, RID)
953
FUNC3(canvas_texture_set_shading_parameters, RID, const Color &, float)
954
955
FUNC2(canvas_texture_set_texture_filter, RID, CanvasItemTextureFilter)
956
FUNC2(canvas_texture_set_texture_repeat, RID, CanvasItemTextureRepeat)
957
958
FUNCRIDSPLIT(canvas_item)
959
FUNC2(canvas_item_set_parent, RID, RID)
960
961
FUNC2(canvas_item_set_default_texture_filter, RID, CanvasItemTextureFilter)
962
FUNC2(canvas_item_set_default_texture_repeat, RID, CanvasItemTextureRepeat)
963
964
FUNC2(canvas_item_set_visible, RID, bool)
965
FUNC2(canvas_item_set_light_mask, RID, int)
966
967
FUNC2(canvas_item_set_visibility_layer, RID, uint32_t)
968
969
FUNC2(canvas_item_set_update_when_visible, RID, bool)
970
971
FUNC2(canvas_item_set_transform, RID, const Transform2D &)
972
FUNC2(canvas_item_set_clip, RID, bool)
973
FUNC2(canvas_item_set_distance_field_mode, RID, bool)
974
FUNC3(canvas_item_set_custom_rect, RID, bool, const Rect2 &)
975
FUNC2(canvas_item_set_modulate, RID, const Color &)
976
FUNC2(canvas_item_set_self_modulate, RID, const Color &)
977
978
FUNC2(canvas_item_set_draw_behind_parent, RID, bool)
979
FUNC2(canvas_item_set_use_identity_transform, RID, bool)
980
981
FUNC6(canvas_item_add_line, RID, const Point2 &, const Point2 &, const Color &, float, bool)
982
FUNC5(canvas_item_add_polyline, RID, const Vector<Point2> &, const Vector<Color> &, float, bool)
983
FUNC5(canvas_item_add_multiline, RID, const Vector<Point2> &, const Vector<Color> &, float, bool)
984
FUNC4(canvas_item_add_rect, RID, const Rect2 &, const Color &, bool)
985
FUNC5(canvas_item_add_circle, RID, const Point2 &, float, const Color &, bool)
986
FUNC6(canvas_item_add_texture_rect, RID, const Rect2 &, RID, bool, const Color &, bool)
987
FUNC7(canvas_item_add_texture_rect_region, RID, const Rect2 &, RID, const Rect2 &, const Color &, bool, bool)
988
FUNC8(canvas_item_add_msdf_texture_rect_region, RID, const Rect2 &, RID, const Rect2 &, const Color &, int, float, float)
989
FUNC5(canvas_item_add_lcd_texture_rect_region, RID, const Rect2 &, RID, const Rect2 &, const Color &)
990
FUNC10(canvas_item_add_nine_patch, RID, const Rect2 &, const Rect2 &, RID, const Vector2 &, const Vector2 &, NinePatchAxisMode, NinePatchAxisMode, bool, const Color &)
991
FUNC5(canvas_item_add_primitive, RID, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID)
992
FUNC5(canvas_item_add_polygon, RID, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID)
993
FUNC9(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)
994
FUNC5(canvas_item_add_mesh, RID, const RID &, const Transform2D &, const Color &, RID)
995
FUNC3(canvas_item_add_multimesh, RID, RID, RID)
996
FUNC3(canvas_item_add_particles, RID, RID, RID)
997
FUNC2(canvas_item_add_set_transform, RID, const Transform2D &)
998
FUNC2(canvas_item_add_clip_ignore, RID, bool)
999
FUNC5(canvas_item_add_animation_slice, RID, double, double, double, double)
1000
1001
FUNC2(canvas_item_set_sort_children_by_y, RID, bool)
1002
FUNC2(canvas_item_set_z_index, RID, int)
1003
FUNC2(canvas_item_set_z_as_relative_to_parent, RID, bool)
1004
FUNC3(canvas_item_set_copy_to_backbuffer, RID, bool, const Rect2 &)
1005
FUNC2(canvas_item_attach_skeleton, RID, RID)
1006
1007
FUNC1(canvas_item_clear, RID)
1008
FUNC2(canvas_item_set_draw_index, RID, int)
1009
1010
FUNC2(canvas_item_set_material, RID, RID)
1011
1012
FUNC3(canvas_item_set_instance_shader_parameter, RID, const StringName &, const Variant &)
1013
FUNC2RC(Variant, canvas_item_get_instance_shader_parameter, RID, const StringName &)
1014
FUNC2RC(Variant, canvas_item_get_instance_shader_parameter_default_value, RID, const StringName &)
1015
FUNC2C(canvas_item_get_instance_shader_parameter_list, RID, List<PropertyInfo> *)
1016
1017
FUNC2(canvas_item_set_use_parent_material, RID, bool)
1018
1019
FUNC5(canvas_item_set_visibility_notifier, RID, bool, const Rect2 &, const Callable &, const Callable &)
1020
1021
FUNC6(canvas_item_set_canvas_group_mode, RID, CanvasGroupMode, float, bool, float, bool)
1022
1023
FUNC1(canvas_item_set_debug_redraw, bool)
1024
FUNC0RC(bool, canvas_item_get_debug_redraw)
1025
1026
FUNC2(canvas_item_set_interpolated, RID, bool)
1027
FUNC1(canvas_item_reset_physics_interpolation, RID)
1028
FUNC2(canvas_item_transform_physics_interpolation, RID, const Transform2D &)
1029
1030
FUNCRIDSPLIT(canvas_light)
1031
1032
FUNC2(canvas_light_set_mode, RID, CanvasLightMode)
1033
1034
FUNC2(canvas_light_attach_to_canvas, RID, RID)
1035
FUNC2(canvas_light_set_enabled, RID, bool)
1036
FUNC2(canvas_light_set_texture_scale, RID, float)
1037
FUNC2(canvas_light_set_transform, RID, const Transform2D &)
1038
FUNC2(canvas_light_set_texture, RID, RID)
1039
FUNC2(canvas_light_set_texture_offset, RID, const Vector2 &)
1040
FUNC2(canvas_light_set_color, RID, const Color &)
1041
FUNC2(canvas_light_set_height, RID, float)
1042
FUNC2(canvas_light_set_energy, RID, float)
1043
FUNC3(canvas_light_set_z_range, RID, int, int)
1044
FUNC3(canvas_light_set_layer_range, RID, int, int)
1045
FUNC2(canvas_light_set_item_cull_mask, RID, int)
1046
FUNC2(canvas_light_set_item_shadow_cull_mask, RID, int)
1047
FUNC2(canvas_light_set_directional_distance, RID, float)
1048
1049
FUNC2(canvas_light_set_blend_mode, RID, CanvasLightBlendMode)
1050
1051
FUNC2(canvas_light_set_shadow_enabled, RID, bool)
1052
FUNC2(canvas_light_set_shadow_filter, RID, CanvasLightShadowFilter)
1053
FUNC2(canvas_light_set_shadow_color, RID, const Color &)
1054
FUNC2(canvas_light_set_shadow_smooth, RID, float)
1055
1056
FUNC2(canvas_light_set_interpolated, RID, bool)
1057
FUNC1(canvas_light_reset_physics_interpolation, RID)
1058
FUNC2(canvas_light_transform_physics_interpolation, RID, const Transform2D &)
1059
1060
FUNCRIDSPLIT(canvas_light_occluder)
1061
FUNC2(canvas_light_occluder_attach_to_canvas, RID, RID)
1062
FUNC2(canvas_light_occluder_set_enabled, RID, bool)
1063
FUNC2(canvas_light_occluder_set_polygon, RID, RID)
1064
FUNC2(canvas_light_occluder_set_as_sdf_collision, RID, bool)
1065
FUNC2(canvas_light_occluder_set_transform, RID, const Transform2D &)
1066
FUNC2(canvas_light_occluder_set_light_mask, RID, int)
1067
1068
FUNC2(canvas_light_occluder_set_interpolated, RID, bool)
1069
FUNC1(canvas_light_occluder_reset_physics_interpolation, RID)
1070
FUNC2(canvas_light_occluder_transform_physics_interpolation, RID, const Transform2D &)
1071
1072
FUNCRIDSPLIT(canvas_occluder_polygon)
1073
FUNC3(canvas_occluder_polygon_set_shape, RID, const Vector<Vector2> &, bool)
1074
1075
FUNC2(canvas_occluder_polygon_set_cull_mode, RID, CanvasOccluderPolygonCullMode)
1076
1077
FUNC1(canvas_set_shadow_texture_size, int)
1078
1079
FUNC1R(Rect2, _debug_canvas_item_get_rect, RID)
1080
1081
/* GLOBAL SHADER UNIFORMS */
1082
1083
#undef server_name
1084
#undef ServerName
1085
//from now on, calls forwarded to this singleton
1086
#define ServerName RendererMaterialStorage
1087
#define server_name RSG::material_storage
1088
1089
FUNC3(global_shader_parameter_add, const StringName &, GlobalShaderParameterType, const Variant &)
1090
FUNC1(global_shader_parameter_remove, const StringName &)
1091
FUNC0RC(Vector<StringName>, global_shader_parameter_get_list)
1092
FUNC2(global_shader_parameter_set, const StringName &, const Variant &)
1093
FUNC2(global_shader_parameter_set_override, const StringName &, const Variant &)
1094
FUNC1RC(GlobalShaderParameterType, global_shader_parameter_get_type, const StringName &)
1095
FUNC1RC(Variant, global_shader_parameter_get, const StringName &)
1096
1097
FUNC1(global_shader_parameters_load_settings, bool)
1098
FUNC0(global_shader_parameters_clear)
1099
1100
/* COMPOSITOR */
1101
1102
#undef server_name
1103
#undef ServerName
1104
#define ServerName RendererCompositor
1105
#define server_name RSG::rasterizer
1106
1107
FUNC4S(set_boot_image, const Ref<Image> &, const Color &, bool, bool)
1108
1109
/* STATUS INFORMATION */
1110
1111
#undef server_name
1112
#undef ServerName
1113
1114
/* UTILITIES */
1115
1116
#define ServerName RendererUtilities
1117
#define server_name RSG::utilities
1118
FUNC0RC(String, get_video_adapter_name)
1119
FUNC0RC(String, get_video_adapter_vendor)
1120
FUNC0RC(String, get_video_adapter_api_version)
1121
#undef server_name
1122
#undef ServerName
1123
#undef WRITE_ACTION
1124
#undef SYNC_DEBUG
1125
#ifdef DEBUG_ENABLED
1126
#undef MAIN_THREAD_SYNC_WARN
1127
#endif
1128
1129
virtual uint64_t get_rendering_info(RenderingInfo p_info) override;
1130
virtual RenderingDevice::DeviceType get_video_adapter_type() const override;
1131
1132
virtual void set_frame_profiling_enabled(bool p_enable) override;
1133
virtual Vector<FrameProfileArea> get_frame_profile() override;
1134
virtual uint64_t get_frame_profile_frame() override;
1135
1136
virtual RID get_test_cube() override;
1137
1138
/* FREE */
1139
1140
virtual void free(RID p_rid) override {
1141
if (Thread::get_caller_id() == server_thread) {
1142
command_queue.flush_if_pending();
1143
_free(p_rid);
1144
} else {
1145
command_queue.push(this, &RenderingServerDefault::_free, p_rid);
1146
}
1147
}
1148
1149
/* INTERPOLATION */
1150
1151
virtual void set_physics_interpolation_enabled(bool p_enabled) override;
1152
1153
/* EVENT QUEUING */
1154
1155
virtual void request_frame_drawn_callback(const Callable &p_callable) override;
1156
1157
virtual void draw(bool p_present, double frame_step) override;
1158
virtual void sync() override;
1159
virtual bool has_changed() const override;
1160
virtual void init() override;
1161
virtual void finish() override;
1162
virtual void tick() override;
1163
virtual void pre_draw(bool p_will_draw) override;
1164
1165
virtual bool is_on_render_thread() override {
1166
return Thread::get_caller_id() == server_thread;
1167
}
1168
1169
virtual void call_on_render_thread(const Callable &p_callable) override {
1170
if (Thread::get_caller_id() == server_thread) {
1171
command_queue.flush_if_pending();
1172
p_callable.call();
1173
} else {
1174
command_queue.push(this, &RenderingServerDefault::_call_on_render_thread, p_callable);
1175
}
1176
}
1177
1178
/* TESTING */
1179
1180
virtual double get_frame_setup_time_cpu() const override;
1181
1182
virtual Color get_default_clear_color() override;
1183
virtual void set_default_clear_color(const Color &p_color) override;
1184
1185
#ifndef DISABLE_DEPRECATED
1186
virtual bool has_feature(Features p_feature) const override;
1187
#endif
1188
1189
virtual bool has_os_feature(const String &p_feature) const override;
1190
virtual void set_debug_generate_wireframes(bool p_generate) override;
1191
1192
virtual bool is_low_end() const override;
1193
1194
virtual void sdfgi_set_debug_probe_select(const Vector3 &p_position, const Vector3 &p_dir) override;
1195
1196
virtual void set_print_gpu_profile(bool p_enable) override;
1197
1198
virtual Size2i get_maximum_viewport_size() const override;
1199
1200
RenderingServerDefault(bool p_create_thread = false);
1201
~RenderingServerDefault();
1202
};
1203
1204