class_viewport.rst 150 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537
  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:`AnisotropicFiltering<enum_Viewport_AnisotropicFiltering>` | :ref:`anisotropic_filtering_level<class_Viewport_property_anisotropic_filtering_level>` | ``2`` |
  38. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  39. | :ref:`bool<class_bool>` | :ref:`audio_listener_enable_2d<class_Viewport_property_audio_listener_enable_2d>` | ``false`` |
  40. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  41. | :ref:`bool<class_bool>` | :ref:`audio_listener_enable_3d<class_Viewport_property_audio_listener_enable_3d>` | ``false`` |
  42. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  43. | :ref:`int<class_int>` | :ref:`canvas_cull_mask<class_Viewport_property_canvas_cull_mask>` | ``4294967295`` |
  44. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  45. | :ref:`DefaultCanvasItemTextureFilter<enum_Viewport_DefaultCanvasItemTextureFilter>` | :ref:`canvas_item_default_texture_filter<class_Viewport_property_canvas_item_default_texture_filter>` | ``1`` |
  46. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  47. | :ref:`DefaultCanvasItemTextureRepeat<enum_Viewport_DefaultCanvasItemTextureRepeat>` | :ref:`canvas_item_default_texture_repeat<class_Viewport_property_canvas_item_default_texture_repeat>` | ``0`` |
  48. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  49. | :ref:`Transform2D<class_Transform2D>` | :ref:`canvas_transform<class_Viewport_property_canvas_transform>` | |
  50. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  51. | :ref:`DebugDraw<enum_Viewport_DebugDraw>` | :ref:`debug_draw<class_Viewport_property_debug_draw>` | ``0`` |
  52. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  53. | :ref:`bool<class_bool>` | :ref:`disable_3d<class_Viewport_property_disable_3d>` | ``false`` |
  54. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  55. | :ref:`float<class_float>` | :ref:`fsr_sharpness<class_Viewport_property_fsr_sharpness>` | ``0.2`` |
  56. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  57. | :ref:`Transform2D<class_Transform2D>` | :ref:`global_canvas_transform<class_Viewport_property_global_canvas_transform>` | |
  58. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  59. | :ref:`bool<class_bool>` | :ref:`gui_disable_input<class_Viewport_property_gui_disable_input>` | ``false`` |
  60. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  61. | :ref:`bool<class_bool>` | :ref:`gui_embed_subwindows<class_Viewport_property_gui_embed_subwindows>` | ``false`` |
  62. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  63. | :ref:`bool<class_bool>` | :ref:`gui_snap_controls_to_pixels<class_Viewport_property_gui_snap_controls_to_pixels>` | ``true`` |
  64. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  65. | :ref:`bool<class_bool>` | :ref:`handle_input_locally<class_Viewport_property_handle_input_locally>` | ``true`` |
  66. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  67. | :ref:`float<class_float>` | :ref:`mesh_lod_threshold<class_Viewport_property_mesh_lod_threshold>` | ``1.0`` |
  68. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  69. | :ref:`MSAA<enum_Viewport_MSAA>` | :ref:`msaa_2d<class_Viewport_property_msaa_2d>` | ``0`` |
  70. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  71. | :ref:`MSAA<enum_Viewport_MSAA>` | :ref:`msaa_3d<class_Viewport_property_msaa_3d>` | ``0`` |
  72. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  73. | :ref:`bool<class_bool>` | :ref:`own_world_3d<class_Viewport_property_own_world_3d>` | ``false`` |
  74. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  75. | :ref:`PhysicsInterpolationMode<enum_Node_PhysicsInterpolationMode>` | physics_interpolation_mode | ``1`` (overrides :ref:`Node<class_Node_property_physics_interpolation_mode>`) |
  76. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  77. | :ref:`bool<class_bool>` | :ref:`physics_object_picking<class_Viewport_property_physics_object_picking>` | ``false`` |
  78. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  79. | :ref:`bool<class_bool>` | :ref:`physics_object_picking_first_only<class_Viewport_property_physics_object_picking_first_only>` | ``false`` |
  80. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  81. | :ref:`bool<class_bool>` | :ref:`physics_object_picking_sort<class_Viewport_property_physics_object_picking_sort>` | ``false`` |
  82. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  83. | :ref:`bool<class_bool>` | :ref:`positional_shadow_atlas_16_bits<class_Viewport_property_positional_shadow_atlas_16_bits>` | ``true`` |
  84. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  85. | :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` | :ref:`positional_shadow_atlas_quad_0<class_Viewport_property_positional_shadow_atlas_quad_0>` | ``2`` |
  86. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  87. | :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` | :ref:`positional_shadow_atlas_quad_1<class_Viewport_property_positional_shadow_atlas_quad_1>` | ``2`` |
  88. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  89. | :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` | :ref:`positional_shadow_atlas_quad_2<class_Viewport_property_positional_shadow_atlas_quad_2>` | ``3`` |
  90. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  91. | :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` | :ref:`positional_shadow_atlas_quad_3<class_Viewport_property_positional_shadow_atlas_quad_3>` | ``4`` |
  92. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  93. | :ref:`int<class_int>` | :ref:`positional_shadow_atlas_size<class_Viewport_property_positional_shadow_atlas_size>` | ``2048`` |
  94. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  95. | :ref:`Scaling3DMode<enum_Viewport_Scaling3DMode>` | :ref:`scaling_3d_mode<class_Viewport_property_scaling_3d_mode>` | ``0`` |
  96. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  97. | :ref:`float<class_float>` | :ref:`scaling_3d_scale<class_Viewport_property_scaling_3d_scale>` | ``1.0`` |
  98. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  99. | :ref:`ScreenSpaceAA<enum_Viewport_ScreenSpaceAA>` | :ref:`screen_space_aa<class_Viewport_property_screen_space_aa>` | ``0`` |
  100. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  101. | :ref:`SDFOversize<enum_Viewport_SDFOversize>` | :ref:`sdf_oversize<class_Viewport_property_sdf_oversize>` | ``1`` |
  102. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  103. | :ref:`SDFScale<enum_Viewport_SDFScale>` | :ref:`sdf_scale<class_Viewport_property_sdf_scale>` | ``1`` |
  104. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  105. | :ref:`bool<class_bool>` | :ref:`snap_2d_transforms_to_pixel<class_Viewport_property_snap_2d_transforms_to_pixel>` | ``false`` |
  106. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  107. | :ref:`bool<class_bool>` | :ref:`snap_2d_vertices_to_pixel<class_Viewport_property_snap_2d_vertices_to_pixel>` | ``false`` |
  108. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  109. | :ref:`float<class_float>` | :ref:`texture_mipmap_bias<class_Viewport_property_texture_mipmap_bias>` | ``0.0`` |
  110. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  111. | :ref:`bool<class_bool>` | :ref:`transparent_bg<class_Viewport_property_transparent_bg>` | ``false`` |
  112. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  113. | :ref:`bool<class_bool>` | :ref:`use_debanding<class_Viewport_property_use_debanding>` | ``false`` |
  114. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  115. | :ref:`bool<class_bool>` | :ref:`use_hdr_2d<class_Viewport_property_use_hdr_2d>` | ``false`` |
  116. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  117. | :ref:`bool<class_bool>` | :ref:`use_occlusion_culling<class_Viewport_property_use_occlusion_culling>` | ``false`` |
  118. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  119. | :ref:`bool<class_bool>` | :ref:`use_taa<class_Viewport_property_use_taa>` | ``false`` |
  120. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  121. | :ref:`bool<class_bool>` | :ref:`use_xr<class_Viewport_property_use_xr>` | ``false`` |
  122. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  123. | :ref:`VRSMode<enum_Viewport_VRSMode>` | :ref:`vrs_mode<class_Viewport_property_vrs_mode>` | ``0`` |
  124. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  125. | :ref:`Texture2D<class_Texture2D>` | :ref:`vrs_texture<class_Viewport_property_vrs_texture>` | |
  126. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  127. | :ref:`VRSUpdateMode<enum_Viewport_VRSUpdateMode>` | :ref:`vrs_update_mode<class_Viewport_property_vrs_update_mode>` | ``1`` |
  128. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  129. | :ref:`World2D<class_World2D>` | :ref:`world_2d<class_Viewport_property_world_2d>` | |
  130. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  131. | :ref:`World3D<class_World3D>` | :ref:`world_3d<class_Viewport_property_world_3d>` | |
  132. +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  133. .. rst-class:: classref-reftable-group
  134. Methods
  135. -------
  136. .. table::
  137. :widths: auto
  138. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  139. | :ref:`World2D<class_World2D>` | :ref:`find_world_2d<class_Viewport_method_find_world_2d>`\ (\ ) |const| |
  140. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  141. | :ref:`World3D<class_World3D>` | :ref:`find_world_3d<class_Viewport_method_find_world_3d>`\ (\ ) |const| |
  142. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  143. | :ref:`AudioListener2D<class_AudioListener2D>` | :ref:`get_audio_listener_2d<class_Viewport_method_get_audio_listener_2d>`\ (\ ) |const| |
  144. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  145. | :ref:`AudioListener3D<class_AudioListener3D>` | :ref:`get_audio_listener_3d<class_Viewport_method_get_audio_listener_3d>`\ (\ ) |const| |
  146. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  147. | :ref:`Camera2D<class_Camera2D>` | :ref:`get_camera_2d<class_Viewport_method_get_camera_2d>`\ (\ ) |const| |
  148. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  149. | :ref:`Camera3D<class_Camera3D>` | :ref:`get_camera_3d<class_Viewport_method_get_camera_3d>`\ (\ ) |const| |
  150. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  151. | :ref:`bool<class_bool>` | :ref:`get_canvas_cull_mask_bit<class_Viewport_method_get_canvas_cull_mask_bit>`\ (\ layer\: :ref:`int<class_int>`\ ) |const| |
  152. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  153. | :ref:`Array<class_Array>`\[:ref:`Window<class_Window>`\] | :ref:`get_embedded_subwindows<class_Viewport_method_get_embedded_subwindows>`\ (\ ) |const| |
  154. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  155. | :ref:`Transform2D<class_Transform2D>` | :ref:`get_final_transform<class_Viewport_method_get_final_transform>`\ (\ ) |const| |
  156. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  157. | :ref:`Vector2<class_Vector2>` | :ref:`get_mouse_position<class_Viewport_method_get_mouse_position>`\ (\ ) |const| |
  158. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  159. | :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| |
  160. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  161. | :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>`\ ) |
  162. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  163. | :ref:`Transform2D<class_Transform2D>` | :ref:`get_screen_transform<class_Viewport_method_get_screen_transform>`\ (\ ) |const| |
  164. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  165. | :ref:`Transform2D<class_Transform2D>` | :ref:`get_stretch_transform<class_Viewport_method_get_stretch_transform>`\ (\ ) |const| |
  166. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  167. | :ref:`ViewportTexture<class_ViewportTexture>` | :ref:`get_texture<class_Viewport_method_get_texture>`\ (\ ) |const| |
  168. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  169. | :ref:`RID<class_RID>` | :ref:`get_viewport_rid<class_Viewport_method_get_viewport_rid>`\ (\ ) |const| |
  170. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  171. | :ref:`Rect2<class_Rect2>` | :ref:`get_visible_rect<class_Viewport_method_get_visible_rect>`\ (\ ) |const| |
  172. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  173. | |void| | :ref:`gui_cancel_drag<class_Viewport_method_gui_cancel_drag>`\ (\ ) |
  174. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  175. | :ref:`Variant<class_Variant>` | :ref:`gui_get_drag_data<class_Viewport_method_gui_get_drag_data>`\ (\ ) |const| |
  176. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  177. | :ref:`Control<class_Control>` | :ref:`gui_get_focus_owner<class_Viewport_method_gui_get_focus_owner>`\ (\ ) |const| |
  178. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  179. | :ref:`Control<class_Control>` | :ref:`gui_get_hovered_control<class_Viewport_method_gui_get_hovered_control>`\ (\ ) |const| |
  180. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  181. | :ref:`bool<class_bool>` | :ref:`gui_is_drag_successful<class_Viewport_method_gui_is_drag_successful>`\ (\ ) |const| |
  182. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  183. | :ref:`bool<class_bool>` | :ref:`gui_is_dragging<class_Viewport_method_gui_is_dragging>`\ (\ ) |const| |
  184. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  185. | |void| | :ref:`gui_release_focus<class_Viewport_method_gui_release_focus>`\ (\ ) |
  186. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  187. | :ref:`bool<class_bool>` | :ref:`is_input_handled<class_Viewport_method_is_input_handled>`\ (\ ) |const| |
  188. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  189. | |void| | :ref:`notify_mouse_entered<class_Viewport_method_notify_mouse_entered>`\ (\ ) |
  190. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  191. | |void| | :ref:`notify_mouse_exited<class_Viewport_method_notify_mouse_exited>`\ (\ ) |
  192. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  193. | |void| | :ref:`push_input<class_Viewport_method_push_input>`\ (\ event\: :ref:`InputEvent<class_InputEvent>`, in_local_coords\: :ref:`bool<class_bool>` = false\ ) |
  194. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  195. | |void| | :ref:`push_text_input<class_Viewport_method_push_text_input>`\ (\ text\: :ref:`String<class_String>`\ ) |
  196. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  197. | |void| | :ref:`push_unhandled_input<class_Viewport_method_push_unhandled_input>`\ (\ event\: :ref:`InputEvent<class_InputEvent>`, in_local_coords\: :ref:`bool<class_bool>` = false\ ) |
  198. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  199. | |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>`\ ) |
  200. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  201. | |void| | :ref:`set_input_as_handled<class_Viewport_method_set_input_as_handled>`\ (\ ) |
  202. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  203. | |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>`\ ) |
  204. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  205. | |void| | :ref:`update_mouse_cursor_state<class_Viewport_method_update_mouse_cursor_state>`\ (\ ) |
  206. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  207. | |void| | :ref:`warp_mouse<class_Viewport_method_warp_mouse>`\ (\ position\: :ref:`Vector2<class_Vector2>`\ ) |
  208. +-----------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  209. .. rst-class:: classref-section-separator
  210. ----
  211. .. rst-class:: classref-descriptions-group
  212. Signals
  213. -------
  214. .. _class_Viewport_signal_gui_focus_changed:
  215. .. rst-class:: classref-signal
  216. **gui_focus_changed**\ (\ node\: :ref:`Control<class_Control>`\ ) :ref:`🔗<class_Viewport_signal_gui_focus_changed>`
  217. Emitted when a Control node grabs keyboard focus.
  218. \ **Note:** A Control node losing focus doesn't cause this signal to be emitted.
  219. .. rst-class:: classref-item-separator
  220. ----
  221. .. _class_Viewport_signal_size_changed:
  222. .. rst-class:: classref-signal
  223. **size_changed**\ (\ ) :ref:`🔗<class_Viewport_signal_size_changed>`
  224. Emitted when the size of the viewport is changed, whether by resizing of window, or some other means.
  225. .. rst-class:: classref-section-separator
  226. ----
  227. .. rst-class:: classref-descriptions-group
  228. Enumerations
  229. ------------
  230. .. _enum_Viewport_PositionalShadowAtlasQuadrantSubdiv:
  231. .. rst-class:: classref-enumeration
  232. enum **PositionalShadowAtlasQuadrantSubdiv**: :ref:`🔗<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>`
  233. .. _class_Viewport_constant_SHADOW_ATLAS_QUADRANT_SUBDIV_DISABLED:
  234. .. rst-class:: classref-enumeration-constant
  235. :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **SHADOW_ATLAS_QUADRANT_SUBDIV_DISABLED** = ``0``
  236. This quadrant will not be used.
  237. .. _class_Viewport_constant_SHADOW_ATLAS_QUADRANT_SUBDIV_1:
  238. .. rst-class:: classref-enumeration-constant
  239. :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **SHADOW_ATLAS_QUADRANT_SUBDIV_1** = ``1``
  240. This quadrant will only be used by one shadow map.
  241. .. _class_Viewport_constant_SHADOW_ATLAS_QUADRANT_SUBDIV_4:
  242. .. rst-class:: classref-enumeration-constant
  243. :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **SHADOW_ATLAS_QUADRANT_SUBDIV_4** = ``2``
  244. This quadrant will be split in 4 and used by up to 4 shadow maps.
  245. .. _class_Viewport_constant_SHADOW_ATLAS_QUADRANT_SUBDIV_16:
  246. .. rst-class:: classref-enumeration-constant
  247. :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **SHADOW_ATLAS_QUADRANT_SUBDIV_16** = ``3``
  248. This quadrant will be split 16 ways and used by up to 16 shadow maps.
  249. .. _class_Viewport_constant_SHADOW_ATLAS_QUADRANT_SUBDIV_64:
  250. .. rst-class:: classref-enumeration-constant
  251. :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **SHADOW_ATLAS_QUADRANT_SUBDIV_64** = ``4``
  252. This quadrant will be split 64 ways and used by up to 64 shadow maps.
  253. .. _class_Viewport_constant_SHADOW_ATLAS_QUADRANT_SUBDIV_256:
  254. .. rst-class:: classref-enumeration-constant
  255. :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **SHADOW_ATLAS_QUADRANT_SUBDIV_256** = ``5``
  256. 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.
  257. .. _class_Viewport_constant_SHADOW_ATLAS_QUADRANT_SUBDIV_1024:
  258. .. rst-class:: classref-enumeration-constant
  259. :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **SHADOW_ATLAS_QUADRANT_SUBDIV_1024** = ``6``
  260. 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.
  261. .. _class_Viewport_constant_SHADOW_ATLAS_QUADRANT_SUBDIV_MAX:
  262. .. rst-class:: classref-enumeration-constant
  263. :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **SHADOW_ATLAS_QUADRANT_SUBDIV_MAX** = ``7``
  264. Represents the size of the :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` enum.
  265. .. rst-class:: classref-item-separator
  266. ----
  267. .. _enum_Viewport_Scaling3DMode:
  268. .. rst-class:: classref-enumeration
  269. enum **Scaling3DMode**: :ref:`🔗<enum_Viewport_Scaling3DMode>`
  270. .. _class_Viewport_constant_SCALING_3D_MODE_BILINEAR:
  271. .. rst-class:: classref-enumeration-constant
  272. :ref:`Scaling3DMode<enum_Viewport_Scaling3DMode>` **SCALING_3D_MODE_BILINEAR** = ``0``
  273. 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.
  274. .. _class_Viewport_constant_SCALING_3D_MODE_FSR:
  275. .. rst-class:: classref-enumeration-constant
  276. :ref:`Scaling3DMode<enum_Viewport_Scaling3DMode>` **SCALING_3D_MODE_FSR** = ``1``
  277. 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.
  278. .. _class_Viewport_constant_SCALING_3D_MODE_FSR2:
  279. .. rst-class:: classref-enumeration-constant
  280. :ref:`Scaling3DMode<enum_Viewport_Scaling3DMode>` **SCALING_3D_MODE_FSR2** = ``2``
  281. 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.
  282. .. _class_Viewport_constant_SCALING_3D_MODE_METALFX_SPATIAL:
  283. .. rst-class:: classref-enumeration-constant
  284. :ref:`Scaling3DMode<enum_Viewport_Scaling3DMode>` **SCALING_3D_MODE_METALFX_SPATIAL** = ``3``
  285. Use the `MetalFX spatial upscaler <https://developer.apple.com/documentation/metalfx/mtlfxspatialscaler#overview>`__ for the viewport's 3D buffer.
  286. The amount of scaling can be set using :ref:`scaling_3d_scale<class_Viewport_property_scaling_3d_scale>`.
  287. Values less than ``1.0`` will be result in the viewport being upscaled using MetalFX. Values greater than ``1.0`` are not supported and bilinear downsampling will be used instead. A value of ``1.0`` disables scaling.
  288. More information: `MetalFX <https://developer.apple.com/documentation/metalfx>`__.
  289. \ **Note:** Only supported when the Metal rendering driver is in use, which limits this scaling mode to macOS and iOS.
  290. .. _class_Viewport_constant_SCALING_3D_MODE_METALFX_TEMPORAL:
  291. .. rst-class:: classref-enumeration-constant
  292. :ref:`Scaling3DMode<enum_Viewport_Scaling3DMode>` **SCALING_3D_MODE_METALFX_TEMPORAL** = ``4``
  293. Use the `MetalFX temporal upscaler <https://developer.apple.com/documentation/metalfx/mtlfxtemporalscaler#overview>`__ for the viewport's 3D buffer.
  294. The amount of scaling can be set using :ref:`scaling_3d_scale<class_Viewport_property_scaling_3d_scale>`. To determine the minimum input scale, use the :ref:`RenderingDevice.limit_get()<class_RenderingDevice_method_limit_get>` method with :ref:`RenderingDevice.LIMIT_METALFX_TEMPORAL_SCALER_MIN_SCALE<class_RenderingDevice_constant_LIMIT_METALFX_TEMPORAL_SCALER_MIN_SCALE>`.
  295. Values less than ``1.0`` will be result in the viewport being upscaled using MetalFX. Values greater than ``1.0`` are not supported and bilinear downsampling will be used instead. A value of ``1.0`` will use MetalFX at native resolution as a TAA solution.
  296. More information: `MetalFX <https://developer.apple.com/documentation/metalfx>`__.
  297. \ **Note:** Only supported when the Metal rendering driver is in use, which limits this scaling mode to macOS and iOS.
  298. .. _class_Viewport_constant_SCALING_3D_MODE_MAX:
  299. .. rst-class:: classref-enumeration-constant
  300. :ref:`Scaling3DMode<enum_Viewport_Scaling3DMode>` **SCALING_3D_MODE_MAX** = ``5``
  301. Represents the size of the :ref:`Scaling3DMode<enum_Viewport_Scaling3DMode>` enum.
  302. .. rst-class:: classref-item-separator
  303. ----
  304. .. _enum_Viewport_MSAA:
  305. .. rst-class:: classref-enumeration
  306. enum **MSAA**: :ref:`🔗<enum_Viewport_MSAA>`
  307. .. _class_Viewport_constant_MSAA_DISABLED:
  308. .. rst-class:: classref-enumeration-constant
  309. :ref:`MSAA<enum_Viewport_MSAA>` **MSAA_DISABLED** = ``0``
  310. Multisample antialiasing mode disabled. This is the default value, and is also the fastest setting.
  311. .. _class_Viewport_constant_MSAA_2X:
  312. .. rst-class:: classref-enumeration-constant
  313. :ref:`MSAA<enum_Viewport_MSAA>` **MSAA_2X** = ``1``
  314. Use 2× Multisample Antialiasing. This has a moderate performance cost. It helps reduce aliasing noticeably, but 4× MSAA still looks substantially better.
  315. .. _class_Viewport_constant_MSAA_4X:
  316. .. rst-class:: classref-enumeration-constant
  317. :ref:`MSAA<enum_Viewport_MSAA>` **MSAA_4X** = ``2``
  318. Use 4× Multisample Antialiasing. This has a significant performance cost, and is generally a good compromise between performance and quality.
  319. .. _class_Viewport_constant_MSAA_8X:
  320. .. rst-class:: classref-enumeration-constant
  321. :ref:`MSAA<enum_Viewport_MSAA>` **MSAA_8X** = ``3``
  322. 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.
  323. .. _class_Viewport_constant_MSAA_MAX:
  324. .. rst-class:: classref-enumeration-constant
  325. :ref:`MSAA<enum_Viewport_MSAA>` **MSAA_MAX** = ``4``
  326. Represents the size of the :ref:`MSAA<enum_Viewport_MSAA>` enum.
  327. .. rst-class:: classref-item-separator
  328. ----
  329. .. _enum_Viewport_AnisotropicFiltering:
  330. .. rst-class:: classref-enumeration
  331. enum **AnisotropicFiltering**: :ref:`🔗<enum_Viewport_AnisotropicFiltering>`
  332. .. _class_Viewport_constant_ANISOTROPY_DISABLED:
  333. .. rst-class:: classref-enumeration-constant
  334. :ref:`AnisotropicFiltering<enum_Viewport_AnisotropicFiltering>` **ANISOTROPY_DISABLED** = ``0``
  335. Anisotropic filtering is disabled.
  336. .. _class_Viewport_constant_ANISOTROPY_2X:
  337. .. rst-class:: classref-enumeration-constant
  338. :ref:`AnisotropicFiltering<enum_Viewport_AnisotropicFiltering>` **ANISOTROPY_2X** = ``1``
  339. Use 2× anisotropic filtering.
  340. .. _class_Viewport_constant_ANISOTROPY_4X:
  341. .. rst-class:: classref-enumeration-constant
  342. :ref:`AnisotropicFiltering<enum_Viewport_AnisotropicFiltering>` **ANISOTROPY_4X** = ``2``
  343. Use 4× anisotropic filtering. This is the default value.
  344. .. _class_Viewport_constant_ANISOTROPY_8X:
  345. .. rst-class:: classref-enumeration-constant
  346. :ref:`AnisotropicFiltering<enum_Viewport_AnisotropicFiltering>` **ANISOTROPY_8X** = ``3``
  347. Use 8× anisotropic filtering.
  348. .. _class_Viewport_constant_ANISOTROPY_16X:
  349. .. rst-class:: classref-enumeration-constant
  350. :ref:`AnisotropicFiltering<enum_Viewport_AnisotropicFiltering>` **ANISOTROPY_16X** = ``4``
  351. Use 16× anisotropic filtering.
  352. .. _class_Viewport_constant_ANISOTROPY_MAX:
  353. .. rst-class:: classref-enumeration-constant
  354. :ref:`AnisotropicFiltering<enum_Viewport_AnisotropicFiltering>` **ANISOTROPY_MAX** = ``5``
  355. Represents the size of the :ref:`AnisotropicFiltering<enum_Viewport_AnisotropicFiltering>` enum.
  356. .. rst-class:: classref-item-separator
  357. ----
  358. .. _enum_Viewport_ScreenSpaceAA:
  359. .. rst-class:: classref-enumeration
  360. enum **ScreenSpaceAA**: :ref:`🔗<enum_Viewport_ScreenSpaceAA>`
  361. .. _class_Viewport_constant_SCREEN_SPACE_AA_DISABLED:
  362. .. rst-class:: classref-enumeration-constant
  363. :ref:`ScreenSpaceAA<enum_Viewport_ScreenSpaceAA>` **SCREEN_SPACE_AA_DISABLED** = ``0``
  364. Do not perform any antialiasing in the full screen post-process.
  365. .. _class_Viewport_constant_SCREEN_SPACE_AA_FXAA:
  366. .. rst-class:: classref-enumeration-constant
  367. :ref:`ScreenSpaceAA<enum_Viewport_ScreenSpaceAA>` **SCREEN_SPACE_AA_FXAA** = ``1``
  368. 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.
  369. .. _class_Viewport_constant_SCREEN_SPACE_AA_MAX:
  370. .. rst-class:: classref-enumeration-constant
  371. :ref:`ScreenSpaceAA<enum_Viewport_ScreenSpaceAA>` **SCREEN_SPACE_AA_MAX** = ``2``
  372. Represents the size of the :ref:`ScreenSpaceAA<enum_Viewport_ScreenSpaceAA>` enum.
  373. .. rst-class:: classref-item-separator
  374. ----
  375. .. _enum_Viewport_RenderInfo:
  376. .. rst-class:: classref-enumeration
  377. enum **RenderInfo**: :ref:`🔗<enum_Viewport_RenderInfo>`
  378. .. _class_Viewport_constant_RENDER_INFO_OBJECTS_IN_FRAME:
  379. .. rst-class:: classref-enumeration-constant
  380. :ref:`RenderInfo<enum_Viewport_RenderInfo>` **RENDER_INFO_OBJECTS_IN_FRAME** = ``0``
  381. Amount of objects in frame.
  382. .. _class_Viewport_constant_RENDER_INFO_PRIMITIVES_IN_FRAME:
  383. .. rst-class:: classref-enumeration-constant
  384. :ref:`RenderInfo<enum_Viewport_RenderInfo>` **RENDER_INFO_PRIMITIVES_IN_FRAME** = ``1``
  385. Amount of vertices in frame.
  386. .. _class_Viewport_constant_RENDER_INFO_DRAW_CALLS_IN_FRAME:
  387. .. rst-class:: classref-enumeration-constant
  388. :ref:`RenderInfo<enum_Viewport_RenderInfo>` **RENDER_INFO_DRAW_CALLS_IN_FRAME** = ``2``
  389. Amount of draw calls in frame.
  390. .. _class_Viewport_constant_RENDER_INFO_MAX:
  391. .. rst-class:: classref-enumeration-constant
  392. :ref:`RenderInfo<enum_Viewport_RenderInfo>` **RENDER_INFO_MAX** = ``3``
  393. Represents the size of the :ref:`RenderInfo<enum_Viewport_RenderInfo>` enum.
  394. .. rst-class:: classref-item-separator
  395. ----
  396. .. _enum_Viewport_RenderInfoType:
  397. .. rst-class:: classref-enumeration
  398. enum **RenderInfoType**: :ref:`🔗<enum_Viewport_RenderInfoType>`
  399. .. _class_Viewport_constant_RENDER_INFO_TYPE_VISIBLE:
  400. .. rst-class:: classref-enumeration-constant
  401. :ref:`RenderInfoType<enum_Viewport_RenderInfoType>` **RENDER_INFO_TYPE_VISIBLE** = ``0``
  402. Visible render pass (excluding shadows).
  403. .. _class_Viewport_constant_RENDER_INFO_TYPE_SHADOW:
  404. .. rst-class:: classref-enumeration-constant
  405. :ref:`RenderInfoType<enum_Viewport_RenderInfoType>` **RENDER_INFO_TYPE_SHADOW** = ``1``
  406. 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.
  407. .. _class_Viewport_constant_RENDER_INFO_TYPE_CANVAS:
  408. .. rst-class:: classref-enumeration-constant
  409. :ref:`RenderInfoType<enum_Viewport_RenderInfoType>` **RENDER_INFO_TYPE_CANVAS** = ``2``
  410. Canvas item rendering. This includes all 2D rendering.
  411. .. _class_Viewport_constant_RENDER_INFO_TYPE_MAX:
  412. .. rst-class:: classref-enumeration-constant
  413. :ref:`RenderInfoType<enum_Viewport_RenderInfoType>` **RENDER_INFO_TYPE_MAX** = ``3``
  414. Represents the size of the :ref:`RenderInfoType<enum_Viewport_RenderInfoType>` enum.
  415. .. rst-class:: classref-item-separator
  416. ----
  417. .. _enum_Viewport_DebugDraw:
  418. .. rst-class:: classref-enumeration
  419. enum **DebugDraw**: :ref:`🔗<enum_Viewport_DebugDraw>`
  420. .. _class_Viewport_constant_DEBUG_DRAW_DISABLED:
  421. .. rst-class:: classref-enumeration-constant
  422. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_DISABLED** = ``0``
  423. Objects are displayed normally.
  424. .. _class_Viewport_constant_DEBUG_DRAW_UNSHADED:
  425. .. rst-class:: classref-enumeration-constant
  426. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_UNSHADED** = ``1``
  427. Objects are displayed without light information.
  428. .. _class_Viewport_constant_DEBUG_DRAW_LIGHTING:
  429. .. rst-class:: classref-enumeration-constant
  430. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_LIGHTING** = ``2``
  431. Objects are displayed without textures and only with lighting information.
  432. .. _class_Viewport_constant_DEBUG_DRAW_OVERDRAW:
  433. .. rst-class:: classref-enumeration-constant
  434. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_OVERDRAW** = ``3``
  435. 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.
  436. .. _class_Viewport_constant_DEBUG_DRAW_WIREFRAME:
  437. .. rst-class:: classref-enumeration-constant
  438. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_WIREFRAME** = ``4``
  439. Objects are displayed as wireframe models.
  440. \ **Note:** :ref:`RenderingServer.set_debug_generate_wireframes()<class_RenderingServer_method_set_debug_generate_wireframes>` must be called before loading any meshes for wireframes to be visible when using the Compatibility renderer.
  441. .. _class_Viewport_constant_DEBUG_DRAW_NORMAL_BUFFER:
  442. .. rst-class:: classref-enumeration-constant
  443. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_NORMAL_BUFFER** = ``5``
  444. Objects are displayed without lighting information and their textures replaced by normal mapping.
  445. .. _class_Viewport_constant_DEBUG_DRAW_VOXEL_GI_ALBEDO:
  446. .. rst-class:: classref-enumeration-constant
  447. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_VOXEL_GI_ALBEDO** = ``6``
  448. Objects are displayed with only the albedo value from :ref:`VoxelGI<class_VoxelGI>`\ s.
  449. .. _class_Viewport_constant_DEBUG_DRAW_VOXEL_GI_LIGHTING:
  450. .. rst-class:: classref-enumeration-constant
  451. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_VOXEL_GI_LIGHTING** = ``7``
  452. Objects are displayed with only the lighting value from :ref:`VoxelGI<class_VoxelGI>`\ s.
  453. .. _class_Viewport_constant_DEBUG_DRAW_VOXEL_GI_EMISSION:
  454. .. rst-class:: classref-enumeration-constant
  455. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_VOXEL_GI_EMISSION** = ``8``
  456. Objects are displayed with only the emission color from :ref:`VoxelGI<class_VoxelGI>`\ s.
  457. .. _class_Viewport_constant_DEBUG_DRAW_SHADOW_ATLAS:
  458. .. rst-class:: classref-enumeration-constant
  459. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_SHADOW_ATLAS** = ``9``
  460. 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**.
  461. .. _class_Viewport_constant_DEBUG_DRAW_DIRECTIONAL_SHADOW_ATLAS:
  462. .. rst-class:: classref-enumeration-constant
  463. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_DIRECTIONAL_SHADOW_ATLAS** = ``10``
  464. Draws the shadow atlas that stores shadows from :ref:`DirectionalLight3D<class_DirectionalLight3D>`\ s in the upper left quadrant of the **Viewport**.
  465. .. _class_Viewport_constant_DEBUG_DRAW_SCENE_LUMINANCE:
  466. .. rst-class:: classref-enumeration-constant
  467. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_SCENE_LUMINANCE** = ``11``
  468. Draws the scene luminance buffer (if available) in the upper left quadrant of the **Viewport**.
  469. .. _class_Viewport_constant_DEBUG_DRAW_SSAO:
  470. .. rst-class:: classref-enumeration-constant
  471. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_SSAO** = ``12``
  472. 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>`.
  473. .. _class_Viewport_constant_DEBUG_DRAW_SSIL:
  474. .. rst-class:: classref-enumeration-constant
  475. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_SSIL** = ``13``
  476. 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>`.
  477. .. _class_Viewport_constant_DEBUG_DRAW_PSSM_SPLITS:
  478. .. rst-class:: classref-enumeration-constant
  479. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_PSSM_SPLITS** = ``14``
  480. 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.
  481. .. _class_Viewport_constant_DEBUG_DRAW_DECAL_ATLAS:
  482. .. rst-class:: classref-enumeration-constant
  483. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_DECAL_ATLAS** = ``15``
  484. Draws the decal atlas used by :ref:`Decal<class_Decal>`\ s and light projector textures in the upper left quadrant of the **Viewport**.
  485. .. _class_Viewport_constant_DEBUG_DRAW_SDFGI:
  486. .. rst-class:: classref-enumeration-constant
  487. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_SDFGI** = ``16``
  488. Draws the cascades used to render signed distance field global illumination (SDFGI).
  489. 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.
  490. .. _class_Viewport_constant_DEBUG_DRAW_SDFGI_PROBES:
  491. .. rst-class:: classref-enumeration-constant
  492. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_SDFGI_PROBES** = ``17``
  493. Draws the probes used for signed distance field global illumination (SDFGI).
  494. 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.
  495. .. _class_Viewport_constant_DEBUG_DRAW_GI_BUFFER:
  496. .. rst-class:: classref-enumeration-constant
  497. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_GI_BUFFER** = ``18``
  498. Draws the buffer used for global illumination (GI).
  499. .. _class_Viewport_constant_DEBUG_DRAW_DISABLE_LOD:
  500. .. rst-class:: classref-enumeration-constant
  501. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_DISABLE_LOD** = ``19``
  502. Draws all of the objects at their highest polycount, without low level of detail (LOD).
  503. .. _class_Viewport_constant_DEBUG_DRAW_CLUSTER_OMNI_LIGHTS:
  504. .. rst-class:: classref-enumeration-constant
  505. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_CLUSTER_OMNI_LIGHTS** = ``20``
  506. Draws the cluster used by :ref:`OmniLight3D<class_OmniLight3D>` nodes to optimize light rendering.
  507. .. _class_Viewport_constant_DEBUG_DRAW_CLUSTER_SPOT_LIGHTS:
  508. .. rst-class:: classref-enumeration-constant
  509. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_CLUSTER_SPOT_LIGHTS** = ``21``
  510. Draws the cluster used by :ref:`SpotLight3D<class_SpotLight3D>` nodes to optimize light rendering.
  511. .. _class_Viewport_constant_DEBUG_DRAW_CLUSTER_DECALS:
  512. .. rst-class:: classref-enumeration-constant
  513. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_CLUSTER_DECALS** = ``22``
  514. Draws the cluster used by :ref:`Decal<class_Decal>` nodes to optimize decal rendering.
  515. .. _class_Viewport_constant_DEBUG_DRAW_CLUSTER_REFLECTION_PROBES:
  516. .. rst-class:: classref-enumeration-constant
  517. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_CLUSTER_REFLECTION_PROBES** = ``23``
  518. Draws the cluster used by :ref:`ReflectionProbe<class_ReflectionProbe>` nodes to optimize decal rendering.
  519. .. _class_Viewport_constant_DEBUG_DRAW_OCCLUDERS:
  520. .. rst-class:: classref-enumeration-constant
  521. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_OCCLUDERS** = ``24``
  522. Draws the buffer used for occlusion culling.
  523. .. _class_Viewport_constant_DEBUG_DRAW_MOTION_VECTORS:
  524. .. rst-class:: classref-enumeration-constant
  525. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_MOTION_VECTORS** = ``25``
  526. Draws vector lines over the viewport to indicate the movement of pixels between frames.
  527. .. _class_Viewport_constant_DEBUG_DRAW_INTERNAL_BUFFER:
  528. .. rst-class:: classref-enumeration-constant
  529. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **DEBUG_DRAW_INTERNAL_BUFFER** = ``26``
  530. Draws the internal resolution buffer of the scene before post-processing is applied.
  531. .. rst-class:: classref-item-separator
  532. ----
  533. .. _enum_Viewport_DefaultCanvasItemTextureFilter:
  534. .. rst-class:: classref-enumeration
  535. enum **DefaultCanvasItemTextureFilter**: :ref:`🔗<enum_Viewport_DefaultCanvasItemTextureFilter>`
  536. .. _class_Viewport_constant_DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST:
  537. .. rst-class:: classref-enumeration-constant
  538. :ref:`DefaultCanvasItemTextureFilter<enum_Viewport_DefaultCanvasItemTextureFilter>` **DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST** = ``0``
  539. 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).
  540. .. _class_Viewport_constant_DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_LINEAR:
  541. .. rst-class:: classref-enumeration-constant
  542. :ref:`DefaultCanvasItemTextureFilter<enum_Viewport_DefaultCanvasItemTextureFilter>` **DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_LINEAR** = ``1``
  543. 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).
  544. .. _class_Viewport_constant_DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS:
  545. .. rst-class:: classref-enumeration-constant
  546. :ref:`DefaultCanvasItemTextureFilter<enum_Viewport_DefaultCanvasItemTextureFilter>` **DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS** = ``2``
  547. 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.
  548. 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.
  549. .. _class_Viewport_constant_DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS:
  550. .. rst-class:: classref-enumeration-constant
  551. :ref:`DefaultCanvasItemTextureFilter<enum_Viewport_DefaultCanvasItemTextureFilter>` **DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS** = ``3``
  552. 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.
  553. 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.
  554. .. _class_Viewport_constant_DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_MAX:
  555. .. rst-class:: classref-enumeration-constant
  556. :ref:`DefaultCanvasItemTextureFilter<enum_Viewport_DefaultCanvasItemTextureFilter>` **DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_MAX** = ``4``
  557. Represents the size of the :ref:`DefaultCanvasItemTextureFilter<enum_Viewport_DefaultCanvasItemTextureFilter>` enum.
  558. .. rst-class:: classref-item-separator
  559. ----
  560. .. _enum_Viewport_DefaultCanvasItemTextureRepeat:
  561. .. rst-class:: classref-enumeration
  562. enum **DefaultCanvasItemTextureRepeat**: :ref:`🔗<enum_Viewport_DefaultCanvasItemTextureRepeat>`
  563. .. _class_Viewport_constant_DEFAULT_CANVAS_ITEM_TEXTURE_REPEAT_DISABLED:
  564. .. rst-class:: classref-enumeration-constant
  565. :ref:`DefaultCanvasItemTextureRepeat<enum_Viewport_DefaultCanvasItemTextureRepeat>` **DEFAULT_CANVAS_ITEM_TEXTURE_REPEAT_DISABLED** = ``0``
  566. 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.
  567. .. _class_Viewport_constant_DEFAULT_CANVAS_ITEM_TEXTURE_REPEAT_ENABLED:
  568. .. rst-class:: classref-enumeration-constant
  569. :ref:`DefaultCanvasItemTextureRepeat<enum_Viewport_DefaultCanvasItemTextureRepeat>` **DEFAULT_CANVAS_ITEM_TEXTURE_REPEAT_ENABLED** = ``1``
  570. 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.
  571. .. _class_Viewport_constant_DEFAULT_CANVAS_ITEM_TEXTURE_REPEAT_MIRROR:
  572. .. rst-class:: classref-enumeration-constant
  573. :ref:`DefaultCanvasItemTextureRepeat<enum_Viewport_DefaultCanvasItemTextureRepeat>` **DEFAULT_CANVAS_ITEM_TEXTURE_REPEAT_MIRROR** = ``2``
  574. Flip the texture when repeating so that the edge lines up instead of abruptly changing.
  575. .. _class_Viewport_constant_DEFAULT_CANVAS_ITEM_TEXTURE_REPEAT_MAX:
  576. .. rst-class:: classref-enumeration-constant
  577. :ref:`DefaultCanvasItemTextureRepeat<enum_Viewport_DefaultCanvasItemTextureRepeat>` **DEFAULT_CANVAS_ITEM_TEXTURE_REPEAT_MAX** = ``3``
  578. Represents the size of the :ref:`DefaultCanvasItemTextureRepeat<enum_Viewport_DefaultCanvasItemTextureRepeat>` enum.
  579. .. rst-class:: classref-item-separator
  580. ----
  581. .. _enum_Viewport_SDFOversize:
  582. .. rst-class:: classref-enumeration
  583. enum **SDFOversize**: :ref:`🔗<enum_Viewport_SDFOversize>`
  584. .. _class_Viewport_constant_SDF_OVERSIZE_100_PERCENT:
  585. .. rst-class:: classref-enumeration-constant
  586. :ref:`SDFOversize<enum_Viewport_SDFOversize>` **SDF_OVERSIZE_100_PERCENT** = ``0``
  587. The signed distance field only covers the viewport's own rectangle.
  588. .. _class_Viewport_constant_SDF_OVERSIZE_120_PERCENT:
  589. .. rst-class:: classref-enumeration-constant
  590. :ref:`SDFOversize<enum_Viewport_SDFOversize>` **SDF_OVERSIZE_120_PERCENT** = ``1``
  591. The signed distance field is expanded to cover 20% of the viewport's size around the borders.
  592. .. _class_Viewport_constant_SDF_OVERSIZE_150_PERCENT:
  593. .. rst-class:: classref-enumeration-constant
  594. :ref:`SDFOversize<enum_Viewport_SDFOversize>` **SDF_OVERSIZE_150_PERCENT** = ``2``
  595. The signed distance field is expanded to cover 50% of the viewport's size around the borders.
  596. .. _class_Viewport_constant_SDF_OVERSIZE_200_PERCENT:
  597. .. rst-class:: classref-enumeration-constant
  598. :ref:`SDFOversize<enum_Viewport_SDFOversize>` **SDF_OVERSIZE_200_PERCENT** = ``3``
  599. The signed distance field is expanded to cover 100% (double) of the viewport's size around the borders.
  600. .. _class_Viewport_constant_SDF_OVERSIZE_MAX:
  601. .. rst-class:: classref-enumeration-constant
  602. :ref:`SDFOversize<enum_Viewport_SDFOversize>` **SDF_OVERSIZE_MAX** = ``4``
  603. Represents the size of the :ref:`SDFOversize<enum_Viewport_SDFOversize>` enum.
  604. .. rst-class:: classref-item-separator
  605. ----
  606. .. _enum_Viewport_SDFScale:
  607. .. rst-class:: classref-enumeration
  608. enum **SDFScale**: :ref:`🔗<enum_Viewport_SDFScale>`
  609. .. _class_Viewport_constant_SDF_SCALE_100_PERCENT:
  610. .. rst-class:: classref-enumeration-constant
  611. :ref:`SDFScale<enum_Viewport_SDFScale>` **SDF_SCALE_100_PERCENT** = ``0``
  612. The signed distance field is rendered at full resolution.
  613. .. _class_Viewport_constant_SDF_SCALE_50_PERCENT:
  614. .. rst-class:: classref-enumeration-constant
  615. :ref:`SDFScale<enum_Viewport_SDFScale>` **SDF_SCALE_50_PERCENT** = ``1``
  616. The signed distance field is rendered at half the resolution of this viewport.
  617. .. _class_Viewport_constant_SDF_SCALE_25_PERCENT:
  618. .. rst-class:: classref-enumeration-constant
  619. :ref:`SDFScale<enum_Viewport_SDFScale>` **SDF_SCALE_25_PERCENT** = ``2``
  620. The signed distance field is rendered at a quarter the resolution of this viewport.
  621. .. _class_Viewport_constant_SDF_SCALE_MAX:
  622. .. rst-class:: classref-enumeration-constant
  623. :ref:`SDFScale<enum_Viewport_SDFScale>` **SDF_SCALE_MAX** = ``3``
  624. Represents the size of the :ref:`SDFScale<enum_Viewport_SDFScale>` enum.
  625. .. rst-class:: classref-item-separator
  626. ----
  627. .. _enum_Viewport_VRSMode:
  628. .. rst-class:: classref-enumeration
  629. enum **VRSMode**: :ref:`🔗<enum_Viewport_VRSMode>`
  630. .. _class_Viewport_constant_VRS_DISABLED:
  631. .. rst-class:: classref-enumeration-constant
  632. :ref:`VRSMode<enum_Viewport_VRSMode>` **VRS_DISABLED** = ``0``
  633. Variable Rate Shading is disabled.
  634. .. _class_Viewport_constant_VRS_TEXTURE:
  635. .. rst-class:: classref-enumeration-constant
  636. :ref:`VRSMode<enum_Viewport_VRSMode>` **VRS_TEXTURE** = ``1``
  637. Variable Rate Shading uses a texture. Note, for stereoscopic use a texture atlas with a texture for each view.
  638. .. _class_Viewport_constant_VRS_XR:
  639. .. rst-class:: classref-enumeration-constant
  640. :ref:`VRSMode<enum_Viewport_VRSMode>` **VRS_XR** = ``2``
  641. Variable Rate Shading's texture is supplied by the primary :ref:`XRInterface<class_XRInterface>`.
  642. .. _class_Viewport_constant_VRS_MAX:
  643. .. rst-class:: classref-enumeration-constant
  644. :ref:`VRSMode<enum_Viewport_VRSMode>` **VRS_MAX** = ``3``
  645. Represents the size of the :ref:`VRSMode<enum_Viewport_VRSMode>` enum.
  646. .. rst-class:: classref-item-separator
  647. ----
  648. .. _enum_Viewport_VRSUpdateMode:
  649. .. rst-class:: classref-enumeration
  650. enum **VRSUpdateMode**: :ref:`🔗<enum_Viewport_VRSUpdateMode>`
  651. .. _class_Viewport_constant_VRS_UPDATE_DISABLED:
  652. .. rst-class:: classref-enumeration-constant
  653. :ref:`VRSUpdateMode<enum_Viewport_VRSUpdateMode>` **VRS_UPDATE_DISABLED** = ``0``
  654. The input texture for variable rate shading will not be processed.
  655. .. _class_Viewport_constant_VRS_UPDATE_ONCE:
  656. .. rst-class:: classref-enumeration-constant
  657. :ref:`VRSUpdateMode<enum_Viewport_VRSUpdateMode>` **VRS_UPDATE_ONCE** = ``1``
  658. The input texture for variable rate shading will be processed once.
  659. .. _class_Viewport_constant_VRS_UPDATE_ALWAYS:
  660. .. rst-class:: classref-enumeration-constant
  661. :ref:`VRSUpdateMode<enum_Viewport_VRSUpdateMode>` **VRS_UPDATE_ALWAYS** = ``2``
  662. The input texture for variable rate shading will be processed each frame.
  663. .. _class_Viewport_constant_VRS_UPDATE_MAX:
  664. .. rst-class:: classref-enumeration-constant
  665. :ref:`VRSUpdateMode<enum_Viewport_VRSUpdateMode>` **VRS_UPDATE_MAX** = ``3``
  666. Represents the size of the :ref:`VRSUpdateMode<enum_Viewport_VRSUpdateMode>` enum.
  667. .. rst-class:: classref-section-separator
  668. ----
  669. .. rst-class:: classref-descriptions-group
  670. Property Descriptions
  671. ---------------------
  672. .. _class_Viewport_property_anisotropic_filtering_level:
  673. .. rst-class:: classref-property
  674. :ref:`AnisotropicFiltering<enum_Viewport_AnisotropicFiltering>` **anisotropic_filtering_level** = ``2`` :ref:`🔗<class_Viewport_property_anisotropic_filtering_level>`
  675. .. rst-class:: classref-property-setget
  676. - |void| **set_anisotropic_filtering_level**\ (\ value\: :ref:`AnisotropicFiltering<enum_Viewport_AnisotropicFiltering>`\ )
  677. - :ref:`AnisotropicFiltering<enum_Viewport_AnisotropicFiltering>` **get_anisotropic_filtering_level**\ (\ )
  678. Sets the maximum number of samples to take when using anisotropic filtering on textures (as a power of two). A higher sample count will result in sharper textures at oblique angles, but is more expensive to compute. A value of ``0`` forcibly disables anisotropic filtering, even on materials where it is enabled.
  679. The anisotropic filtering level also affects decals and light projectors if they are configured to use anisotropic filtering. See :ref:`ProjectSettings.rendering/textures/decals/filter<class_ProjectSettings_property_rendering/textures/decals/filter>` and :ref:`ProjectSettings.rendering/textures/light_projectors/filter<class_ProjectSettings_property_rendering/textures/light_projectors/filter>`.
  680. \ **Note:** In 3D, for this setting to have an effect, set :ref:`BaseMaterial3D.texture_filter<class_BaseMaterial3D_property_texture_filter>` to :ref:`BaseMaterial3D.TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC<class_BaseMaterial3D_constant_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC>` or :ref:`BaseMaterial3D.TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC<class_BaseMaterial3D_constant_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC>` on materials.
  681. \ **Note:** In 2D, for this setting to have an effect, set :ref:`CanvasItem.texture_filter<class_CanvasItem_property_texture_filter>` to :ref:`CanvasItem.TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC<class_CanvasItem_constant_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC>` or :ref:`CanvasItem.TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC<class_CanvasItem_constant_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC>` on the :ref:`CanvasItem<class_CanvasItem>` node displaying the texture (or in :ref:`CanvasTexture<class_CanvasTexture>`). However, anisotropic filtering is rarely useful in 2D, so only enable it for textures in 2D if it makes a meaningful visual difference.
  682. .. rst-class:: classref-item-separator
  683. ----
  684. .. _class_Viewport_property_audio_listener_enable_2d:
  685. .. rst-class:: classref-property
  686. :ref:`bool<class_bool>` **audio_listener_enable_2d** = ``false`` :ref:`🔗<class_Viewport_property_audio_listener_enable_2d>`
  687. .. rst-class:: classref-property-setget
  688. - |void| **set_as_audio_listener_2d**\ (\ value\: :ref:`bool<class_bool>`\ )
  689. - :ref:`bool<class_bool>` **is_audio_listener_2d**\ (\ )
  690. If ``true``, the viewport will process 2D audio streams.
  691. .. rst-class:: classref-item-separator
  692. ----
  693. .. _class_Viewport_property_audio_listener_enable_3d:
  694. .. rst-class:: classref-property
  695. :ref:`bool<class_bool>` **audio_listener_enable_3d** = ``false`` :ref:`🔗<class_Viewport_property_audio_listener_enable_3d>`
  696. .. rst-class:: classref-property-setget
  697. - |void| **set_as_audio_listener_3d**\ (\ value\: :ref:`bool<class_bool>`\ )
  698. - :ref:`bool<class_bool>` **is_audio_listener_3d**\ (\ )
  699. If ``true``, the viewport will process 3D audio streams.
  700. .. rst-class:: classref-item-separator
  701. ----
  702. .. _class_Viewport_property_canvas_cull_mask:
  703. .. rst-class:: classref-property
  704. :ref:`int<class_int>` **canvas_cull_mask** = ``4294967295`` :ref:`🔗<class_Viewport_property_canvas_cull_mask>`
  705. .. rst-class:: classref-property-setget
  706. - |void| **set_canvas_cull_mask**\ (\ value\: :ref:`int<class_int>`\ )
  707. - :ref:`int<class_int>` **get_canvas_cull_mask**\ (\ )
  708. The rendering layers in which this **Viewport** renders :ref:`CanvasItem<class_CanvasItem>` nodes.
  709. .. rst-class:: classref-item-separator
  710. ----
  711. .. _class_Viewport_property_canvas_item_default_texture_filter:
  712. .. rst-class:: classref-property
  713. :ref:`DefaultCanvasItemTextureFilter<enum_Viewport_DefaultCanvasItemTextureFilter>` **canvas_item_default_texture_filter** = ``1`` :ref:`🔗<class_Viewport_property_canvas_item_default_texture_filter>`
  714. .. rst-class:: classref-property-setget
  715. - |void| **set_default_canvas_item_texture_filter**\ (\ value\: :ref:`DefaultCanvasItemTextureFilter<enum_Viewport_DefaultCanvasItemTextureFilter>`\ )
  716. - :ref:`DefaultCanvasItemTextureFilter<enum_Viewport_DefaultCanvasItemTextureFilter>` **get_default_canvas_item_texture_filter**\ (\ )
  717. Sets the default filter mode used by :ref:`CanvasItem<class_CanvasItem>`\ s in this Viewport. See :ref:`DefaultCanvasItemTextureFilter<enum_Viewport_DefaultCanvasItemTextureFilter>` for options.
  718. .. rst-class:: classref-item-separator
  719. ----
  720. .. _class_Viewport_property_canvas_item_default_texture_repeat:
  721. .. rst-class:: classref-property
  722. :ref:`DefaultCanvasItemTextureRepeat<enum_Viewport_DefaultCanvasItemTextureRepeat>` **canvas_item_default_texture_repeat** = ``0`` :ref:`🔗<class_Viewport_property_canvas_item_default_texture_repeat>`
  723. .. rst-class:: classref-property-setget
  724. - |void| **set_default_canvas_item_texture_repeat**\ (\ value\: :ref:`DefaultCanvasItemTextureRepeat<enum_Viewport_DefaultCanvasItemTextureRepeat>`\ )
  725. - :ref:`DefaultCanvasItemTextureRepeat<enum_Viewport_DefaultCanvasItemTextureRepeat>` **get_default_canvas_item_texture_repeat**\ (\ )
  726. Sets the default repeat mode used by :ref:`CanvasItem<class_CanvasItem>`\ s in this Viewport. See :ref:`DefaultCanvasItemTextureRepeat<enum_Viewport_DefaultCanvasItemTextureRepeat>` for options.
  727. .. rst-class:: classref-item-separator
  728. ----
  729. .. _class_Viewport_property_canvas_transform:
  730. .. rst-class:: classref-property
  731. :ref:`Transform2D<class_Transform2D>` **canvas_transform** :ref:`🔗<class_Viewport_property_canvas_transform>`
  732. .. rst-class:: classref-property-setget
  733. - |void| **set_canvas_transform**\ (\ value\: :ref:`Transform2D<class_Transform2D>`\ )
  734. - :ref:`Transform2D<class_Transform2D>` **get_canvas_transform**\ (\ )
  735. 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.
  736. .. rst-class:: classref-item-separator
  737. ----
  738. .. _class_Viewport_property_debug_draw:
  739. .. rst-class:: classref-property
  740. :ref:`DebugDraw<enum_Viewport_DebugDraw>` **debug_draw** = ``0`` :ref:`🔗<class_Viewport_property_debug_draw>`
  741. .. rst-class:: classref-property-setget
  742. - |void| **set_debug_draw**\ (\ value\: :ref:`DebugDraw<enum_Viewport_DebugDraw>`\ )
  743. - :ref:`DebugDraw<enum_Viewport_DebugDraw>` **get_debug_draw**\ (\ )
  744. The overlay mode for test rendered geometry in debug purposes.
  745. .. rst-class:: classref-item-separator
  746. ----
  747. .. _class_Viewport_property_disable_3d:
  748. .. rst-class:: classref-property
  749. :ref:`bool<class_bool>` **disable_3d** = ``false`` :ref:`🔗<class_Viewport_property_disable_3d>`
  750. .. rst-class:: classref-property-setget
  751. - |void| **set_disable_3d**\ (\ value\: :ref:`bool<class_bool>`\ )
  752. - :ref:`bool<class_bool>` **is_3d_disabled**\ (\ )
  753. Disable 3D rendering (but keep 2D rendering).
  754. .. rst-class:: classref-item-separator
  755. ----
  756. .. _class_Viewport_property_fsr_sharpness:
  757. .. rst-class:: classref-property
  758. :ref:`float<class_float>` **fsr_sharpness** = ``0.2`` :ref:`🔗<class_Viewport_property_fsr_sharpness>`
  759. .. rst-class:: classref-property-setget
  760. - |void| **set_fsr_sharpness**\ (\ value\: :ref:`float<class_float>`\ )
  761. - :ref:`float<class_float>` **get_fsr_sharpness**\ (\ )
  762. 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.
  763. 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.
  764. .. rst-class:: classref-item-separator
  765. ----
  766. .. _class_Viewport_property_global_canvas_transform:
  767. .. rst-class:: classref-property
  768. :ref:`Transform2D<class_Transform2D>` **global_canvas_transform** :ref:`🔗<class_Viewport_property_global_canvas_transform>`
  769. .. rst-class:: classref-property-setget
  770. - |void| **set_global_canvas_transform**\ (\ value\: :ref:`Transform2D<class_Transform2D>`\ )
  771. - :ref:`Transform2D<class_Transform2D>` **get_global_canvas_transform**\ (\ )
  772. The global canvas transform of the viewport. The canvas transform is relative to this.
  773. .. rst-class:: classref-item-separator
  774. ----
  775. .. _class_Viewport_property_gui_disable_input:
  776. .. rst-class:: classref-property
  777. :ref:`bool<class_bool>` **gui_disable_input** = ``false`` :ref:`🔗<class_Viewport_property_gui_disable_input>`
  778. .. rst-class:: classref-property-setget
  779. - |void| **set_disable_input**\ (\ value\: :ref:`bool<class_bool>`\ )
  780. - :ref:`bool<class_bool>` **is_input_disabled**\ (\ )
  781. If ``true``, the viewport will not receive input events.
  782. .. rst-class:: classref-item-separator
  783. ----
  784. .. _class_Viewport_property_gui_embed_subwindows:
  785. .. rst-class:: classref-property
  786. :ref:`bool<class_bool>` **gui_embed_subwindows** = ``false`` :ref:`🔗<class_Viewport_property_gui_embed_subwindows>`
  787. .. rst-class:: classref-property-setget
  788. - |void| **set_embedding_subwindows**\ (\ value\: :ref:`bool<class_bool>`\ )
  789. - :ref:`bool<class_bool>` **is_embedding_subwindows**\ (\ )
  790. 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.
  791. .. rst-class:: classref-item-separator
  792. ----
  793. .. _class_Viewport_property_gui_snap_controls_to_pixels:
  794. .. rst-class:: classref-property
  795. :ref:`bool<class_bool>` **gui_snap_controls_to_pixels** = ``true`` :ref:`🔗<class_Viewport_property_gui_snap_controls_to_pixels>`
  796. .. rst-class:: classref-property-setget
  797. - |void| **set_snap_controls_to_pixels**\ (\ value\: :ref:`bool<class_bool>`\ )
  798. - :ref:`bool<class_bool>` **is_snap_controls_to_pixels_enabled**\ (\ )
  799. If ``true``, the GUI controls on the viewport will lay pixel perfectly.
  800. .. rst-class:: classref-item-separator
  801. ----
  802. .. _class_Viewport_property_handle_input_locally:
  803. .. rst-class:: classref-property
  804. :ref:`bool<class_bool>` **handle_input_locally** = ``true`` :ref:`🔗<class_Viewport_property_handle_input_locally>`
  805. .. rst-class:: classref-property-setget
  806. - |void| **set_handle_input_locally**\ (\ value\: :ref:`bool<class_bool>`\ )
  807. - :ref:`bool<class_bool>` **is_handling_input_locally**\ (\ )
  808. 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.
  809. A :ref:`SubViewportContainer<class_SubViewportContainer>` will automatically set this property to ``false`` for the **Viewport** contained inside of it.
  810. 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>`.
  811. .. rst-class:: classref-item-separator
  812. ----
  813. .. _class_Viewport_property_mesh_lod_threshold:
  814. .. rst-class:: classref-property
  815. :ref:`float<class_float>` **mesh_lod_threshold** = ``1.0`` :ref:`🔗<class_Viewport_property_mesh_lod_threshold>`
  816. .. rst-class:: classref-property-setget
  817. - |void| **set_mesh_lod_threshold**\ (\ value\: :ref:`float<class_float>`\ )
  818. - :ref:`float<class_float>` **get_mesh_lod_threshold**\ (\ )
  819. 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.
  820. 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.
  821. \ **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).
  822. .. rst-class:: classref-item-separator
  823. ----
  824. .. _class_Viewport_property_msaa_2d:
  825. .. rst-class:: classref-property
  826. :ref:`MSAA<enum_Viewport_MSAA>` **msaa_2d** = ``0`` :ref:`🔗<class_Viewport_property_msaa_2d>`
  827. .. rst-class:: classref-property-setget
  828. - |void| **set_msaa_2d**\ (\ value\: :ref:`MSAA<enum_Viewport_MSAA>`\ )
  829. - :ref:`MSAA<enum_Viewport_MSAA>` **get_msaa_2d**\ (\ )
  830. The multisample antialiasing mode for 2D/Canvas rendering. A higher number results in smoother edges at the cost of significantly worse performance. A value of :ref:`MSAA_2X<class_Viewport_constant_MSAA_2X>` or :ref:`MSAA_4X<class_Viewport_constant_MSAA_4X>` is best unless targeting very high-end systems. This has no effect on shader-induced aliasing or texture aliasing.
  831. See also :ref:`ProjectSettings.rendering/anti_aliasing/quality/msaa_2d<class_ProjectSettings_property_rendering/anti_aliasing/quality/msaa_2d>` and :ref:`RenderingServer.viewport_set_msaa_2d()<class_RenderingServer_method_viewport_set_msaa_2d>`.
  832. .. rst-class:: classref-item-separator
  833. ----
  834. .. _class_Viewport_property_msaa_3d:
  835. .. rst-class:: classref-property
  836. :ref:`MSAA<enum_Viewport_MSAA>` **msaa_3d** = ``0`` :ref:`🔗<class_Viewport_property_msaa_3d>`
  837. .. rst-class:: classref-property-setget
  838. - |void| **set_msaa_3d**\ (\ value\: :ref:`MSAA<enum_Viewport_MSAA>`\ )
  839. - :ref:`MSAA<enum_Viewport_MSAA>` **get_msaa_3d**\ (\ )
  840. The multisample antialiasing mode for 3D rendering. A higher number results in smoother edges at the cost of significantly worse performance. A value of :ref:`MSAA_2X<class_Viewport_constant_MSAA_2X>` or :ref:`MSAA_4X<class_Viewport_constant_MSAA_4X>` 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.
  841. See also :ref:`ProjectSettings.rendering/anti_aliasing/quality/msaa_3d<class_ProjectSettings_property_rendering/anti_aliasing/quality/msaa_3d>` and :ref:`RenderingServer.viewport_set_msaa_3d()<class_RenderingServer_method_viewport_set_msaa_3d>`.
  842. .. rst-class:: classref-item-separator
  843. ----
  844. .. _class_Viewport_property_own_world_3d:
  845. .. rst-class:: classref-property
  846. :ref:`bool<class_bool>` **own_world_3d** = ``false`` :ref:`🔗<class_Viewport_property_own_world_3d>`
  847. .. rst-class:: classref-property-setget
  848. - |void| **set_use_own_world_3d**\ (\ value\: :ref:`bool<class_bool>`\ )
  849. - :ref:`bool<class_bool>` **is_using_own_world_3d**\ (\ )
  850. 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>`.
  851. .. rst-class:: classref-item-separator
  852. ----
  853. .. _class_Viewport_property_physics_object_picking:
  854. .. rst-class:: classref-property
  855. :ref:`bool<class_bool>` **physics_object_picking** = ``false`` :ref:`🔗<class_Viewport_property_physics_object_picking>`
  856. .. rst-class:: classref-property-setget
  857. - |void| **set_physics_object_picking**\ (\ value\: :ref:`bool<class_bool>`\ )
  858. - :ref:`bool<class_bool>` **get_physics_object_picking**\ (\ )
  859. If ``true``, the objects rendered by viewport become subjects of mouse picking process.
  860. \ **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.
  861. .. rst-class:: classref-item-separator
  862. ----
  863. .. _class_Viewport_property_physics_object_picking_first_only:
  864. .. rst-class:: classref-property
  865. :ref:`bool<class_bool>` **physics_object_picking_first_only** = ``false`` :ref:`🔗<class_Viewport_property_physics_object_picking_first_only>`
  866. .. rst-class:: classref-property-setget
  867. - |void| **set_physics_object_picking_first_only**\ (\ value\: :ref:`bool<class_bool>`\ )
  868. - :ref:`bool<class_bool>` **get_physics_object_picking_first_only**\ (\ )
  869. 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>`.
  870. If ``false``, an input_event signal will be sent to all physics objects in the mouse picking process.
  871. This applies to 2D CanvasItem object picking only.
  872. .. rst-class:: classref-item-separator
  873. ----
  874. .. _class_Viewport_property_physics_object_picking_sort:
  875. .. rst-class:: classref-property
  876. :ref:`bool<class_bool>` **physics_object_picking_sort** = ``false`` :ref:`🔗<class_Viewport_property_physics_object_picking_sort>`
  877. .. rst-class:: classref-property-setget
  878. - |void| **set_physics_object_picking_sort**\ (\ value\: :ref:`bool<class_bool>`\ )
  879. - :ref:`bool<class_bool>` **get_physics_object_picking_sort**\ (\ )
  880. 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.
  881. \ **Note:** This setting is disabled by default because of its potential expensive computational cost.
  882. \ **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.
  883. .. rst-class:: classref-item-separator
  884. ----
  885. .. _class_Viewport_property_positional_shadow_atlas_16_bits:
  886. .. rst-class:: classref-property
  887. :ref:`bool<class_bool>` **positional_shadow_atlas_16_bits** = ``true`` :ref:`🔗<class_Viewport_property_positional_shadow_atlas_16_bits>`
  888. .. rst-class:: classref-property-setget
  889. - |void| **set_positional_shadow_atlas_16_bits**\ (\ value\: :ref:`bool<class_bool>`\ )
  890. - :ref:`bool<class_bool>` **get_positional_shadow_atlas_16_bits**\ (\ )
  891. 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.
  892. .. rst-class:: classref-item-separator
  893. ----
  894. .. _class_Viewport_property_positional_shadow_atlas_quad_0:
  895. .. rst-class:: classref-property
  896. :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **positional_shadow_atlas_quad_0** = ``2`` :ref:`🔗<class_Viewport_property_positional_shadow_atlas_quad_0>`
  897. .. rst-class:: classref-property-setget
  898. - |void| **set_positional_shadow_atlas_quadrant_subdiv**\ (\ quadrant\: :ref:`int<class_int>`, subdiv\: :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>`\ )
  899. - :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **get_positional_shadow_atlas_quadrant_subdiv**\ (\ quadrant\: :ref:`int<class_int>`\ ) |const|
  900. The subdivision amount of the first quadrant on the shadow atlas.
  901. .. rst-class:: classref-item-separator
  902. ----
  903. .. _class_Viewport_property_positional_shadow_atlas_quad_1:
  904. .. rst-class:: classref-property
  905. :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **positional_shadow_atlas_quad_1** = ``2`` :ref:`🔗<class_Viewport_property_positional_shadow_atlas_quad_1>`
  906. .. rst-class:: classref-property-setget
  907. - |void| **set_positional_shadow_atlas_quadrant_subdiv**\ (\ quadrant\: :ref:`int<class_int>`, subdiv\: :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>`\ )
  908. - :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **get_positional_shadow_atlas_quadrant_subdiv**\ (\ quadrant\: :ref:`int<class_int>`\ ) |const|
  909. The subdivision amount of the second quadrant on the shadow atlas.
  910. .. rst-class:: classref-item-separator
  911. ----
  912. .. _class_Viewport_property_positional_shadow_atlas_quad_2:
  913. .. rst-class:: classref-property
  914. :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **positional_shadow_atlas_quad_2** = ``3`` :ref:`🔗<class_Viewport_property_positional_shadow_atlas_quad_2>`
  915. .. rst-class:: classref-property-setget
  916. - |void| **set_positional_shadow_atlas_quadrant_subdiv**\ (\ quadrant\: :ref:`int<class_int>`, subdiv\: :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>`\ )
  917. - :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **get_positional_shadow_atlas_quadrant_subdiv**\ (\ quadrant\: :ref:`int<class_int>`\ ) |const|
  918. The subdivision amount of the third quadrant on the shadow atlas.
  919. .. rst-class:: classref-item-separator
  920. ----
  921. .. _class_Viewport_property_positional_shadow_atlas_quad_3:
  922. .. rst-class:: classref-property
  923. :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **positional_shadow_atlas_quad_3** = ``4`` :ref:`🔗<class_Viewport_property_positional_shadow_atlas_quad_3>`
  924. .. rst-class:: classref-property-setget
  925. - |void| **set_positional_shadow_atlas_quadrant_subdiv**\ (\ quadrant\: :ref:`int<class_int>`, subdiv\: :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>`\ )
  926. - :ref:`PositionalShadowAtlasQuadrantSubdiv<enum_Viewport_PositionalShadowAtlasQuadrantSubdiv>` **get_positional_shadow_atlas_quadrant_subdiv**\ (\ quadrant\: :ref:`int<class_int>`\ ) |const|
  927. The subdivision amount of the fourth quadrant on the shadow atlas.
  928. .. rst-class:: classref-item-separator
  929. ----
  930. .. _class_Viewport_property_positional_shadow_atlas_size:
  931. .. rst-class:: classref-property
  932. :ref:`int<class_int>` **positional_shadow_atlas_size** = ``2048`` :ref:`🔗<class_Viewport_property_positional_shadow_atlas_size>`
  933. .. rst-class:: classref-property-setget
  934. - |void| **set_positional_shadow_atlas_size**\ (\ value\: :ref:`int<class_int>`\ )
  935. - :ref:`int<class_int>` **get_positional_shadow_atlas_size**\ (\ )
  936. The shadow atlas' resolution (used for omni and spot lights). The value is rounded up to the nearest power of 2.
  937. \ **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).
  938. .. rst-class:: classref-item-separator
  939. ----
  940. .. _class_Viewport_property_scaling_3d_mode:
  941. .. rst-class:: classref-property
  942. :ref:`Scaling3DMode<enum_Viewport_Scaling3DMode>` **scaling_3d_mode** = ``0`` :ref:`🔗<class_Viewport_property_scaling_3d_mode>`
  943. .. rst-class:: classref-property-setget
  944. - |void| **set_scaling_3d_mode**\ (\ value\: :ref:`Scaling3DMode<enum_Viewport_Scaling3DMode>`\ )
  945. - :ref:`Scaling3DMode<enum_Viewport_Scaling3DMode>` **get_scaling_3d_mode**\ (\ )
  946. 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.
  947. 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.
  948. .. rst-class:: classref-item-separator
  949. ----
  950. .. _class_Viewport_property_scaling_3d_scale:
  951. .. rst-class:: classref-property
  952. :ref:`float<class_float>` **scaling_3d_scale** = ``1.0`` :ref:`🔗<class_Viewport_property_scaling_3d_scale>`
  953. .. rst-class:: classref-property-setget
  954. - |void| **set_scaling_3d_scale**\ (\ value\: :ref:`float<class_float>`\ )
  955. - :ref:`float<class_float>` **get_scaling_3d_scale**\ (\ )
  956. 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.
  957. 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.
  958. 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.
  959. .. rst-class:: classref-item-separator
  960. ----
  961. .. _class_Viewport_property_screen_space_aa:
  962. .. rst-class:: classref-property
  963. :ref:`ScreenSpaceAA<enum_Viewport_ScreenSpaceAA>` **screen_space_aa** = ``0`` :ref:`🔗<class_Viewport_property_screen_space_aa>`
  964. .. rst-class:: classref-property-setget
  965. - |void| **set_screen_space_aa**\ (\ value\: :ref:`ScreenSpaceAA<enum_Viewport_ScreenSpaceAA>`\ )
  966. - :ref:`ScreenSpaceAA<enum_Viewport_ScreenSpaceAA>` **get_screen_space_aa**\ (\ )
  967. 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.
  968. See also :ref:`ProjectSettings.rendering/anti_aliasing/quality/screen_space_aa<class_ProjectSettings_property_rendering/anti_aliasing/quality/screen_space_aa>` and :ref:`RenderingServer.viewport_set_screen_space_aa()<class_RenderingServer_method_viewport_set_screen_space_aa>`.
  969. .. rst-class:: classref-item-separator
  970. ----
  971. .. _class_Viewport_property_sdf_oversize:
  972. .. rst-class:: classref-property
  973. :ref:`SDFOversize<enum_Viewport_SDFOversize>` **sdf_oversize** = ``1`` :ref:`🔗<class_Viewport_property_sdf_oversize>`
  974. .. rst-class:: classref-property-setget
  975. - |void| **set_sdf_oversize**\ (\ value\: :ref:`SDFOversize<enum_Viewport_SDFOversize>`\ )
  976. - :ref:`SDFOversize<enum_Viewport_SDFOversize>` **get_sdf_oversize**\ (\ )
  977. 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.
  978. 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).
  979. .. rst-class:: classref-item-separator
  980. ----
  981. .. _class_Viewport_property_sdf_scale:
  982. .. rst-class:: classref-property
  983. :ref:`SDFScale<enum_Viewport_SDFScale>` **sdf_scale** = ``1`` :ref:`🔗<class_Viewport_property_sdf_scale>`
  984. .. rst-class:: classref-property-setget
  985. - |void| **set_sdf_scale**\ (\ value\: :ref:`SDFScale<enum_Viewport_SDFScale>`\ )
  986. - :ref:`SDFScale<enum_Viewport_SDFScale>` **get_sdf_scale**\ (\ )
  987. 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.
  988. .. rst-class:: classref-item-separator
  989. ----
  990. .. _class_Viewport_property_snap_2d_transforms_to_pixel:
  991. .. rst-class:: classref-property
  992. :ref:`bool<class_bool>` **snap_2d_transforms_to_pixel** = ``false`` :ref:`🔗<class_Viewport_property_snap_2d_transforms_to_pixel>`
  993. .. rst-class:: classref-property-setget
  994. - |void| **set_snap_2d_transforms_to_pixel**\ (\ value\: :ref:`bool<class_bool>`\ )
  995. - :ref:`bool<class_bool>` **is_snap_2d_transforms_to_pixel_enabled**\ (\ )
  996. 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.
  997. .. rst-class:: classref-item-separator
  998. ----
  999. .. _class_Viewport_property_snap_2d_vertices_to_pixel:
  1000. .. rst-class:: classref-property
  1001. :ref:`bool<class_bool>` **snap_2d_vertices_to_pixel** = ``false`` :ref:`🔗<class_Viewport_property_snap_2d_vertices_to_pixel>`
  1002. .. rst-class:: classref-property-setget
  1003. - |void| **set_snap_2d_vertices_to_pixel**\ (\ value\: :ref:`bool<class_bool>`\ )
  1004. - :ref:`bool<class_bool>` **is_snap_2d_vertices_to_pixel_enabled**\ (\ )
  1005. 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.
  1006. .. rst-class:: classref-item-separator
  1007. ----
  1008. .. _class_Viewport_property_texture_mipmap_bias:
  1009. .. rst-class:: classref-property
  1010. :ref:`float<class_float>` **texture_mipmap_bias** = ``0.0`` :ref:`🔗<class_Viewport_property_texture_mipmap_bias>`
  1011. .. rst-class:: classref-property-setget
  1012. - |void| **set_texture_mipmap_bias**\ (\ value\: :ref:`float<class_float>`\ )
  1013. - :ref:`float<class_float>` **get_texture_mipmap_bias**\ (\ )
  1014. 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).
  1015. 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.
  1016. \ **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``.
  1017. 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.
  1018. .. rst-class:: classref-item-separator
  1019. ----
  1020. .. _class_Viewport_property_transparent_bg:
  1021. .. rst-class:: classref-property
  1022. :ref:`bool<class_bool>` **transparent_bg** = ``false`` :ref:`🔗<class_Viewport_property_transparent_bg>`
  1023. .. rst-class:: classref-property-setget
  1024. - |void| **set_transparent_background**\ (\ value\: :ref:`bool<class_bool>`\ )
  1025. - :ref:`bool<class_bool>` **has_transparent_background**\ (\ )
  1026. If ``true``, the viewport should render its background as transparent.
  1027. .. rst-class:: classref-item-separator
  1028. ----
  1029. .. _class_Viewport_property_use_debanding:
  1030. .. rst-class:: classref-property
  1031. :ref:`bool<class_bool>` **use_debanding** = ``false`` :ref:`🔗<class_Viewport_property_use_debanding>`
  1032. .. rst-class:: classref-property-setget
  1033. - |void| **set_use_debanding**\ (\ value\: :ref:`bool<class_bool>`\ )
  1034. - :ref:`bool<class_bool>` **is_using_debanding**\ (\ )
  1035. 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>`.
  1036. 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.
  1037. See also :ref:`ProjectSettings.rendering/anti_aliasing/quality/use_debanding<class_ProjectSettings_property_rendering/anti_aliasing/quality/use_debanding>` and :ref:`RenderingServer.viewport_set_use_debanding()<class_RenderingServer_method_viewport_set_use_debanding>`.
  1038. .. rst-class:: classref-item-separator
  1039. ----
  1040. .. _class_Viewport_property_use_hdr_2d:
  1041. .. rst-class:: classref-property
  1042. :ref:`bool<class_bool>` **use_hdr_2d** = ``false`` :ref:`🔗<class_Viewport_property_use_hdr_2d>`
  1043. .. rst-class:: classref-property-setget
  1044. - |void| **set_use_hdr_2d**\ (\ value\: :ref:`bool<class_bool>`\ )
  1045. - :ref:`bool<class_bool>` **is_using_hdr_2d**\ (\ )
  1046. 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.
  1047. \ **Note:** This setting will have no effect when using the Compatibility renderer, which always renders in low dynamic range for performance reasons.
  1048. .. rst-class:: classref-item-separator
  1049. ----
  1050. .. _class_Viewport_property_use_occlusion_culling:
  1051. .. rst-class:: classref-property
  1052. :ref:`bool<class_bool>` **use_occlusion_culling** = ``false`` :ref:`🔗<class_Viewport_property_use_occlusion_culling>`
  1053. .. rst-class:: classref-property-setget
  1054. - |void| **set_use_occlusion_culling**\ (\ value\: :ref:`bool<class_bool>`\ )
  1055. - :ref:`bool<class_bool>` **is_using_occlusion_culling**\ (\ )
  1056. 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.
  1057. \ **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.
  1058. \ **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``.
  1059. .. rst-class:: classref-item-separator
  1060. ----
  1061. .. _class_Viewport_property_use_taa:
  1062. .. rst-class:: classref-property
  1063. :ref:`bool<class_bool>` **use_taa** = ``false`` :ref:`🔗<class_Viewport_property_use_taa>`
  1064. .. rst-class:: classref-property-setget
  1065. - |void| **set_use_taa**\ (\ value\: :ref:`bool<class_bool>`\ )
  1066. - :ref:`bool<class_bool>` **is_using_taa**\ (\ )
  1067. Enables temporal antialiasing 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.
  1068. \ **Note:** The implementation is not complete yet, some visual instances such as particles and skinned meshes may show artifacts.
  1069. See also :ref:`ProjectSettings.rendering/anti_aliasing/quality/use_taa<class_ProjectSettings_property_rendering/anti_aliasing/quality/use_taa>` and :ref:`RenderingServer.viewport_set_use_taa()<class_RenderingServer_method_viewport_set_use_taa>`.
  1070. .. rst-class:: classref-item-separator
  1071. ----
  1072. .. _class_Viewport_property_use_xr:
  1073. .. rst-class:: classref-property
  1074. :ref:`bool<class_bool>` **use_xr** = ``false`` :ref:`🔗<class_Viewport_property_use_xr>`
  1075. .. rst-class:: classref-property-setget
  1076. - |void| **set_use_xr**\ (\ value\: :ref:`bool<class_bool>`\ )
  1077. - :ref:`bool<class_bool>` **is_using_xr**\ (\ )
  1078. 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.
  1079. .. rst-class:: classref-item-separator
  1080. ----
  1081. .. _class_Viewport_property_vrs_mode:
  1082. .. rst-class:: classref-property
  1083. :ref:`VRSMode<enum_Viewport_VRSMode>` **vrs_mode** = ``0`` :ref:`🔗<class_Viewport_property_vrs_mode>`
  1084. .. rst-class:: classref-property-setget
  1085. - |void| **set_vrs_mode**\ (\ value\: :ref:`VRSMode<enum_Viewport_VRSMode>`\ )
  1086. - :ref:`VRSMode<enum_Viewport_VRSMode>` **get_vrs_mode**\ (\ )
  1087. The Variable Rate Shading (VRS) mode that is used for this viewport. Note, if hardware does not support VRS this property is ignored.
  1088. .. rst-class:: classref-item-separator
  1089. ----
  1090. .. _class_Viewport_property_vrs_texture:
  1091. .. rst-class:: classref-property
  1092. :ref:`Texture2D<class_Texture2D>` **vrs_texture** :ref:`🔗<class_Viewport_property_vrs_texture>`
  1093. .. rst-class:: classref-property-setget
  1094. - |void| **set_vrs_texture**\ (\ value\: :ref:`Texture2D<class_Texture2D>`\ )
  1095. - :ref:`Texture2D<class_Texture2D>` **get_vrs_texture**\ (\ )
  1096. Texture to use when :ref:`vrs_mode<class_Viewport_property_vrs_mode>` is set to :ref:`VRS_TEXTURE<class_Viewport_constant_VRS_TEXTURE>`.
  1097. 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:
  1098. .. code:: text
  1099. - 1×1 = rgb(0, 0, 0) - #000000
  1100. - 1×2 = rgb(0, 85, 0) - #005500
  1101. - 2×1 = rgb(85, 0, 0) - #550000
  1102. - 2×2 = rgb(85, 85, 0) - #555500
  1103. - 2×4 = rgb(85, 170, 0) - #55aa00
  1104. - 4×2 = rgb(170, 85, 0) - #aa5500
  1105. - 4×4 = rgb(170, 170, 0) - #aaaa00
  1106. - 4×8 = rgb(170, 255, 0) - #aaff00 - Not supported on most hardware
  1107. - 8×4 = rgb(255, 170, 0) - #ffaa00 - Not supported on most hardware
  1108. - 8×8 = rgb(255, 255, 0) - #ffff00 - Not supported on most hardware
  1109. .. rst-class:: classref-item-separator
  1110. ----
  1111. .. _class_Viewport_property_vrs_update_mode:
  1112. .. rst-class:: classref-property
  1113. :ref:`VRSUpdateMode<enum_Viewport_VRSUpdateMode>` **vrs_update_mode** = ``1`` :ref:`🔗<class_Viewport_property_vrs_update_mode>`
  1114. .. rst-class:: classref-property-setget
  1115. - |void| **set_vrs_update_mode**\ (\ value\: :ref:`VRSUpdateMode<enum_Viewport_VRSUpdateMode>`\ )
  1116. - :ref:`VRSUpdateMode<enum_Viewport_VRSUpdateMode>` **get_vrs_update_mode**\ (\ )
  1117. 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.
  1118. .. rst-class:: classref-item-separator
  1119. ----
  1120. .. _class_Viewport_property_world_2d:
  1121. .. rst-class:: classref-property
  1122. :ref:`World2D<class_World2D>` **world_2d** :ref:`🔗<class_Viewport_property_world_2d>`
  1123. .. rst-class:: classref-property-setget
  1124. - |void| **set_world_2d**\ (\ value\: :ref:`World2D<class_World2D>`\ )
  1125. - :ref:`World2D<class_World2D>` **get_world_2d**\ (\ )
  1126. The custom :ref:`World2D<class_World2D>` which can be used as 2D environment source.
  1127. .. rst-class:: classref-item-separator
  1128. ----
  1129. .. _class_Viewport_property_world_3d:
  1130. .. rst-class:: classref-property
  1131. :ref:`World3D<class_World3D>` **world_3d** :ref:`🔗<class_Viewport_property_world_3d>`
  1132. .. rst-class:: classref-property-setget
  1133. - |void| **set_world_3d**\ (\ value\: :ref:`World3D<class_World3D>`\ )
  1134. - :ref:`World3D<class_World3D>` **get_world_3d**\ (\ )
  1135. The custom :ref:`World3D<class_World3D>` which can be used as 3D environment source.
  1136. .. rst-class:: classref-section-separator
  1137. ----
  1138. .. rst-class:: classref-descriptions-group
  1139. Method Descriptions
  1140. -------------------
  1141. .. _class_Viewport_method_find_world_2d:
  1142. .. rst-class:: classref-method
  1143. :ref:`World2D<class_World2D>` **find_world_2d**\ (\ ) |const| :ref:`🔗<class_Viewport_method_find_world_2d>`
  1144. 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.
  1145. .. rst-class:: classref-item-separator
  1146. ----
  1147. .. _class_Viewport_method_find_world_3d:
  1148. .. rst-class:: classref-method
  1149. :ref:`World3D<class_World3D>` **find_world_3d**\ (\ ) |const| :ref:`🔗<class_Viewport_method_find_world_3d>`
  1150. 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.
  1151. .. rst-class:: classref-item-separator
  1152. ----
  1153. .. _class_Viewport_method_get_audio_listener_2d:
  1154. .. rst-class:: classref-method
  1155. :ref:`AudioListener2D<class_AudioListener2D>` **get_audio_listener_2d**\ (\ ) |const| :ref:`🔗<class_Viewport_method_get_audio_listener_2d>`
  1156. Returns the currently active 2D audio listener. Returns ``null`` if there are no active 2D audio listeners, in which case the active 2D camera will be treated as listener.
  1157. .. rst-class:: classref-item-separator
  1158. ----
  1159. .. _class_Viewport_method_get_audio_listener_3d:
  1160. .. rst-class:: classref-method
  1161. :ref:`AudioListener3D<class_AudioListener3D>` **get_audio_listener_3d**\ (\ ) |const| :ref:`🔗<class_Viewport_method_get_audio_listener_3d>`
  1162. Returns the currently active 3D audio listener. Returns ``null`` if there are no active 3D audio listeners, in which case the active 3D camera will be treated as listener.
  1163. .. rst-class:: classref-item-separator
  1164. ----
  1165. .. _class_Viewport_method_get_camera_2d:
  1166. .. rst-class:: classref-method
  1167. :ref:`Camera2D<class_Camera2D>` **get_camera_2d**\ (\ ) |const| :ref:`🔗<class_Viewport_method_get_camera_2d>`
  1168. Returns the currently active 2D camera. Returns ``null`` if there are no active cameras.
  1169. .. rst-class:: classref-item-separator
  1170. ----
  1171. .. _class_Viewport_method_get_camera_3d:
  1172. .. rst-class:: classref-method
  1173. :ref:`Camera3D<class_Camera3D>` **get_camera_3d**\ (\ ) |const| :ref:`🔗<class_Viewport_method_get_camera_3d>`
  1174. Returns the currently active 3D camera.
  1175. .. rst-class:: classref-item-separator
  1176. ----
  1177. .. _class_Viewport_method_get_canvas_cull_mask_bit:
  1178. .. rst-class:: classref-method
  1179. :ref:`bool<class_bool>` **get_canvas_cull_mask_bit**\ (\ layer\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Viewport_method_get_canvas_cull_mask_bit>`
  1180. Returns an individual bit on the rendering layer mask.
  1181. .. rst-class:: classref-item-separator
  1182. ----
  1183. .. _class_Viewport_method_get_embedded_subwindows:
  1184. .. rst-class:: classref-method
  1185. :ref:`Array<class_Array>`\[:ref:`Window<class_Window>`\] **get_embedded_subwindows**\ (\ ) |const| :ref:`🔗<class_Viewport_method_get_embedded_subwindows>`
  1186. Returns a list of the visible embedded :ref:`Window<class_Window>`\ s inside the viewport.
  1187. \ **Note:** :ref:`Window<class_Window>`\ s inside other viewports will not be listed.
  1188. .. rst-class:: classref-item-separator
  1189. ----
  1190. .. _class_Viewport_method_get_final_transform:
  1191. .. rst-class:: classref-method
  1192. :ref:`Transform2D<class_Transform2D>` **get_final_transform**\ (\ ) |const| :ref:`🔗<class_Viewport_method_get_final_transform>`
  1193. Returns the transform from the viewport's coordinate system to the embedder's coordinate system.
  1194. .. rst-class:: classref-item-separator
  1195. ----
  1196. .. _class_Viewport_method_get_mouse_position:
  1197. .. rst-class:: classref-method
  1198. :ref:`Vector2<class_Vector2>` **get_mouse_position**\ (\ ) |const| :ref:`🔗<class_Viewport_method_get_mouse_position>`
  1199. Returns the mouse's position in this **Viewport** using the coordinate system of this **Viewport**.
  1200. .. rst-class:: classref-item-separator
  1201. ----
  1202. .. _class_Viewport_method_get_positional_shadow_atlas_quadrant_subdiv:
  1203. .. rst-class:: classref-method
  1204. :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>`
  1205. Returns the positional shadow atlas quadrant subdivision of the specified quadrant.
  1206. .. rst-class:: classref-item-separator
  1207. ----
  1208. .. _class_Viewport_method_get_render_info:
  1209. .. rst-class:: classref-method
  1210. :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>`
  1211. Returns rendering statistics of the given type. See :ref:`RenderInfoType<enum_Viewport_RenderInfoType>` and :ref:`RenderInfo<enum_Viewport_RenderInfo>` for options.
  1212. .. rst-class:: classref-item-separator
  1213. ----
  1214. .. _class_Viewport_method_get_screen_transform:
  1215. .. rst-class:: classref-method
  1216. :ref:`Transform2D<class_Transform2D>` **get_screen_transform**\ (\ ) |const| :ref:`🔗<class_Viewport_method_get_screen_transform>`
  1217. Returns the transform from the Viewport's coordinates to the screen coordinates of the containing window manager window.
  1218. .. rst-class:: classref-item-separator
  1219. ----
  1220. .. _class_Viewport_method_get_stretch_transform:
  1221. .. rst-class:: classref-method
  1222. :ref:`Transform2D<class_Transform2D>` **get_stretch_transform**\ (\ ) |const| :ref:`🔗<class_Viewport_method_get_stretch_transform>`
  1223. Returns the automatically computed 2D stretch transform, taking the **Viewport**'s stretch settings into account. The final value is multiplied by :ref:`Window.content_scale_factor<class_Window_property_content_scale_factor>`, but only for the root viewport. If this method is called on a :ref:`SubViewport<class_SubViewport>` (e.g., in a scene tree with :ref:`SubViewportContainer<class_SubViewportContainer>` and :ref:`SubViewport<class_SubViewport>`), the scale factor of the root window will not be applied. Using :ref:`Transform2D.get_scale()<class_Transform2D_method_get_scale>` on the returned value, this can be used to compensate for scaling when zooming a :ref:`Camera2D<class_Camera2D>` node, or to scale down a :ref:`TextureRect<class_TextureRect>` to be pixel-perfect regardless of the automatically computed scale factor.
  1224. \ **Note:** Due to how pixel scaling works, the returned transform's X and Y scale may differ slightly, even when :ref:`Window.content_scale_aspect<class_Window_property_content_scale_aspect>` is set to a mode that preserves the pixels' aspect ratio. If :ref:`Window.content_scale_aspect<class_Window_property_content_scale_aspect>` is :ref:`Window.CONTENT_SCALE_ASPECT_IGNORE<class_Window_constant_CONTENT_SCALE_ASPECT_IGNORE>`, the X and Y scale may differ *significantly*.
  1225. .. rst-class:: classref-item-separator
  1226. ----
  1227. .. _class_Viewport_method_get_texture:
  1228. .. rst-class:: classref-method
  1229. :ref:`ViewportTexture<class_ViewportTexture>` **get_texture**\ (\ ) |const| :ref:`🔗<class_Viewport_method_get_texture>`
  1230. Returns the viewport's texture.
  1231. \ **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.
  1232. ::
  1233. func _ready():
  1234. await RenderingServer.frame_post_draw
  1235. $Viewport.get_texture().get_image().save_png("user://Screenshot.png")
  1236. \ **Note:** When :ref:`use_hdr_2d<class_Viewport_property_use_hdr_2d>` is ``true`` the returned texture will be an HDR image encoded in linear space.
  1237. .. rst-class:: classref-item-separator
  1238. ----
  1239. .. _class_Viewport_method_get_viewport_rid:
  1240. .. rst-class:: classref-method
  1241. :ref:`RID<class_RID>` **get_viewport_rid**\ (\ ) |const| :ref:`🔗<class_Viewport_method_get_viewport_rid>`
  1242. Returns the viewport's RID from the :ref:`RenderingServer<class_RenderingServer>`.
  1243. .. rst-class:: classref-item-separator
  1244. ----
  1245. .. _class_Viewport_method_get_visible_rect:
  1246. .. rst-class:: classref-method
  1247. :ref:`Rect2<class_Rect2>` **get_visible_rect**\ (\ ) |const| :ref:`🔗<class_Viewport_method_get_visible_rect>`
  1248. Returns the visible rectangle in global screen coordinates.
  1249. .. rst-class:: classref-item-separator
  1250. ----
  1251. .. _class_Viewport_method_gui_cancel_drag:
  1252. .. rst-class:: classref-method
  1253. |void| **gui_cancel_drag**\ (\ ) :ref:`🔗<class_Viewport_method_gui_cancel_drag>`
  1254. Cancels the drag operation that was previously started through :ref:`Control._get_drag_data()<class_Control_private_method__get_drag_data>` or forced with :ref:`Control.force_drag()<class_Control_method_force_drag>`.
  1255. .. rst-class:: classref-item-separator
  1256. ----
  1257. .. _class_Viewport_method_gui_get_drag_data:
  1258. .. rst-class:: classref-method
  1259. :ref:`Variant<class_Variant>` **gui_get_drag_data**\ (\ ) |const| :ref:`🔗<class_Viewport_method_gui_get_drag_data>`
  1260. Returns the drag data from the GUI, that was previously returned by :ref:`Control._get_drag_data()<class_Control_private_method__get_drag_data>`.
  1261. .. rst-class:: classref-item-separator
  1262. ----
  1263. .. _class_Viewport_method_gui_get_focus_owner:
  1264. .. rst-class:: classref-method
  1265. :ref:`Control<class_Control>` **gui_get_focus_owner**\ (\ ) |const| :ref:`🔗<class_Viewport_method_gui_get_focus_owner>`
  1266. Returns the currently focused :ref:`Control<class_Control>` within this viewport. If no :ref:`Control<class_Control>` is focused, returns ``null``.
  1267. .. rst-class:: classref-item-separator
  1268. ----
  1269. .. _class_Viewport_method_gui_get_hovered_control:
  1270. .. rst-class:: classref-method
  1271. :ref:`Control<class_Control>` **gui_get_hovered_control**\ (\ ) |const| :ref:`🔗<class_Viewport_method_gui_get_hovered_control>`
  1272. 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``.
  1273. 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.
  1274. .. rst-class:: classref-item-separator
  1275. ----
  1276. .. _class_Viewport_method_gui_is_drag_successful:
  1277. .. rst-class:: classref-method
  1278. :ref:`bool<class_bool>` **gui_is_drag_successful**\ (\ ) |const| :ref:`🔗<class_Viewport_method_gui_is_drag_successful>`
  1279. Returns ``true`` if the drag operation is successful.
  1280. .. rst-class:: classref-item-separator
  1281. ----
  1282. .. _class_Viewport_method_gui_is_dragging:
  1283. .. rst-class:: classref-method
  1284. :ref:`bool<class_bool>` **gui_is_dragging**\ (\ ) |const| :ref:`🔗<class_Viewport_method_gui_is_dragging>`
  1285. Returns ``true`` if a drag operation is currently ongoing and where the drop action could happen in this viewport.
  1286. 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.
  1287. .. rst-class:: classref-item-separator
  1288. ----
  1289. .. _class_Viewport_method_gui_release_focus:
  1290. .. rst-class:: classref-method
  1291. |void| **gui_release_focus**\ (\ ) :ref:`🔗<class_Viewport_method_gui_release_focus>`
  1292. 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.
  1293. .. rst-class:: classref-item-separator
  1294. ----
  1295. .. _class_Viewport_method_is_input_handled:
  1296. .. rst-class:: classref-method
  1297. :ref:`bool<class_bool>` **is_input_handled**\ (\ ) |const| :ref:`🔗<class_Viewport_method_is_input_handled>`
  1298. 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>`.
  1299. 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.
  1300. 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.
  1301. .. rst-class:: classref-item-separator
  1302. ----
  1303. .. _class_Viewport_method_notify_mouse_entered:
  1304. .. rst-class:: classref-method
  1305. |void| **notify_mouse_entered**\ (\ ) :ref:`🔗<class_Viewport_method_notify_mouse_entered>`
  1306. Inform the Viewport that the mouse has entered its area. Use this function before sending an :ref:`InputEventMouseButton<class_InputEventMouseButton>` or :ref:`InputEventMouseMotion<class_InputEventMouseMotion>` to the **Viewport** with :ref:`push_input()<class_Viewport_method_push_input>`. See also :ref:`notify_mouse_exited()<class_Viewport_method_notify_mouse_exited>`.
  1307. \ **Note:** In most cases, it is not necessary to call this function because :ref:`SubViewport<class_SubViewport>` nodes that are children of :ref:`SubViewportContainer<class_SubViewportContainer>` are notified automatically. This is only necessary when interacting with viewports in non-default ways, for example as textures in :ref:`TextureRect<class_TextureRect>` or with an :ref:`Area3D<class_Area3D>` that forwards input events.
  1308. .. rst-class:: classref-item-separator
  1309. ----
  1310. .. _class_Viewport_method_notify_mouse_exited:
  1311. .. rst-class:: classref-method
  1312. |void| **notify_mouse_exited**\ (\ ) :ref:`🔗<class_Viewport_method_notify_mouse_exited>`
  1313. Inform the Viewport that the mouse has left its area. Use this function when the node that displays the viewport notices the mouse has left the area of the displayed viewport. See also :ref:`notify_mouse_entered()<class_Viewport_method_notify_mouse_entered>`.
  1314. \ **Note:** In most cases, it is not necessary to call this function because :ref:`SubViewport<class_SubViewport>` nodes that are children of :ref:`SubViewportContainer<class_SubViewportContainer>` are notified automatically. This is only necessary when interacting with viewports in non-default ways, for example as textures in :ref:`TextureRect<class_TextureRect>` or with an :ref:`Area3D<class_Area3D>` that forwards input events.
  1315. .. rst-class:: classref-item-separator
  1316. ----
  1317. .. _class_Viewport_method_push_input:
  1318. .. rst-class:: classref-method
  1319. |void| **push_input**\ (\ event\: :ref:`InputEvent<class_InputEvent>`, in_local_coords\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_Viewport_method_push_input>`
  1320. 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.
  1321. 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.
  1322. 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>`.
  1323. Calling this method will propagate calls to child nodes for following methods in the given order:
  1324. - :ref:`Node._input()<class_Node_private_method__input>`\
  1325. - :ref:`Control._gui_input()<class_Control_private_method__gui_input>` for :ref:`Control<class_Control>` nodes
  1326. - :ref:`Node._shortcut_input()<class_Node_private_method__shortcut_input>`\
  1327. - :ref:`Node._unhandled_key_input()<class_Node_private_method__unhandled_key_input>`\
  1328. - :ref:`Node._unhandled_input()<class_Node_private_method__unhandled_input>`\
  1329. 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.
  1330. 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.
  1331. .. rst-class:: classref-item-separator
  1332. ----
  1333. .. _class_Viewport_method_push_text_input:
  1334. .. rst-class:: classref-method
  1335. |void| **push_text_input**\ (\ text\: :ref:`String<class_String>`\ ) :ref:`🔗<class_Viewport_method_push_text_input>`
  1336. 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>`).
  1337. .. rst-class:: classref-item-separator
  1338. ----
  1339. .. _class_Viewport_method_push_unhandled_input:
  1340. .. rst-class:: classref-method
  1341. |void| **push_unhandled_input**\ (\ event\: :ref:`InputEvent<class_InputEvent>`, in_local_coords\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_Viewport_method_push_unhandled_input>`
  1342. **Deprecated:** Use :ref:`push_input()<class_Viewport_method_push_input>` instead.
  1343. 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.
  1344. 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.
  1345. Calling this method will propagate calls to child nodes for following methods in the given order:
  1346. - :ref:`Node._shortcut_input()<class_Node_private_method__shortcut_input>`\
  1347. - :ref:`Node._unhandled_key_input()<class_Node_private_method__unhandled_key_input>`\
  1348. - :ref:`Node._unhandled_input()<class_Node_private_method__unhandled_input>`\
  1349. 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.
  1350. 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.
  1351. \ **Note:** This method doesn't propagate input events to embedded :ref:`Window<class_Window>`\ s or :ref:`SubViewport<class_SubViewport>`\ s.
  1352. .. rst-class:: classref-item-separator
  1353. ----
  1354. .. _class_Viewport_method_set_canvas_cull_mask_bit:
  1355. .. rst-class:: classref-method
  1356. |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>`
  1357. Set/clear individual bits on the rendering layer mask. This simplifies editing this **Viewport**'s layers.
  1358. .. rst-class:: classref-item-separator
  1359. ----
  1360. .. _class_Viewport_method_set_input_as_handled:
  1361. .. rst-class:: classref-method
  1362. |void| **set_input_as_handled**\ (\ ) :ref:`🔗<class_Viewport_method_set_input_as_handled>`
  1363. Stops the input from propagating further down the :ref:`SceneTree<class_SceneTree>`.
  1364. \ **Note:** This does not affect the methods in :ref:`Input<class_Input>`, only the way events are propagated.
  1365. .. rst-class:: classref-item-separator
  1366. ----
  1367. .. _class_Viewport_method_set_positional_shadow_atlas_quadrant_subdiv:
  1368. .. rst-class:: classref-method
  1369. |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>`
  1370. 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.
  1371. .. rst-class:: classref-item-separator
  1372. ----
  1373. .. _class_Viewport_method_update_mouse_cursor_state:
  1374. .. rst-class:: classref-method
  1375. |void| **update_mouse_cursor_state**\ (\ ) :ref:`🔗<class_Viewport_method_update_mouse_cursor_state>`
  1376. 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.
  1377. .. rst-class:: classref-item-separator
  1378. ----
  1379. .. _class_Viewport_method_warp_mouse:
  1380. .. rst-class:: classref-method
  1381. |void| **warp_mouse**\ (\ position\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_Viewport_method_warp_mouse>`
  1382. Moves the mouse pointer to the specified position in this **Viewport** using the coordinate system of this **Viewport**.
  1383. \ **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.
  1384. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  1385. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  1386. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  1387. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  1388. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  1389. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  1390. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  1391. .. |void| replace:: :abbr:`void (No return value.)`