diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index f8c6fd0547b..9b01966e08a 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -5,6 +5,10 @@ contact_links: url: https://godotengine.org/community about: Please ask for technical support on one of the other community channels, not here. + - name: Godot proposals + url: https://github.com/godotengine/godot-proposals + about: Please submit engine feature proposals on the Godot proposals repository, not here. + - name: Main Godot repository url: https://github.com/godotengine/godot about: Report engine bugs on the main Godot repository diff --git a/about/release_policy.rst b/about/release_policy.rst index 734a34b4381..7e215ef899c 100644 --- a/about/release_policy.rst +++ b/about/release_policy.rst @@ -82,9 +82,12 @@ on GitHub. +--------------+----------------------+--------------------------------------------------------------------------+ | **Version** | **Release date** | **Support level** | +--------------+----------------------+--------------------------------------------------------------------------+ -| Godot 4.3 | June 2024 | |unstable| *Development.* Receives new features, usability and | +| Godot 4.4 | To be announced | |unstable| *Development.* Receives new features, usability and | | (`master`) | (estimate) | performance improvements, as well as bug fixes, while under development. | +--------------+----------------------+--------------------------------------------------------------------------+ +| Godot 4.3 | August 2024 | |supported| Receives fixes for bugs and security issues, as well as | +| | | patches that enable platform support. | ++--------------+----------------------+--------------------------------------------------------------------------+ | Godot 4.2 | November 2023 | |supported| Receives fixes for bugs and security issues, as well as | | | | patches that enable platform support. | +--------------+----------------------+--------------------------------------------------------------------------+ diff --git a/about/system_requirements.rst b/about/system_requirements.rst index 528e1056c3e..f5a96f9b0d9 100644 --- a/about/system_requirements.rst +++ b/about/system_requirements.rst @@ -100,8 +100,7 @@ Mobile device (smartphone/tablet) - Minimum | | Exporting projects requires downloading export templates separately | | | (1.3 GB after installation). | +----------------------+-----------------------------------------------------------------------------------------+ -| **Operating system** | - **Native editor:** Android 6.0 (Compatibility) or Android 9.0 (Forward+/Mobile), | -| | iOS 11.0 | +| **Operating system** | - **Native editor:** Android 6.0 (Compatibility) or Android 9.0 (Forward+/Mobile) | | | - **Web editor:** Firefox 79, Chrome 88, Edge 79, Safari 15.2, Opera 64, | | | Samsung Internet 15 | +----------------------+-----------------------------------------------------------------------------------------+ @@ -174,7 +173,7 @@ Mobile device (smartphone/tablet) - Recommended +----------------------+-----------------------------------------------------------------------------------------+ | **Storage** | 1.5 GB (used for the executable, project files, all export templates and cache) | +----------------------+-----------------------------------------------------------------------------------------+ -| **Operating system** | - **Native editor:** Android 9.0 or iOS 11.0 | +| **Operating system** | - **Native editor:** Android 9.0 | | | - **Web editor:** Latest version of Firefox, Chrome, Edge, Safari, Opera, | | | Samsung Internet | +----------------------+-----------------------------------------------------------------------------------------+ @@ -268,15 +267,15 @@ Mobile device (smartphone/tablet) - Minimum +----------------------+-----------------------------------------------------------------------------------------+ | **GPU** | - **Forward+ rendering method:** SoC featuring GPU with full Vulkan 1.0 support | | | | -| | - *Example: Qualcomm Adreno 505, Mali-G71 MP2, PowerVR G6430 (iPhone 6S/iPhone SE 1)* | +| | - *Example: Qualcomm Adreno 505, Mali-G71 MP2, Apple A12 (iPhone XR/XS)* | | | | | | - **Mobile rendering method:** SoC featuring GPU with full Vulkan 1.0 support | | | | -| | - *Example: Qualcomm Adreno 505, Mali-G71 MP2, PowerVR G6430 (iPhone 6S/iPhone SE 1)* | +| | - *Example: Qualcomm Adreno 505, Mali-G71 MP2, Apple A12 (iPhone XR/XS)* | | | | | | - **Compatibility rendering method:** SoC featuring GPU with full OpenGL ES 3.0 support | | | | -| | - *Example: Qualcomm Adreno 306, Mali-T628 MP6, PowerVR G6430 (iPhone 5S)* | +| | - *Example: Qualcomm Adreno 306, Mali-T628 MP6, Apple A7 (iPhone 5S)* | +----------------------+-----------------------------------------------------------------------------------------+ | **RAM** | - **For native exports:** 1 GB | | | - **For web exports:** 2 GB | @@ -284,7 +283,7 @@ Mobile device (smartphone/tablet) - Minimum | **Storage** | 150 MB (used for the executable, project files and cache) | +----------------------+-----------------------------------------------------------------------------------------+ | **Operating system** | - **For native exports:** Android 6.0 (Compatibility) or Android 9.0 (Forward+/Mobile), | -| | iOS 11.0 | +| | iOS 12.0 | | | - **For web exports:** Firefox 79, Chrome 88, Edge 79, Safari 15.2, Opera 64, | | | Samsung Internet 15 | +----------------------+-----------------------------------------------------------------------------------------+ @@ -340,26 +339,26 @@ Mobile device (smartphone/tablet) - Recommended | | | | | - **iOS:** SoC with 64-bit ARM CPU | | | | -| | - *Example: Apple A11 (iPhone XS/XR)* | +| | - *Example: Apple A14 (iPhone 12)* | +----------------------+-----------------------------------------------------------------------------------------+ | **GPU** | - **Forward+ rendering method:** SoC featuring GPU with full Vulkan 1.2 support | | | | -| | - *Example: Qualcomm Adreno 630, Mali-G72 MP18, Apple G11P (iPhone XR/XS)* | +| | - *Example: Qualcomm Adreno 630, Mali-G72 MP18, Apple A14 (iPhone 12)* | | | | | | - **Mobile rendering method:** SoC featuring GPU with full Vulkan 1.2 support | | | | -| | - *Example: Qualcomm Adreno 630, Mali-G72 MP18, Apple G11P (iPhone XR/XS)* | +| | - *Example: Qualcomm Adreno 630, Mali-G72 MP18, Apple A14 (iPhone 12)* | | | | | | - **Compatibility rendering method:** SoC featuring GPU with full OpenGL ES 3.2 support | | | | -| | - *Example: Qualcomm Adreno 630, Mali-G72 MP18, Apple G11P (iPhone XR/XS)* | +| | - *Example: Qualcomm Adreno 630, Mali-G72 MP18, Apple A14 (iPhone 12)* | +----------------------+-----------------------------------------------------------------------------------------+ | **RAM** | - **For native exports:** 2 GB | | | - **For web exports:** 4 GB | +----------------------+-----------------------------------------------------------------------------------------+ | **Storage** | 150 MB (used for the executable, project files and cache) | +----------------------+-----------------------------------------------------------------------------------------+ -| **Operating system** | - **For native exports:** Android 9.0 or iOS 11.0 | +| **Operating system** | - **For native exports:** Android 9.0 or iOS 14.1 | | | - **For web exports:** Latest version of Firefox, Chrome, Edge, Safari, Opera, | | | Samsung Internet | +----------------------+-----------------------------------------------------------------------------------------+ diff --git a/classes/class_@gdscript.rst b/classes/class_@gdscript.rst index 637da62db00..16accec855f 100644 --- a/classes/class_@gdscript.rst +++ b/classes/class_@gdscript.rst @@ -899,9 +899,9 @@ Returns a single character (as a :ref:`String`) of the given Unico :: - a = char(65) # a is "A" - a = char(65 + 32) # a is "a" - a = char(8364) # a is "โ‚ฌ" + var upper = char(65) # upper is "A" + var lower = char(65 + 32) # lower is "a" + var euro = char(8364) # euro is "โ‚ฌ" .. rst-class:: classref-item-separator @@ -1047,10 +1047,10 @@ Returns the length of the given Variant ``var``. The length can be the character :: - a = [1, 2, 3, 4] + var a = [1, 2, 3, 4] len(a) # Returns 4 - b = "Hello!" + var b = "Hello!" len(b) # Returns 6 .. rst-class:: classref-item-separator diff --git a/classes/class_@globalscope.rst b/classes/class_@globalscope.rst index 2e072c6768f..d75064ca920 100644 --- a/classes/class_@globalscope.rst +++ b/classes/class_@globalscope.rst @@ -7072,9 +7072,11 @@ Returns the hyperbolic sine of ``x``. :ref:`float` **smoothstep**\ (\ from\: :ref:`float`, to\: :ref:`float`, x\: :ref:`float`\ ) :ref:`๐Ÿ”—` -Returns the result of smoothly interpolating the value of ``x`` between ``0`` and ``1``, based on the where ``x`` lies with respect to the edges ``from`` and ``to``. +Returns a smooth cubic Hermite interpolation between ``0`` and ``1``. -The return value is ``0`` if ``x <= from``, and ``1`` if ``x >= to``. If ``x`` lies between ``from`` and ``to``, the returned value follows an S-shaped curve that maps ``x`` between ``0`` and ``1``. +For positive ranges (when ``from <= to``) the return value is ``0`` when ``x <= from``, and ``1`` when ``x >= to``. If ``x`` lies between ``from`` and ``to``, the return value follows an S-shaped curve that smoothly transitions from ``0`` to ``1``. + +For negative ranges (when ``from > to``) the function is mirrored and returns ``1`` when ``x <= to`` and ``0`` when ``x >= from``. This S-shaped curve is the cubic Hermite interpolator, given by ``f(y) = 3*y^2 - 2*y^3`` where ``y = (x-from) / (to-from)``. @@ -7087,7 +7089,9 @@ This S-shaped curve is the cubic Hermite interpolator, given by ``f(y) = 3*y^2 - Compared to :ref:`ease` with a curve value of ``-1.6521``, :ref:`smoothstep` returns the smoothest possible curve with no sudden changes in the derivative. If you need to perform more advanced transitions, use :ref:`Tween` or :ref:`AnimationPlayer`. -\ `Comparison between smoothstep() and ease(x, -1.6521) return values `__ +\ `Comparison between smoothstep() and ease(x, -1.6521) return values `__\ + +\ `Smoothstep() return values with positive, zero, and negative ranges `__ .. rst-class:: classref-item-separator diff --git a/classes/class_aabb.rst b/classes/class_aabb.rst index 4c35ba984c8..b9e0bb902a9 100644 --- a/classes/class_aabb.rst +++ b/classes/class_aabb.rst @@ -103,7 +103,7 @@ Methods +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_shortest_axis_size`\ (\ ) |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Vector3` | :ref:`get_support`\ (\ dir\: :ref:`Vector3`\ ) |const| | + | :ref:`Vector3` | :ref:`get_support`\ (\ direction\: :ref:`Vector3`\ ) |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_volume`\ (\ ) |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -502,7 +502,7 @@ For an example, see :ref:`get_shortest_axis .. rst-class:: classref-method -:ref:`Vector3` **get_support**\ (\ dir\: :ref:`Vector3`\ ) |const| :ref:`๐Ÿ”—` +:ref:`Vector3` **get_support**\ (\ direction\: :ref:`Vector3`\ ) |const| :ref:`๐Ÿ”—` Returns the vertex's position of this bounding box that's the farthest in the given direction. This point is commonly known as the support point in collision detection algorithms. diff --git a/classes/class_animationnodeblendspace2d.rst b/classes/class_animationnodeblendspace2d.rst index 506b47bff25..c107fffa9f8 100644 --- a/classes/class_animationnodeblendspace2d.rst +++ b/classes/class_animationnodeblendspace2d.rst @@ -21,7 +21,7 @@ Description A resource used by :ref:`AnimationNodeBlendTree`. -\ :ref:`AnimationNodeBlendSpace1D` represents a virtual 2D space on which :ref:`AnimationRootNode`\ s are placed. Outputs the linear blend of the three adjacent animations using a :ref:`Vector2` weight. Adjacent in this context means the three :ref:`AnimationRootNode`\ s making up the triangle that contains the current value. +\ **AnimationNodeBlendSpace2D** represents a virtual 2D space on which :ref:`AnimationRootNode`\ s are placed. Outputs the linear blend of the three adjacent animations using a :ref:`Vector2` weight. Adjacent in this context means the three :ref:`AnimationRootNode`\ s making up the triangle that contains the current value. You can add vertices to the blend space with :ref:`add_blend_point` and automatically triangulate it by setting :ref:`auto_triangles` to ``true``. Otherwise, use :ref:`add_triangle` and :ref:`remove_triangle` to triangulate the blend space by hand. @@ -426,7 +426,7 @@ Changes the :ref:`AnimationNode` referenced by the point at |void| **set_blend_point_position**\ (\ point\: :ref:`int`, pos\: :ref:`Vector2`\ ) :ref:`๐Ÿ”—` -Updates the position of the point at index ``point`` on the blend axis. +Updates the position of the point at index ``point`` in the blend space. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` diff --git a/classes/class_boneattachment3d.rst b/classes/class_boneattachment3d.rst index 5b5475a34a4..94b63075d7e 100644 --- a/classes/class_boneattachment3d.rst +++ b/classes/class_boneattachment3d.rst @@ -48,17 +48,19 @@ Methods .. table:: :widths: auto - +---------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`NodePath` | :ref:`get_external_skeleton`\ (\ ) |const| | - +---------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`get_use_external_skeleton`\ (\ ) |const| | - +---------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`on_skeleton_update`\ (\ ) | - +---------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`set_external_skeleton`\ (\ external_skeleton\: :ref:`NodePath`\ ) | - +---------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`set_use_external_skeleton`\ (\ use_external_skeleton\: :ref:`bool`\ ) | - +---------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`NodePath` | :ref:`get_external_skeleton`\ (\ ) |const| | + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Skeleton3D` | :ref:`get_skeleton`\ (\ ) | + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`get_use_external_skeleton`\ (\ ) |const| | + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`on_skeleton_update`\ (\ ) | + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_external_skeleton`\ (\ external_skeleton\: :ref:`NodePath`\ ) | + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_use_external_skeleton`\ (\ use_external_skeleton\: :ref:`bool`\ ) | + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -139,6 +141,18 @@ Returns the :ref:`NodePath` to the external :ref:`Skeleton3D` **get_skeleton**\ (\ ) :ref:`๐Ÿ”—` + +Get parent or external :ref:`Skeleton3D` node if found. + +.. rst-class:: classref-item-separator + +---- + .. _class_BoneAttachment3D_method_get_use_external_skeleton: .. rst-class:: classref-method diff --git a/classes/class_classdb.rst b/classes/class_classdb.rst index 9c5b481cd22..eec74ca2073 100644 --- a/classes/class_classdb.rst +++ b/classes/class_classdb.rst @@ -52,8 +52,12 @@ Methods +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`class_get_property_default_value`\ (\ class\: :ref:`StringName`, property\: :ref:`StringName`\ ) |const| | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`StringName` | :ref:`class_get_property_getter`\ (\ class\: :ref:`StringName`, property\: :ref:`StringName`\ ) | + +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array`\[:ref:`Dictionary`\] | :ref:`class_get_property_list`\ (\ class\: :ref:`StringName`, no_inheritance\: :ref:`bool` = false\ ) |const| | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`StringName` | :ref:`class_get_property_setter`\ (\ class\: :ref:`StringName`, property\: :ref:`StringName`\ ) | + +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Dictionary` | :ref:`class_get_signal`\ (\ class\: :ref:`StringName`, signal\: :ref:`StringName`\ ) |const| | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array`\[:ref:`Dictionary`\] | :ref:`class_get_signal_list`\ (\ class\: :ref:`StringName`, no_inheritance\: :ref:`bool` = false\ ) |const| | @@ -226,6 +230,18 @@ Returns the default value of ``property`` of ``class`` or its ancestor classes. ---- +.. _class_ClassDB_method_class_get_property_getter: + +.. rst-class:: classref-method + +:ref:`StringName` **class_get_property_getter**\ (\ class\: :ref:`StringName`, property\: :ref:`StringName`\ ) :ref:`๐Ÿ”—` + +Returns the getter method name of ``property`` of ``class``. + +.. rst-class:: classref-item-separator + +---- + .. _class_ClassDB_method_class_get_property_list: .. rst-class:: classref-method @@ -238,6 +254,18 @@ Returns an array with all the properties of ``class`` or its ancestry if ``no_in ---- +.. _class_ClassDB_method_class_get_property_setter: + +.. rst-class:: classref-method + +:ref:`StringName` **class_get_property_setter**\ (\ class\: :ref:`StringName`, property\: :ref:`StringName`\ ) :ref:`๐Ÿ”—` + +Returns the setter method name of ``property`` of ``class``. + +.. rst-class:: classref-item-separator + +---- + .. _class_ClassDB_method_class_get_signal: .. rst-class:: classref-method diff --git a/classes/class_compositor.rst b/classes/class_compositor.rst index ec0e40c519f..31533f286bf 100644 --- a/classes/class_compositor.rst +++ b/classes/class_compositor.rst @@ -23,6 +23,13 @@ Description The compositor resource stores attributes used to customize how a :ref:`Viewport` is rendered. +.. rst-class:: classref-introduction-group + +Tutorials +--------- + +- :doc:`The Compositor <../tutorials/rendering/compositor>` + .. rst-class:: classref-reftable-group Properties diff --git a/classes/class_compositoreffect.rst b/classes/class_compositoreffect.rst index 9c644ec5d53..a72da698208 100644 --- a/classes/class_compositoreffect.rst +++ b/classes/class_compositoreffect.rst @@ -23,6 +23,13 @@ Description This resource defines a custom rendering effect that can be applied to :ref:`Viewport`\ s through the viewports' :ref:`Environment`. You can implement a callback that is called during rendering at a given stage of the rendering pipeline and allows you to insert additional passes. Note that this callback happens on the rendering thread. CompositorEffect is an abstract base class and must be extended to implement specific rendering logic. +.. rst-class:: classref-introduction-group + +Tutorials +--------- + +- :doc:`The Compositor <../tutorials/rendering/compositor>` + .. rst-class:: classref-reftable-group Properties diff --git a/classes/class_csgshape3d.rst b/classes/class_csgshape3d.rst index 315f161d6af..60e72560517 100644 --- a/classes/class_csgshape3d.rst +++ b/classes/class_csgshape3d.rst @@ -23,7 +23,15 @@ Description This is the CSG base class that provides CSG operation support to the various CSG nodes in Godot. -\ **Note:** CSG nodes are intended to be used for level prototyping. Creating CSG nodes has a significant CPU cost compared to creating a :ref:`MeshInstance3D` with a :ref:`PrimitiveMesh`. Moving a CSG node within another CSG node also has a significant CPU cost, so it should be avoided during gameplay. +\ **Performance:** CSG nodes are only intended for prototyping as they have a significant CPU performance cost. + +Consider baking final CSG operation results into static geometry that replaces the CSG nodes. + +Individual CSG root node results can be baked to nodes with static resources with the editor menu that appears when a CSG root node is selected. + +Individual CSG root nodes can also be baked to static resources with scripts by calling :ref:`bake_static_mesh` for the visual mesh or :ref:`bake_collision_shape` for the physics collision. + +Entire scenes of CSG nodes can be baked to static geometry and exported with the editor gltf scene exporter. .. rst-class:: classref-introduction-group @@ -64,19 +72,23 @@ Methods .. table:: :widths: auto - +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`get_collision_layer_value`\ (\ layer_number\: :ref:`int`\ ) |const| | - +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`get_collision_mask_value`\ (\ layer_number\: :ref:`int`\ ) |const| | - +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Array` | :ref:`get_meshes`\ (\ ) |const| | - +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`is_root_shape`\ (\ ) |const| | - +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`set_collision_layer_value`\ (\ layer_number\: :ref:`int`, value\: :ref:`bool`\ ) | - +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`set_collision_mask_value`\ (\ layer_number\: :ref:`int`, value\: :ref:`bool`\ ) | - +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`ConcavePolygonShape3D` | :ref:`bake_collision_shape`\ (\ ) | + +-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`ArrayMesh` | :ref:`bake_static_mesh`\ (\ ) | + +-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`get_collision_layer_value`\ (\ layer_number\: :ref:`int`\ ) |const| | + +-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`get_collision_mask_value`\ (\ layer_number\: :ref:`int`\ ) |const| | + +-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Array` | :ref:`get_meshes`\ (\ ) |const| | + +-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_root_shape`\ (\ ) |const| | + +-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_collision_layer_value`\ (\ layer_number\: :ref:`int`, value\: :ref:`bool`\ ) | + +-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_collision_mask_value`\ (\ layer_number\: :ref:`int`, value\: :ref:`bool`\ ) | + +-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -254,6 +266,32 @@ Adds a collision shape to the physics engine for our CSG shape. This will always Method Descriptions ------------------- +.. _class_CSGShape3D_method_bake_collision_shape: + +.. rst-class:: classref-method + +:ref:`ConcavePolygonShape3D` **bake_collision_shape**\ (\ ) :ref:`๐Ÿ”—` + +Returns a baked physics :ref:`ConcavePolygonShape3D` of this node's CSG operation result. Returns an empty shape if the node is not a CSG root node or has no valid geometry. + +\ **Performance:** If the CSG operation results in a very detailed geometry with many faces physics performance will be very slow. Concave shapes should in general only be used for static level geometry and not with dynamic objects that are moving. + +.. rst-class:: classref-item-separator + +---- + +.. _class_CSGShape3D_method_bake_static_mesh: + +.. rst-class:: classref-method + +:ref:`ArrayMesh` **bake_static_mesh**\ (\ ) :ref:`๐Ÿ”—` + +Returns a baked static :ref:`ArrayMesh` of this node's CSG operation result. Materials from involved CSG nodes are added as extra mesh surfaces. Returns an empty mesh if the node is not a CSG root node or has no valid geometry. + +.. rst-class:: classref-item-separator + +---- + .. _class_CSGShape3D_method_get_collision_layer_value: .. rst-class:: classref-method diff --git a/classes/class_curve2d.rst b/classes/class_curve2d.rst index fda17462067..599fb5a8443 100644 --- a/classes/class_curve2d.rst +++ b/classes/class_curve2d.rst @@ -265,7 +265,7 @@ Deletes the point ``idx`` from the curve. Sends an error to the console if ``idx :ref:`Vector2` **sample**\ (\ idx\: :ref:`int`, t\: :ref:`float`\ ) |const| :ref:`๐Ÿ”—` -Returns the position between the vertex ``idx`` and the vertex ``idx + 1``, where ``t`` controls if the point is the first vertex (``t = 0.0``), the last vertex (``t = 1.0``), or in between. Values of ``t`` outside the range (``0.0 >= t <=1``) give strange, but predictable results. +Returns the position between the vertex ``idx`` and the vertex ``idx + 1``, where ``t`` controls if the point is the first vertex (``t = 0.0``), the last vertex (``t = 1.0``), or in between. Values of ``t`` outside the range (``0.0 <= t <= 1.0``) give strange, but predictable results. If ``idx`` is out of bounds it is truncated to the first or last vertex, and ``t`` is ignored. If the curve has no points, the function sends an error to the console, and returns ``(0, 0)``. diff --git a/classes/class_editorsettings.rst b/classes/class_editorsettings.rst index 0a147646091..46ebaf4dacc 100644 --- a/classes/class_editorsettings.rst +++ b/classes/class_editorsettings.rst @@ -337,6 +337,8 @@ Properties +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`interface/editor/expand_to_title` | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`interface/editor/font_allow_msdf` | + +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`interface/editor/font_antialiasing` | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`interface/editor/font_disable_embedded_bitmaps` | @@ -1289,7 +1291,7 @@ The grid size in units. Higher values prevent the grid from appearing "cut off" :ref:`bool` **editors/3d/grid_xy_plane** :ref:`๐Ÿ”—` -If ``true``, render the grid on an XY plane. This can be useful for 3D side-scrolling games. +If ``true``, renders the grid on the XY plane in perspective view. This can be useful for 3D side-scrolling games. .. rst-class:: classref-item-separator @@ -1301,7 +1303,7 @@ If ``true``, render the grid on an XY plane. This can be useful for 3D side-scro :ref:`bool` **editors/3d/grid_xz_plane** :ref:`๐Ÿ”—` -If ``true``, render the grid on an XZ plane. +If ``true``, renders the grid on the XZ plane in perspective view. .. rst-class:: classref-item-separator @@ -1313,7 +1315,7 @@ If ``true``, render the grid on an XZ plane. :ref:`bool` **editors/3d/grid_yz_plane** :ref:`๐Ÿ”—` -If ``true``, render the grid on a YZ plane. This can be useful for 3D side-scrolling games. +If ``true``, renders the grid on the YZ plane in perspective view. This can be useful for 3D side-scrolling games. .. rst-class:: classref-item-separator @@ -2575,6 +2577,18 @@ Specific to the macOS platform. ---- +.. _class_EditorSettings_property_interface/editor/font_allow_msdf: + +.. rst-class:: classref-property + +:ref:`bool` **interface/editor/font_allow_msdf** :ref:`๐Ÿ”—` + +If set to ``true``, MSDF font rendering will be used for the visual shader graph editor. You may need to set this to ``false`` when using a custom main font, as some fonts will look broken due to the use of self-intersecting outlines in their font data. Downloading the font from the font maker's official website as opposed to a service like Google Fonts can help resolve this issue. + +.. rst-class:: classref-item-separator + +---- + .. _class_EditorSettings_property_interface/editor/font_antialiasing: .. rst-class:: classref-property diff --git a/classes/class_editorsyntaxhighlighter.rst b/classes/class_editorsyntaxhighlighter.rst index 27f6bc9de21..0fc9fb80429 100644 --- a/classes/class_editorsyntaxhighlighter.rst +++ b/classes/class_editorsyntaxhighlighter.rst @@ -12,6 +12,8 @@ EditorSyntaxHighlighter **Inherits:** :ref:`SyntaxHighlighter` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` +**Inherited By:** :ref:`GDScriptSyntaxHighlighter` + Base class for :ref:`SyntaxHighlighter` used by the :ref:`ScriptEditor`. .. rst-class:: classref-introduction-group diff --git a/classes/class_gdscriptsyntaxhighlighter.rst b/classes/class_gdscriptsyntaxhighlighter.rst new file mode 100644 index 00000000000..d49f2b44fcb --- /dev/null +++ b/classes/class_gdscriptsyntaxhighlighter.rst @@ -0,0 +1,48 @@ +:github_url: hide + +.. DO NOT EDIT THIS FILE!!! +.. Generated automatically from Godot engine sources. +.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. +.. XML source: https://github.com/godotengine/godot/tree/master/modules/gdscript/doc_classes/GDScriptSyntaxHighlighter.xml. + +.. _class_GDScriptSyntaxHighlighter: + +GDScriptSyntaxHighlighter +========================= + +**Inherits:** :ref:`EditorSyntaxHighlighter` **<** :ref:`SyntaxHighlighter` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` + +A GDScript syntax highlighter that can be used with :ref:`TextEdit` and :ref:`CodeEdit` nodes. + +.. rst-class:: classref-introduction-group + +Description +----------- + +**Note:** This class can only be used for editor plugins because it relies on editor settings. + + +.. tabs:: + + .. code-tab:: gdscript + + var code_preview = TextEdit.new() + var highlighter = GDScriptSyntaxHighlighter.new() + code_preview.syntax_highlighter = highlighter + + .. code-tab:: csharp + + var codePreview = new TextEdit(); + var highlighter = new GDScriptSyntaxHighlighter(); + codePreview.SyntaxHighlighter = highlighter; + + + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` +.. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` +.. |void| replace:: :abbr:`void (No return value.)` diff --git a/classes/class_geometry2d.rst b/classes/class_geometry2d.rst index dc692e09d7a..023e8858327 100644 --- a/classes/class_geometry2d.rst +++ b/classes/class_geometry2d.rst @@ -387,9 +387,40 @@ Returns ``true`` if ``polygon``'s vertices are ordered in clockwise order, other :ref:`Variant` **line_intersects_line**\ (\ from_a\: :ref:`Vector2`, dir_a\: :ref:`Vector2`, from_b\: :ref:`Vector2`, dir_b\: :ref:`Vector2`\ ) :ref:`๐Ÿ”—` -Checks if the two lines (``from_a``, ``dir_a``) and (``from_b``, ``dir_b``) intersect. If yes, return the point of intersection as :ref:`Vector2`. If no intersection takes place, returns ``null``. +Returns the point of intersection between the two lines (``from_a``, ``dir_a``) and (``from_b``, ``dir_b``). Returns a :ref:`Vector2`, or ``null`` if the lines are parallel. + +\ ``from`` and ``dir`` are *not* endpoints of a line segment or ray but the slope (``dir``) and a known point (``from``) on that line. + + +.. tabs:: + + .. code-tab:: gdscript + + var from_a = Vector2.ZERO + var dir_a = Vector2.RIGHT + var from_b = Vector2.DOWN + + # Returns Vector2(1, 0) + Geometry2D.line_intersects_line(from_a, dir_a, from_b, Vector2(1, -1)) + # Returns Vector2(-1, 0) + Geometry2D.line_intersects_line(from_a, dir_a, from_b, Vector2(-1, -1)) + # Returns null + Geometry2D.line_intersects_line(from_a, dir_a, from_b, Vector2.RIGHT) + + .. code-tab:: csharp + + var fromA = Vector2.Zero; + var dirA = Vector2.Right; + var fromB = Vector2.Down; + + // Returns new Vector2(1, 0) + Geometry2D.LineIntersectsLine(fromA, dirA, fromB, new Vector2(1, -1)); + // Returns new Vector2(-1, 0) + Geometry2D.LineIntersectsLine(fromA, dirA, fromB, new Vector2(-1, -1)); + // Returns null + Geometry2D.LineIntersectsLine(fromA, dirA, fromB, Vector2.Right); + -\ **Note:** The lines are specified using direction vectors, not end points. .. rst-class:: classref-item-separator diff --git a/classes/class_gltfaccessor.rst b/classes/class_gltfaccessor.rst index d3febd05a38..dc3b57eba93 100644 --- a/classes/class_gltfaccessor.rst +++ b/classes/class_gltfaccessor.rst @@ -12,16 +12,16 @@ GLTFAccessor **Inherits:** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` -Represents a GLTF accessor. +Represents a glTF accessor. .. rst-class:: classref-introduction-group Description ----------- -GLTFAccessor is a data structure representing GLTF a ``accessor`` that would be found in the ``"accessors"`` array. A buffer is a blob of binary data. A buffer view is a slice of a buffer. An accessor is a typed interpretation of the data in a buffer view. +GLTFAccessor is a data structure representing a glTF ``accessor`` that would be found in the ``"accessors"`` array. A buffer is a blob of binary data. A buffer view is a slice of a buffer. An accessor is a typed interpretation of the data in a buffer view. -Most custom data stored in GLTF does not need accessors, only buffer views (see :ref:`GLTFBufferView`). Accessors are for more advanced use cases such as interleaved mesh data encoded for the GPU. +Most custom data stored in glTF does not need accessors, only buffer views (see :ref:`GLTFBufferView`). Accessors are for more advanced use cases such as interleaved mesh data encoded for the GPU. .. rst-class:: classref-introduction-group @@ -163,7 +163,7 @@ Property Descriptions - |void| **set_accessor_type**\ (\ value\: :ref:`GLTFAccessorType`\ ) - :ref:`GLTFAccessorType` **get_accessor_type**\ (\ ) -The GLTF accessor type as an enum. Possible values are 0 for "SCALAR", 1 for "VEC2", 2 for "VEC3", 3 for "VEC4", 4 for "MAT2", 5 for "MAT3", and 6 for "MAT4". +The glTF accessor type as an enum. Possible values are 0 for "SCALAR", 1 for "VEC2", 2 for "VEC3", 3 for "VEC4", 4 for "MAT2", 5 for "MAT3", and 6 for "MAT4". .. rst-class:: classref-item-separator @@ -214,7 +214,7 @@ The offset relative to the start of the buffer view in bytes. - |void| **set_component_type**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_component_type**\ (\ ) -The GLTF component type as an enum. Possible values are 5120 for "BYTE", 5121 for "UNSIGNED_BYTE", 5122 for "SHORT", 5123 for "UNSIGNED_SHORT", 5125 for "UNSIGNED_INT", and 5126 for "FLOAT". A value of 5125 or "UNSIGNED_INT" must not be used for any accessor that is not referenced by mesh.primitive.indices. +The glTF component type as an enum. Possible values are 5120 for "BYTE", 5121 for "UNSIGNED_BYTE", 5122 for "SHORT", 5123 for "UNSIGNED_SHORT", 5125 for "UNSIGNED_INT", and 5126 for "FLOAT". A value of 5125 or "UNSIGNED_INT" must not be used for any accessor that is not referenced by mesh.primitive.indices. .. rst-class:: classref-item-separator @@ -403,7 +403,7 @@ The offset relative to the start of the bufferView in bytes. **Deprecated:** Use :ref:`accessor_type` instead. -The GLTF accessor type as an enum. Use :ref:`accessor_type` instead. +The glTF accessor type as an enum. Use :ref:`accessor_type` instead. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` diff --git a/classes/class_gltfanimation.rst b/classes/class_gltfanimation.rst index fd6195bdee6..1b5b651824b 100644 --- a/classes/class_gltfanimation.rst +++ b/classes/class_gltfanimation.rst @@ -109,7 +109,7 @@ Method Descriptions Gets additional arbitrary data in this **GLTFAnimation** instance. This can be used to keep per-node state data in :ref:`GLTFDocumentExtension` classes, which is important because they are stateless. -The argument should be the :ref:`GLTFDocumentExtension` name (does not have to match the extension name in the GLTF file), and the return value can be anything you set. If nothing was set, the return value is null. +The argument should be the :ref:`GLTFDocumentExtension` name (does not have to match the extension name in the glTF file), and the return value can be anything you set. If nothing was set, the return value is null. .. rst-class:: classref-item-separator @@ -123,7 +123,7 @@ The argument should be the :ref:`GLTFDocumentExtension` classes, which is important because they are stateless. -The first argument should be the :ref:`GLTFDocumentExtension` name (does not have to match the extension name in the GLTF file), and the second argument can be anything you want. +The first argument should be the :ref:`GLTFDocumentExtension` name (does not have to match the extension name in the glTF file), and the second argument can be anything you want. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` diff --git a/classes/class_gltfbufferview.rst b/classes/class_gltfbufferview.rst index dc1f3c1cb81..2bc977316a4 100644 --- a/classes/class_gltfbufferview.rst +++ b/classes/class_gltfbufferview.rst @@ -12,14 +12,14 @@ GLTFBufferView **Inherits:** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` -Represents a GLTF buffer view. +Represents a glTF buffer view. .. rst-class:: classref-introduction-group Description ----------- -GLTFBufferView is a data structure representing GLTF a ``bufferView`` that would be found in the ``"bufferViews"`` array. A buffer is a blob of binary data. A buffer view is a slice of a buffer that can be used to identify and extract data from the buffer. +GLTFBufferView is a data structure representing a glTF ``bufferView`` that would be found in the ``"bufferViews"`` array. A buffer is a blob of binary data. A buffer view is a slice of a buffer that can be used to identify and extract data from the buffer. Most custom uses of buffers only need to use the :ref:`buffer`, :ref:`byte_length`, and :ref:`byte_offset`. The :ref:`byte_stride` and :ref:`indices` properties are for more advanced use cases such as interleaved mesh data encoded for the GPU. diff --git a/classes/class_gltfcamera.rst b/classes/class_gltfcamera.rst index 418bbfa1c25..b1eced242cc 100644 --- a/classes/class_gltfcamera.rst +++ b/classes/class_gltfcamera.rst @@ -12,14 +12,14 @@ GLTFCamera **Inherits:** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` -Represents a GLTF camera. +Represents a glTF camera. .. rst-class:: classref-introduction-group Description ----------- -Represents a camera as defined by the base GLTF spec. +Represents a camera as defined by the base glTF spec. .. rst-class:: classref-introduction-group @@ -28,9 +28,9 @@ Tutorials - :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>` -- `GLTF camera detailed specification `__ +- `glTF camera detailed specification `__ -- `GLTF camera spec and example file `__ +- `glTF camera spec and example file `__ .. rst-class:: classref-reftable-group @@ -90,7 +90,7 @@ Property Descriptions - |void| **set_depth_far**\ (\ value\: :ref:`float`\ ) - :ref:`float` **get_depth_far**\ (\ ) -The distance to the far culling boundary for this camera relative to its local Z axis, in meters. This maps to GLTF's ``zfar`` property. +The distance to the far culling boundary for this camera relative to its local Z axis, in meters. This maps to glTF's ``zfar`` property. .. rst-class:: classref-item-separator @@ -107,7 +107,7 @@ The distance to the far culling boundary for this camera relative to its local Z - |void| **set_depth_near**\ (\ value\: :ref:`float`\ ) - :ref:`float` **get_depth_near**\ (\ ) -The distance to the near culling boundary for this camera relative to its local Z axis, in meters. This maps to GLTF's ``znear`` property. +The distance to the near culling boundary for this camera relative to its local Z axis, in meters. This maps to glTF's ``znear`` property. .. rst-class:: classref-item-separator @@ -124,7 +124,7 @@ The distance to the near culling boundary for this camera relative to its local - |void| **set_fov**\ (\ value\: :ref:`float`\ ) - :ref:`float` **get_fov**\ (\ ) -The FOV of the camera. This class and GLTF define the camera FOV in radians, while Godot uses degrees. This maps to GLTF's ``yfov`` property. This value is only used for perspective cameras, when :ref:`perspective` is true. +The FOV of the camera. This class and glTF define the camera FOV in radians, while Godot uses degrees. This maps to glTF's ``yfov`` property. This value is only used for perspective cameras, when :ref:`perspective` is true. .. rst-class:: classref-item-separator @@ -141,7 +141,7 @@ The FOV of the camera. This class and GLTF define the camera FOV in radians, whi - |void| **set_perspective**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **get_perspective**\ (\ ) -Whether or not the camera is in perspective mode. If false, the camera is in orthographic/orthogonal mode. This maps to GLTF's camera ``type`` property. See :ref:`Camera3D.projection` and the GLTF spec for more information. +Whether or not the camera is in perspective mode. If false, the camera is in orthographic/orthogonal mode. This maps to glTF's camera ``type`` property. See :ref:`Camera3D.projection` and the glTF spec for more information. .. rst-class:: classref-item-separator @@ -158,7 +158,7 @@ Whether or not the camera is in perspective mode. If false, the camera is in ort - |void| **set_size_mag**\ (\ value\: :ref:`float`\ ) - :ref:`float` **get_size_mag**\ (\ ) -The size of the camera. This class and GLTF define the camera size magnitude as a radius in meters, while Godot defines it as a diameter in meters. This maps to GLTF's ``ymag`` property. This value is only used for orthographic/orthogonal cameras, when :ref:`perspective` is false. +The size of the camera. This class and glTF define the camera size magnitude as a radius in meters, while Godot defines it as a diameter in meters. This maps to glTF's ``ymag`` property. This value is only used for orthographic/orthogonal cameras, when :ref:`perspective` is false. .. rst-class:: classref-section-separator diff --git a/classes/class_gltfdocument.rst b/classes/class_gltfdocument.rst index f5d8a657bc0..40b2c1d392d 100644 --- a/classes/class_gltfdocument.rst +++ b/classes/class_gltfdocument.rst @@ -23,7 +23,7 @@ Description GLTFDocument supports reading data from a glTF file, buffer, or Godot scene. This data can then be written to the filesystem, buffer, or used to create a Godot scene. -All of the data in a GLTF scene is stored in the :ref:`GLTFState` class. GLTFDocument processes state objects, but does not contain any scene data itself. GLTFDocument has member variables to store export configuration settings such as the image format, but is otherwise stateless. Multiple scenes can be processed with the same settings using the same GLTFDocument object and different :ref:`GLTFState` objects. +All of the data in a glTF scene is stored in the :ref:`GLTFState` class. GLTFDocument processes state objects, but does not contain any scene data itself. GLTFDocument has member variables to store export configuration settings such as the image format, but is otherwise stateless. Multiple scenes can be processed with the same settings using the same GLTFDocument object and different :ref:`GLTFState` objects. GLTFDocument can be extended with arbitrary functionality by extending the :ref:`GLTFDocumentExtension` class and registering it with GLTFDocument via :ref:`register_gltf_document_extension`. This allows for custom data to be imported and exported. @@ -139,7 +139,7 @@ Property Descriptions - |void| **set_image_format**\ (\ value\: :ref:`String`\ ) - :ref:`String` **get_image_format**\ (\ ) -The user-friendly name of the export image format. This is used when exporting the GLTF file, including writing to a file and writing to a byte array. +The user-friendly name of the export image format. This is used when exporting the glTF file, including writing to a file and writing to a byte array. By default, Godot allows the following options: "None", "PNG", "JPEG", "Lossless WebP", and "Lossy WebP". Support for more image formats can be added in :ref:`GLTFDocumentExtension` classes. @@ -194,7 +194,7 @@ Method Descriptions :ref:`Error` **append_from_buffer**\ (\ bytes\: :ref:`PackedByteArray`, base_path\: :ref:`String`, state\: :ref:`GLTFState`, flags\: :ref:`int` = 0\ ) :ref:`๐Ÿ”—` -Takes a :ref:`PackedByteArray` defining a GLTF and imports the data to the given :ref:`GLTFState` object through the ``state`` parameter. +Takes a :ref:`PackedByteArray` defining a glTF and imports the data to the given :ref:`GLTFState` object through the ``state`` parameter. \ **Note:** The ``base_path`` tells :ref:`append_from_buffer` where to find dependencies and can be empty. @@ -208,7 +208,7 @@ Takes a :ref:`PackedByteArray` defining a GLTF and import :ref:`Error` **append_from_file**\ (\ path\: :ref:`String`, state\: :ref:`GLTFState`, flags\: :ref:`int` = 0, base_path\: :ref:`String` = ""\ ) :ref:`๐Ÿ”—` -Takes a path to a GLTF file and imports the data at that file path to the given :ref:`GLTFState` object through the ``state`` parameter. +Takes a path to a glTF file and imports the data at that file path to the given :ref:`GLTFState` object through the ``state`` parameter. \ **Note:** The ``base_path`` tells :ref:`append_from_file` where to find dependencies and can be empty. @@ -234,7 +234,7 @@ Takes a Godot Engine scene node and exports it and its descendants to the given :ref:`PackedByteArray` **generate_buffer**\ (\ state\: :ref:`GLTFState`\ ) :ref:`๐Ÿ”—` -Takes a :ref:`GLTFState` object through the ``state`` parameter and returns a GLTF :ref:`PackedByteArray`. +Takes a :ref:`GLTFState` object through the ``state`` parameter and returns a glTF :ref:`PackedByteArray`. .. rst-class:: classref-item-separator diff --git a/classes/class_gltfdocumentextension.rst b/classes/class_gltfdocumentextension.rst index 9daad61f3f2..8e846284b76 100644 --- a/classes/class_gltfdocumentextension.rst +++ b/classes/class_gltfdocumentextension.rst @@ -21,7 +21,7 @@ GLTFDocumentExtension Description ----------- -Extends the functionality of the :ref:`GLTFDocument` class by allowing you to run arbitrary code at various stages of GLTF import or export. +Extends the functionality of the :ref:`GLTFDocument` class by allowing you to run arbitrary code at various stages of glTF import or export. To use, make a new class extending GLTFDocumentExtension, override any methods you need, make an instance of your class, and register it using :ref:`GLTFDocument.register_gltf_document_extension`. @@ -113,7 +113,7 @@ Runs when converting the data from a Godot scene node. This method can be used t Part of the export process. This method is run after :ref:`_get_saveable_image_formats` and before :ref:`_export_post`. If this **GLTFDocumentExtension** is used for exporting images, this runs after :ref:`_serialize_texture_json`. -This method can be used to modify the final JSON of each node. Data should be primarily stored in ``gltf_node`` prior to serializing the JSON, but the original Godot ``node`` is also provided if available. The node may be null if not available, such as when exporting GLTF data not generated from a Godot scene. +This method can be used to modify the final JSON of each node. Data should be primarily stored in ``gltf_node`` prior to serializing the JSON, but the original Godot ``node`` is also provided if available. The node may be null if not available, such as when exporting glTF data not generated from a Godot scene. .. rst-class:: classref-item-separator @@ -127,7 +127,7 @@ This method can be used to modify the final JSON of each node. Data should be pr Part of the export process. This method is run last, after all other parts of the export process. -This method can be used to modify the final JSON of the generated GLTF file. +This method can be used to modify the final JSON of the generated glTF file. .. rst-class:: classref-item-separator @@ -141,7 +141,7 @@ This method can be used to modify the final JSON of the generated GLTF file. Part of the export process. This method is run first, before all other parts of the export process. -The return value is used to determine if this **GLTFDocumentExtension** instance should be used for exporting a given GLTF file. If :ref:`@GlobalScope.OK`, the export will use this **GLTFDocumentExtension** instance. If not overridden, :ref:`@GlobalScope.OK` is returned. +The return value is used to determine if this **GLTFDocumentExtension** instance should be used for exporting a given glTF file. If :ref:`@GlobalScope.OK`, the export will use this **GLTFDocumentExtension** instance. If not overridden, :ref:`@GlobalScope.OK` is returned. .. rst-class:: classref-item-separator @@ -211,7 +211,7 @@ Returns an array of the image formats that can be saved/exported by this extensi Part of the import process. This method is run after :ref:`_import_preflight` and before :ref:`_parse_node_extensions`. -Returns an array of the GLTF extensions supported by this GLTFDocumentExtension class. This is used to validate if a GLTF file with required extensions can be loaded. +Returns an array of the glTF extensions supported by this GLTFDocumentExtension class. This is used to validate if a glTF file with required extensions can be loaded. .. rst-class:: classref-item-separator @@ -267,7 +267,7 @@ This method can be used to modify any of the data imported so far after parsing, Part of the import process. This method is run first, before all other parts of the import process. -The return value is used to determine if this **GLTFDocumentExtension** instance should be used for importing a given GLTF file. If :ref:`@GlobalScope.OK`, the import will use this **GLTFDocumentExtension** instance. If not overridden, :ref:`@GlobalScope.OK` is returned. +The return value is used to determine if this **GLTFDocumentExtension** instance should be used for importing a given glTF file. If :ref:`@GlobalScope.OK`, the import will use this **GLTFDocumentExtension** instance. If not overridden, :ref:`@GlobalScope.OK` is returned. .. rst-class:: classref-item-separator @@ -281,7 +281,7 @@ The return value is used to determine if this **GLTFDocumentExtension** instance Part of the import process. This method is run after :ref:`_parse_node_extensions` and before :ref:`_parse_texture_json`. -Runs when parsing image data from a GLTF file. The data could be sourced from a separate file, a URI, or a buffer, and then is passed as a byte array. +Runs when parsing image data from a glTF file. The data could be sourced from a separate file, a URI, or a buffer, and then is passed as a byte array. .. rst-class:: classref-item-separator @@ -309,7 +309,7 @@ Runs when parsing the node extensions of a GLTFNode. This method can be used to Part of the import process. This method is run after :ref:`_parse_image_data` and before :ref:`_generate_scene_node`. -Runs when parsing the texture JSON from the GLTF textures array. This can be used to set the source image index to use as the texture. +Runs when parsing the texture JSON from the glTF textures array. This can be used to set the source image index to use as the texture. .. rst-class:: classref-item-separator @@ -323,7 +323,7 @@ Runs when parsing the texture JSON from the GLTF textures array. This can be use Part of the export process. This method is run after :ref:`_get_saveable_image_formats` and before :ref:`_serialize_texture_json`. -This method is run when saving images separately from the GLTF file. When images are embedded, :ref:`_serialize_image_to_bytes` runs instead. Note that these methods only run when this **GLTFDocumentExtension** is selected as the image exporter. +This method is run when saving images separately from the glTF file. When images are embedded, :ref:`_serialize_image_to_bytes` runs instead. Note that these methods only run when this **GLTFDocumentExtension** is selected as the image exporter. .. rst-class:: classref-item-separator @@ -337,7 +337,7 @@ This method is run when saving images separately from the GLTF file. When images Part of the export process. This method is run after :ref:`_get_saveable_image_formats` and before :ref:`_serialize_texture_json`. -This method is run when embedding images in the GLTF file. When images are saved separately, :ref:`_save_image_at_path` runs instead. Note that these methods only run when this **GLTFDocumentExtension** is selected as the image exporter. +This method is run when embedding images in the glTF file. When images are saved separately, :ref:`_save_image_at_path` runs instead. Note that these methods only run when this **GLTFDocumentExtension** is selected as the image exporter. This method must set the image MIME type in the ``image_dict`` with the ``"mimeType"`` key. For example, for a PNG image, it would be set to ``"image/png"``. The return value must be a :ref:`PackedByteArray` containing the image data. diff --git a/classes/class_gltflight.rst b/classes/class_gltflight.rst index d92a7c3a890..f9c74903bc1 100644 --- a/classes/class_gltflight.rst +++ b/classes/class_gltflight.rst @@ -12,14 +12,14 @@ GLTFLight **Inherits:** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` -Represents a GLTF light. +Represents a glTF light. .. rst-class:: classref-introduction-group Description ----------- -Represents a light as defined by the ``KHR_lights_punctual`` GLTF extension. +Represents a light as defined by the ``KHR_lights_punctual`` glTF extension. .. rst-class:: classref-introduction-group @@ -28,7 +28,7 @@ Tutorials - :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>` -- `KHR_lights_punctual GLTF extension spec `__ +- `KHR_lights_punctual glTF extension spec `__ .. rst-class:: classref-reftable-group @@ -183,7 +183,7 @@ At this angle, the light drops off to zero brightness. Between the inner and out - |void| **set_range**\ (\ value\: :ref:`float`\ ) - :ref:`float` **get_range**\ (\ ) -The range of the light, beyond which the light has no effect. GLTF lights with no range defined behave like physical lights (which have infinite range). When creating a Godot light, the range is clamped to 4096. +The range of the light, beyond which the light has no effect. glTF lights with no range defined behave like physical lights (which have infinite range). When creating a Godot light, the range is clamped to 4096. .. rst-class:: classref-section-separator diff --git a/classes/class_gltfmesh.rst b/classes/class_gltfmesh.rst index 1003478aa10..d56c474eec9 100644 --- a/classes/class_gltfmesh.rst +++ b/classes/class_gltfmesh.rst @@ -12,14 +12,14 @@ GLTFMesh **Inherits:** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` -GLTFMesh represents a GLTF mesh. +GLTFMesh represents a glTF mesh. .. rst-class:: classref-introduction-group Description ----------- -GLTFMesh handles 3D mesh data imported from GLTF files. It includes properties for blend channels, blend weights, instance materials, and the mesh itself. +GLTFMesh handles 3D mesh data imported from glTF files. It includes properties for blend channels, blend weights, instance materials, and the mesh itself. .. rst-class:: classref-introduction-group @@ -152,7 +152,7 @@ Method Descriptions Gets additional arbitrary data in this **GLTFMesh** instance. This can be used to keep per-node state data in :ref:`GLTFDocumentExtension` classes, which is important because they are stateless. -The argument should be the :ref:`GLTFDocumentExtension` name (does not have to match the extension name in the GLTF file), and the return value can be anything you set. If nothing was set, the return value is null. +The argument should be the :ref:`GLTFDocumentExtension` name (does not have to match the extension name in the glTF file), and the return value can be anything you set. If nothing was set, the return value is null. .. rst-class:: classref-item-separator @@ -166,7 +166,7 @@ The argument should be the :ref:`GLTFDocumentExtension` classes, which is important because they are stateless. -The first argument should be the :ref:`GLTFDocumentExtension` name (does not have to match the extension name in the GLTF file), and the second argument can be anything you want. +The first argument should be the :ref:`GLTFDocumentExtension` name (does not have to match the extension name in the glTF file), and the second argument can be anything you want. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` diff --git a/classes/class_gltfnode.rst b/classes/class_gltfnode.rst index dde695d27d3..77459360253 100644 --- a/classes/class_gltfnode.rst +++ b/classes/class_gltfnode.rst @@ -12,16 +12,16 @@ GLTFNode **Inherits:** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` -GLTF node class. +glTF node class. .. rst-class:: classref-introduction-group Description ----------- -Represents a GLTF node. GLTF nodes may have names, transforms, children (other GLTF nodes), and more specialized properties (represented by their own classes). +Represents a glTF node. glTF nodes may have names, transforms, children (other glTF nodes), and more specialized properties (represented by their own classes). -GLTF nodes generally exist inside of :ref:`GLTFState` which represents all data of a GLTF file. Most of GLTFNode's properties are indices of other data in the GLTF file. You can extend a GLTF node with additional properties by using :ref:`get_additional_data` and :ref:`set_additional_data`. +glTF nodes generally exist inside of :ref:`GLTFState` which represents all data of a glTF file. Most of GLTFNode's properties are indices of other data in the glTF file. You can extend a glTF node with additional properties by using :ref:`get_additional_data` and :ref:`set_additional_data`. .. rst-class:: classref-introduction-group @@ -30,7 +30,7 @@ Tutorials - :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>` -- `GLTF scene and node spec `__ +- `glTF scene and node spec `__ .. rst-class:: classref-reftable-group @@ -102,7 +102,7 @@ Property Descriptions - |void| **set_camera**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_camera**\ (\ ) -If this GLTF node is a camera, the index of the :ref:`GLTFCamera` in the :ref:`GLTFState` that describes the camera's properties. If -1, this node is not a camera. +If this glTF node is a camera, the index of the :ref:`GLTFCamera` in the :ref:`GLTFState` that describes the camera's properties. If -1, this node is not a camera. .. rst-class:: classref-item-separator @@ -119,7 +119,7 @@ If this GLTF node is a camera, the index of the :ref:`GLTFCamera`\ ) - :ref:`PackedInt32Array` **get_children**\ (\ ) -The indices of the child nodes in the :ref:`GLTFState`. If this GLTF node has no children, this will be an empty array. +The indices of the child nodes in the :ref:`GLTFState`. If this glTF node has no children, this will be an empty array. **Note:** The returned array is *copied* and any changes to it will not update the original property value. See :ref:`PackedInt32Array` for more details. @@ -155,7 +155,7 @@ How deep into the node hierarchy this node is. A root node will have a height of - |void| **set_light**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_light**\ (\ ) -If this GLTF node is a light, the index of the :ref:`GLTFLight` in the :ref:`GLTFState` that describes the light's properties. If -1, this node is not a light. +If this glTF node is a light, the index of the :ref:`GLTFLight` in the :ref:`GLTFState` that describes the light's properties. If -1, this node is not a light. .. rst-class:: classref-item-separator @@ -172,7 +172,7 @@ If this GLTF node is a light, the index of the :ref:`GLTFLight` - |void| **set_mesh**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_mesh**\ (\ ) -If this GLTF node is a mesh, the index of the :ref:`GLTFMesh` in the :ref:`GLTFState` that describes the mesh's properties. If -1, this node is not a mesh. +If this glTF node is a mesh, the index of the :ref:`GLTFMesh` in the :ref:`GLTFState` that describes the mesh's properties. If -1, this node is not a mesh. .. rst-class:: classref-item-separator @@ -223,7 +223,7 @@ The index of the parent node in the :ref:`GLTFState`. If -1, th - |void| **set_position**\ (\ value\: :ref:`Vector3`\ ) - :ref:`Vector3` **get_position**\ (\ ) -The position of the GLTF node relative to its parent. +The position of the glTF node relative to its parent. .. rst-class:: classref-item-separator @@ -240,7 +240,7 @@ The position of the GLTF node relative to its parent. - |void| **set_rotation**\ (\ value\: :ref:`Quaternion`\ ) - :ref:`Quaternion` **get_rotation**\ (\ ) -The rotation of the GLTF node relative to its parent. +The rotation of the glTF node relative to its parent. .. rst-class:: classref-item-separator @@ -257,7 +257,7 @@ The rotation of the GLTF node relative to its parent. - |void| **set_scale**\ (\ value\: :ref:`Vector3`\ ) - :ref:`Vector3` **get_scale**\ (\ ) -The scale of the GLTF node relative to its parent. +The scale of the glTF node relative to its parent. .. rst-class:: classref-item-separator @@ -274,7 +274,7 @@ The scale of the GLTF node relative to its parent. - |void| **set_skeleton**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_skeleton**\ (\ ) -If this GLTF node has a skeleton, the index of the :ref:`GLTFSkeleton` in the :ref:`GLTFState` that describes the skeleton's properties. If -1, this node does not have a skeleton. +If this glTF node has a skeleton, the index of the :ref:`GLTFSkeleton` in the :ref:`GLTFState` that describes the skeleton's properties. If -1, this node does not have a skeleton. .. rst-class:: classref-item-separator @@ -291,7 +291,7 @@ If this GLTF node has a skeleton, the index of the :ref:`GLTFSkeleton`\ ) - :ref:`int` **get_skin**\ (\ ) -If this GLTF node has a skin, the index of the :ref:`GLTFSkin` in the :ref:`GLTFState` that describes the skin's properties. If -1, this node does not have a skin. +If this glTF node has a skin, the index of the :ref:`GLTFSkin` in the :ref:`GLTFState` that describes the skin's properties. If -1, this node does not have a skin. .. rst-class:: classref-item-separator @@ -308,7 +308,7 @@ If this GLTF node has a skin, the index of the :ref:`GLTFSkin` i - |void| **set_xform**\ (\ value\: :ref:`Transform3D`\ ) - :ref:`Transform3D` **get_xform**\ (\ ) -The transform of the GLTF node relative to its parent. This property is usually unused since the position, rotation, and scale properties are preferred. +The transform of the glTF node relative to its parent. This property is usually unused since the position, rotation, and scale properties are preferred. .. rst-class:: classref-section-separator @@ -327,7 +327,7 @@ Method Descriptions Gets additional arbitrary data in this **GLTFNode** instance. This can be used to keep per-node state data in :ref:`GLTFDocumentExtension` classes, which is important because they are stateless. -The argument should be the :ref:`GLTFDocumentExtension` name (does not have to match the extension name in the GLTF file), and the return value can be anything you set. If nothing was set, the return value is null. +The argument should be the :ref:`GLTFDocumentExtension` name (does not have to match the extension name in the glTF file), and the return value can be anything you set. If nothing was set, the return value is null. .. rst-class:: classref-item-separator @@ -341,7 +341,7 @@ The argument should be the :ref:`GLTFDocumentExtension` classes, which is important because they are stateless. -The first argument should be the :ref:`GLTFDocumentExtension` name (does not have to match the extension name in the GLTF file), and the second argument can be anything you want. +The first argument should be the :ref:`GLTFDocumentExtension` name (does not have to match the extension name in the glTF file), and the second argument can be anything you want. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` diff --git a/classes/class_gltfphysicsbody.rst b/classes/class_gltfphysicsbody.rst index 4eb9962f904..e2879a47810 100644 --- a/classes/class_gltfphysicsbody.rst +++ b/classes/class_gltfphysicsbody.rst @@ -12,14 +12,14 @@ GLTFPhysicsBody **Inherits:** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` -Represents a GLTF physics body. +Represents a glTF physics body. .. rst-class:: classref-introduction-group Description ----------- -Represents a physics body as an intermediary between the ``OMI_physics_body`` GLTF data and Godot's nodes, and it's abstracted in a way that allows adding support for different GLTF physics extensions in the future. +Represents a physics body as an intermediary between the ``OMI_physics_body`` glTF data and Godot's nodes, and it's abstracted in a way that allows adding support for different glTF physics extensions in the future. .. rst-class:: classref-introduction-group @@ -28,7 +28,7 @@ Tutorials - :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>` -- `OMI_physics_body GLTF extension `__ +- `OMI_physics_body glTF extension `__ .. rst-class:: classref-reftable-group @@ -236,7 +236,7 @@ Method Descriptions :ref:`GLTFPhysicsBody` **from_dictionary**\ (\ dictionary\: :ref:`Dictionary`\ ) |static| :ref:`๐Ÿ”—` -Creates a new GLTFPhysicsBody instance by parsing the given :ref:`Dictionary` in the ``OMI_physics_body`` GLTF extension format. +Creates a new GLTFPhysicsBody instance by parsing the given :ref:`Dictionary` in the ``OMI_physics_body`` glTF extension format. .. rst-class:: classref-item-separator @@ -260,7 +260,7 @@ Creates a new GLTFPhysicsBody instance from the given Godot :ref:`CollisionObjec :ref:`Dictionary` **to_dictionary**\ (\ ) |const| :ref:`๐Ÿ”—` -Serializes this GLTFPhysicsBody instance into a :ref:`Dictionary`. It will be in the format expected by the ``OMI_physics_body`` GLTF extension. +Serializes this GLTFPhysicsBody instance into a :ref:`Dictionary`. It will be in the format expected by the ``OMI_physics_body`` glTF extension. .. rst-class:: classref-item-separator diff --git a/classes/class_gltfphysicsshape.rst b/classes/class_gltfphysicsshape.rst index b0b5cb10d41..fae4b8bd87b 100644 --- a/classes/class_gltfphysicsshape.rst +++ b/classes/class_gltfphysicsshape.rst @@ -12,14 +12,14 @@ GLTFPhysicsShape **Inherits:** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` -Represents a GLTF physics shape. +Represents a glTF physics shape. .. rst-class:: classref-introduction-group Description ----------- -Represents a physics shape as defined by the ``OMI_physics_shape`` or ``OMI_collider`` GLTF extensions. This class is an intermediary between the GLTF data and Godot's nodes, and it's abstracted in a way that allows adding support for different GLTF physics extensions in the future. +Represents a physics shape as defined by the ``OMI_physics_shape`` or ``OMI_collider`` glTF extensions. This class is an intermediary between the glTF data and Godot's nodes, and it's abstracted in a way that allows adding support for different glTF physics extensions in the future. .. rst-class:: classref-introduction-group @@ -28,9 +28,9 @@ Tutorials - :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>` -- `OMI_physics_shape GLTF extension `__ +- `OMI_physics_shape glTF extension `__ -- `OMI_collider GLTF extension `__ +- `OMI_collider glTF extension `__ .. rst-class:: classref-reftable-group @@ -151,7 +151,7 @@ This is the only variable not used in the :ref:`to_node`\ ) - :ref:`int` **get_mesh_index**\ (\ ) -The index of the shape's mesh in the GLTF file. This is only used when the shape type is "hull" (convex hull) or "trimesh" (concave trimesh). +The index of the shape's mesh in the glTF file. This is only used when the shape type is "hull" (convex hull) or "trimesh" (concave trimesh). .. rst-class:: classref-item-separator diff --git a/classes/class_gltfskeleton.rst b/classes/class_gltfskeleton.rst index 9951dfc18aa..2c18ecaea1d 100644 --- a/classes/class_gltfskeleton.rst +++ b/classes/class_gltfskeleton.rst @@ -147,7 +147,7 @@ Method Descriptions :ref:`Dictionary` **get_godot_bone_node**\ (\ ) :ref:`๐Ÿ”—` -Returns a :ref:`Dictionary` that maps skeleton bone indices to the indices of GLTF nodes. This property is unused during import, and only set during export. In a GLTF file, a bone is a node, so Godot converts skeleton bones to GLTF nodes. +Returns a :ref:`Dictionary` that maps skeleton bone indices to the indices of glTF nodes. This property is unused during import, and only set during export. In a glTF file, a bone is a node, so Godot converts skeleton bones to glTF nodes. .. rst-class:: classref-item-separator @@ -187,7 +187,7 @@ Returns a :ref:`Dictionary` that maps skeleton bone indices to |void| **set_godot_bone_node**\ (\ godot_bone_node\: :ref:`Dictionary`\ ) :ref:`๐Ÿ”—` -Sets a :ref:`Dictionary` that maps skeleton bone indices to the indices of GLTF nodes. This property is unused during import, and only set during export. In a GLTF file, a bone is a node, so Godot converts skeleton bones to GLTF nodes. +Sets a :ref:`Dictionary` that maps skeleton bone indices to the indices of glTF nodes. This property is unused during import, and only set during export. In a glTF file, a bone is a node, so Godot converts skeleton bones to glTF nodes. .. rst-class:: classref-item-separator diff --git a/classes/class_gltfspecgloss.rst b/classes/class_gltfspecgloss.rst index a5cb4f2d997..0cc58a899d4 100644 --- a/classes/class_gltfspecgloss.rst +++ b/classes/class_gltfspecgloss.rst @@ -12,14 +12,14 @@ GLTFSpecGloss **Inherits:** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` -Archived GLTF extension for specular/glossy materials. +Archived glTF extension for specular/glossy materials. .. rst-class:: classref-introduction-group Description ----------- -KHR_materials_pbrSpecularGlossiness is an archived GLTF extension. This means that it is deprecated and not recommended for new files. However, it is still supported for loading old files. +KHR_materials_pbrSpecularGlossiness is an archived glTF extension. This means that it is deprecated and not recommended for new files. However, it is still supported for loading old files. .. rst-class:: classref-introduction-group @@ -28,7 +28,7 @@ Tutorials - :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>` -- `KHR_materials_pbrSpecularGlossiness GLTF extension spec `__ +- `KHR_materials_pbrSpecularGlossiness glTF extension spec `__ .. rst-class:: classref-reftable-group diff --git a/classes/class_gltfstate.rst b/classes/class_gltfstate.rst index 9faaf6c653d..2cc29142e42 100644 --- a/classes/class_gltfstate.rst +++ b/classes/class_gltfstate.rst @@ -14,16 +14,16 @@ GLTFState **Inherited By:** :ref:`FBXState` -Represents all data of a GLTF file. +Represents all data of a glTF file. .. rst-class:: classref-introduction-group Description ----------- -Contains all nodes and resources of a GLTF file. This is used by :ref:`GLTFDocument` as data storage, which allows :ref:`GLTFDocument` and all :ref:`GLTFDocumentExtension` classes to remain stateless. +Contains all nodes and resources of a glTF file. This is used by :ref:`GLTFDocument` as data storage, which allows :ref:`GLTFDocument` and all :ref:`GLTFDocumentExtension` classes to remain stateless. -GLTFState can be populated by :ref:`GLTFDocument` reading a file or by converting a Godot scene. Then the data can either be used to create a Godot scene or save to a GLTF file. The code that converts to/from a Godot scene can be intercepted at arbitrary points by :ref:`GLTFDocumentExtension` classes. This allows for custom data to be stored in the GLTF file or for custom data to be converted to/from Godot nodes. +GLTFState can be populated by :ref:`GLTFDocument` reading a file or by converting a Godot scene. Then the data can either be used to create a Godot scene or save to a glTF file. The code that converts to/from a Godot scene can be intercepted at arbitrary points by :ref:`GLTFDocumentExtension` classes. This allows for custom data to be stored in the glTF file or for custom data to be converted to/from Godot nodes. .. rst-class:: classref-introduction-group @@ -32,7 +32,7 @@ Tutorials - :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>` -- `GLTF asset header schema `__ +- `glTF asset header schema `__ .. rst-class:: classref-reftable-group @@ -240,7 +240,7 @@ The baking fps of the animation for either import or export. - |void| **set_base_path**\ (\ value\: :ref:`String`\ ) - :ref:`String` **get_base_path**\ (\ ) -The folder path associated with this GLTF data. This is used to find other files the GLTF file references, like images or binary buffers. This will be set during import when appending from a file, and will be set during export when writing to a file. +The folder path associated with this glTF data. This is used to find other files the glTF file references, like images or binary buffers. This will be set during import when appending from a file, and will be set during export when writing to a file. .. rst-class:: classref-item-separator @@ -276,7 +276,7 @@ The folder path associated with this GLTF data. This is used to find other files - |void| **set_copyright**\ (\ value\: :ref:`String`\ ) - :ref:`String` **get_copyright**\ (\ ) -The copyright string in the asset header of the GLTF file. This is set during import if present and export if non-empty. See the GLTF asset header documentation for more information. +The copyright string in the asset header of the glTF file. This is set during import if present and export if non-empty. See the glTF asset header documentation for more information. .. rst-class:: classref-item-separator @@ -312,7 +312,7 @@ The copyright string in the asset header of the GLTF file. This is set during im - |void| **set_filename**\ (\ value\: :ref:`String`\ ) - :ref:`String` **get_filename**\ (\ ) -The file name associated with this GLTF data. If it ends with ``.gltf``, this is text-based GLTF, otherwise this is binary GLB. This will be set during import when appending from a file, and will be set during export when writing to a file. If writing to a buffer, this will be an empty string. +The file name associated with this glTF data. If it ends with ``.gltf``, this is text-based glTF, otherwise this is binary GLB. This will be set during import when appending from a file, and will be set during export when writing to a file. If writing to a buffer, this will be an empty string. .. rst-class:: classref-item-separator @@ -420,7 +420,7 @@ The original raw JSON document corresponding to this GLTFState. - |void| **set_root_nodes**\ (\ value\: :ref:`PackedInt32Array`\ ) - :ref:`PackedInt32Array` **get_root_nodes**\ (\ ) -The root nodes of the GLTF file. Typically, a GLTF file will only have one scene, and therefore one root node. However, a GLTF file may have multiple scenes and therefore multiple root nodes, which will be generated as siblings of each other and as children of the root node of the generated Godot scene. +The root nodes of the glTF file. Typically, a glTF file will only have one scene, and therefore one root node. However, a glTF file may have multiple scenes and therefore multiple root nodes, which will be generated as siblings of each other and as children of the root node of the generated Godot scene. **Note:** The returned array is *copied* and any changes to it will not update the original property value. See :ref:`PackedInt32Array` for more details. @@ -439,7 +439,7 @@ The root nodes of the GLTF file. Typically, a GLTF file will only have one scene - |void| **set_scene_name**\ (\ value\: :ref:`String`\ ) - :ref:`String` **get_scene_name**\ (\ ) -The name of the scene. When importing, if not specified, this will be the file name. When exporting, if specified, the scene name will be saved to the GLTF file. +The name of the scene. When importing, if not specified, this will be the file name. When exporting, if specified, the scene name will be saved to the glTF file. .. rst-class:: classref-item-separator @@ -475,7 +475,7 @@ Method Descriptions |void| **add_used_extension**\ (\ extension_name\: :ref:`String`, required\: :ref:`bool`\ ) :ref:`๐Ÿ”—` -Appends an extension to the list of extensions used by this GLTF file during serialization. If ``required`` is true, the extension will also be added to the list of required extensions. Do not run this in :ref:`GLTFDocumentExtension._export_post`, as that stage is too late to add extensions. The final list is sorted alphabetically. +Appends an extension to the list of extensions used by this glTF file during serialization. If ``required`` is true, the extension will also be added to the list of required extensions. Do not run this in :ref:`GLTFDocumentExtension._export_post`, as that stage is too late to add extensions. The final list is sorted alphabetically. .. rst-class:: classref-item-separator @@ -515,7 +515,7 @@ Appends the given byte array data to the buffers and creates a :ref:`GLTFBufferV Gets additional arbitrary data in this **GLTFState** instance. This can be used to keep per-file state data in :ref:`GLTFDocumentExtension` classes, which is important because they are stateless. -The argument should be the :ref:`GLTFDocumentExtension` name (does not have to match the extension name in the GLTF file), and the return value can be anything you set. If nothing was set, the return value is null. +The argument should be the :ref:`GLTFDocumentExtension` name (does not have to match the extension name in the glTF file), and the return value can be anything you set. If nothing was set, the return value is null. .. rst-class:: classref-item-separator @@ -527,7 +527,7 @@ The argument should be the :ref:`GLTFDocumentExtension` **get_animation_player**\ (\ idx\: :ref:`int`\ ) :ref:`๐Ÿ”—` -Returns the :ref:`AnimationPlayer` node with the given index. These nodes are only used during the export process when converting Godot :ref:`AnimationPlayer` nodes to GLTF animations. +Returns the :ref:`AnimationPlayer` node with the given index. These nodes are only used during the export process when converting Godot :ref:`AnimationPlayer` nodes to glTF animations. .. rst-class:: classref-item-separator @@ -539,7 +539,7 @@ Returns the :ref:`AnimationPlayer` node with the given in :ref:`int` **get_animation_players_count**\ (\ idx\: :ref:`int`\ ) :ref:`๐Ÿ”—` -Returns the number of :ref:`AnimationPlayer` nodes in this **GLTFState**. These nodes are only used during the export process when converting Godot :ref:`AnimationPlayer` nodes to GLTF animations. +Returns the number of :ref:`AnimationPlayer` nodes in this **GLTFState**. These nodes are only used during the export process when converting Godot :ref:`AnimationPlayer` nodes to glTF animations. .. rst-class:: classref-item-separator @@ -551,7 +551,7 @@ Returns the number of :ref:`AnimationPlayer` nodes in thi :ref:`Array`\[:ref:`GLTFAnimation`\] **get_animations**\ (\ ) :ref:`๐Ÿ”—` -Returns an array of all :ref:`GLTFAnimation`\ s in the GLTF file. When importing, these will be generated as animations in an :ref:`AnimationPlayer` node. When exporting, these will be generated from Godot :ref:`AnimationPlayer` nodes. +Returns an array of all :ref:`GLTFAnimation`\ s in the glTF file. When importing, these will be generated as animations in an :ref:`AnimationPlayer` node. When exporting, these will be generated from Godot :ref:`AnimationPlayer` nodes. .. rst-class:: classref-item-separator @@ -577,7 +577,7 @@ Returns an array of all :ref:`GLTFAnimation`\ s in the GLTF :ref:`Array`\[:ref:`GLTFCamera`\] **get_cameras**\ (\ ) :ref:`๐Ÿ”—` -Returns an array of all :ref:`GLTFCamera`\ s in the GLTF file. These are the cameras that the :ref:`GLTFNode.camera` index refers to. +Returns an array of all :ref:`GLTFCamera`\ s in the glTF file. These are the cameras that the :ref:`GLTFNode.camera` index refers to. .. rst-class:: classref-item-separator @@ -603,7 +603,7 @@ Returns an array of all :ref:`GLTFCamera`\ s in the GLTF file. :ref:`Array`\[:ref:`Texture2D`\] **get_images**\ (\ ) :ref:`๐Ÿ”—` -Gets the images of the GLTF file as an array of :ref:`Texture2D`\ s. These are the images that the :ref:`GLTFTexture.src_image` index refers to. +Gets the images of the glTF file as an array of :ref:`Texture2D`\ s. These are the images that the :ref:`GLTFTexture.src_image` index refers to. .. rst-class:: classref-item-separator @@ -615,7 +615,7 @@ Gets the images of the GLTF file as an array of :ref:`Texture2D :ref:`Array`\[:ref:`GLTFLight`\] **get_lights**\ (\ ) :ref:`๐Ÿ”—` -Returns an array of all :ref:`GLTFLight`\ s in the GLTF file. These are the lights that the :ref:`GLTFNode.light` index refers to. +Returns an array of all :ref:`GLTFLight`\ s in the glTF file. These are the lights that the :ref:`GLTFNode.light` index refers to. .. rst-class:: classref-item-separator @@ -641,7 +641,7 @@ Returns an array of all :ref:`GLTFLight`\ s in the GLTF file. T :ref:`Array`\[:ref:`GLTFMesh`\] **get_meshes**\ (\ ) :ref:`๐Ÿ”—` -Returns an array of all :ref:`GLTFMesh`\ es in the GLTF file. These are the meshes that the :ref:`GLTFNode.mesh` index refers to. +Returns an array of all :ref:`GLTFMesh`\ es in the glTF file. These are the meshes that the :ref:`GLTFNode.mesh` index refers to. .. rst-class:: classref-item-separator @@ -667,7 +667,7 @@ Returns the index of the :ref:`GLTFNode` corresponding to this G :ref:`Array`\[:ref:`GLTFNode`\] **get_nodes**\ (\ ) :ref:`๐Ÿ”—` -Returns an array of all :ref:`GLTFNode`\ s in the GLTF file. These are the nodes that :ref:`GLTFNode.children` and :ref:`root_nodes` refer to. This includes nodes that may not be generated in the Godot scene, or nodes that may generate multiple Godot scene nodes. +Returns an array of all :ref:`GLTFNode`\ s in the glTF file. These are the nodes that :ref:`GLTFNode.children` and :ref:`root_nodes` refer to. This includes nodes that may not be generated in the Godot scene, or nodes that may generate multiple Godot scene nodes. .. rst-class:: classref-item-separator @@ -693,7 +693,7 @@ Returns the Godot scene node that corresponds to the same index as the :ref:`GLT :ref:`Array`\[:ref:`GLTFSkeleton`\] **get_skeletons**\ (\ ) :ref:`๐Ÿ”—` -Returns an array of all :ref:`GLTFSkeleton`\ s in the GLTF file. These are the skeletons that the :ref:`GLTFNode.skeleton` index refers to. +Returns an array of all :ref:`GLTFSkeleton`\ s in the glTF file. These are the skeletons that the :ref:`GLTFNode.skeleton` index refers to. .. rst-class:: classref-item-separator @@ -705,7 +705,7 @@ Returns an array of all :ref:`GLTFSkeleton`\ s in the GLTF f :ref:`Array`\[:ref:`GLTFSkin`\] **get_skins**\ (\ ) :ref:`๐Ÿ”—` -Returns an array of all :ref:`GLTFSkin`\ s in the GLTF file. These are the skins that the :ref:`GLTFNode.skin` index refers to. +Returns an array of all :ref:`GLTFSkin`\ s in the glTF file. These are the skins that the :ref:`GLTFNode.skin` index refers to. .. rst-class:: classref-item-separator @@ -717,7 +717,7 @@ Returns an array of all :ref:`GLTFSkin`\ s in the GLTF file. The :ref:`Array`\[:ref:`GLTFTextureSampler`\] **get_texture_samplers**\ (\ ) :ref:`๐Ÿ”—` -Retrieves the array of texture samplers that are used by the textures contained in the GLTF. +Retrieves the array of texture samplers that are used by the textures contained in the glTF. .. rst-class:: classref-item-separator @@ -783,7 +783,7 @@ Returns an array of unique node names. This is used in both the import process a Sets additional arbitrary data in this **GLTFState** instance. This can be used to keep per-file state data in :ref:`GLTFDocumentExtension` classes, which is important because they are stateless. -The first argument should be the :ref:`GLTFDocumentExtension` name (does not have to match the extension name in the GLTF file), and the second argument can be anything you want. +The first argument should be the :ref:`GLTFDocumentExtension` name (does not have to match the extension name in the glTF file), and the second argument can be anything you want. .. rst-class:: classref-item-separator @@ -933,7 +933,7 @@ Sets the :ref:`GLTFSkin`\ s in the state. These are the skins th |void| **set_texture_samplers**\ (\ texture_samplers\: :ref:`Array`\[:ref:`GLTFTextureSampler`\]\ ) :ref:`๐Ÿ”—` -Sets the array of texture samplers that are used by the textures contained in the GLTF. +Sets the array of texture samplers that are used by the textures contained in the glTF. .. rst-class:: classref-item-separator diff --git a/classes/class_gltftexture.rst b/classes/class_gltftexture.rst index 187d5364509..5dff769778a 100644 --- a/classes/class_gltftexture.rst +++ b/classes/class_gltftexture.rst @@ -12,7 +12,7 @@ GLTFTexture **Inherits:** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` -GLTFTexture represents a texture in a GLTF file. +GLTFTexture represents a texture in a glTF file. .. rst-class:: classref-introduction-group diff --git a/classes/class_gltftexturesampler.rst b/classes/class_gltftexturesampler.rst index dad254a2c83..9e120d012d1 100644 --- a/classes/class_gltftexturesampler.rst +++ b/classes/class_gltftexturesampler.rst @@ -12,14 +12,14 @@ GLTFTextureSampler **Inherits:** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` -Represents a GLTF texture sampler +Represents a glTF texture sampler .. rst-class:: classref-introduction-group Description ----------- -Represents a texture sampler as defined by the base GLTF spec. Texture samplers in GLTF specify how to sample data from the texture's base image, when rendering the texture on an object. +Represents a texture sampler as defined by the base glTF spec. Texture samplers in glTF specify how to sample data from the texture's base image, when rendering the texture on an object. .. rst-class:: classref-introduction-group diff --git a/classes/class_image.rst b/classes/class_image.rst index 4e594fca6d5..57fbdce0f8c 100644 --- a/classes/class_image.rst +++ b/classes/class_image.rst @@ -137,6 +137,8 @@ Methods +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_invisible`\ (\ ) |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`linear_to_srgb`\ (\ ) | + +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`load`\ (\ path\: :ref:`String`\ ) | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`load_bmp_from_buffer`\ (\ buffer\: :ref:`PackedByteArray`\ ) | @@ -1382,6 +1384,18 @@ Returns ``true`` if all the image's pixels have an alpha value of 0. Returns ``f ---- +.. _class_Image_method_linear_to_srgb: + +.. rst-class:: classref-method + +|void| **linear_to_srgb**\ (\ ) :ref:`๐Ÿ”—` + +Converts the entire image from the linear colorspace to the sRGB colorspace. Only works on images with :ref:`FORMAT_RGB8` or :ref:`FORMAT_RGBA8` formats. + +.. rst-class:: classref-item-separator + +---- + .. _class_Image_method_load: .. rst-class:: classref-method @@ -1818,7 +1832,7 @@ Shrinks the image by a factor of 2 on each axis (this divides the pixel count by |void| **srgb_to_linear**\ (\ ) :ref:`๐Ÿ”—` -Converts the raw data from the sRGB colorspace to a linear scale. +Converts the raw data from the sRGB colorspace to a linear scale. Only works on images with :ref:`FORMAT_RGB8` or :ref:`FORMAT_RGBA8` formats. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` diff --git a/classes/class_input.rst b/classes/class_input.rst index bae03e0b96f..6da893f301b 100644 --- a/classes/class_input.rst +++ b/classes/class_input.rst @@ -672,6 +672,8 @@ On Linux: \ ``steam_input_index``: The Steam Input gamepad index, if the device is not a Steam Input device this key won't be present. +\ **Note:** The returned dictionary is always empty on Web, iOS, Android, and macOS. + .. rst-class:: classref-item-separator ---- diff --git a/classes/class_multimesh.rst b/classes/class_multimesh.rst index bfef9e8093f..4dcf5ef822a 100644 --- a/classes/class_multimesh.rst +++ b/classes/class_multimesh.rst @@ -53,31 +53,33 @@ Properties .. table:: :widths: auto - +--------------------------------------------------------+--------------------------------------------------------------------------------+----------------------------+ - | :ref:`PackedFloat32Array` | :ref:`buffer` | ``PackedFloat32Array()`` | - +--------------------------------------------------------+--------------------------------------------------------------------------------+----------------------------+ - | :ref:`PackedColorArray` | :ref:`color_array` | | - +--------------------------------------------------------+--------------------------------------------------------------------------------+----------------------------+ - | :ref:`AABB` | :ref:`custom_aabb` | ``AABB(0, 0, 0, 0, 0, 0)`` | - +--------------------------------------------------------+--------------------------------------------------------------------------------+----------------------------+ - | :ref:`PackedColorArray` | :ref:`custom_data_array` | | - +--------------------------------------------------------+--------------------------------------------------------------------------------+----------------------------+ - | :ref:`int` | :ref:`instance_count` | ``0`` | - +--------------------------------------------------------+--------------------------------------------------------------------------------+----------------------------+ - | :ref:`Mesh` | :ref:`mesh` | | - +--------------------------------------------------------+--------------------------------------------------------------------------------+----------------------------+ - | :ref:`PackedVector2Array` | :ref:`transform_2d_array` | | - +--------------------------------------------------------+--------------------------------------------------------------------------------+----------------------------+ - | :ref:`PackedVector3Array` | :ref:`transform_array` | | - +--------------------------------------------------------+--------------------------------------------------------------------------------+----------------------------+ - | :ref:`TransformFormat` | :ref:`transform_format` | ``0`` | - +--------------------------------------------------------+--------------------------------------------------------------------------------+----------------------------+ - | :ref:`bool` | :ref:`use_colors` | ``false`` | - +--------------------------------------------------------+--------------------------------------------------------------------------------+----------------------------+ - | :ref:`bool` | :ref:`use_custom_data` | ``false`` | - +--------------------------------------------------------+--------------------------------------------------------------------------------+----------------------------+ - | :ref:`int` | :ref:`visible_instance_count` | ``-1`` | - +--------------------------------------------------------+--------------------------------------------------------------------------------+----------------------------+ + +--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------+----------------------------+ + | :ref:`PackedFloat32Array` | :ref:`buffer` | ``PackedFloat32Array()`` | + +--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------+----------------------------+ + | :ref:`PackedColorArray` | :ref:`color_array` | | + +--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------+----------------------------+ + | :ref:`AABB` | :ref:`custom_aabb` | ``AABB(0, 0, 0, 0, 0, 0)`` | + +--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------+----------------------------+ + | :ref:`PackedColorArray` | :ref:`custom_data_array` | | + +--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------+----------------------------+ + | :ref:`int` | :ref:`instance_count` | ``0`` | + +--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------+----------------------------+ + | :ref:`Mesh` | :ref:`mesh` | | + +--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------+----------------------------+ + | :ref:`PhysicsInterpolationQuality` | :ref:`physics_interpolation_quality` | ``0`` | + +--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------+----------------------------+ + | :ref:`PackedVector2Array` | :ref:`transform_2d_array` | | + +--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------+----------------------------+ + | :ref:`PackedVector3Array` | :ref:`transform_array` | | + +--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------+----------------------------+ + | :ref:`TransformFormat` | :ref:`transform_format` | ``0`` | + +--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------+----------------------------+ + | :ref:`bool` | :ref:`use_colors` | ``false`` | + +--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------+----------------------------+ + | :ref:`bool` | :ref:`use_custom_data` | ``false`` | + +--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------+----------------------------+ + | :ref:`int` | :ref:`visible_instance_count` | ``-1`` | + +--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------+----------------------------+ .. rst-class:: classref-reftable-group @@ -87,25 +89,29 @@ Methods .. table:: :widths: auto - +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`AABB` | :ref:`get_aabb`\ (\ ) |const| | - +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Color` | :ref:`get_instance_color`\ (\ instance\: :ref:`int`\ ) |const| | - +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Color` | :ref:`get_instance_custom_data`\ (\ instance\: :ref:`int`\ ) |const| | - +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Transform3D` | :ref:`get_instance_transform`\ (\ instance\: :ref:`int`\ ) |const| | - +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Transform2D` | :ref:`get_instance_transform_2d`\ (\ instance\: :ref:`int`\ ) |const| | - +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`set_instance_color`\ (\ instance\: :ref:`int`, color\: :ref:`Color`\ ) | - +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`set_instance_custom_data`\ (\ instance\: :ref:`int`, custom_data\: :ref:`Color`\ ) | - +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`set_instance_transform`\ (\ instance\: :ref:`int`, transform\: :ref:`Transform3D`\ ) | - +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | |void| | :ref:`set_instance_transform_2d`\ (\ instance\: :ref:`int`, transform\: :ref:`Transform2D`\ ) | - +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`AABB` | :ref:`get_aabb`\ (\ ) |const| | + +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Color` | :ref:`get_instance_color`\ (\ instance\: :ref:`int`\ ) |const| | + +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Color` | :ref:`get_instance_custom_data`\ (\ instance\: :ref:`int`\ ) |const| | + +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Transform3D` | :ref:`get_instance_transform`\ (\ instance\: :ref:`int`\ ) |const| | + +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Transform2D` | :ref:`get_instance_transform_2d`\ (\ instance\: :ref:`int`\ ) |const| | + +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`reset_instance_physics_interpolation`\ (\ instance\: :ref:`int`\ ) | + +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_buffer_interpolated`\ (\ buffer_curr\: :ref:`PackedFloat32Array`, buffer_prev\: :ref:`PackedFloat32Array`\ ) | + +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_instance_color`\ (\ instance\: :ref:`int`, color\: :ref:`Color`\ ) | + +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_instance_custom_data`\ (\ instance\: :ref:`int`, custom_data\: :ref:`Color`\ ) | + +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_instance_transform`\ (\ instance\: :ref:`int`, transform\: :ref:`Transform3D`\ ) | + +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_instance_transform_2d`\ (\ instance\: :ref:`int`, transform\: :ref:`Transform2D`\ ) | + +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -138,6 +144,32 @@ Use this when using 2D transforms. Use this when using 3D transforms. +.. rst-class:: classref-item-separator + +---- + +.. _enum_MultiMesh_PhysicsInterpolationQuality: + +.. rst-class:: classref-enumeration + +enum **PhysicsInterpolationQuality**: :ref:`๐Ÿ”—` + +.. _class_MultiMesh_constant_INTERP_QUALITY_FAST: + +.. rst-class:: classref-enumeration-constant + +:ref:`PhysicsInterpolationQuality` **INTERP_QUALITY_FAST** = ``0`` + +Always interpolate using Basis lerping, which can produce warping artifacts in some situations. + +.. _class_MultiMesh_constant_INTERP_QUALITY_HIGH: + +.. rst-class:: classref-enumeration-constant + +:ref:`PhysicsInterpolationQuality` **INTERP_QUALITY_HIGH** = ``1`` + +Attempt to interpolate using Basis slerping (spherical linear interpolation) where possible, otherwise fall back to lerping. + .. rst-class:: classref-section-separator ---- @@ -253,6 +285,27 @@ The looks of the individual instances can be modified using :ref:`set_instance_c ---- +.. _class_MultiMesh_property_physics_interpolation_quality: + +.. rst-class:: classref-property + +:ref:`PhysicsInterpolationQuality` **physics_interpolation_quality** = ``0`` :ref:`๐Ÿ”—` + +.. rst-class:: classref-property-setget + +- |void| **set_physics_interpolation_quality**\ (\ value\: :ref:`PhysicsInterpolationQuality`\ ) +- :ref:`PhysicsInterpolationQuality` **get_physics_interpolation_quality**\ (\ ) + +Choose whether to use an interpolation method that favors speed or quality. + +When using low physics tick rates (typically below 20) or high rates of object rotation, you may get better results from the high quality setting. + +\ **Note:** Fast quality does not equate to low quality. Except in the special cases mentioned above, the quality should be comparable to high quality. + +.. rst-class:: classref-item-separator + +---- + .. _class_MultiMesh_property_transform_2d_array: .. rst-class:: classref-property @@ -418,6 +471,36 @@ Returns the :ref:`Transform2D` of a specific instance. ---- +.. _class_MultiMesh_method_reset_instance_physics_interpolation: + +.. rst-class:: classref-method + +|void| **reset_instance_physics_interpolation**\ (\ instance\: :ref:`int`\ ) :ref:`๐Ÿ”—` + +When using *physics interpolation*, this function allows you to prevent interpolation on an instance in the current physics tick. + +This allows you to move instances instantaneously, and should usually be used when initially placing an instance such as a bullet to prevent graphical glitches. + +.. rst-class:: classref-item-separator + +---- + +.. _class_MultiMesh_method_set_buffer_interpolated: + +.. rst-class:: classref-method + +|void| **set_buffer_interpolated**\ (\ buffer_curr\: :ref:`PackedFloat32Array`, buffer_prev\: :ref:`PackedFloat32Array`\ ) :ref:`๐Ÿ”—` + +An alternative to setting the :ref:`buffer` property, which can be used with *physics interpolation*. This method takes two arrays, and can set the data for the current and previous tick in one go. The renderer will automatically interpolate the data at each frame. + +This is useful for situations where the order of instances may change from physics tick to tick, such as particle systems. + +When the order of instances is coherent, the simpler alternative of setting :ref:`buffer` can still be used with interpolation. + +.. rst-class:: classref-item-separator + +---- + .. _class_MultiMesh_method_set_instance_color: .. rst-class:: classref-method diff --git a/classes/class_multiplayerspawner.rst b/classes/class_multiplayerspawner.rst index 557d860fb72..d2d78757a08 100644 --- a/classes/class_multiplayerspawner.rst +++ b/classes/class_multiplayerspawner.rst @@ -113,7 +113,7 @@ Property Descriptions - |void| **set_spawn_function**\ (\ value\: :ref:`Callable`\ ) - :ref:`Callable` **get_spawn_function**\ (\ ) -Method called on all peers when for every custom :ref:`spawn` requested by the authority. Will receive the ``data`` parameter, and should return a :ref:`Node` that is not in the scene tree. +Method called on all peers when a custom :ref:`spawn` is requested by the authority. Will receive the ``data`` parameter, and should return a :ref:`Node` that is not in the scene tree. \ **Note:** The returned node should **not** be added to the scene with :ref:`Node.add_child`. This is done automatically. @@ -132,7 +132,7 @@ Method called on all peers when for every custom :ref:`spawn`\ ) - :ref:`int` **get_spawn_limit**\ (\ ) -Maximum nodes that is allowed to be spawned by this spawner. Includes both spawnable scenes and custom spawns. +Maximum number of nodes allowed to be spawned by this spawner. Includes both spawnable scenes and custom spawns. When set to ``0`` (the default), there is no limit. diff --git a/classes/class_navigationlink2d.rst b/classes/class_navigationlink2d.rst index ee524d16615..ee45e15a15b 100644 --- a/classes/class_navigationlink2d.rst +++ b/classes/class_navigationlink2d.rst @@ -69,6 +69,8 @@ Methods +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_navigation_layer_value`\ (\ layer_number\: :ref:`int`\ ) |const| | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`get_navigation_map`\ (\ ) |const| | + +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`get_rid`\ (\ ) |const| | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_global_end_position`\ (\ position\: :ref:`Vector2`\ ) | @@ -77,6 +79,8 @@ Methods +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_navigation_layer_value`\ (\ layer_number\: :ref:`int`, value\: :ref:`bool`\ ) | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_navigation_map`\ (\ navigation_map\: :ref:`RID`\ ) | + +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -255,6 +259,18 @@ Returns whether or not the specified layer of the :ref:`navigation_layers` **get_navigation_map**\ (\ ) |const| :ref:`๐Ÿ”—` + +Returns the current navigation map :ref:`RID` used by this link. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationLink2D_method_get_rid: .. rst-class:: classref-method @@ -299,6 +315,18 @@ Sets the :ref:`start_position` t Based on ``value``, enables or disables the specified layer in the :ref:`navigation_layers` bitmask, given a ``layer_number`` between 1 and 32. +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationLink2D_method_set_navigation_map: + +.. rst-class:: classref-method + +|void| **set_navigation_map**\ (\ navigation_map\: :ref:`RID`\ ) :ref:`๐Ÿ”—` + +Sets the :ref:`RID` of the navigation map this link should use. By default the link will automatically join the :ref:`World2D` default navigation map so this function is only required to override the default map. + .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_navigationlink3d.rst b/classes/class_navigationlink3d.rst index 11a90a70ecd..698f0dff394 100644 --- a/classes/class_navigationlink3d.rst +++ b/classes/class_navigationlink3d.rst @@ -69,6 +69,8 @@ Methods +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_navigation_layer_value`\ (\ layer_number\: :ref:`int`\ ) |const| | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`RID` | :ref:`get_navigation_map`\ (\ ) |const| | + +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`get_rid`\ (\ ) |const| | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_global_end_position`\ (\ position\: :ref:`Vector3`\ ) | @@ -77,6 +79,8 @@ Methods +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_navigation_layer_value`\ (\ layer_number\: :ref:`int`, value\: :ref:`bool`\ ) | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`set_navigation_map`\ (\ navigation_map\: :ref:`RID`\ ) | + +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -255,6 +259,18 @@ Returns whether or not the specified layer of the :ref:`navigation_layers` **get_navigation_map**\ (\ ) |const| :ref:`๐Ÿ”—` + +Returns the current navigation map :ref:`RID` used by this link. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationLink3D_method_get_rid: .. rst-class:: classref-method @@ -299,6 +315,18 @@ Sets the :ref:`start_position` t Based on ``value``, enables or disables the specified layer in the :ref:`navigation_layers` bitmask, given a ``layer_number`` between 1 and 32. +.. rst-class:: classref-item-separator + +---- + +.. _class_NavigationLink3D_method_set_navigation_map: + +.. rst-class:: classref-method + +|void| **set_navigation_map**\ (\ navigation_map\: :ref:`RID`\ ) :ref:`๐Ÿ”—` + +Sets the :ref:`RID` of the navigation map this link should use. By default the link will automatically join the :ref:`World3D` default navigation map so this function is only required to override the default map. + .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_navigationmesh.rst b/classes/class_navigationmesh.rst index 1562e6021af..7e37ec9c77a 100644 --- a/classes/class_navigationmesh.rst +++ b/classes/class_navigationmesh.rst @@ -75,7 +75,7 @@ Properties +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`int` | :ref:`geometry_collision_mask` | ``4294967295`` | +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+ - | :ref:`ParsedGeometryType` | :ref:`geometry_parsed_geometry_type` | ``0`` | + | :ref:`ParsedGeometryType` | :ref:`geometry_parsed_geometry_type` | ``2`` | +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`SourceGeometryMode` | :ref:`geometry_source_geometry_mode` | ``0`` | +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+ @@ -567,7 +567,7 @@ Only used when :ref:`geometry_parsed_geometry_type` **geometry_parsed_geometry_type** = ``0`` :ref:`๐Ÿ”—` +:ref:`ParsedGeometryType` **geometry_parsed_geometry_type** = ``2`` :ref:`๐Ÿ”—` .. rst-class:: classref-property-setget diff --git a/classes/class_navigationmeshsourcegeometrydata2d.rst b/classes/class_navigationmeshsourcegeometrydata2d.rst index 557a839f4c5..cb2bb11b82e 100644 --- a/classes/class_navigationmeshsourcegeometrydata2d.rst +++ b/classes/class_navigationmeshsourcegeometrydata2d.rst @@ -46,6 +46,8 @@ Methods +----------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`clear_projected_obstructions`\ (\ ) | +----------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Rect2` | :ref:`get_bounds`\ (\ ) | + +----------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array`\[:ref:`PackedVector2Array`\] | :ref:`get_obstruction_outlines`\ (\ ) |const| | +----------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array` | :ref:`get_projected_obstructions`\ (\ ) |const| | @@ -156,6 +158,18 @@ Clears all projected obstructions. ---- +.. _class_NavigationMeshSourceGeometryData2D_method_get_bounds: + +.. rst-class:: classref-method + +:ref:`Rect2` **get_bounds**\ (\ ) :ref:`๐Ÿ”—` + +Returns an axis-aligned bounding box that covers all the stored geometry data. The bounds are calculated when calling this function with the result cached until further geometry changes are made. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationMeshSourceGeometryData2D_method_get_obstruction_outlines: .. rst-class:: classref-method diff --git a/classes/class_navigationmeshsourcegeometrydata3d.rst b/classes/class_navigationmeshsourcegeometrydata3d.rst index 1543fe5205e..65a1c0f99d6 100644 --- a/classes/class_navigationmeshsourcegeometrydata3d.rst +++ b/classes/class_navigationmeshsourcegeometrydata3d.rst @@ -46,6 +46,8 @@ Methods +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`clear_projected_obstructions`\ (\ ) | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`AABB` | :ref:`get_bounds`\ (\ ) | + +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PackedInt32Array` | :ref:`get_indices`\ (\ ) |const| | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array` | :ref:`get_projected_obstructions`\ (\ ) |const| | @@ -156,6 +158,18 @@ Clears all projected obstructions. ---- +.. _class_NavigationMeshSourceGeometryData3D_method_get_bounds: + +.. rst-class:: classref-method + +:ref:`AABB` **get_bounds**\ (\ ) :ref:`๐Ÿ”—` + +Returns an axis-aligned bounding box that covers all the stored geometry data. The bounds are calculated when calling this function with the result cached until further geometry changes are made. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationMeshSourceGeometryData3D_method_get_indices: .. rst-class:: classref-method diff --git a/classes/class_navigationpolygon.rst b/classes/class_navigationpolygon.rst index b55607d9068..8b2eecc205f 100644 --- a/classes/class_navigationpolygon.rst +++ b/classes/class_navigationpolygon.rst @@ -88,25 +88,27 @@ Properties .. table:: :widths: auto - +----------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ - | :ref:`float` | :ref:`agent_radius` | ``10.0`` | - +----------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ - | :ref:`Rect2` | :ref:`baking_rect` | ``Rect2(0, 0, 0, 0)`` | - +----------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ - | :ref:`Vector2` | :ref:`baking_rect_offset` | ``Vector2(0, 0)`` | - +----------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ - | :ref:`float` | :ref:`border_size` | ``0.0`` | - +----------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ - | :ref:`float` | :ref:`cell_size` | ``1.0`` | - +----------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ - | :ref:`int` | :ref:`parsed_collision_mask` | ``4294967295`` | - +----------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ - | :ref:`ParsedGeometryType` | :ref:`parsed_geometry_type` | ``2`` | - +----------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ - | :ref:`StringName` | :ref:`source_geometry_group_name` | ``&"navigation_polygon_source_geometry_group"`` | - +----------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ - | :ref:`SourceGeometryMode` | :ref:`source_geometry_mode` | ``0`` | - +----------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ + +------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ + | :ref:`float` | :ref:`agent_radius` | ``10.0`` | + +------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ + | :ref:`Rect2` | :ref:`baking_rect` | ``Rect2(0, 0, 0, 0)`` | + +------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ + | :ref:`Vector2` | :ref:`baking_rect_offset` | ``Vector2(0, 0)`` | + +------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ + | :ref:`float` | :ref:`border_size` | ``0.0`` | + +------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ + | :ref:`float` | :ref:`cell_size` | ``1.0`` | + +------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ + | :ref:`int` | :ref:`parsed_collision_mask` | ``4294967295`` | + +------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ + | :ref:`ParsedGeometryType` | :ref:`parsed_geometry_type` | ``2`` | + +------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ + | :ref:`SamplePartitionType` | :ref:`sample_partition_type` | ``0`` | + +------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ + | :ref:`StringName` | :ref:`source_geometry_group_name` | ``&"navigation_polygon_source_geometry_group"`` | + +------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ + | :ref:`SourceGeometryMode` | :ref:`source_geometry_mode` | ``0`` | + +------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------------------------------------+ .. rst-class:: classref-reftable-group @@ -163,6 +165,40 @@ Methods Enumerations ------------ +.. _enum_NavigationPolygon_SamplePartitionType: + +.. rst-class:: classref-enumeration + +enum **SamplePartitionType**: :ref:`๐Ÿ”—` + +.. _class_NavigationPolygon_constant_SAMPLE_PARTITION_CONVEX_PARTITION: + +.. rst-class:: classref-enumeration-constant + +:ref:`SamplePartitionType` **SAMPLE_PARTITION_CONVEX_PARTITION** = ``0`` + +Convex partitioning that yields navigation mesh with convex polygons. + +.. _class_NavigationPolygon_constant_SAMPLE_PARTITION_TRIANGULATE: + +.. rst-class:: classref-enumeration-constant + +:ref:`SamplePartitionType` **SAMPLE_PARTITION_TRIANGULATE** = ``1`` + +Triangulation partitioning that yields navigation mesh with triangle polygons. + +.. _class_NavigationPolygon_constant_SAMPLE_PARTITION_MAX: + +.. rst-class:: classref-enumeration-constant + +:ref:`SamplePartitionType` **SAMPLE_PARTITION_MAX** = ``2`` + +Represents the size of the :ref:`SamplePartitionType` enum. + +.. rst-class:: classref-item-separator + +---- + .. _enum_NavigationPolygon_ParsedGeometryType: .. rst-class:: classref-enumeration @@ -377,6 +413,23 @@ Determines which type of nodes will be parsed as geometry. See :ref:`ParsedGeome ---- +.. _class_NavigationPolygon_property_sample_partition_type: + +.. rst-class:: classref-property + +:ref:`SamplePartitionType` **sample_partition_type** = ``0`` :ref:`๐Ÿ”—` + +.. rst-class:: classref-property-setget + +- |void| **set_sample_partition_type**\ (\ value\: :ref:`SamplePartitionType`\ ) +- :ref:`SamplePartitionType` **get_sample_partition_type**\ (\ ) + +Partitioning algorithm for creating the navigation mesh polys. See :ref:`SamplePartitionType` for possible values. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationPolygon_property_source_geometry_group_name: .. rst-class:: classref-property diff --git a/classes/class_navigationserver3d.rst b/classes/class_navigationserver3d.rst index 370ebd0bf5e..d6462951ddb 100644 --- a/classes/class_navigationserver3d.rst +++ b/classes/class_navigationserver3d.rst @@ -472,6 +472,14 @@ Constant to get the number of navigation mesh polygon edges that are considered Constant to get the number of navigation mesh polygon edges that could not be merged but may be still connected by edge proximity or with links. +.. _class_NavigationServer3D_constant_INFO_OBSTACLE_COUNT: + +.. rst-class:: classref-enumeration-constant + +:ref:`ProcessInfo` **INFO_OBSTACLE_COUNT** = ``9`` + +Constant to get the number of active navigation obstacles. + .. rst-class:: classref-section-separator ---- diff --git a/classes/class_node3d.rst b/classes/class_node3d.rst index f8a6153a0cc..2f1eea7f782 100644 --- a/classes/class_node3d.rst +++ b/classes/class_node3d.rst @@ -101,6 +101,8 @@ Methods +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array`\[:ref:`Node3DGizmo`\] | :ref:`get_gizmos`\ (\ ) |const| | +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Transform3D` | :ref:`get_global_transform_interpolated`\ (\ ) | + +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Node3D` | :ref:`get_parent_node_3d`\ (\ ) |const| | +--------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`World3D` | :ref:`get_world_3d`\ (\ ) |const| | @@ -648,6 +650,22 @@ Returns all the gizmos attached to this **Node3D**. ---- +.. _class_Node3D_method_get_global_transform_interpolated: + +.. rst-class:: classref-method + +:ref:`Transform3D` **get_global_transform_interpolated**\ (\ ) :ref:`๐Ÿ”—` + +When using physics interpolation, there will be circumstances in which you want to know the interpolated (displayed) transform of a node rather than the standard transform (which may only be accurate to the most recent physics tick). + +This is particularly important for frame-based operations that take place in :ref:`Node._process`, rather than :ref:`Node._physics_process`. Examples include :ref:`Camera3D`\ s focusing on a node, or finding where to fire lasers from on a frame rather than physics tick. + +\ **Note:** This function creates an interpolation pump on the **Node3D** the first time it is called, which can respond to physics interpolation resets. If you get problems with "streaking" when initially following a **Node3D**, be sure to call :ref:`get_global_transform_interpolated` at least once *before* resetting the **Node3D** physics interpolation. + +.. rst-class:: classref-item-separator + +---- + .. _class_Node3D_method_get_parent_node_3d: .. rst-class:: classref-method diff --git a/classes/class_openxrvisibilitymask.rst b/classes/class_openxrvisibilitymask.rst new file mode 100644 index 00000000000..d74f8e0019e --- /dev/null +++ b/classes/class_openxrvisibilitymask.rst @@ -0,0 +1,33 @@ +:github_url: hide + +.. DO NOT EDIT THIS FILE!!! +.. Generated automatically from Godot engine sources. +.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. +.. XML source: https://github.com/godotengine/godot/tree/master/modules/openxr/doc_classes/OpenXRVisibilityMask.xml. + +.. _class_OpenXRVisibilityMask: + +OpenXRVisibilityMask +==================== + +**Inherits:** :ref:`VisualInstance3D` **<** :ref:`Node3D` **<** :ref:`Node` **<** :ref:`Object` + +Draws a stereo correct visibility mask. + +.. rst-class:: classref-introduction-group + +Description +----------- + +The visibility mask allows us to black out the part of the render result that is invisible due to lens distortion. + +As this is rendered first, it prevents fragments with expensive lighting calculations to be processed as they are discarded through z-checking. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` +.. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` +.. |void| replace:: :abbr:`void (No return value.)` diff --git a/classes/class_os.rst b/classes/class_os.rst index b26590dfea6..eb00f225a53 100644 --- a/classes/class_os.rst +++ b/classes/class_os.rst @@ -231,6 +231,14 @@ The OpenGL 3 rendering driver. It uses OpenGL 3.3 Core Profile on desktop platfo The Direct3D 12 rendering driver. +.. _class_OS_constant_RENDERING_DRIVER_METAL: + +.. rst-class:: classref-enumeration-constant + +:ref:`RenderingDriver` **RENDERING_DRIVER_METAL** = ``3`` + +The Metal rendering driver. + .. rst-class:: classref-item-separator ---- diff --git a/classes/class_performance.rst b/classes/class_performance.rst index 8928c4e8237..f66d110dc04 100644 --- a/classes/class_performance.rst +++ b/classes/class_performance.rst @@ -332,11 +332,19 @@ Number of polygon edges that are considered connected by edge proximity :ref:`Na Number of navigation mesh polygon edges that could not be merged in the :ref:`NavigationServer3D`. The edges still may be connected by edge proximity or with links. +.. _class_Performance_constant_NAVIGATION_OBSTACLE_COUNT: + +.. rst-class:: classref-enumeration-constant + +:ref:`Monitor` **NAVIGATION_OBSTACLE_COUNT** = ``33`` + +Number of active navigation obstacles in the :ref:`NavigationServer3D`. + .. _class_Performance_constant_MONITOR_MAX: .. rst-class:: classref-enumeration-constant -:ref:`Monitor` **MONITOR_MAX** = ``33`` +:ref:`Monitor` **MONITOR_MAX** = ``34`` Represents the size of the :ref:`Monitor` enum. diff --git a/classes/class_polygon2d.rst b/classes/class_polygon2d.rst index 3ccc0cef189..ebcae4cf138 100644 --- a/classes/class_polygon2d.rst +++ b/classes/class_polygon2d.rst @@ -32,8 +32,6 @@ Properties +-----------------------------------------------------+------------------------------------------------------------------------------+--------------------------+ | :ref:`bool` | :ref:`antialiased` | ``false`` | +-----------------------------------------------------+------------------------------------------------------------------------------+--------------------------+ - | :ref:`Array` | :ref:`bones` | ``[]`` | - +-----------------------------------------------------+------------------------------------------------------------------------------+--------------------------+ | :ref:`Color` | :ref:`color` | ``Color(1, 1, 1, 1)`` | +-----------------------------------------------------+------------------------------------------------------------------------------+--------------------------+ | :ref:`int` | :ref:`internal_vertex_count` | ``0`` | @@ -115,18 +113,6 @@ If ``true``, polygon edges will be anti-aliased. ---- -.. _class_Polygon2D_property_bones: - -.. rst-class:: classref-property - -:ref:`Array` **bones** = ``[]`` :ref:`๐Ÿ”—` - -Internal list of :ref:`Bone2D` nodes used by the assigned :ref:`skeleton`. Edited using the Polygon2D editor ("UV" button on the top toolbar). - -.. rst-class:: classref-item-separator - ----- - .. _class_Polygon2D_property_color: .. rst-class:: classref-property diff --git a/classes/class_projectsettings.rst b/classes/class_projectsettings.rst index 0ff76597b42..3fd1314e449 100644 --- a/classes/class_projectsettings.rst +++ b/classes/class_projectsettings.rst @@ -277,6 +277,8 @@ Properties +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`debug/settings/gdscript/max_call_stack` | ``1024`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`debug/settings/physics_interpolation/enable_warnings` | ``true`` | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`debug/settings/profiler/max_functions` | ``16384`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`debug/settings/profiler/max_timestamp_query_elements` | ``256`` | @@ -493,7 +495,7 @@ Properties +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`editor/run/main_run_args` | ``""`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ - | :ref:`PackedStringArray` | :ref:`editor/script/search_in_file_extensions` | ``PackedStringArray("gd", "gdshader")`` | + | :ref:`PackedStringArray` | :ref:`editor/script/search_in_file_extensions` | | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`editor/script/templates_search_path` | ``"res://script_templates"`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ @@ -723,6 +725,14 @@ Properties +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`input_devices/pointing/emulate_touch_from_mouse` | ``false`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`input_devices/sensors/enable_accelerometer` | ``false`` | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`input_devices/sensors/enable_gravity` | ``false`` | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`input_devices/sensors/enable_gyroscope` | ``false`` | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`input_devices/sensors/enable_magnetometer` | ``false`` | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`internationalization/locale/fallback` | ``"en"`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`internationalization/locale/include_text_server_data` | ``false`` | @@ -1417,6 +1427,8 @@ Properties +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`rendering/lightmapping/denoising/denoiser` | ``0`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`rendering/lightmapping/lightmap_gi/use_bicubic_filter` | ``true`` | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`rendering/lightmapping/primitive_meshes/texel_size` | ``0.2`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`rendering/lightmapping/probe_capture/update_speed` | ``15`` | @@ -1583,6 +1595,8 @@ Properties +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`rendering/textures/lossless_compression/force_png` | ``false`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`rendering/textures/vram_compression/compress_with_gpu` | ``true`` | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`rendering/textures/vram_compression/import_etc2_astc` | ``false`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`rendering/textures/vram_compression/import_s3tc_bptc` | ``false`` | @@ -1613,7 +1627,11 @@ Properties +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`xr/openxr/extensions/hand_interaction_profile` | ``false`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ - | :ref:`bool` | :ref:`xr/openxr/extensions/hand_tracking` | ``true`` | + | :ref:`bool` | :ref:`xr/openxr/extensions/hand_tracking` | ``false`` | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`xr/openxr/extensions/hand_tracking_controller_data_source` | ``false`` | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`xr/openxr/extensions/hand_tracking_unobstructed_data_source` | ``false`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`xr/openxr/form_factor` | ``"0"`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ @@ -3188,6 +3206,20 @@ Maximum call stack allowed for debugging GDScript. ---- +.. _class_ProjectSettings_property_debug/settings/physics_interpolation/enable_warnings: + +.. rst-class:: classref-property + +:ref:`bool` **debug/settings/physics_interpolation/enable_warnings** = ``true`` :ref:`๐Ÿ”—` + +If ``true``, enables warnings which can help pinpoint where nodes are being incorrectly updated, which will result in incorrect interpolation and visual glitches. + +When a node is being interpolated, it is essential that the transform is set during :ref:`Node._physics_process` (during a physics tick) rather than :ref:`Node._process` (during a frame). + +.. rst-class:: classref-item-separator + +---- + .. _class_ProjectSettings_property_debug/settings/profiler/max_functions: .. rst-class:: classref-property @@ -4586,7 +4618,7 @@ For example, this can be used to force the project to run on the dedicated GPU i .. rst-class:: classref-property -:ref:`PackedStringArray` **editor/script/search_in_file_extensions** = ``PackedStringArray("gd", "gdshader")`` :ref:`๐Ÿ”—` +:ref:`PackedStringArray` **editor/script/search_in_file_extensions** :ref:`๐Ÿ”—` Text-based file extensions to include in the script editor's "Find in Files" feature. You can add e.g. ``tscn`` if you wish to also parse your scene files, especially if you use built-in scripts which are serialized in the scene files. @@ -6134,6 +6166,54 @@ If ``true``, sends touch input events when clicking or dragging the mouse. ---- +.. _class_ProjectSettings_property_input_devices/sensors/enable_accelerometer: + +.. rst-class:: classref-property + +:ref:`bool` **input_devices/sensors/enable_accelerometer** = ``false`` :ref:`๐Ÿ”—` + +If ``true``, the accelerometer sensor is enabled and :ref:`Input.get_accelerometer` returns valid data. + +.. rst-class:: classref-item-separator + +---- + +.. _class_ProjectSettings_property_input_devices/sensors/enable_gravity: + +.. rst-class:: classref-property + +:ref:`bool` **input_devices/sensors/enable_gravity** = ``false`` :ref:`๐Ÿ”—` + +If ``true``, the gravity sensor is enabled and :ref:`Input.get_gravity` returns valid data. + +.. rst-class:: classref-item-separator + +---- + +.. _class_ProjectSettings_property_input_devices/sensors/enable_gyroscope: + +.. rst-class:: classref-property + +:ref:`bool` **input_devices/sensors/enable_gyroscope** = ``false`` :ref:`๐Ÿ”—` + +If ``true``, the gyroscope sensor is enabled and :ref:`Input.get_gyroscope` returns valid data. + +.. rst-class:: classref-item-separator + +---- + +.. _class_ProjectSettings_property_input_devices/sensors/enable_magnetometer: + +.. rst-class:: classref-property + +:ref:`bool` **input_devices/sensors/enable_magnetometer** = ``false`` :ref:`๐Ÿ”—` + +If ``true``, the magnetometer sensor is enabled and :ref:`Input.get_magnetometer` returns valid data. + +.. rst-class:: classref-item-separator + +---- + .. _class_ProjectSettings_property_internationalization/locale/fallback: .. rst-class:: classref-property @@ -9552,7 +9632,9 @@ If ``true``, the renderer will interpolate the transforms of physics objects bet Controls how much physics ticks are synchronized with real time. For 0 or less, the ticks are synchronized. Such values are recommended for network games, where clock synchronization matters. Higher values cause higher deviation of in-game clock and real clock, but allows smoothing out framerate jitters. The default value of 0.5 should be good enough for most; values above 2 could cause the game to react to dropped frames with a noticeable delay and are not recommended. -\ **Note:** When using a physics interpolation solution (such as enabling :ref:`physics/common/physics_interpolation` or using a custom solution), the physics jitter fix should be disabled by setting :ref:`physics/common/physics_jitter_fix` to ``0.0``. +\ **Note:** Jitter fix is automatically disabled at runtime when :ref:`physics/common/physics_interpolation` is enabled. + +\ **Note:** When using a custom physics interpolation solution, the physics jitter fix should be disabled by setting :ref:`physics/common/physics_jitter_fix` to ``0.0``. \ **Note:** This property is only read when the project starts. To change the physics jitter fix at runtime, set :ref:`Engine.physics_jitter_fix` instead. @@ -10524,6 +10606,20 @@ If no GPU acceleration is configured on the system, multi-threaded CPU-based den ---- +.. _class_ProjectSettings_property_rendering/lightmapping/lightmap_gi/use_bicubic_filter: + +.. rst-class:: classref-property + +:ref:`bool` **rendering/lightmapping/lightmap_gi/use_bicubic_filter** = ``true`` :ref:`๐Ÿ”—` + +If ``true``, applies a bicubic filter during lightmap sampling. This makes lightmaps look much smoother, at a moderate performance cost. + +\ **Note:** The bicubic filter exaggerates the 'bleeding' effect that occurs when a lightmap's resolution is low enough. + +.. rst-class:: classref-item-separator + +---- + .. _class_ProjectSettings_property_rendering/lightmapping/primitive_meshes/texel_size: .. rst-class:: classref-property @@ -11628,6 +11724,22 @@ If ``true``, the texture importer will import lossless textures using the PNG fo ---- +.. _class_ProjectSettings_property_rendering/textures/vram_compression/compress_with_gpu: + +.. rst-class:: classref-property + +:ref:`bool` **rendering/textures/vram_compression/compress_with_gpu** = ``true`` :ref:`๐Ÿ”—` + +If ``true``, the texture importer will utilize the GPU for compressing textures, which makes large textures import significantly faster. + +\ **Note:** This setting requires either Vulkan or D3D12 available as a rendering backend. + +\ **Note:** Currently this only affects BC6H compression, which is used on Desktop and Console for HDR images. + +.. rst-class:: classref-item-separator + +---- + .. _class_ProjectSettings_property_rendering/textures/vram_compression/import_etc2_astc: .. rst-class:: classref-property @@ -11825,7 +11937,7 @@ Specify whether to enable eye tracking for this project. Depending on the platfo :ref:`bool` **xr/openxr/extensions/hand_interaction_profile** = ``false`` :ref:`๐Ÿ”—` -If true the hand interaction profile extension will be activated if supported by the platform. +If ``true`` the hand interaction profile extension will be activated if supported by the platform. .. rst-class:: classref-item-separator @@ -11835,9 +11947,39 @@ If true the hand interaction profile extension will be activated if supported by .. rst-class:: classref-property -:ref:`bool` **xr/openxr/extensions/hand_tracking** = ``true`` :ref:`๐Ÿ”—` +:ref:`bool` **xr/openxr/extensions/hand_tracking** = ``false`` :ref:`๐Ÿ”—` + +If ``true``, the hand tracking extension is enabled if available. + +\ **Note:** By default hand tracking will only work for data sources chosen by the XR runtime. For SteamVR this is the controller inferred data source, for most other runtimes this is the unobstructed data source. There is no way to query this. If a runtime supports the OpenXR data source extension you can use the :ref:`xr/openxr/extensions/hand_tracking_controller_data_source` and/or :ref:`xr/openxr/extensions/hand_tracking_unobstructed_data_source` to indicate you wish to enable these data sources. If neither is selected the data source extension is not enabled and the XR runtimes default behavior persists. + +.. rst-class:: classref-item-separator + +---- + +.. _class_ProjectSettings_property_xr/openxr/extensions/hand_tracking_controller_data_source: + +.. rst-class:: classref-property + +:ref:`bool` **xr/openxr/extensions/hand_tracking_controller_data_source** = ``false`` :ref:`๐Ÿ”—` + +If ``true``, support for the controller inferred data source is requested. If supported, you will receive hand tracking data even if the user has a controller in hand, with finger positions automatically inferred from controller input and/or sensors. + +\ **Node:** This requires the OpenXR data source extension and controller inferred handtracking to be supported by the XR runtime. If not supported this setting will be ignored. :ref:`xr/openxr/extensions/hand_tracking` must be enabled for this setting to be used. + +.. rst-class:: classref-item-separator + +---- + +.. _class_ProjectSettings_property_xr/openxr/extensions/hand_tracking_unobstructed_data_source: + +.. rst-class:: classref-property + +:ref:`bool` **xr/openxr/extensions/hand_tracking_unobstructed_data_source** = ``false`` :ref:`๐Ÿ”—` + +If ``true``, support for the unobstructed data source is requested. If supported, you will receive hand tracking data based on the actual finger positions of the user often determined by optical tracking. -If true we enable the hand tracking extension if available. +\ **Node:** This requires the OpenXR data source extension and unobstructed handtracking to be supported by the XR runtime. If not supported this setting will be ignored. :ref:`xr/openxr/extensions/hand_tracking` must be enabled for this setting to be used. .. rst-class:: classref-item-separator diff --git a/classes/class_rect2.rst b/classes/class_rect2.rst index 65d11ae327c..ba2d6e7f15c 100644 --- a/classes/class_rect2.rst +++ b/classes/class_rect2.rst @@ -95,6 +95,8 @@ Methods +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_center`\ (\ ) |const| | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Vector2` | :ref:`get_support`\ (\ direction\: :ref:`Vector2`\ ) |const| | + +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Rect2` | :ref:`grow`\ (\ amount\: :ref:`float`\ ) |const| | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Rect2` | :ref:`grow_individual`\ (\ left\: :ref:`float`, top\: :ref:`float`, right\: :ref:`float`, bottom\: :ref:`float`\ ) |const| | @@ -337,6 +339,18 @@ Returns the center point of the rectangle. This is the same as ``position + (siz ---- +.. _class_Rect2_method_get_support: + +.. rst-class:: classref-method + +:ref:`Vector2` **get_support**\ (\ direction\: :ref:`Vector2`\ ) |const| :ref:`๐Ÿ”—` + +Returns the vertex's position of this rect that's the farthest in the given direction. This point is commonly known as the support point in collision detection algorithms. + +.. rst-class:: classref-item-separator + +---- + .. _class_Rect2_method_grow: .. rst-class:: classref-method diff --git a/classes/class_renderingdevice.rst b/classes/class_renderingdevice.rst index d7e988760f8..1de51adadac 100644 --- a/classes/class_renderingdevice.rst +++ b/classes/class_renderingdevice.rst @@ -85,7 +85,7 @@ Methods +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`draw_command_insert_label`\ (\ name\: :ref:`String`, color\: :ref:`Color`\ ) | +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`draw_list_begin`\ (\ framebuffer\: :ref:`RID`, initial_color_action\: :ref:`InitialAction`, final_color_action\: :ref:`FinalAction`, initial_depth_action\: :ref:`InitialAction`, final_depth_action\: :ref:`FinalAction`, clear_color_values\: :ref:`PackedColorArray` = PackedColorArray(), clear_depth\: :ref:`float` = 1.0, clear_stencil\: :ref:`int` = 0, region\: :ref:`Rect2` = Rect2(0, 0, 0, 0)\ ) | + | :ref:`int` | :ref:`draw_list_begin`\ (\ framebuffer\: :ref:`RID`, initial_color_action\: :ref:`InitialAction`, final_color_action\: :ref:`FinalAction`, initial_depth_action\: :ref:`InitialAction`, final_depth_action\: :ref:`FinalAction`, clear_color_values\: :ref:`PackedColorArray` = PackedColorArray(), clear_depth\: :ref:`float` = 1.0, clear_stencil\: :ref:`int` = 0, region\: :ref:`Rect2` = Rect2(0, 0, 0, 0), breadcrumb\: :ref:`int` = 0\ ) | +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`draw_list_begin_for_screen`\ (\ screen\: :ref:`int` = 0, clear_color\: :ref:`Color` = Color(0, 0, 0, 1)\ ) | +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -147,18 +147,40 @@ Methods +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_captured_timestamps_frame`\ (\ ) |const| | +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_device_allocation_count`\ (\ ) |const| | + +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_device_allocs_by_object_type`\ (\ type\: :ref:`int`\ ) |const| | + +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_device_memory_by_object_type`\ (\ type\: :ref:`int`\ ) |const| | + +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_device_name`\ (\ ) |const| | +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_device_pipeline_cache_uuid`\ (\ ) |const| | +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_device_total_memory`\ (\ ) |const| | + +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_device_vendor_name`\ (\ ) |const| | +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_driver_allocation_count`\ (\ ) |const| | + +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_driver_allocs_by_object_type`\ (\ type\: :ref:`int`\ ) |const| | + +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_driver_memory_by_object_type`\ (\ type\: :ref:`int`\ ) |const| | + +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_driver_resource`\ (\ resource\: :ref:`DriverResource`, rid\: :ref:`RID`, index\: :ref:`int`\ ) | +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_driver_total_memory`\ (\ ) |const| | + +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_frame_delay`\ (\ ) |const| | +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_memory_usage`\ (\ type\: :ref:`MemoryType`\ ) |const| | +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_perf_report`\ (\ ) |const| | + +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`String` | :ref:`get_tracked_object_name`\ (\ type_index\: :ref:`int`\ ) |const| | + +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`get_tracked_object_type_count`\ (\ ) |const| | + +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`index_array_create`\ (\ index_buffer\: :ref:`RID`, index_offset\: :ref:`int`, index_count\: :ref:`int`\ ) | +------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`index_buffer_create`\ (\ size_indices\: :ref:`int`, format\: :ref:`IndexBufferFormat`, data\: :ref:`PackedByteArray` = PackedByteArray(), use_restart_indices\: :ref:`bool` = false\ ) | @@ -4507,6 +4529,172 @@ Memory taken by buffers. Total memory taken. This is greater than the sum of :ref:`MEMORY_TEXTURES` and :ref:`MEMORY_BUFFERS`, as it also includes miscellaneous memory usage. +.. rst-class:: classref-item-separator + +---- + +.. _enum_RenderingDevice_BreadcrumbMarker: + +.. rst-class:: classref-enumeration + +enum **BreadcrumbMarker**: :ref:`๐Ÿ”—` + +.. _class_RenderingDevice_constant_NONE: + +.. rst-class:: classref-enumeration-constant + +:ref:`BreadcrumbMarker` **NONE** = ``0`` + +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + + + +.. _class_RenderingDevice_constant_REFLECTION_PROBES: + +.. rst-class:: classref-enumeration-constant + +:ref:`BreadcrumbMarker` **REFLECTION_PROBES** = ``65536`` + +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + + + +.. _class_RenderingDevice_constant_SKY_PASS: + +.. rst-class:: classref-enumeration-constant + +:ref:`BreadcrumbMarker` **SKY_PASS** = ``131072`` + +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + + + +.. _class_RenderingDevice_constant_LIGHTMAPPER_PASS: + +.. rst-class:: classref-enumeration-constant + +:ref:`BreadcrumbMarker` **LIGHTMAPPER_PASS** = ``196608`` + +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + + + +.. _class_RenderingDevice_constant_SHADOW_PASS_DIRECTIONAL: + +.. rst-class:: classref-enumeration-constant + +:ref:`BreadcrumbMarker` **SHADOW_PASS_DIRECTIONAL** = ``262144`` + +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + + + +.. _class_RenderingDevice_constant_SHADOW_PASS_CUBE: + +.. rst-class:: classref-enumeration-constant + +:ref:`BreadcrumbMarker` **SHADOW_PASS_CUBE** = ``327680`` + +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + + + +.. _class_RenderingDevice_constant_OPAQUE_PASS: + +.. rst-class:: classref-enumeration-constant + +:ref:`BreadcrumbMarker` **OPAQUE_PASS** = ``393216`` + +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + + + +.. _class_RenderingDevice_constant_ALPHA_PASS: + +.. rst-class:: classref-enumeration-constant + +:ref:`BreadcrumbMarker` **ALPHA_PASS** = ``458752`` + +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + + + +.. _class_RenderingDevice_constant_TRANSPARENT_PASS: + +.. rst-class:: classref-enumeration-constant + +:ref:`BreadcrumbMarker` **TRANSPARENT_PASS** = ``524288`` + +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + + + +.. _class_RenderingDevice_constant_POST_PROCESSING_PASS: + +.. rst-class:: classref-enumeration-constant + +:ref:`BreadcrumbMarker` **POST_PROCESSING_PASS** = ``589824`` + +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + + + +.. _class_RenderingDevice_constant_BLIT_PASS: + +.. rst-class:: classref-enumeration-constant + +:ref:`BreadcrumbMarker` **BLIT_PASS** = ``655360`` + +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + + + +.. _class_RenderingDevice_constant_UI_PASS: + +.. rst-class:: classref-enumeration-constant + +:ref:`BreadcrumbMarker` **UI_PASS** = ``720896`` + +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + + + +.. _class_RenderingDevice_constant_DEBUG_PASS: + +.. rst-class:: classref-enumeration-constant + +:ref:`BreadcrumbMarker` **DEBUG_PASS** = ``786432`` + +.. container:: contribute + + There is currently no description for this enum. Please help us by :ref:`contributing one `! + + + .. rst-class:: classref-section-separator ---- @@ -4839,7 +5027,7 @@ This method does nothing. .. rst-class:: classref-method -:ref:`int` **draw_list_begin**\ (\ framebuffer\: :ref:`RID`, initial_color_action\: :ref:`InitialAction`, final_color_action\: :ref:`FinalAction`, initial_depth_action\: :ref:`InitialAction`, final_depth_action\: :ref:`FinalAction`, clear_color_values\: :ref:`PackedColorArray` = PackedColorArray(), clear_depth\: :ref:`float` = 1.0, clear_stencil\: :ref:`int` = 0, region\: :ref:`Rect2` = Rect2(0, 0, 0, 0)\ ) :ref:`๐Ÿ”—` +:ref:`int` **draw_list_begin**\ (\ framebuffer\: :ref:`RID`, initial_color_action\: :ref:`InitialAction`, final_color_action\: :ref:`FinalAction`, initial_depth_action\: :ref:`InitialAction`, final_depth_action\: :ref:`FinalAction`, clear_color_values\: :ref:`PackedColorArray` = PackedColorArray(), clear_depth\: :ref:`float` = 1.0, clear_stencil\: :ref:`int` = 0, region\: :ref:`Rect2` = Rect2(0, 0, 0, 0), breadcrumb\: :ref:`int` = 0\ ) :ref:`๐Ÿ”—` Starts a list of raster drawing commands created with the ``draw_*`` methods. The returned value should be passed to other ``draw_list_*`` functions. @@ -4851,7 +5039,7 @@ A simple drawing operation might look like this (code is not a complete example) var rd = RenderingDevice.new() var clear_colors = PackedColorArray([Color(0, 0, 0, 0), Color(0, 0, 0, 0), Color(0, 0, 0, 0)]) - var draw_list = rd.draw_list_begin(framebuffers[i], RenderingDevice.INITIAL_ACTION_CLEAR, RenderingDevice.FINAL_ACTION_READ, RenderingDevice.INITIAL_ACTION_CLEAR, RenderingDevice.FINAL_ACTION_DISCARD, clear_colors) + var draw_list = rd.draw_list_begin(framebuffers[i], RenderingDevice.INITIAL_ACTION_CLEAR, RenderingDevice.FINAL_ACTION_READ, RenderingDevice.INITIAL_ACTION_CLEAR, RenderingDevice.FINAL_ACTION_DISCARD, clear_colors, RenderingDevice.OPAQUE_PASS) # Draw opaque. rd.draw_list_bind_render_pipeline(draw_list, raster_pipeline) @@ -4866,6 +5054,14 @@ A simple drawing operation might look like this (code is not a complete example) rd.draw_list_end() +The ``breadcrumb`` parameter can be an arbitrary 32-bit integer that is useful to diagnose GPU crashes. If Godot is built in dev or debug mode; when the GPU crashes Godot will dump all shaders that were being executed at the time of the crash and the breadcrumb is useful to diagnose what passes did those shaders belong to. + +It does not affect rendering behavior and can be set to 0. It is recommended to use :ref:`BreadcrumbMarker` enumerations for consistency but it's not required. It is also possible to use bitwise operations to add extra data. e.g. + +:: + + rd.draw_list_begin(fb[i], RenderingDevice.INITIAL_ACTION_CLEAR, RenderingDevice.FINAL_ACTION_READ, RenderingDevice.INITIAL_ACTION_CLEAR, RenderingDevice.FINAL_ACTION_DISCARD, clear_colors, RenderingDevice.OPAQUE_PASS | 5) + .. rst-class:: classref-item-separator ---- @@ -5248,6 +5444,52 @@ Returns the index of the last frame rendered that has rendering timestamps avail ---- +.. _class_RenderingDevice_method_get_device_allocation_count: + +.. rst-class:: classref-method + +:ref:`int` **get_device_allocation_count**\ (\ ) |const| :ref:`๐Ÿ”—` + +Returns how many allocations the GPU has performed for internal driver structures. + +This is only used by Vulkan in Debug builds and can return 0 when this information is not tracked or unknown. + +.. rst-class:: classref-item-separator + +---- + +.. _class_RenderingDevice_method_get_device_allocs_by_object_type: + +.. rst-class:: classref-method + +:ref:`int` **get_device_allocs_by_object_type**\ (\ type\: :ref:`int`\ ) |const| :ref:`๐Ÿ”—` + +Same as :ref:`get_device_allocation_count` but filtered for a given object type. + +The type argument must be in range ``[0; get_tracked_object_type_count - 1]``. If :ref:`get_tracked_object_type_count` is 0, then type argument is ignored and always returns 0. + +This is only used by Vulkan in Debug builds and can return 0 when this information is not tracked or unknown. + +.. rst-class:: classref-item-separator + +---- + +.. _class_RenderingDevice_method_get_device_memory_by_object_type: + +.. rst-class:: classref-method + +:ref:`int` **get_device_memory_by_object_type**\ (\ type\: :ref:`int`\ ) |const| :ref:`๐Ÿ”—` + +Same as :ref:`get_device_total_memory` but filtered for a given object type. + +The type argument must be in range ``[0; get_tracked_object_type_count - 1]``. If :ref:`get_tracked_object_type_count` is 0, then type argument is ignored and always returns 0. + +This is only used by Vulkan in Debug builds and can return 0 when this information is not tracked or unknown. + +.. rst-class:: classref-item-separator + +---- + .. _class_RenderingDevice_method_get_device_name: .. rst-class:: classref-method @@ -5272,6 +5514,20 @@ Returns the universally unique identifier for the pipeline cache. This is used t ---- +.. _class_RenderingDevice_method_get_device_total_memory: + +.. rst-class:: classref-method + +:ref:`int` **get_device_total_memory**\ (\ ) |const| :ref:`๐Ÿ”—` + +Returns how much bytes the GPU is using. + +This is only used by Vulkan in Debug builds and can return 0 when this information is not tracked or unknown. + +.. rst-class:: classref-item-separator + +---- + .. _class_RenderingDevice_method_get_device_vendor_name: .. rst-class:: classref-method @@ -5284,6 +5540,52 @@ Returns the vendor of the video adapter (e.g. "NVIDIA Corporation"). Equivalent ---- +.. _class_RenderingDevice_method_get_driver_allocation_count: + +.. rst-class:: classref-method + +:ref:`int` **get_driver_allocation_count**\ (\ ) |const| :ref:`๐Ÿ”—` + +Returns how many allocations the GPU driver has performed for internal driver structures. + +This is only used by Vulkan in Debug builds and can return 0 when this information is not tracked or unknown. + +.. rst-class:: classref-item-separator + +---- + +.. _class_RenderingDevice_method_get_driver_allocs_by_object_type: + +.. rst-class:: classref-method + +:ref:`int` **get_driver_allocs_by_object_type**\ (\ type\: :ref:`int`\ ) |const| :ref:`๐Ÿ”—` + +Same as :ref:`get_driver_allocation_count` but filtered for a given object type. + +The type argument must be in range ``[0; get_tracked_object_type_count - 1]``. If :ref:`get_tracked_object_type_count` is 0, then type argument is ignored and always returns 0. + +This is only used by Vulkan in Debug builds and can return 0 when this information is not tracked or unknown. + +.. rst-class:: classref-item-separator + +---- + +.. _class_RenderingDevice_method_get_driver_memory_by_object_type: + +.. rst-class:: classref-method + +:ref:`int` **get_driver_memory_by_object_type**\ (\ type\: :ref:`int`\ ) |const| :ref:`๐Ÿ”—` + +Same as :ref:`get_driver_total_memory` but filtered for a given object type. + +The type argument must be in range ``[0; get_tracked_object_type_count - 1]``. If :ref:`get_tracked_object_type_count` is 0, then type argument is ignored and always returns 0. + +This is only used by Vulkan in Debug builds and can return 0 when this information is not tracked or unknown. + +.. rst-class:: classref-item-separator + +---- + .. _class_RenderingDevice_method_get_driver_resource: .. rst-class:: classref-method @@ -5296,6 +5598,20 @@ Returns the unique identifier of the driver ``resource`` for the specified ``rid ---- +.. _class_RenderingDevice_method_get_driver_total_memory: + +.. rst-class:: classref-method + +:ref:`int` **get_driver_total_memory**\ (\ ) |const| :ref:`๐Ÿ”—` + +Returns how much bytes the GPU driver is using for internal driver structures. + +This is only used by Vulkan in Debug builds and can return 0 when this information is not tracked or unknown. + +.. rst-class:: classref-item-separator + +---- + .. _class_RenderingDevice_method_get_frame_delay: .. rst-class:: classref-method @@ -5320,6 +5636,58 @@ Returns the memory usage in bytes corresponding to the given ``type``. When usin ---- +.. _class_RenderingDevice_method_get_perf_report: + +.. rst-class:: classref-method + +:ref:`String` **get_perf_report**\ (\ ) |const| :ref:`๐Ÿ”—` + +Returns a string with a performance report from the past frame. Updates every frame. + +.. rst-class:: classref-item-separator + +---- + +.. _class_RenderingDevice_method_get_tracked_object_name: + +.. rst-class:: classref-method + +:ref:`String` **get_tracked_object_name**\ (\ type_index\: :ref:`int`\ ) |const| :ref:`๐Ÿ”—` + +Returns the name of the type of object for the given ``type_index``. This value must be in range ``[0; get_tracked_object_type_count - 1]``. If :ref:`get_tracked_object_type_count` is 0, then type argument is ignored and always returns the same string. + +The return value is important because it gives meaning to the types passed to :ref:`get_driver_memory_by_object_type`, :ref:`get_driver_allocs_by_object_type`, :ref:`get_device_memory_by_object_type`, and :ref:`get_device_allocs_by_object_type`. Examples of strings it can return (not exhaustive): + +- DEVICE_MEMORY + +- PIPELINE_CACHE + +- SWAPCHAIN_KHR + +- COMMAND_POOL + +Thus if e.g. ``get_tracked_object_name(5)`` returns "COMMAND_POOL", then ``get_device_memory_by_object_type(5)`` returns the bytes used by the GPU for command pools. + +This is only used by Vulkan in Debug builds. + +.. rst-class:: classref-item-separator + +---- + +.. _class_RenderingDevice_method_get_tracked_object_type_count: + +.. rst-class:: classref-method + +:ref:`int` **get_tracked_object_type_count**\ (\ ) |const| :ref:`๐Ÿ”—` + +Returns how many types of trackable objects are. + +This is only used by Vulkan in Debug builds. + +.. rst-class:: classref-item-separator + +---- + .. _class_RenderingDevice_method_index_array_create: .. rst-class:: classref-method diff --git a/classes/class_renderingserver.rst b/classes/class_renderingserver.rst index 21fd6d7b8fc..85b1d47dbe3 100644 --- a/classes/class_renderingserver.rst +++ b/classes/class_renderingserver.rst @@ -477,6 +477,8 @@ Methods +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`instance_geometry_set_visibility_range`\ (\ instance\: :ref:`RID`, min\: :ref:`float`, max\: :ref:`float`, min_margin\: :ref:`float`, max_margin\: :ref:`float`, fade_mode\: :ref:`VisibilityRangeFadeMode`\ ) | +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`instance_reset_physics_interpolation`\ (\ instance\: :ref:`RID`\ ) | + +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`instance_set_base`\ (\ instance\: :ref:`RID`, base\: :ref:`RID`\ ) | +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`instance_set_blend_shape_weight`\ (\ instance\: :ref:`RID`, shape\: :ref:`int`, weight\: :ref:`float`\ ) | @@ -487,6 +489,8 @@ Methods +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`instance_set_ignore_culling`\ (\ instance\: :ref:`RID`, enabled\: :ref:`bool`\ ) | +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`instance_set_interpolated`\ (\ instance\: :ref:`RID`, interpolated\: :ref:`bool`\ ) | + +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`instance_set_layer_mask`\ (\ instance\: :ref:`RID`, mask\: :ref:`int`\ ) | +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`instance_set_pivot_data`\ (\ instance\: :ref:`RID`, sorting_offset\: :ref:`float`, use_aabb_center\: :ref:`bool`\ ) | @@ -561,6 +565,8 @@ Methods +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`lightmap_set_textures`\ (\ lightmap\: :ref:`RID`, light\: :ref:`RID`, uses_sh\: :ref:`bool`\ ) | +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`lightmaps_set_bicubic_filter`\ (\ enable\: :ref:`bool`\ ) | + +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`make_sphere_mesh`\ (\ latitudes\: :ref:`int`, longitudes\: :ref:`int`, radius\: :ref:`float`\ ) | +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`material_create`\ (\ ) | @@ -649,6 +655,8 @@ Methods +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Transform2D` | :ref:`multimesh_instance_get_transform_2d`\ (\ multimesh\: :ref:`RID`, index\: :ref:`int`\ ) |const| | +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`multimesh_instance_reset_physics_interpolation`\ (\ multimesh\: :ref:`RID`, index\: :ref:`int`\ ) | + +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`multimesh_instance_set_color`\ (\ multimesh\: :ref:`RID`, index\: :ref:`int`, color\: :ref:`Color`\ ) | +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`multimesh_instance_set_custom_data`\ (\ multimesh\: :ref:`RID`, index\: :ref:`int`, custom_data\: :ref:`Color`\ ) | @@ -659,10 +667,16 @@ Methods +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`multimesh_set_buffer`\ (\ multimesh\: :ref:`RID`, buffer\: :ref:`PackedFloat32Array`\ ) | +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`multimesh_set_buffer_interpolated`\ (\ multimesh\: :ref:`RID`, buffer\: :ref:`PackedFloat32Array`, buffer_previous\: :ref:`PackedFloat32Array`\ ) | + +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`multimesh_set_custom_aabb`\ (\ multimesh\: :ref:`RID`, aabb\: :ref:`AABB`\ ) | +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`multimesh_set_mesh`\ (\ multimesh\: :ref:`RID`, mesh\: :ref:`RID`\ ) | +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`multimesh_set_physics_interpolated`\ (\ multimesh\: :ref:`RID`, interpolated\: :ref:`bool`\ ) | + +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`multimesh_set_physics_interpolation_quality`\ (\ multimesh\: :ref:`RID`, quality\: :ref:`MultimeshPhysicsInterpolationQuality`\ ) | + +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`multimesh_set_visible_instances`\ (\ multimesh\: :ref:`RID`, visible\: :ref:`int`\ ) | +----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`occluder_create`\ (\ ) | @@ -1866,6 +1880,32 @@ Use :ref:`Transform3D` to store MultiMesh transform. ---- +.. _enum_RenderingServer_MultimeshPhysicsInterpolationQuality: + +.. rst-class:: classref-enumeration + +enum **MultimeshPhysicsInterpolationQuality**: :ref:`๐Ÿ”—` + +.. _class_RenderingServer_constant_MULTIMESH_INTERP_QUALITY_FAST: + +.. rst-class:: classref-enumeration-constant + +:ref:`MultimeshPhysicsInterpolationQuality` **MULTIMESH_INTERP_QUALITY_FAST** = ``0`` + +MultiMesh physics interpolation favors speed over quality. + +.. _class_RenderingServer_constant_MULTIMESH_INTERP_QUALITY_HIGH: + +.. rst-class:: classref-enumeration-constant + +:ref:`MultimeshPhysicsInterpolationQuality` **MULTIMESH_INTERP_QUALITY_HIGH** = ``1`` + +MultiMesh physics interpolation favors quality over speed. + +.. rst-class:: classref-item-separator + +---- + .. _enum_RenderingServer_LightProjectorFilter: .. rst-class:: classref-enumeration @@ -7086,7 +7126,9 @@ Sets the shape of the occluder polygon. |void| **canvas_set_item_mirroring**\ (\ canvas\: :ref:`RID`, item\: :ref:`RID`, mirroring\: :ref:`Vector2`\ ) :ref:`๐Ÿ”—` -A copy of the canvas item will be drawn with a local offset of the mirroring :ref:`Vector2`. +A copy of the canvas item will be drawn with a local offset of the ``mirroring``. + +\ **Note:** This is equivalent to calling :ref:`canvas_set_item_repeat` like ``canvas_set_item_repeat(item, mirroring, 1)``, with an additional check ensuring ``canvas`` is a parent of ``item``. .. rst-class:: classref-item-separator @@ -8432,6 +8474,20 @@ Sets the visibility range values for the given geometry instance. Equivalent to ---- +.. _class_RenderingServer_method_instance_reset_physics_interpolation: + +.. rst-class:: classref-method + +|void| **instance_reset_physics_interpolation**\ (\ instance\: :ref:`RID`\ ) :ref:`๐Ÿ”—` + +Prevents physics interpolation for the current physics tick. + +This is useful when moving an instance to a new location, to give an instantaneous change rather than interpolation from the previous location. + +.. rst-class:: classref-item-separator + +---- + .. _class_RenderingServer_method_instance_set_base: .. rst-class:: classref-method @@ -8492,6 +8548,18 @@ If ``true``, ignores both frustum and occlusion culling on the specified 3D geom ---- +.. _class_RenderingServer_method_instance_set_interpolated: + +.. rst-class:: classref-method + +|void| **instance_set_interpolated**\ (\ instance\: :ref:`RID`, interpolated\: :ref:`bool`\ ) :ref:`๐Ÿ”—` + +Turns on and off physics interpolation for the instance. + +.. rst-class:: classref-item-separator + +---- + .. _class_RenderingServer_method_instance_set_layer_mask: .. rst-class:: classref-method @@ -8962,6 +9030,18 @@ Set the textures on the given ``lightmap`` GI instance to the texture array poin ---- +.. _class_RenderingServer_method_lightmaps_set_bicubic_filter: + +.. rst-class:: classref-method + +|void| **lightmaps_set_bicubic_filter**\ (\ enable\: :ref:`bool`\ ) :ref:`๐Ÿ”—` + +Toggles whether a bicubic filter should be used when lightmaps are sampled. This smoothens their appearance at a performance cost. + +.. rst-class:: classref-item-separator + +---- + .. _class_RenderingServer_method_make_sphere_mesh: .. rst-class:: classref-method @@ -9526,6 +9606,20 @@ Returns the :ref:`Transform2D` of the specified instance. For ---- +.. _class_RenderingServer_method_multimesh_instance_reset_physics_interpolation: + +.. rst-class:: classref-method + +|void| **multimesh_instance_reset_physics_interpolation**\ (\ multimesh\: :ref:`RID`, index\: :ref:`int`\ ) :ref:`๐Ÿ”—` + +Prevents physics interpolation for the specified instance during the current physics tick. + +This is useful when moving an instance to a new location, to give an instantaneous change rather than interpolation from the previous location. + +.. rst-class:: classref-item-separator + +---- + .. _class_RenderingServer_method_multimesh_instance_set_color: .. rst-class:: classref-method @@ -9601,6 +9695,20 @@ The per-instance data size and expected data order is: ---- +.. _class_RenderingServer_method_multimesh_set_buffer_interpolated: + +.. rst-class:: classref-method + +|void| **multimesh_set_buffer_interpolated**\ (\ multimesh\: :ref:`RID`, buffer\: :ref:`PackedFloat32Array`, buffer_previous\: :ref:`PackedFloat32Array`\ ) :ref:`๐Ÿ”—` + +Alternative version of :ref:`multimesh_set_buffer` for use with physics interpolation. + +Takes both an array of current data and an array of data for the previous physics tick. + +.. rst-class:: classref-item-separator + +---- + .. _class_RenderingServer_method_multimesh_set_custom_aabb: .. rst-class:: classref-method @@ -9625,6 +9733,32 @@ Sets the mesh to be drawn by the multimesh. Equivalent to :ref:`MultiMesh.mesh`, interpolated\: :ref:`bool`\ ) :ref:`๐Ÿ”—` + +Turns on and off physics interpolation for this MultiMesh resource. + +.. rst-class:: classref-item-separator + +---- + +.. _class_RenderingServer_method_multimesh_set_physics_interpolation_quality: + +.. rst-class:: classref-method + +|void| **multimesh_set_physics_interpolation_quality**\ (\ multimesh\: :ref:`RID`, quality\: :ref:`MultimeshPhysicsInterpolationQuality`\ ) :ref:`๐Ÿ”—` + +Sets the physics interpolation quality for the :ref:`MultiMesh`. + +A value of :ref:`MULTIMESH_INTERP_QUALITY_FAST` gives fast but low quality interpolation, a value of :ref:`MULTIMESH_INTERP_QUALITY_HIGH` gives slower but higher quality interpolation. + +.. rst-class:: classref-item-separator + +---- + .. _class_RenderingServer_method_multimesh_set_visible_instances: .. rst-class:: classref-method diff --git a/classes/class_resourceimporterdynamicfont.rst b/classes/class_resourceimporterdynamicfont.rst index c0388887f2e..9cacce548df 100644 --- a/classes/class_resourceimporterdynamicfont.rst +++ b/classes/class_resourceimporterdynamicfont.rst @@ -73,7 +73,7 @@ Properties +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------+-----------+ | :ref:`Dictionary` | :ref:`script_support` | ``{}`` | +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------+-----------+ - | :ref:`int` | :ref:`subpixel_positioning` | ``1`` | + | :ref:`int` | :ref:`subpixel_positioning` | ``4`` | +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------+-----------+ .. rst-class:: classref-section-separator @@ -299,7 +299,7 @@ Override the list of language scripts supported by this font. If left empty, thi .. rst-class:: classref-property -:ref:`int` **subpixel_positioning** = ``1`` :ref:`๐Ÿ”—` +:ref:`int` **subpixel_positioning** = ``4`` :ref:`๐Ÿ”—` Subpixel positioning improves font rendering appearance, especially at smaller font sizes. The downside is that it takes more time to initially render the font, which can cause stuttering during gameplay, especially if used with large font sizes. This should be set to **Disabled** for fonts with a pixel art appearance. @@ -311,6 +311,8 @@ Subpixel positioning improves font rendering appearance, especially at smaller f \ **One Quarter of a Pixel:** Always perform precise subpixel positioning regardless of font size. Highest quality, slowest rendering. +\ **Auto (Except Pixel Fonts):** **Disabled** for the pixel style fonts (each glyph contours contain only straight horizontal and vertical lines), **Auto** for the other fonts. + .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_resourceimporterimagefont.rst b/classes/class_resourceimporterimagefont.rst index 989f5f61ffb..d6882106b0b 100644 --- a/classes/class_resourceimporterimagefont.rst +++ b/classes/class_resourceimporterimagefont.rst @@ -183,7 +183,7 @@ Margin to cut on the sides of the entire image. This can be used to cut parts of Kerning pairs for the font. Kerning pair adjust the spacing between two characters. -Each string consist of three space separated values: "from" string, "to" string and integer offset. Each combination form the two string for a kerning pair, e.g, ``ab cd -3`` will create kerning pairs ``ac``, ``ad``, ``bc``, and ``bd`` with offset ``-3``. +Each string consist of three space separated values: "from" string, "to" string and integer offset. Each combination form the two string for a kerning pair, e.g, ``ab cd -3`` will create kerning pairs ``ac``, ``ad``, ``bc``, and ``bd`` with offset ``-3``. ``\uXXXX`` escape sequences can be used to add Unicode characters. **Note:** The returned array is *copied* and any changes to it will not update the original property value. See :ref:`PackedStringArray` for more details. diff --git a/classes/class_resourceimporterobj.rst b/classes/class_resourceimporterobj.rst index db0de9ba1fd..cfc2b3127c6 100644 --- a/classes/class_resourceimporterobj.rst +++ b/classes/class_resourceimporterobj.rst @@ -45,8 +45,6 @@ Properties +-------------------------------+----------------------------------------------------------------------------------------------------------+----------------------+ | :ref:`Vector3` | :ref:`offset_mesh` | ``Vector3(0, 0, 0)`` | +-------------------------------+----------------------------------------------------------------------------------------------------------+----------------------+ - | :ref:`bool` | :ref:`optimize_mesh` | ``true`` | - +-------------------------------+----------------------------------------------------------------------------------------------------------+----------------------+ | :ref:`Vector3` | :ref:`scale_mesh` | ``Vector3(1, 1, 1)`` | +-------------------------------+----------------------------------------------------------------------------------------------------------+----------------------+ @@ -97,18 +95,6 @@ Offsets the mesh's data by the specified value. This can be used to work around ---- -.. _class_ResourceImporterOBJ_property_optimize_mesh: - -.. rst-class:: classref-property - -:ref:`bool` **optimize_mesh** = ``true`` :ref:`๐Ÿ”—` - -Unused parameter. This currently has no effect. - -.. rst-class:: classref-item-separator - ----- - .. _class_ResourceImporterOBJ_property_scale_mesh: .. rst-class:: classref-property diff --git a/classes/class_scriptlanguageextension.rst b/classes/class_scriptlanguageextension.rst index 5c3fde62ee9..4ad7879b7b4 100644 --- a/classes/class_scriptlanguageextension.rst +++ b/classes/class_scriptlanguageextension.rst @@ -127,6 +127,8 @@ Methods +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`_reload_all_scripts`\ (\ ) |virtual| | +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`_reload_scripts`\ (\ scripts\: :ref:`Array`, soft_reload\: :ref:`bool`\ ) |virtual| | + +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`_reload_tool_script`\ (\ script\: :ref:`Script`, soft_reload\: :ref:`bool`\ ) |virtual| | +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`_remove_named_global_constant`\ (\ name\: :ref:`StringName`\ ) |virtual| | @@ -1180,6 +1182,20 @@ Returns the line where the function is defined in the code, or ``-1`` if the fun ---- +.. _class_ScriptLanguageExtension_private_method__reload_scripts: + +.. rst-class:: classref-method + +|void| **_reload_scripts**\ (\ scripts\: :ref:`Array`, soft_reload\: :ref:`bool`\ ) |virtual| :ref:`๐Ÿ”—` + +.. container:: contribute + + There is currently no description for this method. Please help us by :ref:`contributing one `! + +.. rst-class:: classref-item-separator + +---- + .. _class_ScriptLanguageExtension_private_method__reload_tool_script: .. rst-class:: classref-method diff --git a/classes/class_shapecast2d.rst b/classes/class_shapecast2d.rst index fefcbd4e2df..0e93e897b49 100644 --- a/classes/class_shapecast2d.rst +++ b/classes/class_shapecast2d.rst @@ -153,7 +153,7 @@ If ``true``, collisions with :ref:`PhysicsBody2D`\ s will b - |void| **set_collision_mask**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_collision_mask**\ (\ ) -The shape's collision mask. Only objects in at least one collision layer enabled in the mask will be detected. +The shape's collision mask. Only objects in at least one collision layer enabled in the mask will be detected. See `Collision layers and masks <../tutorials/physics/physics_introduction.html#collision-layers-and-masks>`__ in the documentation for more information. .. rst-class:: classref-item-separator @@ -165,6 +165,10 @@ The shape's collision mask. Only objects in at least one collision layer enabled :ref:`Array` **collision_result** = ``[]`` :ref:`๐Ÿ”—` +.. rst-class:: classref-property-setget + +- :ref:`Array` **get_collision_result**\ (\ ) + Returns the complete collision information from the collision sweep. The data returned is the same as in the :ref:`PhysicsDirectSpaceState2D.get_rest_info` method. .. rst-class:: classref-item-separator @@ -250,7 +254,7 @@ The number of intersections can be limited with this parameter, to reduce the pr - |void| **set_shape**\ (\ value\: :ref:`Shape2D`\ ) - :ref:`Shape2D` **get_shape**\ (\ ) -The :ref:`Shape2D`-derived shape to be used for collision queries. +The shape to be used for collision queries. .. rst-class:: classref-item-separator @@ -267,7 +271,7 @@ The :ref:`Shape2D`-derived shape to be used for collision queries - |void| **set_target_position**\ (\ value\: :ref:`Vector2`\ ) - :ref:`Vector2` **get_target_position**\ (\ ) -The shape's destination point, relative to this node's ``position``. +The shape's destination point, relative to this node's :ref:`Node2D.position`. .. rst-class:: classref-section-separator @@ -284,7 +288,7 @@ Method Descriptions |void| **add_exception**\ (\ node\: :ref:`CollisionObject2D`\ ) :ref:`๐Ÿ”—` -Adds a collision exception so the shape does not report collisions with the specified :ref:`CollisionObject2D` node. +Adds a collision exception so the shape does not report collisions with the specified node. .. rst-class:: classref-item-separator @@ -322,7 +326,7 @@ Removes all collision exceptions for this shape. Updates the collision information for the shape immediately, without waiting for the next ``_physics_process`` call. Use this method, for example, when the shape or its parent has changed state. -\ **Note:** ``enabled == true`` is not required for this to work. +\ **Note:** Setting :ref:`enabled` to ``true`` is not required for this to work. .. rst-class:: classref-item-separator @@ -334,7 +338,7 @@ Updates the collision information for the shape immediately, without waiting for :ref:`float` **get_closest_collision_safe_fraction**\ (\ ) |const| :ref:`๐Ÿ”—` -The fraction from the **ShapeCast2D**'s origin to its :ref:`target_position` (between 0 and 1) of how far the shape can move without triggering a collision. +Returns the fraction from this cast's origin to its :ref:`target_position` of how far the shape can move without triggering a collision, as a value between ``0.0`` and ``1.0``. .. rst-class:: classref-item-separator @@ -346,7 +350,7 @@ The fraction from the **ShapeCast2D**'s origin to its :ref:`target_position` **get_closest_collision_unsafe_fraction**\ (\ ) |const| :ref:`๐Ÿ”—` -The fraction from the **ShapeCast2D**'s origin to its :ref:`target_position` (between 0 and 1) of how far the shape must move to trigger a collision. +Returns the fraction from this cast's origin to its :ref:`target_position` of how far the shape must move to trigger a collision, as a value between ``0.0`` and ``1.0``. In ideal conditions this would be the same as :ref:`get_closest_collision_safe_fraction`, however shape casting is calculated in discrete steps, so the precise point of collision can occur between two calculated positions. @@ -434,7 +438,7 @@ Returns the normal of one of the multiple collisions at ``index`` of the interse Returns the collision point of one of the multiple collisions at ``index`` where the shape intersects the colliding object. -\ **Note:** this point is in the **global** coordinate system. +\ **Note:** This point is in the **global** coordinate system. .. rst-class:: classref-item-separator @@ -458,7 +462,7 @@ Returns whether any object is intersecting with the shape's vector (considering |void| **remove_exception**\ (\ node\: :ref:`CollisionObject2D`\ ) :ref:`๐Ÿ”—` -Removes a collision exception so the shape does report collisions with the specified :ref:`CollisionObject2D` node. +Removes a collision exception so the shape does report collisions with the specified node. .. rst-class:: classref-item-separator diff --git a/classes/class_shapecast3d.rst b/classes/class_shapecast3d.rst index 09a71f904f8..cb1dc3cbd71 100644 --- a/classes/class_shapecast3d.rst +++ b/classes/class_shapecast3d.rst @@ -169,6 +169,10 @@ The shape's collision mask. Only objects in at least one collision layer enabled :ref:`Array` **collision_result** = ``[]`` :ref:`๐Ÿ”—` +.. rst-class:: classref-property-setget + +- :ref:`Array` **get_collision_result**\ (\ ) + Returns the complete collision information from the collision sweep. The data returned is the same as in the :ref:`PhysicsDirectSpaceState3D.get_rest_info` method. .. rst-class:: classref-item-separator @@ -273,7 +277,7 @@ The number of intersections can be limited with this parameter, to reduce the pr - |void| **set_shape**\ (\ value\: :ref:`Shape3D`\ ) - :ref:`Shape3D` **get_shape**\ (\ ) -The :ref:`Shape3D`-derived shape to be used for collision queries. +The shape to be used for collision queries. .. rst-class:: classref-item-separator @@ -290,7 +294,7 @@ The :ref:`Shape3D`-derived shape to be used for collision queries - |void| **set_target_position**\ (\ value\: :ref:`Vector3`\ ) - :ref:`Vector3` **get_target_position**\ (\ ) -The shape's destination point, relative to this node's ``position``. +The shape's destination point, relative to this node's :ref:`Node3D.position`. .. rst-class:: classref-section-separator @@ -307,7 +311,7 @@ Method Descriptions |void| **add_exception**\ (\ node\: :ref:`CollisionObject3D`\ ) :ref:`๐Ÿ”—` -Adds a collision exception so the shape does not report collisions with the specified :ref:`CollisionObject3D` node. +Adds a collision exception so the shape does not report collisions with the specified node. .. rst-class:: classref-item-separator @@ -331,7 +335,7 @@ Adds a collision exception so the shape does not report collisions with the spec |void| **clear_exceptions**\ (\ ) :ref:`๐Ÿ”—` -Removes all collision exceptions for this **ShapeCast3D**. +Removes all collision exceptions for this shape. .. rst-class:: classref-item-separator @@ -345,7 +349,7 @@ Removes all collision exceptions for this **ShapeCast3D**. Updates the collision information for the shape immediately, without waiting for the next ``_physics_process`` call. Use this method, for example, when the shape or its parent has changed state. -\ **Note:** ``enabled == true`` is not required for this to work. +\ **Note:** Setting :ref:`enabled` to ``true`` is not required for this to work. .. rst-class:: classref-item-separator @@ -357,7 +361,7 @@ Updates the collision information for the shape immediately, without waiting for :ref:`float` **get_closest_collision_safe_fraction**\ (\ ) |const| :ref:`๐Ÿ”—` -The fraction from the **ShapeCast3D**'s origin to its :ref:`target_position` (between 0 and 1) of how far the shape can move without triggering a collision. +Returns the fraction from this cast's origin to its :ref:`target_position` of how far the shape can move without triggering a collision, as a value between ``0.0`` and ``1.0``. .. rst-class:: classref-item-separator @@ -369,7 +373,7 @@ The fraction from the **ShapeCast3D**'s origin to its :ref:`target_position` **get_closest_collision_unsafe_fraction**\ (\ ) |const| :ref:`๐Ÿ”—` -The fraction from the **ShapeCast3D**'s origin to its :ref:`target_position` (between 0 and 1) of how far the shape must move to trigger a collision. +Returns the fraction from this cast's origin to its :ref:`target_position` of how far the shape must move to trigger a collision, as a value between ``0.0`` and ``1.0``. In ideal conditions this would be the same as :ref:`get_closest_collision_safe_fraction`, however shape casting is calculated in discrete steps, so the precise point of collision can occur between two calculated positions. @@ -457,7 +461,7 @@ Returns the normal of one of the multiple collisions at ``index`` of the interse Returns the collision point of one of the multiple collisions at ``index`` where the shape intersects the colliding object. -\ **Note:** this point is in the **global** coordinate system. +\ **Note:** This point is in the **global** coordinate system. .. rst-class:: classref-item-separator @@ -481,7 +485,7 @@ Returns whether any object is intersecting with the shape's vector (considering |void| **remove_exception**\ (\ node\: :ref:`CollisionObject3D`\ ) :ref:`๐Ÿ”—` -Removes a collision exception so the shape does report collisions with the specified :ref:`CollisionObject3D` node. +Removes a collision exception so the shape does report collisions with the specified node. .. rst-class:: classref-item-separator diff --git a/classes/class_textserver.rst b/classes/class_textserver.rst index 655d54c9d71..cd8c968acb0 100644 --- a/classes/class_textserver.rst +++ b/classes/class_textserver.rst @@ -157,6 +157,8 @@ Methods +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`font_get_supported_chars`\ (\ font_rid\: :ref:`RID`\ ) |const| | +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedInt32Array` | :ref:`font_get_supported_glyphs`\ (\ font_rid\: :ref:`RID`\ ) |const| | + +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`font_get_texture_count`\ (\ font_rid\: :ref:`RID`, size\: :ref:`Vector2i`\ ) |const| | +------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Image` | :ref:`font_get_texture_image`\ (\ font_rid\: :ref:`RID`, size\: :ref:`Vector2i`, texture_index\: :ref:`int`\ ) |const| | @@ -2250,6 +2252,18 @@ Returns a string containing all the characters available in the font. ---- +.. _class_TextServer_method_font_get_supported_glyphs: + +.. rst-class:: classref-method + +:ref:`PackedInt32Array` **font_get_supported_glyphs**\ (\ font_rid\: :ref:`RID`\ ) |const| :ref:`๐Ÿ”—` + +Returns an array containing all glyph indices in the font. + +.. rst-class:: classref-item-separator + +---- + .. _class_TextServer_method_font_get_texture_count: .. rst-class:: classref-method diff --git a/classes/class_textserverextension.rst b/classes/class_textserverextension.rst index 04c009aa4eb..45d910800d5 100644 --- a/classes/class_textserverextension.rst +++ b/classes/class_textserverextension.rst @@ -142,6 +142,8 @@ Methods +-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`_font_get_supported_chars`\ (\ font_rid\: :ref:`RID`\ ) |virtual| |const| | +-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`PackedInt32Array` | :ref:`_font_get_supported_glyphs`\ (\ font_rid\: :ref:`RID`\ ) |virtual| |const| | + +-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`_font_get_texture_count`\ (\ font_rid\: :ref:`RID`, size\: :ref:`Vector2i`\ ) |virtual| |const| | +-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Image` | :ref:`_font_get_texture_image`\ (\ font_rid\: :ref:`RID`, size\: :ref:`Vector2i`, texture_index\: :ref:`int`\ ) |virtual| |const| | @@ -1244,6 +1246,20 @@ Returns a string containing all the characters available in the font. ---- +.. _class_TextServerExtension_private_method__font_get_supported_glyphs: + +.. rst-class:: classref-method + +:ref:`PackedInt32Array` **_font_get_supported_glyphs**\ (\ font_rid\: :ref:`RID`\ ) |virtual| |const| :ref:`๐Ÿ”—` + +**Required.**\ + +Returns an array containing all glyph indices in the font. + +.. rst-class:: classref-item-separator + +---- + .. _class_TextServerExtension_private_method__font_get_texture_count: .. rst-class:: classref-method diff --git a/classes/class_tilemap.rst b/classes/class_tilemap.rst index 878c1b28d0b..c5afd5f3356 100644 --- a/classes/class_tilemap.rst +++ b/classes/class_tilemap.rst @@ -132,6 +132,12 @@ Methods +--------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Rect2i` | :ref:`get_used_rect`\ (\ ) |const| | +--------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_cell_flipped_h`\ (\ layer\: :ref:`int`, coords\: :ref:`Vector2i`, use_proxies\: :ref:`bool` = false\ ) |const| | + +--------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_cell_flipped_v`\ (\ layer\: :ref:`int`, coords\: :ref:`Vector2i`, use_proxies\: :ref:`bool` = false\ ) |const| | + +--------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_cell_transposed`\ (\ layer\: :ref:`int`, coords\: :ref:`Vector2i`, use_proxies\: :ref:`bool` = false\ ) |const| | + +--------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_layer_enabled`\ (\ layer\: :ref:`int`\ ) |const| | +--------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_layer_navigation_enabled`\ (\ layer\: :ref:`int`\ ) |const| | @@ -732,6 +738,42 @@ Returns a rectangle enclosing the used (non-empty) tiles of the map, including a ---- +.. _class_TileMap_method_is_cell_flipped_h: + +.. rst-class:: classref-method + +:ref:`bool` **is_cell_flipped_h**\ (\ layer\: :ref:`int`, coords\: :ref:`Vector2i`, use_proxies\: :ref:`bool` = false\ ) |const| :ref:`๐Ÿ”—` + +Returns ``true`` if the cell on layer ``layer`` at coordinates ``coords`` is flipped horizontally. The result is valid only for atlas sources. + +.. rst-class:: classref-item-separator + +---- + +.. _class_TileMap_method_is_cell_flipped_v: + +.. rst-class:: classref-method + +:ref:`bool` **is_cell_flipped_v**\ (\ layer\: :ref:`int`, coords\: :ref:`Vector2i`, use_proxies\: :ref:`bool` = false\ ) |const| :ref:`๐Ÿ”—` + +Returns ``true`` if the cell on layer ``layer`` at coordinates ``coords`` is flipped vertically. The result is valid only for atlas sources. + +.. rst-class:: classref-item-separator + +---- + +.. _class_TileMap_method_is_cell_transposed: + +.. rst-class:: classref-method + +:ref:`bool` **is_cell_transposed**\ (\ layer\: :ref:`int`, coords\: :ref:`Vector2i`, use_proxies\: :ref:`bool` = false\ ) |const| :ref:`๐Ÿ”—` + +Returns ``true`` if the cell on layer ``layer`` at coordinates ``coords`` is transposed. The result is valid only for atlas sources. + +.. rst-class:: classref-item-separator + +---- + .. _class_TileMap_method_is_layer_enabled: .. rst-class:: classref-method diff --git a/classes/class_tilemaplayer.rst b/classes/class_tilemaplayer.rst index 62145b9fa45..01eb6878870 100644 --- a/classes/class_tilemaplayer.rst +++ b/classes/class_tilemaplayer.rst @@ -102,6 +102,12 @@ Methods +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_body_rid`\ (\ body\: :ref:`RID`\ ) |const| | +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_cell_flipped_h`\ (\ coords\: :ref:`Vector2i`\ ) |const| | + +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_cell_flipped_v`\ (\ coords\: :ref:`Vector2i`\ ) |const| | + +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`is_cell_transposed`\ (\ coords\: :ref:`Vector2i`\ ) |const| | + +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2i` | :ref:`local_to_map`\ (\ local_position\: :ref:`Vector2`\ ) |const| | +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2i` | :ref:`map_pattern`\ (\ position_in_tilemap\: :ref:`Vector2i`, coords_in_pattern\: :ref:`Vector2i`, pattern\: :ref:`TileMapPattern`\ ) | @@ -630,6 +636,42 @@ Returns whether the provided ``body`` :ref:`RID` belongs to one of th ---- +.. _class_TileMapLayer_method_is_cell_flipped_h: + +.. rst-class:: classref-method + +:ref:`bool` **is_cell_flipped_h**\ (\ coords\: :ref:`Vector2i`\ ) |const| :ref:`๐Ÿ”—` + +Returns ``true`` if the cell at coordinates ``coords`` is flipped horizontally. The result is valid only for atlas sources. + +.. rst-class:: classref-item-separator + +---- + +.. _class_TileMapLayer_method_is_cell_flipped_v: + +.. rst-class:: classref-method + +:ref:`bool` **is_cell_flipped_v**\ (\ coords\: :ref:`Vector2i`\ ) |const| :ref:`๐Ÿ”—` + +Returns ``true`` if the cell at coordinates ``coords`` is flipped vertically. The result is valid only for atlas sources. + +.. rst-class:: classref-item-separator + +---- + +.. _class_TileMapLayer_method_is_cell_transposed: + +.. rst-class:: classref-method + +:ref:`bool` **is_cell_transposed**\ (\ coords\: :ref:`Vector2i`\ ) |const| :ref:`๐Ÿ”—` + +Returns ``true`` if the cell at coordinates ``coords`` is transposed. The result is valid only for atlas sources. + +.. rst-class:: classref-item-separator + +---- + .. _class_TileMapLayer_method_local_to_map: .. rst-class:: classref-method diff --git a/classes/class_timer.rst b/classes/class_timer.rst index fee0bdb49e2..0b0a08f8f1b 100644 --- a/classes/class_timer.rst +++ b/classes/class_timer.rst @@ -266,7 +266,7 @@ Returns ``true`` if the timer is stopped or has not started. |void| **start**\ (\ time_sec\: :ref:`float` = -1\ ) :ref:`๐Ÿ”—` -Starts the timer, if it was not started already. Fails if the timer is not inside the tree. If ``time_sec`` is greater than ``0``, this value is used for the :ref:`wait_time`. +Starts the timer, or resets the timer if it was started already. Fails if the timer is not inside the tree. If ``time_sec`` is greater than ``0``, this value is used for the :ref:`wait_time`. \ **Note:** This method does not resume a paused timer. See :ref:`paused`. diff --git a/classes/class_viewport.rst b/classes/class_viewport.rst index a49e66d7ff7..94a5041bc30 100644 --- a/classes/class_viewport.rst +++ b/classes/class_viewport.rst @@ -60,99 +60,101 @@ Properties .. table:: :widths: auto - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`bool` | :ref:`audio_listener_enable_2d` | ``false`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`bool` | :ref:`audio_listener_enable_3d` | ``false`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`int` | :ref:`canvas_cull_mask` | ``4294967295`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`DefaultCanvasItemTextureFilter` | :ref:`canvas_item_default_texture_filter` | ``1`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`DefaultCanvasItemTextureRepeat` | :ref:`canvas_item_default_texture_repeat` | ``0`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`Transform2D` | :ref:`canvas_transform` | | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`DebugDraw` | :ref:`debug_draw` | ``0`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`bool` | :ref:`disable_3d` | ``false`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`float` | :ref:`fsr_sharpness` | ``0.2`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`Transform2D` | :ref:`global_canvas_transform` | | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`bool` | :ref:`gui_disable_input` | ``false`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`bool` | :ref:`gui_embed_subwindows` | ``false`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`bool` | :ref:`gui_snap_controls_to_pixels` | ``true`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`bool` | :ref:`handle_input_locally` | ``true`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`float` | :ref:`mesh_lod_threshold` | ``1.0`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`MSAA` | :ref:`msaa_2d` | ``0`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`MSAA` | :ref:`msaa_3d` | ``0`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`bool` | :ref:`own_world_3d` | ``false`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`bool` | :ref:`physics_object_picking` | ``false`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`bool` | :ref:`physics_object_picking_first_only` | ``false`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`bool` | :ref:`physics_object_picking_sort` | ``false`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`bool` | :ref:`positional_shadow_atlas_16_bits` | ``true`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`PositionalShadowAtlasQuadrantSubdiv` | :ref:`positional_shadow_atlas_quad_0` | ``2`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`PositionalShadowAtlasQuadrantSubdiv` | :ref:`positional_shadow_atlas_quad_1` | ``2`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`PositionalShadowAtlasQuadrantSubdiv` | :ref:`positional_shadow_atlas_quad_2` | ``3`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`PositionalShadowAtlasQuadrantSubdiv` | :ref:`positional_shadow_atlas_quad_3` | ``4`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`int` | :ref:`positional_shadow_atlas_size` | ``2048`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`Scaling3DMode` | :ref:`scaling_3d_mode` | ``0`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`float` | :ref:`scaling_3d_scale` | ``1.0`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`ScreenSpaceAA` | :ref:`screen_space_aa` | ``0`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`SDFOversize` | :ref:`sdf_oversize` | ``1`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`SDFScale` | :ref:`sdf_scale` | ``1`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`bool` | :ref:`snap_2d_transforms_to_pixel` | ``false`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`bool` | :ref:`snap_2d_vertices_to_pixel` | ``false`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`float` | :ref:`texture_mipmap_bias` | ``0.0`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`bool` | :ref:`transparent_bg` | ``false`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`bool` | :ref:`use_debanding` | ``false`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`bool` | :ref:`use_hdr_2d` | ``false`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`bool` | :ref:`use_occlusion_culling` | ``false`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`bool` | :ref:`use_taa` | ``false`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`bool` | :ref:`use_xr` | ``false`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`VRSMode` | :ref:`vrs_mode` | ``0`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`Texture2D` | :ref:`vrs_texture` | | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`VRSUpdateMode` | :ref:`vrs_update_mode` | ``1`` | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`World2D` | :ref:`world_2d` | | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ - | :ref:`World3D` | :ref:`world_3d` | | - +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+----------------+ + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`audio_listener_enable_2d` | ``false`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`audio_listener_enable_3d` | ``false`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`canvas_cull_mask` | ``4294967295`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`DefaultCanvasItemTextureFilter` | :ref:`canvas_item_default_texture_filter` | ``1`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`DefaultCanvasItemTextureRepeat` | :ref:`canvas_item_default_texture_repeat` | ``0`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`Transform2D` | :ref:`canvas_transform` | | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`DebugDraw` | :ref:`debug_draw` | ``0`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`disable_3d` | ``false`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`fsr_sharpness` | ``0.2`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`Transform2D` | :ref:`global_canvas_transform` | | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`gui_disable_input` | ``false`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`gui_embed_subwindows` | ``false`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`gui_snap_controls_to_pixels` | ``true`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`handle_input_locally` | ``true`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`mesh_lod_threshold` | ``1.0`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`MSAA` | :ref:`msaa_2d` | ``0`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`MSAA` | :ref:`msaa_3d` | ``0`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`own_world_3d` | ``false`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`PhysicsInterpolationMode` | physics_interpolation_mode | ``1`` (overrides :ref:`Node`) | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`physics_object_picking` | ``false`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`physics_object_picking_first_only` | ``false`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`physics_object_picking_sort` | ``false`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`positional_shadow_atlas_16_bits` | ``true`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`PositionalShadowAtlasQuadrantSubdiv` | :ref:`positional_shadow_atlas_quad_0` | ``2`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`PositionalShadowAtlasQuadrantSubdiv` | :ref:`positional_shadow_atlas_quad_1` | ``2`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`PositionalShadowAtlasQuadrantSubdiv` | :ref:`positional_shadow_atlas_quad_2` | ``3`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`PositionalShadowAtlasQuadrantSubdiv` | :ref:`positional_shadow_atlas_quad_3` | ``4`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`int` | :ref:`positional_shadow_atlas_size` | ``2048`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`Scaling3DMode` | :ref:`scaling_3d_mode` | ``0`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`scaling_3d_scale` | ``1.0`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`ScreenSpaceAA` | :ref:`screen_space_aa` | ``0`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`SDFOversize` | :ref:`sdf_oversize` | ``1`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`SDFScale` | :ref:`sdf_scale` | ``1`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`snap_2d_transforms_to_pixel` | ``false`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`snap_2d_vertices_to_pixel` | ``false`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`float` | :ref:`texture_mipmap_bias` | ``0.0`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`transparent_bg` | ``false`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`use_debanding` | ``false`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`use_hdr_2d` | ``false`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`use_occlusion_culling` | ``false`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`use_taa` | ``false`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`use_xr` | ``false`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`VRSMode` | :ref:`vrs_mode` | ``0`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`Texture2D` | :ref:`vrs_texture` | | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`VRSUpdateMode` | :ref:`vrs_update_mode` | ``1`` | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`World2D` | :ref:`world_2d` | | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ + | :ref:`World3D` | :ref:`world_3d` | | + +-----------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ .. rst-class:: classref-reftable-group @@ -2051,6 +2053,8 @@ Returns the viewport's texture. await RenderingServer.frame_post_draw $Viewport.get_texture().get_image().save_png("user://Screenshot.png") +\ **Note:** When :ref:`use_hdr_2d` is ``true`` the returned texture will be an HDR image encoded in linear space. + .. rst-class:: classref-item-separator ---- diff --git a/classes/class_viewporttexture.rst b/classes/class_viewporttexture.rst index 96387139a62..2684c184d88 100644 --- a/classes/class_viewporttexture.rst +++ b/classes/class_viewporttexture.rst @@ -27,6 +27,13 @@ To get a **ViewportTexture** in code, use the :ref:`Viewport.get_texture` with :ref:`Viewport.use_hdr_2d` set to ``true`` the returned texture will be an HDR image encoded in linear space. This may look darker than normal when displayed directly on screen. To convert to gamma space, you can do the following: + +:: + + img.convert(Image.FORMAT_RGBA8) + imb.linear_to_srgb() + .. rst-class:: classref-introduction-group Tutorials diff --git a/classes/class_visualinstance3d.rst b/classes/class_visualinstance3d.rst index 713d99f60ff..4645f7c459b 100644 --- a/classes/class_visualinstance3d.rst +++ b/classes/class_visualinstance3d.rst @@ -12,7 +12,7 @@ VisualInstance3D **Inherits:** :ref:`Node3D` **<** :ref:`Node` **<** :ref:`Object` -**Inherited By:** :ref:`Decal`, :ref:`FogVolume`, :ref:`GeometryInstance3D`, :ref:`GPUParticlesAttractor3D`, :ref:`GPUParticlesCollision3D`, :ref:`Light3D`, :ref:`LightmapGI`, :ref:`OccluderInstance3D`, :ref:`ReflectionProbe`, :ref:`RootMotionView`, :ref:`VisibleOnScreenNotifier3D`, :ref:`VoxelGI` +**Inherited By:** :ref:`Decal`, :ref:`FogVolume`, :ref:`GeometryInstance3D`, :ref:`GPUParticlesAttractor3D`, :ref:`GPUParticlesCollision3D`, :ref:`Light3D`, :ref:`LightmapGI`, :ref:`OccluderInstance3D`, :ref:`OpenXRVisibilityMask`, :ref:`ReflectionProbe`, :ref:`RootMotionView`, :ref:`VisibleOnScreenNotifier3D`, :ref:`VoxelGI` Parent of all visual 3D nodes. diff --git a/classes/class_visualshadernodeintparameter.rst b/classes/class_visualshadernodeintparameter.rst index ee79ad55fc1..bb727fd7a96 100644 --- a/classes/class_visualshadernodeintparameter.rst +++ b/classes/class_visualshadernodeintparameter.rst @@ -29,19 +29,21 @@ Properties .. table:: :widths: auto - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+-----------+ - | :ref:`int` | :ref:`default_value` | ``0`` | - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+-----------+ - | :ref:`bool` | :ref:`default_value_enabled` | ``false`` | - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+-----------+ - | :ref:`Hint` | :ref:`hint` | ``0`` | - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+-----------+ - | :ref:`int` | :ref:`max` | ``100`` | - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+-----------+ - | :ref:`int` | :ref:`min` | ``0`` | - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+-----------+ - | :ref:`int` | :ref:`step` | ``1`` | - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+-----------+ + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------+ + | :ref:`int` | :ref:`default_value` | ``0`` | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------+ + | :ref:`bool` | :ref:`default_value_enabled` | ``false`` | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------+ + | :ref:`PackedStringArray` | :ref:`enum_names` | ``PackedStringArray()`` | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------+ + | :ref:`Hint` | :ref:`hint` | ``0`` | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------+ + | :ref:`int` | :ref:`max` | ``100`` | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------+ + | :ref:`int` | :ref:`min` | ``0`` | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------+ + | :ref:`int` | :ref:`step` | ``1`` | + +-----------------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------+ .. rst-class:: classref-section-separator @@ -82,11 +84,19 @@ The parameter's value must be within the specified :ref:`min` between values. +.. _class_VisualShaderNodeIntParameter_constant_HINT_ENUM: + +.. rst-class:: classref-enumeration-constant + +:ref:`Hint` **HINT_ENUM** = ``3`` + +The parameter uses an enum to associate preset values to names in the editor. + .. _class_VisualShaderNodeIntParameter_constant_HINT_MAX: .. rst-class:: classref-enumeration-constant -:ref:`Hint` **HINT_MAX** = ``3`` +:ref:`Hint` **HINT_MAX** = ``4`` Represents the size of the :ref:`Hint` enum. @@ -133,6 +143,25 @@ If ``true``, the node will have a custom default value. ---- +.. _class_VisualShaderNodeIntParameter_property_enum_names: + +.. rst-class:: classref-property + +:ref:`PackedStringArray` **enum_names** = ``PackedStringArray()`` :ref:`๐Ÿ”—` + +.. rst-class:: classref-property-setget + +- |void| **set_enum_names**\ (\ value\: :ref:`PackedStringArray`\ ) +- :ref:`PackedStringArray` **get_enum_names**\ (\ ) + +The names used for the enum select in the editor. :ref:`hint` must be :ref:`HINT_ENUM` for this to take effect. + +**Note:** The returned array is *copied* and any changes to it will not update the original property value. See :ref:`PackedStringArray` for more details. + +.. rst-class:: classref-item-separator + +---- + .. _class_VisualShaderNodeIntParameter_property_hint: .. rst-class:: classref-property diff --git a/classes/class_xrhandtracker.rst b/classes/class_xrhandtracker.rst index 9aeb48e332c..8fbfbbf92a9 100644 --- a/classes/class_xrhandtracker.rst +++ b/classes/class_xrhandtracker.rst @@ -117,11 +117,19 @@ The source of hand tracking data is unobstructed, meaning that an accurate metho The source of hand tracking data is a controller, meaning that joint positions are inferred from controller inputs. +.. _class_XRHandTracker_constant_HAND_TRACKING_SOURCE_NOT_TRACKED: + +.. rst-class:: classref-enumeration-constant + +:ref:`HandTrackingSource` **HAND_TRACKING_SOURCE_NOT_TRACKED** = ``3`` + +No hand tracking data is tracked, this either means the hand is obscured, the controller is turned off, or tracking is not supported for the current input type. + .. _class_XRHandTracker_constant_HAND_TRACKING_SOURCE_MAX: .. rst-class:: classref-enumeration-constant -:ref:`HandTrackingSource` **HAND_TRACKING_SOURCE_MAX** = ``3`` +:ref:`HandTrackingSource` **HAND_TRACKING_SOURCE_MAX** = ``4`` Represents the size of the :ref:`HandTrackingSource` enum. diff --git a/classes/index.rst b/classes/index.rst index fd3c02edabc..f6bcfbcc85d 100644 --- a/classes/index.rst +++ b/classes/index.rst @@ -177,6 +177,7 @@ Nodes class_openxrcompositionlayerequirect class_openxrcompositionlayerquad class_openxrhand + class_openxrvisibilitymask class_optionbutton class_panel class_panelcontainer @@ -406,6 +407,7 @@ Resources class_fontvariation class_gdextension class_gdscript + class_gdscriptsyntaxhighlighter class_gltfaccessor class_gltfanimation class_gltfbufferview diff --git a/conf.py b/conf.py index 49616ce43b2..2b4a71149c9 100644 --- a/conf.py +++ b/conf.py @@ -194,7 +194,7 @@ # Set this to `True` when in the `latest` branch to clearly indicate to the reader # that they are not reading the `stable` documentation. "godot_is_latest": True, - "godot_version": "4.3", + "godot_version": "4.4", # Enables a banner that displays the up-to-date status of each article. "godot_show_article_status": True, # Display user-contributed notes at the bottom of pages that don't have `:allow_comments: False` at the top. diff --git a/contributing/development/best_practices_for_engine_contributors.rst b/contributing/development/best_practices_for_engine_contributors.rst index 87fdf14a000..b0dd1de5608 100644 --- a/contributing/development/best_practices_for_engine_contributors.rst +++ b/contributing/development/best_practices_for_engine_contributors.rst @@ -167,7 +167,7 @@ who design software) to actually understand all future user needs. Trying to write very flexible structures that cater to many use cases at once is often a mistake. -We may come up with something we believe is brilliant but later find out that +We may come up with something we believe is brilliant, but later find out that users will never even use half of it or that they require features that don't quite fit into our original design, forcing us to either throw it away or make it even more complex. diff --git a/contributing/development/code_style_guidelines.rst b/contributing/development/code_style_guidelines.rst index 2b6e681a6c3..0d4fbd5defe 100644 --- a/contributing/development/code_style_guidelines.rst +++ b/contributing/development/code_style_guidelines.rst @@ -35,7 +35,7 @@ fine. If you plan to contribute regularly, however, we strongly advise that you set up clang-format locally to check and automatically fix all your commits. .. warning:: Godot's code style should *not* be applied to third-party code, - i.e. that is included in Godot's source tree but was not written + i.e. code that is included in Godot's source tree, but was not written specifically for our project. Such code usually comes from different upstream projects with their own style guides (or lack thereof), and don't want to introduce differences that would make @@ -65,7 +65,7 @@ Pre-commit hook ^^^^^^^^^^^^^^^ For ease of use, we provide hooks for Git with the `pre-commit `__ -Python framework that will run clang-format automatically on all your commits with the +Python framework that will run clang-format automatically on all your commits with the correct version of clang-format. To set up: @@ -77,7 +77,7 @@ To set up: You can also run the hook manually with ``pre-commit run``. -.. note:: +.. note:: Previously, we supplied a hook in the folder ``misc/hooks``. If you copied the script manually, these hooks should still work, but symlinks will be broken. @@ -382,7 +382,7 @@ instead. // ... } -For member variables, don't use Javadoc-style comments but use single-line comments instead: +For member variables, don't use Javadoc-style comments, but use single-line comments instead: .. code-block:: cpp diff --git a/contributing/development/compiling/introduction_to_the_buildsystem.rst b/contributing/development/compiling/introduction_to_the_buildsystem.rst index 2b01c0f8a59..47f9f254f0f 100644 --- a/contributing/development/compiling/introduction_to_the_buildsystem.rst +++ b/contributing/development/compiling/introduction_to_the_buildsystem.rst @@ -403,7 +403,7 @@ To perform an SCU build, use the ``scu_build=yes`` SCons option. regular build prior to submitting the PR. This is because SCU builds by nature include headers from earlier ``.cpp`` files in the translation unit, therefore won't catch all the includes you will - need in a regular build. The CI will catch these errors but it will + need in a regular build. The CI will catch these errors, but it will usually be faster to catch them on a local build on your machine. Export templates diff --git a/contributing/development/configuring_an_ide/visual_studio_code.rst b/contributing/development/configuring_an_ide/visual_studio_code.rst index 919f7e04273..165b2a14b2e 100644 --- a/contributing/development/configuring_an_ide/visual_studio_code.rst +++ b/contributing/development/configuring_an_ide/visual_studio_code.rst @@ -115,7 +115,7 @@ To run and debug the project you need to create a new configuration in the ``lau }, { "description": "Load custom pretty-printers for Godot types.", - "text": "source ${workspaceRoot}/misc/scripts/godot_gdb_pretty_print.py" + "text": "source ${workspaceRoot}/misc/utility/godot_gdb_pretty_print.py" } ], "preLaunchTask": "build" diff --git a/contributing/development/core_and_modules/custom_godot_servers.rst b/contributing/development/core_and_modules/custom_godot_servers.rst index 798c3b8d4bc..0158092b0be 100644 --- a/contributing/development/core_and_modules/custom_godot_servers.rst +++ b/contributing/development/core_and_modules/custom_godot_servers.rst @@ -483,7 +483,7 @@ Here is the GDScript sample code: func _ready(): print("Start debugging") - HilbertHotel.connect("occupy_room", self, "_print_occupy_room") + HilbertHotel.occupy_room.connect(_print_occupy_room) var rid = HilbertHotel.create_bus() OS.delay_msec(2000) HilbertHotel.create_bus() diff --git a/contributing/documentation/building_the_manual.rst b/contributing/documentation/building_the_manual.rst index 4ac1d5059b4..a3752d14ecf 100644 --- a/contributing/documentation/building_the_manual.rst +++ b/contributing/documentation/building_the_manual.rst @@ -120,7 +120,7 @@ If you run into errors, you may try the following command: If you get a ``MemoryError`` or ``EOFError``, you can remove the ``classes/`` folder and run ``make`` again. -This will drop the class references from the final HTML documentation but will keep the +This will drop the class references from the final HTML documentation, but will keep the rest intact. .. important:: @@ -166,4 +166,4 @@ You can specify a list of files to build, which can greatly speed up compilation .. code:: sh - make FILELIST='classes/class_node.rst classes/class_resource.rst' html + make html FILELIST='classes/class_node.rst classes/class_resource.rst' diff --git a/contributing/documentation/contributing_to_the_documentation.rst b/contributing/documentation/contributing_to_the_documentation.rst index 396276fa56d..a6abad0d295 100644 --- a/contributing/documentation/contributing_to_the_documentation.rst +++ b/contributing/documentation/contributing_to_the_documentation.rst @@ -89,7 +89,7 @@ and to log in to use it. Once logged in, you can propose change like so: 4. At the bottom of the web page, summarize the changes you made and click the button **Propose file change**. Make sure to replace the placeholder "Update file.rst" - by a short but clear one-line description, as this is the commit title. + by a short, but clear one-line description, as this is the commit title. 5. On the following screens, click the **Create pull request** button until you see a message like *Username wants to merge 1 commit into godotengine:master diff --git a/contributing/how_to_contribute.rst b/contributing/how_to_contribute.rst index fd8c61f3083..72a73d46683 100644 --- a/contributing/how_to_contribute.rst +++ b/contributing/how_to_contribute.rst @@ -74,8 +74,9 @@ Technical contributions - **Write Plugins (GDScript, C#, & more)** Community addons are not directly included in the core engine download or repository, yet they provide essential quality of life upgrades for your fellow game developers. Upload your plugins to the `Godot Asset Library `_ to make them available to others. - .. update to talk about Asset Store later + .. + update to talk about Asset Store later - **Demo projects (GDScript, C#, and making Assets)** We provide new users with `demo projects `_ so they can quickly test new features or get familiar with the engine in the first place. At industry events, we might even exhibit these demo projects to showcase what Godot can do! diff --git a/contributing/workflow/pr_review_guidelines.rst b/contributing/workflow/pr_review_guidelines.rst index b0cfc136949..66281dcc1a9 100644 --- a/contributing/workflow/pr_review_guidelines.rst +++ b/contributing/workflow/pr_review_guidelines.rst @@ -12,7 +12,7 @@ Pull request review process wanting to know how to ensure that their PR is merged. From a high level, the ideal life cycle of a pull request looks like the -following: +following: 1. A contributor opens a PR that fixes a specific problem (optimally closing a GitHub `issue `_ or implementing @@ -33,9 +33,9 @@ following: This document will explain steps 2, 3, 4, and 5 in more detail. For a more detailed explanation of the pull request workflow please see the :ref:`pull -request workflow document `. +request workflow document `. -.. note:: +.. note:: In practice these steps may blend together. Oftentimes maintainers will provide comments on code style and code quality at the same time and will approve a pull request for both. @@ -160,7 +160,7 @@ As you review pull requests, keep the Godot `Code of Conduct * Always assume positive intent from others. -* Feedback is always welcome but keep your criticism constructive. +* Feedback is always welcome, but keep your criticism constructive. Here are some things to avoid as you iterate on a pull request with a contributor: @@ -178,7 +178,7 @@ contributor: areas and in performance-sensitive areas than it is in editor code for example. -* **Expanding the scope of a pull request.** +* **Expanding the scope of a pull request.** Providing context or related/similar issues or proposals that may be fixed similarly can be helpful, but adding a "may as well fix that thing over there @@ -253,7 +253,7 @@ Merging pull requests In general, pull requests should only be merged by members of the production team or team leaders for pull requests in their area of the engine. For example, the networking team leader could merge a networking pull request that doesn't -substantially change non-networking sections of code. +substantially change non-networking sections of code. In practice it is best to wait for a member of the production team to merge the pull request as they keep a close eye on the entire codebase and will likely @@ -275,7 +275,7 @@ steps yourself. Production team members should ensure that the right people look at a pull request before it is merged. In some cases this may require multiple people to weigh in. In other cases, only one substantive approval is needed before the -code can be merged. +code can be merged. In general, try not to merge things based on one review alone, especially if it is your own. Get a second opinion from another maintainer, and make sure all the diff --git a/getting_started/first_3d_game/02.player_input.rst b/getting_started/first_3d_game/02.player_input.rst index 282b722cab3..a9d49650ec7 100644 --- a/getting_started/first_3d_game/02.player_input.rst +++ b/getting_started/first_3d_game/02.player_input.rst @@ -51,10 +51,10 @@ You can rename it to ``Character``. .. note:: - The ``.glb`` files contain 3D scene data based on the open source GLTF 2.0 + The ``.glb`` files contain 3D scene data based on the open source glTF 2.0 specification. They're a modern and powerful alternative to a proprietary format like FBX, which Godot also supports. To produce these files, we designed the - model in `Blender 3D `__ and exported it to GLTF. + model in `Blender 3D `__ and exported it to glTF. As with all kinds of physics nodes, we need a collision shape for our character to collide with the environment. Select the ``Player`` node again and add a child node diff --git a/getting_started/first_3d_game/07.killing_player.rst b/getting_started/first_3d_game/07.killing_player.rst index 74b22d246b1..92a0a65b88e 100644 --- a/getting_started/first_3d_game/07.killing_player.rst +++ b/getting_started/first_3d_game/07.killing_player.rst @@ -138,7 +138,7 @@ Also note that the enemy colliding with the player and dying depends on the size ``Player`` and the ``Mob``\ 's collision shapes. You may need to move them and resize them to achieve a tight game feel. -You can pat yourself in the back: you prototyped a complete 3D game, +You can pat yourself on the back: you prototyped a complete 3D game, even if it's still a bit rough. From there, we'll add a score, the option to retry the game, and you'll diff --git a/getting_started/first_3d_game/img/08.score_and_replay/18_register_autoload.webp b/getting_started/first_3d_game/img/08.score_and_replay/18_register_autoload.webp index 6d5fa1b784c..4687d36e884 100644 Binary files a/getting_started/first_3d_game/img/08.score_and_replay/18_register_autoload.webp and b/getting_started/first_3d_game/img/08.score_and_replay/18_register_autoload.webp differ diff --git a/img/smoothstep_range.webp b/img/smoothstep_range.webp new file mode 100644 index 00000000000..08a5fb796f7 Binary files /dev/null and b/img/smoothstep_range.webp differ diff --git a/tutorials/2d/2d_sprite_animation.rst b/tutorials/2d/2d_sprite_animation.rst index bce8da40dd3..912cbffbfec 100644 --- a/tutorials/2d/2d_sprite_animation.rst +++ b/tutorials/2d/2d_sprite_animation.rst @@ -271,7 +271,7 @@ released. it's important to keep in mind that ``play()`` isn't applied instantly. Instead, it's applied the next time the :ref:`AnimationPlayer ` is processed. This may end up being on the next frame, causing a 'glitch' frame, - where the property change was applied but the animation was not. + where the property change was applied, but the animation was not. If this turns out to be a problem, after calling ``play()``, you can call ``advance(0)`` to update the animation immediately. diff --git a/tutorials/2d/2d_transforms.rst b/tutorials/2d/2d_transforms.rst index 8403913f157..b8e8ccee8cd 100644 --- a/tutorials/2d/2d_transforms.rst +++ b/tutorials/2d/2d_transforms.rst @@ -45,7 +45,7 @@ resizing or stretching the screen. This transform is used internally (as described in :ref:`doc_multiple_resolutions`), but can also be manually set on each viewport. -Input events are multiplied by this transform but lack the ones above. To +Input events are multiplied by this transform, but lack the ones above. To convert InputEvent coordinates to local CanvasItem coordinates, the :ref:`CanvasItem.make_input_local() ` function was added for convenience. diff --git a/tutorials/3d/environment_and_post_processing.rst b/tutorials/3d/environment_and_post_processing.rst index ff84da5226f..cacc178e0b8 100644 --- a/tutorials/3d/environment_and_post_processing.rst +++ b/tutorials/3d/environment_and_post_processing.rst @@ -499,7 +499,7 @@ own, the effect may not be that noticeable, which is intended. Instead, :abbr:`SSIL (Screen-Space Indirect Lighting)` is meant to be used as a *complement* to other global illumination techniques such as VoxelGI, SDFGI and LightmapGI. :abbr:`SSIL (Screen-Space Indirect Lighting)` also provides -a subtle ambient occlusion effect, similar to SSAO but with less detail. +a subtle ambient occlusion effect, similar to SSAO, but with less detail. This feature only provides indirect lighting. It is not a full global illumination solution. This makes it different from screen-space global illumination (SSGI) diff --git a/tutorials/3d/lights_and_shadows.rst b/tutorials/3d/lights_and_shadows.rst index 6f3b31b2add..f2806896a0c 100644 --- a/tutorials/3d/lights_and_shadows.rst +++ b/tutorials/3d/lights_and_shadows.rst @@ -160,12 +160,12 @@ at the cost of decreased performance. all" settings. To achieve the best visuals, you may need to use different shadow bias values on a per-light basis. -**Note on Appearance Changes**: When enabling shadows on a light, be aware that the light's -appearance might change compared to when it's rendered without shadows in the compatibility -renderer. Due to limitations with older mobile devices, shadows are implemented using a multi-pass -rendering approach so lights with shadows are rendered in sRGB space instead of linear space. -This change in rendering space can sometimes drastically alter the light's appearance. To achieve a similar -appearance to an unshadowed light, you may need to adjust the light's energy setting. +**Note on Appearance Changes**: When enabling shadows on a light, be aware that the light's +appearance might change compared to when it's rendered without shadows in the compatibility +renderer. Due to limitations with older mobile devices, shadows are implemented using a multi-pass +rendering approach so lights with shadows are rendered in sRGB space instead of linear space. +This change in rendering space can sometimes drastically alter the light's appearance. To achieve a similar +appearance to an unshadowed light, you may need to adjust the light's energy setting. Directional light ----------------- @@ -208,10 +208,10 @@ receive low-resolution shadows that may appear blocky. To fix this, a technique named *Parallel Split Shadow Maps* (PSSM) is used. This splits the view frustum in 2 or 4 areas. Each area gets its own shadow map. This allows small areas close to the viewer to have the same shadow resolution -as a huge, far-away area. When shadows are enabled for DirectionalLight3D, the -default shadow mode is PSSM with 4 splits. In scenarios where an object is large -enough to appear in all four splits, it results in increased draw calls. Specifically, -such an object will be rendered five times in total: once for each of the four shadow +as a huge, far-away area. When shadows are enabled for DirectionalLight3D, the +default shadow mode is PSSM with 4 splits. In scenarios where an object is large +enough to appear in all four splits, it results in increased draw calls. Specifically, +such an object will be rendered five times in total: once for each of the four shadow splits and once for the final scene rendering. This can impact performance, understanding this behavior is important for optimizing your scene and managing performance expectations. @@ -535,7 +535,7 @@ not use mipmaps, which makes them faster to render. However, projectors will look grainy at distance. **Nearest/Linear Mipmaps** will look smoother at a distance, but projectors will look blurry when viewed from oblique angles. This can be resolved by using **Nearest/Linear Mipmaps Anisotropic**, which is the -highest-quality mode but also the most expensive. +highest-quality mode, but also the most expensive. If your project has a pixel art style, consider setting the filter to one of the **Nearest** values so that projectors use nearest-neighbor filtering. Otherwise, diff --git a/tutorials/3d/mesh_lod.rst b/tutorials/3d/mesh_lod.rst index d073dbffd3e..6fd3d71cd9d 100644 --- a/tutorials/3d/mesh_lod.rst +++ b/tutorials/3d/mesh_lod.rst @@ -138,24 +138,29 @@ by changing the **Rendering > Mesh LOD > LOD Change > Threshold Pixels** project setting. To change this value at run-time, set ``mesh_lod_threshold`` on the root viewport as follows: -:: +.. tabs:: + .. code-tab:: gdscript get_tree().root.mesh_lod_threshold = 4.0 + .. code-tab:: csharp + + GetTree().Root.MeshLodThreshold = 4.0f; + Each viewport has its own ``mesh_lod_threshold`` property, which can be set independently from other viewports. The default mesh LOD threshold of 1 pixel is tuned to look *perceptually* lossless; it provides a significant performance gain with an unnoticeable loss in quality. Higher values will make LOD transitions happen sooner when the -camera moves away, resulting in higher performance but lower quality. +camera moves away, resulting in higher performance, but lower quality. If you need to perform per-object adjustments to mesh LOD, you can adjust how aggressive LOD transitions should be by adjusting the **LOD Bias** property on any node that inherits from GeometryInstance3D. Values *above* ``1.0`` will make -LOD transitions happen later than usual (resulting in higher quality but lower +LOD transitions happen later than usual (resulting in higher quality, but lower performance). Values *below* ``1.0`` will make LOD transitions happen sooner than -usual (resulting in lower quality but higher performance). +usual (resulting in lower quality, but higher performance). Additionally, ReflectionProbe nodes have their own **Mesh LOD Threshold** property that can be adjusted to improve rendering performance when the reflection probe diff --git a/tutorials/3d/occlusion_culling.rst b/tutorials/3d/occlusion_culling.rst index f6b984b5bea..d5e97098fb5 100644 --- a/tutorials/3d/occlusion_culling.rst +++ b/tutorials/3d/occlusion_culling.rst @@ -195,10 +195,16 @@ occluders in front of the camera. To toggle occlusion culling at run-time, set ``use_occlusion_culling`` on the root viewport as follows: -:: +.. tabs:: + .. code-tab:: gdscript get_tree().root.use_occlusion_culling = true + .. code-tab:: csharp + + GetTree().Root.UseOcclusionCulling = true; + + Toggling occlusion culling at run-time is useful to compare performance on a running project. diff --git a/tutorials/3d/using_decals.rst b/tutorials/3d/using_decals.rst index 9998865d5a5..8c42d525b45 100644 --- a/tutorials/3d/using_decals.rst +++ b/tutorials/3d/using_decals.rst @@ -240,7 +240,7 @@ textures should be filtered. **Nearest/Linear** does not use mipmaps. However, decals will look grainy at a distance. **Nearest/Linear Mipmaps** will look smoother at a distance, but decals will look blurry when viewed from oblique angles. This can be resolved by using **Nearest/Linear Mipmaps Anisotropic**, -which provides the highest quality but is also slower to render. +which provides the highest quality, but is also slower to render. If your project has a pixel art style, consider setting the filter to one of the **Nearest** values so that decals use nearest-neighbor filtering. Otherwise, diff --git a/tutorials/3d/variable_rate_shading.rst b/tutorials/3d/variable_rate_shading.rst index 82f20fae7cd..81b902c25cf 100644 --- a/tutorials/3d/variable_rate_shading.rst +++ b/tutorials/3d/variable_rate_shading.rst @@ -37,12 +37,12 @@ density map linked at the bottom of this page: .. figure:: img/variable_rate_shading_textured_enabled.webp :align: center - :alt: Variable rate shading enabled in textured scene (lower quality but higher performance) + :alt: Variable rate shading enabled in textured scene (lower quality, but higher performance) - Variable rate shading enabled in textured scene (lower quality but higher performance) + Variable rate shading enabled in textured scene (lower quality, but higher performance) When used in scenes with low-frequency detail (such as scenes with a -stylized/low-poly aesthetic), it's possible to achieve similar performance gains +stylized/low-poly aesthetic), it's possible to achieve similar performance gains, but with less reduction in visual quality: .. figure:: img/variable_rate_shading_untextured_disabled.webp @@ -53,9 +53,9 @@ but with less reduction in visual quality: .. figure:: img/variable_rate_shading_untextured_enabled.webp :align: center - :alt: Variable rate shading enabled in untextured scene (lower quality but higher performance) + :alt: Variable rate shading enabled in untextured scene (lower quality, but higher performance) - Variable rate shading enabled in untextured scene (lower quality but higher performance) + Variable rate shading enabled in untextured scene (lower quality, but higher performance) Hardware support ---------------- diff --git a/tutorials/3d/visibility_ranges.rst b/tutorials/3d/visibility_ranges.rst index 02cba970372..0c882bd1adf 100644 --- a/tutorials/3d/visibility_ranges.rst +++ b/tutorials/3d/visibility_ranges.rst @@ -15,7 +15,7 @@ On this page, you'll learn: .. seealso:: - If you only need meshes to become less detailed over distance but don't have + If you only need meshes to become less detailed over distance, but don't have manually authored LOD meshes, consider relying on automatic :ref:`doc_mesh_lod` instead. diff --git a/tutorials/3d/volumetric_fog.rst b/tutorials/3d/volumetric_fog.rst index f5fca792360..e32acee8344 100644 --- a/tutorials/3d/volumetric_fog.rst +++ b/tutorials/3d/volumetric_fog.rst @@ -142,11 +142,11 @@ and quality: for better performance. - **Rendering > Environment > Volumetric Fog > Volume Depth:** Number of slices to use along the depth of the froxel buffer for volumetric fog. A lower number - will be more efficient but may result in artifacts appearing during camera + will be more efficient, but may result in artifacts appearing during camera movement. - **Rendering > Environment > Volumetric Fog > Use Filter:** Enables filtering of the volumetric fog effect prior to integration. This substantially blurs - the fog which reduces fine details but also smooths out harsh edges and + the fog which reduces fine details, but also smooths out harsh edges and aliasing artifacts. Disable when more detail is required. .. note:: @@ -159,7 +159,7 @@ Using fog volumes for local volumetric fog ------------------------------------------ Sometimes, you want fog to be constrained to specific areas. Conversely, you may -want to have global volumetric fog but fog should be excluded from certain +want to have global volumetric fog, but fog should be excluded from certain areas. Both approaches can be followed using FogVolume nodes. Here's a quick start guide to using FogVolumes: diff --git a/tutorials/animation/creating_movies.rst b/tutorials/animation/creating_movies.rst index b27d211245e..f7f5178b978 100644 --- a/tutorials/animation/creating_movies.rst +++ b/tutorials/animation/creating_movies.rst @@ -285,7 +285,8 @@ This feature tag can also be queried in a script to increase quality settings that are set in the Environment resource. For example, to further improve SDFGI detail and reduce light leaking: -:: +.. tabs:: + .. code-tab:: gdscript extends Node3D @@ -296,6 +297,24 @@ detail and reduce light leaking: get_viewport().world_3d.environment.sdfgi_min_cell_size *= 0.25 get_viewport().world_3d.environment.sdfgi_cascades = 8 + .. code-tab:: csharp + + using Godot; + + public partial class MyNode3D : Node3D + { + public override void _Ready() + { + if (OS.HasFeature("movie")) + { + // When recording a movie, improve SDFGI cell density + // without decreasing its maximum distance. + GetViewport().World3D.Environment.SdfgiMinCellSize *= 0.25f; + GetViewport().World3D.Environment.SdfgiCascades = 8; + } + } + } + .. _doc_creating_movies_recording_at_higher_resolution: Rendering at a higher resolution than the screen resolution diff --git a/tutorials/animation/playing_videos.rst b/tutorials/animation/playing_videos.rst index 9862d8e4282..6938a9253ad 100644 --- a/tutorials/animation/playing_videos.rst +++ b/tutorials/animation/playing_videos.rst @@ -268,7 +268,7 @@ To implement the chroma key effect, follow these steps: 2. In the "ChromaKeyShader.gdshader" file, write the custom shader code as shown below: -.. code-block:: gd +.. code-block:: glsl shader_type canvas_item; @@ -311,25 +311,64 @@ UI Controls To allow users to manipulate the chroma key effect in real-time, we created sliders in the `Control` node. The `Control` node's script contains the following functions: -.. code-block:: gd +.. tabs:: + .. code-tab:: gdscript - extends Control + extends Control - func _on_color_picker_button_color_changed(color): - # Update the "chroma_key_color" shader parameter of the VideoStreamPlayer's material - $VideoStreamPlayer.material.set("shader_parameter/chroma_key_color", color) + func _on_color_picker_button_color_changed(color): + # Update the "chroma_key_color" shader parameter of the VideoStreamPlayer's material. + $VideoStreamPlayer.material.set("shader_parameter/chroma_key_color", color) - func _on_h_slider_value_changed(value): - # Update the "pickup_range" shader parameter of the VideoStreamPlayer's material - $VideoStreamPlayer.material.set("shader_parameter/pickup_range", value) + func _on_h_slider_value_changed(value): + # Update the "pickup_range" shader parameter of the VideoStreamPlayer's material. + $VideoStreamPlayer.material.set("shader_parameter/pickup_range", value) - func _on_h_slider_2_value_changed(value): - # Update the "fade_amount" shader parameter of the VideoStreamPlayer's material - $VideoStreamPlayer.material.set("shader_parameter/fade_amount", value) + func _on_h_slider_2_value_changed(value): + # Update the "fade_amount" shader parameter of the VideoStreamPlayer's material. + $VideoStreamPlayer.material.set("shader_parameter/fade_amount", value) func _on_video_stream_player_finished(): - # Restart the video playback when it's finished - $VideoStreamPlayer.play() + # Restart the video playback when it's finished. + $VideoStreamPlayer.play() + + .. code-tab:: csharp + + using Godot; + + public partial class MyControl : Control + { + private VideoStreamPlayer _videoStreamPlayer; + + public override void _Ready() + { + _videoStreamPlayer = GetNode("VideoStreamPlayer"); + } + + private void OnColorPickerButtonColorChanged(Color color) + { + // Update the "chroma_key_color" shader parameter of the VideoStreamPlayer's material. + _videoStreamPlayer.Material.Set("shader_parameter/chroma_key_color", color); + } + + private void OnHSliderValueChanged(double value) + { + // Update the "pickup_range" shader parameter of the VideoStreamPlayer's material. + _videoStreamPlayer.Material.Set("shader_parameter/pickup_range", value); + } + + private void OnHSlider2ValueChanged(double value) + { + // Update the "fade_amount" shader parameter of the VideoStreamPlayer's material. + _videoStreamPlayer.Material.Set("shader_parameter/fade_amount", value); + } + + private void OnVideoStreamPlayerFinished() + { + // Restart the video playback when it's finished. + _videoStreamPlayer.Play(); + } + } also make sure that the range of the sliders are appropriate, our settings are : diff --git a/tutorials/best_practices/autoloads_versus_internal_nodes.rst b/tutorials/best_practices/autoloads_versus_internal_nodes.rst index 48664a26a59..2f8b10a92a9 100644 --- a/tutorials/best_practices/autoloads_versus_internal_nodes.rst +++ b/tutorials/best_practices/autoloads_versus_internal_nodes.rst @@ -87,7 +87,7 @@ limitation of static functions is that they can't reference member variables, non-static functions or ``self``. Since Godot 4.1, GDScript also supports ``static`` variables using ``static var``. -This means you can now share a variables across instances of a class without +This means you can now share variables across instances of a class without having to create a separate autoload. Still, autoloaded nodes can simplify your code for systems with a wide scope. If diff --git a/tutorials/best_practices/data_preferences.rst b/tutorials/best_practices/data_preferences.rst index 7bd718267c0..994d3d45e98 100644 --- a/tutorials/best_practices/data_preferences.rst +++ b/tutorials/best_practices/data_preferences.rst @@ -332,15 +332,15 @@ in a :ref:`TileSet ` and integrate it with a :ref:`TileMapLayer ` for many auto-animating backgrounds that all render in a single batched draw call. -The AnimatedSprite2D node, in combination with the +The :ref:`AnimatedSprite2D ` node, in combination with the :ref:`SpriteFrames ` resource, allows one to create a variety of animation sequences through spritesheets, flip between animations, and control their speed, regional offset, and orientation. This makes them well-suited to controlling 2D frame-based animations. -If one needs trigger other effects in relation to animation changes (for +If one needs to trigger other effects in relation to animation changes (for example, create particle effects, call functions, or manipulate other -peripheral elements besides the frame-based animation), then will need to use +peripheral elements besides the frame-based animation), then one will need to use an :ref:`AnimationPlayer ` node in conjunction with the AnimatedSprite2D. diff --git a/tutorials/io/background_loading.rst b/tutorials/io/background_loading.rst index 9384be4c890..8f484333e6f 100644 --- a/tutorials/io/background_loading.rst +++ b/tutorials/io/background_loading.rst @@ -48,7 +48,8 @@ The path will be ``"Enemy.tscn"`` which is located at ``res://Enemy.tscn``. First, we will start a request to load the resource and connect the button: -:: +.. tabs:: + .. code-tab:: gdscript const ENEMY_SCENE_PATH : String = "Enemy.tscn" @@ -56,14 +57,41 @@ First, we will start a request to load the resource and connect the button: ResourceLoader.load_threaded_request(ENEMY_SCENE_PATH) self.pressed.connect(_on_button_pressed) + .. code-tab:: csharp + + using Godot; + + public partial class MyButton : Button + { + private const string EnemyScenePath = "Enemy.tscn"; + + public override void _Ready() + { + ResourceLoader.LoadThreadedRequest(EnemyScenePath); + Pressed += OnButtonPressed; + } + } + Now ``_on_button_pressed`` will be called when the button is pressed. This method will be used to spawn an enemy. -:: +.. tabs:: + .. code-tab:: gdscript - func _on_button_pressed(): # Button was pressed - # Obtain the resource now that we need it + func _on_button_pressed(): # Button was pressed. + # Obtain the resource now that we need it. var enemy_scene = ResourceLoader.load_threaded_get(ENEMY_SCENE_PATH) - # Instantiate the enemy scene and add it to the current scene + # Instantiate the enemy scene and add it to the current scene. var enemy = enemy_scene.instantiate() add_child(enemy) + + .. code-tab:: csharp + + private void OnButtonPressed() // Button was pressed. + { + // Obtain the resource now that we need it. + var enemyScene = (PackedScene)ResourceLoader.LoadThreadedGet(EnemyScenePath); + // Instantiate the enemy scene and add it to the current scene. + var enemy = enemyScene.Instantiate(); + AddChild(enemy); + } diff --git a/tutorials/navigation/navigation_introduction_2d.rst b/tutorials/navigation/navigation_introduction_2d.rst index 3831a88feee..cd7eabf42f0 100644 --- a/tutorials/navigation/navigation_introduction_2d.rst +++ b/tutorials/navigation/navigation_introduction_2d.rst @@ -131,7 +131,7 @@ It uses the NavigationServer2D and a NavigationAgent2D for path movement. navigation_agent.target_desired_distance = 4.0 # Make sure to not await during _ready. - call_deferred("actor_setup") + actor_setup.call_deferred() func actor_setup(): # Wait for the first physics frame so the NavigationServer can sync. diff --git a/tutorials/navigation/navigation_introduction_3d.rst b/tutorials/navigation/navigation_introduction_3d.rst index a09e19e522d..032a22769a3 100644 --- a/tutorials/navigation/navigation_introduction_3d.rst +++ b/tutorials/navigation/navigation_introduction_3d.rst @@ -132,7 +132,7 @@ It uses the NavigationServer3D and a NavigationAgent3D for path movement. navigation_agent.target_desired_distance = 0.5 # Make sure to not await during _ready. - call_deferred("actor_setup") + actor_setup.call_deferred() func actor_setup(): # Wait for the first physics frame so the NavigationServer can sync. diff --git a/tutorials/navigation/navigation_using_navigationagents.rst b/tutorials/navigation/navigation_using_navigationagents.rst index b22be476db4..e404e22dd43 100644 --- a/tutorials/navigation/navigation_using_navigationagents.rst +++ b/tutorials/navigation/navigation_using_navigationagents.rst @@ -121,7 +121,7 @@ The following NavigationAgent properties are relevant for avoidance: - The property ``use_3d_avoidance`` switches the agent between the 2D avoidance (xz axis) and the 3D avoidance (xyz axis) on the next update. Note that 2D avoidance and 3D avoidance run in separate avoidance simulations so agents split between them do not affect each other. - The properties ``avoidance_layers`` and ``avoidance_mask`` are bitmasks similar to e.g. physics layers. Agents will only avoid other avoidance objects that are on an avoidance layer that matches at least one of their own avoidance mask bits. - - The ``avoidance_priority`` makes agents with a higher priority ignore agents with a lower priority. This can be used to give certain agents more importance in the avoidance simulation, e.g. important npcs characters, without constantly changing their entire avoidance layers or mask. + - The ``avoidance_priority`` makes agents with a higher priority ignore agents with a lower priority. This can be used to give certain agents more importance in the avoidance simulation, e.g. important non-playable characters, without constantly changing their entire avoidance layers or mask. Avoidance exists in its own space and has no information from navigation meshes or physics collision. diff --git a/tutorials/navigation/navigation_using_navigationmaps.rst b/tutorials/navigation/navigation_using_navigationmaps.rst index 66c90162558..078250d4d7e 100644 --- a/tutorials/navigation/navigation_using_navigationmaps.rst +++ b/tutorials/navigation/navigation_using_navigationmaps.rst @@ -33,6 +33,16 @@ The 3D default navigation map RID can be obtained with ``get_world_3d().get_navi func _ready() -> void: var default_navigation_map_rid: RID = get_world_2d().get_navigation_map() + .. code-tab:: csharp 2D C# + + public partial class MyNode2D : Node2D + { + public override void _Ready() + { + Rid defaultNavigationMapRid = GetWorld2D().NavigationMap; + } + } + .. code-tab:: gdscript 3D GDScript extends Node3D @@ -40,6 +50,16 @@ The 3D default navigation map RID can be obtained with ``get_world_3d().get_navi func _ready() -> void: var default_navigation_map_rid: RID = get_world_3d().get_navigation_map() + .. code-tab:: csharp 3D C# + + public partial class MyNode3D : Node3D + { + public override void _Ready() + { + Rid defaultNavigationMapRid = GetWorld3D().NavigationMap; + } + } + Creating new navigation maps ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -66,6 +86,17 @@ Navigation regions and avoidance agents can only be part of a single navigation var new_navigation_map: RID = NavigationServer2D.map_create() NavigationServer2D.map_set_active(new_navigation_map, true) + .. code-tab:: csharp 2D C# + + public partial class MyNode2D : Node2D + { + public override void _Ready() + { + Rid newNavigationMap = NavigationServer2D.MapCreate(); + NavigationServer2D.MapSetActive(newNavigationMap, true); + } + } + .. code-tab:: gdscript 3D GDScript extends Node3D @@ -74,6 +105,17 @@ Navigation regions and avoidance agents can only be part of a single navigation var new_navigation_map: RID = NavigationServer3D.map_create() NavigationServer3D.map_set_active(new_navigation_map, true) + .. code-tab:: csharp 3D C# + + public partial class MyNode3D : Node3D + { + public override void _Ready() + { + Rid newNavigationMap = NavigationServer3D.MapCreate(); + NavigationServer3D.MapSetActive(newNavigationMap, true); + } + } + .. note:: There is no difference between navigation maps created with the NavigationServer2D API or the NavigationServer3D API. diff --git a/tutorials/navigation/navigation_using_navigationregions.rst b/tutorials/navigation/navigation_using_navigationregions.rst index 97a7d3afbdd..a2ff94cd98b 100644 --- a/tutorials/navigation/navigation_using_navigationregions.rst +++ b/tutorials/navigation/navigation_using_navigationregions.rst @@ -45,12 +45,32 @@ The region RID can then be obtained from NavigationRegion Nodes with ``get_rid() var navigationserver_region_rid: RID = get_rid() + .. code-tab:: csharp 2D C# + + public partial class MyNavigationRegion2D : NavigationRegion2D + { + public override void _Ready() + { + Rid navigationServerRegionRid = GetRid(); + } + } + .. code-tab:: gdscript 3D GDScript extends NavigationRegion3D var navigationserver_region_rid: RID = get_rid() + .. code-tab:: csharp 3D C# + + public partial class MyNavigationRegion3D : NavigationRegion3D + { + public override void _Ready() + { + Rid navigationServerRegionRid = GetRid(); + } + } + New regions can also be created with the NavigationServer API and added to any existing map. If regions are created with the NavigationServer API directly they need to be assigned a navigation map manually. @@ -65,6 +85,18 @@ If regions are created with the NavigationServer API directly they need to be as var default_map_rid: RID = get_world_2d().get_navigation_map() NavigationServer2D.region_set_map(new_region_rid, default_map_rid) + .. code-tab:: csharp 2D C# + + public partial class MyNode2D : Node2D + { + public override void _Ready() + { + Rid newRegionRid = NavigationServer2D.RegionCreate(); + Rid defaultMapRid = GetWorld2D().NavigationMap; + NavigationServer2D.RegionSetMap(newRegionRid, defaultMapRid); + } + } + .. code-tab:: gdscript 3D GDScript extends Node3D @@ -74,6 +106,18 @@ If regions are created with the NavigationServer API directly they need to be as var default_map_rid: RID = get_world_3d().get_navigation_map() NavigationServer3D.region_set_map(new_region_rid, default_map_rid) + .. code-tab:: csharp 3D C# + + public partial class MyNode3D : Node3D + { + public override void _Ready() + { + Rid newRegionRid = NavigationServer3D.RegionCreate(); + Rid defaultMapRid = GetWorld3D().NavigationMap; + NavigationServer3D.RegionSetMap(newRegionRid, defaultMapRid); + } + } + .. note:: Navigation regions can only be assigned to a single navigation map. diff --git a/tutorials/navigation/navigation_using_navigationservers.rst b/tutorials/navigation/navigation_using_navigationservers.rst index d8da6791a0e..2599ab8eb22 100644 --- a/tutorials/navigation/navigation_using_navigationservers.rst +++ b/tutorials/navigation/navigation_using_navigationservers.rst @@ -97,7 +97,7 @@ Afterwards the function waits for the next physics frame before continuing with func _ready(): # Use call deferred to make sure the entire scene tree nodes are setup # else await on 'physics_frame' in a _ready() might get stuck. - call_deferred("custom_setup") + custom_setup.call_deferred() func custom_setup(): diff --git a/tutorials/networking/high_level_multiplayer.rst b/tutorials/networking/high_level_multiplayer.rst index 45e7e8557d7..9d4e015e7db 100644 --- a/tutorials/networking/high_level_multiplayer.rst +++ b/tutorials/networking/high_level_multiplayer.rst @@ -107,16 +107,24 @@ which will override ``multiplayer`` for the node at that path and all of its des This allows sibling nodes to be configured with different peers, which makes it possible to run a server and a client simultaneously in one instance of Godot. -:: +.. tabs:: + .. code-tab:: gdscript GDScript # By default, these expressions are interchangeable. multiplayer # Get the MultiplayerAPI object configured for this node. get_tree().get_multiplayer() # Get the default MultiplayerAPI object. + .. code-tab:: csharp + + // By default, these expressions are interchangeable. + Multiplayer; // Get the MultiplayerAPI object configured for this node. + GetTree().GetMultiplayer(); // Get the default MultiplayerAPI object. + To initialize networking, a ``MultiplayerPeer`` object must be created, initialized as a server or client, and passed to the ``MultiplayerAPI``. -:: +.. tabs:: + .. code-tab:: gdscript GDScript # Create client. var peer = ENetMultiplayerPeer.new() @@ -128,12 +136,29 @@ and passed to the ``MultiplayerAPI``. peer.create_server(PORT, MAX_CLIENTS) multiplayer.multiplayer_peer = peer + .. code-tab:: csharp + + // Create client. + var peer = new ENetMultiplayerPeer(); + peer.CreateClient(IPAddress, Port); + Multiplayer.MultiplayerPeer = peer; + + // Create server. + var peer = new ENetMultiplayerPeer(); + peer.CreateServer(Port, MaxClients); + Multiplayer.MultiplayerPeer = peer; + To terminate networking: -:: +.. tabs:: + .. code-tab:: gdscript GDScript multiplayer.multiplayer_peer = null + .. code-tab:: csharp + + Multiplayer.MultiplayerPeer = null; + .. warning:: When exporting to Android, make sure to enable the ``INTERNET`` @@ -159,16 +184,27 @@ The rest are only emitted on clients: To get the unique ID of the associated peer: -:: +.. tabs:: + .. code-tab:: gdscript GDScript multiplayer.get_unique_id() + .. code-tab:: csharp + + Multiplayer.GetUniqueId(); + + To check whether the peer is server or client: -:: +.. tabs:: + .. code-tab:: gdscript GDScript multiplayer.is_server() + .. code-tab:: csharp + + Multiplayer.IsServer(); + Remote procedure calls ---------------------- @@ -176,7 +212,8 @@ Remote procedure calls, or RPCs, are functions that can be called on other peers before a function definition. To call an RPC, use ``Callable``'s method ``rpc()`` to call in every peer, or ``rpc_id()`` to call in a specific peer. -:: +.. tabs:: + .. code-tab:: gdscript GDScript func _ready(): if multiplayer.is_server(): @@ -186,6 +223,23 @@ call in a specific peer. func print_once_per_client(): print("I will be printed to the console once per each connected client.") + .. code-tab:: csharp + + public override void _Ready() + { + if (Multiplayer.IsServer()) + { + Rpc(MethodName.PrintOncePerClient); + } + } + + [Rpc] + private void PrintOncePerClient() + { + GD.Print("I will be printed to the console once per each connected client."); + } + + RPCs will not serialize objects or callables. For a remote call to be successful, the sending and receiving node need to have the same ``NodePath``, which means they @@ -204,7 +258,7 @@ must have the same name. When using ``add_child()`` for nodes which are expected **and** the NodePath. If an RPC resides in a script attached to ``/root/Main/Node1``, then it must reside in precisely the same path and node on both the client script and the server script. Function arguments are not checked for matching between the server and client code - (example: ``func sendstuff():`` and ``func sendstuff(arg1, arg2):`` **will pass** signature + (example: ``func sendstuff():`` and ``func sendstuff(arg1, arg2):`` **will pass** signature matching). If these conditions are not met (if all RPCs do not pass signature matching), the script may print an @@ -215,10 +269,15 @@ must have the same name. When using ``add_child()`` for nodes which are expected The annotation can take a number of arguments, which have default values. ``@rpc`` is equivalent to: -:: +.. tabs:: + .. code-tab:: gdscript GDScript @rpc("authority", "call_remote", "unreliable", 0) + .. code-tab:: csharp + + [Rpc(MultiplayerApi.RpcMode.Authority, CallLocal = false, TransferMode = MultiplayerPeer.TransferModeEnum.Unreliable, TransferChannel = 0)] + The parameters and their functions are as follows: ``mode``: @@ -243,7 +302,8 @@ The first 3 can be passed in any order, but ``transfer_channel`` must always be The function ``multiplayer.get_remote_sender_id()`` can be used to get the unique id of an rpc sender, when used within the function called by rpc. -:: +.. tabs:: + .. code-tab:: gdscript GDScript func _on_some_input(): # Connected to some input. transfer_some_input.rpc_id(1) # Send the input only to the server. @@ -256,6 +316,22 @@ The function ``multiplayer.get_remote_sender_id()`` can be used to get the uniqu var sender_id = multiplayer.get_remote_sender_id() # Process the input and affect game logic. + .. code-tab:: csharp + + private void OnSomeInput() // Connected to some input. + { + RpcId(1, MethodName.TransferSomeInput); // Send the input only to the server. + } + + // Call local is required if the server is also a player. + [Rpc(MultiplayerApi.RpcMode.AnyPeer, CallLocal = true, TransferMode = MultiplayerPeer.TransferModeEnum.Reliable)] + private void TransferSomeInput() + { + // The server knows who sent the input. + int senderId = Multiplayer.GetRemoteSenderId(); + // Process the input and affect game logic. + } + Channels -------- Modern networking protocols support channels, which are separate connections within the connection. This allows for multiple @@ -276,7 +352,8 @@ Example lobby implementation This is an example lobby that can handle peers joining and leaving, notify UI scenes through signals, and start the game after all clients have loaded the game scene. -:: +.. tabs:: + .. code-tab:: gdscript GDScript extends Node @@ -388,9 +465,159 @@ have loaded the game scene. players.clear() server_disconnected.emit() + .. code-tab:: csharp + + using Godot; + + public partial class Lobby : Node + { + public static Lobby Instance { get; private set; } + + // These signals can be connected to by a UI lobby scene or the game scene. + [Signal] + public delegate void PlayerConnectedEventHandler(int peerId, Godot.Collections.Dictionary playerInfo); + [Signal] + public delegate void PlayerDisconnectedEventHandler(int peerId); + [Signal] + public delegate void ServerDisconnectedEventHandler(); + + private const int Port = 7000; + private const string DefaultServerIP = "127.0.0.1"; // IPv4 localhost + private const int MaxConnections = 20; + + // This will contain player info for every player, + // with the keys being each player's unique IDs. + private Godot.Collections.Dictionary> _players = new Godot.Collections.Dictionary>(); + + // This is the local player info. This should be modified locally + // before the connection is made. It will be passed to every other peer. + // For example, the value of "name" can be set to something the player + // entered in a UI scene. + private Godot.Collections.Dictionary _playerInfo = new Godot.Collections.Dictionary() + { + { "Name", "PlayerName" }, + }; + + private int _playersLoaded = 0; + + public override void _Ready() + { + Instance = this; + Multiplayer.PeerConnected += OnPlayerConnected; + Multiplayer.PeerDisconnected += OnPlayerDisconnected; + Multiplayer.ConnectedToServer += OnConnectOk; + Multiplayer.ConnectionFailed += OnConnectionFail; + Multiplayer.ServerDisconnected += OnServerDisconnected; + } + + private Error JoinGame(string address = "") + { + if (string.IsNullOrEmpty(address)) + { + address = DefaultServerIP; + } + + var peer = new ENetMultiplayerPeer(); + Error error = peer.CreateClient(address, Port); + + if (error != Error.Ok) + { + return error; + } + + Multiplayer.MultiplayerPeer = peer; + return Error.Ok; + } + + private Error CreateGame() + { + var peer = new ENetMultiplayerPeer(); + Error error = peer.CreateServer(Port, MaxConnections); + + if (error != Error.Ok) + { + return error; + } + + Multiplayer.MultiplayerPeer = peer; + _players[1] = _playerInfo; + EmitSignal(SignalName.PlayerConnected, 1, _playerInfo); + return Error.Ok; + } + + private void RemoveMultiplayerPeer() + { + Multiplayer.MultiplayerPeer = null; + } + + // When the server decides to start the game from a UI scene, + // do Rpc(Lobby.MethodName.LoadGame, filePath); + [Rpc(CallLocal = true,TransferMode = MultiplayerPeer.TransferModeEnum.Reliable)] + private void LoadGame(string gameScenePath) + { + GetTree().ChangeSceneToFile(gameScenePath); + } + + // Every peer will call this when they have loaded the game scene. + [Rpc(MultiplayerApi.RpcMode.AnyPeer,CallLocal = true,TransferMode = MultiplayerPeer.TransferModeEnum.Reliable)] + private void PlayerLoaded() + { + if (Multiplayer.IsServer()) + { + _playersLoaded += 1; + if (_playersLoaded == _players.Count) + { + GetNode("/root/Game").StartGame(); + _playersLoaded = 0; + } + } + } + + // When a peer connects, send them my player info. + // This allows transfer of all desired data for each player, not only the unique ID. + private void OnPlayerConnected(long id) + { + RpcId(id, MethodName.RegisterPlayer, _playerInfo); + } + + [Rpc(MultiplayerApi.RpcMode.AnyPeer,TransferMode = MultiplayerPeer.TransferModeEnum.Reliable)] + private void RegisterPlayer(Godot.Collections.Dictionary newPlayerInfo) + { + int newPlayerId = Multiplayer.GetRemoteSenderId(); + _players[newPlayerId] = newPlayerInfo; + EmitSignal(SignalName.PlayerConnected, newPlayerId, newPlayerInfo); + } + + private void OnPlayerDisconnected(long id) + { + _players.Remove(id); + EmitSignal(SignalName.PlayerDisconnected, id); + } + + private void OnConnectOk() + { + int peerId = Multiplayer.GetUniqueId(); + _players[peerId] = _playerInfo; + EmitSignal(SignalName.PlayerConnected, peerId, _playerInfo); + } + + private void OnConnectionFail() + { + Multiplayer.MultiplayerPeer = null; + } + + private void OnServerDisconnected() + { + Multiplayer.MultiplayerPeer = null; + _players.Clear(); + EmitSignal(SignalName.ServerDisconnected); + } + } + The game scene's root node should be named Game. In the script attached to it: -:: +.. tabs:: + .. code-tab:: gdscript GDScript extends Node3D # Or Node2D. @@ -406,6 +633,26 @@ The game scene's root node should be named Game. In the script attached to it: func start_game(): # All peers are ready to receive RPCs in this scene. + .. code-tab:: csharp + + using Godot; + + public partial class Game : Node3D // Or Node2D. + { + public override void _Ready() + { + // Preconfigure game. + + Lobby.Instance.RpcId(1, Lobby.MethodName.PlayerLoaded); // Tell the server that this peer has loaded. + } + + // Called only on the server. + public void StartGame() + { + // All peers are ready to receive RPCs in this scene. + } + } + Exporting for dedicated servers ------------------------------- diff --git a/tutorials/performance/cpu_optimization.rst b/tutorials/performance/cpu_optimization.rst index ec927f017b6..7e03a209ce2 100644 --- a/tutorials/performance/cpu_optimization.rst +++ b/tutorials/performance/cpu_optimization.rst @@ -92,7 +92,8 @@ using a profiler, is to manually time the function or area under test. The specifics vary depending on the language, but in GDScript, you would do the following: -:: +.. tabs:: + .. code-tab:: gdscript GDScript var time_start = Time.get_ticks_usec() @@ -102,6 +103,16 @@ the following: var time_end = Time.get_ticks_usec() print("update_enemies() took %d microseconds" % time_end - time_start) + .. code-tab:: csharp + + var timeStart = Time.GetTicksUsec(); + + // Your function you want to time. + UpdateEnemies(); + + var timeEnd = Time.GetTicksUsec(); + GD.Print($"UpdateEnemies() took {timeEnd - timeStart} microseconds"); + When manually timing functions, it is usually a good idea to run the function many times (1,000 or more times), instead of just once (unless it is a very slow function). The reason for doing this is that timers often have limited accuracy. diff --git a/tutorials/performance/thread_safe_apis.rst b/tutorials/performance/thread_safe_apis.rst index 26e1abebabb..174dfc3dbeb 100644 --- a/tutorials/performance/thread_safe_apis.rst +++ b/tutorials/performance/thread_safe_apis.rst @@ -30,7 +30,7 @@ Interacting with the active scene tree is **NOT** thread-safe. Make sure to use # Unsafe: node.add_child(child_node) # Safe: - node.call_deferred("add_child", child_node) + node.add_child.call_deferred(child_node) However, creating scene chunks (nodes in tree arrangement) outside the active tree is fine. This way, parts of a scene can be built or instantiated in a thread, then added in the main thread: @@ -39,7 +39,7 @@ However, creating scene chunks (nodes in tree arrangement) outside the active tr var enemy_scene = load("res://enemy_scene.scn") var enemy = enemy_scene.instantiate() enemy.add_child(weapon) # Set a weapon. - world.call_deferred("add_child", enemy) + world.add_child.call_deferred(enemy) Still, this is only really useful if you have **one** thread loading data. Attempting to load or create scene chunks from multiple threads may work, but you risk diff --git a/tutorials/platform/android/android_library.rst b/tutorials/platform/android/android_library.rst index a962e6fa481..634df4fc558 100644 --- a/tutorials/platform/android/android_library.rst +++ b/tutorials/platform/android/android_library.rst @@ -45,11 +45,11 @@ These APIs can also be used to provide bidirectional communication between the h Godot instance allowing for greater control over the desired experience. We showcase how this is done using a sample Android app that embeds the Godot Engine as an Android view, -and uses it to render 3D GLTF models. +and uses it to render 3D glTF models. The `GLTF Viewer `_ sample app uses an `Android RecyclerView component `_ to create -a list of GLTF items, populated from `Kenney's Food Kit pack `_. -When an item on the list is selected, the app's logic interacts with the embedded Godot Engine to render the selected GLTF item as a 3D model. +a list of glTF items, populated from `Kenney's Food Kit pack `_. +When an item on the list is selected, the app's logic interacts with the embedded Godot Engine to render the selected glTF item as a 3D model. .. image:: img/gltf_viewer_sample_app_screenshot.webp @@ -146,7 +146,7 @@ Below we break-down the steps used to create the GLTF Viewer app. - Add any additional logic that will be used by your application - - For the sample app, this includes adding the `ItemsSelectionFragment fragment `_ (and related classes), a fragment used to build and show the list of GLTF items + - For the sample app, this includes adding the `ItemsSelectionFragment fragment `_ (and related classes), a fragment used to build and show the list of glTF items - Open the ``AndroidManifest.xml`` file, and configure the orientation if needed using the `android:screenOrientation attribute `_ @@ -191,7 +191,7 @@ Below we break-down the steps used to create the GLTF Viewer app. - Update the Godot project script logic as needed - For the sample app, the `script logic `_ queries for the runtime ``GodotPlugin`` instance and uses it to register for signals fired by the app logic - - The app logic fires a signal every time an item is selected in the list. The signal contains the filepath of the GLTF model, which is used by the ``gdscript`` logic to render the model. + - The app logic fires a signal every time an item is selected in the list. The signal contains the filepath of the glTF model, which is used by the ``gdscript`` logic to render the model. .. code-block:: gdscript diff --git a/tutorials/rendering/viewports.rst b/tutorials/rendering/viewports.rst index 9a108d759f0..19927a23ac9 100644 --- a/tutorials/rendering/viewports.rst +++ b/tutorials/rendering/viewports.rst @@ -76,10 +76,15 @@ There can only be one active camera per :ref:`Viewport `, so if than one, make sure that the desired one has the :ref:`current ` property set, or make it the current camera by calling: -:: +.. tabs:: + .. code-tab:: gdscript GDScript camera.make_current() + .. code-tab:: csharp + + camera.MakeCurrent(); + By default, cameras will render all objects in their world. In 3D, cameras can use their :ref:`cull_mask ` property combined with the :ref:`VisualInstance3D's ` :ref:`layer ` @@ -95,11 +100,17 @@ these values are overridden, but for all others, this sets their resolution. It is also possible to scale the 2D content and make the :ref:`SubViewport ` resolution different from the one specified in size, by calling: -:: +.. tabs:: + .. code-tab:: gdscript GDScript sub_viewport.set_size_2d_override(Vector2i(width, height)) # Custom size for 2D. sub_viewport.set_size_2d_override_stretch(true) # Enable stretch for custom size. + .. code-tab:: csharp + + subViewport.Size2DOverride = new Vector2I(width, height); // Custom size for 2D. + subViewport.Size2DOverrideStretch = true; // Enable stretch for custom size. + For information on scaling and stretching with the Root Viewport visit the :ref:`Multiple Resolutions Tutorial ` Worlds @@ -137,7 +148,8 @@ It is possible to query a capture of the :ref:`Viewport ` conten Viewport, this is effectively a screen capture. This is done with the following code: -:: +.. tabs:: + .. code-tab:: gdscript GDScript # Retrieve the captured Image using get_image(). var img = get_viewport().get_texture().get_image() @@ -146,16 +158,32 @@ following code: # Set sprite texture. sprite.texture = tex + .. code-tab:: csharp + + // Retrieve the captured Image using get_image(). + var img = GetViewport().GetTexture().GetImage(); + // Convert Image to ImageTexture. + var tex = ImageTexture.CreateFromImage(img); + // Set sprite texture. + sprite.Texture = tex; + But if you use this in ``_ready()`` or from the first frame of the :ref:`Viewport's ` initialization, you will get an empty texture because there is nothing to get as texture. You can deal with it using (for example): -:: +.. tabs:: + .. code-tab:: gdscript GDScript # Wait until the frame has finished before getting the texture. await RenderingServer.frame_post_draw # You can get the image after this. + .. code-tab:: csharp + + // Wait until the frame has finished before getting the texture. + await RenderingServer.Singleton.ToSignal(RenderingServer.SignalName.FramePostDraw); + // You can get the image after this. + Viewport Container ------------------ @@ -218,12 +246,19 @@ When rendering to a :ref:`SubViewport `, whatever is inside w visible in the scene editor. To display the contents, you have to draw the SubViewport's :ref:`ViewportTexture ` somewhere. This can be requested via code using (for example): -:: +.. tabs:: + .. code-tab:: gdscript GDScript # This gives us the ViewportTexture. var tex = viewport.get_texture() sprite.texture = tex + .. code-tab:: csharp + + // This gives us the ViewportTexture. + var tex = viewport.GetTexture(); + sprite.Texture = tex; + Or it can be assigned in the editor by selecting "New ViewportTexture" .. image:: img/texturemenu.webp @@ -245,6 +280,6 @@ This flexibility allows users to render an image once and then use the texture w .. note:: - Make sure to check the Viewport demos. They are available in the + Make sure to check the Viewport demos. They are available in the viewport folder of the demos archive, or at https://github.com/godotengine/godot-demo-projects/tree/master/viewport. diff --git a/tutorials/scripting/c_sharp/c_sharp_exports.rst b/tutorials/scripting/c_sharp/c_sharp_exports.rst index a0af83a3e33..4fcf8b0c037 100644 --- a/tutorials/scripting/c_sharp/c_sharp_exports.rst +++ b/tutorials/scripting/c_sharp/c_sharp_exports.rst @@ -342,7 +342,7 @@ Therefore, if you specify a type derived from Resource such as: public AnimationNode AnimationNode { get; set; } The drop-down menu will be limited to AnimationNode and all -its inherited classes. Custom resource classes can also be used, +its derived classes. Custom resource classes can also be used, see :ref:`doc_c_sharp_global_classes`. It must be noted that even if the script is not being run while in the diff --git a/tutorials/scripting/c_sharp/c_sharp_features.rst b/tutorials/scripting/c_sharp/c_sharp_features.rst index b3d8d1e8b43..94e9d539d77 100644 --- a/tutorials/scripting/c_sharp/c_sharp_features.rst +++ b/tutorials/scripting/c_sharp/c_sharp_features.rst @@ -102,10 +102,6 @@ Preprocessor defines Godot has a set of defines that allow you to change your C# code depending on the environment you are compiling to. -.. note:: If you created your project before Godot 3.2, you have to modify - or regenerate your `csproj` file to use this feature - (compare ```` with a new 3.2+ project). - Examples ~~~~~~~~ @@ -115,10 +111,7 @@ For example, you can change code based on the platform: public override void _Ready() { - #if GODOT_SERVER - // Don't try to load meshes or anything, this is a server! - LaunchServer(); - #elif GODOT_32 || GODOT_MOBILE || GODOT_WEB + #if (GODOT_32 || GODOT_MOBILE || GODOT_WEB) // Use simple objects when running on less powerful systems. SpawnSimpleObjects(); #else @@ -167,7 +160,7 @@ Full list of defines * One of ``GODOT_64`` or ``GODOT_32`` is defined depending on if the architecture is 64-bit or 32-bit. * One of ``GODOT_LINUXBSD``, ``GODOT_WINDOWS``, ``GODOT_OSX``, - ``GODOT_ANDROID``, ``GODOT_IOS``, ``GODOT_HTML5``, or ``GODOT_SERVER`` + ``GODOT_ANDROID``, ``GODOT_IOS``, ``GODOT_WEB`` depending on the OS. These names may change in the future. These are created from the ``get_name()`` method of the :ref:`OS ` singleton, but not every possible OS diff --git a/tutorials/scripting/gdextension/files/cpp_example/SConstruct b/tutorials/scripting/gdextension/files/cpp_example/SConstruct index 691f8131944..a1ce2492dff 100644 --- a/tutorials/scripting/gdextension/files/cpp_example/SConstruct +++ b/tutorials/scripting/gdextension/files/cpp_example/SConstruct @@ -23,6 +23,17 @@ if env["platform"] == "macos": ), source=sources, ) +elif env["platform"] == "ios": + if env["ios_simulator"]: + library = env.StaticLibrary( + "demo/bin/libgdexample.{}.{}.simulator.a".format(env["platform"], env["target"]), + source=sources, + ) + else: + library = env.StaticLibrary( + "demo/bin/libgdexample.{}.{}.a".format(env["platform"], env["target"]), + source=sources, + ) else: library = env.SharedLibrary( "demo/bin/libgdexample{}{}".format(env["suffix"], env["SHLIBSUFFIX"]), diff --git a/tutorials/scripting/gdextension/gdextension_cpp_example.rst b/tutorials/scripting/gdextension/gdextension_cpp_example.rst index f89754b77bc..d444a13e40c 100644 --- a/tutorials/scripting/gdextension/gdextension_cpp_example.rst +++ b/tutorials/scripting/gdextension/gdextension_cpp_example.rst @@ -344,6 +344,18 @@ structure alongside ``godot-cpp``, ``src`` and ``demo``, then run: You should now be able to find the module in ``demo/bin/``. +When building for iOS, package the module as a static `.xcframework`, you can use +following commands to do so: + +:: + # compile simulator and device modules + scons arch=universal ios_simulator=yes platform=ios target= + scons arch=arm64 ios_simulator=no platform=ios target= + + # assembe xcframeworks + xcodebuild -create-xcframework -library demo/bin/libgdexample.ios..a -library demo/bin/libgdexample.ios..simulator.a -output demo/bin/libgdexample.ios..xcframework + xcodebuild -create-xcframework -library godot-cpp/bin/libgodot-cpp.ios..arm64.a -library godot-cpp/bin/libgodot-cpp.ios..universal.simulator.a -output demo/bin/libgodot-cpp.ios..xcframework + .. note:: Here, we've compiled both godot-cpp and our gdexample library as debug @@ -371,6 +383,8 @@ loaded for each platform and the entry function for the module. It is called ``g macos.debug = "res://bin/libgdexample.macos.template_debug.framework" macos.release = "res://bin/libgdexample.macos.template_release.framework" + ios.debug = "res://bin/libgdexample.ios.template_debug.xcframework" + ios.release = "res://bin/libgdexample.ios.template_release.xcframework" windows.debug.x86_32 = "res://bin/libgdexample.windows.template_debug.x86_32.dll" windows.release.x86_32 = "res://bin/libgdexample.windows.template_release.x86_32.dll" windows.debug.x86_64 = "res://bin/libgdexample.windows.template_debug.x86_64.dll" @@ -386,6 +400,14 @@ loaded for each platform and the entry function for the module. It is called ``g android.debug.arm64 = "res://bin/libgdexample.android.template_debug.arm64.so" android.release.arm64 = "res://bin/libgdexample.android.template_release.arm64.so" + [dependencies] + ios.debug = { + "res://bin/libgodot-cpp.ios.template_debug.xcframework": "" + } + ios.release = { + "res://bin/libgodot-cpp.ios.template_release.xcframework": "" + } + This file contains a ``configuration`` section that controls the entry function of the module. You should also set the minimum compatible Godot version with ``compatability_minimum``, which prevents older version of Godot from trying to load your extension. diff --git a/tutorials/scripting/gdextension/gdextension_docs_system.rst b/tutorials/scripting/gdextension/gdextension_docs_system.rst index 0a5f09338ca..aa23fab44e8 100644 --- a/tutorials/scripting/gdextension/gdextension_docs_system.rst +++ b/tutorials/scripting/gdextension/gdextension_docs_system.rst @@ -18,6 +18,8 @@ XML files (one per class) to document the exposed constructors, properties, meth We are assuming you are using the project files explained in the :ref:`GDExtension C++ Example ` with the following structure: +.. code-block:: none + gdextension_cpp_example/ # GDExtension directory | +--demo/ # game example/demo to test the extension diff --git a/tutorials/scripting/gdscript/gdscript_basics.rst b/tutorials/scripting/gdscript/gdscript_basics.rst index 0f1451799d4..4204fd7ac57 100644 --- a/tutorials/scripting/gdscript/gdscript_basics.rst +++ b/tutorials/scripting/gdscript/gdscript_basics.rst @@ -1890,7 +1890,7 @@ If you want to use ``extends`` too, you can keep both on the same line:: .. warning:: - The Godot editor will hide these custom classes with names that beging with the prefix + The Godot editor will hide these custom classes with names that begin with the prefix "Editor" in the 'Create New Node' or 'Create New Scene' dialog windows. The classes are available for instantiation at runtime via their class names, but are automatically hidden by the editor windows along with the built-in editor nodes used diff --git a/tutorials/scripting/gdscript/gdscript_exports.rst b/tutorials/scripting/gdscript/gdscript_exports.rst index e8577aab82d..4e7430703ab 100644 --- a/tutorials/scripting/gdscript/gdscript_exports.rst +++ b/tutorials/scripting/gdscript/gdscript_exports.rst @@ -242,7 +242,7 @@ Therefore, if you specify an extension of Resource such as: @export var resource: AnimationNode The drop-down menu will be limited to AnimationNode and all -its inherited classes. +its derived classes. It must be noted that even if the script is not being run while in the editor, the exported properties are still editable. This can be used diff --git a/tutorials/scripting/img/autoload_example.webp b/tutorials/scripting/img/autoload_example.webp index 0ab122861e0..47ab9829b58 100644 Binary files a/tutorials/scripting/img/autoload_example.webp and b/tutorials/scripting/img/autoload_example.webp differ diff --git a/tutorials/scripting/img/autoload_tab.webp b/tutorials/scripting/img/autoload_tab.webp index 2419ea54f03..69bae3f19b9 100644 Binary files a/tutorials/scripting/img/autoload_tab.webp and b/tutorials/scripting/img/autoload_tab.webp differ diff --git a/tutorials/scripting/img/autoload_tutorial1.webp b/tutorials/scripting/img/autoload_tutorial1.webp index dcccaacc3b8..4b51c680673 100644 Binary files a/tutorials/scripting/img/autoload_tutorial1.webp and b/tutorials/scripting/img/autoload_tutorial1.webp differ diff --git a/tutorials/scripting/singletons_autoload.rst b/tutorials/scripting/singletons_autoload.rst index 851c1a2a7c6..fdc4be9670a 100644 --- a/tutorials/scripting/singletons_autoload.rst +++ b/tutorials/scripting/singletons_autoload.rst @@ -205,7 +205,7 @@ current scene and replace it with the requested one. # The solution is to defer the load to a later time, when # we can be sure that no code from the current scene is running: - call_deferred("_deferred_goto_scene", path) + _deferred_goto_scene.call_deferred(path) func _deferred_goto_scene(path): diff --git a/tutorials/shaders/advanced_postprocessing.rst b/tutorials/shaders/advanced_postprocessing.rst index e06b97e148a..8c900b7cecd 100644 --- a/tutorials/shaders/advanced_postprocessing.rst +++ b/tutorials/shaders/advanced_postprocessing.rst @@ -47,7 +47,7 @@ and sets the vertex position in clip space directly. shader_type spatial; // Prevent the quad from being affected by lighting and fog. This also improves performance. - render_mode unshaded, disable_fog; + render_mode unshaded, fog_disabled; void vertex() { POSITION = vec4(VERTEX.xy, 1.0, 1.0); @@ -93,11 +93,10 @@ Once defined, the depth texture can be read with the ``texture()`` function. possible when reading from the current viewport. The depth texture cannot be accessed from another viewport to which you have rendered. -The values returned by ``depth_texture`` are between ``0.0`` and ``1.0`` and are nonlinear. +The values returned by ``depth_texture`` are between ``1.0`` and ``0.0`` (corresponding to +the near and far plane, respectively, because of using a "reverse-z" depth buffer) and are nonlinear. When displaying depth directly from the ``depth_texture``, everything will look almost -white unless it is very close. This is because the depth buffer stores objects closer -to the camera using more bits than those further, so most of the detail in depth -buffer is found close to the camera. In order to make the depth value align with world or +black unless it is very close due to that nonlinearity. In order to make the depth value align with world or model coordinates, we need to linearize the value. When we apply the projection matrix to the vertex position, the z value is made nonlinear, so to linearize it, we multiply it by the inverse of the projection matrix, which in Godot, is accessible with the variable diff --git a/tutorials/troubleshooting.rst b/tutorials/troubleshooting.rst index 0cc7a44a8ef..647f49d9d6a 100644 --- a/tutorials/troubleshooting.rst +++ b/tutorials/troubleshooting.rst @@ -25,11 +25,11 @@ There are several ways to improve performance and battery life: which can be up to 4 times faster. - Open the Editor Settings and increase the value of **Low Processor Mode Sleep (ยตsec)** to ``33000`` (30 FPS). This value determines the amount of *microseconds* - between frames to render. Higher values will make the editor feel less reactive + between frames to render. Higher values will make the editor feel less reactive, but will help decrease CPU and GPU usage significantly. - If you have a node that causes the editor to redraw continuously (such as particles), hide it and show it using a script in the ``_ready()`` method. - This way, it will be hidden in the editor but will still be visible in the + This way, it will be hidden in the editor, but will still be visible in the running project. The editor stutters and flickers on my variable refresh rate monitor (G-Sync/FreeSync) @@ -49,7 +49,7 @@ There are several workarounds for this: alleviate this, you can increase **Low Processor Mode Sleep (ยตsec)** to ``33000`` (30 FPS) in the Editor Settings. This value determines the amount of *microseconds* between frames to render. Higher values will make the editor - feel less reactive but will help decrease CPU and GPU usage significantly. + feel less reactive, but will help decrease CPU and GPU usage significantly. - Alternatively, disable variable refresh rate on your monitor or in the graphics driver. - VRR flicker can be reduced on some displays using the **VRR Control** or **Fine Tune Dark Areas** options in your monitor's OSD. These options may diff --git a/tutorials/xr/openxr_hand_tracking.rst b/tutorials/xr/openxr_hand_tracking.rst index 9f0da10f5db..5d91708ca97 100644 --- a/tutorials/xr/openxr_hand_tracking.rst +++ b/tutorials/xr/openxr_hand_tracking.rst @@ -127,7 +127,7 @@ For this Godot uses the hand bone structure as defined for the :ref:`Godot Human but optionally supporting an extra tip bone for each finger. The `OpenXR hand tracking demo `_ -contains example GLTF files of properly rigged hands. +contains example glTF files of properly rigged hands. We will be using those here and add them as a child to our ``XRNode3D`` node. We also need to enable editable children to gain access to our :ref:`Skeleton3D ` node.