class_viewport.rst 133 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/Viewport.xml.
  6. .. _class_Viewport:
  7. Viewport
  8. ========
  9. **Inherits:** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`SubViewport<class_SubViewport>`, :ref:`Window<class_Window>`
  11. Abstract base class for viewports. Encapsulates drawing and interaction with a game world.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. A **Viewport** creates a different view into the screen, or a sub-view inside another viewport. Child 2D nodes will display on it, and child Camera3D 3D nodes will render on it too.
  16. Optionally, a viewport can have its own 2D or 3D world, so it doesn't share what it draws with other viewports.
  17. Viewports can also choose to be audio listeners, so they generate positional audio depending on a 2D or 3D camera child of it.
  18. Also, viewports can be assigned to different screens in case the devices have multiple screens.
  19. Finally, viewports can also behave as render targets, in which case they will not be visible unless the associated texture is used to draw.
  20. .. rst-class:: classref-introduction-group
  21. Tutorials
  22. ---------
  23. - :doc:`Using Viewports <../tutorials/rendering/viewports>`
  24. - :doc:`Viewport and canvas transforms <../tutorials/2d/2d_transforms>`
  25. - `GUI in 3D Viewport Demo <https://godotengine.org/asset-library/asset/2807>`__
  26. - `3D in 2D Viewport Demo <https://godotengine.org/asset-library/asset/2804>`__
  27. - `2D in 3D Viewport Demo <https://godotengine.org/asset-library/asset/2803>`__
  28. - `Screen Capture Demo <https://godotengine.org/asset-library/asset/2808>`__
  29. - `Dynamic Split Screen Demo <https://godotengine.org/asset-library/asset/2806>`__
  30. - `3D Resolution Scaling Demo <https://godotengine.org/asset-library/asset/2805>`__
  31. .. rst-class:: classref-reftable-group
  32. Properties
  33. ----------
  34. .. table::
  35. :widths: auto
  36. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  37. | :ref:`bool<class_bool>` | :ref:`audio_listener_enable_2d<class_Viewport_property_audio_listener_enable_2d>` | ``false`` |
  38. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  39. | :ref:`bool<class_bool>` | :ref:`audio_listener_enable_3d<class_Viewport_property_audio_listener_enable_3d>` | ``false`` |
  40. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  41. | :ref:`int<class_int>` | :ref:`canvas_cull_mask<class_Viewport_property_canvas_cull_mask>` | ``4294967295`` |
  42. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  43. | :ref:`DefaultCanvasItemTextureFilter<enum_Viewport_DefaultCanvasItemTextureFilter>` | :ref:`canvas_item_default_texture_filter<class_Viewport_property_canvas_item_default_texture_filter>` | ``1`` |
  44. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  45. | :ref:`DefaultCanvasItemTextureRepeat<enum_Viewport_DefaultCanvasItemTextureRepeat>` | :ref:`canvas_item_default_texture_repeat<class_Viewport_property_canvas_item_default_texture_repeat>` | ``0`` |
  46. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  47. | :ref:`Transform2D<class_Transform2D>` | :ref:`canvas_transform<class_Viewport_property_canvas_transform>` | |
  48. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  49. | :ref:`DebugDraw<enum_Viewport_DebugDraw>` | :ref:`debug_draw<class_Viewport_property_debug_draw>` | ``0`` |
  50. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  51. | :ref:`bool<class_bool>` | :ref:`disable_3d<class_Viewport_property_disable_3d>` | ``false`` |
  52. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  53. | :ref:`float<class_float>` | :ref:`fsr_sharpness<class_Viewport_property_fsr_sharpness>` | ``0.2`` |
  54. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  55. | :ref:`Transform2D<class_Transform2D>` | :ref:`global_canvas_transform<class_Viewport_property_global_canvas_transform>` | |
  56. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  57. | :ref:`bool<class_bool>` | :ref:`gui_disable_input<class_Viewport_property_gui_disable_input>` | ``false`` |
  58. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  59. | :ref:`bool<class_bool>` | :ref:`gui_embed_subwindows<class_Viewport_property_gui_embed_subwindows>` | ``false`` |
  60. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  61. | :ref:`bool<class_bool>` | :ref:`gui_snap_controls_to_pixels<class_Viewport_property_gui_snap_controls_to_pixels>` | ``true`` |
  62. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  63. | :ref:`bool<class_bool>` | :ref:`handle_input_locally<class_Viewport_property_handle_input_locally>` | ``true`` |
  64. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  65. | :ref:`float<class_float>` | :ref:`mesh_lod_threshold<class_Viewport_property_mesh_lod_threshold>` | ``1.0`` |
  66. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  67. | :ref:`MSAA<enum_Viewport_MSAA>` | :ref:`msaa_2d<class_Viewport_property_msaa_2d>` | ``0`` |
  68. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  69. | :ref:`MSAA<enum_Viewport_MSAA>` | :ref:`msaa_3d<class_Viewport_property_msaa_3d>` | ``0`` |
  70. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  71. | :ref:`bool<class_bool>` | :ref:`own_world_3d<class_Viewport_property_own_world_3d>` | ``false`` |
  72. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  73. | :ref:`PhysicsInterpolationMode<enum_Node_PhysicsInterpolationMode>` | physics_interpolation_mode | ``1`` (overrides :ref:`Node<class_Node_property_physics_interpolation_mode>`) |
  74. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  75. | :ref:`bool<class_bool>` | :ref:`physics_object_picking<class_Viewport_property_physics_object_picking>` | ``false`` |
  76. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  77. | :ref:`bool<class_bool>` | :ref:`physics_object_picking_first_only<class_Viewport_property_physics_object_picking_first_only>` | ``false`` |
  78. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  79. | :ref:`bool<class_bool>` | :ref:`physics_object_picking_sort<class_Viewport_property_physics_object_picking_sort>` | ``false`` |
  80. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  81. | :ref:`bool<class_bool>` | :ref:`positional_shadow_atlas_16_bits<class_Viewport_property_positional_shadow_atlas_16_bits>` | ``true`` |
  82. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  83. | :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` | :ref:`positional_shadow_atlas_quad_0<class_Viewport_property_positional_shadow_atlas_quad_0>` | ``2`` |
  84. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  85. | :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` | :ref:`positional_shadow_atlas_quad_1<class_Viewport_property_positional_shadow_atlas_quad_1>` | ``2`` |
  86. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  87. | :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` | :ref:`positional_shadow_atlas_quad_2<class_Viewport_property_positional_shadow_atlas_quad_2>` | ``3`` |
  88. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  89. | :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` | :ref:`positional_shadow_atlas_quad_3<class_Viewport_property_positional_shadow_atlas_quad_3>` | ``4`` |
  90. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  91. | :ref:`int<class_int>` | :ref:`positional_shadow_atlas_size<class_Viewport_property_positional_shadow_atlas_size>` | ``2048`` |
  92. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  93. | :ref:`Scaling3DMode<enum_Viewport_Scaling3DMode>` | :ref:`scaling_3d_mode<class_Viewport_property_scaling_3d_mode>` | ``0`` |
  94. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  95. | :ref:`float<class_float>` | :ref:`scaling_3d_scale<class_Viewport_property_scaling_3d_scale>` | ``1.0`` |
  96. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  97. | :ref:`ScreenSpaceAA<enum_Viewport_ScreenSpaceAA>` | :ref:`screen_space_aa<class_Viewport_property_screen_space_aa>` | ``0`` |
  98. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  99. | :ref:`SDFOversize<enum_Viewport_SDFOversize>` | :ref:`sdf_oversize<class_Viewport_property_sdf_oversize>` | ``1`` |
  100. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  101. | :ref:`SDFScale<enum_Viewport_SDFScale>` | :ref:`sdf_scale<class_Viewport_property_sdf_scale>` | ``1`` |
  102. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  103. | :ref:`bool<class_bool>` | :ref:`snap_2d_transforms_to_pixel<class_Viewport_property_snap_2d_transforms_to_pixel>` | ``false`` |
  104. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  105. | :ref:`bool<class_bool>` | :ref:`snap_2d_vertices_to_pixel<class_Viewport_property_snap_2d_vertices_to_pixel>` | ``false`` |
  106. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  107. | :ref:`float<class_float>` | :ref:`texture_mipmap_bias<class_Viewport_property_texture_mipmap_bias>` | ``0.0`` |
  108. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  109. | :ref:`bool<class_bool>` | :ref:`transparent_bg<class_Viewport_property_transparent_bg>` | ``false`` |
  110. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  111. | :ref:`bool<class_bool>` | :ref:`use_debanding<class_Viewport_property_use_debanding>` | ``false`` |
  112. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  113. | :ref:`bool<class_bool>` | :ref:`use_hdr_2d<class_Viewport_property_use_hdr_2d>` | ``false`` |
  114. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  115. | :ref:`bool<class_bool>` | :ref:`use_occlusion_culling<class_Viewport_property_use_occlusion_culling>` | ``false`` |
  116. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  117. | :ref:`bool<class_bool>` | :ref:`use_taa<class_Viewport_property_use_taa>` | ``false`` |
  118. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  119. | :ref:`bool<class_bool>` | :ref:`use_xr<class_Viewport_property_use_xr>` | ``false`` |
  120. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  121. | :ref:`VRSMode<enum_Viewport_VRSMode>` | :ref:`vrs_mode<class_Viewport_property_vrs_mode>` | ``0`` |
  122. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  123. | :ref:`Texture2D<class_Texture2D>` | :ref:`vrs_texture<class_Viewport_property_vrs_texture>` | |
  124. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  125. | :ref:`VRSUpdateMode<enum_Viewport_VRSUpdateMode>` | :ref:`vrs_update_mode<class_Viewport_property_vrs_update_mode>` | ``1`` |
  126. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  127. | :ref:`World2D<class_World2D>` | :ref:`world_2d<class_Viewport_property_world_2d>` | |
  128. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  129. | :ref:`World3D<class_World3D>` | :ref:`world_3d<class_Viewport_property_world_3d>` | |
  130. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  131. .. rst-class:: classref-reftable-group
  132. Methods
  133. -------
  134. .. table::
  135. :widths: auto
  136. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  137. | :ref:`World2D<class_World2D>` | :ref:`find_world_2d<class_Viewport_method_find_world_2d>`\ (\ ) |const| |
  138. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  139. | :ref:`World3D<class_World3D>` | :ref:`find_world_3d<class_Viewport_method_find_world_3d>`\ (\ ) |const| |
  140. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  141. | :ref:`Camera2D<class_Camera2D>` | :ref:`get_camera_2d<class_Viewport_method_get_camera_2d>`\ (\ ) |const| |
  142. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  143. | :ref:`Camera3D<class_Camera3D>` | :ref:`get_camera_3d<class_Viewport_method_get_camera_3d>`\ (\ ) |const| |
  144. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  145. | :ref:`bool<class_bool>` | :ref:`get_canvas_cull_mask_bit<class_Viewport_method_get_canvas_cull_mask_bit>`\ (\ layer\: :ref:`int<class_int>`\ ) |const| |
  146. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  147. | :ref:`Array<class_Array>`\[:ref:`Window<class_Window>`\] | :ref:`get_embedded_subwindows<class_Viewport_method_get_embedded_subwindows>`\ (\ ) |const| |
  148. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  149. | :ref:`Transform2D<class_Transform2D>` | :ref:`get_final_transform<class_Viewport_method_get_final_transform>`\ (\ ) |const| |
  150. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  151. | :ref:`Vector2<class_Vector2>` | :ref:`get_mouse_position<class_Viewport_method_get_mouse_position>`\ (\ ) |const| |
  152. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  153. | :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` | :ref:`get_positional_shadow_atlas_quadrant_subdiv<class_Viewport_method_get_positional_shadow_atlas_quadrant_subdiv>`\ (\ quadrant\: :ref:`int<class_int>`\ ) |const| |
  154. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  155. | :ref:`int<class_int>` | :ref:`get_render_info<class_Viewport_method_get_render_info>`\ (\ type\: :ref:`RenderInfoType<enum_Viewport_RenderInfoType>`, info\: :ref:`RenderInfo<enum_Viewport_RenderInfo>`\ ) |
  156. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  157. | :ref:`Transform2D<class_Transform2D>` | :ref:`get_screen_transform<class_Viewport_method_get_screen_transform>`\ (\ ) |const| |
  158. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  159. | :ref:`ViewportTexture<class_ViewportTexture>` | :ref:`get_texture<class_Viewport_method_get_texture>`\ (\ ) |const| |
  160. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  161. | :ref:`RID<class_RID>` | :ref:`get_viewport_rid<class_Viewport_method_get_viewport_rid>`\ (\ ) |const| |
  162. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  163. | :ref:`Rect2<class_Rect2>` | :ref:`get_visible_rect<class_Viewport_method_get_visible_rect>`\ (\ ) |const| |
  164. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  165. | :ref:`Variant<class_Variant>` | :ref:`gui_get_drag_data<class_Viewport_method_gui_get_drag_data>`\ (\ ) |const| |
  166. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  167. | :ref:`Control<class_Control>` | :ref:`gui_get_focus_owner<class_Viewport_method_gui_get_focus_owner>`\ (\ ) |const| |
  168. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  169. | :ref:`Control<class_Control>` | :ref:`gui_get_hovered_control<class_Viewport_method_gui_get_hovered_control>`\ (\ ) |const| |
  170. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  171. | :ref:`bool<class_bool>` | :ref:`gui_is_drag_successful<class_Viewport_method_gui_is_drag_successful>`\ (\ ) |const| |
  172. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  173. | :ref:`bool<class_bool>` | :ref:`gui_is_dragging<class_Viewport_method_gui_is_dragging>`\ (\ ) |const| |
  174. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  175. | |void| | :ref:`gui_release_focus<class_Viewport_method_gui_release_focus>`\ (\ ) |
  176. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  177. | :ref:`bool<class_bool>` | :ref:`is_input_handled<class_Viewport_method_is_input_handled>`\ (\ ) |const| |
  178. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  179. | |void| | :ref:`push_input<class_Viewport_method_push_input>`\ (\ event\: :ref:`InputEvent<class_InputEvent>`, in_local_coords\: :ref:`bool<class_bool>` = false\ ) |
  180. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  181. | |void| | :ref:`push_text_input<class_Viewport_method_push_text_input>`\ (\ text\: :ref:`String<class_String>`\ ) |
  182. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  183. | |void| | :ref:`push_unhandled_input<class_Viewport_method_push_unhandled_input>`\ (\ event\: :ref:`InputEvent<class_InputEvent>`, in_local_coords\: :ref:`bool<class_bool>` = false\ ) |
  184. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  185. | |void| | :ref:`set_canvas_cull_mask_bit<class_Viewport_method_set_canvas_cull_mask_bit>`\ (\ layer\: :ref:`int<class_int>`, enable\: :ref:`bool<class_bool>`\ ) |
  186. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  187. | |void| | :ref:`set_input_as_handled<class_Viewport_method_set_input_as_handled>`\ (\ ) |
  188. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  189. | |void| | :ref:`set_positional_shadow_atlas_quadrant_subdiv<class_Viewport_method_set_positional_shadow_atlas_quadrant_subdiv>`\ (\ quadrant\: :ref:`int<class_int>`, subdiv\: :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>`\ ) |
  190. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  191. | |void| | :ref:`update_mouse_cursor_state<class_Viewport_method_update_mouse_cursor_state>`\ (\ ) |
  192. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  193. | |void| | :ref:`warp_mouse<class_Viewport_method_warp_mouse>`\ (\ position\: :ref:`Vector2<class_Vector2>`\ ) |
  194. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  195. .. rst-class:: classref-section-separator
  196. ----
  197. .. rst-class:: classref-descriptions-group
  198. Signals
  199. -------
  200. .. _class_Viewport_signal_gui_focus_changed:
  201. .. rst-class:: classref-signal
  202. **gui_focus_changed**\ (\ node\: :ref:`Control<class_Control>`\ ) :ref:`🔗<class_Viewport_signal_gui_focus_changed>`
  203. Emitted when a Control node grabs keyboard focus.
  204. \ **Note:** A Control node losing focus doesn't cause this signal to be emitted.
  205. .. rst-class:: classref-item-separator
  206. ----
  207. .. _class_Viewport_signal_size_changed:
  208. .. rst-class:: classref-signal
  209. **size_changed**\ (\ ) :ref:`🔗<class_Viewport_signal_size_changed>`
  210. Emitted when the size of the viewport is changed, whether by resizing of window, or some other means.
  211. .. rst-class:: classref-section-separator
  212. ----
  213. .. rst-class:: classref-descriptions-group
  214. Enumerations
  215. ------------
  216. .. _enum_Viewport_PositionalShadowAtlasQuadrantSubdiv:
  217. .. rst-class:: classref-enumeration
  218. enum **PositionalShadowAtlasQuadrantSubdiv**: :ref:`🔗<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>`
  219. .. _class_Viewport_constant_SHADOW_ATLAS_QUADRANT_SUBDIV_DISABLED:
  220. .. rst-class:: classref-enumeration-constant
  221. :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **SHADOW_ATLAS_QUADRANT_SUBDIV_DISABLED** = ``0``
  222. This quadrant will not be used.
  223. .. _class_Viewport_constant_SHADOW_ATLAS_QUADRANT_SUBDIV_1:
  224. .. rst-class:: classref-enumeration-constant
  225. :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **SHADOW_ATLAS_QUADRANT_SUBDIV_1** = ``1``
  226. This quadrant will only be used by one shadow map.
  227. .. _class_Viewport_constant_SHADOW_ATLAS_QUADRANT_SUBDIV_4:
  228. .. rst-class:: classref-enumeration-constant
  229. :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **SHADOW_ATLAS_QUADRANT_SUBDIV_4** = ``2``
  230. This quadrant will be split in 4 and used by up to 4 shadow maps.
  231. .. _class_Viewport_constant_SHADOW_ATLAS_QUADRANT_SUBDIV_16:
  232. .. rst-class:: classref-enumeration-constant
  233. :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **SHADOW_ATLAS_QUADRANT_SUBDIV_16** = ``3``
  234. This quadrant will be split 16 ways and used by up to 16 shadow maps.
  235. .. _class_Viewport_constant_SHADOW_ATLAS_QUADRANT_SUBDIV_64:
  236. .. rst-class:: classref-enumeration-constant
  237. :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **SHADOW_ATLAS_QUADRANT_SUBDIV_64** = ``4``
  238. This quadrant will be split 64 ways and used by up to 64 shadow maps.
  239. .. _class_Viewport_constant_SHADOW_ATLAS_QUADRANT_SUBDIV_256:
  240. .. rst-class:: classref-enumeration-constant
  241. :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **SHADOW_ATLAS_QUADRANT_SUBDIV_256** = ``5``
  242. This quadrant will be split 256 ways and used by up to 256 shadow maps. Unless the :ref:`positional_shadow_atlas_size<class_Viewport_property_positional_shadow_atlas_size>` is very high, the shadows in this quadrant will be very low resolution.
  243. .. _class_Viewport_constant_SHADOW_ATLAS_QUADRANT_SUBDIV_1024:
  244. .. rst-class:: classref-enumeration-constant
  245. :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **SHADOW_ATLAS_QUADRANT_SUBDIV_1024** = ``6``
  246. This quadrant will be split 1024 ways and used by up to 1024 shadow maps. Unless the :ref:`positional_shadow_atlas_size<class_Viewport_property_positional_shadow_atlas_size>` is very high, the shadows in this quadrant will be very low resolution.
  247. .. _class_Viewport_constant_SHADOW_ATLAS_QUADRANT_SUBDIV_MAX:
  248. .. rst-class:: classref-enumeration-constant
  249. :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **SHADOW_ATLAS_QUADRANT_SUBDIV_MAX** = ``7``
  250. Represents the size of the :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` enum.
  251. .. rst-class:: classref-item-separator
  252. ----
  253. .. _enum_Viewport_Scaling3DMode:
  254. .. rst-class:: classref-enumeration
  255. enum **Scaling3DMode**: :ref:`🔗<enum_Viewport_Scaling3DMode>`
  256. .. _class_Viewport_constant_SCALING_3D_MODE_BILINEAR:
  257. .. rst-class:: classref-enumeration-constant
  258. :ref:`Scaling3DMode<enum_Viewport_Scaling3DMode>` **SCALING_3D_MODE_BILINEAR** = ``0``
  259. Use bilinear scaling for the viewport's 3D buffer. The amount of scaling can be set using :ref:`scaling_3d_scale<class_Viewport_property_scaling_3d_scale>`. Values less than ``1.0`` will result in undersampling while values greater than ``1.0`` will result in supersampling. A value of ``1.0`` disables scaling.
  260. .. _class_Viewport_constant_SCALING_3D_MODE_FSR:
  261. .. rst-class:: classref-enumeration-constant
  262. :ref:`Scaling3DMode<enum_Viewport_Scaling3DMode>` **SCALING_3D_MODE_FSR** = ``1``
  263. Use AMD FidelityFX Super Resolution 1.0 upscaling for the viewport's 3D buffer. The amount of scaling can be set using :ref:`scaling_3d_scale<class_Viewport_property_scaling_3d_scale>`. Values less than ``1.0`` will be result in the viewport being upscaled using FSR. Values greater than ``1.0`` are not supported and bilinear downsampling will be used instead. A value of ``1.0`` disables scaling.
  264. .. _class_Viewport_constant_SCALING_3D_MODE_FSR2:
  265. .. rst-class:: classref-enumeration-constant
  266. :ref:`Scaling3DMode<enum_Viewport_Scaling3DMode>` **SCALING_3D_MODE_FSR2** = ``2``
  267. Use AMD FidelityFX Super Resolution 2.2 upscaling for the viewport's 3D buffer. The amount of scaling can be set using :ref:`scaling_3d_scale<class_Viewport_property_scaling_3d_scale>`. Values less than ``1.0`` will be result in the viewport being upscaled using FSR2. Values greater than ``1.0`` are not supported and bilinear downsampling will be used instead. A value of ``1.0`` will use FSR2 at native resolution as a TAA solution.
  268. .. _class_Viewport_constant_SCALING_3D_MODE_MAX:
  269. .. rst-class:: classref-enumeration-constant
  270. :ref:`Scaling3DMode<enum_Viewport_Scaling3DMode>` **SCALING_3D_MODE_MAX** = ``3``
  271. Represents the size of the :ref:`Scaling3DMode<enum_Viewport_Scaling3DMode>` enum.
  272. .. rst-class:: classref-item-separator
  273. ----
  274. .. _enum_Viewport_MSAA:
  275. .. rst-class:: classref-enumeration
  276. enum **MSAA**: :ref:`🔗<enum_Viewport_MSAA>`
  277. .. _class_Viewport_constant_MSAA_DISABLED:
  278. .. rst-class:: classref-enumeration-constant
  279. :ref:`MSAA<enum_Viewport_MSAA>` **MSAA_DISABLED** = ``0``
  280. Multisample antialiasing mode disabled. This is the default value, and is also the fastest setting.
  281. .. _class_Viewport_constant_MSAA_2X:
  282. .. rst-class:: classref-enumeration-constant
  283. :ref:`MSAA<enum_Viewport_MSAA>` **MSAA_2X** = ``1``
  284. Use 2× Multisample Antialiasing. This has a moderate performance cost. It helps reduce aliasing noticeably, but 4× MSAA still looks substantially better.
  285. .. _class_Viewport_constant_MSAA_4X:
  286. .. rst-class:: classref-enumeration-constant
  287. :ref:`MSAA<enum_Viewport_MSAA>` **MSAA_4X** = ``2``
  288. Use 4× Multisample Antialiasing. This has a significant performance cost, and is generally a good compromise between performance and quality.
  289. .. _class_Viewport_constant_MSAA_8X:
  290. .. rst-class:: classref-enumeration-constant
  291. :ref:`MSAA<enum_Viewport_MSAA>` **MSAA_8X** = ``3``
  292. Use 8× Multisample Antialiasing. This has a very high performance cost. The difference between 4× and 8× MSAA may not always be visible in real gameplay conditions. Likely unsupported on low-end and older hardware.
  293. .. _class_Viewport_constant_MSAA_MAX:
  294. .. rst-class:: classref-enumeration-constant
  295. :ref:`MSAA<enum_Viewport_MSAA>` **MSAA_MAX** = ``4``
  296. Represents the size of the :ref:`MSAA<enum_Viewport_MSAA>` enum.
  297. .. rst-class:: classref-item-separator
  298. ----
  299. .. _enum_Viewport_ScreenSpaceAA:
  300. .. rst-class:: classref-enumeration
  301. enum **ScreenSpaceAA**: :ref:`🔗<enum_Viewport_ScreenSpaceAA>`
  302. .. _class_Viewport_constant_SCREEN_SPACE_AA_DISABLED:
  303. .. rst-class:: classref-enumeration-constant
  304. :ref:`ScreenSpaceAA<enum_Viewport_ScreenSpaceAA>` **SCREEN_SPACE_AA_DISABLED** = ``0``
  305. Do not perform any antialiasing in the full screen post-process.
  306. .. _class_Viewport_constant_SCREEN_SPACE_AA_FXAA:
  307. .. rst-class:: classref-enumeration-constant
  308. :ref:`ScreenSpaceAA<enum_Viewport_ScreenSpaceAA>` **SCREEN_SPACE_AA_FXAA** = ``1``
  309. Use fast approximate antialiasing. FXAA is a popular screen-space antialiasing method, which is fast but will make the image look blurry, especially at lower resolutions. It can still work relatively well at large resolutions such as 1440p and 4K.
  310. .. _class_Viewport_constant_SCREEN_SPACE_AA_MAX:
  311. .. rst-class:: classref-enumeration-constant
  312. :ref:`ScreenSpaceAA<enum_Viewport_ScreenSpaceAA>` **SCREEN_SPACE_AA_MAX** = ``2``
  313. Represents the size of the :ref:`ScreenSpaceAA<enum_Viewport_ScreenSpaceAA>` enum.
  314. .. rst-class:: classref-item-separator
  315. ----
  316. .. _enum_Viewport_RenderInfo:
  317. .. rst-class:: classref-enumeration
  318. enum **RenderInfo**: :ref:`🔗<enum_Viewport_RenderInfo>`
  319. .. _class_Viewport_constant_RENDER_INFO_OBJECTS_IN_FRAME:
  320. .. rst-class:: classref-enumeration-constant
  321. :ref:`RenderInfo<enum_Viewport_RenderInfo>` **RENDER_INFO_OBJECTS_IN_FRAME** = ``0``
  322. Amount of objects in frame.
  323. .. _class_Viewport_constant_RENDER_INFO_PRIMITIVES_IN_FRAME:
  324. .. rst-class:: classref-enumeration-constant
  325. :ref:`RenderInfo<enum_Viewport_RenderInfo>` **RENDER_INFO_PRIMITIVES_IN_FRAME** = ``1``
  326. Amount of vertices in frame.
  327. .. _class_Viewport_constant_RENDER_INFO_DRAW_CALLS_IN_FRAME:
  328. .. rst-class:: classref-enumeration-constant
  329. :ref:`RenderInfo<enum_Viewport_RenderInfo>` **RENDER_INFO_DRAW_CALLS_IN_FRAME** = ``2``
  330. Amount of draw calls in frame.
  331. .. _class_Viewport_constant_RENDER_INFO_MAX:
  332. .. rst-class:: classref-enumeration-constant
  333. :ref:`RenderInfo<enum_Viewport_RenderInfo>` **RENDER_INFO_MAX** = ``3``
  334. Represents the size of the :ref:`RenderInfo<enum_Viewport_RenderInfo>` enum.
  335. .. rst-class:: classref-item-separator
  336. ----
  337. .. _enum_Viewport_RenderInfoType:
  338. .. rst-class:: classref-enumeration
  339. enum **RenderInfoType**: :ref:`🔗<enum_Viewport_RenderInfoType>`
  340. .. _class_Viewport_constant_RENDER_INFO_TYPE_VISIBLE:
  341. .. rst-class:: classref-enumeration-constant
  342. :ref:`RenderInfoType<enum_Viewport_RenderInfoType>` **RENDER_INFO_TYPE_VISIBLE** = ``0``
  343. Visible render pass (excluding shadows).
  344. .. _class_Viewport_constant_RENDER_INFO_TYPE_SHADOW:
  345. .. rst-class:: classref-enumeration-constant
  346. :ref:`RenderInfoType<enum_Viewport_RenderInfoType>` **RENDER_INFO_TYPE_SHADOW** = ``1``
  347. Shadow render pass. Objects will be rendered several times depending on the number of amounts of lights with shadows and the number of directional shadow splits.
  348. .. _class_Viewport_constant_RENDER_INFO_TYPE_CANVAS:
  349. .. rst-class:: classref-enumeration-constant
  350. :ref:`RenderInfoType<enum_Viewport_RenderInfoType>` **RENDER_INFO_TYPE_CANVAS** = ``2``
  351. Canvas item rendering. This includes all 2D rendering.
  352. .. _class_Viewport_constant_RENDER_INFO_TYPE_MAX:
  353. .. rst-class:: classref-enumeration-constant
  354. :ref:`RenderInfoType<enum_Viewport_RenderInfoType>` **RENDER_INFO_TYPE_MAX** = ``3``
  355. Represents the size of the :ref:`RenderInfoType<enum_Viewport_RenderInfoType>` enum.
  356. .. rst-class:: classref-item-separator
  357. ----
  358. .. _enum_Viewport_DebugDraw:
  359. .. rst-class:: classref-enumeration
  360. enum **DebugDraw**: :ref:`🔗<enum_Viewport_DebugDraw>`
  361. .. _class_Viewport_constant_DEBUG_DRAW_DISABLED:
  362. .. rst-class:: classref-enumeration-constant
  363. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_DISABLED** = ``0``
  364. Objects are displayed normally.
  365. .. _class_Viewport_constant_DEBUG_DRAW_UNSHADED:
  366. .. rst-class:: classref-enumeration-constant
  367. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_UNSHADED** = ``1``
  368. Objects are displayed without light information.
  369. .. _class_Viewport_constant_DEBUG_DRAW_LIGHTING:
  370. .. rst-class:: classref-enumeration-constant
  371. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_LIGHTING** = ``2``
  372. Objects are displayed without textures and only with lighting information.
  373. .. _class_Viewport_constant_DEBUG_DRAW_OVERDRAW:
  374. .. rst-class:: classref-enumeration-constant
  375. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_OVERDRAW** = ``3``
  376. Objects are displayed semi-transparent with additive blending so you can see where they are drawing over top of one another. A higher overdraw means you are wasting performance on drawing pixels that are being hidden behind others.
  377. .. _class_Viewport_constant_DEBUG_DRAW_WIREFRAME:
  378. .. rst-class:: classref-enumeration-constant
  379. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_WIREFRAME** = ``4``
  380. Objects are displayed as wireframe models.
  381. .. _class_Viewport_constant_DEBUG_DRAW_NORMAL_BUFFER:
  382. .. rst-class:: classref-enumeration-constant
  383. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_NORMAL_BUFFER** = ``5``
  384. Objects are displayed without lighting information and their textures replaced by normal mapping.
  385. .. _class_Viewport_constant_DEBUG_DRAW_VOXEL_GI_ALBEDO:
  386. .. rst-class:: classref-enumeration-constant
  387. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_VOXEL_GI_ALBEDO** = ``6``
  388. Objects are displayed with only the albedo value from :ref:`VoxelGI<class_VoxelGI>`\ s.
  389. .. _class_Viewport_constant_DEBUG_DRAW_VOXEL_GI_LIGHTING:
  390. .. rst-class:: classref-enumeration-constant
  391. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_VOXEL_GI_LIGHTING** = ``7``
  392. Objects are displayed with only the lighting value from :ref:`VoxelGI<class_VoxelGI>`\ s.
  393. .. _class_Viewport_constant_DEBUG_DRAW_VOXEL_GI_EMISSION:
  394. .. rst-class:: classref-enumeration-constant
  395. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_VOXEL_GI_EMISSION** = ``8``
  396. Objects are displayed with only the emission color from :ref:`VoxelGI<class_VoxelGI>`\ s.
  397. .. _class_Viewport_constant_DEBUG_DRAW_SHADOW_ATLAS:
  398. .. rst-class:: classref-enumeration-constant
  399. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_SHADOW_ATLAS** = ``9``
  400. Draws the shadow atlas that stores shadows from :ref:`OmniLight3D<class_OmniLight3D>`\ s and :ref:`SpotLight3D<class_SpotLight3D>`\ s in the upper left quadrant of the **Viewport**.
  401. .. _class_Viewport_constant_DEBUG_DRAW_DIRECTIONAL_SHADOW_ATLAS:
  402. .. rst-class:: classref-enumeration-constant
  403. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_DIRECTIONAL_SHADOW_ATLAS** = ``10``
  404. Draws the shadow atlas that stores shadows from :ref:`DirectionalLight3D<class_DirectionalLight3D>`\ s in the upper left quadrant of the **Viewport**.
  405. .. _class_Viewport_constant_DEBUG_DRAW_SCENE_LUMINANCE:
  406. .. rst-class:: classref-enumeration-constant
  407. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_SCENE_LUMINANCE** = ``11``
  408. Draws the scene luminance buffer (if available) in the upper left quadrant of the **Viewport**.
  409. .. _class_Viewport_constant_DEBUG_DRAW_SSAO:
  410. .. rst-class:: classref-enumeration-constant
  411. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_SSAO** = ``12``
  412. Draws the screen-space ambient occlusion texture instead of the scene so that you can clearly see how it is affecting objects. In order for this display mode to work, you must have :ref:`Environment.ssao_enabled<class_Environment_property_ssao_enabled>` set in your :ref:`WorldEnvironment<class_WorldEnvironment>`.
  413. .. _class_Viewport_constant_DEBUG_DRAW_SSIL:
  414. .. rst-class:: classref-enumeration-constant
  415. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_SSIL** = ``13``
  416. Draws the screen-space indirect lighting texture instead of the scene so that you can clearly see how it is affecting objects. In order for this display mode to work, you must have :ref:`Environment.ssil_enabled<class_Environment_property_ssil_enabled>` set in your :ref:`WorldEnvironment<class_WorldEnvironment>`.
  417. .. _class_Viewport_constant_DEBUG_DRAW_PSSM_SPLITS:
  418. .. rst-class:: classref-enumeration-constant
  419. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_PSSM_SPLITS** = ``14``
  420. Colors each PSSM split for the :ref:`DirectionalLight3D<class_DirectionalLight3D>`\ s in the scene a different color so you can see where the splits are. In order, they will be colored red, green, blue, and yellow.
  421. .. _class_Viewport_constant_DEBUG_DRAW_DECAL_ATLAS:
  422. .. rst-class:: classref-enumeration-constant
  423. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_DECAL_ATLAS** = ``15``
  424. Draws the decal atlas used by :ref:`Decal<class_Decal>`\ s and light projector textures in the upper left quadrant of the **Viewport**.
  425. .. _class_Viewport_constant_DEBUG_DRAW_SDFGI:
  426. .. rst-class:: classref-enumeration-constant
  427. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_SDFGI** = ``16``
  428. Draws the cascades used to render signed distance field global illumination (SDFGI).
  429. Does nothing if the current environment's :ref:`Environment.sdfgi_enabled<class_Environment_property_sdfgi_enabled>` is ``false`` or SDFGI is not supported on the platform.
  430. .. _class_Viewport_constant_DEBUG_DRAW_SDFGI_PROBES:
  431. .. rst-class:: classref-enumeration-constant
  432. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_SDFGI_PROBES** = ``17``
  433. Draws the probes used for signed distance field global illumination (SDFGI).
  434. Does nothing if the current environment's :ref:`Environment.sdfgi_enabled<class_Environment_property_sdfgi_enabled>` is ``false`` or SDFGI is not supported on the platform.
  435. .. _class_Viewport_constant_DEBUG_DRAW_GI_BUFFER:
  436. .. rst-class:: classref-enumeration-constant
  437. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_GI_BUFFER** = ``18``
  438. Draws the buffer used for global illumination (GI).
  439. .. _class_Viewport_constant_DEBUG_DRAW_DISABLE_LOD:
  440. .. rst-class:: classref-enumeration-constant
  441. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_DISABLE_LOD** = ``19``
  442. Draws all of the objects at their highest polycount, without low level of detail (LOD).
  443. .. _class_Viewport_constant_DEBUG_DRAW_CLUSTER_OMNI_LIGHTS:
  444. .. rst-class:: classref-enumeration-constant
  445. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_CLUSTER_OMNI_LIGHTS** = ``20``
  446. Draws the cluster used by :ref:`OmniLight3D<class_OmniLight3D>` nodes to optimize light rendering.
  447. .. _class_Viewport_constant_DEBUG_DRAW_CLUSTER_SPOT_LIGHTS:
  448. .. rst-class:: classref-enumeration-constant
  449. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_CLUSTER_SPOT_LIGHTS** = ``21``
  450. Draws the cluster used by :ref:`SpotLight3D<class_SpotLight3D>` nodes to optimize light rendering.
  451. .. _class_Viewport_constant_DEBUG_DRAW_CLUSTER_DECALS:
  452. .. rst-class:: classref-enumeration-constant
  453. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_CLUSTER_DECALS** = ``22``
  454. Draws the cluster used by :ref:`Decal<class_Decal>` nodes to optimize decal rendering.
  455. .. _class_Viewport_constant_DEBUG_DRAW_CLUSTER_REFLECTION_PROBES:
  456. .. rst-class:: classref-enumeration-constant
  457. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_CLUSTER_REFLECTION_PROBES** = ``23``
  458. Draws the cluster used by :ref:`ReflectionProbe<class_ReflectionProbe>` nodes to optimize decal rendering.
  459. .. _class_Viewport_constant_DEBUG_DRAW_OCCLUDERS:
  460. .. rst-class:: classref-enumeration-constant
  461. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_OCCLUDERS** = ``24``
  462. Draws the buffer used for occlusion culling.
  463. .. _class_Viewport_constant_DEBUG_DRAW_MOTION_VECTORS:
  464. .. rst-class:: classref-enumeration-constant
  465. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_MOTION_VECTORS** = ``25``
  466. Draws vector lines over the viewport to indicate the movement of pixels between frames.
  467. .. _class_Viewport_constant_DEBUG_DRAW_INTERNAL_BUFFER:
  468. .. rst-class:: classref-enumeration-constant
  469. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_INTERNAL_BUFFER** = ``26``
  470. Draws the internal resolution buffer of the scene before post-processing is applied.
  471. .. rst-class:: classref-item-separator
  472. ----
  473. .. _enum_Viewport_DefaultCanvasItemTextureFilter:
  474. .. rst-class:: classref-enumeration
  475. enum **DefaultCanvasItemTextureFilter**: :ref:`🔗<enum_Viewport_DefaultCanvasItemTextureFilter>`
  476. .. _class_Viewport_constant_DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST:
  477. .. rst-class:: classref-enumeration-constant
  478. :ref:`DefaultCanvasItemTextureFilter<enum_Viewport_DefaultCanvasItemTextureFilter>` **DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST** = ``0``
  479. The texture filter reads from the nearest pixel only. This makes the texture look pixelated from up close, and grainy from a distance (due to mipmaps not being sampled).
  480. .. _class_Viewport_constant_DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_LINEAR:
  481. .. rst-class:: classref-enumeration-constant
  482. :ref:`DefaultCanvasItemTextureFilter<enum_Viewport_DefaultCanvasItemTextureFilter>` **DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_LINEAR** = ``1``
  483. The texture filter blends between the nearest 4 pixels. This makes the texture look smooth from up close, and grainy from a distance (due to mipmaps not being sampled).
  484. .. _class_Viewport_constant_DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS:
  485. .. rst-class:: classref-enumeration-constant
  486. :ref:`DefaultCanvasItemTextureFilter<enum_Viewport_DefaultCanvasItemTextureFilter>` **DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS** = ``2``
  487. The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps (or uses the nearest mipmap if :ref:`ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter<class_ProjectSettings_property_rendering/textures/default_filters/use_nearest_mipmap_filter>` is ``true``). This makes the texture look smooth from up close, and smooth from a distance.
  488. Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to :ref:`Camera2D<class_Camera2D>` zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels.
  489. .. _class_Viewport_constant_DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS:
  490. .. rst-class:: classref-enumeration-constant
  491. :ref:`DefaultCanvasItemTextureFilter<enum_Viewport_DefaultCanvasItemTextureFilter>` **DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS** = ``3``
  492. The texture filter reads from the nearest pixel and blends between the nearest 2 mipmaps (or uses the nearest mipmap if :ref:`ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter<class_ProjectSettings_property_rendering/textures/default_filters/use_nearest_mipmap_filter>` is ``true``). This makes the texture look pixelated from up close, and smooth from a distance.
  493. Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to :ref:`Camera2D<class_Camera2D>` zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels.
  494. .. _class_Viewport_constant_DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_MAX:
  495. .. rst-class:: classref-enumeration-constant
  496. :ref:`DefaultCanvasItemTextureFilter<enum_Viewport_DefaultCanvasItemTextureFilter>` **DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_MAX** = ``4``
  497. Represents the size of the :ref:`DefaultCanvasItemTextureFilter<enum_Viewport_DefaultCanvasItemTextureFilter>` enum.
  498. .. rst-class:: classref-item-separator
  499. ----
  500. .. _enum_Viewport_DefaultCanvasItemTextureRepeat:
  501. .. rst-class:: classref-enumeration
  502. enum **DefaultCanvasItemTextureRepeat**: :ref:`🔗<enum_Viewport_DefaultCanvasItemTextureRepeat>`
  503. .. _class_Viewport_constant_DEFAULT_CANVAS_ITEM_TEXTURE_REPEAT_DISABLED:
  504. .. rst-class:: classref-enumeration-constant
  505. :ref:`DefaultCanvasItemTextureRepeat<enum_Viewport_DefaultCanvasItemTextureRepeat>` **DEFAULT_CANVAS_ITEM_TEXTURE_REPEAT_DISABLED** = ``0``
  506. Disables textures repeating. Instead, when reading UVs outside the 0-1 range, the value will be clamped to the edge of the texture, resulting in a stretched out look at the borders of the texture.
  507. .. _class_Viewport_constant_DEFAULT_CANVAS_ITEM_TEXTURE_REPEAT_ENABLED:
  508. .. rst-class:: classref-enumeration-constant
  509. :ref:`DefaultCanvasItemTextureRepeat<enum_Viewport_DefaultCanvasItemTextureRepeat>` **DEFAULT_CANVAS_ITEM_TEXTURE_REPEAT_ENABLED** = ``1``
  510. Enables the texture to repeat when UV coordinates are outside the 0-1 range. If using one of the linear filtering modes, this can result in artifacts at the edges of a texture when the sampler filters across the edges of the texture.
  511. .. _class_Viewport_constant_DEFAULT_CANVAS_ITEM_TEXTURE_REPEAT_MIRROR:
  512. .. rst-class:: classref-enumeration-constant
  513. :ref:`DefaultCanvasItemTextureRepeat<enum_Viewport_DefaultCanvasItemTextureRepeat>` **DEFAULT_CANVAS_ITEM_TEXTURE_REPEAT_MIRROR** = ``2``
  514. Flip the texture when repeating so that the edge lines up instead of abruptly changing.
  515. .. _class_Viewport_constant_DEFAULT_CANVAS_ITEM_TEXTURE_REPEAT_MAX:
  516. .. rst-class:: classref-enumeration-constant
  517. :ref:`DefaultCanvasItemTextureRepeat<enum_Viewport_DefaultCanvasItemTextureRepeat>` **DEFAULT_CANVAS_ITEM_TEXTURE_REPEAT_MAX** = ``3``
  518. Represents the size of the :ref:`DefaultCanvasItemTextureRepeat<enum_Viewport_DefaultCanvasItemTextureRepeat>` enum.
  519. .. rst-class:: classref-item-separator
  520. ----
  521. .. _enum_Viewport_SDFOversize:
  522. .. rst-class:: classref-enumeration
  523. enum **SDFOversize**: :ref:`🔗<enum_Viewport_SDFOversize>`
  524. .. _class_Viewport_constant_SDF_OVERSIZE_100_PERCENT:
  525. .. rst-class:: classref-enumeration-constant
  526. :ref:`SDFOversize<enum_Viewport_SDFOversize>` **SDF_OVERSIZE_100_PERCENT** = ``0``
  527. The signed distance field only covers the viewport's own rectangle.
  528. .. _class_Viewport_constant_SDF_OVERSIZE_120_PERCENT:
  529. .. rst-class:: classref-enumeration-constant
  530. :ref:`SDFOversize<enum_Viewport_SDFOversize>` **SDF_OVERSIZE_120_PERCENT** = ``1``
  531. The signed distance field is expanded to cover 20% of the viewport's size around the borders.
  532. .. _class_Viewport_constant_SDF_OVERSIZE_150_PERCENT:
  533. .. rst-class:: classref-enumeration-constant
  534. :ref:`SDFOversize<enum_Viewport_SDFOversize>` **SDF_OVERSIZE_150_PERCENT** = ``2``
  535. The signed distance field is expanded to cover 50% of the viewport's size around the borders.
  536. .. _class_Viewport_constant_SDF_OVERSIZE_200_PERCENT:
  537. .. rst-class:: classref-enumeration-constant
  538. :ref:`SDFOversize<enum_Viewport_SDFOversize>` **SDF_OVERSIZE_200_PERCENT** = ``3``
  539. The signed distance field is expanded to cover 100% (double) of the viewport's size around the borders.
  540. .. _class_Viewport_constant_SDF_OVERSIZE_MAX:
  541. .. rst-class:: classref-enumeration-constant
  542. :ref:`SDFOversize<enum_Viewport_SDFOversize>` **SDF_OVERSIZE_MAX** = ``4``
  543. Represents the size of the :ref:`SDFOversize<enum_Viewport_SDFOversize>` enum.
  544. .. rst-class:: classref-item-separator
  545. ----
  546. .. _enum_Viewport_SDFScale:
  547. .. rst-class:: classref-enumeration
  548. enum **SDFScale**: :ref:`🔗<enum_Viewport_SDFScale>`
  549. .. _class_Viewport_constant_SDF_SCALE_100_PERCENT:
  550. .. rst-class:: classref-enumeration-constant
  551. :ref:`SDFScale<enum_Viewport_SDFScale>` **SDF_SCALE_100_PERCENT** = ``0``
  552. The signed distance field is rendered at full resolution.
  553. .. _class_Viewport_constant_SDF_SCALE_50_PERCENT:
  554. .. rst-class:: classref-enumeration-constant
  555. :ref:`SDFScale<enum_Viewport_SDFScale>` **SDF_SCALE_50_PERCENT** = ``1``
  556. The signed distance field is rendered at half the resolution of this viewport.
  557. .. _class_Viewport_constant_SDF_SCALE_25_PERCENT:
  558. .. rst-class:: classref-enumeration-constant
  559. :ref:`SDFScale<enum_Viewport_SDFScale>` **SDF_SCALE_25_PERCENT** = ``2``
  560. The signed distance field is rendered at a quarter the resolution of this viewport.
  561. .. _class_Viewport_constant_SDF_SCALE_MAX:
  562. .. rst-class:: classref-enumeration-constant
  563. :ref:`SDFScale<enum_Viewport_SDFScale>` **SDF_SCALE_MAX** = ``3``
  564. Represents the size of the :ref:`SDFScale<enum_Viewport_SDFScale>` enum.
  565. .. rst-class:: classref-item-separator
  566. ----
  567. .. _enum_Viewport_VRSMode:
  568. .. rst-class:: classref-enumeration
  569. enum **VRSMode**: :ref:`🔗<enum_Viewport_VRSMode>`
  570. .. _class_Viewport_constant_VRS_DISABLED:
  571. .. rst-class:: classref-enumeration-constant
  572. :ref:`VRSMode<enum_Viewport_VRSMode>` **VRS_DISABLED** = ``0``
  573. Variable Rate Shading is disabled.
  574. .. _class_Viewport_constant_VRS_TEXTURE:
  575. .. rst-class:: classref-enumeration-constant
  576. :ref:`VRSMode<enum_Viewport_VRSMode>` **VRS_TEXTURE** = ``1``
  577. Variable Rate Shading uses a texture. Note, for stereoscopic use a texture atlas with a texture for each view.
  578. .. _class_Viewport_constant_VRS_XR:
  579. .. rst-class:: classref-enumeration-constant
  580. :ref:`VRSMode<enum_Viewport_VRSMode>` **VRS_XR** = ``2``
  581. Variable Rate Shading's texture is supplied by the primary :ref:`XRInterface<class_XRInterface>`.
  582. .. _class_Viewport_constant_VRS_MAX:
  583. .. rst-class:: classref-enumeration-constant
  584. :ref:`VRSMode<enum_Viewport_VRSMode>` **VRS_MAX** = ``3``
  585. Represents the size of the :ref:`VRSMode<enum_Viewport_VRSMode>` enum.
  586. .. rst-class:: classref-item-separator
  587. ----
  588. .. _enum_Viewport_VRSUpdateMode:
  589. .. rst-class:: classref-enumeration
  590. enum **VRSUpdateMode**: :ref:`🔗<enum_Viewport_VRSUpdateMode>`
  591. .. _class_Viewport_constant_VRS_UPDATE_DISABLED:
  592. .. rst-class:: classref-enumeration-constant
  593. :ref:`VRSUpdateMode<enum_Viewport_VRSUpdateMode>` **VRS_UPDATE_DISABLED** = ``0``
  594. The input texture for variable rate shading will not be processed.
  595. .. _class_Viewport_constant_VRS_UPDATE_ONCE:
  596. .. rst-class:: classref-enumeration-constant
  597. :ref:`VRSUpdateMode<enum_Viewport_VRSUpdateMode>` **VRS_UPDATE_ONCE** = ``1``
  598. The input texture for variable rate shading will be processed once.
  599. .. _class_Viewport_constant_VRS_UPDATE_ALWAYS:
  600. .. rst-class:: classref-enumeration-constant
  601. :ref:`VRSUpdateMode<enum_Viewport_VRSUpdateMode>` **VRS_UPDATE_ALWAYS** = ``2``
  602. The input texture for variable rate shading will be processed each frame.
  603. .. _class_Viewport_constant_VRS_UPDATE_MAX:
  604. .. rst-class:: classref-enumeration-constant
  605. :ref:`VRSUpdateMode<enum_Viewport_VRSUpdateMode>` **VRS_UPDATE_MAX** = ``3``
  606. Represents the size of the :ref:`VRSUpdateMode<enum_Viewport_VRSUpdateMode>` enum.
  607. .. rst-class:: classref-section-separator
  608. ----
  609. .. rst-class:: classref-descriptions-group
  610. Property Descriptions
  611. ---------------------
  612. .. _class_Viewport_property_audio_listener_enable_2d:
  613. .. rst-class:: classref-property
  614. :ref:`bool<class_bool>` **audio_listener_enable_2d** = ``false`` :ref:`🔗<class_Viewport_property_audio_listener_enable_2d>`
  615. .. rst-class:: classref-property-setget
  616. - |void| **set_as_audio_listener_2d**\ (\ value\: :ref:`bool<class_bool>`\ )
  617. - :ref:`bool<class_bool>` **is_audio_listener_2d**\ (\ )
  618. If ``true``, the viewport will process 2D audio streams.
  619. .. rst-class:: classref-item-separator
  620. ----
  621. .. _class_Viewport_property_audio_listener_enable_3d:
  622. .. rst-class:: classref-property
  623. :ref:`bool<class_bool>` **audio_listener_enable_3d** = ``false`` :ref:`🔗<class_Viewport_property_audio_listener_enable_3d>`
  624. .. rst-class:: classref-property-setget
  625. - |void| **set_as_audio_listener_3d**\ (\ value\: :ref:`bool<class_bool>`\ )
  626. - :ref:`bool<class_bool>` **is_audio_listener_3d**\ (\ )
  627. If ``true``, the viewport will process 3D audio streams.
  628. .. rst-class:: classref-item-separator
  629. ----
  630. .. _class_Viewport_property_canvas_cull_mask:
  631. .. rst-class:: classref-property
  632. :ref:`int<class_int>` **canvas_cull_mask** = ``4294967295`` :ref:`🔗<class_Viewport_property_canvas_cull_mask>`
  633. .. rst-class:: classref-property-setget
  634. - |void| **set_canvas_cull_mask**\ (\ value\: :ref:`int<class_int>`\ )
  635. - :ref:`int<class_int>` **get_canvas_cull_mask**\ (\ )
  636. The rendering layers in which this **Viewport** renders :ref:`CanvasItem<class_CanvasItem>` nodes.
  637. .. rst-class:: classref-item-separator
  638. ----
  639. .. _class_Viewport_property_canvas_item_default_texture_filter:
  640. .. rst-class:: classref-property
  641. :ref:`DefaultCanvasItemTextureFilter<enum_Viewport_DefaultCanvasItemTextureFilter>` **canvas_item_default_texture_filter** = ``1`` :ref:`🔗<class_Viewport_property_canvas_item_default_texture_filter>`
  642. .. rst-class:: classref-property-setget
  643. - |void| **set_default_canvas_item_texture_filter**\ (\ value\: :ref:`DefaultCanvasItemTextureFilter<enum_Viewport_DefaultCanvasItemTextureFilter>`\ )
  644. - :ref:`DefaultCanvasItemTextureFilter<enum_Viewport_DefaultCanvasItemTextureFilter>` **get_default_canvas_item_texture_filter**\ (\ )
  645. Sets the default filter mode used by :ref:`CanvasItem<class_CanvasItem>`\ s in this Viewport. See :ref:`DefaultCanvasItemTextureFilter<enum_Viewport_DefaultCanvasItemTextureFilter>` for options.
  646. .. rst-class:: classref-item-separator
  647. ----
  648. .. _class_Viewport_property_canvas_item_default_texture_repeat:
  649. .. rst-class:: classref-property
  650. :ref:`DefaultCanvasItemTextureRepeat<enum_Viewport_DefaultCanvasItemTextureRepeat>` **canvas_item_default_texture_repeat** = ``0`` :ref:`🔗<class_Viewport_property_canvas_item_default_texture_repeat>`
  651. .. rst-class:: classref-property-setget
  652. - |void| **set_default_canvas_item_texture_repeat**\ (\ value\: :ref:`DefaultCanvasItemTextureRepeat<enum_Viewport_DefaultCanvasItemTextureRepeat>`\ )
  653. - :ref:`DefaultCanvasItemTextureRepeat<enum_Viewport_DefaultCanvasItemTextureRepeat>` **get_default_canvas_item_texture_repeat**\ (\ )
  654. Sets the default repeat mode used by :ref:`CanvasItem<class_CanvasItem>`\ s in this Viewport. See :ref:`DefaultCanvasItemTextureRepeat<enum_Viewport_DefaultCanvasItemTextureRepeat>` for options.
  655. .. rst-class:: classref-item-separator
  656. ----
  657. .. _class_Viewport_property_canvas_transform:
  658. .. rst-class:: classref-property
  659. :ref:`Transform2D<class_Transform2D>` **canvas_transform** :ref:`🔗<class_Viewport_property_canvas_transform>`
  660. .. rst-class:: classref-property-setget
  661. - |void| **set_canvas_transform**\ (\ value\: :ref:`Transform2D<class_Transform2D>`\ )
  662. - :ref:`Transform2D<class_Transform2D>` **get_canvas_transform**\ (\ )
  663. The canvas transform of the viewport, useful for changing the on-screen positions of all child :ref:`CanvasItem<class_CanvasItem>`\ s. This is relative to the global canvas transform of the viewport.
  664. .. rst-class:: classref-item-separator
  665. ----
  666. .. _class_Viewport_property_debug_draw:
  667. .. rst-class:: classref-property
  668. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **debug_draw** = ``0`` :ref:`🔗<class_Viewport_property_debug_draw>`
  669. .. rst-class:: classref-property-setget
  670. - |void| **set_debug_draw**\ (\ value\: :ref:`DebugDraw<enum_Viewport_DebugDraw>`\ )
  671. - :ref:`DebugDraw<enum_Viewport_DebugDraw>` **get_debug_draw**\ (\ )
  672. The overlay mode for test rendered geometry in debug purposes.
  673. .. rst-class:: classref-item-separator
  674. ----
  675. .. _class_Viewport_property_disable_3d:
  676. .. rst-class:: classref-property
  677. :ref:`bool<class_bool>` **disable_3d** = ``false`` :ref:`🔗<class_Viewport_property_disable_3d>`
  678. .. rst-class:: classref-property-setget
  679. - |void| **set_disable_3d**\ (\ value\: :ref:`bool<class_bool>`\ )
  680. - :ref:`bool<class_bool>` **is_3d_disabled**\ (\ )
  681. Disable 3D rendering (but keep 2D rendering).
  682. .. rst-class:: classref-item-separator
  683. ----
  684. .. _class_Viewport_property_fsr_sharpness:
  685. .. rst-class:: classref-property
  686. :ref:`float<class_float>` **fsr_sharpness** = ``0.2`` :ref:`🔗<class_Viewport_property_fsr_sharpness>`
  687. .. rst-class:: classref-property-setget
  688. - |void| **set_fsr_sharpness**\ (\ value\: :ref:`float<class_float>`\ )
  689. - :ref:`float<class_float>` **get_fsr_sharpness**\ (\ )
  690. Determines how sharp the upscaled image will be when using the FSR upscaling mode. Sharpness halves with every whole number. Values go from 0.0 (sharpest) to 2.0. Values above 2.0 won't make a visible difference.
  691. To control this property on the root viewport, set the :ref:`ProjectSettings.rendering/scaling_3d/fsr_sharpness<class_ProjectSettings_property_rendering/scaling_3d/fsr_sharpness>` project setting.
  692. .. rst-class:: classref-item-separator
  693. ----
  694. .. _class_Viewport_property_global_canvas_transform:
  695. .. rst-class:: classref-property
  696. :ref:`Transform2D<class_Transform2D>` **global_canvas_transform** :ref:`🔗<class_Viewport_property_global_canvas_transform>`
  697. .. rst-class:: classref-property-setget
  698. - |void| **set_global_canvas_transform**\ (\ value\: :ref:`Transform2D<class_Transform2D>`\ )
  699. - :ref:`Transform2D<class_Transform2D>` **get_global_canvas_transform**\ (\ )
  700. The global canvas transform of the viewport. The canvas transform is relative to this.
  701. .. rst-class:: classref-item-separator
  702. ----
  703. .. _class_Viewport_property_gui_disable_input:
  704. .. rst-class:: classref-property
  705. :ref:`bool<class_bool>` **gui_disable_input** = ``false`` :ref:`🔗<class_Viewport_property_gui_disable_input>`
  706. .. rst-class:: classref-property-setget
  707. - |void| **set_disable_input**\ (\ value\: :ref:`bool<class_bool>`\ )
  708. - :ref:`bool<class_bool>` **is_input_disabled**\ (\ )
  709. If ``true``, the viewport will not receive input events.
  710. .. rst-class:: classref-item-separator
  711. ----
  712. .. _class_Viewport_property_gui_embed_subwindows:
  713. .. rst-class:: classref-property
  714. :ref:`bool<class_bool>` **gui_embed_subwindows** = ``false`` :ref:`🔗<class_Viewport_property_gui_embed_subwindows>`
  715. .. rst-class:: classref-property-setget
  716. - |void| **set_embedding_subwindows**\ (\ value\: :ref:`bool<class_bool>`\ )
  717. - :ref:`bool<class_bool>` **is_embedding_subwindows**\ (\ )
  718. If ``true``, sub-windows (popups and dialogs) will be embedded inside application window as control-like nodes. If ``false``, they will appear as separate windows handled by the operating system.
  719. .. rst-class:: classref-item-separator
  720. ----
  721. .. _class_Viewport_property_gui_snap_controls_to_pixels:
  722. .. rst-class:: classref-property
  723. :ref:`bool<class_bool>` **gui_snap_controls_to_pixels** = ``true`` :ref:`🔗<class_Viewport_property_gui_snap_controls_to_pixels>`
  724. .. rst-class:: classref-property-setget
  725. - |void| **set_snap_controls_to_pixels**\ (\ value\: :ref:`bool<class_bool>`\ )
  726. - :ref:`bool<class_bool>` **is_snap_controls_to_pixels_enabled**\ (\ )
  727. If ``true``, the GUI controls on the viewport will lay pixel perfectly.
  728. .. rst-class:: classref-item-separator
  729. ----
  730. .. _class_Viewport_property_handle_input_locally:
  731. .. rst-class:: classref-property
  732. :ref:`bool<class_bool>` **handle_input_locally** = ``true`` :ref:`🔗<class_Viewport_property_handle_input_locally>`
  733. .. rst-class:: classref-property-setget
  734. - |void| **set_handle_input_locally**\ (\ value\: :ref:`bool<class_bool>`\ )
  735. - :ref:`bool<class_bool>` **is_handling_input_locally**\ (\ )
  736. If ``true``, this viewport will mark incoming input events as handled by itself. If ``false``, this is instead done by the first parent viewport that is set to handle input locally.
  737. A :ref:`SubViewportContainer<class_SubViewportContainer>` will automatically set this property to ``false`` for the **Viewport** contained inside of it.
  738. See also :ref:`set_input_as_handled<class_Viewport_method_set_input_as_handled>` and :ref:`is_input_handled<class_Viewport_method_is_input_handled>`.
  739. .. rst-class:: classref-item-separator
  740. ----
  741. .. _class_Viewport_property_mesh_lod_threshold:
  742. .. rst-class:: classref-property
  743. :ref:`float<class_float>` **mesh_lod_threshold** = ``1.0`` :ref:`🔗<class_Viewport_property_mesh_lod_threshold>`
  744. .. rst-class:: classref-property-setget
  745. - |void| **set_mesh_lod_threshold**\ (\ value\: :ref:`float<class_float>`\ )
  746. - :ref:`float<class_float>` **get_mesh_lod_threshold**\ (\ )
  747. The automatic LOD bias to use for meshes rendered within the **Viewport** (this is analogous to :ref:`ReflectionProbe.mesh_lod_threshold<class_ReflectionProbe_property_mesh_lod_threshold>`). Higher values will use less detailed versions of meshes that have LOD variations generated. If set to ``0.0``, automatic LOD is disabled. Increase :ref:`mesh_lod_threshold<class_Viewport_property_mesh_lod_threshold>` to improve performance at the cost of geometry detail.
  748. To control this property on the root viewport, set the :ref:`ProjectSettings.rendering/mesh_lod/lod_change/threshold_pixels<class_ProjectSettings_property_rendering/mesh_lod/lod_change/threshold_pixels>` project setting.
  749. \ **Note:** :ref:`mesh_lod_threshold<class_Viewport_property_mesh_lod_threshold>` does not affect :ref:`GeometryInstance3D<class_GeometryInstance3D>` visibility ranges (also known as "manual" LOD or hierarchical LOD).
  750. .. rst-class:: classref-item-separator
  751. ----
  752. .. _class_Viewport_property_msaa_2d:
  753. .. rst-class:: classref-property
  754. :ref:`MSAA<enum_Viewport_MSAA>` **msaa_2d** = ``0`` :ref:`🔗<class_Viewport_property_msaa_2d>`
  755. .. rst-class:: classref-property-setget
  756. - |void| **set_msaa_2d**\ (\ value\: :ref:`MSAA<enum_Viewport_MSAA>`\ )
  757. - :ref:`MSAA<enum_Viewport_MSAA>` **get_msaa_2d**\ (\ )
  758. The multisample anti-aliasing mode for 2D/Canvas rendering. A higher number results in smoother edges at the cost of significantly worse performance. A value of 2 or 4 is best unless targeting very high-end systems. This has no effect on shader-induced aliasing or texture aliasing.
  759. .. rst-class:: classref-item-separator
  760. ----
  761. .. _class_Viewport_property_msaa_3d:
  762. .. rst-class:: classref-property
  763. :ref:`MSAA<enum_Viewport_MSAA>` **msaa_3d** = ``0`` :ref:`🔗<class_Viewport_property_msaa_3d>`
  764. .. rst-class:: classref-property-setget
  765. - |void| **set_msaa_3d**\ (\ value\: :ref:`MSAA<enum_Viewport_MSAA>`\ )
  766. - :ref:`MSAA<enum_Viewport_MSAA>` **get_msaa_3d**\ (\ )
  767. The multisample anti-aliasing mode for 3D rendering. A higher number results in smoother edges at the cost of significantly worse performance. A value of 2 or 4 is best unless targeting very high-end systems. See also bilinear scaling 3d :ref:`scaling_3d_mode<class_Viewport_property_scaling_3d_mode>` for supersampling, which provides higher quality but is much more expensive. This has no effect on shader-induced aliasing or texture aliasing.
  768. .. rst-class:: classref-item-separator
  769. ----
  770. .. _class_Viewport_property_own_world_3d:
  771. .. rst-class:: classref-property
  772. :ref:`bool<class_bool>` **own_world_3d** = ``false`` :ref:`🔗<class_Viewport_property_own_world_3d>`
  773. .. rst-class:: classref-property-setget
  774. - |void| **set_use_own_world_3d**\ (\ value\: :ref:`bool<class_bool>`\ )
  775. - :ref:`bool<class_bool>` **is_using_own_world_3d**\ (\ )
  776. If ``true``, the viewport will use a unique copy of the :ref:`World3D<class_World3D>` defined in :ref:`world_3d<class_Viewport_property_world_3d>`.
  777. .. rst-class:: classref-item-separator
  778. ----
  779. .. _class_Viewport_property_physics_object_picking:
  780. .. rst-class:: classref-property
  781. :ref:`bool<class_bool>` **physics_object_picking** = ``false`` :ref:`🔗<class_Viewport_property_physics_object_picking>`
  782. .. rst-class:: classref-property-setget
  783. - |void| **set_physics_object_picking**\ (\ value\: :ref:`bool<class_bool>`\ )
  784. - :ref:`bool<class_bool>` **get_physics_object_picking**\ (\ )
  785. If ``true``, the objects rendered by viewport become subjects of mouse picking process.
  786. \ **Note:** The number of simultaneously pickable objects is limited to 64 and they are selected in a non-deterministic order, which can be different in each picking process.
  787. .. rst-class:: classref-item-separator
  788. ----
  789. .. _class_Viewport_property_physics_object_picking_first_only:
  790. .. rst-class:: classref-property
  791. :ref:`bool<class_bool>` **physics_object_picking_first_only** = ``false`` :ref:`🔗<class_Viewport_property_physics_object_picking_first_only>`
  792. .. rst-class:: classref-property-setget
  793. - |void| **set_physics_object_picking_first_only**\ (\ value\: :ref:`bool<class_bool>`\ )
  794. - :ref:`bool<class_bool>` **get_physics_object_picking_first_only**\ (\ )
  795. If ``true``, the input_event signal will only be sent to one physics object in the mouse picking process. If you want to get the top object only, you must also enable :ref:`physics_object_picking_sort<class_Viewport_property_physics_object_picking_sort>`.
  796. If ``false``, an input_event signal will be sent to all physics objects in the mouse picking process.
  797. This applies to 2D CanvasItem object picking only.
  798. .. rst-class:: classref-item-separator
  799. ----
  800. .. _class_Viewport_property_physics_object_picking_sort:
  801. .. rst-class:: classref-property
  802. :ref:`bool<class_bool>` **physics_object_picking_sort** = ``false`` :ref:`🔗<class_Viewport_property_physics_object_picking_sort>`
  803. .. rst-class:: classref-property-setget
  804. - |void| **set_physics_object_picking_sort**\ (\ value\: :ref:`bool<class_bool>`\ )
  805. - :ref:`bool<class_bool>` **get_physics_object_picking_sort**\ (\ )
  806. If ``true``, objects receive mouse picking events sorted primarily by their :ref:`CanvasItem.z_index<class_CanvasItem_property_z_index>` and secondarily by their position in the scene tree. If ``false``, the order is undetermined.
  807. \ **Note:** This setting is disabled by default because of its potential expensive computational cost.
  808. \ **Note:** Sorting happens after selecting the pickable objects. Because of the limitation of 64 simultaneously pickable objects, it is not guaranteed that the object with the highest :ref:`CanvasItem.z_index<class_CanvasItem_property_z_index>` receives the picking event.
  809. .. rst-class:: classref-item-separator
  810. ----
  811. .. _class_Viewport_property_positional_shadow_atlas_16_bits:
  812. .. rst-class:: classref-property
  813. :ref:`bool<class_bool>` **positional_shadow_atlas_16_bits** = ``true`` :ref:`🔗<class_Viewport_property_positional_shadow_atlas_16_bits>`
  814. .. rst-class:: classref-property-setget
  815. - |void| **set_positional_shadow_atlas_16_bits**\ (\ value\: :ref:`bool<class_bool>`\ )
  816. - :ref:`bool<class_bool>` **get_positional_shadow_atlas_16_bits**\ (\ )
  817. Use 16 bits for the omni/spot shadow depth map. Enabling this results in shadows having less precision and may result in shadow acne, but can lead to performance improvements on some devices.
  818. .. rst-class:: classref-item-separator
  819. ----
  820. .. _class_Viewport_property_positional_shadow_atlas_quad_0:
  821. .. rst-class:: classref-property
  822. :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **positional_shadow_atlas_quad_0** = ``2`` :ref:`🔗<class_Viewport_property_positional_shadow_atlas_quad_0>`
  823. .. rst-class:: classref-property-setget
  824. - |void| **set_positional_shadow_atlas_quadrant_subdiv**\ (\ quadrant\: :ref:`int<class_int>`, subdiv\: :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>`\ )
  825. - :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **get_positional_shadow_atlas_quadrant_subdiv**\ (\ quadrant\: :ref:`int<class_int>`\ ) |const|
  826. The subdivision amount of the first quadrant on the shadow atlas.
  827. .. rst-class:: classref-item-separator
  828. ----
  829. .. _class_Viewport_property_positional_shadow_atlas_quad_1:
  830. .. rst-class:: classref-property
  831. :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **positional_shadow_atlas_quad_1** = ``2`` :ref:`🔗<class_Viewport_property_positional_shadow_atlas_quad_1>`
  832. .. rst-class:: classref-property-setget
  833. - |void| **set_positional_shadow_atlas_quadrant_subdiv**\ (\ quadrant\: :ref:`int<class_int>`, subdiv\: :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>`\ )
  834. - :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **get_positional_shadow_atlas_quadrant_subdiv**\ (\ quadrant\: :ref:`int<class_int>`\ ) |const|
  835. The subdivision amount of the second quadrant on the shadow atlas.
  836. .. rst-class:: classref-item-separator
  837. ----
  838. .. _class_Viewport_property_positional_shadow_atlas_quad_2:
  839. .. rst-class:: classref-property
  840. :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **positional_shadow_atlas_quad_2** = ``3`` :ref:`🔗<class_Viewport_property_positional_shadow_atlas_quad_2>`
  841. .. rst-class:: classref-property-setget
  842. - |void| **set_positional_shadow_atlas_quadrant_subdiv**\ (\ quadrant\: :ref:`int<class_int>`, subdiv\: :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>`\ )
  843. - :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **get_positional_shadow_atlas_quadrant_subdiv**\ (\ quadrant\: :ref:`int<class_int>`\ ) |const|
  844. The subdivision amount of the third quadrant on the shadow atlas.
  845. .. rst-class:: classref-item-separator
  846. ----
  847. .. _class_Viewport_property_positional_shadow_atlas_quad_3:
  848. .. rst-class:: classref-property
  849. :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **positional_shadow_atlas_quad_3** = ``4`` :ref:`🔗<class_Viewport_property_positional_shadow_atlas_quad_3>`
  850. .. rst-class:: classref-property-setget
  851. - |void| **set_positional_shadow_atlas_quadrant_subdiv**\ (\ quadrant\: :ref:`int<class_int>`, subdiv\: :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>`\ )
  852. - :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **get_positional_shadow_atlas_quadrant_subdiv**\ (\ quadrant\: :ref:`int<class_int>`\ ) |const|
  853. The subdivision amount of the fourth quadrant on the shadow atlas.
  854. .. rst-class:: classref-item-separator
  855. ----
  856. .. _class_Viewport_property_positional_shadow_atlas_size:
  857. .. rst-class:: classref-property
  858. :ref:`int<class_int>` **positional_shadow_atlas_size** = ``2048`` :ref:`🔗<class_Viewport_property_positional_shadow_atlas_size>`
  859. .. rst-class:: classref-property-setget
  860. - |void| **set_positional_shadow_atlas_size**\ (\ value\: :ref:`int<class_int>`\ )
  861. - :ref:`int<class_int>` **get_positional_shadow_atlas_size**\ (\ )
  862. The shadow atlas' resolution (used for omni and spot lights). The value is rounded up to the nearest power of 2.
  863. \ **Note:** If this is set to ``0``, no positional shadows will be visible at all. This can improve performance significantly on low-end systems by reducing both the CPU and GPU load (as fewer draw calls are needed to draw the scene without shadows).
  864. .. rst-class:: classref-item-separator
  865. ----
  866. .. _class_Viewport_property_scaling_3d_mode:
  867. .. rst-class:: classref-property
  868. :ref:`Scaling3DMode<enum_Viewport_Scaling3DMode>` **scaling_3d_mode** = ``0`` :ref:`🔗<class_Viewport_property_scaling_3d_mode>`
  869. .. rst-class:: classref-property-setget
  870. - |void| **set_scaling_3d_mode**\ (\ value\: :ref:`Scaling3DMode<enum_Viewport_Scaling3DMode>`\ )
  871. - :ref:`Scaling3DMode<enum_Viewport_Scaling3DMode>` **get_scaling_3d_mode**\ (\ )
  872. Sets scaling 3d mode. Bilinear scaling renders at different resolution to either undersample or supersample the viewport. FidelityFX Super Resolution 1.0, abbreviated to FSR, is an upscaling technology that produces high quality images at fast framerates by using a spatially aware upscaling algorithm. FSR is slightly more expensive than bilinear, but it produces significantly higher image quality. FSR should be used where possible.
  873. To control this property on the root viewport, set the :ref:`ProjectSettings.rendering/scaling_3d/mode<class_ProjectSettings_property_rendering/scaling_3d/mode>` project setting.
  874. .. rst-class:: classref-item-separator
  875. ----
  876. .. _class_Viewport_property_scaling_3d_scale:
  877. .. rst-class:: classref-property
  878. :ref:`float<class_float>` **scaling_3d_scale** = ``1.0`` :ref:`🔗<class_Viewport_property_scaling_3d_scale>`
  879. .. rst-class:: classref-property-setget
  880. - |void| **set_scaling_3d_scale**\ (\ value\: :ref:`float<class_float>`\ )
  881. - :ref:`float<class_float>` **get_scaling_3d_scale**\ (\ )
  882. Scales the 3D render buffer based on the viewport size uses an image filter specified in :ref:`ProjectSettings.rendering/scaling_3d/mode<class_ProjectSettings_property_rendering/scaling_3d/mode>` to scale the output image to the full viewport size. Values lower than ``1.0`` can be used to speed up 3D rendering at the cost of quality (undersampling). Values greater than ``1.0`` are only valid for bilinear mode and can be used to improve 3D rendering quality at a high performance cost (supersampling). See also :ref:`ProjectSettings.rendering/anti_aliasing/quality/msaa_3d<class_ProjectSettings_property_rendering/anti_aliasing/quality/msaa_3d>` for multi-sample antialiasing, which is significantly cheaper but only smooths the edges of polygons.
  883. When using FSR upscaling, AMD recommends exposing the following values as preset options to users "Ultra Quality: 0.77", "Quality: 0.67", "Balanced: 0.59", "Performance: 0.5" instead of exposing the entire scale.
  884. To control this property on the root viewport, set the :ref:`ProjectSettings.rendering/scaling_3d/scale<class_ProjectSettings_property_rendering/scaling_3d/scale>` project setting.
  885. .. rst-class:: classref-item-separator
  886. ----
  887. .. _class_Viewport_property_screen_space_aa:
  888. .. rst-class:: classref-property
  889. :ref:`ScreenSpaceAA<enum_Viewport_ScreenSpaceAA>` **screen_space_aa** = ``0`` :ref:`🔗<class_Viewport_property_screen_space_aa>`
  890. .. rst-class:: classref-property-setget
  891. - |void| **set_screen_space_aa**\ (\ value\: :ref:`ScreenSpaceAA<enum_Viewport_ScreenSpaceAA>`\ )
  892. - :ref:`ScreenSpaceAA<enum_Viewport_ScreenSpaceAA>` **get_screen_space_aa**\ (\ )
  893. Sets the screen-space antialiasing method used. Screen-space antialiasing works by selectively blurring edges in a post-process shader. It differs from MSAA which takes multiple coverage samples while rendering objects. Screen-space AA methods are typically faster than MSAA and will smooth out specular aliasing, but tend to make scenes appear blurry.
  894. .. rst-class:: classref-item-separator
  895. ----
  896. .. _class_Viewport_property_sdf_oversize:
  897. .. rst-class:: classref-property
  898. :ref:`SDFOversize<enum_Viewport_SDFOversize>` **sdf_oversize** = ``1`` :ref:`🔗<class_Viewport_property_sdf_oversize>`
  899. .. rst-class:: classref-property-setget
  900. - |void| **set_sdf_oversize**\ (\ value\: :ref:`SDFOversize<enum_Viewport_SDFOversize>`\ )
  901. - :ref:`SDFOversize<enum_Viewport_SDFOversize>` **get_sdf_oversize**\ (\ )
  902. Controls how much of the original viewport's size should be covered by the 2D signed distance field. This SDF can be sampled in :ref:`CanvasItem<class_CanvasItem>` shaders and is also used for :ref:`GPUParticles2D<class_GPUParticles2D>` collision. Higher values allow portions of occluders located outside the viewport to still be taken into account in the generated signed distance field, at the cost of performance. If you notice particles falling through :ref:`LightOccluder2D<class_LightOccluder2D>`\ s as the occluders leave the viewport, increase this setting.
  903. The percentage is added on each axis and on both sides. For example, with the default :ref:`SDF_OVERSIZE_120_PERCENT<class_Viewport_constant_SDF_OVERSIZE_120_PERCENT>`, the signed distance field will cover 20% of the viewport's size outside the viewport on each side (top, right, bottom, left).
  904. .. rst-class:: classref-item-separator
  905. ----
  906. .. _class_Viewport_property_sdf_scale:
  907. .. rst-class:: classref-property
  908. :ref:`SDFScale<enum_Viewport_SDFScale>` **sdf_scale** = ``1`` :ref:`🔗<class_Viewport_property_sdf_scale>`
  909. .. rst-class:: classref-property-setget
  910. - |void| **set_sdf_scale**\ (\ value\: :ref:`SDFScale<enum_Viewport_SDFScale>`\ )
  911. - :ref:`SDFScale<enum_Viewport_SDFScale>` **get_sdf_scale**\ (\ )
  912. The resolution scale to use for the 2D signed distance field. Higher values lead to a more precise and more stable signed distance field as the camera moves, at the cost of performance.
  913. .. rst-class:: classref-item-separator
  914. ----
  915. .. _class_Viewport_property_snap_2d_transforms_to_pixel:
  916. .. rst-class:: classref-property
  917. :ref:`bool<class_bool>` **snap_2d_transforms_to_pixel** = ``false`` :ref:`🔗<class_Viewport_property_snap_2d_transforms_to_pixel>`
  918. .. rst-class:: classref-property-setget
  919. - |void| **set_snap_2d_transforms_to_pixel**\ (\ value\: :ref:`bool<class_bool>`\ )
  920. - :ref:`bool<class_bool>` **is_snap_2d_transforms_to_pixel_enabled**\ (\ )
  921. If ``true``, :ref:`CanvasItem<class_CanvasItem>` nodes will internally snap to full pixels. Their position can still be sub-pixel, but the decimals will not have effect. This can lead to a crisper appearance at the cost of less smooth movement, especially when :ref:`Camera2D<class_Camera2D>` smoothing is enabled.
  922. .. rst-class:: classref-item-separator
  923. ----
  924. .. _class_Viewport_property_snap_2d_vertices_to_pixel:
  925. .. rst-class:: classref-property
  926. :ref:`bool<class_bool>` **snap_2d_vertices_to_pixel** = ``false`` :ref:`🔗<class_Viewport_property_snap_2d_vertices_to_pixel>`
  927. .. rst-class:: classref-property-setget
  928. - |void| **set_snap_2d_vertices_to_pixel**\ (\ value\: :ref:`bool<class_bool>`\ )
  929. - :ref:`bool<class_bool>` **is_snap_2d_vertices_to_pixel_enabled**\ (\ )
  930. If ``true``, vertices of :ref:`CanvasItem<class_CanvasItem>` nodes will snap to full pixels. Only affects the final vertex positions, not the transforms. This can lead to a crisper appearance at the cost of less smooth movement, especially when :ref:`Camera2D<class_Camera2D>` smoothing is enabled.
  931. .. rst-class:: classref-item-separator
  932. ----
  933. .. _class_Viewport_property_texture_mipmap_bias:
  934. .. rst-class:: classref-property
  935. :ref:`float<class_float>` **texture_mipmap_bias** = ``0.0`` :ref:`🔗<class_Viewport_property_texture_mipmap_bias>`
  936. .. rst-class:: classref-property-setget
  937. - |void| **set_texture_mipmap_bias**\ (\ value\: :ref:`float<class_float>`\ )
  938. - :ref:`float<class_float>` **get_texture_mipmap_bias**\ (\ )
  939. Affects the final texture sharpness by reading from a lower or higher mipmap (also called "texture LOD bias"). Negative values make mipmapped textures sharper but grainier when viewed at a distance, while positive values make mipmapped textures blurrier (even when up close).
  940. Enabling temporal antialiasing (:ref:`use_taa<class_Viewport_property_use_taa>`) will automatically apply a ``-0.5`` offset to this value, while enabling FXAA (:ref:`screen_space_aa<class_Viewport_property_screen_space_aa>`) will automatically apply a ``-0.25`` offset to this value. If both TAA and FXAA are enabled at the same time, an offset of ``-0.75`` is applied to this value.
  941. \ **Note:** If :ref:`scaling_3d_scale<class_Viewport_property_scaling_3d_scale>` is lower than ``1.0`` (exclusive), :ref:`texture_mipmap_bias<class_Viewport_property_texture_mipmap_bias>` is used to adjust the automatic mipmap bias which is calculated internally based on the scale factor. The formula for this is ``log2(scaling_3d_scale) + mipmap_bias``.
  942. To control this property on the root viewport, set the :ref:`ProjectSettings.rendering/textures/default_filters/texture_mipmap_bias<class_ProjectSettings_property_rendering/textures/default_filters/texture_mipmap_bias>` project setting.
  943. .. rst-class:: classref-item-separator
  944. ----
  945. .. _class_Viewport_property_transparent_bg:
  946. .. rst-class:: classref-property
  947. :ref:`bool<class_bool>` **transparent_bg** = ``false`` :ref:`🔗<class_Viewport_property_transparent_bg>`
  948. .. rst-class:: classref-property-setget
  949. - |void| **set_transparent_background**\ (\ value\: :ref:`bool<class_bool>`\ )
  950. - :ref:`bool<class_bool>` **has_transparent_background**\ (\ )
  951. If ``true``, the viewport should render its background as transparent.
  952. .. rst-class:: classref-item-separator
  953. ----
  954. .. _class_Viewport_property_use_debanding:
  955. .. rst-class:: classref-property
  956. :ref:`bool<class_bool>` **use_debanding** = ``false`` :ref:`🔗<class_Viewport_property_use_debanding>`
  957. .. rst-class:: classref-property-setget
  958. - |void| **set_use_debanding**\ (\ value\: :ref:`bool<class_bool>`\ )
  959. - :ref:`bool<class_bool>` **is_using_debanding**\ (\ )
  960. If ``true``, uses a fast post-processing filter to make banding significantly less visible in 3D. 2D rendering is *not* affected by debanding unless the :ref:`Environment.background_mode<class_Environment_property_background_mode>` is :ref:`Environment.BG_CANVAS<class_Environment_constant_BG_CANVAS>`. See also :ref:`ProjectSettings.rendering/anti_aliasing/quality/use_debanding<class_ProjectSettings_property_rendering/anti_aliasing/quality/use_debanding>`.
  961. In some cases, debanding may introduce a slightly noticeable dithering pattern. It's recommended to enable debanding only when actually needed since the dithering pattern will make lossless-compressed screenshots larger.
  962. .. rst-class:: classref-item-separator
  963. ----
  964. .. _class_Viewport_property_use_hdr_2d:
  965. .. rst-class:: classref-property
  966. :ref:`bool<class_bool>` **use_hdr_2d** = ``false`` :ref:`🔗<class_Viewport_property_use_hdr_2d>`
  967. .. rst-class:: classref-property-setget
  968. - |void| **set_use_hdr_2d**\ (\ value\: :ref:`bool<class_bool>`\ )
  969. - :ref:`bool<class_bool>` **is_using_hdr_2d**\ (\ )
  970. If ``true``, 2D rendering will use an high dynamic range (HDR) format framebuffer matching the bit depth of the 3D framebuffer. When using the Forward+ renderer this will be an ``RGBA16`` framebuffer, while when using the Mobile renderer it will be an ``RGB10_A2`` framebuffer. Additionally, 2D rendering will take place in linear color space and will be converted to sRGB space immediately before blitting to the screen (if the Viewport is attached to the screen). Practically speaking, this means that the end result of the Viewport will not be clamped into the ``0-1`` range and can be used in 3D rendering without color space adjustments. This allows 2D rendering to take advantage of effects requiring high dynamic range (e.g. 2D glow) as well as substantially improves the appearance of effects requiring highly detailed gradients.
  971. \ **Note:** This setting will have no effect when using the GL Compatibility renderer as the GL Compatibility renderer always renders in low dynamic range for performance reasons.
  972. .. rst-class:: classref-item-separator
  973. ----
  974. .. _class_Viewport_property_use_occlusion_culling:
  975. .. rst-class:: classref-property
  976. :ref:`bool<class_bool>` **use_occlusion_culling** = ``false`` :ref:`🔗<class_Viewport_property_use_occlusion_culling>`
  977. .. rst-class:: classref-property-setget
  978. - |void| **set_use_occlusion_culling**\ (\ value\: :ref:`bool<class_bool>`\ )
  979. - :ref:`bool<class_bool>` **is_using_occlusion_culling**\ (\ )
  980. If ``true``, :ref:`OccluderInstance3D<class_OccluderInstance3D>` nodes will be usable for occlusion culling in 3D for this viewport. For the root viewport, :ref:`ProjectSettings.rendering/occlusion_culling/use_occlusion_culling<class_ProjectSettings_property_rendering/occlusion_culling/use_occlusion_culling>` must be set to ``true`` instead.
  981. \ **Note:** Enabling occlusion culling has a cost on the CPU. Only enable occlusion culling if you actually plan to use it, and think whether your scene can actually benefit from occlusion culling. Large, open scenes with few or no objects blocking the view will generally not benefit much from occlusion culling. Large open scenes generally benefit more from mesh LOD and visibility ranges (:ref:`GeometryInstance3D.visibility_range_begin<class_GeometryInstance3D_property_visibility_range_begin>` and :ref:`GeometryInstance3D.visibility_range_end<class_GeometryInstance3D_property_visibility_range_end>`) compared to occlusion culling.
  982. \ **Note:** Due to memory constraints, occlusion culling is not supported by default in Web export templates. It can be enabled by compiling custom Web export templates with ``module_raycast_enabled=yes``.
  983. .. rst-class:: classref-item-separator
  984. ----
  985. .. _class_Viewport_property_use_taa:
  986. .. rst-class:: classref-property
  987. :ref:`bool<class_bool>` **use_taa** = ``false`` :ref:`🔗<class_Viewport_property_use_taa>`
  988. .. rst-class:: classref-property-setget
  989. - |void| **set_use_taa**\ (\ value\: :ref:`bool<class_bool>`\ )
  990. - :ref:`bool<class_bool>` **is_using_taa**\ (\ )
  991. Enables Temporal Anti-Aliasing for this viewport. TAA works by jittering the camera and accumulating the images of the last rendered frames, motion vector rendering is used to account for camera and object motion.
  992. \ **Note:** The implementation is not complete yet, some visual instances such as particles and skinned meshes may show artifacts.
  993. .. rst-class:: classref-item-separator
  994. ----
  995. .. _class_Viewport_property_use_xr:
  996. .. rst-class:: classref-property
  997. :ref:`bool<class_bool>` **use_xr** = ``false`` :ref:`🔗<class_Viewport_property_use_xr>`
  998. .. rst-class:: classref-property-setget
  999. - |void| **set_use_xr**\ (\ value\: :ref:`bool<class_bool>`\ )
  1000. - :ref:`bool<class_bool>` **is_using_xr**\ (\ )
  1001. If ``true``, the viewport will use the primary XR interface to render XR output. When applicable this can result in a stereoscopic image and the resulting render being output to a headset.
  1002. .. rst-class:: classref-item-separator
  1003. ----
  1004. .. _class_Viewport_property_vrs_mode:
  1005. .. rst-class:: classref-property
  1006. :ref:`VRSMode<enum_Viewport_VRSMode>` **vrs_mode** = ``0`` :ref:`🔗<class_Viewport_property_vrs_mode>`
  1007. .. rst-class:: classref-property-setget
  1008. - |void| **set_vrs_mode**\ (\ value\: :ref:`VRSMode<enum_Viewport_VRSMode>`\ )
  1009. - :ref:`VRSMode<enum_Viewport_VRSMode>` **get_vrs_mode**\ (\ )
  1010. The Variable Rate Shading (VRS) mode that is used for this viewport. Note, if hardware does not support VRS this property is ignored.
  1011. .. rst-class:: classref-item-separator
  1012. ----
  1013. .. _class_Viewport_property_vrs_texture:
  1014. .. rst-class:: classref-property
  1015. :ref:`Texture2D<class_Texture2D>` **vrs_texture** :ref:`🔗<class_Viewport_property_vrs_texture>`
  1016. .. rst-class:: classref-property-setget
  1017. - |void| **set_vrs_texture**\ (\ value\: :ref:`Texture2D<class_Texture2D>`\ )
  1018. - :ref:`Texture2D<class_Texture2D>` **get_vrs_texture**\ (\ )
  1019. Texture to use when :ref:`vrs_mode<class_Viewport_property_vrs_mode>` is set to :ref:`VRS_TEXTURE<class_Viewport_constant_VRS_TEXTURE>`.
  1020. The texture *must* use a lossless compression format so that colors can be matched precisely. The following VRS densities are mapped to various colors, with brighter colors representing a lower level of shading precision:
  1021. .. code:: text
  1022. - 1×1 = rgb(0, 0, 0) - #000000
  1023. - 1×2 = rgb(0, 85, 0) - #005500
  1024. - 2×1 = rgb(85, 0, 0) - #550000
  1025. - 2×2 = rgb(85, 85, 0) - #555500
  1026. - 2×4 = rgb(85, 170, 0) - #55aa00
  1027. - 4×2 = rgb(170, 85, 0) - #aa5500
  1028. - 4×4 = rgb(170, 170, 0) - #aaaa00
  1029. - 4×8 = rgb(170, 255, 0) - #aaff00 - Not supported on most hardware
  1030. - 8×4 = rgb(255, 170, 0) - #ffaa00 - Not supported on most hardware
  1031. - 8×8 = rgb(255, 255, 0) - #ffff00 - Not supported on most hardware
  1032. .. rst-class:: classref-item-separator
  1033. ----
  1034. .. _class_Viewport_property_vrs_update_mode:
  1035. .. rst-class:: classref-property
  1036. :ref:`VRSUpdateMode<enum_Viewport_VRSUpdateMode>` **vrs_update_mode** = ``1`` :ref:`🔗<class_Viewport_property_vrs_update_mode>`
  1037. .. rst-class:: classref-property-setget
  1038. - |void| **set_vrs_update_mode**\ (\ value\: :ref:`VRSUpdateMode<enum_Viewport_VRSUpdateMode>`\ )
  1039. - :ref:`VRSUpdateMode<enum_Viewport_VRSUpdateMode>` **get_vrs_update_mode**\ (\ )
  1040. Sets the update mode for Variable Rate Shading (VRS) for the viewport. VRS requires the input texture to be converted to the format usable by the VRS method supported by the hardware. The update mode defines how often this happens. If the GPU does not support VRS, or VRS is not enabled, this property is ignored.
  1041. .. rst-class:: classref-item-separator
  1042. ----
  1043. .. _class_Viewport_property_world_2d:
  1044. .. rst-class:: classref-property
  1045. :ref:`World2D<class_World2D>` **world_2d** :ref:`🔗<class_Viewport_property_world_2d>`
  1046. .. rst-class:: classref-property-setget
  1047. - |void| **set_world_2d**\ (\ value\: :ref:`World2D<class_World2D>`\ )
  1048. - :ref:`World2D<class_World2D>` **get_world_2d**\ (\ )
  1049. The custom :ref:`World2D<class_World2D>` which can be used as 2D environment source.
  1050. .. rst-class:: classref-item-separator
  1051. ----
  1052. .. _class_Viewport_property_world_3d:
  1053. .. rst-class:: classref-property
  1054. :ref:`World3D<class_World3D>` **world_3d** :ref:`🔗<class_Viewport_property_world_3d>`
  1055. .. rst-class:: classref-property-setget
  1056. - |void| **set_world_3d**\ (\ value\: :ref:`World3D<class_World3D>`\ )
  1057. - :ref:`World3D<class_World3D>` **get_world_3d**\ (\ )
  1058. The custom :ref:`World3D<class_World3D>` which can be used as 3D environment source.
  1059. .. rst-class:: classref-section-separator
  1060. ----
  1061. .. rst-class:: classref-descriptions-group
  1062. Method Descriptions
  1063. -------------------
  1064. .. _class_Viewport_method_find_world_2d:
  1065. .. rst-class:: classref-method
  1066. :ref:`World2D<class_World2D>` **find_world_2d**\ (\ ) |const| :ref:`🔗<class_Viewport_method_find_world_2d>`
  1067. Returns the first valid :ref:`World2D<class_World2D>` for this viewport, searching the :ref:`world_2d<class_Viewport_property_world_2d>` property of itself and any Viewport ancestor.
  1068. .. rst-class:: classref-item-separator
  1069. ----
  1070. .. _class_Viewport_method_find_world_3d:
  1071. .. rst-class:: classref-method
  1072. :ref:`World3D<class_World3D>` **find_world_3d**\ (\ ) |const| :ref:`🔗<class_Viewport_method_find_world_3d>`
  1073. Returns the first valid :ref:`World3D<class_World3D>` for this viewport, searching the :ref:`world_3d<class_Viewport_property_world_3d>` property of itself and any Viewport ancestor.
  1074. .. rst-class:: classref-item-separator
  1075. ----
  1076. .. _class_Viewport_method_get_camera_2d:
  1077. .. rst-class:: classref-method
  1078. :ref:`Camera2D<class_Camera2D>` **get_camera_2d**\ (\ ) |const| :ref:`🔗<class_Viewport_method_get_camera_2d>`
  1079. Returns the currently active 2D camera. Returns null if there are no active cameras.
  1080. .. rst-class:: classref-item-separator
  1081. ----
  1082. .. _class_Viewport_method_get_camera_3d:
  1083. .. rst-class:: classref-method
  1084. :ref:`Camera3D<class_Camera3D>` **get_camera_3d**\ (\ ) |const| :ref:`🔗<class_Viewport_method_get_camera_3d>`
  1085. Returns the currently active 3D camera.
  1086. .. rst-class:: classref-item-separator
  1087. ----
  1088. .. _class_Viewport_method_get_canvas_cull_mask_bit:
  1089. .. rst-class:: classref-method
  1090. :ref:`bool<class_bool>` **get_canvas_cull_mask_bit**\ (\ layer\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Viewport_method_get_canvas_cull_mask_bit>`
  1091. Returns an individual bit on the rendering layer mask.
  1092. .. rst-class:: classref-item-separator
  1093. ----
  1094. .. _class_Viewport_method_get_embedded_subwindows:
  1095. .. rst-class:: classref-method
  1096. :ref:`Array<class_Array>`\[:ref:`Window<class_Window>`\] **get_embedded_subwindows**\ (\ ) |const| :ref:`🔗<class_Viewport_method_get_embedded_subwindows>`
  1097. Returns a list of the visible embedded :ref:`Window<class_Window>`\ s inside the viewport.
  1098. \ **Note:** :ref:`Window<class_Window>`\ s inside other viewports will not be listed.
  1099. .. rst-class:: classref-item-separator
  1100. ----
  1101. .. _class_Viewport_method_get_final_transform:
  1102. .. rst-class:: classref-method
  1103. :ref:`Transform2D<class_Transform2D>` **get_final_transform**\ (\ ) |const| :ref:`🔗<class_Viewport_method_get_final_transform>`
  1104. Returns the transform from the viewport's coordinate system to the embedder's coordinate system.
  1105. .. rst-class:: classref-item-separator
  1106. ----
  1107. .. _class_Viewport_method_get_mouse_position:
  1108. .. rst-class:: classref-method
  1109. :ref:`Vector2<class_Vector2>` **get_mouse_position**\ (\ ) |const| :ref:`🔗<class_Viewport_method_get_mouse_position>`
  1110. Returns the mouse's position in this **Viewport** using the coordinate system of this **Viewport**.
  1111. .. rst-class:: classref-item-separator
  1112. ----
  1113. .. _class_Viewport_method_get_positional_shadow_atlas_quadrant_subdiv:
  1114. .. rst-class:: classref-method
  1115. :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **get_positional_shadow_atlas_quadrant_subdiv**\ (\ quadrant\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Viewport_method_get_positional_shadow_atlas_quadrant_subdiv>`
  1116. Returns the positional shadow atlas quadrant subdivision of the specified quadrant.
  1117. .. rst-class:: classref-item-separator
  1118. ----
  1119. .. _class_Viewport_method_get_render_info:
  1120. .. rst-class:: classref-method
  1121. :ref:`int<class_int>` **get_render_info**\ (\ type\: :ref:`RenderInfoType<enum_Viewport_RenderInfoType>`, info\: :ref:`RenderInfo<enum_Viewport_RenderInfo>`\ ) :ref:`🔗<class_Viewport_method_get_render_info>`
  1122. Returns rendering statistics of the given type. See :ref:`RenderInfoType<enum_Viewport_RenderInfoType>` and :ref:`RenderInfo<enum_Viewport_RenderInfo>` for options.
  1123. .. rst-class:: classref-item-separator
  1124. ----
  1125. .. _class_Viewport_method_get_screen_transform:
  1126. .. rst-class:: classref-method
  1127. :ref:`Transform2D<class_Transform2D>` **get_screen_transform**\ (\ ) |const| :ref:`🔗<class_Viewport_method_get_screen_transform>`
  1128. Returns the transform from the Viewport's coordinates to the screen coordinates of the containing window manager window.
  1129. .. rst-class:: classref-item-separator
  1130. ----
  1131. .. _class_Viewport_method_get_texture:
  1132. .. rst-class:: classref-method
  1133. :ref:`ViewportTexture<class_ViewportTexture>` **get_texture**\ (\ ) |const| :ref:`🔗<class_Viewport_method_get_texture>`
  1134. Returns the viewport's texture.
  1135. \ **Note:** When trying to store the current texture (e.g. in a file), it might be completely black or outdated if used too early, especially when used in e.g. :ref:`Node._ready<class_Node_private_method__ready>`. To make sure the texture you get is correct, you can await :ref:`RenderingServer.frame_post_draw<class_RenderingServer_signal_frame_post_draw>` signal.
  1136. ::
  1137. func _ready():
  1138. await RenderingServer.frame_post_draw
  1139. $Viewport.get_texture().get_image().save_png("user://Screenshot.png")
  1140. .. rst-class:: classref-item-separator
  1141. ----
  1142. .. _class_Viewport_method_get_viewport_rid:
  1143. .. rst-class:: classref-method
  1144. :ref:`RID<class_RID>` **get_viewport_rid**\ (\ ) |const| :ref:`🔗<class_Viewport_method_get_viewport_rid>`
  1145. Returns the viewport's RID from the :ref:`RenderingServer<class_RenderingServer>`.
  1146. .. rst-class:: classref-item-separator
  1147. ----
  1148. .. _class_Viewport_method_get_visible_rect:
  1149. .. rst-class:: classref-method
  1150. :ref:`Rect2<class_Rect2>` **get_visible_rect**\ (\ ) |const| :ref:`🔗<class_Viewport_method_get_visible_rect>`
  1151. Returns the visible rectangle in global screen coordinates.
  1152. .. rst-class:: classref-item-separator
  1153. ----
  1154. .. _class_Viewport_method_gui_get_drag_data:
  1155. .. rst-class:: classref-method
  1156. :ref:`Variant<class_Variant>` **gui_get_drag_data**\ (\ ) |const| :ref:`🔗<class_Viewport_method_gui_get_drag_data>`
  1157. Returns the drag data from the GUI, that was previously returned by :ref:`Control._get_drag_data<class_Control_private_method__get_drag_data>`.
  1158. .. rst-class:: classref-item-separator
  1159. ----
  1160. .. _class_Viewport_method_gui_get_focus_owner:
  1161. .. rst-class:: classref-method
  1162. :ref:`Control<class_Control>` **gui_get_focus_owner**\ (\ ) |const| :ref:`🔗<class_Viewport_method_gui_get_focus_owner>`
  1163. Returns the :ref:`Control<class_Control>` having the focus within this viewport. If no :ref:`Control<class_Control>` has the focus, returns null.
  1164. .. rst-class:: classref-item-separator
  1165. ----
  1166. .. _class_Viewport_method_gui_get_hovered_control:
  1167. .. rst-class:: classref-method
  1168. :ref:`Control<class_Control>` **gui_get_hovered_control**\ (\ ) |const| :ref:`🔗<class_Viewport_method_gui_get_hovered_control>`
  1169. Returns the :ref:`Control<class_Control>` that the mouse is currently hovering over in this viewport. If no :ref:`Control<class_Control>` has the cursor, returns null.
  1170. Typically the leaf :ref:`Control<class_Control>` node or deepest level of the subtree which claims hover. This is very useful when used together with :ref:`Node.is_ancestor_of<class_Node_method_is_ancestor_of>` to find if the mouse is within a control tree.
  1171. .. rst-class:: classref-item-separator
  1172. ----
  1173. .. _class_Viewport_method_gui_is_drag_successful:
  1174. .. rst-class:: classref-method
  1175. :ref:`bool<class_bool>` **gui_is_drag_successful**\ (\ ) |const| :ref:`🔗<class_Viewport_method_gui_is_drag_successful>`
  1176. Returns ``true`` if the drag operation is successful.
  1177. .. rst-class:: classref-item-separator
  1178. ----
  1179. .. _class_Viewport_method_gui_is_dragging:
  1180. .. rst-class:: classref-method
  1181. :ref:`bool<class_bool>` **gui_is_dragging**\ (\ ) |const| :ref:`🔗<class_Viewport_method_gui_is_dragging>`
  1182. Returns ``true`` if the viewport is currently performing a drag operation.
  1183. Alternative to :ref:`Node.NOTIFICATION_DRAG_BEGIN<class_Node_constant_NOTIFICATION_DRAG_BEGIN>` and :ref:`Node.NOTIFICATION_DRAG_END<class_Node_constant_NOTIFICATION_DRAG_END>` when you prefer polling the value.
  1184. .. rst-class:: classref-item-separator
  1185. ----
  1186. .. _class_Viewport_method_gui_release_focus:
  1187. .. rst-class:: classref-method
  1188. |void| **gui_release_focus**\ (\ ) :ref:`🔗<class_Viewport_method_gui_release_focus>`
  1189. Removes the focus from the currently focused :ref:`Control<class_Control>` within this viewport. If no :ref:`Control<class_Control>` has the focus, does nothing.
  1190. .. rst-class:: classref-item-separator
  1191. ----
  1192. .. _class_Viewport_method_is_input_handled:
  1193. .. rst-class:: classref-method
  1194. :ref:`bool<class_bool>` **is_input_handled**\ (\ ) |const| :ref:`🔗<class_Viewport_method_is_input_handled>`
  1195. Returns whether the current :ref:`InputEvent<class_InputEvent>` has been handled. Input events are not handled until :ref:`set_input_as_handled<class_Viewport_method_set_input_as_handled>` has been called during the lifetime of an :ref:`InputEvent<class_InputEvent>`.
  1196. This is usually done as part of input handling methods like :ref:`Node._input<class_Node_private_method__input>`, :ref:`Control._gui_input<class_Control_private_method__gui_input>` or others, as well as in corresponding signal handlers.
  1197. If :ref:`handle_input_locally<class_Viewport_property_handle_input_locally>` is set to ``false``, this method will try finding the first parent viewport that is set to handle input locally, and return its value for :ref:`is_input_handled<class_Viewport_method_is_input_handled>` instead.
  1198. .. rst-class:: classref-item-separator
  1199. ----
  1200. .. _class_Viewport_method_push_input:
  1201. .. rst-class:: classref-method
  1202. |void| **push_input**\ (\ event\: :ref:`InputEvent<class_InputEvent>`, in_local_coords\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_Viewport_method_push_input>`
  1203. Triggers the given ``event`` in this **Viewport**. This can be used to pass an :ref:`InputEvent<class_InputEvent>` between viewports, or to locally apply inputs that were sent over the network or saved to a file.
  1204. If ``in_local_coords`` is ``false``, the event's position is in the embedder's coordinates and will be converted to viewport coordinates. If ``in_local_coords`` is ``true``, the event's position is in viewport coordinates.
  1205. While this method serves a similar purpose as :ref:`Input.parse_input_event<class_Input_method_parse_input_event>`, it does not remap the specified ``event`` based on project settings like :ref:`ProjectSettings.input_devices/pointing/emulate_touch_from_mouse<class_ProjectSettings_property_input_devices/pointing/emulate_touch_from_mouse>`.
  1206. Calling this method will propagate calls to child nodes for following methods in the given order:
  1207. - :ref:`Node._input<class_Node_private_method__input>`\
  1208. - :ref:`Control._gui_input<class_Control_private_method__gui_input>` for :ref:`Control<class_Control>` nodes
  1209. - :ref:`Node._shortcut_input<class_Node_private_method__shortcut_input>`\
  1210. - :ref:`Node._unhandled_key_input<class_Node_private_method__unhandled_key_input>`\
  1211. - :ref:`Node._unhandled_input<class_Node_private_method__unhandled_input>`\
  1212. If an earlier method marks the input as handled via :ref:`set_input_as_handled<class_Viewport_method_set_input_as_handled>`, any later method in this list will not be called.
  1213. If none of the methods handle the event and :ref:`physics_object_picking<class_Viewport_property_physics_object_picking>` is ``true``, the event is used for physics object picking.
  1214. .. rst-class:: classref-item-separator
  1215. ----
  1216. .. _class_Viewport_method_push_text_input:
  1217. .. rst-class:: classref-method
  1218. |void| **push_text_input**\ (\ text\: :ref:`String<class_String>`\ ) :ref:`🔗<class_Viewport_method_push_text_input>`
  1219. Helper method which calls the ``set_text()`` method on the currently focused :ref:`Control<class_Control>`, provided that it is defined (e.g. if the focused Control is :ref:`Button<class_Button>` or :ref:`LineEdit<class_LineEdit>`).
  1220. .. rst-class:: classref-item-separator
  1221. ----
  1222. .. _class_Viewport_method_push_unhandled_input:
  1223. .. rst-class:: classref-method
  1224. |void| **push_unhandled_input**\ (\ event\: :ref:`InputEvent<class_InputEvent>`, in_local_coords\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_Viewport_method_push_unhandled_input>`
  1225. **Deprecated:** Use :ref:`push_input<class_Viewport_method_push_input>` instead.
  1226. Triggers the given ``event`` in this **Viewport**. This can be used to pass an :ref:`InputEvent<class_InputEvent>` between viewports, or to locally apply inputs that were sent over the network or saved to a file.
  1227. If ``in_local_coords`` is ``false``, the event's position is in the embedder's coordinates and will be converted to viewport coordinates. If ``in_local_coords`` is ``true``, the event's position is in viewport coordinates.
  1228. Calling this method will propagate calls to child nodes for following methods in the given order:
  1229. - :ref:`Node._shortcut_input<class_Node_private_method__shortcut_input>`\
  1230. - :ref:`Node._unhandled_key_input<class_Node_private_method__unhandled_key_input>`\
  1231. - :ref:`Node._unhandled_input<class_Node_private_method__unhandled_input>`\
  1232. If an earlier method marks the input as handled via :ref:`set_input_as_handled<class_Viewport_method_set_input_as_handled>`, any later method in this list will not be called.
  1233. If none of the methods handle the event and :ref:`physics_object_picking<class_Viewport_property_physics_object_picking>` is ``true``, the event is used for physics object picking.
  1234. \ **Note:** This method doesn't propagate input events to embedded :ref:`Window<class_Window>`\ s or :ref:`SubViewport<class_SubViewport>`\ s.
  1235. .. rst-class:: classref-item-separator
  1236. ----
  1237. .. _class_Viewport_method_set_canvas_cull_mask_bit:
  1238. .. rst-class:: classref-method
  1239. |void| **set_canvas_cull_mask_bit**\ (\ layer\: :ref:`int<class_int>`, enable\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_Viewport_method_set_canvas_cull_mask_bit>`
  1240. Set/clear individual bits on the rendering layer mask. This simplifies editing this **Viewport**'s layers.
  1241. .. rst-class:: classref-item-separator
  1242. ----
  1243. .. _class_Viewport_method_set_input_as_handled:
  1244. .. rst-class:: classref-method
  1245. |void| **set_input_as_handled**\ (\ ) :ref:`🔗<class_Viewport_method_set_input_as_handled>`
  1246. Stops the input from propagating further down the :ref:`SceneTree<class_SceneTree>`.
  1247. \ **Note:** This does not affect the methods in :ref:`Input<class_Input>`, only the way events are propagated.
  1248. .. rst-class:: classref-item-separator
  1249. ----
  1250. .. _class_Viewport_method_set_positional_shadow_atlas_quadrant_subdiv:
  1251. .. rst-class:: classref-method
  1252. |void| **set_positional_shadow_atlas_quadrant_subdiv**\ (\ quadrant\: :ref:`int<class_int>`, subdiv\: :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>`\ ) :ref:`🔗<class_Viewport_method_set_positional_shadow_atlas_quadrant_subdiv>`
  1253. Sets the number of subdivisions to use in the specified quadrant. A higher number of subdivisions allows you to have more shadows in the scene at once, but reduces the quality of the shadows. A good practice is to have quadrants with a varying number of subdivisions and to have as few subdivisions as possible.
  1254. .. rst-class:: classref-item-separator
  1255. ----
  1256. .. _class_Viewport_method_update_mouse_cursor_state:
  1257. .. rst-class:: classref-method
  1258. |void| **update_mouse_cursor_state**\ (\ ) :ref:`🔗<class_Viewport_method_update_mouse_cursor_state>`
  1259. Force instantly updating the display based on the current mouse cursor position. This includes updating the mouse cursor shape and sending necessary :ref:`Control.mouse_entered<class_Control_signal_mouse_entered>`, :ref:`CollisionObject2D.mouse_entered<class_CollisionObject2D_signal_mouse_entered>`, :ref:`CollisionObject3D.mouse_entered<class_CollisionObject3D_signal_mouse_entered>` and :ref:`Window.mouse_entered<class_Window_signal_mouse_entered>` signals and their respective ``mouse_exited`` counterparts.
  1260. .. rst-class:: classref-item-separator
  1261. ----
  1262. .. _class_Viewport_method_warp_mouse:
  1263. .. rst-class:: classref-method
  1264. |void| **warp_mouse**\ (\ position\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_Viewport_method_warp_mouse>`
  1265. Moves the mouse pointer to the specified position in this **Viewport** using the coordinate system of this **Viewport**.
  1266. \ **Note:** :ref:`warp_mouse<class_Viewport_method_warp_mouse>` is only supported on Windows, macOS and Linux. It has no effect on Android, iOS and Web.
  1267. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  1268. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  1269. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  1270. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  1271. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  1272. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  1273. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  1274. .. |void| replace:: :abbr:`void (No return value.)`