forked from godotengine/godot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRenderingServer.xml
5897 lines (5895 loc) · 326 KB
/
RenderingServer.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8" ?>
<class name="RenderingServer" inherits="Object" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Server for anything visible.
</brief_description>
<description>
The rendering server is the API backend for everything visible. The whole scene system mounts on it to display. The rendering server is completely opaque: the internals are entirely implementation-specific and cannot be accessed.
The rendering server can be used to bypass the scene/[Node] system entirely. This can improve performance in cases where the scene system is the bottleneck, but won't improve performance otherwise (for instance, if the GPU is already fully utilized).
Resources are created using the [code]*_create[/code] functions. These functions return [RID]s which are not references to the objects themselves, but opaque [i]pointers[/i] towards these objects.
All objects are drawn to a viewport. You can use the [Viewport] attached to the [SceneTree] or you can create one yourself with [method viewport_create]. When using a custom scenario or canvas, the scenario or canvas needs to be attached to the viewport using [method viewport_set_scenario] or [method viewport_attach_canvas].
[b]Scenarios:[/b] In 3D, all visual objects must be associated with a scenario. The scenario is a visual representation of the world. If accessing the rendering server from a running game, the scenario can be accessed from the scene tree from any [Node3D] node with [method Node3D.get_world_3d]. Otherwise, a scenario can be created with [method scenario_create].
Similarly, in 2D, a canvas is needed to draw all canvas items.
[b]3D:[/b] In 3D, all visible objects are comprised of a resource and an instance. A resource can be a mesh, a particle system, a light, or any other 3D object. In order to be visible resources must be attached to an instance using [method instance_set_base]. The instance must also be attached to the scenario using [method instance_set_scenario] in order to be visible. RenderingServer methods that don't have a prefix are usually 3D-specific (but not always).
[b]2D:[/b] In 2D, all visible objects are some form of canvas item. In order to be visible, a canvas item needs to be the child of a canvas attached to a viewport, or it needs to be the child of another canvas item that is eventually attached to the canvas. 2D-specific RenderingServer methods generally start with [code]canvas_*[/code].
[b]Headless mode:[/b] Starting the engine with the [code]--headless[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url] disables all rendering and window management functions. Most functions from [RenderingServer] will return dummy values in this case.
</description>
<tutorials>
<link title="Optimization using Servers">$DOCS_URL/tutorials/performance/using_servers.html</link>
</tutorials>
<methods>
<method name="bake_render_uv2">
<return type="Image[]" />
<param index="0" name="base" type="RID" />
<param index="1" name="material_overrides" type="RID[]" />
<param index="2" name="image_size" type="Vector2i" />
<description>
Bakes the material data of the Mesh passed in the [param base] parameter with optional [param material_overrides] to a set of [Image]s of size [param image_size]. Returns an array of [Image]s containing material properties as specified in [enum BakeChannels].
</description>
</method>
<method name="call_on_render_thread">
<return type="void" />
<param index="0" name="callable" type="Callable" />
<description>
As the RenderingServer actual logic may run on an separate thread, accessing its internals from the main (or any other) thread will result in errors. To make it easier to run code that can safely access the rendering internals (such as [RenderingDevice] and similar RD classes), push a callable via this function so it will be executed on the render thread.
</description>
</method>
<method name="camera_attributes_create">
<return type="RID" />
<description>
Creates a camera attributes object and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]camera_attributes_[/code] RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method.
[b]Note:[/b] The equivalent resource is [CameraAttributes].
</description>
</method>
<method name="camera_attributes_set_auto_exposure">
<return type="void" />
<param index="0" name="camera_attributes" type="RID" />
<param index="1" name="enable" type="bool" />
<param index="2" name="min_sensitivity" type="float" />
<param index="3" name="max_sensitivity" type="float" />
<param index="4" name="speed" type="float" />
<param index="5" name="scale" type="float" />
<description>
Sets the parameters to use with the auto-exposure effect. These parameters take on the same meaning as their counterparts in [CameraAttributes] and [CameraAttributesPractical].
</description>
</method>
<method name="camera_attributes_set_dof_blur">
<return type="void" />
<param index="0" name="camera_attributes" type="RID" />
<param index="1" name="far_enable" type="bool" />
<param index="2" name="far_distance" type="float" />
<param index="3" name="far_transition" type="float" />
<param index="4" name="near_enable" type="bool" />
<param index="5" name="near_distance" type="float" />
<param index="6" name="near_transition" type="float" />
<param index="7" name="amount" type="float" />
<description>
Sets the parameters to use with the DOF blur effect. These parameters take on the same meaning as their counterparts in [CameraAttributesPractical].
</description>
</method>
<method name="camera_attributes_set_dof_blur_bokeh_shape">
<return type="void" />
<param index="0" name="shape" type="int" enum="RenderingServer.DOFBokehShape" />
<description>
Sets the shape of the DOF bokeh pattern. Different shapes may be used to achieve artistic effect, or to meet performance targets. For more detail on available options see [enum DOFBokehShape].
</description>
</method>
<method name="camera_attributes_set_dof_blur_quality">
<return type="void" />
<param index="0" name="quality" type="int" enum="RenderingServer.DOFBlurQuality" />
<param index="1" name="use_jitter" type="bool" />
<description>
Sets the quality level of the DOF blur effect to one of the options in [enum DOFBlurQuality]. [param use_jitter] can be used to jitter samples taken during the blur pass to hide artifacts at the cost of looking more fuzzy.
</description>
</method>
<method name="camera_attributes_set_exposure">
<return type="void" />
<param index="0" name="camera_attributes" type="RID" />
<param index="1" name="multiplier" type="float" />
<param index="2" name="normalization" type="float" />
<description>
Sets the exposure values that will be used by the renderers. The normalization amount is used to bake a given Exposure Value (EV) into rendering calculations to reduce the dynamic range of the scene.
The normalization factor can be calculated from exposure value (EV100) as follows:
[codeblock]
func get_exposure_normalization(ev100: float):
return 1.0 / (pow(2.0, ev100) * 1.2)
[/codeblock]
The exposure value can be calculated from aperture (in f-stops), shutter speed (in seconds), and sensitivity (in ISO) as follows:
[codeblock]
func get_exposure(aperture: float, shutter_speed: float, sensitivity: float):
return log((aperture * aperture) / shutter_speed * (100.0 / sensitivity)) / log(2)
[/codeblock]
</description>
</method>
<method name="camera_create">
<return type="RID" />
<description>
Creates a 3D camera and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]camera_*[/code] RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method.
[b]Note:[/b] The equivalent node is [Camera3D].
</description>
</method>
<method name="camera_set_camera_attributes">
<return type="void" />
<param index="0" name="camera" type="RID" />
<param index="1" name="effects" type="RID" />
<description>
Sets the camera_attributes created with [method camera_attributes_create] to the given camera.
</description>
</method>
<method name="camera_set_compositor">
<return type="void" />
<param index="0" name="camera" type="RID" />
<param index="1" name="compositor" type="RID" />
<description>
Sets the compositor used by this camera. Equivalent to [member Camera3D.compositor].
</description>
</method>
<method name="camera_set_cull_mask">
<return type="void" />
<param index="0" name="camera" type="RID" />
<param index="1" name="layers" type="int" />
<description>
Sets the cull mask associated with this camera. The cull mask describes which 3D layers are rendered by this camera. Equivalent to [member Camera3D.cull_mask].
</description>
</method>
<method name="camera_set_environment">
<return type="void" />
<param index="0" name="camera" type="RID" />
<param index="1" name="env" type="RID" />
<description>
Sets the environment used by this camera. Equivalent to [member Camera3D.environment].
</description>
</method>
<method name="camera_set_frustum">
<return type="void" />
<param index="0" name="camera" type="RID" />
<param index="1" name="size" type="float" />
<param index="2" name="offset" type="Vector2" />
<param index="3" name="z_near" type="float" />
<param index="4" name="z_far" type="float" />
<description>
Sets camera to use frustum projection. This mode allows adjusting the [param offset] argument to create "tilted frustum" effects.
</description>
</method>
<method name="camera_set_orthogonal">
<return type="void" />
<param index="0" name="camera" type="RID" />
<param index="1" name="size" type="float" />
<param index="2" name="z_near" type="float" />
<param index="3" name="z_far" type="float" />
<description>
Sets camera to use orthogonal projection, also known as orthographic projection. Objects remain the same size on the screen no matter how far away they are.
</description>
</method>
<method name="camera_set_perspective">
<return type="void" />
<param index="0" name="camera" type="RID" />
<param index="1" name="fovy_degrees" type="float" />
<param index="2" name="z_near" type="float" />
<param index="3" name="z_far" type="float" />
<description>
Sets camera to use perspective projection. Objects on the screen becomes smaller when they are far away.
</description>
</method>
<method name="camera_set_transform">
<return type="void" />
<param index="0" name="camera" type="RID" />
<param index="1" name="transform" type="Transform3D" />
<description>
Sets [Transform3D] of camera.
</description>
</method>
<method name="camera_set_use_vertical_aspect">
<return type="void" />
<param index="0" name="camera" type="RID" />
<param index="1" name="enable" type="bool" />
<description>
If [code]true[/code], preserves the horizontal aspect ratio which is equivalent to [constant Camera3D.KEEP_WIDTH]. If [code]false[/code], preserves the vertical aspect ratio which is equivalent to [constant Camera3D.KEEP_HEIGHT].
</description>
</method>
<method name="canvas_create">
<return type="RID" />
<description>
Creates a canvas and returns the assigned [RID]. It can be accessed with the RID that is returned. This RID will be used in all [code]canvas_*[/code] RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method.
Canvas has no [Resource] or [Node] equivalent.
</description>
</method>
<method name="canvas_item_add_animation_slice">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="animation_length" type="float" />
<param index="2" name="slice_begin" type="float" />
<param index="3" name="slice_end" type="float" />
<param index="4" name="offset" type="float" default="0.0" />
<description>
Subsequent drawing commands will be ignored unless they fall within the specified animation slice. This is a faster way to implement animations that loop on background rather than redrawing constantly.
</description>
</method>
<method name="canvas_item_add_circle">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="pos" type="Vector2" />
<param index="2" name="radius" type="float" />
<param index="3" name="color" type="Color" />
<param index="4" name="antialiased" type="bool" default="false" />
<description>
Draws a circle on the [CanvasItem] pointed to by the [param item] [RID]. See also [method CanvasItem.draw_circle].
</description>
</method>
<method name="canvas_item_add_clip_ignore">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="ignore" type="bool" />
<description>
If [param ignore] is [code]true[/code], ignore clipping on items drawn with this canvas item until this is called again with [param ignore] set to [code]false[/code].
</description>
</method>
<method name="canvas_item_add_lcd_texture_rect_region">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="rect" type="Rect2" />
<param index="2" name="texture" type="RID" />
<param index="3" name="src_rect" type="Rect2" />
<param index="4" name="modulate" type="Color" />
<description>
See also [method CanvasItem.draw_lcd_texture_rect_region].
</description>
</method>
<method name="canvas_item_add_line">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="from" type="Vector2" />
<param index="2" name="to" type="Vector2" />
<param index="3" name="color" type="Color" />
<param index="4" name="width" type="float" default="-1.0" />
<param index="5" name="antialiased" type="bool" default="false" />
<description>
Draws a line on the [CanvasItem] pointed to by the [param item] [RID]. See also [method CanvasItem.draw_line].
</description>
</method>
<method name="canvas_item_add_mesh">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="mesh" type="RID" />
<param index="2" name="transform" type="Transform2D" default="Transform2D(1, 0, 0, 1, 0, 0)" />
<param index="3" name="modulate" type="Color" default="Color(1, 1, 1, 1)" />
<param index="4" name="texture" type="RID" default="RID()" />
<description>
Draws a mesh created with [method mesh_create] with given [param transform], [param modulate] color, and [param texture]. This is used internally by [MeshInstance2D].
</description>
</method>
<method name="canvas_item_add_msdf_texture_rect_region">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="rect" type="Rect2" />
<param index="2" name="texture" type="RID" />
<param index="3" name="src_rect" type="Rect2" />
<param index="4" name="modulate" type="Color" default="Color(1, 1, 1, 1)" />
<param index="5" name="outline_size" type="int" default="0" />
<param index="6" name="px_range" type="float" default="1.0" />
<param index="7" name="scale" type="float" default="1.0" />
<description>
See also [method CanvasItem.draw_msdf_texture_rect_region].
</description>
</method>
<method name="canvas_item_add_multiline">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="points" type="PackedVector2Array" />
<param index="2" name="colors" type="PackedColorArray" />
<param index="3" name="width" type="float" default="-1.0" />
<param index="4" name="antialiased" type="bool" default="false" />
<description>
Draws a 2D multiline on the [CanvasItem] pointed to by the [param item] [RID]. See also [method CanvasItem.draw_multiline] and [method CanvasItem.draw_multiline_colors].
</description>
</method>
<method name="canvas_item_add_multimesh">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="mesh" type="RID" />
<param index="2" name="texture" type="RID" default="RID()" />
<description>
Draws a 2D [MultiMesh] on the [CanvasItem] pointed to by the [param item] [RID]. See also [method CanvasItem.draw_multimesh].
</description>
</method>
<method name="canvas_item_add_nine_patch">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="rect" type="Rect2" />
<param index="2" name="source" type="Rect2" />
<param index="3" name="texture" type="RID" />
<param index="4" name="topleft" type="Vector2" />
<param index="5" name="bottomright" type="Vector2" />
<param index="6" name="x_axis_mode" type="int" enum="RenderingServer.NinePatchAxisMode" default="0" />
<param index="7" name="y_axis_mode" type="int" enum="RenderingServer.NinePatchAxisMode" default="0" />
<param index="8" name="draw_center" type="bool" default="true" />
<param index="9" name="modulate" type="Color" default="Color(1, 1, 1, 1)" />
<description>
Draws a nine-patch rectangle on the [CanvasItem] pointed to by the [param item] [RID].
</description>
</method>
<method name="canvas_item_add_particles">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="particles" type="RID" />
<param index="2" name="texture" type="RID" />
<description>
Draws particles on the [CanvasItem] pointed to by the [param item] [RID].
</description>
</method>
<method name="canvas_item_add_polygon">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="points" type="PackedVector2Array" />
<param index="2" name="colors" type="PackedColorArray" />
<param index="3" name="uvs" type="PackedVector2Array" default="PackedVector2Array()" />
<param index="4" name="texture" type="RID" default="RID()" />
<description>
Draws a 2D polygon on the [CanvasItem] pointed to by the [param item] [RID]. If you need more flexibility (such as being able to use bones), use [method canvas_item_add_triangle_array] instead. See also [method CanvasItem.draw_polygon].
[b]Note:[/b] If you frequently redraw the same polygon with a large number of vertices, consider pre-calculating the triangulation with [method Geometry2D.triangulate_polygon] and using [method CanvasItem.draw_mesh], [method CanvasItem.draw_multimesh], or [method canvas_item_add_triangle_array].
</description>
</method>
<method name="canvas_item_add_polyline">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="points" type="PackedVector2Array" />
<param index="2" name="colors" type="PackedColorArray" />
<param index="3" name="width" type="float" default="-1.0" />
<param index="4" name="antialiased" type="bool" default="false" />
<description>
Draws a 2D polyline on the [CanvasItem] pointed to by the [param item] [RID]. See also [method CanvasItem.draw_polyline] and [method CanvasItem.draw_polyline_colors].
</description>
</method>
<method name="canvas_item_add_primitive">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="points" type="PackedVector2Array" />
<param index="2" name="colors" type="PackedColorArray" />
<param index="3" name="uvs" type="PackedVector2Array" />
<param index="4" name="texture" type="RID" />
<description>
Draws a 2D primitive on the [CanvasItem] pointed to by the [param item] [RID]. See also [method CanvasItem.draw_primitive].
</description>
</method>
<method name="canvas_item_add_rect">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="rect" type="Rect2" />
<param index="2" name="color" type="Color" />
<param index="3" name="antialiased" type="bool" default="false" />
<description>
Draws a rectangle on the [CanvasItem] pointed to by the [param item] [RID]. See also [method CanvasItem.draw_rect].
</description>
</method>
<method name="canvas_item_add_set_transform">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="transform" type="Transform2D" />
<description>
Sets a [Transform2D] that will be used to transform subsequent canvas item commands.
</description>
</method>
<method name="canvas_item_add_texture_rect">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="rect" type="Rect2" />
<param index="2" name="texture" type="RID" />
<param index="3" name="tile" type="bool" default="false" />
<param index="4" name="modulate" type="Color" default="Color(1, 1, 1, 1)" />
<param index="5" name="transpose" type="bool" default="false" />
<description>
Draws a 2D textured rectangle on the [CanvasItem] pointed to by the [param item] [RID]. See also [method CanvasItem.draw_texture_rect] and [method Texture2D.draw_rect].
</description>
</method>
<method name="canvas_item_add_texture_rect_region">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="rect" type="Rect2" />
<param index="2" name="texture" type="RID" />
<param index="3" name="src_rect" type="Rect2" />
<param index="4" name="modulate" type="Color" default="Color(1, 1, 1, 1)" />
<param index="5" name="transpose" type="bool" default="false" />
<param index="6" name="clip_uv" type="bool" default="true" />
<description>
Draws the specified region of a 2D textured rectangle on the [CanvasItem] pointed to by the [param item] [RID]. See also [method CanvasItem.draw_texture_rect_region] and [method Texture2D.draw_rect_region].
</description>
</method>
<method name="canvas_item_add_triangle_array">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="indices" type="PackedInt32Array" />
<param index="2" name="points" type="PackedVector2Array" />
<param index="3" name="colors" type="PackedColorArray" />
<param index="4" name="uvs" type="PackedVector2Array" default="PackedVector2Array()" />
<param index="5" name="bones" type="PackedInt32Array" default="PackedInt32Array()" />
<param index="6" name="weights" type="PackedFloat32Array" default="PackedFloat32Array()" />
<param index="7" name="texture" type="RID" default="RID()" />
<param index="8" name="count" type="int" default="-1" />
<description>
Draws a triangle array on the [CanvasItem] pointed to by the [param item] [RID]. This is internally used by [Line2D] and [StyleBoxFlat] for rendering. [method canvas_item_add_triangle_array] is highly flexible, but more complex to use than [method canvas_item_add_polygon].
[b]Note:[/b] [param count] is unused and can be left unspecified.
</description>
</method>
<method name="canvas_item_attach_skeleton">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="skeleton" type="RID" />
<description>
Attaches a skeleton to the [CanvasItem]. Removes the previous skeleton.
</description>
</method>
<method name="canvas_item_clear">
<return type="void" />
<param index="0" name="item" type="RID" />
<description>
Clears the [CanvasItem] and removes all commands in it.
</description>
</method>
<method name="canvas_item_create">
<return type="RID" />
<description>
Creates a new CanvasItem instance and returns its [RID]. It can be accessed with the RID that is returned. This RID will be used in all [code]canvas_item_*[/code] RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method.
[b]Note:[/b] The equivalent node is [CanvasItem].
</description>
</method>
<method name="canvas_item_get_instance_shader_parameter" qualifiers="const">
<return type="Variant" />
<param index="0" name="instance" type="RID" />
<param index="1" name="parameter" type="StringName" />
<description>
Returns the value of the per-instance shader uniform from the specified canvas item instance. Equivalent to [method CanvasItem.get_instance_shader_parameter].
</description>
</method>
<method name="canvas_item_get_instance_shader_parameter_default_value" qualifiers="const">
<return type="Variant" />
<param index="0" name="instance" type="RID" />
<param index="1" name="parameter" type="StringName" />
<description>
Returns the default value of the per-instance shader uniform from the specified canvas item instance. Equivalent to [method CanvasItem.get_instance_shader_parameter].
</description>
</method>
<method name="canvas_item_get_instance_shader_parameter_list" qualifiers="const">
<return type="Dictionary[]" />
<param index="0" name="instance" type="RID" />
<description>
Returns a dictionary of per-instance shader uniform names of the per-instance shader uniform from the specified canvas item instance.
The returned dictionary is in PropertyInfo format, with the keys [code]name[/code], [code]class_name[/code], [code]type[/code], [code]hint[/code], [code]hint_string[/code], and [code]usage[/code].
</description>
</method>
<method name="canvas_item_reset_physics_interpolation">
<return type="void" />
<param index="0" name="item" type="RID" />
<description>
Prevents physics interpolation for the current physics tick.
This is useful when moving a canvas item to a new location, to give an instantaneous change rather than interpolation from the previous location.
</description>
</method>
<method name="canvas_item_set_canvas_group_mode">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="mode" type="int" enum="RenderingServer.CanvasGroupMode" />
<param index="2" name="clear_margin" type="float" default="5.0" />
<param index="3" name="fit_empty" type="bool" default="false" />
<param index="4" name="fit_margin" type="float" default="0.0" />
<param index="5" name="blur_mipmaps" type="bool" default="false" />
<description>
Sets the canvas group mode used during 2D rendering for the canvas item specified by the [param item] RID. For faster but more limited clipping, use [method canvas_item_set_clip] instead.
[b]Note:[/b] The equivalent node functionality is found in [CanvasGroup] and [member CanvasItem.clip_children].
</description>
</method>
<method name="canvas_item_set_clip">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="clip" type="bool" />
<description>
If [param clip] is [code]true[/code], makes the canvas item specified by the [param item] RID not draw anything outside of its rect's coordinates. This clipping is fast, but works only with axis-aligned rectangles. This means that rotation is ignored by the clipping rectangle. For more advanced clipping shapes, use [method canvas_item_set_canvas_group_mode] instead.
[b]Note:[/b] The equivalent node functionality is found in [member Label.clip_text], [RichTextLabel] (always enabled) and more.
</description>
</method>
<method name="canvas_item_set_copy_to_backbuffer">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="enabled" type="bool" />
<param index="2" name="rect" type="Rect2" />
<description>
Sets the [CanvasItem] to copy a rect to the backbuffer.
</description>
</method>
<method name="canvas_item_set_custom_rect">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="use_custom_rect" type="bool" />
<param index="2" name="rect" type="Rect2" default="Rect2(0, 0, 0, 0)" />
<description>
If [param use_custom_rect] is [code]true[/code], sets the custom visibility rectangle (used for culling) to [param rect] for the canvas item specified by [param item]. Setting a custom visibility rect can reduce CPU load when drawing lots of 2D instances. If [param use_custom_rect] is [code]false[/code], automatically computes a visibility rectangle based on the canvas item's draw commands.
</description>
</method>
<method name="canvas_item_set_default_texture_filter">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="filter" type="int" enum="RenderingServer.CanvasItemTextureFilter" />
<description>
Sets the default texture filter mode for the canvas item specified by the [param item] RID. Equivalent to [member CanvasItem.texture_filter].
</description>
</method>
<method name="canvas_item_set_default_texture_repeat">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="repeat" type="int" enum="RenderingServer.CanvasItemTextureRepeat" />
<description>
Sets the default texture repeat mode for the canvas item specified by the [param item] RID. Equivalent to [member CanvasItem.texture_repeat].
</description>
</method>
<method name="canvas_item_set_distance_field_mode">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="enabled" type="bool" />
<description>
If [param enabled] is [code]true[/code], enables multichannel signed distance field rendering mode for the canvas item specified by the [param item] RID. This is meant to be used for font rendering, or with specially generated images using [url=https://github.com/Chlumsky/msdfgen]msdfgen[/url].
</description>
</method>
<method name="canvas_item_set_draw_behind_parent">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="enabled" type="bool" />
<description>
If [param enabled] is [code]true[/code], draws the canvas item specified by the [param item] RID behind its parent. Equivalent to [member CanvasItem.show_behind_parent].
</description>
</method>
<method name="canvas_item_set_draw_index">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="index" type="int" />
<description>
Sets the index for the [CanvasItem].
</description>
</method>
<method name="canvas_item_set_instance_shader_parameter">
<return type="void" />
<param index="0" name="instance" type="RID" />
<param index="1" name="parameter" type="StringName" />
<param index="2" name="value" type="Variant" />
<description>
Sets the per-instance shader uniform on the specified canvas item instance. Equivalent to [method CanvasItem.set_instance_shader_parameter].
</description>
</method>
<method name="canvas_item_set_interpolated">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="interpolated" type="bool" />
<description>
If [param interpolated] is [code]true[/code], turns on physics interpolation for the canvas item.
</description>
</method>
<method name="canvas_item_set_light_mask">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="mask" type="int" />
<description>
Sets the light [param mask] for the canvas item specified by the [param item] RID. Equivalent to [member CanvasItem.light_mask].
</description>
</method>
<method name="canvas_item_set_material">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="material" type="RID" />
<description>
Sets a new [param material] to the canvas item specified by the [param item] RID. Equivalent to [member CanvasItem.material].
</description>
</method>
<method name="canvas_item_set_modulate">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="color" type="Color" />
<description>
Multiplies the color of the canvas item specified by the [param item] RID, while affecting its children. See also [method canvas_item_set_self_modulate]. Equivalent to [member CanvasItem.modulate].
</description>
</method>
<method name="canvas_item_set_parent">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="parent" type="RID" />
<description>
Sets a parent [CanvasItem] to the [CanvasItem]. The item will inherit transform, modulation and visibility from its parent, like [CanvasItem] nodes in the scene tree.
</description>
</method>
<method name="canvas_item_set_self_modulate">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="color" type="Color" />
<description>
Multiplies the color of the canvas item specified by the [param item] RID, without affecting its children. See also [method canvas_item_set_modulate]. Equivalent to [member CanvasItem.self_modulate].
</description>
</method>
<method name="canvas_item_set_sort_children_by_y">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="enabled" type="bool" />
<description>
If [param enabled] is [code]true[/code], child nodes with the lowest Y position are drawn before those with a higher Y position. Y-sorting only affects children that inherit from the canvas item specified by the [param item] RID, not the canvas item itself. Equivalent to [member CanvasItem.y_sort_enabled].
</description>
</method>
<method name="canvas_item_set_transform">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="transform" type="Transform2D" />
<description>
Sets the [param transform] of the canvas item specified by the [param item] RID. This affects where and how the item will be drawn. Child canvas items' transforms are multiplied by their parent's transform. Equivalent to [member Node2D.transform].
</description>
</method>
<method name="canvas_item_set_use_parent_material">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="enabled" type="bool" />
<description>
Sets if the [CanvasItem] uses its parent's material.
</description>
</method>
<method name="canvas_item_set_visibility_layer">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="visibility_layer" type="int" />
<description>
Sets the rendering visibility layer associated with this [CanvasItem]. Only [Viewport] nodes with a matching rendering mask will render this [CanvasItem].
</description>
</method>
<method name="canvas_item_set_visibility_notifier">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="enable" type="bool" />
<param index="2" name="area" type="Rect2" />
<param index="3" name="enter_callable" type="Callable" />
<param index="4" name="exit_callable" type="Callable" />
<description>
Sets the given [CanvasItem] as visibility notifier. [param area] defines the area of detecting visibility. [param enter_callable] is called when the [CanvasItem] enters the screen, [param exit_callable] is called when the [CanvasItem] exits the screen. If [param enable] is [code]false[/code], the item will no longer function as notifier.
This method can be used to manually mimic [VisibleOnScreenNotifier2D].
</description>
</method>
<method name="canvas_item_set_visible">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="visible" type="bool" />
<description>
Sets the visibility of the [CanvasItem].
</description>
</method>
<method name="canvas_item_set_z_as_relative_to_parent">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="enabled" type="bool" />
<description>
If this is enabled, the Z index of the parent will be added to the children's Z index.
</description>
</method>
<method name="canvas_item_set_z_index">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="z_index" type="int" />
<description>
Sets the [CanvasItem]'s Z index, i.e. its draw order (lower indexes are drawn first).
</description>
</method>
<method name="canvas_item_transform_physics_interpolation">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="transform" type="Transform2D" />
<description>
Transforms both the current and previous stored transform for a canvas item.
This allows transforming a canvas item without creating a "glitch" in the interpolation, which is particularly useful for large worlds utilizing a shifting origin.
</description>
</method>
<method name="canvas_light_attach_to_canvas">
<return type="void" />
<param index="0" name="light" type="RID" />
<param index="1" name="canvas" type="RID" />
<description>
Attaches the canvas light to the canvas. Removes it from its previous canvas.
</description>
</method>
<method name="canvas_light_create">
<return type="RID" />
<description>
Creates a canvas light and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]canvas_light_*[/code] RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method.
[b]Note:[/b] The equivalent node is [Light2D].
</description>
</method>
<method name="canvas_light_occluder_attach_to_canvas">
<return type="void" />
<param index="0" name="occluder" type="RID" />
<param index="1" name="canvas" type="RID" />
<description>
Attaches a light occluder to the canvas. Removes it from its previous canvas.
</description>
</method>
<method name="canvas_light_occluder_create">
<return type="RID" />
<description>
Creates a light occluder and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]canvas_light_occluder_*[/code] RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method.
[b]Note:[/b] The equivalent node is [LightOccluder2D].
</description>
</method>
<method name="canvas_light_occluder_reset_physics_interpolation">
<return type="void" />
<param index="0" name="occluder" type="RID" />
<description>
Prevents physics interpolation for the current physics tick.
This is useful when moving an occluder to a new location, to give an instantaneous change rather than interpolation from the previous location.
</description>
</method>
<method name="canvas_light_occluder_set_as_sdf_collision">
<return type="void" />
<param index="0" name="occluder" type="RID" />
<param index="1" name="enable" type="bool" />
<description>
</description>
</method>
<method name="canvas_light_occluder_set_enabled">
<return type="void" />
<param index="0" name="occluder" type="RID" />
<param index="1" name="enabled" type="bool" />
<description>
Enables or disables light occluder.
</description>
</method>
<method name="canvas_light_occluder_set_interpolated">
<return type="void" />
<param index="0" name="occluder" type="RID" />
<param index="1" name="interpolated" type="bool" />
<description>
If [param interpolated] is [code]true[/code], turns on physics interpolation for the light occluder.
</description>
</method>
<method name="canvas_light_occluder_set_light_mask">
<return type="void" />
<param index="0" name="occluder" type="RID" />
<param index="1" name="mask" type="int" />
<description>
The light mask. See [LightOccluder2D] for more information on light masks.
</description>
</method>
<method name="canvas_light_occluder_set_polygon">
<return type="void" />
<param index="0" name="occluder" type="RID" />
<param index="1" name="polygon" type="RID" />
<description>
Sets a light occluder's polygon.
</description>
</method>
<method name="canvas_light_occluder_set_transform">
<return type="void" />
<param index="0" name="occluder" type="RID" />
<param index="1" name="transform" type="Transform2D" />
<description>
Sets a light occluder's [Transform2D].
</description>
</method>
<method name="canvas_light_occluder_transform_physics_interpolation">
<return type="void" />
<param index="0" name="occluder" type="RID" />
<param index="1" name="transform" type="Transform2D" />
<description>
Transforms both the current and previous stored transform for a light occluder.
This allows transforming an occluder without creating a "glitch" in the interpolation, which is particularly useful for large worlds utilizing a shifting origin.
</description>
</method>
<method name="canvas_light_reset_physics_interpolation">
<return type="void" />
<param index="0" name="light" type="RID" />
<description>
Prevents physics interpolation for the current physics tick.
This is useful when moving a canvas item to a new location, to give an instantaneous change rather than interpolation from the previous location.
</description>
</method>
<method name="canvas_light_set_blend_mode">
<return type="void" />
<param index="0" name="light" type="RID" />
<param index="1" name="mode" type="int" enum="RenderingServer.CanvasLightBlendMode" />
<description>
Sets the blend mode for the given canvas light. See [enum CanvasLightBlendMode] for options. Equivalent to [member Light2D.blend_mode].
</description>
</method>
<method name="canvas_light_set_color">
<return type="void" />
<param index="0" name="light" type="RID" />
<param index="1" name="color" type="Color" />
<description>
Sets the color for a light.
</description>
</method>
<method name="canvas_light_set_enabled">
<return type="void" />
<param index="0" name="light" type="RID" />
<param index="1" name="enabled" type="bool" />
<description>
Enables or disables a canvas light.
</description>
</method>
<method name="canvas_light_set_energy">
<return type="void" />
<param index="0" name="light" type="RID" />
<param index="1" name="energy" type="float" />
<description>
Sets a canvas light's energy.
</description>
</method>
<method name="canvas_light_set_height">
<return type="void" />
<param index="0" name="light" type="RID" />
<param index="1" name="height" type="float" />
<description>
Sets a canvas light's height.
</description>
</method>
<method name="canvas_light_set_interpolated">
<return type="void" />
<param index="0" name="light" type="RID" />
<param index="1" name="interpolated" type="bool" />
<description>
If [param interpolated] is [code]true[/code], turns on physics interpolation for the canvas light.
</description>
</method>
<method name="canvas_light_set_item_cull_mask">
<return type="void" />
<param index="0" name="light" type="RID" />
<param index="1" name="mask" type="int" />
<description>
The light mask. See [LightOccluder2D] for more information on light masks.
</description>
</method>
<method name="canvas_light_set_item_shadow_cull_mask">
<return type="void" />
<param index="0" name="light" type="RID" />
<param index="1" name="mask" type="int" />
<description>
The binary mask used to determine which layers this canvas light's shadows affects. See [LightOccluder2D] for more information on light masks.
</description>
</method>
<method name="canvas_light_set_layer_range">
<return type="void" />
<param index="0" name="light" type="RID" />
<param index="1" name="min_layer" type="int" />
<param index="2" name="max_layer" type="int" />
<description>
The layer range that gets rendered with this light.
</description>
</method>
<method name="canvas_light_set_mode">
<return type="void" />
<param index="0" name="light" type="RID" />
<param index="1" name="mode" type="int" enum="RenderingServer.CanvasLightMode" />
<description>
The mode of the light, see [enum CanvasLightMode] constants.
</description>
</method>
<method name="canvas_light_set_shadow_color">
<return type="void" />
<param index="0" name="light" type="RID" />
<param index="1" name="color" type="Color" />
<description>
Sets the color of the canvas light's shadow.
</description>
</method>
<method name="canvas_light_set_shadow_enabled">
<return type="void" />
<param index="0" name="light" type="RID" />
<param index="1" name="enabled" type="bool" />
<description>
Enables or disables the canvas light's shadow.
</description>
</method>
<method name="canvas_light_set_shadow_filter">
<return type="void" />
<param index="0" name="light" type="RID" />
<param index="1" name="filter" type="int" enum="RenderingServer.CanvasLightShadowFilter" />
<description>
Sets the canvas light's shadow's filter, see [enum CanvasLightShadowFilter] constants.
</description>
</method>
<method name="canvas_light_set_shadow_smooth">
<return type="void" />
<param index="0" name="light" type="RID" />
<param index="1" name="smooth" type="float" />
<description>
Smoothens the shadow. The lower, the smoother.
</description>
</method>
<method name="canvas_light_set_texture">
<return type="void" />
<param index="0" name="light" type="RID" />
<param index="1" name="texture" type="RID" />
<description>
Sets the texture to be used by a [PointLight2D]. Equivalent to [member PointLight2D.texture].
</description>
</method>
<method name="canvas_light_set_texture_offset">
<return type="void" />
<param index="0" name="light" type="RID" />
<param index="1" name="offset" type="Vector2" />
<description>
Sets the offset of a [PointLight2D]'s texture. Equivalent to [member PointLight2D.offset].
</description>
</method>
<method name="canvas_light_set_texture_scale">
<return type="void" />
<param index="0" name="light" type="RID" />
<param index="1" name="scale" type="float" />
<description>
Sets the scale factor of a [PointLight2D]'s texture. Equivalent to [member PointLight2D.texture_scale].
</description>
</method>
<method name="canvas_light_set_transform">
<return type="void" />
<param index="0" name="light" type="RID" />
<param index="1" name="transform" type="Transform2D" />
<description>
Sets the canvas light's [Transform2D].
</description>
</method>
<method name="canvas_light_set_z_range">
<return type="void" />
<param index="0" name="light" type="RID" />
<param index="1" name="min_z" type="int" />
<param index="2" name="max_z" type="int" />
<description>
Sets the Z range of objects that will be affected by this light. Equivalent to [member Light2D.range_z_min] and [member Light2D.range_z_max].
</description>
</method>
<method name="canvas_light_transform_physics_interpolation">
<return type="void" />
<param index="0" name="light" type="RID" />
<param index="1" name="transform" type="Transform2D" />
<description>
Transforms both the current and previous stored transform for a canvas light.
This allows transforming a light without creating a "glitch" in the interpolation, which is particularly useful for large worlds utilizing a shifting origin.
</description>
</method>
<method name="canvas_occluder_polygon_create">
<return type="RID" />
<description>
Creates a new light occluder polygon and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]canvas_occluder_polygon_*[/code] RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method.
[b]Note:[/b] The equivalent resource is [OccluderPolygon2D].
</description>
</method>
<method name="canvas_occluder_polygon_set_cull_mode">
<return type="void" />
<param index="0" name="occluder_polygon" type="RID" />
<param index="1" name="mode" type="int" enum="RenderingServer.CanvasOccluderPolygonCullMode" />
<description>
Sets an occluder polygons cull mode. See [enum CanvasOccluderPolygonCullMode] constants.
</description>
</method>
<method name="canvas_occluder_polygon_set_shape">
<return type="void" />
<param index="0" name="occluder_polygon" type="RID" />
<param index="1" name="shape" type="PackedVector2Array" />
<param index="2" name="closed" type="bool" />
<description>
Sets the shape of the occluder polygon.
</description>
</method>
<method name="canvas_set_disable_scale">
<return type="void" />
<param index="0" name="disable" type="bool" />
<description>
</description>
</method>
<method name="canvas_set_item_mirroring">
<return type="void" />
<param index="0" name="canvas" type="RID" />
<param index="1" name="item" type="RID" />
<param index="2" name="mirroring" type="Vector2" />
<description>
A copy of the canvas item will be drawn with a local offset of the [param mirroring].
[b]Note:[/b] This is equivalent to calling [method canvas_set_item_repeat] like [code]canvas_set_item_repeat(item, mirroring, 1)[/code], with an additional check ensuring [param canvas] is a parent of [param item].
</description>
</method>
<method name="canvas_set_item_repeat">
<return type="void" />
<param index="0" name="item" type="RID" />
<param index="1" name="repeat_size" type="Vector2" />
<param index="2" name="repeat_times" type="int" />
<description>
A copy of the canvas item will be drawn with a local offset of the [param repeat_size] by the number of times of the [param repeat_times]. As the [param repeat_times] increases, the copies will spread away from the origin texture.
</description>