mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-04 14:11:02 +03:00
Standardize RST header syntax
This commit is contained in:
@@ -27,7 +27,7 @@ New pages since version 4.3
|
|||||||
- :ref:`doc_spring_arm`
|
- :ref:`doc_spring_arm`
|
||||||
|
|
||||||
Debug
|
Debug
|
||||||
^^^^^
|
~~~~~
|
||||||
|
|
||||||
- :ref:`doc_output_panel`
|
- :ref:`doc_output_panel`
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ Performance
|
|||||||
- :ref:`doc_pipeline_compilations`
|
- :ref:`doc_pipeline_compilations`
|
||||||
|
|
||||||
Physics
|
Physics
|
||||||
^^^^^^^
|
~~~~~~~
|
||||||
|
|
||||||
- :ref:`doc_physics_interpolation`
|
- :ref:`doc_physics_interpolation`
|
||||||
- :ref:`doc_physics_interpolation_quick_start_guide`
|
- :ref:`doc_physics_interpolation_quick_start_guide`
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ required:
|
|||||||
.. _doc_compiling_for_linuxbsd_oneliners:
|
.. _doc_compiling_for_linuxbsd_oneliners:
|
||||||
|
|
||||||
Distro-specific one-liners
|
Distro-specific one-liners
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. tabs::
|
.. tabs::
|
||||||
|
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ More details about this directory in
|
|||||||
:ref:`Data directory<compiling_with_dotnet_data_directory>`.
|
:ref:`Data directory<compiling_with_dotnet_data_directory>`.
|
||||||
|
|
||||||
Build Platform
|
Build Platform
|
||||||
^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Provide the ``--godot-platform=<platform>`` argument to control for which
|
Provide the ``--godot-platform=<platform>`` argument to control for which
|
||||||
platform specific the libraries are built. Omit this argument to build for the
|
platform specific the libraries are built. Omit this argument to build for the
|
||||||
@@ -93,7 +93,7 @@ This currently only controls the inclusion of the support for Visual Studio as
|
|||||||
an external editor, the libraries are otherwise identical.
|
an external editor, the libraries are otherwise identical.
|
||||||
|
|
||||||
NuGet packages
|
NuGet packages
|
||||||
^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The API assemblies, source generators, and custom MSBuild project SDK are
|
The API assemblies, source generators, and custom MSBuild project SDK are
|
||||||
distributed as NuGet packages. This is all transparent to the user, but it can
|
distributed as NuGet packages. This is all transparent to the user, but it can
|
||||||
@@ -130,7 +130,7 @@ cache. It's recommended to always use this option when building the C# solutions
|
|||||||
during development to avoid mistakes.
|
during development to avoid mistakes.
|
||||||
|
|
||||||
Building without depending on deprecated features (NO_DEPRECATED)
|
Building without depending on deprecated features (NO_DEPRECATED)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
When building Godot without deprecated classes and functions, i.e. the ``deprecated=no``
|
When building Godot without deprecated classes and functions, i.e. the ``deprecated=no``
|
||||||
argument for scons, the managed libraries must also be built without dependencies to deprecated code.
|
argument for scons, the managed libraries must also be built without dependencies to deprecated code.
|
||||||
@@ -140,7 +140,7 @@ This is done by passing the ``--no-deprecated`` argument:
|
|||||||
./modules/mono/build_scripts/build_assemblies.py --godot-output-dir ./bin --push-nupkgs-local <my_local_source> --no-deprecated
|
./modules/mono/build_scripts/build_assemblies.py --godot-output-dir ./bin --push-nupkgs-local <my_local_source> --no-deprecated
|
||||||
|
|
||||||
Double Precision Support (REAL_T_IS_DOUBLE)
|
Double Precision Support (REAL_T_IS_DOUBLE)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
When building Godot with double precision support, i.e. the ``precision=double``
|
When building Godot with double precision support, i.e. the ``precision=double``
|
||||||
argument for scons, the managed libraries must be adjusted to match by passing
|
argument for scons, the managed libraries must be adjusted to match by passing
|
||||||
@@ -154,7 +154,7 @@ Examples
|
|||||||
--------
|
--------
|
||||||
|
|
||||||
Example (Windows)
|
Example (Windows)
|
||||||
^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
@@ -171,7 +171,7 @@ Example (Windows)
|
|||||||
|
|
||||||
|
|
||||||
Example (Linux, \*BSD)
|
Example (Linux, \*BSD)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
@@ -196,7 +196,7 @@ enabled. It contains important files for the correct functioning of Godot. It
|
|||||||
must be distributed together with the Godot executable.
|
must be distributed together with the Godot executable.
|
||||||
|
|
||||||
Editor
|
Editor
|
||||||
^^^^^^
|
~~~~~~
|
||||||
|
|
||||||
The name of the data directory for the Godot editor will always be
|
The name of the data directory for the Godot editor will always be
|
||||||
``GodotSharp``. This directory contains an ``Api`` subdirectory with the Godot
|
``GodotSharp``. This directory contains an ``Api`` subdirectory with the Godot
|
||||||
@@ -208,7 +208,7 @@ directory may be placed in the ``<bundle_name>.app/Contents/Resources/``
|
|||||||
directory inside the bundle.
|
directory inside the bundle.
|
||||||
|
|
||||||
Export templates
|
Export templates
|
||||||
^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The data directory for exported projects is generated by the editor during the
|
The data directory for exported projects is generated by the editor during the
|
||||||
export. It is named ``data_<APPNAME>_<ARCH>``, where ``<APPNAME>`` is the
|
export. It is named ``data_<APPNAME>_<ARCH>``, where ``<APPNAME>`` is the
|
||||||
|
|||||||
@@ -271,7 +271,7 @@ Optimizing the distribution of your project
|
|||||||
-------------------------------------------
|
-------------------------------------------
|
||||||
|
|
||||||
Desktop
|
Desktop
|
||||||
^^^^^^^
|
~~~~~~~
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -303,7 +303,7 @@ command:
|
|||||||
7z a -mx9 my_project.zip folder_containing_executable_and_pck
|
7z a -mx9 my_project.zip folder_containing_executable_and_pck
|
||||||
|
|
||||||
Web
|
Web
|
||||||
^^^
|
~~~
|
||||||
|
|
||||||
Enabling gzip or Brotli compression for all file types from the web export
|
Enabling gzip or Brotli compression for all file types from the web export
|
||||||
(especially the ``.wasm`` and ``.pck``) can reduce the download size
|
(especially the ``.wasm`` and ``.pck``) can reduce the download size
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ knowledge of the platform's SDKs. Depending on what features you need, the
|
|||||||
amount of work needed varies:
|
amount of work needed varies:
|
||||||
|
|
||||||
Required features of a platform port
|
Required features of a platform port
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
At the very least, a platform port must have methods from the :ref:`class_OS`
|
At the very least, a platform port must have methods from the :ref:`class_OS`
|
||||||
singleton implemented to be buildable and usable for headless operation.
|
singleton implemented to be buildable and usable for headless operation.
|
||||||
@@ -109,7 +109,7 @@ All methods should be implemented within ``detect.py`` as follows:
|
|||||||
options depending on SCons options chosen.
|
options depending on SCons options chosen.
|
||||||
|
|
||||||
Optional features of a platform port
|
Optional features of a platform port
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
In practice, headless operation doesn't suffice if you want to see anything on
|
In practice, headless operation doesn't suffice if you want to see anything on
|
||||||
screen and handle input devices. You may also want audio output for most
|
screen and handle input devices. You may also want audio output for most
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ Rendering methods
|
|||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
Forward+
|
Forward+
|
||||||
^^^^^^^^
|
~~~~~~~~
|
||||||
|
|
||||||
This is a forward renderer that uses a *clustered* approach to lighting.
|
This is a forward renderer that uses a *clustered* approach to lighting.
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ This approach can greatly speed up rendering performance on desktop hardware,
|
|||||||
but is substantially less efficient on mobile.
|
but is substantially less efficient on mobile.
|
||||||
|
|
||||||
Mobile
|
Mobile
|
||||||
^^^^^^
|
~~~~~~
|
||||||
|
|
||||||
This is a forward renderer that uses a traditional single-pass approach to lighting.
|
This is a forward renderer that uses a traditional single-pass approach to lighting.
|
||||||
Internally, it is called **Forward Mobile**.
|
Internally, it is called **Forward Mobile**.
|
||||||
@@ -104,7 +104,7 @@ post-processing effects are also not available.
|
|||||||
.. _doc_internal_rendering_architecture_compatibility:
|
.. _doc_internal_rendering_architecture_compatibility:
|
||||||
|
|
||||||
Compatibility
|
Compatibility
|
||||||
^^^^^^^^^^^^^
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ rendering features (even less so compared to Mobile). Most
|
|||||||
post-processing effects are not available.
|
post-processing effects are not available.
|
||||||
|
|
||||||
Why not deferred rendering?
|
Why not deferred rendering?
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Forward rendering generally provides a better tradeoff for performance versus
|
Forward rendering generally provides a better tradeoff for performance versus
|
||||||
flexibility, especially when a clustered approach to lighting is used. While
|
flexibility, especially when a clustered approach to lighting is used. While
|
||||||
@@ -161,7 +161,7 @@ Rendering drivers
|
|||||||
Godot 4 supports the following graphics APIs:
|
Godot 4 supports the following graphics APIs:
|
||||||
|
|
||||||
Vulkan
|
Vulkan
|
||||||
^^^^^^
|
~~~~~~
|
||||||
|
|
||||||
This is the main driver in Godot 4, with most of the development focus going
|
This is the main driver in Godot 4, with most of the development focus going
|
||||||
towards this driver.
|
towards this driver.
|
||||||
@@ -185,7 +185,7 @@ Vulkan driver.
|
|||||||
- `drivers/d3d12/d3d12_context.cpp <https://github.com/godotengine/godot/blob/master/drivers/d3d12/d3d12_context.cpp>`__
|
- `drivers/d3d12/d3d12_context.cpp <https://github.com/godotengine/godot/blob/master/drivers/d3d12/d3d12_context.cpp>`__
|
||||||
|
|
||||||
Direct3D 12
|
Direct3D 12
|
||||||
^^^^^^^^^^^
|
~~~~~~~~~~~
|
||||||
|
|
||||||
Like Vulkan, the Direct3D 12 driver targets modern platforms only. It is
|
Like Vulkan, the Direct3D 12 driver targets modern platforms only. It is
|
||||||
designed to target both Windows and Xbox (whereas Vulkan can't be used directly on Xbox).
|
designed to target both Windows and Xbox (whereas Vulkan can't be used directly on Xbox).
|
||||||
@@ -206,7 +206,7 @@ See the `pull request that introduced Direct3D 12 support <https://github.com/go
|
|||||||
for more information.
|
for more information.
|
||||||
|
|
||||||
Metal
|
Metal
|
||||||
^^^^^
|
~~~~~
|
||||||
|
|
||||||
Godot supports Metal rendering via `MoltenVK <https://github.com/KhronosGroup/MoltenVK>`__,
|
Godot supports Metal rendering via `MoltenVK <https://github.com/KhronosGroup/MoltenVK>`__,
|
||||||
as macOS and iOS do not support Vulkan natively.
|
as macOS and iOS do not support Vulkan natively.
|
||||||
@@ -224,7 +224,7 @@ A native Metal driver is planned in the future for better performance and
|
|||||||
compatibility.
|
compatibility.
|
||||||
|
|
||||||
OpenGL
|
OpenGL
|
||||||
^^^^^^
|
~~~~~~
|
||||||
|
|
||||||
This driver uses OpenGL ES 3.0 and targets legacy and low-end devices that don't
|
This driver uses OpenGL ES 3.0 and targets legacy and low-end devices that don't
|
||||||
support Vulkan. OpenGL 3.3 Core Profile is used on desktop platforms to run this
|
support Vulkan. OpenGL 3.3 Core Profile is used on desktop platforms to run this
|
||||||
@@ -246,7 +246,7 @@ Many advanced features are not supported with this driver, as it targets low-end
|
|||||||
devices first and foremost.
|
devices first and foremost.
|
||||||
|
|
||||||
Summary of rendering drivers/methods
|
Summary of rendering drivers/methods
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The following rendering API + rendering method combinations are currently possible:
|
The following rendering API + rendering method combinations are currently possible:
|
||||||
|
|
||||||
@@ -447,14 +447,14 @@ used to calculate particle collisions in 2D.
|
|||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
Batching and instancing
|
Batching and instancing
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
In the Forward+ renderer, Vulkan instancing is used to group rendering
|
In the Forward+ renderer, Vulkan instancing is used to group rendering
|
||||||
of identical objects for performance. This is not as fast as static mesh
|
of identical objects for performance. This is not as fast as static mesh
|
||||||
merging, but it still allows instances to be culled individually.
|
merging, but it still allows instances to be culled individually.
|
||||||
|
|
||||||
Light, decal and reflection probe rendering
|
Light, decal and reflection probe rendering
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -497,7 +497,7 @@ Clustering is also used for reflection probes and decal rendering in the
|
|||||||
Forward+ renderer.
|
Forward+ renderer.
|
||||||
|
|
||||||
Shadow mapping
|
Shadow mapping
|
||||||
^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Both Forward+ and Mobile methods use
|
Both Forward+ and Mobile methods use
|
||||||
:abbr:`PCF (Percentage Closer Filtering)` to filter shadow maps and create a
|
:abbr:`PCF (Percentage Closer Filtering)` to filter shadow maps and create a
|
||||||
@@ -517,7 +517,7 @@ The Compatibility renderer supports shadow mapping for DirectionalLight3D,
|
|||||||
OmniLight3D, and SpotLight3D lights.
|
OmniLight3D, and SpotLight3D lights.
|
||||||
|
|
||||||
Temporal antialiasing
|
Temporal antialiasing
|
||||||
^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -549,7 +549,7 @@ RenderingDevice abstraction as opposed to using AMD's reference code directly.
|
|||||||
- `thirdparty/amd-fsr2/ <https://github.com/godotengine/godot/tree/master/thirdparty/amd-fsr2>`__
|
- `thirdparty/amd-fsr2/ <https://github.com/godotengine/godot/tree/master/thirdparty/amd-fsr2>`__
|
||||||
|
|
||||||
Global illumination
|
Global illumination
|
||||||
^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -600,7 +600,7 @@ This would allow baking lightmaps while using the Compatibility renderer.
|
|||||||
- `modules/lightmapper_rd/lm_blendseams.glsl <https://github.com/godotengine/godot/blob/4.2/modules/lightmapper_rd/lm_blendseams.glsl>`__
|
- `modules/lightmapper_rd/lm_blendseams.glsl <https://github.com/godotengine/godot/blob/4.2/modules/lightmapper_rd/lm_blendseams.glsl>`__
|
||||||
|
|
||||||
Depth of field
|
Depth of field
|
||||||
^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -629,7 +629,7 @@ when temporal antialiasing is enabled.
|
|||||||
- `servers/rendering/renderer_rd/shaders/effects/bokeh_dof_raster.glsl <https://github.com/godotengine/godot/blob/4.2/servers/rendering/renderer_rd/shaders/effects/bokeh_dof_raster.glsl>`__
|
- `servers/rendering/renderer_rd/shaders/effects/bokeh_dof_raster.glsl <https://github.com/godotengine/godot/blob/4.2/servers/rendering/renderer_rd/shaders/effects/bokeh_dof_raster.glsl>`__
|
||||||
|
|
||||||
Screen-space effects (SSAO, SSIL, SSR, SSS)
|
Screen-space effects (SSAO, SSIL, SSR, SSS)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -678,7 +678,7 @@ SSR is always performed at half resolution to improve performance.
|
|||||||
- `servers/rendering/renderer_rd/shaders/effects/subsurface_scattering.glsl <https://github.com/godotengine/godot/blob/4.2/servers/rendering/renderer_rd/shaders/effects/subsurface_scattering.glsl>`__
|
- `servers/rendering/renderer_rd/shaders/effects/subsurface_scattering.glsl <https://github.com/godotengine/godot/blob/4.2/servers/rendering/renderer_rd/shaders/effects/subsurface_scattering.glsl>`__
|
||||||
|
|
||||||
Sky rendering
|
Sky rendering
|
||||||
^^^^^^^^^^^^^
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. seealso::
|
.. seealso::
|
||||||
|
|
||||||
@@ -705,7 +705,7 @@ article.
|
|||||||
**Sky rendering GLSL shader:**
|
**Sky rendering GLSL shader:**
|
||||||
|
|
||||||
Volumetric fog
|
Volumetric fog
|
||||||
^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -740,7 +740,7 @@ article.
|
|||||||
- `servers/rendering/renderer_rd/shaders/environment/volumetric_fog_process.glsl <https://github.com/godotengine/godot/blob/4.2/servers/rendering/renderer_rd/shaders/environment/volumetric_fog_process.glsl>`__
|
- `servers/rendering/renderer_rd/shaders/environment/volumetric_fog_process.glsl <https://github.com/godotengine/godot/blob/4.2/servers/rendering/renderer_rd/shaders/environment/volumetric_fog_process.glsl>`__
|
||||||
|
|
||||||
Occlusion culling
|
Occlusion culling
|
||||||
^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
While modern GPUs can handle drawing a lot of triangles, the number of draw
|
While modern GPUs can handle drawing a lot of triangles, the number of draw
|
||||||
calls in complex scenes can still be a bottleneck (even with Vulkan and Direct3D 12).
|
calls in complex scenes can still be a bottleneck (even with Vulkan and Direct3D 12).
|
||||||
@@ -782,7 +782,7 @@ RendererSceneOcclusionCull.
|
|||||||
- `servers/rendering/renderer_scene_occlusion_cull.cpp <https://github.com/godotengine/godot/blob/4.2/servers/rendering/renderer_scene_occlusion_cull.cpp>`__
|
- `servers/rendering/renderer_scene_occlusion_cull.cpp <https://github.com/godotengine/godot/blob/4.2/servers/rendering/renderer_scene_occlusion_cull.cpp>`__
|
||||||
|
|
||||||
Visibility range (LOD)
|
Visibility range (LOD)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Godot supports manually authored hierarchical level of detail (HLOD), with
|
Godot supports manually authored hierarchical level of detail (HLOD), with
|
||||||
distances specified by the user in the inspector.
|
distances specified by the user in the inspector.
|
||||||
@@ -796,7 +796,7 @@ same mesh with different LODs (to allow for split screen rendering to look corre
|
|||||||
- `servers/rendering/renderer_scene_cull.cpp <https://github.com/godotengine/godot/blob/4.2/servers/rendering/renderer_scene_cull.cpp>`__
|
- `servers/rendering/renderer_scene_cull.cpp <https://github.com/godotengine/godot/blob/4.2/servers/rendering/renderer_scene_cull.cpp>`__
|
||||||
|
|
||||||
Automatic mesh LOD
|
Automatic mesh LOD
|
||||||
^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The ImporterMesh class is used for the 3D mesh import workflow in the editor.
|
The ImporterMesh class is used for the 3D mesh import workflow in the editor.
|
||||||
Its ``generate_lods()`` function handles generating using the
|
Its ``generate_lods()`` function handles generating using the
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ use of modern C++ features conservative. Their use needs to serve a real
|
|||||||
purpose, such as improving code readability or performance.
|
purpose, such as improving code readability or performance.
|
||||||
|
|
||||||
Standard Template Library
|
Standard Template Library
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
We don't allow using the `STL <https://en.wikipedia.org/wiki/Standard_Template_Library>`__
|
We don't allow using the `STL <https://en.wikipedia.org/wiki/Standard_Template_Library>`__
|
||||||
as Godot provides its own data types (among other things).
|
as Godot provides its own data types (among other things).
|
||||||
@@ -67,7 +67,7 @@ This means that pull requests should **not** use ``std::string``,
|
|||||||
and Array. Therefore, List should be avoided in new code unless necessary.
|
and Array. Therefore, List should be avoided in new code unless necessary.
|
||||||
|
|
||||||
``auto`` keyword
|
``auto`` keyword
|
||||||
^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Please don't use the ``auto`` keyword for type inference. While it can avoid
|
Please don't use the ``auto`` keyword for type inference. While it can avoid
|
||||||
repetition, it can also lead to confusing code:
|
repetition, it can also lead to confusing code:
|
||||||
@@ -88,14 +88,14 @@ We chose to forbid ``auto`` instead of allowing it on a case-by-case basis to
|
|||||||
avoid having to decide on difficult edge cases. Thank you for your understanding.
|
avoid having to decide on difficult edge cases. Thank you for your understanding.
|
||||||
|
|
||||||
Lambdas
|
Lambdas
|
||||||
^^^^^^^
|
~~~~~~~
|
||||||
|
|
||||||
Lambdas should be used conservatively when they make code effectively faster or
|
Lambdas should be used conservatively when they make code effectively faster or
|
||||||
simpler, and do not impede readability. Please ask before using lambdas in a
|
simpler, and do not impede readability. Please ask before using lambdas in a
|
||||||
pull request.
|
pull request.
|
||||||
|
|
||||||
``#pragma once`` directive
|
``#pragma once`` directive
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
To follow the existing style, please use standard ``#ifdef``-based include
|
To follow the existing style, please use standard ``#ifdef``-based include
|
||||||
guards instead of ``#pragma once`` in new files.
|
guards instead of ``#pragma once`` in new files.
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ Profiler-specific instructions
|
|||||||
------------------------------
|
------------------------------
|
||||||
|
|
||||||
VerySleepy
|
VerySleepy
|
||||||
^^^^^^^^^^
|
~~~~~~~~~~
|
||||||
|
|
||||||
- Start the Godot editor or your project first.
|
- Start the Godot editor or your project first.
|
||||||
If you start the Project Manager, make sure to edit or run a project first.
|
If you start the Project Manager, make sure to edit or run a project first.
|
||||||
@@ -81,7 +81,7 @@ VerySleepy
|
|||||||
.. image:: img/cpp_profiler_verysleepy_results_filtered.png
|
.. image:: img/cpp_profiler_verysleepy_results_filtered.png
|
||||||
|
|
||||||
HotSpot
|
HotSpot
|
||||||
^^^^^^^
|
~~~~~~~
|
||||||
|
|
||||||
- Open HotSpot. Click **Record Data**:
|
- Open HotSpot. Click **Record Data**:
|
||||||
|
|
||||||
@@ -128,7 +128,7 @@ HotSpot
|
|||||||
This process attachment-based workflow is similar to the one used by VerySleepy.
|
This process attachment-based workflow is similar to the one used by VerySleepy.
|
||||||
|
|
||||||
Xcode Instruments
|
Xcode Instruments
|
||||||
^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
- Open Xcode. Select **Open Developer Tool** - **Instruments** from the **Xcode** app menu:
|
- Open Xcode. Select **Open Developer Tool** - **Instruments** from the **Xcode** app menu:
|
||||||
- Double-click on **Time Profiler** in the **Instruments** window:
|
- Double-click on **Time Profiler** in the **Instruments** window:
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ Platform-specific sanitizers
|
|||||||
----------------------------
|
----------------------------
|
||||||
|
|
||||||
Web
|
Web
|
||||||
^^^
|
~~~
|
||||||
|
|
||||||
When :ref:`compiling for the Web <doc_compiling_for_web>`,
|
When :ref:`compiling for the Web <doc_compiling_for_web>`,
|
||||||
there are 2 additional sanitizer SCons options available:
|
there are 2 additional sanitizer SCons options available:
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ Hints for performance
|
|||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
RAM usage
|
RAM usage
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
Building the documentation requires at least 8 GB of RAM to run without disk swapping,
|
Building the documentation requires at least 8 GB of RAM to run without disk swapping,
|
||||||
which slows it down.
|
which slows it down.
|
||||||
@@ -160,7 +160,7 @@ threads, ``-j auto`` (which corresponds to ``-j 32`` here) can require 20+ GB of
|
|||||||
RAM for Sphinx alone.
|
RAM for Sphinx alone.
|
||||||
|
|
||||||
Specifying a list of files
|
Specifying a list of files
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
You can specify a list of files to build, which can greatly speed up compilation:
|
You can specify a list of files to build, which can greatly speed up compilation:
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ Images
|
|||||||
------
|
------
|
||||||
|
|
||||||
Capturing an image
|
Capturing an image
|
||||||
^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
To take a picture of something in Godot, a screen capture tool can be used.
|
To take a picture of something in Godot, a screen capture tool can be used.
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ resolution screen the screenshot should be scaled down. There are instructions
|
|||||||
on how to do this later on this page.
|
on how to do this later on this page.
|
||||||
|
|
||||||
Format conversion
|
Format conversion
|
||||||
^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The current format for images in Godot's documentation is WebP (``.webp``).
|
The current format for images in Godot's documentation is WebP (``.webp``).
|
||||||
While some Linux programs will support saving screenshots in this format, macOS
|
While some Linux programs will support saving screenshots in this format, macOS
|
||||||
@@ -60,7 +60,7 @@ it may have the ability to open an image then save it as a WebP file.
|
|||||||
a 256-color palette with 1-bit transparency.
|
a 256-color palette with 1-bit transparency.
|
||||||
|
|
||||||
Cropping
|
Cropping
|
||||||
^^^^^^^^
|
~~~~~~~~
|
||||||
|
|
||||||
For a screenshot of a 2D or 3D scene in the editor, the above steps will be enough.
|
For a screenshot of a 2D or 3D scene in the editor, the above steps will be enough.
|
||||||
But for most UI images some extra work should be done, specifically cropping to
|
But for most UI images some extra work should be done, specifically cropping to
|
||||||
@@ -95,7 +95,7 @@ Krita and can be adjusted. Click on the image with your cropping tool still sele
|
|||||||
and the controls will return.
|
and the controls will return.
|
||||||
|
|
||||||
Scaling down an image
|
Scaling down an image
|
||||||
^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
As explained earlier on this page, all images taken on a screen that is a higher resolution
|
As explained earlier on this page, all images taken on a screen that is a higher resolution
|
||||||
than 1080p should be scaled down. To do this in Krita click on **Image** on the top bar, and
|
than 1080p should be scaled down. To do this in Krita click on **Image** on the top bar, and
|
||||||
@@ -107,7 +107,7 @@ sure the **Constrain Proportions** box at the bottom of the menu is checked so y
|
|||||||
to change 1 value.
|
to change 1 value.
|
||||||
|
|
||||||
Saving as WebP in Krita
|
Saving as WebP in Krita
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
To save an image as webp if it isn't already one, Go to **File > Save As**. Select **webp** from the
|
To save an image as webp if it isn't already one, Go to **File > Save As**. Select **webp** from the
|
||||||
**Save as type:** dropdown, then choose wherever you want to save it. After clicking **Save** a menu
|
**Save as type:** dropdown, then choose wherever you want to save it. After clicking **Save** a menu
|
||||||
@@ -120,7 +120,7 @@ If it's still over 300KB change to lossy compression and slowly increase the com
|
|||||||
size is bigger.
|
size is bigger.
|
||||||
|
|
||||||
Outlines, arrows and text
|
Outlines, arrows and text
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Sometimes an image needs something extra to properly direct the readers
|
Sometimes an image needs something extra to properly direct the readers
|
||||||
attention, or make something clear. Outlines and arrows can be used
|
attention, or make something clear. Outlines and arrows can be used
|
||||||
@@ -145,7 +145,7 @@ be used if appropriate. For example, if yellow blends into the image, or if ther
|
|||||||
multiple outlines in multiple colors.
|
multiple outlines in multiple colors.
|
||||||
|
|
||||||
Adding an image to a documentation page
|
Adding an image to a documentation page
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Once you've finished working on your image, it can be added to the documentation.
|
Once you've finished working on your image, it can be added to the documentation.
|
||||||
All images are stored in folders named ``img`` next to the page they are used in.
|
All images are stored in folders named ``img`` next to the page they are used in.
|
||||||
@@ -164,7 +164,7 @@ Videos
|
|||||||
------
|
------
|
||||||
|
|
||||||
Capturing a video
|
Capturing a video
|
||||||
^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
To record a video of something in Godot, a screen capture tool can be used.
|
To record a video of something in Godot, a screen capture tool can be used.
|
||||||
Operating systems generally don't come with tools that are flexible enough
|
Operating systems generally don't come with tools that are flexible enough
|
||||||
@@ -188,7 +188,7 @@ use a resolution of 1280×720.
|
|||||||
recording on a slow device), but it's less flexible.
|
recording on a slow device), but it's less flexible.
|
||||||
|
|
||||||
Compressing the captured video
|
Compressing the captured video
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The recommendation is to record your video in the highest quality possible
|
The recommendation is to record your video in the highest quality possible
|
||||||
(without dropping frames due to excessive CPU/GPU utilization), then re-encode
|
(without dropping frames due to excessive CPU/GPU utilization), then re-encode
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ as an example) to find the list of all languages:
|
|||||||
more details.
|
more details.
|
||||||
|
|
||||||
Adding a new language
|
Adding a new language
|
||||||
^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
If your language is already listed, click on its name to access the overview,
|
If your language is already listed, click on its name to access the overview,
|
||||||
and skip the rest of this section.
|
and skip the rest of this section.
|
||||||
@@ -92,7 +92,7 @@ to translate to:
|
|||||||
``pt_PT``).
|
``pt_PT``).
|
||||||
|
|
||||||
Translation interface
|
Translation interface
|
||||||
^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Once a language has been selected, you will see an overview of the translation
|
Once a language has been selected, you will see an overview of the translation
|
||||||
status, including how many strings are left to translate or review. Each item
|
status, including how many strings are left to translate or review. Each item
|
||||||
@@ -208,7 +208,7 @@ having some notions on the markup language used for each resource is important
|
|||||||
to avoid creating syntax errors in your translations.
|
to avoid creating syntax errors in your translations.
|
||||||
|
|
||||||
Editor interface (C++)
|
Editor interface (C++)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The editor translations originate from C++ strings, and may use:
|
The editor translations originate from C++ strings, and may use:
|
||||||
|
|
||||||
@@ -246,7 +246,7 @@ The editor translations originate from C++ strings, and may use:
|
|||||||
specifiers may be displayed as ``s%``.
|
specifiers may be displayed as ``s%``.
|
||||||
|
|
||||||
Online documentation (RST)
|
Online documentation (RST)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The documentation translations originate from reStructuredText (RST) files,
|
The documentation translations originate from reStructuredText (RST) files,
|
||||||
which also use their own markup syntax to style text, create internal and
|
which also use their own markup syntax to style text, create internal and
|
||||||
@@ -296,7 +296,7 @@ external links, etc. Here are some examples::
|
|||||||
and the internal and external hyperlink markup.
|
and the internal and external hyperlink markup.
|
||||||
|
|
||||||
Class reference (BBCode)
|
Class reference (BBCode)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The class reference is documented in the main Godot repository using XML files,
|
The class reference is documented in the main Godot repository using XML files,
|
||||||
and with BBCode-like markup for styling and internal references.
|
and with BBCode-like markup for styling and internal references.
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ reproduce the bug.
|
|||||||
another contributor can continue bisecting from there.
|
another contributor can continue bisecting from there.
|
||||||
|
|
||||||
Determine the commit hashes
|
Determine the commit hashes
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
To start bisecting, you must first determine the commit hashes (identifiers) of
|
To start bisecting, you must first determine the commit hashes (identifiers) of
|
||||||
the "bad" and "good" build. "bad" refers to the build that exhibits the bug,
|
the "bad" and "good" build. "bad" refers to the build that exhibits the bug,
|
||||||
@@ -138,7 +138,7 @@ instead of a commit hash. Note that unlike tagged releases or snapshot commit
|
|||||||
hashes, ``master`` is a perpetually moving target.
|
hashes, ``master`` is a perpetually moving target.
|
||||||
|
|
||||||
Build the engine
|
Build the engine
|
||||||
^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
:ref:`Get Godot's source code using Git <doc_getting_source>`. Once this
|
:ref:`Get Godot's source code using Git <doc_getting_source>`. Once this
|
||||||
is done, in the terminal window, use ``cd`` to reach the Godot repository
|
is done, in the terminal window, use ``cd`` to reach the Godot repository
|
||||||
@@ -159,7 +159,7 @@ Compile Godot. This assumes you've set up a build environment:
|
|||||||
scons
|
scons
|
||||||
|
|
||||||
Run the engine
|
Run the engine
|
||||||
^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Run the binary located in the ``bin/`` folder and try to reproduce the bug.
|
Run the binary located in the ``bin/`` folder and try to reproduce the bug.
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ do to conduct a substantive code review of a pull request.
|
|||||||
code only and have not tested the changes locally.
|
code only and have not tested the changes locally.
|
||||||
|
|
||||||
1. Confirm that the problem exists
|
1. Confirm that the problem exists
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
PRs need to solve problems and problems need to be documented. Make sure that
|
PRs need to solve problems and problems need to be documented. Make sure that
|
||||||
the pull request links and closes (or at least addresses) a bug or a proposal.
|
the pull request links and closes (or at least addresses) a bug or a proposal.
|
||||||
@@ -83,7 +83,7 @@ the PR to explain the problem that the PR aims to solve in more detail.
|
|||||||
helps contributors in the future understand why the code is the way it is.
|
helps contributors in the future understand why the code is the way it is.
|
||||||
|
|
||||||
2. Test the PR and look for regressions
|
2. Test the PR and look for regressions
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
While strict code review and CI help to ensure that all pull requests work as
|
While strict code review and CI help to ensure that all pull requests work as
|
||||||
intended, mistakes happen and sometimes contributors push code that creates a
|
intended, mistakes happen and sometimes contributors push code that creates a
|
||||||
@@ -99,7 +99,7 @@ the code, look for suspicious changes in other parts of the engine. Sometimes
|
|||||||
during rebasing changes slip through that contributors are not aware of.
|
during rebasing changes slip through that contributors are not aware of.
|
||||||
|
|
||||||
3. Do a code review
|
3. Do a code review
|
||||||
^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Code reviews are usually done by people who are already experienced in a given
|
Code reviews are usually done by people who are already experienced in a given
|
||||||
area. They may be able to provide ideas to make code faster, more organized, or
|
area. They may be able to provide ideas to make code faster, more organized, or
|
||||||
@@ -137,7 +137,7 @@ Here are some things to think about and look out for as you review the code:
|
|||||||
problem.
|
problem.
|
||||||
|
|
||||||
4. Iterate with the contributor and improve the PR
|
4. Iterate with the contributor and improve the PR
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Maintainers should provide feedback and suggestions for improvement if they spot
|
Maintainers should provide feedback and suggestions for improvement if they spot
|
||||||
things in the code that they would like changed. Preferably, suggestions should
|
things in the code that they would like changed. Preferably, suggestions should
|
||||||
@@ -194,7 +194,7 @@ Other teams may already be tagged for review, so you can also wait or ask for
|
|||||||
their assistance.
|
their assistance.
|
||||||
|
|
||||||
5. Approve the pull request
|
5. Approve the pull request
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
After reviewing the code, if you think that the code is ready to be merged into
|
After reviewing the code, if you think that the code is ready to be merged into
|
||||||
the engine, then go ahead and "approve" it. Make sure to also comment and
|
the engine, then go ahead and "approve" it. Make sure to also comment and
|
||||||
@@ -270,7 +270,7 @@ As a contributor you can help move a pull request forward by doing some of these
|
|||||||
steps yourself.
|
steps yourself.
|
||||||
|
|
||||||
1. Get feedback from the right people/teams
|
1. Get feedback from the right people/teams
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Production team members should ensure that the right people look at a pull
|
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
|
request before it is merged. In some cases this may require multiple people to
|
||||||
@@ -301,7 +301,7 @@ Godot organization left a review without having the relevant expertise.
|
|||||||
<https://github.com/godotengine/godot/pulls?q=is%3Apr+is%3Aopen+review%3Aapproved+sort%3Aupdated-desc>`_.
|
<https://github.com/godotengine/godot/pulls?q=is%3Apr+is%3Aopen+review%3Aapproved+sort%3Aupdated-desc>`_.
|
||||||
|
|
||||||
2. Get feedback from the community
|
2. Get feedback from the community
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
If a pull request is having trouble attracting reviewers, you may need to reach
|
If a pull request is having trouble attracting reviewers, you may need to reach
|
||||||
out more broadly to ask for help reviewing. Consider asking:
|
out more broadly to ask for help reviewing. Consider asking:
|
||||||
@@ -311,7 +311,7 @@ out more broadly to ask for help reviewing. Consider asking:
|
|||||||
* a more experienced maintainer from another area if they could provide feedback.
|
* a more experienced maintainer from another area if they could provide feedback.
|
||||||
|
|
||||||
3. Git checklist
|
3. Git checklist
|
||||||
^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
* **Make sure that the PR comes in one commit.**
|
* **Make sure that the PR comes in one commit.**
|
||||||
|
|
||||||
@@ -358,7 +358,7 @@ out more broadly to ask for help reviewing. Consider asking:
|
|||||||
page in the main Godot repository.
|
page in the main Godot repository.
|
||||||
|
|
||||||
4. GitHub checklist
|
4. GitHub checklist
|
||||||
^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
* **Validate the target branch of the PR.**
|
* **Validate the target branch of the PR.**
|
||||||
|
|
||||||
@@ -413,7 +413,7 @@ out more broadly to ask for help reviewing. Consider asking:
|
|||||||
milestone for the closed issue.
|
milestone for the closed issue.
|
||||||
|
|
||||||
5. Merge the pull request
|
5. Merge the pull request
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
If it is appropriate for you to be merging a pull request (i.e. you are on the
|
If it is appropriate for you to be merging a pull request (i.e. you are on the
|
||||||
production team or you are the team leader for that area), you are confident
|
production team or you are the team leader for that area), you are confident
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ depending on whether you have a GitHub account or not.
|
|||||||
instead.
|
instead.
|
||||||
|
|
||||||
If you have a GitHub account
|
If you have a GitHub account
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
- Open the pull request page. Click the **Checks** tab near the top of the page:
|
- Open the pull request page. Click the **Checks** tab near the top of the page:
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ If you have a GitHub account
|
|||||||
On macOS, see :ref:`doc_running_on_macos` for instructions on bypassing Gatekeeper.
|
On macOS, see :ref:`doc_running_on_macos` for instructions on bypassing Gatekeeper.
|
||||||
|
|
||||||
If you don't have a GitHub account
|
If you don't have a GitHub account
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
If you don't have a GitHub account and can't sign up for one,
|
If you don't have a GitHub account and can't sign up for one,
|
||||||
you can use the third-party `nightly.link <https://nightly.link>`__ service
|
you can use the third-party `nightly.link <https://nightly.link>`__ service
|
||||||
@@ -91,7 +91,7 @@ This approach may be needed for pull requests that were last updated more than
|
|||||||
by Godot's GitHub Actions setup.
|
by Godot's GitHub Actions setup.
|
||||||
|
|
||||||
Downloading a zipped pull request branch
|
Downloading a zipped pull request branch
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
- Open the pull request page. Click the *fork*'s branch name near the top of the page:
|
- Open the pull request page. Click the *fork*'s branch name near the top of the page:
|
||||||
|
|
||||||
@@ -106,7 +106,7 @@ Downloading a zipped pull request branch
|
|||||||
for your operating system.
|
for your operating system.
|
||||||
|
|
||||||
Checking out a pull request branch with git
|
Checking out a pull request branch with git
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Alternatively, you can checkout the pull request directly with git:
|
Alternatively, you can checkout the pull request directly with git:
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ This ensures that the game scales consistently on different sized screens.
|
|||||||
.. image:: img/setting-stretch-mode.webp
|
.. image:: img/setting-stretch-mode.webp
|
||||||
|
|
||||||
Organizing the project
|
Organizing the project
|
||||||
~~~~~~~~~~~~~~~~~~~~~~
|
----------------------
|
||||||
|
|
||||||
In this project, we will make 3 independent scenes: ``Player``, ``Mob``, and
|
In this project, we will make 3 independent scenes: ``Player``, ``Mob``, and
|
||||||
``HUD``, which we will combine into the game's ``Main`` scene.
|
``HUD``, which we will combine into the game's ``Main`` scene.
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ creating a separate Player scene is that we can test it separately, even before
|
|||||||
we've created other parts of the game.
|
we've created other parts of the game.
|
||||||
|
|
||||||
Node structure
|
Node structure
|
||||||
~~~~~~~~~~~~~~
|
--------------
|
||||||
|
|
||||||
To begin, we need to choose a root node for the player object. As a general
|
To begin, we need to choose a root node for the player object. As a general
|
||||||
rule, a scene's root node should reflect the object's desired functionality -
|
rule, a scene's root node should reflect the object's desired functionality -
|
||||||
@@ -60,7 +60,7 @@ or :kbd:`Cmd + S` on macOS.
|
|||||||
|
|
||||||
|
|
||||||
Sprite animation
|
Sprite animation
|
||||||
~~~~~~~~~~~~~~~~
|
----------------
|
||||||
|
|
||||||
Click on the ``Player`` node and add (:kbd:`Ctrl + A` on Windows/Linux or
|
Click on the ``Player`` node and add (:kbd:`Ctrl + A` on Windows/Linux or
|
||||||
:kbd:`Cmd + A` on macOS) a child node :ref:`AnimatedSprite2D
|
:kbd:`Cmd + A` on macOS) a child node :ref:`AnimatedSprite2D
|
||||||
|
|||||||
@@ -260,7 +260,7 @@ the player around the screen in all directions.
|
|||||||
the name you see in the scene tree.
|
the name you see in the scene tree.
|
||||||
|
|
||||||
Choosing animations
|
Choosing animations
|
||||||
~~~~~~~~~~~~~~~~~~~
|
-------------------
|
||||||
|
|
||||||
Now that the player can move, we need to change which animation the
|
Now that the player can move, we need to change which animation the
|
||||||
AnimatedSprite2D is playing based on its direction. We have the "walk" animation,
|
AnimatedSprite2D is playing based on its direction. We have the "walk" animation,
|
||||||
@@ -341,7 +341,7 @@ When you're sure the movement is working correctly, add this line to
|
|||||||
Hide();
|
Hide();
|
||||||
|
|
||||||
Preparing for collisions
|
Preparing for collisions
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
------------------------
|
||||||
|
|
||||||
We want ``Player`` to detect when it's hit by an enemy, but we haven't made any
|
We want ``Player`` to detect when it's hit by an enemy, but we haven't made any
|
||||||
enemies yet! That's OK, because we're going to use Godot's *signal*
|
enemies yet! That's OK, because we're going to use Godot's *signal*
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ We'll create a ``Mob`` scene, which we can then *instance* to create any number
|
|||||||
of independent mobs in the game.
|
of independent mobs in the game.
|
||||||
|
|
||||||
Node setup
|
Node setup
|
||||||
~~~~~~~~~~
|
----------
|
||||||
|
|
||||||
Click Scene -> New Scene from the top menu and add the following nodes:
|
Click Scene -> New Scene from the top menu and add the following nodes:
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ to ``90`` (under "Transform" in the Inspector).
|
|||||||
Save the scene.
|
Save the scene.
|
||||||
|
|
||||||
Enemy script
|
Enemy script
|
||||||
~~~~~~~~~~~~
|
------------
|
||||||
|
|
||||||
Add a script to the ``Mob`` like this:
|
Add a script to the ``Mob`` like this:
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ In addition, set the ``One Shot`` property of ``StartTimer`` to "On" and set
|
|||||||
``Position`` of the ``StartPosition`` node to ``(240, 450)``.
|
``Position`` of the ``StartPosition`` node to ``(240, 450)``.
|
||||||
|
|
||||||
Spawning mobs
|
Spawning mobs
|
||||||
~~~~~~~~~~~~~
|
-------------
|
||||||
|
|
||||||
The Main node will be spawning new mobs, and we want them to appear at a random
|
The Main node will be spawning new mobs, and we want them to appear at a random
|
||||||
location on the edge of the screen. Add a :ref:`Path2D <class_Path2D>` node
|
location on the edge of the screen. Add a :ref:`Path2D <class_Path2D>` node
|
||||||
@@ -70,7 +70,7 @@ Your scene should look like this:
|
|||||||
.. image:: img/main_scene_nodes.webp
|
.. image:: img/main_scene_nodes.webp
|
||||||
|
|
||||||
Main script
|
Main script
|
||||||
~~~~~~~~~~~
|
-----------
|
||||||
|
|
||||||
Add a script to ``Main``. At the top of the script, we use
|
Add a script to ``Main``. At the top of the script, we use
|
||||||
``@export var mob_scene: PackedScene`` to allow us to choose the Mob scene we want
|
``@export var mob_scene: PackedScene`` to allow us to choose the Mob scene we want
|
||||||
@@ -257,7 +257,7 @@ Note that a new instance must be added to the scene using ``add_child()``.
|
|||||||
convert between the two.
|
convert between the two.
|
||||||
|
|
||||||
Testing the scene
|
Testing the scene
|
||||||
~~~~~~~~~~~~~~~~~
|
-----------------
|
||||||
|
|
||||||
Let's test the scene to make sure everything is working. Add this ``new_game``
|
Let's test the scene to make sure everything is working. Add this ``new_game``
|
||||||
call to ``_ready()``:
|
call to ``_ready()``:
|
||||||
|
|||||||
@@ -56,14 +56,14 @@ use "Anchor Presets".
|
|||||||
.. image:: img/ui_anchor.webp
|
.. image:: img/ui_anchor.webp
|
||||||
|
|
||||||
ScoreLabel
|
ScoreLabel
|
||||||
~~~~~~~~~~
|
----------
|
||||||
|
|
||||||
1. Add the text ``0``.
|
1. Add the text ``0``.
|
||||||
2. Set the "Horizontal Alignment" and "Vertical Alignment" to ``Center``.
|
2. Set the "Horizontal Alignment" and "Vertical Alignment" to ``Center``.
|
||||||
3. Choose the "Anchor Preset" ``Center Top``.
|
3. Choose the "Anchor Preset" ``Center Top``.
|
||||||
|
|
||||||
Message
|
Message
|
||||||
~~~~~~~~~~~~
|
-------
|
||||||
|
|
||||||
1. Add the text ``Dodge the Creeps!``.
|
1. Add the text ``Dodge the Creeps!``.
|
||||||
2. Set the "Horizontal Alignment" and "Vertical Alignment" to ``Center``.
|
2. Set the "Horizontal Alignment" and "Vertical Alignment" to ``Center``.
|
||||||
@@ -72,7 +72,7 @@ Message
|
|||||||
5. Choose the "Anchor Preset" ``Center``.
|
5. Choose the "Anchor Preset" ``Center``.
|
||||||
|
|
||||||
StartButton
|
StartButton
|
||||||
~~~~~~~~~~~
|
-----------
|
||||||
|
|
||||||
1. Add the text ``Start``.
|
1. Add the text ``Start``.
|
||||||
2. Under "Control - Layout/Transform", set "Size X" to ``200`` and "Size Y" to ``100``
|
2. Under "Control - Layout/Transform", set "Size X" to ``200`` and "Size Y" to ``100``
|
||||||
@@ -213,7 +213,7 @@ signal of ``MessageTimer`` to the ``HUD`` node, and add the following code to th
|
|||||||
}
|
}
|
||||||
|
|
||||||
Connecting HUD to Main
|
Connecting HUD to Main
|
||||||
~~~~~~~~~~~~~~~~~~~~~~
|
----------------------
|
||||||
|
|
||||||
Now that we're done creating the ``HUD`` scene, go back to ``Main``. Instance
|
Now that we're done creating the ``HUD`` scene, go back to ``Main``. Instance
|
||||||
the ``HUD`` scene in ``Main`` like you did the ``Player`` scene. The scene tree
|
the ``HUD`` scene in ``Main`` like you did the ``Player`` scene. The scene tree
|
||||||
@@ -276,7 +276,7 @@ with the changing score:
|
|||||||
Now you're ready to play! Click the "Play the Project" button.
|
Now you're ready to play! Click the "Play the Project" button.
|
||||||
|
|
||||||
Removing old creeps
|
Removing old creeps
|
||||||
~~~~~~~~~~~~~~~~~~~
|
-------------------
|
||||||
|
|
||||||
If you play until "Game Over" and then start a new game right away, the creeps
|
If you play until "Game Over" and then start a new game right away, the creeps
|
||||||
from the previous game may still be on the screen. It would be better if they
|
from the previous game may still be on the screen. It would be better if they
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ remaining steps to add a bit more "juice" to improve the game experience.
|
|||||||
Feel free to expand the gameplay with your own ideas.
|
Feel free to expand the gameplay with your own ideas.
|
||||||
|
|
||||||
Background
|
Background
|
||||||
~~~~~~~~~~
|
----------
|
||||||
|
|
||||||
The default gray background is not very appealing, so let's change its color.
|
The default gray background is not very appealing, so let's change its color.
|
||||||
One way to do this is to use a :ref:`ColorRect <class_ColorRect>` node. Make it
|
One way to do this is to use a :ref:`ColorRect <class_ColorRect>` node. Make it
|
||||||
@@ -21,7 +21,7 @@ You could also add a background image, if you have one, by using a
|
|||||||
:ref:`TextureRect <class_TextureRect>` node instead.
|
:ref:`TextureRect <class_TextureRect>` node instead.
|
||||||
|
|
||||||
Sound effects
|
Sound effects
|
||||||
~~~~~~~~~~~~~
|
-------------
|
||||||
|
|
||||||
Sound and music can be the single most effective way to add appeal to the game
|
Sound and music can be the single most effective way to add appeal to the game
|
||||||
experience. In your game's **art** folder, you have two sound files: "House In a
|
experience. In your game's **art** folder, you have two sound files: "House In a
|
||||||
@@ -73,7 +73,7 @@ Finally, add ``$DeathSound.play()`` in the ``game_over()`` function.
|
|||||||
|
|
||||||
|
|
||||||
Keyboard shortcut
|
Keyboard shortcut
|
||||||
~~~~~~~~~~~~~~~~~
|
-----------------
|
||||||
|
|
||||||
Since the game is played with keyboard controls, it would be convenient if we
|
Since the game is played with keyboard controls, it would be convenient if we
|
||||||
could also start the game by pressing a key on the keyboard. We can do this with
|
could also start the game by pressing a key on the keyboard. We can do this with
|
||||||
@@ -123,7 +123,7 @@ And when you're ready, you can move on to :ref:`doc_your_first_3d_game` to learn
|
|||||||
to create a complete 3D game from scratch, in Godot.
|
to create a complete 3D game from scratch, in Godot.
|
||||||
|
|
||||||
Sharing the finished game with others
|
Sharing the finished game with others
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
-------------------------------------
|
||||||
|
|
||||||
If you want people to try out your game without having to install Godot, you'll
|
If you want people to try out your game without having to install Godot, you'll
|
||||||
need to export the project for each operating system you want the game to be
|
need to export the project for each operating system you want the game to be
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ LightOccluder2D nodes have 2 properties:
|
|||||||
There are two ways to create light occluders:
|
There are two ways to create light occluders:
|
||||||
|
|
||||||
Automatically generating a light occluder
|
Automatically generating a light occluder
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Occluders can be created automatically from Sprite2D nodes by selecting the
|
Occluders can be created automatically from Sprite2D nodes by selecting the
|
||||||
node, clicking the **Sprite2D** menu at the top of the 2D editor then choosing
|
node, clicking the **Sprite2D** menu at the top of the 2D editor then choosing
|
||||||
@@ -213,7 +213,7 @@ edges), adjust **Grow (pixels)** and **Shrink (pixels)**, then click **Update
|
|||||||
Preview**. Repeat this operation until you get satisfactory results.
|
Preview**. Repeat this operation until you get satisfactory results.
|
||||||
|
|
||||||
Manually drawing a light occluder
|
Manually drawing a light occluder
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Create a LightOccluder2D node, then select the node and click the "+" button at
|
Create a LightOccluder2D node, then select the node and click the "+" button at
|
||||||
the top of the 2D editor. When asked to create a polygon resource, answer
|
the top of the 2D editor. When asked to create a polygon resource, answer
|
||||||
@@ -256,7 +256,7 @@ The following properties can be adjusted on 2D lights that have shadows enabled:
|
|||||||
Soft shadows with streaking artifacts due to Filter Smooth being too high (PCF5, Filter Smooth 4)
|
Soft shadows with streaking artifacts due to Filter Smooth being too high (PCF5, Filter Smooth 4)
|
||||||
|
|
||||||
Occluder draw order
|
Occluder draw order
|
||||||
^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
**LightOccluder2Ds follows the usual 2D drawing order.** This is important for 2D
|
**LightOccluder2Ds follows the usual 2D drawing order.** This is important for 2D
|
||||||
lighting, as this is how you control whether the occluder should occlude the
|
lighting, as this is how you control whether the occluder should occlude the
|
||||||
|
|||||||
@@ -259,7 +259,7 @@ You will have to code a function to perform this and draw it yourself.
|
|||||||
to adjust the project to a higher resolution (a 2 or 4 scale tends to work well).
|
to adjust the project to a higher resolution (a 2 or 4 scale tends to work well).
|
||||||
|
|
||||||
Drawing a custom polygon shape
|
Drawing a custom polygon shape
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
While there is a dedicated node to draw custom polygons (
|
While there is a dedicated node to draw custom polygons (
|
||||||
:ref:`Polygon2D <class_Polygon2D>`), we will use in this case exclusively lower
|
:ref:`Polygon2D <class_Polygon2D>`), we will use in this case exclusively lower
|
||||||
@@ -394,7 +394,7 @@ Polygons will always **connect its last defined point to its first
|
|||||||
one** in order to have a closed shape.
|
one** in order to have a closed shape.
|
||||||
|
|
||||||
Drawing connected lines
|
Drawing connected lines
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Drawing a sequence of connected lines that don't close down to form a polygon
|
Drawing a sequence of connected lines that don't close down to form a polygon
|
||||||
is very similar to the previous method. We will use a connected set of lines to
|
is very similar to the previous method. We will use a connected set of lines to
|
||||||
@@ -499,7 +499,7 @@ code or a predefined color name. Check the class :ref:`Color <class_Color>` for
|
|||||||
constants and ways to define Colors.
|
constants and ways to define Colors.
|
||||||
|
|
||||||
Drawing circles
|
Drawing circles
|
||||||
^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
To create the eyes, we are going to add 4 additional calls to draw the eye
|
To create the eyes, we are going to add 4 additional calls to draw the eye
|
||||||
shapes, in different sizes, colors and positions.
|
shapes, in different sizes, colors and positions.
|
||||||
@@ -555,7 +555,7 @@ arbitrary angles), you can use the method
|
|||||||
:ref:`draw_arc <class_CanvasItem_method_draw_arc>`.
|
:ref:`draw_arc <class_CanvasItem_method_draw_arc>`.
|
||||||
|
|
||||||
Drawing lines
|
Drawing lines
|
||||||
^^^^^^^^^^^^^
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
To draw the final shape (the nose) we will use a line to approximate it.
|
To draw the final shape (the nose) we will use a line to approximate it.
|
||||||
|
|
||||||
@@ -610,7 +610,7 @@ you may get additional performance by drawing all of them in a single call, usin
|
|||||||
the :ref:`draw_multiline <class_CanvasItem_method_draw_multiline>` method.
|
the :ref:`draw_multiline <class_CanvasItem_method_draw_multiline>` method.
|
||||||
|
|
||||||
Drawing text
|
Drawing text
|
||||||
^^^^^^^^^^^^
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
While using the :ref:`Label <class_Label>` Node is the most common way to add
|
While using the :ref:`Label <class_Label>` Node is the most common way to add
|
||||||
text to your application, the low-level `_draw` function includes functionality
|
text to your application, the low-level `_draw` function includes functionality
|
||||||
@@ -680,7 +680,7 @@ can be found on the :ref:`CanvasItem <class_CanvasItem>` class reference.
|
|||||||
.. _doc_draw_show_drawing_while_editing_example:
|
.. _doc_draw_show_drawing_while_editing_example:
|
||||||
|
|
||||||
Show the drawing while editing
|
Show the drawing while editing
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
While the code so far is able to draw the logo on a running window, it will
|
While the code so far is able to draw the logo on a running window, it will
|
||||||
not show up on the ``2D view`` on the editor. In certain cases you would
|
not show up on the ``2D view`` on the editor. In certain cases you would
|
||||||
@@ -710,7 +710,7 @@ to refresh the current node in the ``2D`` view the first time you add or remove
|
|||||||
the ``@tool`` annotation.
|
the ``@tool`` annotation.
|
||||||
|
|
||||||
Animation
|
Animation
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
If we wanted to make the custom shape change at runtime, we could modify the
|
If we wanted to make the custom shape change at runtime, we could modify the
|
||||||
methods called or its arguments at execution time, or apply a transform.
|
methods called or its arguments at execution time, or apply a transform.
|
||||||
@@ -870,7 +870,7 @@ will see how to draw a dynamic line whose coordinates are not known beforehand,
|
|||||||
and are affected by the user's input.
|
and are affected by the user's input.
|
||||||
|
|
||||||
Drawing a straight line between 2 points
|
Drawing a straight line between 2 points
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Let's assume we want to draw a straight line between 2 points, the first one
|
Let's assume we want to draw a straight line between 2 points, the first one
|
||||||
will be fixed on the upper left corner ``(0, 0)`` and the second will be defined
|
will be fixed on the upper left corner ``(0, 0)`` and the second will be defined
|
||||||
@@ -943,7 +943,7 @@ It should look like this when run:
|
|||||||
.. image:: img/draw_line_between_2_points.webp
|
.. image:: img/draw_line_between_2_points.webp
|
||||||
|
|
||||||
Drawing an arc between 2 points
|
Drawing an arc between 2 points
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The above example works, but we may want to join those 2 points with a
|
The above example works, but we may want to join those 2 points with a
|
||||||
different shape or function, other than a straight line.
|
different shape or function, other than a straight line.
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ This page will show you the 2D workspace and how you can get to know it.
|
|||||||
.. tip:: If you would like to get an introduction to 3D, see :ref:`doc_introduction_to_3d`.
|
.. tip:: If you would like to get an introduction to 3D, see :ref:`doc_introduction_to_3d`.
|
||||||
|
|
||||||
2D workspace
|
2D workspace
|
||||||
~~~~~~~~~~~~
|
------------
|
||||||
|
|
||||||
You will use the 2D workspace to work with 2D scenes, design levels, or create user
|
You will use the 2D workspace to work with 2D scenes, design levels, or create user
|
||||||
interfaces.
|
interfaces.
|
||||||
@@ -47,7 +47,7 @@ applicable.
|
|||||||
|
|
||||||
|
|
||||||
Main toolbar
|
Main toolbar
|
||||||
------------
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
Some buttons in the main toolbar are the same as those in the 3D workspace. A brief explanation
|
Some buttons in the main toolbar are the same as those in the 3D workspace. A brief explanation
|
||||||
is given with the shortcut if the mouse cursor is hovered over a button for one second.
|
is given with the shortcut if the mouse cursor is hovered over a button for one second.
|
||||||
@@ -182,7 +182,7 @@ provides buttons to add, modify, or remove points.
|
|||||||
|
|
||||||
|
|
||||||
Coordinate system
|
Coordinate system
|
||||||
-----------------
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
In the 2D editor, unlike 3D, there are only two axes: ``x`` and ``y``. Also, the viewing
|
In the 2D editor, unlike 3D, there are only two axes: ``x`` and ``y``. Also, the viewing
|
||||||
angle is fixed.
|
angle is fixed.
|
||||||
@@ -206,7 +206,7 @@ Dragging in a negative direction flips the node horizontally or vertically.
|
|||||||
.. _doc_introduction_to_2d_the_viewport:
|
.. _doc_introduction_to_2d_the_viewport:
|
||||||
|
|
||||||
2D Viewport
|
2D Viewport
|
||||||
-----------
|
~~~~~~~~~~~
|
||||||
|
|
||||||
The viewport will be the area you spend the most time if you plan to design levels or user
|
The viewport will be the area you spend the most time if you plan to design levels or user
|
||||||
interfaces visually:
|
interfaces visually:
|
||||||
@@ -298,7 +298,7 @@ Viewport has a **View** menu which provides several options to change the look o
|
|||||||
|
|
||||||
|
|
||||||
Node2D and Control node
|
Node2D and Control node
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~
|
-----------------------
|
||||||
|
|
||||||
:ref:`CanvasItem <class_CanvasItem>` is the base node for 2D. :ref:`Node2D <class_Node2D>` is the base node
|
:ref:`CanvasItem <class_CanvasItem>` is the base node for 2D. :ref:`Node2D <class_Node2D>` is the base node
|
||||||
for 2D game objects, and :ref:`Control <class_Control>` is the base node
|
for 2D game objects, and :ref:`Control <class_Control>` is the base node
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ Each TileMapLayer node has several properties you can adjust:
|
|||||||
- **TileSet** The tileset used by the TileMapLayer node.
|
- **TileSet** The tileset used by the TileMapLayer node.
|
||||||
|
|
||||||
Rendering
|
Rendering
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
- **Y Sort Origin:** The vertical offset to use for Y-sorting on each tile (in pixels).
|
- **Y Sort Origin:** The vertical offset to use for Y-sorting on each tile (in pixels).
|
||||||
Only effective if **Y Sort Enabled** under CanvasItem settings is ``true``.
|
Only effective if **Y Sort Enabled** under CanvasItem settings is ``true``.
|
||||||
@@ -67,7 +67,7 @@ Rendering
|
|||||||
TileMapLayer since tiles are grouped by Y position in that case.
|
TileMapLayer since tiles are grouped by Y position in that case.
|
||||||
|
|
||||||
Physics
|
Physics
|
||||||
^^^^^^^
|
~~~~~~~
|
||||||
- **Collision Enabled** Enables or disables collision.
|
- **Collision Enabled** Enables or disables collision.
|
||||||
- **Use Kinematic Bodies** When true TileMapLayer collision shapes will be instantiated
|
- **Use Kinematic Bodies** When true TileMapLayer collision shapes will be instantiated
|
||||||
as kinematic bodies.
|
as kinematic bodies.
|
||||||
@@ -75,7 +75,7 @@ Physics
|
|||||||
visible. If set to default, then it depends on the show collision debug settings.
|
visible. If set to default, then it depends on the show collision debug settings.
|
||||||
|
|
||||||
Navigation
|
Navigation
|
||||||
^^^^^^^^^^
|
~~~~~~~~~~
|
||||||
|
|
||||||
- **Navigation Enabled** Whether or not navigation regions are enabled.
|
- **Navigation Enabled** Whether or not navigation regions are enabled.
|
||||||
- **Navigation Visible** Whether or not the TileMapLayer's navigation meshes are
|
- **Navigation Visible** Whether or not the TileMapLayer's navigation meshes are
|
||||||
@@ -91,7 +91,7 @@ Navigation
|
|||||||
2D navigation meshes can not be "layered" or stacked on top of each other like visuals or physic shapes. Attempting to stack navigation meshes on the same navigation map will result in merge and logical errors that break the pathfinding.
|
2D navigation meshes can not be "layered" or stacked on top of each other like visuals or physic shapes. Attempting to stack navigation meshes on the same navigation map will result in merge and logical errors that break the pathfinding.
|
||||||
|
|
||||||
Reordering layers
|
Reordering layers
|
||||||
^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
You can reorder layers by drag-and-dropping their node in the Scene tab. You can
|
You can reorder layers by drag-and-dropping their node in the Scene tab. You can
|
||||||
also switch between which TileMapLayer node you're working on by using the buttons
|
also switch between which TileMapLayer node you're working on by using the buttons
|
||||||
@@ -195,7 +195,7 @@ the 2D editor, **not** the TileMap panel itself.
|
|||||||
From left to right, the painting modes and tools you can choose are:
|
From left to right, the painting modes and tools you can choose are:
|
||||||
|
|
||||||
Selection
|
Selection
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
Select tiles by clicking a single tile, or by holding down the left mouse button to
|
Select tiles by clicking a single tile, or by holding down the left mouse button to
|
||||||
select multiple with a rectangle in the 2D editor. Note that empty space cannot be
|
select multiple with a rectangle in the 2D editor. Note that empty space cannot be
|
||||||
@@ -221,7 +221,7 @@ then performing a selection.
|
|||||||
Right-click or press :kbd:`Escape` to cancel pasting.
|
Right-click or press :kbd:`Escape` to cancel pasting.
|
||||||
|
|
||||||
Paint
|
Paint
|
||||||
^^^^^
|
~~~~~
|
||||||
|
|
||||||
The standard Paint mode allows you to place tiles by clicking or holding
|
The standard Paint mode allows you to place tiles by clicking or holding
|
||||||
down the left mouse button.
|
down the left mouse button.
|
||||||
@@ -250,7 +250,7 @@ the left mouse button.
|
|||||||
This is identical to using the Picker tool described below.
|
This is identical to using the Picker tool described below.
|
||||||
|
|
||||||
Line
|
Line
|
||||||
^^^^
|
~~~~
|
||||||
|
|
||||||
After selecting Line Paint mode, you can draw in a line that is
|
After selecting Line Paint mode, you can draw in a line that is
|
||||||
always 1 tile thick (no matter its orientation).
|
always 1 tile thick (no matter its orientation).
|
||||||
@@ -270,7 +270,7 @@ You can toggle this mode temporarily while in Paint or Eraser mode by holding
|
|||||||
Using the line tool after selecting two tiles to draw platforms diagonally
|
Using the line tool after selecting two tiles to draw platforms diagonally
|
||||||
|
|
||||||
Rectangle
|
Rectangle
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
After selecting Rectangle Paint mode, you can draw in an axis-aligned
|
After selecting Rectangle Paint mode, you can draw in an axis-aligned
|
||||||
rectangle.
|
rectangle.
|
||||||
@@ -285,7 +285,7 @@ You can toggle this mode temporarily while in Paint or Eraser mode by holding
|
|||||||
:kbd:`Ctrl` and :kbd:`Shift` then drawing.
|
:kbd:`Ctrl` and :kbd:`Shift` then drawing.
|
||||||
|
|
||||||
Bucket Fill
|
Bucket Fill
|
||||||
^^^^^^^^^^^
|
~~~~~~~~~~~
|
||||||
|
|
||||||
After selecting Bucket Fill mode, you can choose whether painting should be
|
After selecting Bucket Fill mode, you can choose whether painting should be
|
||||||
limited to contiguous areas only by toggling the **Contiguous** checkbox that
|
limited to contiguous areas only by toggling the **Contiguous** checkbox that
|
||||||
@@ -313,7 +313,7 @@ you can place them in a repeating pattern within the filled area.
|
|||||||
Using the Bucket Fill tool
|
Using the Bucket Fill tool
|
||||||
|
|
||||||
Picker
|
Picker
|
||||||
^^^^^^
|
~~~~~~
|
||||||
|
|
||||||
After selecting Picker mode, you can pick existing tiles in the 2D editor by
|
After selecting Picker mode, you can pick existing tiles in the 2D editor by
|
||||||
holding :kbd:`Ctrl` then clicking on a tile. This will switch the currently
|
holding :kbd:`Ctrl` then clicking on a tile. This will switch the currently
|
||||||
@@ -325,7 +325,7 @@ You can toggle this mode temporarily while in Paint mode by holding :kbd:`Ctrl`
|
|||||||
then clicking or dragging the mouse.
|
then clicking or dragging the mouse.
|
||||||
|
|
||||||
Eraser
|
Eraser
|
||||||
^^^^^^
|
~~~~~~
|
||||||
|
|
||||||
This mode is combined with any other painting mode (Paint, Line, Rectangle,
|
This mode is combined with any other painting mode (Paint, Line, Rectangle,
|
||||||
Bucket Fill). When eraser mode is enabled, tiles will be replaced by empty tiles
|
Bucket Fill). When eraser mode is enabled, tiles will be replaced by empty tiles
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ Creating a new TileSet
|
|||||||
.. _doc_creating_tilesets_using_tilesheet:
|
.. _doc_creating_tilesets_using_tilesheet:
|
||||||
|
|
||||||
Using a tilesheet
|
Using a tilesheet
|
||||||
^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
This demonstration will use the following tiles taken from
|
This demonstration will use the following tiles taken from
|
||||||
`Kenney's "Abstract Platformer" pack <https://kenney.nl/assets/abstract-platformer>`__.
|
`Kenney's "Abstract Platformer" pack <https://kenney.nl/assets/abstract-platformer>`__.
|
||||||
@@ -155,7 +155,7 @@ three vertical dots menu button at the top of the TileSet editor and choose
|
|||||||
Recreating tiles automatically after changing atlas properties
|
Recreating tiles automatically after changing atlas properties
|
||||||
|
|
||||||
Using a collection of scenes
|
Using a collection of scenes
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Since Godot 4.0, you can place actual *scenes* as tiles. This allows you to use
|
Since Godot 4.0, you can place actual *scenes* as tiles. This allows you to use
|
||||||
any collection of nodes as a tile. For example, you could use scene tiles to
|
any collection of nodes as a tile. For example, you could use scene tiles to
|
||||||
@@ -522,7 +522,7 @@ There are two ways to assign properties to multiple tiles at once.
|
|||||||
Depending on your use cases, one method may be faster than the other:
|
Depending on your use cases, one method may be faster than the other:
|
||||||
|
|
||||||
Using multiple tile selection
|
Using multiple tile selection
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
If you wish to configure various properties on several tiles at once,
|
If you wish to configure various properties on several tiles at once,
|
||||||
choose the **Select** mode at the top of the TileSet editor:
|
choose the **Select** mode at the top of the TileSet editor:
|
||||||
@@ -550,7 +550,7 @@ property's value on all tiles in the atlas after editing a property:
|
|||||||
.. _doc_using_tilemaps_using_tile_property_painting:
|
.. _doc_using_tilemaps_using_tile_property_painting:
|
||||||
|
|
||||||
Using tile property painting
|
Using tile property painting
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
If you wish to apply a single property to several tiles at once,
|
If you wish to apply a single property to several tiles at once,
|
||||||
you can use the *property painting* mode for this purpose.
|
you can use the *property painting* mode for this purpose.
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ remains customizable and uses the same font subresource as Control nodes
|
|||||||
rendering).
|
rendering).
|
||||||
|
|
||||||
Advantages
|
Advantages
|
||||||
^^^^^^^^^^
|
~~~~~~~~~~
|
||||||
|
|
||||||
- Label3D is faster to generate than TextMesh. While both use a caching
|
- Label3D is faster to generate than TextMesh. While both use a caching
|
||||||
mechanism to only render new glyphs once, Label3D will still be faster to
|
mechanism to only render new glyphs once, Label3D will still be faster to
|
||||||
@@ -52,7 +52,7 @@ Advantages
|
|||||||
See :ref:`doc_gui_using_fonts` for guidelines on configuring font imports.
|
See :ref:`doc_gui_using_fonts` for guidelines on configuring font imports.
|
||||||
|
|
||||||
Limitations
|
Limitations
|
||||||
^^^^^^^^^^^
|
~~~~~~~~~~~
|
||||||
|
|
||||||
By default, Label3D has limited interaction with a 3D environment. It can be
|
By default, Label3D has limited interaction with a 3D environment. It can be
|
||||||
occluded by geometry and lit by light sources if the **Shaded** flag is enabled.
|
occluded by geometry and lit by light sources if the **Shaded** flag is enabled.
|
||||||
@@ -94,7 +94,7 @@ the texture below as a reference for the generated mesh's UV map:
|
|||||||
.. image:: img/text_mesh_textured.png
|
.. image:: img/text_mesh_textured.png
|
||||||
|
|
||||||
Advantages
|
Advantages
|
||||||
^^^^^^^^^^
|
~~~~~~~~~~
|
||||||
|
|
||||||
TextMesh has a few advantages over Label3D:
|
TextMesh has a few advantages over Label3D:
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ TextMesh has a few advantages over Label3D:
|
|||||||
- TextMesh can use custom shaders, unlike Label3D.
|
- TextMesh can use custom shaders, unlike Label3D.
|
||||||
|
|
||||||
Limitations
|
Limitations
|
||||||
^^^^^^^^^^^
|
~~~~~~~~~~~
|
||||||
|
|
||||||
There are some limitations to TextMesh:
|
There are some limitations to TextMesh:
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ See the `3D waypoints <https://github.com/godotengine/godot-demo-projects/tree/m
|
|||||||
demo for an example of this.
|
demo for an example of this.
|
||||||
|
|
||||||
Advantages
|
Advantages
|
||||||
^^^^^^^^^^
|
~~~~~~~~~~
|
||||||
|
|
||||||
- Any Control node can be used, including Label, RichTextLabel or even nodes such
|
- Any Control node can be used, including Label, RichTextLabel or even nodes such
|
||||||
as Button. This allows for powerful formatting and GUI interaction.
|
as Button. This allows for powerful formatting and GUI interaction.
|
||||||
@@ -144,7 +144,7 @@ Advantages
|
|||||||
applies to the project.
|
applies to the project.
|
||||||
|
|
||||||
Limitations
|
Limitations
|
||||||
^^^^^^^^^^^
|
~~~~~~~~~~~
|
||||||
|
|
||||||
- Projected Controls cannot be occluded by 3D geometry in any way. You can use a
|
- Projected Controls cannot be occluded by 3D geometry in any way. You can use a
|
||||||
RayCast to fully hide the control if its target position is occluded by a
|
RayCast to fully hide the control if its target position is occluded by a
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ but you can enable it by using it in one of the following locations, in order
|
|||||||
of priority:
|
of priority:
|
||||||
|
|
||||||
Camera3D node (high priority)
|
Camera3D node (high priority)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
An Environment can be set to a Camera3D node. It will have priority over any
|
An Environment can be set to a Camera3D node. It will have priority over any
|
||||||
other setting.
|
other setting.
|
||||||
@@ -37,7 +37,7 @@ This is mostly useful when you want to override an existing environment,
|
|||||||
but in general it's a better idea to use the option below.
|
but in general it's a better idea to use the option below.
|
||||||
|
|
||||||
WorldEnvironment node (medium priority, recommended)
|
WorldEnvironment node (medium priority, recommended)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The WorldEnvironment node can be added to any scene, but only one can exist per
|
The WorldEnvironment node can be added to any scene, but only one can exist per
|
||||||
active scene tree. Adding more than one will result in a warning.
|
active scene tree. Adding more than one will result in a warning.
|
||||||
@@ -49,7 +49,7 @@ Any Environment added has higher priority than the default Environment
|
|||||||
which makes it quite useful.
|
which makes it quite useful.
|
||||||
|
|
||||||
Preview environment and sun (low priority)
|
Preview environment and sun (low priority)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@ The following is a detailed description of all environment options and how
|
|||||||
they are intended to be used.
|
they are intended to be used.
|
||||||
|
|
||||||
Background
|
Background
|
||||||
^^^^^^^^^^
|
~~~~~~~~~~
|
||||||
|
|
||||||
The Background section contains settings on how to fill the background (parts of
|
The Background section contains settings on how to fill the background (parts of
|
||||||
the screen where objects were not drawn). The background not only serves the
|
the screen where objects were not drawn). The background not only serves the
|
||||||
@@ -160,7 +160,7 @@ There are several background modes available:
|
|||||||
"hall of mirrors" visual glitch if the sky is visible at any time.
|
"hall of mirrors" visual glitch if the sky is visible at any time.
|
||||||
|
|
||||||
Sky materials
|
Sky materials
|
||||||
^^^^^^^^^^^^^
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
When using the **Sky** background mode (or the ambient/reflected light mode is
|
When using the **Sky** background mode (or the ambient/reflected light mode is
|
||||||
set to **Sky**), a Sky subresource becomes available to edit in the Environment
|
set to **Sky**), a Sky subresource becomes available to edit in the Environment
|
||||||
@@ -201,7 +201,7 @@ If you need a custom sky material (e.g. for procedural clouds), you can
|
|||||||
create a custom :ref:`sky shader <doc_sky_shader>`.
|
create a custom :ref:`sky shader <doc_sky_shader>`.
|
||||||
|
|
||||||
Ambient light
|
Ambient light
|
||||||
^^^^^^^^^^^^^
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
Ambient light (as defined here) is a type of light that affects every piece of
|
Ambient light (as defined here) is a type of light that affects every piece of
|
||||||
geometry with the same intensity. It is global and independent of lights that
|
geometry with the same intensity. It is global and independent of lights that
|
||||||
@@ -255,7 +255,7 @@ Using one of the methods described above will replace constant ambient
|
|||||||
lighting with ambient lighting from the probes.
|
lighting with ambient lighting from the probes.
|
||||||
|
|
||||||
Reflected light
|
Reflected light
|
||||||
^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Reflected light (also called specular light) is the other of the two components
|
Reflected light (also called specular light) is the other of the two components
|
||||||
of image-based lighting.
|
of image-based lighting.
|
||||||
@@ -271,7 +271,7 @@ Reflected light can be set to one of 3 modes:
|
|||||||
behaves identically to **Background**.
|
behaves identically to **Background**.
|
||||||
|
|
||||||
Fog
|
Fog
|
||||||
^^^
|
~~~
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -308,7 +308,7 @@ In practice, it makes light stand out more across the fog.
|
|||||||
for guidance on reducing banding.
|
for guidance on reducing banding.
|
||||||
|
|
||||||
Volumetric Fog
|
Volumetric Fog
|
||||||
^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Volumetric fog provides a realistic fog effect to the scene, with fog color
|
Volumetric fog provides a realistic fog effect to the scene, with fog color
|
||||||
being affected by the lights that traverse the fog.
|
being affected by the lights that traverse the fog.
|
||||||
@@ -318,7 +318,7 @@ being affected by the lights that traverse the fog.
|
|||||||
See :ref:`doc_volumetric_fog` for documentation on setting up volumetric fog.
|
See :ref:`doc_volumetric_fog` for documentation on setting up volumetric fog.
|
||||||
|
|
||||||
Tonemap
|
Tonemap
|
||||||
^^^^^^^
|
~~~~~~~
|
||||||
|
|
||||||
Tonemap selects the tonemapping curve that will be applied to the scene, from a
|
Tonemap selects the tonemapping curve that will be applied to the scene, from a
|
||||||
list of standard curves used in the film and game industries. Tonemapping operators
|
list of standard curves used in the film and game industries. Tonemapping operators
|
||||||
@@ -369,7 +369,7 @@ The Environment resource supports many popular mid- and post-processing effects.
|
|||||||
distracting changes during gameplay.
|
distracting changes during gameplay.
|
||||||
|
|
||||||
Screen-Space Reflections (SSR)
|
Screen-Space Reflections (SSR)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
*This feature is only available when using the Forward+ renderer, not
|
*This feature is only available when using the Forward+ renderer, not
|
||||||
Mobile or Compatibility.*
|
Mobile or Compatibility.*
|
||||||
@@ -411,7 +411,7 @@ This also applies to shaders that use ``hint_screen_texture`` or ``hint_depth_te
|
|||||||
uniforms.
|
uniforms.
|
||||||
|
|
||||||
Screen-Space Ambient Occlusion (SSAO)
|
Screen-Space Ambient Occlusion (SSAO)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
*This feature is only available when using the Forward+ renderer, not
|
*This feature is only available when using the Forward+ renderer, not
|
||||||
Mobile or Compatibility.*
|
Mobile or Compatibility.*
|
||||||
@@ -485,7 +485,7 @@ parameters:
|
|||||||
.. _doc_environment_and_post_processing_ssil:
|
.. _doc_environment_and_post_processing_ssil:
|
||||||
|
|
||||||
Screen-Space Indirect Lighting (SSIL)
|
Screen-Space Indirect Lighting (SSIL)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
*This feature is only available when using the Forward+ renderer, not
|
*This feature is only available when using the Forward+ renderer, not
|
||||||
Mobile or Compatibility.*
|
Mobile or Compatibility.*
|
||||||
@@ -531,7 +531,7 @@ Tweaking :abbr:`SSIL (Screen-Space Indirect Lighting)` is possible with several
|
|||||||
.. image:: img/environment_ssil.webp
|
.. image:: img/environment_ssil.webp
|
||||||
|
|
||||||
Signed Distance Field Global Illumination (SDFGI)
|
Signed Distance Field Global Illumination (SDFGI)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
*This feature is only available when using the Forward+ renderer, not
|
*This feature is only available when using the Forward+ renderer, not
|
||||||
Mobile or Compatibility.*
|
Mobile or Compatibility.*
|
||||||
@@ -550,7 +550,7 @@ illumination for off-screen elements (unlike :abbr:`SSIL (Screen-Space Indirect
|
|||||||
.. _doc_environment_and_post_processing_glow:
|
.. _doc_environment_and_post_processing_glow:
|
||||||
|
|
||||||
Glow
|
Glow
|
||||||
^^^^
|
~~~~
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -641,7 +641,7 @@ There are 2 main use cases for a glow map texture:
|
|||||||
.. _doc_environment_and_post_processing_using_glow_in_2d:
|
.. _doc_environment_and_post_processing_using_glow_in_2d:
|
||||||
|
|
||||||
Using glow in 2D
|
Using glow in 2D
|
||||||
^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
There are 2 ways to use glow in 2D:
|
There are 2 ways to use glow in 2D:
|
||||||
|
|
||||||
@@ -689,7 +689,7 @@ There are 2 ways to use glow in 2D:
|
|||||||
.. _doc_environment_and_post_processing_using_glow_to_blur_the_screen:
|
.. _doc_environment_and_post_processing_using_glow_to_blur_the_screen:
|
||||||
|
|
||||||
Using glow to blur the screen
|
Using glow to blur the screen
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Glow can be used to blur the whole viewport, which is useful for background blur
|
Glow can be used to blur the whole viewport, which is useful for background blur
|
||||||
when a menu is open. Only 3D rendering will be affected unless the environment's
|
when a menu is open. Only 3D rendering will be affected unless the environment's
|
||||||
@@ -715,7 +715,7 @@ To use glow as a blurring solution:
|
|||||||
Example of using glow to blur the 2D rendering in the menu's background
|
Example of using glow to blur the 2D rendering in the menu's background
|
||||||
|
|
||||||
Adjustments
|
Adjustments
|
||||||
^^^^^^^^^^^
|
~~~~~~~~~~~
|
||||||
|
|
||||||
At the end of processing, Godot offers the possibility to do some standard
|
At the end of processing, Godot offers the possibility to do some standard
|
||||||
image adjustments.
|
image adjustments.
|
||||||
@@ -797,7 +797,7 @@ Camera attribute options
|
|||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
Depth of Field / Far Blur
|
Depth of Field / Far Blur
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
This effect simulates focal distance on cameras. It blurs objects behind
|
This effect simulates focal distance on cameras. It blurs objects behind
|
||||||
a given range. It has an initial **Distance** with a **Transition** region
|
a given range. It has an initial **Distance** with a **Transition** region
|
||||||
@@ -810,7 +810,7 @@ the depth of field quality in the advanced project settings may be needed to
|
|||||||
avoid artifacts.
|
avoid artifacts.
|
||||||
|
|
||||||
Depth of Field / Near Blur
|
Depth of Field / Near Blur
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
This effect simulates focal distance on cameras. It blurs objects close
|
This effect simulates focal distance on cameras. It blurs objects close
|
||||||
to the camera (acts in the opposite direction as far blur).
|
to the camera (acts in the opposite direction as far blur).
|
||||||
@@ -834,13 +834,13 @@ given object, or create a so-called
|
|||||||
distance, focal length, and aperture.
|
distance, focal length, and aperture.
|
||||||
|
|
||||||
Exposure
|
Exposure
|
||||||
^^^^^^^^
|
~~~~~~~~
|
||||||
|
|
||||||
This multiplies the overall scene brightness visible from the camera. Higher
|
This multiplies the overall scene brightness visible from the camera. Higher
|
||||||
values result in a visually brighter scene.
|
values result in a visually brighter scene.
|
||||||
|
|
||||||
Auto Exposure
|
Auto Exposure
|
||||||
^^^^^^^^^^^^^
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
*This feature is only available when using the Forward+ renderer, not
|
*This feature is only available when using the Forward+ renderer, not
|
||||||
Mobile or Compatibility.*
|
Mobile or Compatibility.*
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ being reflected back onto the rest of the scene.
|
|||||||
Global illumination is composed of several key concepts:
|
Global illumination is composed of several key concepts:
|
||||||
|
|
||||||
Indirect diffuse lighting
|
Indirect diffuse lighting
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
This is the lighting that does not change depending on the camera's angle.
|
This is the lighting that does not change depending on the camera's angle.
|
||||||
There are two main sources of indirect diffuse lighting:
|
There are two main sources of indirect diffuse lighting:
|
||||||
@@ -64,7 +64,7 @@ it when targeting low-end hardware.
|
|||||||
limitations documentation for ways to reduce this effect.
|
limitations documentation for ways to reduce this effect.
|
||||||
|
|
||||||
Specular lighting
|
Specular lighting
|
||||||
^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Specular lighting is also referred to as *reflections*.
|
Specular lighting is also referred to as *reflections*.
|
||||||
This is the lighting that changes in intensity depending on the camera's angle.
|
This is the lighting that changes in intensity depending on the camera's angle.
|
||||||
@@ -112,7 +112,7 @@ there are several criteria to keep in mind:
|
|||||||
Here's a comparison of all the global illumination techniques available in Godot:
|
Here's a comparison of all the global illumination techniques available in Godot:
|
||||||
|
|
||||||
Performance
|
Performance
|
||||||
^^^^^^^^^^^
|
~~~~~~~~~~~
|
||||||
|
|
||||||
In order of performance from fastest to slowest:
|
In order of performance from fastest to slowest:
|
||||||
|
|
||||||
@@ -158,7 +158,7 @@ In order of performance from fastest to slowest:
|
|||||||
**Not available** *when using the Mobile or Compatibility renderers.*
|
**Not available** *when using the Mobile or Compatibility renderers.*
|
||||||
|
|
||||||
Visuals
|
Visuals
|
||||||
^^^^^^^
|
~~~~~~~
|
||||||
|
|
||||||
For comparison, here's a 3D scene with no global illumination options used:
|
For comparison, here's a 3D scene with no global illumination options used:
|
||||||
|
|
||||||
@@ -242,7 +242,7 @@ Here's how Godot's various global illumination techniques compare:
|
|||||||
ReflectionProbe in action (without any other GI technique). Notice the reflective sphere.
|
ReflectionProbe in action (without any other GI technique). Notice the reflective sphere.
|
||||||
|
|
||||||
Real-time ability
|
Real-time ability
|
||||||
^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
- **VoxelGI:** |good| Fully real-time.
|
- **VoxelGI:** |good| Fully real-time.
|
||||||
|
|
||||||
@@ -290,7 +290,7 @@ Real-time ability
|
|||||||
This makes ReflectionProbes viable for procedurally generated levels.
|
This makes ReflectionProbes viable for procedurally generated levels.
|
||||||
|
|
||||||
User work needed
|
User work needed
|
||||||
^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
- **VoxelGI:** One or more VoxelGI nodes need to be created and baked.
|
- **VoxelGI:** One or more VoxelGI nodes need to be created and baked.
|
||||||
|
|
||||||
@@ -325,7 +325,7 @@ User work needed
|
|||||||
.. |bad| image:: img/score_bad.webp
|
.. |bad| image:: img/score_bad.webp
|
||||||
|
|
||||||
Summary
|
Summary
|
||||||
^^^^^^^
|
~~~~~~~
|
||||||
|
|
||||||
If you are unsure about which GI technique to use:
|
If you are unsure about which GI technique to use:
|
||||||
|
|
||||||
@@ -349,7 +349,7 @@ If you are unsure about which GI technique to use:
|
|||||||
.. _doc_introduction_to_global_illumination_gi_mode_recommendations:
|
.. _doc_introduction_to_global_illumination_gi_mode_recommendations:
|
||||||
|
|
||||||
Which global illumination mode should I use on meshes and lights?
|
Which global illumination mode should I use on meshes and lights?
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Regardless of which global illumination technique you use, there is no
|
Regardless of which global illumination technique you use, there is no
|
||||||
universally "better" global illumination mode. Still, here are some
|
universally "better" global illumination mode. Still, here are some
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ not share pixels in the texture.
|
|||||||
There are a few ways to ensure your object has a unique UV2 layer and texture size:
|
There are a few ways to ensure your object has a unique UV2 layer and texture size:
|
||||||
|
|
||||||
Unwrap on scene import (recommended)
|
Unwrap on scene import (recommended)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
In most scenarios, this is the best approach to use. The only downside is that,
|
In most scenarios, this is the best approach to use. The only downside is that,
|
||||||
on large models, unwrapping can take a while on import. Nonetheless, Godot will
|
on large models, unwrapping can take a while on import. Nonetheless, Godot will
|
||||||
@@ -137,7 +137,7 @@ their UV2 maps properly generated.
|
|||||||
and engine versions.
|
and engine versions.
|
||||||
|
|
||||||
Unwrap from within Godot
|
Unwrap from within Godot
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. warning::
|
.. warning::
|
||||||
|
|
||||||
@@ -154,7 +154,7 @@ This will generate a second set of UV2 coordinates which can be used for baking.
|
|||||||
It will also set the texture size automatically.
|
It will also set the texture size automatically.
|
||||||
|
|
||||||
Unwrap from your 3D modeling software
|
Unwrap from your 3D modeling software
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The last option is to do it from your favorite 3D app. This approach is
|
The last option is to do it from your favorite 3D app. This approach is
|
||||||
generally **not recommended**, but it's explained so that you know it exists.
|
generally **not recommended**, but it's explained so that you know it exists.
|
||||||
@@ -177,7 +177,7 @@ to work quickly. You will mostly need to use seams or other techniques to create
|
|||||||
better unwrapping.
|
better unwrapping.
|
||||||
|
|
||||||
Generating UV2 for primitive meshes
|
Generating UV2 for primitive meshes
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -203,7 +203,7 @@ lightmap texture, which varies depending on the mesh's size properties and the
|
|||||||
any modifications will be lost when the scene is reloaded.
|
any modifications will be lost when the scene is reloaded.
|
||||||
|
|
||||||
Generating UV2 for CSG nodes
|
Generating UV2 for CSG nodes
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Since Godot 4.4, you can
|
Since Godot 4.4, you can
|
||||||
:ref:`convert a CSG node and its children to a MeshInstance3D <doc_csg_tools_converting_to_mesh_instance_3d>`.
|
:ref:`convert a CSG node and its children to a MeshInstance3D <doc_csg_tools_converting_to_mesh_instance_3d>`.
|
||||||
@@ -222,7 +222,7 @@ This can be used to bake lightmaps on a CSG node by following these steps:
|
|||||||
again.
|
again.
|
||||||
|
|
||||||
Checking UV2
|
Checking UV2
|
||||||
^^^^^^^^^^^^
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
In the **Mesh** menu mentioned before, the UV2 texture coordinates can be visualized.
|
In the **Mesh** menu mentioned before, the UV2 texture coordinates can be visualized.
|
||||||
If something is failing, double-check that the meshes have these UV2 coordinates:
|
If something is failing, double-check that the meshes have these UV2 coordinates:
|
||||||
@@ -244,7 +244,7 @@ inconsistent lightmap texel scaling, make sure to respect the rule about mesh
|
|||||||
scaling mentioned before.
|
scaling mentioned before.
|
||||||
|
|
||||||
Setting up meshes
|
Setting up meshes
|
||||||
^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
For a **MeshInstance3D** node to take part in the baking process, it needs to have
|
For a **MeshInstance3D** node to take part in the baking process, it needs to have
|
||||||
its bake mode set to **Static**. Meshes that have their bake mode set to **Disabled**
|
its bake mode set to **Static**. Meshes that have their bake mode set to **Disabled**
|
||||||
@@ -255,7 +255,7 @@ or **Dynamic** will be ignored by the lightmapper.
|
|||||||
When auto-generating lightmaps on scene import, this is enabled automatically.
|
When auto-generating lightmaps on scene import, this is enabled automatically.
|
||||||
|
|
||||||
Setting up lights
|
Setting up lights
|
||||||
^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Lights are baked with indirect light only by default. This means that shadowmapping
|
Lights are baked with indirect light only by default. This means that shadowmapping
|
||||||
and lighting are still dynamic and affect moving objects, but light bounces from
|
and lighting are still dynamic and affect moving objects, but light bounces from
|
||||||
@@ -269,7 +269,7 @@ can be controlled from the **Bake Mode** menu in lights:
|
|||||||
The modes are:
|
The modes are:
|
||||||
|
|
||||||
Disabled
|
Disabled
|
||||||
^^^^^^^^
|
~~~~~~~~
|
||||||
|
|
||||||
The light is ignored when baking lightmaps. This is the mode to use for dynamic
|
The light is ignored when baking lightmaps. This is the mode to use for dynamic
|
||||||
lighting effects such as explosions and weapon effects.
|
lighting effects such as explosions and weapon effects.
|
||||||
@@ -281,7 +281,7 @@ lighting effects such as explosions and weapon effects.
|
|||||||
disabling its **Visible** property.
|
disabling its **Visible** property.
|
||||||
|
|
||||||
Dynamic
|
Dynamic
|
||||||
^^^^^^^
|
~~~~~~~
|
||||||
|
|
||||||
This is the default mode, and is a compromise between performance and real-time
|
This is the default mode, and is a compromise between performance and real-time
|
||||||
friendliness. Only indirect lighting will be baked. Direct light and shadows are
|
friendliness. Only indirect lighting will be baked. Direct light and shadows are
|
||||||
@@ -292,7 +292,7 @@ position while still looking fairly correct. For example, you can use this
|
|||||||
to create flickering static torches that have their indirect light baked.
|
to create flickering static torches that have their indirect light baked.
|
||||||
|
|
||||||
Static
|
Static
|
||||||
^^^^^^
|
~~~~~~
|
||||||
|
|
||||||
Both indirect and direct lighting will be baked. Since static surfaces can skip
|
Both indirect and direct lighting will be baked. Since static surfaces can skip
|
||||||
lighting and shadow computations entirely, this mode provides the best
|
lighting and shadow computations entirely, this mode provides the best
|
||||||
@@ -343,7 +343,7 @@ method and quality selected.
|
|||||||
set to a high enough value.
|
set to a high enough value.
|
||||||
|
|
||||||
Tweaks
|
Tweaks
|
||||||
^^^^^^
|
~~~~~~
|
||||||
|
|
||||||
- **Quality:** Four bake quality modes are provided: Low, Medium, High, and
|
- **Quality:** Four bake quality modes are provided: Low, Medium, High, and
|
||||||
Ultra. Higher quality takes more time, but result in a better-looking lightmap
|
Ultra. Higher quality takes more time, but result in a better-looking lightmap
|
||||||
@@ -433,7 +433,7 @@ noise and softens them while attempting to best preserve detail.
|
|||||||
Godot offers two denoising algorithms:
|
Godot offers two denoising algorithms:
|
||||||
|
|
||||||
JNLM (Non-Local Means with Joint Filtering)
|
JNLM (Non-Local Means with Joint Filtering)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
JNLM is the default denoising method and is included in Godot. It uses a simple
|
JNLM is the default denoising method and is included in Godot. It uses a simple
|
||||||
but efficient denoising algorithm known as *non-local means*. JNLM runs on the
|
but efficient denoising algorithm known as *non-local means*. JNLM runs on the
|
||||||
@@ -451,7 +451,7 @@ removing noise, at the cost of suppressing shadow detail for static shadows.
|
|||||||
Comparison between JNLM denoiser strength values. Higher values can reduce detail.
|
Comparison between JNLM denoiser strength values. Higher values can reduce detail.
|
||||||
|
|
||||||
OIDN (Open Image Denoise)
|
OIDN (Open Image Denoise)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Unlike JNLM, OIDN uses a machine learning approach to denoising lightmaps. It
|
Unlike JNLM, OIDN uses a machine learning approach to denoising lightmaps. It
|
||||||
features a model specifically trained to remove noise from lightmaps while
|
features a model specifically trained to remove noise from lightmaps while
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ relevant math written for game developers, not mathemeticians or engineers,
|
|||||||
check out :ref:`doc_vector_math` and :ref:`doc_using_transforms`.
|
check out :ref:`doc_vector_math` and :ref:`doc_using_transforms`.
|
||||||
|
|
||||||
3D workspace
|
3D workspace
|
||||||
~~~~~~~~~~~~
|
------------
|
||||||
|
|
||||||
Editing 3D scenes is done in the 3D workspace. This workspace can be selected
|
Editing 3D scenes is done in the 3D workspace. This workspace can be selected
|
||||||
manually, but it will be automatically selected when a Node3D node is
|
manually, but it will be automatically selected when a Node3D node is
|
||||||
@@ -40,7 +40,7 @@ Below the scene selector, the main toolbar is visible, and beneath the main tool
|
|||||||
is the 3D viewport.
|
is the 3D viewport.
|
||||||
|
|
||||||
Main toolbar
|
Main toolbar
|
||||||
------------
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
Some buttons in the main toolbar are the same as those in the 2D workspace. A brief explanation
|
Some buttons in the main toolbar are the same as those in the 2D workspace. A brief explanation
|
||||||
is given with the shortcut if the mouse cursor is hovered over a button for one second.
|
is given with the shortcut if the mouse cursor is hovered over a button for one second.
|
||||||
@@ -125,7 +125,7 @@ MeshInstance3D is selected. This menu provides some quick actions or tools to
|
|||||||
work on a specific node or selection.
|
work on a specific node or selection.
|
||||||
|
|
||||||
View menu of viewport
|
View menu of viewport
|
||||||
---------------------
|
~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Below the *Select* tool, in the 3D viewport, clicking on the three dots opens the
|
Below the *Select* tool, in the 3D viewport, clicking on the three dots opens the
|
||||||
**View menu** for the viewport.
|
**View menu** for the viewport.
|
||||||
@@ -141,7 +141,7 @@ nodes within the viewport.
|
|||||||
.. _doc_introduction_to_3d_coordinate_system:
|
.. _doc_introduction_to_3d_coordinate_system:
|
||||||
|
|
||||||
Coordinate system
|
Coordinate system
|
||||||
-----------------
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Godot uses the `metric <https://en.wikipedia.org/wiki/Metric_system>`__
|
Godot uses the `metric <https://en.wikipedia.org/wiki/Metric_system>`__
|
||||||
system for everything in 3D, with 1 unit being equal to 1 meter.
|
system for everything in 3D, with 1 unit being equal to 1 meter.
|
||||||
@@ -176,7 +176,7 @@ See this chart for comparison with other 3D software:
|
|||||||
.. _doc_introduction_to_3d_space_and_manipulation:
|
.. _doc_introduction_to_3d_space_and_manipulation:
|
||||||
|
|
||||||
Space and manipulation gizmos
|
Space and manipulation gizmos
|
||||||
-----------------------------
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Moving, rotating, and scaling objects in the 3D view is done through the
|
Moving, rotating, and scaling objects in the 3D view is done through the
|
||||||
manipulator gizmos.
|
manipulator gizmos.
|
||||||
@@ -202,7 +202,7 @@ If the transform mode is changed from *Select Mode* to *Scale Mode*, the arrows
|
|||||||
replaced by cubes, which can be dragged to scale an object as if the object is being moved.
|
replaced by cubes, which can be dragged to scale an object as if the object is being moved.
|
||||||
|
|
||||||
Navigating the 3D environment
|
Navigating the 3D environment
|
||||||
-----------------------------
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
In 3D environments, it is often important to adjust the viewpoint or angle
|
In 3D environments, it is often important to adjust the viewpoint or angle
|
||||||
from which you are viewing the scene.
|
from which you are viewing the scene.
|
||||||
@@ -251,7 +251,7 @@ In orthogonal mode, holding the right mouse button will pan the view instead.
|
|||||||
Use :kbd:`Keypad 5` to toggle between perspective and orthogonal view.
|
Use :kbd:`Keypad 5` to toggle between perspective and orthogonal view.
|
||||||
|
|
||||||
Using Blender-style transform shortcuts
|
Using Blender-style transform shortcuts
|
||||||
---------------------------------------
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Since Godot 4.2, you can enable Blender-style shortcuts for translating,
|
Since Godot 4.2, you can enable Blender-style shortcuts for translating,
|
||||||
rotating and scaling nodes. In Blender, these shortcuts are:
|
rotating and scaling nodes. In Blender, these shortcuts are:
|
||||||
@@ -284,7 +284,7 @@ To use Blender-style transform shortcuts in Godot, go to the Editor Settings'
|
|||||||
:ref:`doc_default_key_mapping_shortcuts_spatial_editor` page.
|
:ref:`doc_default_key_mapping_shortcuts_spatial_editor` page.
|
||||||
|
|
||||||
Node3D node
|
Node3D node
|
||||||
~~~~~~~~~~~
|
-----------
|
||||||
|
|
||||||
:ref:`Node2D <class_Node2D>` is the base node for 2D.
|
:ref:`Node2D <class_Node2D>` is the base node for 2D.
|
||||||
:ref:`Control <class_Control>` is the base node for everything GUI.
|
:ref:`Control <class_Control>` is the base node for everything GUI.
|
||||||
@@ -303,7 +303,7 @@ scale.
|
|||||||
.. image:: img/tuto_3d2.webp
|
.. image:: img/tuto_3d2.webp
|
||||||
|
|
||||||
3D content
|
3D content
|
||||||
~~~~~~~~~~
|
----------
|
||||||
|
|
||||||
Unlike 2D, where loading image content and drawing is straightforward, 3D is a
|
Unlike 2D, where loading image content and drawing is straightforward, 3D is a
|
||||||
little more difficult. The content needs to be created with special 3D tools
|
little more difficult. The content needs to be created with special 3D tools
|
||||||
@@ -312,7 +312,7 @@ exchange file format to be imported in Godot. This is required since 3D formats
|
|||||||
are not as standardized as images.
|
are not as standardized as images.
|
||||||
|
|
||||||
Manually authored models (using 3D modeling software)
|
Manually authored models (using 3D modeling software)
|
||||||
-----------------------------------------------------
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. FIXME: Needs update to properly description Godot 3.x workflow
|
.. FIXME: Needs update to properly description Godot 3.x workflow
|
||||||
(used to reference a non existing doc_importing_3d_meshes importer).
|
(used to reference a non existing doc_importing_3d_meshes importer).
|
||||||
@@ -325,7 +325,7 @@ as simple resources.
|
|||||||
.. seealso:: See :ref:`doc_importing_3d_scenes` for more on importing.
|
.. seealso:: See :ref:`doc_importing_3d_scenes` for more on importing.
|
||||||
|
|
||||||
Generated geometry
|
Generated geometry
|
||||||
------------------
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
It is possible to create custom geometry by using the
|
It is possible to create custom geometry by using the
|
||||||
:ref:`ArrayMesh <class_ArrayMesh>` resource directly. Simply create your arrays
|
:ref:`ArrayMesh <class_ArrayMesh>` resource directly. Simply create your arrays
|
||||||
@@ -343,7 +343,7 @@ submitting them to the 3D API has a significant performance cost.
|
|||||||
|
|
||||||
|
|
||||||
Immediate geometry
|
Immediate geometry
|
||||||
------------------
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
If, instead, you need to generate simple geometry that will be updated often,
|
If, instead, you need to generate simple geometry that will be updated often,
|
||||||
Godot provides a special :ref:`ImmediateMesh <class_ImmediateMesh>` resource
|
Godot provides a special :ref:`ImmediateMesh <class_ImmediateMesh>` resource
|
||||||
@@ -352,7 +352,7 @@ This provides an OpenGL 1.x-style immediate-mode API to create points, lines,
|
|||||||
triangles, etc.
|
triangles, etc.
|
||||||
|
|
||||||
2D in 3D
|
2D in 3D
|
||||||
--------
|
~~~~~~~~
|
||||||
|
|
||||||
While Godot packs a powerful 2D engine, many types of games use 2D in a
|
While Godot packs a powerful 2D engine, many types of games use 2D in a
|
||||||
3D environment. By using a fixed camera (either orthogonal or
|
3D environment. By using a fixed camera (either orthogonal or
|
||||||
@@ -367,7 +367,7 @@ performance in comparison to plain 2D, as well as the lack of reference
|
|||||||
of working in pixels.
|
of working in pixels.
|
||||||
|
|
||||||
Environment
|
Environment
|
||||||
~~~~~~~~~~~
|
-----------
|
||||||
|
|
||||||
Besides editing a scene, it is often common to edit the environment.
|
Besides editing a scene, it is often common to edit the environment.
|
||||||
Godot provides a :ref:`WorldEnvironment <class_WorldEnvironment>`
|
Godot provides a :ref:`WorldEnvironment <class_WorldEnvironment>`
|
||||||
@@ -378,7 +378,7 @@ Environments can also be overridden in the Camera.
|
|||||||
.. _doc_introduction_to_3d_preview_environment_light:
|
.. _doc_introduction_to_3d_preview_environment_light:
|
||||||
|
|
||||||
Preview environment and light
|
Preview environment and light
|
||||||
-----------------------------
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
By default, any 3D scene that doesn't have a :ref:`WorldEnvironment <class_WorldEnvironment>`
|
By default, any 3D scene that doesn't have a :ref:`WorldEnvironment <class_WorldEnvironment>`
|
||||||
node, or a :ref:`DirectionalLight3D <class_DirectionalLight3D>`, will have
|
node, or a :ref:`DirectionalLight3D <class_DirectionalLight3D>`, will have
|
||||||
@@ -405,7 +405,7 @@ So only make adjustments that would apply to all of the scenes you will need a p
|
|||||||
light and environment for.
|
light and environment for.
|
||||||
|
|
||||||
Cameras
|
Cameras
|
||||||
-------
|
~~~~~~~
|
||||||
|
|
||||||
No matter how many objects are placed in the 3D space, nothing will be
|
No matter how many objects are placed in the 3D space, nothing will be
|
||||||
displayed unless a :ref:`Camera3D <class_Camera3D>` is
|
displayed unless a :ref:`Camera3D <class_Camera3D>` is
|
||||||
@@ -435,7 +435,7 @@ each viewport:
|
|||||||
tree-order will take its place.
|
tree-order will take its place.
|
||||||
|
|
||||||
Lights
|
Lights
|
||||||
------
|
~~~~~~
|
||||||
|
|
||||||
The background environment emits some ambient light which appears on surfaces.
|
The background environment emits some ambient light which appears on surfaces.
|
||||||
Still, without any light sources placed in the scene, the scene will appear
|
Still, without any light sources placed in the scene, the scene will appear
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ There is a list of generic shadow parameters, each also has a specific function:
|
|||||||
.. image:: img/lights_and_shadows_blur.webp
|
.. image:: img/lights_and_shadows_blur.webp
|
||||||
|
|
||||||
Tweaking shadow bias
|
Tweaking shadow bias
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Below is an image of what tweaking bias looks like. Default values work for most
|
Below is an image of what tweaking bias looks like. Default values work for most
|
||||||
cases, but in general, it depends on the size and complexity of geometry.
|
cases, but in general, it depends on the size and complexity of geometry.
|
||||||
@@ -201,7 +201,7 @@ recommendations in :ref:`doc_lights_and_shadows_pcss_recommendations` if setting
|
|||||||
this value above ``0.0`` on lights with shadows enabled.
|
this value above ``0.0`` on lights with shadows enabled.
|
||||||
|
|
||||||
Directional shadow mapping
|
Directional shadow mapping
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
To compute shadow maps, the scene is rendered (only depth) from an orthogonal
|
To compute shadow maps, the scene is rendered (only depth) from an orthogonal
|
||||||
point of view that covers the whole scene (or up to the max distance). There is,
|
point of view that covers the whole scene (or up to the max distance). There is,
|
||||||
@@ -290,7 +290,7 @@ expensive, so check the recommendations in
|
|||||||
.. image:: img/lights_and_shadows_pcss.webp
|
.. image:: img/lights_and_shadows_pcss.webp
|
||||||
|
|
||||||
Omni shadow mapping
|
Omni shadow mapping
|
||||||
^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Omni light shadow mapping is relatively straightforward. The main issue that
|
Omni light shadow mapping is relatively straightforward. The main issue that
|
||||||
needs to be considered is the algorithm used to render it.
|
needs to be considered is the algorithm used to render it.
|
||||||
@@ -343,7 +343,7 @@ and add two extra parameters:
|
|||||||
- **Angle Attenuation:** The cone attenuation, which helps soften the cone borders.
|
- **Angle Attenuation:** The cone attenuation, which helps soften the cone borders.
|
||||||
|
|
||||||
Spot shadow mapping
|
Spot shadow mapping
|
||||||
^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Spots feature the same parameters as omni lights for shadow mapping. Rendering
|
Spots feature the same parameters as omni lights for shadow mapping. Rendering
|
||||||
spot shadow maps is significantly faster compared to omni lights, as only one
|
spot shadow maps is significantly faster compared to omni lights, as only one
|
||||||
@@ -439,7 +439,7 @@ Positional (omni/spot) shadow quality settings can be changed at runtime on the
|
|||||||
root :ref:`class_Viewport`.
|
root :ref:`class_Viewport`.
|
||||||
|
|
||||||
Shadow map size
|
Shadow map size
|
||||||
^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
High shadow resolutions result in sharper shadows, but at a significant
|
High shadow resolutions result in sharper shadows, but at a significant
|
||||||
performance cost. It should also be noted that *sharper shadows are not always
|
performance cost. It should also be noted that *sharper shadows are not always
|
||||||
@@ -454,7 +454,7 @@ fewer shadows. This will allow each shadow to be rendered at a higher resolution
|
|||||||
.. _doc_lights_and_shadows_shadow_filter_mode:
|
.. _doc_lights_and_shadows_shadow_filter_mode:
|
||||||
|
|
||||||
Shadow filter mode
|
Shadow filter mode
|
||||||
^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Several shadow map quality settings can be chosen here. The default **Soft Low**
|
Several shadow map quality settings can be chosen here. The default **Soft Low**
|
||||||
is a good balance between performance and quality for scenes with detailed
|
is a good balance between performance and quality for scenes with detailed
|
||||||
@@ -474,7 +474,7 @@ make use of the increased sample count.
|
|||||||
.. image:: img/lights_and_shadows_filter_quality.webp
|
.. image:: img/lights_and_shadows_filter_quality.webp
|
||||||
|
|
||||||
16-bits versus 32-bit
|
16-bits versus 32-bit
|
||||||
^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
By default, Godot uses 16-bit depth textures for shadow map rendering. This is
|
By default, Godot uses 16-bit depth textures for shadow map rendering. This is
|
||||||
recommended in most cases as it performs better without a noticeable difference
|
recommended in most cases as it performs better without a noticeable difference
|
||||||
@@ -486,7 +486,7 @@ enabled. However, the difference is often barely visible, yet this can have a
|
|||||||
significant performance cost.
|
significant performance cost.
|
||||||
|
|
||||||
Light/shadow distance fade
|
Light/shadow distance fade
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
OmniLight3D and SpotLight3D offer several properties to hide distant lights.
|
OmniLight3D and SpotLight3D offer several properties to hide distant lights.
|
||||||
This can improve performance significantly in large scenes with dozens of lights
|
This can improve performance significantly in large scenes with dozens of lights
|
||||||
@@ -509,7 +509,7 @@ or more.
|
|||||||
.. _doc_lights_and_shadows_pcss_recommendations:
|
.. _doc_lights_and_shadows_pcss_recommendations:
|
||||||
|
|
||||||
PCSS recommendations
|
PCSS recommendations
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Percentage-closer soft shadows (PCSS) provide a more realistic shadow mapping
|
Percentage-closer soft shadows (PCSS) provide a more realistic shadow mapping
|
||||||
appearance, with the penumbra size varying depending on the distance between the
|
appearance, with the penumbra size varying depending on the distance between the
|
||||||
@@ -529,7 +529,7 @@ To avoid performance issues, it's recommended to:
|
|||||||
``light_size`` property to ``0.0`` in a script.
|
``light_size`` property to ``0.0`` in a script.
|
||||||
|
|
||||||
Projector filter mode
|
Projector filter mode
|
||||||
^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The way projectors are rendered also has an impact on performance. The
|
The way projectors are rendered also has an impact on performance. The
|
||||||
**Rendering > Textures > Light Projectors > Filter** advanced project setting
|
**Rendering > Textures > Light Projectors > Filter** advanced project setting
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ There are two ways to set up occluders in a scene:
|
|||||||
.. _doc_occlusion_culling_baking:
|
.. _doc_occlusion_culling_baking:
|
||||||
|
|
||||||
Automatically baking occluders (recommended)
|
Automatically baking occluders (recommended)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -156,7 +156,7 @@ on the **VisualInstance3D > Layers** property, uncheck layer 1 then check layer
|
|||||||
following the above process.
|
following the above process.
|
||||||
|
|
||||||
Manually placing occluders
|
Manually placing occluders
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
This approach is more suited for specialized use cases, such as creating occlusion
|
This approach is more suited for specialized use cases, such as creating occlusion
|
||||||
for MultiMeshInstance3D setups or CSG nodes (due to the aforementioned limitation).
|
for MultiMeshInstance3D setups or CSG nodes (due to the aforementioned limitation).
|
||||||
@@ -217,7 +217,7 @@ Performance considerations
|
|||||||
--------------------------
|
--------------------------
|
||||||
|
|
||||||
Design your levels to take advantage of occlusion culling
|
Design your levels to take advantage of occlusion culling
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
**This is the most important guideline.** A good level design is not just about
|
**This is the most important guideline.** A good level design is not just about
|
||||||
what the gameplay demands; it should also be built with occlusion in mind.
|
what the gameplay demands; it should also be built with occlusion in mind.
|
||||||
@@ -230,7 +230,7 @@ when possible. This provides the greatest culling opportunities compared to any
|
|||||||
other terrain shape.
|
other terrain shape.
|
||||||
|
|
||||||
Avoid moving OccluderInstance3D nodes during gameplay
|
Avoid moving OccluderInstance3D nodes during gameplay
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
This includes moving the parents of OccluderInstance3D nodes, as this will cause
|
This includes moving the parents of OccluderInstance3D nodes, as this will cause
|
||||||
the nodes themselves to move in global space, therefore requiring the :abbr:`BVH
|
the nodes themselves to move in global space, therefore requiring the :abbr:`BVH
|
||||||
@@ -250,7 +250,7 @@ If you absolutely have to move an OccluderInstance3D node during gameplay, use a
|
|||||||
primitive Occluder3D shape for it instead of a complex baked shape.
|
primitive Occluder3D shape for it instead of a complex baked shape.
|
||||||
|
|
||||||
Use the simplest possible occluder shapes
|
Use the simplest possible occluder shapes
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
If you notice low performance or stuttering in complex 3D scenes, it may mean
|
If you notice low performance or stuttering in complex 3D scenes, it may mean
|
||||||
that the CPU is overloaded as a result of rendering detailed occluders.
|
that the CPU is overloaded as a result of rendering detailed occluders.
|
||||||
@@ -272,7 +272,7 @@ Troubleshooting
|
|||||||
---------------
|
---------------
|
||||||
|
|
||||||
My occludee isn't being culled when it should be
|
My occludee isn't being culled when it should be
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
**On the occluder side:**
|
**On the occluder side:**
|
||||||
|
|
||||||
@@ -302,7 +302,7 @@ the occluder shapes for the occludee to be hidden.
|
|||||||
.. _doc_occlusion_culling_troubleshooting_false_negative:
|
.. _doc_occlusion_culling_troubleshooting_false_negative:
|
||||||
|
|
||||||
My occludee is being culled when it shouldn't be
|
My occludee is being culled when it shouldn't be
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The most likely cause for this is that objects that were included in the
|
The most likely cause for this is that objects that were included in the
|
||||||
occluder bake have been moved after baking occluders. For instance, this can
|
occluder bake have been moved after baking occluders. For instance, this can
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ tradeoffs that aren't worth it for many games. As Godot favors ease of use by
|
|||||||
default, physical light units are disabled by default.
|
default, physical light units are disabled by default.
|
||||||
|
|
||||||
Advantages of physical units
|
Advantages of physical units
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
If you aim for photorealism in your project, using real world units as a basis
|
If you aim for photorealism in your project, using real world units as a basis
|
||||||
can help make things easier to adjust. References for real world materials,
|
can help make things easier to adjust. References for real world materials,
|
||||||
@@ -24,7 +24,7 @@ Using real world units in Godot can also be useful when porting a scene from
|
|||||||
other 3D software that uses physical light units (such as Blender).
|
other 3D software that uses physical light units (such as Blender).
|
||||||
|
|
||||||
Disadvantages of physical units
|
Disadvantages of physical units
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The biggest disadvantage of using physical light units is you will have to pay
|
The biggest disadvantage of using physical light units is you will have to pay
|
||||||
close attention to the dynamic range in use at a given time. You can run into
|
close attention to the dynamic range in use at a given time. You can run into
|
||||||
@@ -68,13 +68,13 @@ this performance impact, depth of field quality can be decreased in the advanced
|
|||||||
Project Settings.
|
Project Settings.
|
||||||
|
|
||||||
Enable the project setting
|
Enable the project setting
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Open the Project Settings, enable the **Advanced** toggle then enable
|
Open the Project Settings, enable the **Advanced** toggle then enable
|
||||||
**Rendering > Lights And Shadows > Use Physical Light Units**. Restart the editor.
|
**Rendering > Lights And Shadows > Use Physical Light Units**. Restart the editor.
|
||||||
|
|
||||||
Configure the camera
|
Configure the camera
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. warning::
|
.. warning::
|
||||||
|
|
||||||
@@ -136,7 +136,7 @@ for a description of CameraAttributesPhysical properties that are also available
|
|||||||
**not** using physical light units.
|
**not** using physical light units.
|
||||||
|
|
||||||
Configure the environment
|
Configure the environment
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. warning::
|
.. warning::
|
||||||
|
|
||||||
@@ -160,7 +160,7 @@ the :ref:`class_Environment` resource:
|
|||||||
is set, this energy is multiplied by the intensity.
|
is set, this energy is multiplied by the intensity.
|
||||||
|
|
||||||
Configure the light nodes
|
Configure the light nodes
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
After enabling physical light units, 2 new properties become available in Light3D nodes:
|
After enabling physical light units, 2 new properties become available in Light3D nodes:
|
||||||
|
|
||||||
|
|||||||
@@ -61,13 +61,13 @@ hidden from the user in the :ref:`RenderingServer <class_RenderingServer>`, but
|
|||||||
manually by passing in an array containing the surface information.
|
manually by passing in an array containing the surface information.
|
||||||
|
|
||||||
Surfaces
|
Surfaces
|
||||||
^^^^^^^^
|
~~~~~~~~
|
||||||
|
|
||||||
Each surface has its own material. Alternatively, you can override the material for all surfaces
|
Each surface has its own material. Alternatively, you can override the material for all surfaces
|
||||||
in the Mesh when you use a MeshInstance3D using the :ref:`material_override <class_GeometryInstance3D_property_material_override>` property.
|
in the Mesh when you use a MeshInstance3D using the :ref:`material_override <class_GeometryInstance3D_property_material_override>` property.
|
||||||
|
|
||||||
Surface array
|
Surface array
|
||||||
^^^^^^^^^^^^^
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
The surface array is an array of length ``ArrayMesh.ARRAY_MAX``. Each position in the array is
|
The surface array is an array of length ``ArrayMesh.ARRAY_MAX``. Each position in the array is
|
||||||
filled with a sub-array containing per-vertex information. For example, the array located at
|
filled with a sub-array containing per-vertex information. For example, the array located at
|
||||||
@@ -89,7 +89,7 @@ Godot provides different ways of accessing and working with geometry. More infor
|
|||||||
be provided in the following tutorials.
|
be provided in the following tutorials.
|
||||||
|
|
||||||
ArrayMesh
|
ArrayMesh
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
The ArrayMesh resource extends Mesh to add a few different quality of life functions and, most
|
The ArrayMesh resource extends Mesh to add a few different quality of life functions and, most
|
||||||
importantly, the ability to construct a Mesh surface through scripting.
|
importantly, the ability to construct a Mesh surface through scripting.
|
||||||
@@ -97,7 +97,7 @@ importantly, the ability to construct a Mesh surface through scripting.
|
|||||||
For more information about the ArrayMesh, please see the :ref:`ArrayMesh tutorial <doc_arraymesh>`.
|
For more information about the ArrayMesh, please see the :ref:`ArrayMesh tutorial <doc_arraymesh>`.
|
||||||
|
|
||||||
MeshDataTool
|
MeshDataTool
|
||||||
^^^^^^^^^^^^
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
The MeshDataTool is a resource that converts Mesh data into arrays of vertices, faces, and edges that can
|
The MeshDataTool is a resource that converts Mesh data into arrays of vertices, faces, and edges that can
|
||||||
be modified at runtime.
|
be modified at runtime.
|
||||||
@@ -105,14 +105,14 @@ be modified at runtime.
|
|||||||
For more information about the MeshDataTool, please see the :ref:`MeshDataTool tutorial <doc_meshdatatool>`.
|
For more information about the MeshDataTool, please see the :ref:`MeshDataTool tutorial <doc_meshdatatool>`.
|
||||||
|
|
||||||
SurfaceTool
|
SurfaceTool
|
||||||
^^^^^^^^^^^
|
~~~~~~~~~~~
|
||||||
|
|
||||||
The SurfaceTool allows the creation of Meshes using an OpenGL 1.x immediate mode style interface.
|
The SurfaceTool allows the creation of Meshes using an OpenGL 1.x immediate mode style interface.
|
||||||
|
|
||||||
For more information about the SurfaceTool, please see the :ref:`SurfaceTool tutorial <doc_surfacetool>`.
|
For more information about the SurfaceTool, please see the :ref:`SurfaceTool tutorial <doc_surfacetool>`.
|
||||||
|
|
||||||
ImmediateMesh
|
ImmediateMesh
|
||||||
^^^^^^^^^^^^^
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
ImmediateMesh is a mesh that uses an immediate mode style interface (like
|
ImmediateMesh is a mesh that uses an immediate mode style interface (like
|
||||||
SurfaceTool) to draw objects. The difference between ImmediateMesh and the
|
SurfaceTool) to draw objects. The difference between ImmediateMesh and the
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ In the advanced Project Settings' **Rendering > Scaling 3D** section, you can
|
|||||||
find several options for 3D resolution scaling:
|
find several options for 3D resolution scaling:
|
||||||
|
|
||||||
Scaling mode
|
Scaling mode
|
||||||
^^^^^^^^^^^^
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
- **Bilinear:** Standard bilinear filtering (default).
|
- **Bilinear:** Standard bilinear filtering (default).
|
||||||
- **FSR 1.0:** `AMD FidelityFX Super Resolution 1.0 <https://gpuopen.com/fidelityfx-superresolution/>`__.
|
- **FSR 1.0:** `AMD FidelityFX Super Resolution 1.0 <https://gpuopen.com/fidelityfx-superresolution/>`__.
|
||||||
@@ -86,7 +86,7 @@ MSAA is enabled. However, FSR2 doesn't benefit much from enabling MSAA since it
|
|||||||
already performs temporal antialiasing.
|
already performs temporal antialiasing.
|
||||||
|
|
||||||
Rendering scale
|
Rendering scale
|
||||||
^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The **Rendering > Scaling 3D > Scale** setting adjusts the resolution scale.
|
The **Rendering > Scaling 3D > Scale** setting adjusts the resolution scale.
|
||||||
``1.0`` represents the full resolution scale, with the 3D rendering resolution
|
``1.0`` represents the full resolution scale, with the 3D rendering resolution
|
||||||
@@ -181,7 +181,7 @@ in each table.
|
|||||||
+--------------------------+-------------------------+-------------------------------+
|
+--------------------------+-------------------------+-------------------------------+
|
||||||
|
|
||||||
FSR Sharpness
|
FSR Sharpness
|
||||||
^^^^^^^^^^^^^
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
When using the FSR1 or FSR2 scaling modes, the sharpness can be controlled using the
|
When using the FSR1 or FSR2 scaling modes, the sharpness can be controlled using the
|
||||||
**Rendering > Scaling 3D > FSR Sharpness** advanced project setting.
|
**Rendering > Scaling 3D > FSR Sharpness** advanced project setting.
|
||||||
@@ -211,7 +211,7 @@ to oversharpening.
|
|||||||
.. _doc_resolution_scaling_mipmap_bias:
|
.. _doc_resolution_scaling_mipmap_bias:
|
||||||
|
|
||||||
Mipmap bias
|
Mipmap bias
|
||||||
^^^^^^^^^^^
|
~~~~~~~~~~~
|
||||||
|
|
||||||
Godot automatically uses a negative texture mipmap bias when the 3D resolution
|
Godot automatically uses a negative texture mipmap bias when the 3D resolution
|
||||||
scale is set below ``1.0``. This allows for better preservation of texture
|
scale is set below ``1.0``. This allows for better preservation of texture
|
||||||
@@ -261,7 +261,7 @@ Troubleshooting
|
|||||||
---------------
|
---------------
|
||||||
|
|
||||||
Performance does not increase much when decreasing resolution scale
|
Performance does not increase much when decreasing resolution scale
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
If performance doesn't increase much when decreasing resolution scale to a value
|
If performance doesn't increase much when decreasing resolution scale to a value
|
||||||
like ``0.5``, it likely means the performance bottleneck is elsewhere in your
|
like ``0.5``, it likely means the performance bottleneck is elsewhere in your
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ Use cases
|
|||||||
---------
|
---------
|
||||||
|
|
||||||
Static decoration
|
Static decoration
|
||||||
^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Sometimes, the fastest way to add texture detail to a scene is to use decals.
|
Sometimes, the fastest way to add texture detail to a scene is to use decals.
|
||||||
This is especially the case for organic detail, such as patches of dirt or sand
|
This is especially the case for organic detail, such as patches of dirt or sand
|
||||||
@@ -58,7 +58,7 @@ footprints or wet puddles.
|
|||||||
Dirt added on top of level geometry using decals
|
Dirt added on top of level geometry using decals
|
||||||
|
|
||||||
Dynamic gameplay elements
|
Dynamic gameplay elements
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Decals can represent temporary or persistent gameplay effects such as bullet
|
Decals can represent temporary or persistent gameplay effects such as bullet
|
||||||
impacts and explosion scorches.
|
impacts and explosion scorches.
|
||||||
@@ -67,7 +67,7 @@ Using an AnimationPlayer node or a script, decals can be made to fade over time
|
|||||||
(and then be removed using ``queue_free()``) to improve performance.
|
(and then be removed using ``queue_free()``) to improve performance.
|
||||||
|
|
||||||
Blob shadows
|
Blob shadows
|
||||||
^^^^^^^^^^^^
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
Blob shadows are frequently used in mobile projects (or to follow a retro art
|
Blob shadows are frequently used in mobile projects (or to follow a retro art
|
||||||
style), as real-time lighting tends to be too expensive on low-end mobile
|
style), as real-time lighting tends to be too expensive on low-end mobile
|
||||||
@@ -96,7 +96,7 @@ Quick start guide
|
|||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
Creating decals in the editor
|
Creating decals in the editor
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
1. Create a Decal node in the 3D editor.
|
1. Create a Decal node in the 3D editor.
|
||||||
2. In the inspector, expand the **Textures** section and load a texture in
|
2. In the inspector, expand the **Textures** section and load a texture in
|
||||||
@@ -121,7 +121,7 @@ Decal node properties
|
|||||||
culling opportunities, therefore improving performance.
|
culling opportunities, therefore improving performance.
|
||||||
|
|
||||||
Textures
|
Textures
|
||||||
^^^^^^^^
|
~~~~~~~~
|
||||||
|
|
||||||
- **Albedo:** The albedo (diffuse/color) map to use for the decal. In
|
- **Albedo:** The albedo (diffuse/color) map to use for the decal. In
|
||||||
most situations, this is the texture you want to set first. If using a normal
|
most situations, this is the texture you want to set first. If using a normal
|
||||||
@@ -141,7 +141,7 @@ Textures
|
|||||||
**Albedo**, this texture will appear to glow in the dark.
|
**Albedo**, this texture will appear to glow in the dark.
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
^^^^^^^^^^
|
~~~~~~~~~~
|
||||||
|
|
||||||
- **Emission Energy:** The brightness of the emission texture.
|
- **Emission Energy:** The brightness of the emission texture.
|
||||||
- **Modulate:** Multiplies the color of the albedo and emission textures. Use
|
- **Modulate:** Multiplies the color of the albedo and emission textures. Use
|
||||||
@@ -160,7 +160,7 @@ Parameters
|
|||||||
added normal angle computations.
|
added normal angle computations.
|
||||||
|
|
||||||
Vertical Fade
|
Vertical Fade
|
||||||
^^^^^^^^^^^^^
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
- **Upper Fade:** The curve over which the decal will fade as the surface gets
|
- **Upper Fade:** The curve over which the decal will fade as the surface gets
|
||||||
further from the center of the :abbr:`AABB (Axis-Aligned Bounding Box)`
|
further from the center of the :abbr:`AABB (Axis-Aligned Bounding Box)`
|
||||||
@@ -170,7 +170,7 @@ Vertical Fade
|
|||||||
from the decal's projection angle). Only positive values are valid.
|
from the decal's projection angle). Only positive values are valid.
|
||||||
|
|
||||||
Distance Fade
|
Distance Fade
|
||||||
^^^^^^^^^^^^^
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
- **Enabled:** Controls whether distance fade (a form of :abbr:`LOD (Level of Detail)`)
|
- **Enabled:** Controls whether distance fade (a form of :abbr:`LOD (Level of Detail)`)
|
||||||
is enabled. The decal will fade out over **Begin + Length**, after which it
|
is enabled. The decal will fade out over **Begin + Length**, after which it
|
||||||
@@ -184,7 +184,7 @@ Distance Fade
|
|||||||
more suited when the camera moves fast.
|
more suited when the camera moves fast.
|
||||||
|
|
||||||
Cull Mask
|
Cull Mask
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
- **Cull Mask:** Specifies which VisualInstance3D layers this decal will project
|
- **Cull Mask:** Specifies which VisualInstance3D layers this decal will project
|
||||||
on. By default, decals affect all layers. This is used so you can specify which
|
on. By default, decals affect all layers. This is used so you can specify which
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
.. _doc_using_multi_mesh_instance:
|
.. _doc_using_multi_mesh_instance:
|
||||||
|
|
||||||
Using MultiMeshInstance3D
|
Using MultiMeshInstance3D
|
||||||
-------------------------
|
=========================
|
||||||
|
|
||||||
Introduction
|
Introduction
|
||||||
~~~~~~~~~~~~
|
------------
|
||||||
|
|
||||||
In a normal scenario, you would use a :ref:`MeshInstance3D <class_MeshInstance3D>`
|
In a normal scenario, you would use a :ref:`MeshInstance3D <class_MeshInstance3D>`
|
||||||
node to display a 3D mesh like a human model for the main character, but in some
|
node to display a 3D mesh like a human model for the main character, but in some
|
||||||
@@ -22,7 +22,7 @@ MeshInstance over a surface of a specific mesh. An example would be having a
|
|||||||
tree mesh populate a landscape mesh with trees of random scales and orientations.
|
tree mesh populate a landscape mesh with trees of random scales and orientations.
|
||||||
|
|
||||||
Setting up the nodes
|
Setting up the nodes
|
||||||
~~~~~~~~~~~~~~~~~~~~
|
--------------------
|
||||||
|
|
||||||
The basic setup requires three nodes: the MultiMeshInstance3D node
|
The basic setup requires three nodes: the MultiMeshInstance3D node
|
||||||
and two MeshInstance3D nodes.
|
and two MeshInstance3D nodes.
|
||||||
@@ -50,48 +50,48 @@ Click it and select *Populate surface* in the dropdown menu. A new window titled
|
|||||||
.. image:: img/multimesh_settings.png
|
.. image:: img/multimesh_settings.png
|
||||||
|
|
||||||
MultiMesh settings
|
MultiMesh settings
|
||||||
~~~~~~~~~~~~~~~~~~
|
------------------
|
||||||
|
|
||||||
Below are descriptions of the options.
|
Below are descriptions of the options.
|
||||||
|
|
||||||
Target Surface
|
Target Surface
|
||||||
++++++++++++++
|
~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The mesh used as the target surface on which to place copies of your
|
The mesh used as the target surface on which to place copies of your
|
||||||
source mesh.
|
source mesh.
|
||||||
|
|
||||||
Source Mesh
|
Source Mesh
|
||||||
+++++++++++
|
~~~~~~~~~~~
|
||||||
|
|
||||||
The mesh you want duplicated on the target surface.
|
The mesh you want duplicated on the target surface.
|
||||||
|
|
||||||
Mesh Up Axis
|
Mesh Up Axis
|
||||||
++++++++++++
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
The axis used as the up axis of the source mesh.
|
The axis used as the up axis of the source mesh.
|
||||||
|
|
||||||
Random Rotation
|
Random Rotation
|
||||||
+++++++++++++++
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Randomizing the rotation around the up axis of the source mesh.
|
Randomizing the rotation around the up axis of the source mesh.
|
||||||
|
|
||||||
Random Tilt
|
Random Tilt
|
||||||
+++++++++++
|
~~~~~~~~~~~
|
||||||
|
|
||||||
Randomizing the overall rotation of the source mesh.
|
Randomizing the overall rotation of the source mesh.
|
||||||
|
|
||||||
Random Scale
|
Random Scale
|
||||||
++++++++++++
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
Randomizing the scale of the source mesh.
|
Randomizing the scale of the source mesh.
|
||||||
|
|
||||||
Scale
|
Scale
|
||||||
+++++
|
~~~~~
|
||||||
|
|
||||||
The scale of the source mesh that will be placed over the target surface.
|
The scale of the source mesh that will be placed over the target surface.
|
||||||
|
|
||||||
Amount
|
Amount
|
||||||
++++++
|
~~~~~~
|
||||||
|
|
||||||
The amount of mesh instances placed over the target surface.
|
The amount of mesh instances placed over the target surface.
|
||||||
|
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ For custom viewports, the VRS mode and texture must be set manually to the
|
|||||||
:ref:`command line argument <doc_command_line_tutorial>`.
|
:ref:`command line argument <doc_command_line_tutorial>`.
|
||||||
|
|
||||||
Creating a VRS density map
|
Creating a VRS density map
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
If using the **Texture** VRS mode, you *must* set a texture to be used as a
|
If using the **Texture** VRS mode, you *must* set a texture to be used as a
|
||||||
density map. Otherwise, no effect will be visible.
|
density map. Otherwise, no effect will be visible.
|
||||||
@@ -187,7 +187,7 @@ aspect ratio in your project (such as 16:9).
|
|||||||
low, or textures will appear grainy.
|
low, or textures will appear grainy.
|
||||||
|
|
||||||
Performance comparison
|
Performance comparison
|
||||||
^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
To give an idea of how much VRS can improve performance in theory, here's a
|
To give an idea of how much VRS can improve performance in theory, here's a
|
||||||
performance comparison with the textured example scene shown at the top of this
|
performance comparison with the textured example scene shown at the top of this
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ the following properties in the GeometryInstance3D's **Visibility Range** sectio
|
|||||||
.. _doc_visibility_ranges_fade_mode:
|
.. _doc_visibility_ranges_fade_mode:
|
||||||
|
|
||||||
Fade mode
|
Fade mode
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -132,7 +132,7 @@ choose from:
|
|||||||
.. _doc_visibility_ranges_visibility_parent:
|
.. _doc_visibility_ranges_visibility_parent:
|
||||||
|
|
||||||
Visibility parent
|
Visibility parent
|
||||||
^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The **Visibility Parent** property makes it easier to set up
|
The **Visibility Parent** property makes it easier to set up
|
||||||
:abbr:`HLOD (Hierarchical Level of Detail)`. It allows automatically hiding
|
:abbr:`HLOD (Hierarchical Level of Detail)`. It allows automatically hiding
|
||||||
@@ -194,7 +194,7 @@ Configuration tips
|
|||||||
------------------
|
------------------
|
||||||
|
|
||||||
Use simpler materials at a distance to improve performance
|
Use simpler materials at a distance to improve performance
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
One way to further improve performance is to use simpler materials for distant
|
One way to further improve performance is to use simpler materials for distant
|
||||||
LOD meshes. While using LOD meshes will reduce the number of vertices that need
|
LOD meshes. While using LOD meshes will reduce the number of vertices that need
|
||||||
@@ -223,7 +223,7 @@ expensive material features such as:
|
|||||||
- Proximity Fade
|
- Proximity Fade
|
||||||
|
|
||||||
Use dithering for LOD transitions
|
Use dithering for LOD transitions
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Godot currently only supports alpha-based fading for visibility ranges. You can
|
Godot currently only supports alpha-based fading for visibility ranges. You can
|
||||||
however use dithering instead by using several different materials for different
|
however use dithering instead by using several different materials for different
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ the following properties in FogMaterial:
|
|||||||
:ref:`changing its import type in the Import dock <doc_importing_images_changing_import_type>`.
|
:ref:`changing its import type in the Import dock <doc_importing_images_changing_import_type>`.
|
||||||
|
|
||||||
Using 3D noise density textures
|
Using 3D noise density textures
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Since Godot 4.1, there is a NoiseTexture3D resource that can be used to
|
Since Godot 4.1, there is a NoiseTexture3D resource that can be used to
|
||||||
procedurally generate 3D noise. This is well-suited to FogMaterial density
|
procedurally generate 3D noise. This is well-suited to FogMaterial density
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ This will simply play back the animation. Make sure that the ``AnimationTree`` i
|
|||||||
Following is a short description of available nodes:
|
Following is a short description of available nodes:
|
||||||
|
|
||||||
Blend2 / Blend3
|
Blend2 / Blend3
|
||||||
^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
These nodes will blend between two or three inputs by a user-specified blend value:
|
These nodes will blend between two or three inputs by a user-specified blend value:
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ This is very useful for layering animations on top of each other.
|
|||||||
.. image:: img/animtree6.png
|
.. image:: img/animtree6.png
|
||||||
|
|
||||||
OneShot
|
OneShot
|
||||||
^^^^^^^
|
~~~~~~~
|
||||||
|
|
||||||
This node will execute a sub-animation and return once it finishes. Blend times for fading in and out can be customized, as well as filters.
|
This node will execute a sub-animation and return once it finishes. Blend times for fading in and out can be customized, as well as filters.
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ After setting the request and changing the animation playback, the one-shot node
|
|||||||
animationTree.Get("parameters/OneShot/active");
|
animationTree.Get("parameters/OneShot/active");
|
||||||
|
|
||||||
TimeSeek
|
TimeSeek
|
||||||
^^^^^^^^
|
~~~~~~~~
|
||||||
|
|
||||||
This node can be used to cause a seek command to happen to any sub-children of the animation graph. Use this node type to play an ``Animation`` from the start or a certain playback position inside the ``AnimationNodeBlendTree``.
|
This node can be used to cause a seek command to happen to any sub-children of the animation graph. Use this node type to play an ``Animation`` from the start or a certain playback position inside the ``AnimationNodeBlendTree``.
|
||||||
|
|
||||||
@@ -150,12 +150,12 @@ After setting the time and changing the animation playback, the seek node automa
|
|||||||
animationTree.Set("parameters/TimeSeek/seek_request", 12.0);
|
animationTree.Set("parameters/TimeSeek/seek_request", 12.0);
|
||||||
|
|
||||||
TimeScale
|
TimeScale
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
Allows scaling the speed of the animation (or reverse it) connected to the `in` input via the `scale` parameter. Setting the `scale` to 0 will pause the animation.
|
Allows scaling the speed of the animation (or reverse it) connected to the `in` input via the `scale` parameter. Setting the `scale` to 0 will pause the animation.
|
||||||
|
|
||||||
Transition
|
Transition
|
||||||
^^^^^^^^^^
|
~~~~~~~~~~
|
||||||
|
|
||||||
Very simple state machine (when you don't want to cope with a ``StateMachine`` node). Animations can be connected to the outputs and transition times can be specified.
|
Very simple state machine (when you don't want to cope with a ``StateMachine`` node). Animations can be connected to the outputs and transition times can be specified.
|
||||||
After setting the request and changing the animation playback, the transition node automatically clears the request on the next process frame by setting its ``transition_request`` value to an empty string (``""``).
|
After setting the request and changing the animation playback, the transition node automatically clears the request on the next process frame by setting its ``transition_request`` value to an empty string (``""``).
|
||||||
@@ -190,7 +190,7 @@ After setting the request and changing the animation playback, the transition no
|
|||||||
animationTree.Get("parameters/Transition/current_index");
|
animationTree.Get("parameters/Transition/current_index");
|
||||||
|
|
||||||
BlendSpace2D
|
BlendSpace2D
|
||||||
^^^^^^^^^^^^
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
``BlendSpace2D`` is a node to do advanced blending in two dimensions. Points are added to a two-dimensional space and then a position
|
``BlendSpace2D`` is a node to do advanced blending in two dimensions. Points are added to a two-dimensional space and then a position
|
||||||
can be controlled to determine blending:
|
can be controlled to determine blending:
|
||||||
@@ -214,12 +214,12 @@ This mode can be changed in the *Blend* menu:
|
|||||||
.. image:: img/animtree10.png
|
.. image:: img/animtree10.png
|
||||||
|
|
||||||
BlendSpace1D
|
BlendSpace1D
|
||||||
^^^^^^^^^^^^
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
This is similar to 2D blend spaces, but in one dimension (so triangles are not needed).
|
This is similar to 2D blend spaces, but in one dimension (so triangles are not needed).
|
||||||
|
|
||||||
StateMachine
|
StateMachine
|
||||||
^^^^^^^^^^^^
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
This node acts as a state machine with root nodes as states. Root nodes can be created and connected via lines. States are connected via *Transitions*,
|
This node acts as a state machine with root nodes as states. Root nodes can be created and connected via lines. States are connected via *Transitions*,
|
||||||
which are connections with special properties. Transitions are uni-directional, but two can be used to connect in both directions.
|
which are connections with special properties. Transitions are uni-directional, but two can be used to connect in both directions.
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ Once you've configured and enabled Movie Maker mode, it will be automatically us
|
|||||||
when running the project from the editor.
|
when running the project from the editor.
|
||||||
|
|
||||||
Command line usage
|
Command line usage
|
||||||
^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Movie Maker can also be enabled from the :ref:`command line <doc_command_line_tutorial>`:
|
Movie Maker can also be enabled from the :ref:`command line <doc_command_line_tutorial>`:
|
||||||
|
|
||||||
@@ -157,7 +157,7 @@ Godot has 2 built-in :ref:`MovieWriters <class_MovieWriter>`, and more can be
|
|||||||
implemented by extensions:
|
implemented by extensions:
|
||||||
|
|
||||||
AVI (recommended)
|
AVI (recommended)
|
||||||
^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
AVI container with MJPEG for video and uncompressed audio. Features lossy video
|
AVI container with MJPEG for video and uncompressed audio. Features lossy video
|
||||||
compression, resulting in medium file sizes and fast encoding. The lossy
|
compression, resulting in medium file sizes and fast encoding. The lossy
|
||||||
@@ -173,7 +173,7 @@ To use AVI, specify a path to an ``.avi`` file to be created in the
|
|||||||
**Editor > Movie Writer > Movie File** project setting.
|
**Editor > Movie Writer > Movie File** project setting.
|
||||||
|
|
||||||
PNG
|
PNG
|
||||||
^^^
|
~~~
|
||||||
|
|
||||||
PNG image sequence for video and WAV for audio. Features lossless video
|
PNG image sequence for video and WAV for audio. Features lossless video
|
||||||
compression, at the cost of large file sizes and slow encoding. This is designed
|
compression, at the cost of large file sizes and slow encoding. This is designed
|
||||||
@@ -193,7 +193,7 @@ To use PNG, specify a ``.png`` file to be created in the
|
|||||||
file will have the same name as the ``.png`` file (minus the extension).
|
file will have the same name as the ``.png`` file (minus the extension).
|
||||||
|
|
||||||
Custom
|
Custom
|
||||||
^^^^^^
|
~~~~~~
|
||||||
|
|
||||||
If you need to encode directly to a different format or pipe a stream through
|
If you need to encode directly to a different format or pipe a stream through
|
||||||
third-party software, you can extend the MovieWriter class to create your own
|
third-party software, you can extend the MovieWriter class to create your own
|
||||||
@@ -371,7 +371,7 @@ Some common post-processing steps are listed below.
|
|||||||
.. _doc_creating_movies_converting_avi:
|
.. _doc_creating_movies_converting_avi:
|
||||||
|
|
||||||
Converting AVI video to MP4
|
Converting AVI video to MP4
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
While some platforms such as YouTube support uploading the AVI file directly, many
|
While some platforms such as YouTube support uploading the AVI file directly, many
|
||||||
others will require a conversion step beforehand. `HandBrake <https://handbrake.fr/>`__
|
others will require a conversion step beforehand. `HandBrake <https://handbrake.fr/>`__
|
||||||
@@ -398,7 +398,7 @@ cost of a worse size/quality ratio.
|
|||||||
.. _doc_creating_movies_converting_image_sequence:
|
.. _doc_creating_movies_converting_image_sequence:
|
||||||
|
|
||||||
Converting PNG image sequence + WAV audio to a video
|
Converting PNG image sequence + WAV audio to a video
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
If you chose to record a PNG image sequence with a WAV file beside it,
|
If you chose to record a PNG image sequence with a WAV file beside it,
|
||||||
you need to convert it to a video before you can use it elsewhere.
|
you need to convert it to a video before you can use it elsewhere.
|
||||||
@@ -428,7 +428,7 @@ storing transparency, so you can use WebM/VP9 as an alternative:
|
|||||||
.. _doc_creating_movies_motion_blur:
|
.. _doc_creating_movies_motion_blur:
|
||||||
|
|
||||||
Cutting video
|
Cutting video
|
||||||
^^^^^^^^^^^^^
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
You can trim parts of the video you don't want to keep after the video is
|
You can trim parts of the video you don't want to keep after the video is
|
||||||
recorded. For example, to discard everything before 12.1 seconds and keep
|
recorded. For example, to discard everything before 12.1 seconds and keep
|
||||||
@@ -442,7 +442,7 @@ Cutting videos can also be done with the GUI tool
|
|||||||
`LosslessCut <https://mifi.github.io/lossless-cut/>`__.
|
`LosslessCut <https://mifi.github.io/lossless-cut/>`__.
|
||||||
|
|
||||||
Resizing video
|
Resizing video
|
||||||
^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The following command resizes a video to be 1080 pixels tall (1080p),
|
The following command resizes a video to be 1080 pixels tall (1080p),
|
||||||
while preserving its existing aspect ratio:
|
while preserving its existing aspect ratio:
|
||||||
@@ -455,7 +455,7 @@ while preserving its existing aspect ratio:
|
|||||||
.. _doc_creating_movies_reducing_framerate:
|
.. _doc_creating_movies_reducing_framerate:
|
||||||
|
|
||||||
Reducing framerate
|
Reducing framerate
|
||||||
^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The following command changes a video's framerate to 30 FPS, dropping some of
|
The following command changes a video's framerate to 30 FPS, dropping some of
|
||||||
the original frames if there are more in the input video:
|
the original frames if there are more in the input video:
|
||||||
@@ -465,7 +465,7 @@ the original frames if there are more in the input video:
|
|||||||
ffmpeg -i input.avi -r 30 -crf 15 output.mp4
|
ffmpeg -i input.avi -r 30 -crf 15 output.mp4
|
||||||
|
|
||||||
Generating accumulation motion blur with FFmpeg
|
Generating accumulation motion blur with FFmpeg
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Godot does not have built-in support for motion blur, but it can still be
|
Godot does not have built-in support for motion blur, but it can still be
|
||||||
created in recorded videos.
|
created in recorded videos.
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ Setting up VideoStreamPlayer
|
|||||||
desired.
|
desired.
|
||||||
|
|
||||||
Handling resizing and different aspect ratios
|
Handling resizing and different aspect ratios
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
By default in Godot 4.0, the VideoStreamPlayer will automatically be resized to match
|
By default in Godot 4.0, the VideoStreamPlayer will automatically be resized to match
|
||||||
the video's resolution. You can make it follow usual :ref:`class_Control` sizing
|
the video's resolution. You can make it follow usual :ref:`class_Control` sizing
|
||||||
@@ -85,7 +85,7 @@ to fit the whole screen while avoiding distortion.
|
|||||||
aspect ratios in your project.
|
aspect ratios in your project.
|
||||||
|
|
||||||
Displaying a video on a 3D surface
|
Displaying a video on a 3D surface
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Using a VideoStreamPlayer node as a child of a :ref:`class_SubViewport` node,
|
Using a VideoStreamPlayer node as a child of a :ref:`class_SubViewport` node,
|
||||||
it's possible to display any 2D node on a 3D surface. For example, this can be
|
it's possible to display any 2D node on a 3D surface. For example, this can be
|
||||||
@@ -117,7 +117,7 @@ See :ref:`doc_viewports` and the
|
|||||||
for more information on setting this up.
|
for more information on setting this up.
|
||||||
|
|
||||||
Looping a video
|
Looping a video
|
||||||
^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
For looping a video, the **Loop** property can be enabled. This will seamlessly
|
For looping a video, the **Loop** property can be enabled. This will seamlessly
|
||||||
restart the video when it reaches its end.
|
restart the video when it reaches its end.
|
||||||
@@ -196,7 +196,7 @@ below with almost any input video format (AVI, MOV, WebM, …).
|
|||||||
at the ``configuration:`` line in the command output.
|
at the ``configuration:`` line in the command output.
|
||||||
|
|
||||||
Balancing quality and file size
|
Balancing quality and file size
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The **video quality** level (``-q:v``) must be between ``1`` and ``10``. Quality
|
The **video quality** level (``-q:v``) must be between ``1`` and ``10``. Quality
|
||||||
``6`` is a good compromise between quality and file size. If encoding at a high
|
``6`` is a good compromise between quality and file size. If encoding at a high
|
||||||
@@ -218,7 +218,7 @@ for a table listing Ogg Vorbis audio quality presets and their respective
|
|||||||
variable bitrates.
|
variable bitrates.
|
||||||
|
|
||||||
FFmpeg: Convert while preserving original video resolution
|
FFmpeg: Convert while preserving original video resolution
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The following command converts the video while keeping its original resolution.
|
The following command converts the video while keeping its original resolution.
|
||||||
The video and audio's bitrate will be variable to maximize quality while saving
|
The video and audio's bitrate will be variable to maximize quality while saving
|
||||||
@@ -230,7 +230,7 @@ static scenes).
|
|||||||
ffmpeg -i input.mp4 -q:v 6 -q:a 6 output.ogv
|
ffmpeg -i input.mp4 -q:v 6 -q:a 6 output.ogv
|
||||||
|
|
||||||
FFmpeg: Resize the video then convert it
|
FFmpeg: Resize the video then convert it
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The following command resizes a video to be 720 pixels tall (720p), while
|
The following command resizes a video to be 720 pixels tall (720p), while
|
||||||
preserving its existing aspect ratio. This helps decrease the file size
|
preserving its existing aspect ratio. This helps decrease the file size
|
||||||
@@ -253,14 +253,14 @@ Chroma key, commonly known as the "green screen" or "blue screen" effect, allows
|
|||||||
We will achieve the chroma key effect by writing a custom shader in GDScript and using a `VideoStreamPlayer` node to display the video content.
|
We will achieve the chroma key effect by writing a custom shader in GDScript and using a `VideoStreamPlayer` node to display the video content.
|
||||||
|
|
||||||
Scene Setup
|
Scene Setup
|
||||||
^^^^^^^^^^^
|
~~~~~~~~~~~
|
||||||
|
|
||||||
Ensure that the scene contains a `VideoStreamPlayer` node to play the video and a `Control` node to hold the UI elements for controlling the chroma key effect.
|
Ensure that the scene contains a `VideoStreamPlayer` node to play the video and a `Control` node to hold the UI elements for controlling the chroma key effect.
|
||||||
|
|
||||||
.. image:: img/chroma_key_scene.webp
|
.. image:: img/chroma_key_scene.webp
|
||||||
|
|
||||||
Writing the Custom Shader
|
Writing the Custom Shader
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
To implement the chroma key effect, follow these steps:
|
To implement the chroma key effect, follow these steps:
|
||||||
|
|
||||||
@@ -307,7 +307,7 @@ The code above represents a simple demonstration of the Chroma Key shader,
|
|||||||
and users can customize it according to their specific requirements.
|
and users can customize it according to their specific requirements.
|
||||||
|
|
||||||
UI Controls
|
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:
|
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:
|
||||||
|
|
||||||
@@ -375,7 +375,7 @@ also make sure that the range of the sliders are appropriate, our settings are :
|
|||||||
.. image:: img/slider_range.webp
|
.. image:: img/slider_range.webp
|
||||||
|
|
||||||
Signal Handling
|
Signal Handling
|
||||||
^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Connect the appropriate signal from the UI elements to the `Control` node's script.
|
Connect the appropriate signal from the UI elements to the `Control` node's script.
|
||||||
you created in the `Control` node's script to control the chroma key effect.
|
you created in the `Control` node's script to control the chroma key effect.
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ you'll need to use the Advanced Import Settings dialog, import hints, or possibl
|
|||||||
.. _doc_importing_3d_scenes_using_the_import_dock:
|
.. _doc_importing_3d_scenes_using_the_import_dock:
|
||||||
|
|
||||||
Using the Import dock
|
Using the Import dock
|
||||||
^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The following options can be adjusted in the Import dock after selecting a 3D
|
The following options can be adjusted in the Import dock after selecting a 3D
|
||||||
scene in the FileSystem dock:
|
scene in the FileSystem dock:
|
||||||
@@ -173,7 +173,7 @@ exported from other tools such as Maya.
|
|||||||
imported scene, with and without VRAM compression respectively.
|
imported scene, with and without VRAM compression respectively.
|
||||||
|
|
||||||
Using the Advanced Import Settings dialog
|
Using the Advanced Import Settings dialog
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The first tab you'll see is the **Scene** tab. The options available in the
|
The first tab you'll see is the **Scene** tab. The options available in the
|
||||||
panel on the right are identical to the Import dock, but you have access to a 3D
|
panel on the right are identical to the Import dock, but you have access to a 3D
|
||||||
@@ -316,7 +316,7 @@ use an external material instead of the material that is included in the
|
|||||||
original 3D scene file; see the section below.
|
original 3D scene file; see the section below.
|
||||||
|
|
||||||
Extracting materials to separate files
|
Extracting materials to separate files
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
While Godot can import materials authored in 3D modeling software, the default
|
While Godot can import materials authored in 3D modeling software, the default
|
||||||
configuration may not be suitable for your needs. For example:
|
configuration may not be suitable for your needs. For example:
|
||||||
@@ -374,7 +374,7 @@ material, enabling **Save to File**, then specifying the save path using the
|
|||||||
.. _doc_importing_3d_scenes_import_script:
|
.. _doc_importing_3d_scenes_import_script:
|
||||||
|
|
||||||
Using import scripts for automation
|
Using import scripts for automation
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
A special script to process the whole scene after import can be provided.
|
A special script to process the whole scene after import can be provided.
|
||||||
This is great for post-processing, changing materials, doing funny stuff with
|
This is great for post-processing, changing materials, doing funny stuff with
|
||||||
@@ -413,7 +413,7 @@ finally be used **must** be returned (even if the scene can be entirely differen
|
|||||||
To use your script, locate the script in the import tab's "Path" option under the "Import Script" category.
|
To use your script, locate the script in the import tab's "Path" option under the "Import Script" category.
|
||||||
|
|
||||||
Using animation libraries
|
Using animation libraries
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
As of Godot 4.0, you can choose to import **only** animations from a glTF file and
|
As of Godot 4.0, you can choose to import **only** animations from a glTF file and
|
||||||
nothing else. This is used in some asset pipelines to distribute animations
|
nothing else. This is used in some asset pipelines to distribute animations
|
||||||
@@ -440,7 +440,7 @@ Library act the same as when using the Scene import mode. See
|
|||||||
:ref:`doc_importing_3d_scenes_using_the_import_dock` for more information.
|
:ref:`doc_importing_3d_scenes_using_the_import_dock` for more information.
|
||||||
|
|
||||||
Filter script
|
Filter script
|
||||||
^^^^^^^^^^^^^
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
It is possible to specify a filter script in a special syntax to decide which
|
It is possible to specify a filter script in a special syntax to decide which
|
||||||
tracks from which animations should be kept.
|
tracks from which animations should be kept.
|
||||||
@@ -492,21 +492,21 @@ would be retained.
|
|||||||
Any track filter lines that do not begin with a ``+`` or ``-`` are ignored.
|
Any track filter lines that do not begin with a ``+`` or ``-`` are ignored.
|
||||||
|
|
||||||
Storage
|
Storage
|
||||||
^^^^^^^
|
~~~~~~~
|
||||||
|
|
||||||
By default, animations are saved as built-in. It is possible to save them to a
|
By default, animations are saved as built-in. It is possible to save them to a
|
||||||
file instead. This allows adding custom tracks to the animations and keeping
|
file instead. This allows adding custom tracks to the animations and keeping
|
||||||
them after a reimport.
|
them after a reimport.
|
||||||
|
|
||||||
Optimizer
|
Optimizer
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
When animations are imported, an optimizer is run, which reduces the size of the
|
When animations are imported, an optimizer is run, which reduces the size of the
|
||||||
animation considerably. In general, this should always be turned on unless you
|
animation considerably. In general, this should always be turned on unless you
|
||||||
suspect that an animation might be broken due to it being enabled.
|
suspect that an animation might be broken due to it being enabled.
|
||||||
|
|
||||||
Clips
|
Clips
|
||||||
^^^^^
|
~~~~~
|
||||||
|
|
||||||
It is possible to specify multiple animations from a single timeline as clips.
|
It is possible to specify multiple animations from a single timeline as clips.
|
||||||
For this to work, the model must have only one animation that is named
|
For this to work, the model must have only one animation that is named
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ will detect suffixes in object names and will perform actions automatically.
|
|||||||
**case-insensitive**.
|
**case-insensitive**.
|
||||||
|
|
||||||
Remove nodes (-noimp)
|
Remove nodes (-noimp)
|
||||||
^^^^^^^^^^^^^^^^^^^^^
|
---------------------
|
||||||
|
|
||||||
Objects that have the ``-noimp`` suffix will be removed at import-time no matter
|
Objects that have the ``-noimp`` suffix will be removed at import-time no matter
|
||||||
what their type is. They will not appear in the imported scene.
|
what their type is. They will not appear in the imported scene.
|
||||||
@@ -30,7 +30,7 @@ This is equivalent to enabling **Skip Import** for a node in the Advanced Import
|
|||||||
Settings dialog.
|
Settings dialog.
|
||||||
|
|
||||||
Create collisions (-col, -convcol, -colonly, -convcolonly)
|
Create collisions (-col, -convcol, -colonly, -convcolonly)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
----------------------------------------------------------
|
||||||
|
|
||||||
The option ``-col`` will work only for Mesh objects. If it is detected, a child
|
The option ``-col`` will work only for Mesh objects. If it is detected, a child
|
||||||
static collision node will be added, using the same geometry as the mesh. This
|
static collision node will be added, using the same geometry as the mesh. This
|
||||||
@@ -93,7 +93,7 @@ reliability.
|
|||||||
shapes.
|
shapes.
|
||||||
|
|
||||||
Create Occluder (-occ, -occonly)
|
Create Occluder (-occ, -occonly)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
--------------------------------
|
||||||
|
|
||||||
If a mesh is imported with the ``-occ`` suffix an :ref:`class_occluder3D` node
|
If a mesh is imported with the ``-occ`` suffix an :ref:`class_occluder3D` node
|
||||||
will be created based on the geometry of the mesh, it does not replace the mesh.
|
will be created based on the geometry of the mesh, it does not replace the mesh.
|
||||||
@@ -101,30 +101,30 @@ A mesh node with the ``-occonly`` suffix will be converted to an
|
|||||||
:ref:`class_occluder3D` on import.
|
:ref:`class_occluder3D` on import.
|
||||||
|
|
||||||
Create navigation (-navmesh)
|
Create navigation (-navmesh)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
----------------------------
|
||||||
|
|
||||||
A mesh node with the ``-navmesh`` suffix will be converted to a navigation mesh.
|
A mesh node with the ``-navmesh`` suffix will be converted to a navigation mesh.
|
||||||
The original Mesh object will be removed at import-time.
|
The original Mesh object will be removed at import-time.
|
||||||
|
|
||||||
Create a VehicleBody (-vehicle)
|
Create a VehicleBody (-vehicle)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
-------------------------------
|
||||||
|
|
||||||
A mesh node with the ``-vehicle`` suffix will be imported as a child to a
|
A mesh node with the ``-vehicle`` suffix will be imported as a child to a
|
||||||
:ref:`class_VehicleBody3D` node.
|
:ref:`class_VehicleBody3D` node.
|
||||||
|
|
||||||
Create a VehicleWheel (-wheel)
|
Create a VehicleWheel (-wheel)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
------------------------------
|
||||||
|
|
||||||
A mesh node with the ``-wheel`` suffix will be imported as a child to a
|
A mesh node with the ``-wheel`` suffix will be imported as a child to a
|
||||||
:ref:`class_VehicleWheel3D` node.
|
:ref:`class_VehicleWheel3D` node.
|
||||||
|
|
||||||
Rigid Body (-rigid)
|
Rigid Body (-rigid)
|
||||||
^^^^^^^^^^^^^^^^^^^
|
-------------------
|
||||||
|
|
||||||
A mesh node with the ``-rigid`` suffix will be imported as a :ref:`class_RigidBody3D`.
|
A mesh node with the ``-rigid`` suffix will be imported as a :ref:`class_RigidBody3D`.
|
||||||
|
|
||||||
Animation loop (-loop, -cycle)
|
Animation loop (-loop, -cycle)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
------------------------------
|
||||||
|
|
||||||
Animation clips in the source 3D file that start or end with the token ``loop`` or ``cycle``
|
Animation clips in the source 3D file that start or end with the token ``loop`` or ``cycle``
|
||||||
will be imported as a Godot :ref:`class_Animation` with the loop flag set.
|
will be imported as a Godot :ref:`class_Animation` with the loop flag set.
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ Import options (Ogg Vorbis and MP3)
|
|||||||
-----------------------------------
|
-----------------------------------
|
||||||
|
|
||||||
Loop
|
Loop
|
||||||
^^^^
|
~~~~
|
||||||
|
|
||||||
If enabled, the audio will begin playing at the beginning after playback ends by
|
If enabled, the audio will begin playing at the beginning after playback ends by
|
||||||
reaching the end of the audio.
|
reaching the end of the audio.
|
||||||
@@ -193,7 +193,7 @@ reaching the end of the audio.
|
|||||||
playing indefinitely.
|
playing indefinitely.
|
||||||
|
|
||||||
Loop Offset
|
Loop Offset
|
||||||
^^^^^^^^^^^
|
~~~~~~~~~~~
|
||||||
|
|
||||||
The loop offset determines where audio will start to loop after playback reaches
|
The loop offset determines where audio will start to loop after playback reaches
|
||||||
the end of the audio. This can be used to only loop a part of the audio file,
|
the end of the audio. This can be used to only loop a part of the audio file,
|
||||||
@@ -208,7 +208,7 @@ A more convenient editor for **Loop Offset** is provided in the
|
|||||||
dialog, as it lets you preview your changes without having to reimport the audio.
|
dialog, as it lets you preview your changes without having to reimport the audio.
|
||||||
|
|
||||||
BPM
|
BPM
|
||||||
^^^
|
~~~
|
||||||
|
|
||||||
The Beats Per Minute of the audio track. This should match the BPM measure that
|
The Beats Per Minute of the audio track. This should match the BPM measure that
|
||||||
was used to compose the track. This is only relevant for music that wishes to
|
was used to compose the track. This is only relevant for music that wishes to
|
||||||
@@ -220,7 +220,7 @@ A more convenient editor for **BPM** is provided in the
|
|||||||
dialog, as it lets you preview your changes without having to reimport the audio.
|
dialog, as it lets you preview your changes without having to reimport the audio.
|
||||||
|
|
||||||
Beat Count
|
Beat Count
|
||||||
^^^^^^^^^^
|
~~~~~~~~~~
|
||||||
|
|
||||||
The beat count of the audio track. This is only relevant for music that wishes
|
The beat count of the audio track. This is only relevant for music that wishes
|
||||||
to make use of interactive music functionality, not sound
|
to make use of interactive music functionality, not sound
|
||||||
@@ -231,7 +231,7 @@ A more convenient editor for **Beat Count** is provided in the
|
|||||||
dialog, as it lets you preview your changes without having to reimport the audio.
|
dialog, as it lets you preview your changes without having to reimport the audio.
|
||||||
|
|
||||||
Bar Beats
|
Bar Beats
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
The number of bars within a single beat in the audio track. This is only
|
The number of bars within a single beat in the audio track. This is only
|
||||||
relevant for music that wishes to make use of interactive music functionality
|
relevant for music that wishes to make use of interactive music functionality
|
||||||
@@ -273,7 +273,7 @@ Best practices
|
|||||||
--------------
|
--------------
|
||||||
|
|
||||||
Use appropriate quality settings
|
Use appropriate quality settings
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
While keeping pristine-quality audio sources is important if you're performing
|
While keeping pristine-quality audio sources is important if you're performing
|
||||||
editing, using the same quality in the exported project is not necessary. For
|
editing, using the same quality in the exported project is not necessary. For
|
||||||
@@ -299,7 +299,7 @@ sample rate and number of channels for your audio:
|
|||||||
very high-pitched). This is because most human voices never go past 11 kHz.
|
very high-pitched). This is because most human voices never go past 11 kHz.
|
||||||
|
|
||||||
Use real-time audio effects to reduce file size
|
Use real-time audio effects to reduce file size
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Godot has an :ref:`extensive bus system <doc_audio_buses>` with built-in effects.
|
Godot has an :ref:`extensive bus system <doc_audio_buses>` with built-in effects.
|
||||||
This saves SFX artists the need to add reverb to the sound effects,
|
This saves SFX artists the need to add reverb to the sound effects,
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ image in the FileSystem dock:
|
|||||||
.. _doc_importing_images_changing_import_type:
|
.. _doc_importing_images_changing_import_type:
|
||||||
|
|
||||||
Changing import type
|
Changing import type
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
It is possible to choose other types of imported resources in the Import dock:
|
It is possible to choose other types of imported resources in the Import dock:
|
||||||
|
|
||||||
@@ -113,7 +113,7 @@ Here are templates you can use for cubemap images (right-click > **Save Link As
|
|||||||
- :download:`6×1 cubemap template <img/cubemap_template_6x1.webp>`
|
- :download:`6×1 cubemap template <img/cubemap_template_6x1.webp>`
|
||||||
|
|
||||||
Detect 3D
|
Detect 3D
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
The default import options (no mipmaps and **Lossless** compression) are suited
|
The default import options (no mipmaps and **Lossless** compression) are suited
|
||||||
for 2D, but are not ideal for most 3D projects. **Detect 3D** makes Godot aware
|
for 2D, but are not ideal for most 3D projects. **Detect 3D** makes Godot aware
|
||||||
@@ -152,7 +152,7 @@ Import options
|
|||||||
.. _doc_importing_images_compress_mode:
|
.. _doc_importing_images_compress_mode:
|
||||||
|
|
||||||
Compress > Mode
|
Compress > Mode
|
||||||
^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Images are one of the largest assets in a game. To handle them efficiently, they
|
Images are one of the largest assets in a game. To handle them efficiently, they
|
||||||
need to be compressed. Godot offers several compression methods, depending on
|
need to be compressed. Godot offers several compression methods, depending on
|
||||||
@@ -256,7 +256,7 @@ FileSystem dock, then looking at the Inspector:
|
|||||||
Previewing a texture in the Inspector. Credit: `Red Brick 03 - Poly Haven <https://polyhaven.com/a/red_brick_03>`__
|
Previewing a texture in the Inspector. Credit: `Red Brick 03 - Poly Haven <https://polyhaven.com/a/red_brick_03>`__
|
||||||
|
|
||||||
Compress > High Quality
|
Compress > High Quality
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -279,7 +279,7 @@ BPTC and ASTC support VRAM compression for HDR textures, but S3TC and ETC2 do
|
|||||||
not (see **HDR Compression** below).
|
not (see **HDR Compression** below).
|
||||||
|
|
||||||
Compress > HDR Compression
|
Compress > HDR Compression
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -299,7 +299,7 @@ If set to **Always**, will force VRAM compression even for HDR textures with an
|
|||||||
alpha channel. To perform this, the alpha channel is discarded on import.
|
alpha channel. To perform this, the alpha channel is discarded on import.
|
||||||
|
|
||||||
Compress > Normal Map
|
Compress > Normal Map
|
||||||
^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
When using a texture as normal map, only the red and green channels are
|
When using a texture as normal map, only the red and green channels are
|
||||||
required. Given regular texture compression algorithms produce artifacts that
|
required. Given regular texture compression algorithms produce artifacts that
|
||||||
@@ -337,7 +337,7 @@ using the same amount of memory as a standard RGBA VRAM-compressed texture:
|
|||||||
`here <http://wiki.polycount.com/wiki/Normal_Map_Technical_Details>`__.
|
`here <http://wiki.polycount.com/wiki/Normal_Map_Technical_Details>`__.
|
||||||
|
|
||||||
Compress > Channel Pack
|
Compress > Channel Pack
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
If set to **sRGB Friendly** (default), prevents the RG color format from being
|
If set to **sRGB Friendly** (default), prevents the RG color format from being
|
||||||
used as it does not support sRGB color.
|
used as it does not support sRGB color.
|
||||||
@@ -355,7 +355,7 @@ or **Basis Universal** compression modes.
|
|||||||
.. _doc_importing_images_mipmaps:
|
.. _doc_importing_images_mipmaps:
|
||||||
|
|
||||||
Mipmaps > Generate
|
Mipmaps > Generate
|
||||||
^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
If enabled, smaller versions of the texture are generated on import. For
|
If enabled, smaller versions of the texture are generated on import. For
|
||||||
example, a 64×64 texture will generate 6 mipmaps (32×32, 16×16, 8×8, 4×4, 2×2,
|
example, a 64×64 texture will generate 6 mipmaps (32×32, 16×16, 8×8, 4×4, 2×2,
|
||||||
@@ -375,7 +375,7 @@ camera never zooms out significantly, there won't be a benefit to enabling
|
|||||||
mipmaps but memory usage will increase.
|
mipmaps but memory usage will increase.
|
||||||
|
|
||||||
Mipmaps > Limit
|
Mipmaps > Limit
|
||||||
^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. UPDATE: Not implemented. When Mipmaps > Limit is implemented, remove this
|
.. UPDATE: Not implemented. When Mipmaps > Limit is implemented, remove this
|
||||||
.. warning and remove this comment.
|
.. warning and remove this comment.
|
||||||
@@ -389,13 +389,13 @@ can be generated. This can be decreased if you don't want textures to become too
|
|||||||
low-resolution at extreme distances, at the cost of some graininess.
|
low-resolution at extreme distances, at the cost of some graininess.
|
||||||
|
|
||||||
Roughness > Mode
|
Roughness > Mode
|
||||||
^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The color channel to consider as a roughness map in this texture. Only effective if
|
The color channel to consider as a roughness map in this texture. Only effective if
|
||||||
**Roughness > Src Normal** is not empty.
|
**Roughness > Src Normal** is not empty.
|
||||||
|
|
||||||
Roughness > Src Normal
|
Roughness > Src Normal
|
||||||
^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The path to the texture to consider as a normal map for roughness filtering on
|
The path to the texture to consider as a normal map for roughness filtering on
|
||||||
import. Specifying this can help decrease specular aliasing slightly in 3D.
|
import. Specifying this can help decrease specular aliasing slightly in 3D.
|
||||||
@@ -403,7 +403,7 @@ import. Specifying this can help decrease specular aliasing slightly in 3D.
|
|||||||
Roughness filtering on import is only used in 3D rendering, not 2D.
|
Roughness filtering on import is only used in 3D rendering, not 2D.
|
||||||
|
|
||||||
Process > Fix Alpha Border
|
Process > Fix Alpha Border
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
This puts pixels of the same surrounding color in transition from transparent to
|
This puts pixels of the same surrounding color in transition from transparent to
|
||||||
opaque areas. For textures displayed with bilinear filtering, this helps
|
opaque areas. For textures displayed with bilinear filtering, this helps
|
||||||
@@ -415,7 +415,7 @@ It's recommended to leave this enabled (as it is by default), unless this causes
|
|||||||
issues for a particular image.
|
issues for a particular image.
|
||||||
|
|
||||||
Process > Premult Alpha
|
Process > Premult Alpha
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
An alternative to fixing darkened borders with **Fix Alpha Border** is to use
|
An alternative to fixing darkened borders with **Fix Alpha Border** is to use
|
||||||
premultiplied alpha. By enabling this option, the texture will be converted to
|
premultiplied alpha. By enabling this option, the texture will be converted to
|
||||||
@@ -429,7 +429,7 @@ displayed correctly:
|
|||||||
option is only suited for 2D.
|
option is only suited for 2D.
|
||||||
|
|
||||||
Process > Normal Map Invert Y
|
Process > Normal Map Invert Y
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Godot requires the normal map to use the X+, Y+ and Z+ coordinates, which is
|
Godot requires the normal map to use the X+, Y+ and Z+ coordinates, which is
|
||||||
known as an OpenGL-style normal map. If you've imported a material made to be
|
known as an OpenGL-style normal map. If you've imported a material made to be
|
||||||
@@ -441,7 +441,7 @@ popular engines) can be found
|
|||||||
`here <http://wiki.polycount.com/wiki/Normal_Map_Technical_Details>`__.
|
`here <http://wiki.polycount.com/wiki/Normal_Map_Technical_Details>`__.
|
||||||
|
|
||||||
Process > HDR as sRGB
|
Process > HDR as sRGB
|
||||||
^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Some HDR images you can find online may be broken and contain sRGB color data
|
Some HDR images you can find online may be broken and contain sRGB color data
|
||||||
(instead of linear color data). It is advised not to use those files. If you
|
(instead of linear color data). It is advised not to use those files. If you
|
||||||
@@ -453,7 +453,7 @@ absolutely have to, enabling this option on will make them look correct.
|
|||||||
resulting image to look too dark, so leave this disabled if unsure.
|
resulting image to look too dark, so leave this disabled if unsure.
|
||||||
|
|
||||||
Process > HDR Clamp Exposure
|
Process > HDR Clamp Exposure
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Some HDR panorama images you can find online may contain extremely bright
|
Some HDR panorama images you can find online may contain extremely bright
|
||||||
pixels, due to being taken from real life sources without any clipping.
|
pixels, due to being taken from real life sources without any clipping.
|
||||||
@@ -466,7 +466,7 @@ clamping formula that does not introduce *visible* clipping – glow will keep
|
|||||||
working when looking at the background sky.
|
working when looking at the background sky.
|
||||||
|
|
||||||
Process > Size Limit
|
Process > Size Limit
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
If set to a value greater than ``0``, the size of the texture is limited on
|
If set to a value greater than ``0``, the size of the texture is limited on
|
||||||
import to a value smaller than or equal to the value specified here. For
|
import to a value smaller than or equal to the value specified here. For
|
||||||
@@ -481,7 +481,7 @@ usually can't display textures larger than 4096×4096).
|
|||||||
.. _doc_importing_images_detect_3d_compress_to:
|
.. _doc_importing_images_detect_3d_compress_to:
|
||||||
|
|
||||||
Detect 3D > Compress To
|
Detect 3D > Compress To
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
This changes the :ref:`doc_importing_images_compress_mode` option that is used
|
This changes the :ref:`doc_importing_images_compress_mode` option that is used
|
||||||
when a texture is detected as being used in 3D.
|
when a texture is detected as being used in 3D.
|
||||||
@@ -492,7 +492,7 @@ existing compress mode on a texture (if it's detected to be used in 3D), but
|
|||||||
choosing **VRAM Compressed** or **Basis Universal** will.
|
choosing **VRAM Compressed** or **Basis Universal** will.
|
||||||
|
|
||||||
SVG > Scale
|
SVG > Scale
|
||||||
^^^^^^^^^^^
|
~~~~~~~~~~~
|
||||||
|
|
||||||
*This is only available for SVG images.*
|
*This is only available for SVG images.*
|
||||||
|
|
||||||
@@ -504,7 +504,7 @@ also **Editor > Scale With Editor Scale** below.
|
|||||||
.. _doc_importing_images_editor_import_options:
|
.. _doc_importing_images_editor_import_options:
|
||||||
|
|
||||||
Editor > Scale With Editor Scale
|
Editor > Scale With Editor Scale
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
*This is only available for SVG images.*
|
*This is only available for SVG images.*
|
||||||
|
|
||||||
@@ -513,7 +513,7 @@ This should be enabled for editor plugin icons and custom class icons, but
|
|||||||
should be left disabled otherwise.
|
should be left disabled otherwise.
|
||||||
|
|
||||||
Editor > Convert Colors With Editor Theme
|
Editor > Convert Colors With Editor Theme
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
*This is only available for SVG images.*
|
*This is only available for SVG images.*
|
||||||
|
|
||||||
@@ -549,7 +549,7 @@ Best practices
|
|||||||
--------------
|
--------------
|
||||||
|
|
||||||
Supporting high-resolution texture sizes in 2D without artifacts
|
Supporting high-resolution texture sizes in 2D without artifacts
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
To support :ref:`multiple resolutions <doc_multiple_resolutions>` with crisp
|
To support :ref:`multiple resolutions <doc_multiple_resolutions>` with crisp
|
||||||
visuals at high resolutions, you will need to use high-resolution source images
|
visuals at high resolutions, you will need to use high-resolution source images
|
||||||
@@ -575,7 +575,7 @@ to make textures sharper (at the cost of some graininess) by setting
|
|||||||
negative value.
|
negative value.
|
||||||
|
|
||||||
Use appropriate texture sizes in 3D
|
Use appropriate texture sizes in 3D
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
While there's no "one size fits all" recommendation, here are some general
|
While there's no "one size fits all" recommendation, here are some general
|
||||||
recommendations for choosing texture sizes in 3D:
|
recommendations for choosing texture sizes in 3D:
|
||||||
|
|||||||
@@ -74,7 +74,8 @@ Godot depends on system libraries for text-to-speech functionality. These librar
|
|||||||
Both Godot users on Linux and end-users on Linux running Godot games need to ensure that their system includes the system libraries for text-to-speech to work. Please consult the table below or your own distribution's documentation to determine what libraries you need to install.
|
Both Godot users on Linux and end-users on Linux running Godot games need to ensure that their system includes the system libraries for text-to-speech to work. Please consult the table below or your own distribution's documentation to determine what libraries you need to install.
|
||||||
|
|
||||||
Distro-specific one-liners
|
Distro-specific one-liners
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
+------------------+-----------------------------------------------------------------------------------------------------------+
|
+------------------+-----------------------------------------------------------------------------------------------------------+
|
||||||
| **Arch Linux** | :: |
|
| **Arch Linux** | :: |
|
||||||
| | |
|
| | |
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ As of July 2023, there is only a Git plugin available, but the community may
|
|||||||
create additional VCS plugins.
|
create additional VCS plugins.
|
||||||
|
|
||||||
Official Git plugin
|
Official Git plugin
|
||||||
^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Using Git from inside the editor is supported with an official plugin.
|
Using Git from inside the editor is supported with an official plugin.
|
||||||
You can find the latest releases on
|
You can find the latest releases on
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ To use these protocols, a Godot instance must be running on your current project
|
|||||||
Below are some configuration steps for specific editors:
|
Below are some configuration steps for specific editors:
|
||||||
|
|
||||||
Visual Studio Code
|
Visual Studio Code
|
||||||
^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
You need to install the official `Visual Studio Code plugin <https://github.com/godotengine/godot-vscode-plugin>`_.
|
You need to install the official `Visual Studio Code plugin <https://github.com/godotengine/godot-vscode-plugin>`_.
|
||||||
|
|
||||||
@@ -121,6 +121,6 @@ For **DAP**, specify the ``debugServer`` property in your ``launch.json`` file:
|
|||||||
}
|
}
|
||||||
|
|
||||||
Emacs
|
Emacs
|
||||||
^^^^^
|
~~~~~
|
||||||
|
|
||||||
Check the official instructions to configure `LSP <https://github.com/godotengine/emacs-gdscript-mode#auto-completion-with-the-language-server-protocol-lsp>`_, and `DAP <https://github.com/godotengine/emacs-gdscript-mode#using-the-debugger>`_.
|
Check the official instructions to configure `LSP <https://github.com/godotengine/emacs-gdscript-mode#auto-completion-with-the-language-server-protocol-lsp>`_, and `DAP <https://github.com/godotengine/emacs-gdscript-mode#using-the-debugger>`_.
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ Script Editor
|
|||||||
.. _doc_script_editor_introduction:
|
.. _doc_script_editor_introduction:
|
||||||
|
|
||||||
Introduction
|
Introduction
|
||||||
~~~~~~~~~~~~
|
------------
|
||||||
|
|
||||||
Godot Engine's script editor is a powerful and fully-integrated text editor
|
Godot Engine's script editor is a powerful and fully-integrated text editor
|
||||||
that not only streamlines the process of writing and debugging code written in
|
that not only streamlines the process of writing and debugging code written in
|
||||||
@@ -25,7 +25,7 @@ be accessed in several ways as described in the
|
|||||||
.. _doc_script_editor_features:
|
.. _doc_script_editor_features:
|
||||||
|
|
||||||
Features
|
Features
|
||||||
~~~~~~~~
|
--------
|
||||||
|
|
||||||
Some of the key features of the text editor are listed below:
|
Some of the key features of the text editor are listed below:
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ Some of the key features of the text editor are listed below:
|
|||||||
.. _doc_script_editor_usage:
|
.. _doc_script_editor_usage:
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
~~~~~
|
-----
|
||||||
|
|
||||||
If you are using GDScript in your project, the built-in text editor in
|
If you are using GDScript in your project, the built-in text editor in
|
||||||
Godot provides everything you need, serving as a one-stop location to
|
Godot provides everything you need, serving as a one-stop location to
|
||||||
@@ -106,7 +106,7 @@ You can also select a section below to jump to a specific topic:
|
|||||||
.. _doc_script_editor_script_panel:
|
.. _doc_script_editor_script_panel:
|
||||||
|
|
||||||
Script Panel
|
Script Panel
|
||||||
------------
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
.. |script| image:: img/script_editor_icons/Script.webp
|
.. |script| image:: img/script_editor_icons/Script.webp
|
||||||
.. |scriptcsharp| image:: img/script_editor_icons/ScriptCSharp.webp
|
.. |scriptcsharp| image:: img/script_editor_icons/ScriptCSharp.webp
|
||||||
@@ -165,7 +165,7 @@ behavior as filtering scripts.
|
|||||||
.. _doc_script_editor_menus:
|
.. _doc_script_editor_menus:
|
||||||
|
|
||||||
Menus
|
Menus
|
||||||
-----
|
~~~~~
|
||||||
|
|
||||||
The text editor's menus lie below the scene switcher and allow you to access a
|
The text editor's menus lie below the scene switcher and allow you to access a
|
||||||
variety of tools and options, such as file management, search and replace, debugging
|
variety of tools and options, such as file management, search and replace, debugging
|
||||||
@@ -365,7 +365,7 @@ The **Go To** menu lets you navigate within the code at ease with these options:
|
|||||||
.. _doc_script_editor_coding_area:
|
.. _doc_script_editor_coding_area:
|
||||||
|
|
||||||
Coding area
|
Coding area
|
||||||
-----------
|
~~~~~~~~~~~
|
||||||
|
|
||||||
.. note:: This section will only cover the basics of the coding area in terms of the user
|
.. note:: This section will only cover the basics of the coding area in terms of the user
|
||||||
interface. To learn more about scripting in Godot, refer to the :ref:`doc_gdscript` or
|
interface. To learn more about scripting in Godot, refer to the :ref:`doc_gdscript` or
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ Troubleshooting
|
|||||||
---------------
|
---------------
|
||||||
|
|
||||||
Android
|
Android
|
||||||
^^^^^^^
|
~~~~~~~
|
||||||
|
|
||||||
If you can't see the device in the list of devices when running the
|
If you can't see the device in the list of devices when running the
|
||||||
``adb devices`` command in a terminal, it will not be visible by Godot either.
|
``adb devices`` command in a terminal, it will not be visible by Godot either.
|
||||||
@@ -123,7 +123,7 @@ To resolve this:
|
|||||||
.. _doc_one-click_deploy_troubleshooting_web:
|
.. _doc_one-click_deploy_troubleshooting_web:
|
||||||
|
|
||||||
Web
|
Web
|
||||||
^^^
|
~~~
|
||||||
|
|
||||||
By default, the web server started by the editor is only accessible from
|
By default, the web server started by the editor is only accessible from
|
||||||
``localhost``. This means the web server can't be reached by other devices on
|
``localhost``. This means the web server can't be reached by other devices on
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ This will just look up the text in the translations and convert it if found:
|
|||||||
define the DynamicFont as the Default Font in the theme.
|
define the DynamicFont as the Default Font in the theme.
|
||||||
|
|
||||||
Placeholders
|
Placeholders
|
||||||
^^^^^^^^^^^^
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
To feature placeholders in your translated strings, use
|
To feature placeholders in your translated strings, use
|
||||||
:ref:`doc_gdscript_printf` or the equivalent feature in C#. This lets
|
:ref:`doc_gdscript_printf` or the equivalent feature in C#. This lets
|
||||||
@@ -123,7 +123,7 @@ allow translators to choose the *order* in which placeholders appear:
|
|||||||
message.text = tr("{character} picked up the {weapon}").format({character = "Ogre", weapon = "Sword"})
|
message.text = tr("{character} picked up the {weapon}").format({character = "Ogre", weapon = "Sword"})
|
||||||
|
|
||||||
Translation contexts
|
Translation contexts
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
If you're using plain English as source strings (rather than message codes
|
If you're using plain English as source strings (rather than message codes
|
||||||
``LIKE_THIS``), you may run into ambiguities when you have to translate the same
|
``LIKE_THIS``), you may run into ambiguities when you have to translate the same
|
||||||
@@ -150,7 +150,7 @@ identical:
|
|||||||
GetNode<Label>("Distance").Text = Tr("Close", "Distance");
|
GetNode<Label>("Distance").Text = Tr("Close", "Distance");
|
||||||
|
|
||||||
Pluralization
|
Pluralization
|
||||||
^^^^^^^^^^^^^
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
Most languages require different strings depending on whether an object is in
|
Most languages require different strings depending on whether an object is in
|
||||||
singular or plural form. However, hardcoding the "is plural" condition depending
|
singular or plural form. However, hardcoding the "is plural" condition depending
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ Creating the PO template
|
|||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
Automatic generation using the editor
|
Automatic generation using the editor
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Since Godot 4.0, the editor can generate a PO template automatically from
|
Since Godot 4.0, the editor can generate a PO template automatically from
|
||||||
specified scene and GDScript files. This POT generation also supports translation
|
specified scene and GDScript files. This POT generation also supports translation
|
||||||
@@ -92,7 +92,7 @@ You can then move over to
|
|||||||
update translations for outdated strings.
|
update translations for outdated strings.
|
||||||
|
|
||||||
Manual creation
|
Manual creation
|
||||||
^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
If the automatic generation approach doesn't work out for your needs, you can
|
If the automatic generation approach doesn't work out for your needs, you can
|
||||||
create a PO template by hand in a text editor. This file can be placed anywhere
|
create a PO template by hand in a text editor. This file can be placed anywhere
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ Input actions are explained in detail on the :ref:`doc_inputevent` page.
|
|||||||
different code paths since these have to be handled separately.
|
different code paths since these have to be handled separately.
|
||||||
|
|
||||||
Which Input singleton method should I use?
|
Which Input singleton method should I use?
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
There are 3 ways to get input in an analog-aware way:
|
There are 3 ways to get input in an analog-aware way:
|
||||||
|
|
||||||
@@ -167,7 +167,7 @@ If you're used to handling keyboard and mouse input, you may be surprised by how
|
|||||||
controllers handle specific situations.
|
controllers handle specific situations.
|
||||||
|
|
||||||
Dead zone
|
Dead zone
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
Unlike keyboards and mice, controllers offer axes with *analog* inputs. The
|
Unlike keyboards and mice, controllers offer axes with *analog* inputs. The
|
||||||
upside of analog inputs is that they offer additional flexibility for actions.
|
upside of analog inputs is that they offer additional flexibility for actions.
|
||||||
@@ -195,7 +195,7 @@ specified as an optional 5th parameter. If not specified, it will calculate the
|
|||||||
average deadzone value from all of the actions in the vector.
|
average deadzone value from all of the actions in the vector.
|
||||||
|
|
||||||
"Echo" events
|
"Echo" events
|
||||||
^^^^^^^^^^^^^
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
Unlike keyboard input, holding down a controller button such as a D-pad
|
Unlike keyboard input, holding down a controller button such as a D-pad
|
||||||
direction will **not** generate repeated input events at fixed intervals (also
|
direction will **not** generate repeated input events at fixed intervals (also
|
||||||
@@ -209,7 +209,7 @@ at regular intervals. This can be accomplished
|
|||||||
with the help of a :ref:`class_Timer` node.
|
with the help of a :ref:`class_Timer` node.
|
||||||
|
|
||||||
Window focus
|
Window focus
|
||||||
^^^^^^^^^^^^
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
Unlike keyboard input, controller inputs can be seen by **all** windows on the
|
Unlike keyboard input, controller inputs can be seen by **all** windows on the
|
||||||
operating system, including unfocused windows.
|
operating system, including unfocused windows.
|
||||||
@@ -258,7 +258,7 @@ use ``Focus.event_is_action_pressed(event, action)`` where ``event`` is an
|
|||||||
InputEvent reference and ``action`` is the name of the input action.
|
InputEvent reference and ``action`` is the name of the input action.
|
||||||
|
|
||||||
Power saving prevention
|
Power saving prevention
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Unlike keyboard and mouse input, controller inputs do **not** inhibit sleep and
|
Unlike keyboard and mouse input, controller inputs do **not** inhibit sleep and
|
||||||
power saving measures (such as turning off the screen after a certain amount of
|
power saving measures (such as turning off the screen after a certain amount of
|
||||||
@@ -283,7 +283,7 @@ Troubleshooting
|
|||||||
on GitHub.
|
on GitHub.
|
||||||
|
|
||||||
My controller isn't recognized by Godot.
|
My controller isn't recognized by Godot.
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
First, check that your controller is recognized by other applications. You can
|
First, check that your controller is recognized by other applications. You can
|
||||||
use the `Gamepad Tester <https://gamepad-tester.com/>`__ website to confirm that
|
use the `Gamepad Tester <https://gamepad-tester.com/>`__ website to confirm that
|
||||||
@@ -294,7 +294,7 @@ because Godot uses the XInput API, which is limited to supporting 4 controllers
|
|||||||
at once. Additional controllers above this limit are ignored by Godot.
|
at once. Additional controllers above this limit are ignored by Godot.
|
||||||
|
|
||||||
My controller has incorrectly mapped buttons or axes.
|
My controller has incorrectly mapped buttons or axes.
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
First, if your controller provides some kind of firmware update utility,
|
First, if your controller provides some kind of firmware update utility,
|
||||||
make sure to run it to get the latest fixes from the manufacturer. For instance,
|
make sure to run it to get the latest fixes from the manufacturer. For instance,
|
||||||
@@ -337,10 +337,10 @@ additional controller mappings, you can add them by calling
|
|||||||
as early as possible in a script's ``_ready()`` function.
|
as early as possible in a script's ``_ready()`` function.
|
||||||
|
|
||||||
My controller works on a given platform, but not on another platform.
|
My controller works on a given platform, but not on another platform.
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Linux
|
Linux
|
||||||
~~~~~
|
^^^^^
|
||||||
|
|
||||||
If you're using a self-compiled engine binary, make sure it was compiled with
|
If you're using a self-compiled engine binary, make sure it was compiled with
|
||||||
udev support. This is enabled by default, but it is possible to disable udev
|
udev support. This is enabled by default, but it is possible to disable udev
|
||||||
@@ -353,7 +353,7 @@ regular polling must be used to check for controllers being connected or
|
|||||||
disconnected during gameplay (hotplugging).
|
disconnected during gameplay (hotplugging).
|
||||||
|
|
||||||
HTML5
|
HTML5
|
||||||
~~~~~
|
^^^^^
|
||||||
|
|
||||||
HTML5 controller support is often less reliable compared to "native" platforms.
|
HTML5 controller support is often less reliable compared to "native" platforms.
|
||||||
The quality of controller support tends to vary wildly across browsers. As a
|
The quality of controller support tends to vary wildly across browsers. As a
|
||||||
|
|||||||
@@ -111,10 +111,10 @@ should be ``(offset - 4) * 2 + 4``. The "float" type itself always uses double
|
|||||||
precision.
|
precision.
|
||||||
|
|
||||||
0: null
|
0: null
|
||||||
^^^^^^^
|
~~~~~~~
|
||||||
|
|
||||||
1: :ref:`bool<class_bool>`
|
1: :ref:`bool<class_bool>`
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
+----------+-------+-----------+---------------------------+
|
+----------+-------+-----------+---------------------------+
|
||||||
| Offset | Len | Type | Description |
|
| Offset | Len | Type | Description |
|
||||||
@@ -123,7 +123,7 @@ precision.
|
|||||||
+----------+-------+-----------+---------------------------+
|
+----------+-------+-----------+---------------------------+
|
||||||
|
|
||||||
2: :ref:`int<class_int>`
|
2: :ref:`int<class_int>`
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
If no flags are set (flags == 0), the integer is sent as a 32 bit integer:
|
If no flags are set (flags == 0), the integer is sent as a 32 bit integer:
|
||||||
|
|
||||||
@@ -143,7 +143,7 @@ a 64-bit integer:
|
|||||||
+----------+-------+-----------+--------------------------+
|
+----------+-------+-----------+--------------------------+
|
||||||
|
|
||||||
3: :ref:`float<class_float>`
|
3: :ref:`float<class_float>`
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
If no flags are set (flags == 0), the float is sent as a 32 bit single precision:
|
If no flags are set (flags == 0), the float is sent as a 32 bit single precision:
|
||||||
|
|
||||||
@@ -163,7 +163,7 @@ a 64-bit double precision number:
|
|||||||
+----------+-------+---------+-----------------------------------+
|
+----------+-------+---------+-----------------------------------+
|
||||||
|
|
||||||
4: :ref:`String<class_string>`
|
4: :ref:`String<class_string>`
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
+----------+-------+-----------+----------------------------+
|
+----------+-------+-----------+----------------------------+
|
||||||
| Offset | Len | Type | Description |
|
| Offset | Len | Type | Description |
|
||||||
@@ -176,7 +176,7 @@ a 64-bit double precision number:
|
|||||||
This field is padded to 4 bytes.
|
This field is padded to 4 bytes.
|
||||||
|
|
||||||
5: :ref:`Vector2<class_vector2>`
|
5: :ref:`Vector2<class_vector2>`
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
+----------+-------+---------+----------------+
|
+----------+-------+---------+----------------+
|
||||||
| Offset | Len | Type | Description |
|
| Offset | Len | Type | Description |
|
||||||
@@ -187,7 +187,7 @@ This field is padded to 4 bytes.
|
|||||||
+----------+-------+---------+----------------+
|
+----------+-------+---------+----------------+
|
||||||
|
|
||||||
6: :ref:`Rect2<class_rect2>`
|
6: :ref:`Rect2<class_rect2>`
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
+----------+-------+---------+----------------+
|
+----------+-------+---------+----------------+
|
||||||
| Offset | Len | Type | Description |
|
| Offset | Len | Type | Description |
|
||||||
@@ -202,7 +202,7 @@ This field is padded to 4 bytes.
|
|||||||
+----------+-------+---------+----------------+
|
+----------+-------+---------+----------------+
|
||||||
|
|
||||||
7: :ref:`Vector3<class_vector3>`
|
7: :ref:`Vector3<class_vector3>`
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
+----------+-------+---------+----------------+
|
+----------+-------+---------+----------------+
|
||||||
| Offset | Len | Type | Description |
|
| Offset | Len | Type | Description |
|
||||||
@@ -215,7 +215,7 @@ This field is padded to 4 bytes.
|
|||||||
+----------+-------+---------+----------------+
|
+----------+-------+---------+----------------+
|
||||||
|
|
||||||
8: :ref:`Transform2D<class_transform2d>`
|
8: :ref:`Transform2D<class_transform2d>`
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
+----------+-------+---------+---------------------------------------------------------------+
|
+----------+-------+---------+---------------------------------------------------------------+
|
||||||
| Offset | Len | Type | Description |
|
| Offset | Len | Type | Description |
|
||||||
@@ -234,7 +234,7 @@ This field is padded to 4 bytes.
|
|||||||
+----------+-------+---------+---------------------------------------------------------------+
|
+----------+-------+---------+---------------------------------------------------------------+
|
||||||
|
|
||||||
9: :ref:`Plane<class_plane>`
|
9: :ref:`Plane<class_plane>`
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
+----------+-------+---------+---------------+
|
+----------+-------+---------+---------------+
|
||||||
| Offset | Len | Type | Description |
|
| Offset | Len | Type | Description |
|
||||||
@@ -249,7 +249,7 @@ This field is padded to 4 bytes.
|
|||||||
+----------+-------+---------+---------------+
|
+----------+-------+---------+---------------+
|
||||||
|
|
||||||
10: :ref:`Quaternion<class_quaternion>`
|
10: :ref:`Quaternion<class_quaternion>`
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
+----------+-------+---------+---------------+
|
+----------+-------+---------+---------------+
|
||||||
| Offset | Len | Type | Description |
|
| Offset | Len | Type | Description |
|
||||||
@@ -264,7 +264,7 @@ This field is padded to 4 bytes.
|
|||||||
+----------+-------+---------+---------------+
|
+----------+-------+---------+---------------+
|
||||||
|
|
||||||
11: :ref:`AABB<class_aabb>`
|
11: :ref:`AABB<class_aabb>`
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
+----------+-------+---------+----------------+
|
+----------+-------+---------+----------------+
|
||||||
| Offset | Len | Type | Description |
|
| Offset | Len | Type | Description |
|
||||||
@@ -283,7 +283,7 @@ This field is padded to 4 bytes.
|
|||||||
+----------+-------+---------+----------------+
|
+----------+-------+---------+----------------+
|
||||||
|
|
||||||
12: :ref:`Basis<class_basis>`
|
12: :ref:`Basis<class_basis>`
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
+----------+-------+---------+---------------------------------------------------------------+
|
+----------+-------+---------+---------------------------------------------------------------+
|
||||||
| Offset | Len | Type | Description |
|
| Offset | Len | Type | Description |
|
||||||
@@ -308,7 +308,7 @@ This field is padded to 4 bytes.
|
|||||||
+----------+-------+---------+---------------------------------------------------------------+
|
+----------+-------+---------+---------------------------------------------------------------+
|
||||||
|
|
||||||
13: :ref:`Transform3D<class_transform3d>`
|
13: :ref:`Transform3D<class_transform3d>`
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
+----------+-------+---------+---------------------------------------------------------------+
|
+----------+-------+---------+---------------------------------------------------------------+
|
||||||
| Offset | Len | Type | Description |
|
| Offset | Len | Type | Description |
|
||||||
@@ -339,7 +339,7 @@ This field is padded to 4 bytes.
|
|||||||
+----------+-------+---------+---------------------------------------------------------------+
|
+----------+-------+---------+---------------------------------------------------------------+
|
||||||
|
|
||||||
14: :ref:`Color<class_color>`
|
14: :ref:`Color<class_color>`
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
+----------+-------+---------+--------------------------------------------------------------+
|
+----------+-------+---------+--------------------------------------------------------------+
|
||||||
| Offset | Len | Type | Description |
|
| Offset | Len | Type | Description |
|
||||||
@@ -354,7 +354,7 @@ This field is padded to 4 bytes.
|
|||||||
+----------+-------+---------+--------------------------------------------------------------+
|
+----------+-------+---------+--------------------------------------------------------------+
|
||||||
|
|
||||||
15: :ref:`NodePath<class_nodepath>`
|
15: :ref:`NodePath<class_nodepath>`
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
+----------+-------+-----------+-----------------------------------------------------------------------------------------+
|
+----------+-------+-----------+-----------------------------------------------------------------------------------------+
|
||||||
| Offset | Len | Type | Description |
|
| Offset | Len | Type | Description |
|
||||||
@@ -363,7 +363,7 @@ This field is padded to 4 bytes.
|
|||||||
+----------+-------+-----------+-----------------------------------------------------------------------------------------+
|
+----------+-------+-----------+-----------------------------------------------------------------------------------------+
|
||||||
|
|
||||||
For old format:
|
For old format:
|
||||||
^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
+----------+-------+---------+------------------------+
|
+----------+-------+---------+------------------------+
|
||||||
| Offset | Len | Type | Description |
|
| Offset | Len | Type | Description |
|
||||||
@@ -374,7 +374,7 @@ For old format:
|
|||||||
Padded to 4 bytes.
|
Padded to 4 bytes.
|
||||||
|
|
||||||
For new format:
|
For new format:
|
||||||
^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
+----------+-------+-----------+-------------------------------------+
|
+----------+-------+-----------+-------------------------------------+
|
||||||
| Offset | Len | Type | Description |
|
| Offset | Len | Type | Description |
|
||||||
@@ -397,16 +397,16 @@ For each Name and Sub-Name
|
|||||||
Every name string is padded to 4 bytes.
|
Every name string is padded to 4 bytes.
|
||||||
|
|
||||||
16: :ref:`RID<class_rid>` (unsupported)
|
16: :ref:`RID<class_rid>` (unsupported)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
17: :ref:`Object<class_object>`
|
17: :ref:`Object<class_object>`
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
An Object could be serialized in three different ways: as a null value, with
|
An Object could be serialized in three different ways: as a null value, with
|
||||||
``full_objects = false``, or with ``full_objects = true``.
|
``full_objects = false``, or with ``full_objects = true``.
|
||||||
|
|
||||||
A null value
|
A null value
|
||||||
""""""""""""
|
^^^^^^^^^^^^
|
||||||
|
|
||||||
+----------+-------+------------+-------------------------------------------------+
|
+----------+-------+------------+-------------------------------------------------+
|
||||||
| Offset | Len | Type | Description |
|
| Offset | Len | Type | Description |
|
||||||
@@ -415,7 +415,7 @@ A null value
|
|||||||
+----------+-------+------------+-------------------------------------------------+
|
+----------+-------+------------+-------------------------------------------------+
|
||||||
|
|
||||||
``full_objects`` disabled
|
``full_objects`` disabled
|
||||||
"""""""""""""""""""""""""
|
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
+----------+-------+------------+-------------------------------------------------+
|
+----------+-------+------------+-------------------------------------------------+
|
||||||
| Offset | Len | Type | Description |
|
| Offset | Len | Type | Description |
|
||||||
@@ -424,7 +424,7 @@ A null value
|
|||||||
+----------+-------+------------+-------------------------------------------------+
|
+----------+-------+------------+-------------------------------------------------+
|
||||||
|
|
||||||
``full_objects`` enabled
|
``full_objects`` enabled
|
||||||
""""""""""""""""""""""""
|
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
+----------+-------+----------------+----------------------------------------------------------+
|
+----------+-------+----------------+----------------------------------------------------------+
|
||||||
| Offset | Len | Type | Description |
|
| Offset | Len | Type | Description |
|
||||||
@@ -460,7 +460,7 @@ For each property:
|
|||||||
possible usage flags.
|
possible usage flags.
|
||||||
|
|
||||||
18: :ref:`Dictionary<class_dictionary>`
|
18: :ref:`Dictionary<class_dictionary>`
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
+----------+-------+-----------+---------------------------------------------------------------------+
|
+----------+-------+-----------+---------------------------------------------------------------------+
|
||||||
| Offset | Len | Type | Description |
|
| Offset | Len | Type | Description |
|
||||||
@@ -472,7 +472,7 @@ Then what follows is, for amount of "elements", pairs of key and value,
|
|||||||
one after the other, using this same format.
|
one after the other, using this same format.
|
||||||
|
|
||||||
19: :ref:`Array<class_array>`
|
19: :ref:`Array<class_array>`
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
+----------+-------+-----------+---------------------------------------------------------------------+
|
+----------+-------+-----------+---------------------------------------------------------------------+
|
||||||
| Offset | Len | Type | Description |
|
| Offset | Len | Type | Description |
|
||||||
@@ -484,7 +484,7 @@ Then what follows is, for amount of "elements", values one after the
|
|||||||
other, using this same format.
|
other, using this same format.
|
||||||
|
|
||||||
20: :ref:`PackedByteArray<class_PackedByteArray>`
|
20: :ref:`PackedByteArray<class_PackedByteArray>`
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
+---------------+-------+-----------+------------------------+
|
+---------------+-------+-----------+------------------------+
|
||||||
| Offset | Len | Type | Description |
|
| Offset | Len | Type | Description |
|
||||||
@@ -497,7 +497,7 @@ other, using this same format.
|
|||||||
The array data is padded to 4 bytes.
|
The array data is padded to 4 bytes.
|
||||||
|
|
||||||
21: :ref:`PackedInt32Array<class_PackedInt32Array>`
|
21: :ref:`PackedInt32Array<class_PackedInt32Array>`
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
+------------------+-------+-----------+---------------------------+
|
+------------------+-------+-----------+---------------------------+
|
||||||
| Offset | Len | Type | Description |
|
| Offset | Len | Type | Description |
|
||||||
@@ -508,7 +508,7 @@ The array data is padded to 4 bytes.
|
|||||||
+------------------+-------+-----------+---------------------------+
|
+------------------+-------+-----------+---------------------------+
|
||||||
|
|
||||||
22: :ref:`PackedInt64Array<class_PackedInt64Array>`
|
22: :ref:`PackedInt64Array<class_PackedInt64Array>`
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
+------------------+-------+-----------+---------------------------+
|
+------------------+-------+-----------+---------------------------+
|
||||||
| Offset | Len | Type | Description |
|
| Offset | Len | Type | Description |
|
||||||
@@ -519,7 +519,7 @@ The array data is padded to 4 bytes.
|
|||||||
+------------------+-------+-----------+---------------------------+
|
+------------------+-------+-----------+---------------------------+
|
||||||
|
|
||||||
23: :ref:`PackedFloat32Array<class_PackedFloat32Array>`
|
23: :ref:`PackedFloat32Array<class_PackedFloat32Array>`
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
+------------------+-------+-----------+-------------------------------------------+
|
+------------------+-------+-----------+-------------------------------------------+
|
||||||
| Offset | Len | Type | Description |
|
| Offset | Len | Type | Description |
|
||||||
@@ -530,7 +530,7 @@ The array data is padded to 4 bytes.
|
|||||||
+------------------+-------+-----------+-------------------------------------------+
|
+------------------+-------+-----------+-------------------------------------------+
|
||||||
|
|
||||||
24: :ref:`PackedFloat64Array<class_PackedFloat64Array>`
|
24: :ref:`PackedFloat64Array<class_PackedFloat64Array>`
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
+------------------+-------+-----------+-------------------------------------------+
|
+------------------+-------+-----------+-------------------------------------------+
|
||||||
| Offset | Len | Type | Description |
|
| Offset | Len | Type | Description |
|
||||||
@@ -541,7 +541,7 @@ The array data is padded to 4 bytes.
|
|||||||
+------------------+-------+-----------+-------------------------------------------+
|
+------------------+-------+-----------+-------------------------------------------+
|
||||||
|
|
||||||
25: :ref:`PackedStringArray<class_PackedStringArray>`
|
25: :ref:`PackedStringArray<class_PackedStringArray>`
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
+----------+-------+-----------+--------------------------+
|
+----------+-------+-----------+--------------------------+
|
||||||
| Offset | Len | Type | Description |
|
| Offset | Len | Type | Description |
|
||||||
@@ -562,7 +562,7 @@ For each String:
|
|||||||
Every string is padded to 4 bytes.
|
Every string is padded to 4 bytes.
|
||||||
|
|
||||||
26: :ref:`PackedVector2Array<class_PackedVector2Array>`
|
26: :ref:`PackedVector2Array<class_PackedVector2Array>`
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
+-------------------+-------+-----------+----------------+
|
+-------------------+-------+-----------+----------------+
|
||||||
| Offset | Len | Type | Description |
|
| Offset | Len | Type | Description |
|
||||||
@@ -575,7 +575,7 @@ Every string is padded to 4 bytes.
|
|||||||
+-------------------+-------+-----------+----------------+
|
+-------------------+-------+-----------+----------------+
|
||||||
|
|
||||||
27: :ref:`PackedVector3Array<class_PackedVector3Array>`
|
27: :ref:`PackedVector3Array<class_PackedVector3Array>`
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
+--------------------+-------+-----------+----------------+
|
+--------------------+-------+-----------+----------------+
|
||||||
| Offset | Len | Type | Description |
|
| Offset | Len | Type | Description |
|
||||||
@@ -590,7 +590,7 @@ Every string is padded to 4 bytes.
|
|||||||
+--------------------+-------+-----------+----------------+
|
+--------------------+-------+-----------+----------------+
|
||||||
|
|
||||||
28: :ref:`PackedColorArray<class_PackedColorArray>`
|
28: :ref:`PackedColorArray<class_PackedColorArray>`
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
+--------------------+-------+-----------+--------------------------------------------------------------+
|
+--------------------+-------+-----------+--------------------------------------------------------------+
|
||||||
| Offset | Len | Type | Description |
|
| Offset | Len | Type | Description |
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ the C# breaking change is *binary compatible* or *source compatible*:
|
|||||||
upgrading Godot.
|
upgrading Godot.
|
||||||
|
|
||||||
Core
|
Core
|
||||||
^^^^
|
~~~~
|
||||||
|
|
||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
||||||
@@ -46,7 +46,7 @@ Method ``wait_for_task_completion`` changes return type from ``void`` to ``Error
|
|||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
|
|
||||||
Animation
|
Animation
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
||||||
@@ -60,7 +60,7 @@ Method ``get_travel_path`` changes return type from ``PackedStringArray`` to ``A
|
|||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
|
|
||||||
2D nodes
|
2D nodes
|
||||||
^^^^^^^^
|
~~~~~~~~
|
||||||
|
|
||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
||||||
@@ -70,7 +70,7 @@ Property ``lookahead`` removed
|
|||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
|
|
||||||
3D nodes
|
3D nodes
|
||||||
^^^^^^^^
|
~~~~~~~~
|
||||||
|
|
||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
||||||
@@ -85,7 +85,7 @@ Method ``look_at_from_position`` adds a new ``use_model_front`` optional paramet
|
|||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
|
|
||||||
GUI nodes
|
GUI nodes
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
||||||
@@ -101,7 +101,7 @@ Method ``edit_selected`` adds a new ``force_edit`` optional parameter
|
|||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
|
|
||||||
Physics
|
Physics
|
||||||
^^^^^^^
|
~~~~~~~
|
||||||
|
|
||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
||||||
@@ -117,7 +117,7 @@ Method ``collide_shape`` changes return type from ``Array[PackedVector3Array]``
|
|||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
|
|
||||||
Rendering
|
Rendering
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
||||||
@@ -133,7 +133,7 @@ Method ``add_triangle_fan`` changes ``tangents`` parameter type from untyped ``A
|
|||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
|
|
||||||
Navigation
|
Navigation
|
||||||
^^^^^^^^^^
|
~~~~~~~~~~
|
||||||
|
|
||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
||||||
@@ -163,7 +163,7 @@ Method ``agent_set_time_horizon`` split into ``agent_set_time_horizon_agents`` a
|
|||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
|
|
||||||
Networking
|
Networking
|
||||||
^^^^^^^^^^
|
~~~~~~~~~~
|
||||||
|
|
||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
||||||
@@ -173,7 +173,7 @@ Method ``_create_data_channel`` changes return type from ``Object`` to ``WebRTCD
|
|||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
|
|
||||||
Editor plugins
|
Editor plugins
|
||||||
^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~
|
||||||
|
|
||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ the C# breaking change is *binary compatible* or *source compatible*:
|
|||||||
upgrading Godot.
|
upgrading Godot.
|
||||||
|
|
||||||
Core
|
Core
|
||||||
^^^^
|
~~~~
|
||||||
|
|
||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
||||||
@@ -59,7 +59,7 @@ Constant ``NOTIFICATION_NODE_RECACHE_REQUESTED`` removed
|
|||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
|
|
||||||
Animation
|
Animation
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
||||||
@@ -111,7 +111,7 @@ Property ``tree_root`` changes type from ``AnimationNode`` to ``AnimationRootNod
|
|||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
|
|
||||||
GUI nodes
|
GUI nodes
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
||||||
@@ -125,7 +125,7 @@ Method ``add_image`` adds new ``key``, ``pad``, ``tooltip``, and ``size_in_perce
|
|||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
|
|
||||||
Rendering
|
Rendering
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
||||||
@@ -147,7 +147,7 @@ Method ``commit`` changes ``flags`` parameter type from ``uint32`` to ``uint64``
|
|||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
|
|
||||||
Text
|
Text
|
||||||
^^^^
|
~~~~
|
||||||
|
|
||||||
==================================================================================================================================== =================== ==================== ==================== ===========
|
==================================================================================================================================== =================== ==================== ==================== ===========
|
||||||
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
||||||
@@ -159,7 +159,7 @@ Method ``find_variation`` adds new ``spacing_top``, ``spacing_bottom``, ``spacin
|
|||||||
==================================================================================================================================== =================== ==================== ==================== ===========
|
==================================================================================================================================== =================== ==================== ==================== ===========
|
||||||
|
|
||||||
GraphEdit
|
GraphEdit
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
||||||
@@ -203,7 +203,7 @@ Property ``text_direction`` removed
|
|||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
|
|
||||||
TileMap
|
TileMap
|
||||||
^^^^^^^
|
~~~~~~~
|
||||||
|
|
||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
||||||
@@ -213,7 +213,7 @@ Property ``cell_quadrant_size`` renamed to ``rendering_quadrant_size``
|
|||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
|
|
||||||
XR
|
XR
|
||||||
^^
|
~~
|
||||||
|
|
||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ the C# breaking change is *binary compatible* or *source compatible*:
|
|||||||
upgrading Godot.
|
upgrading Godot.
|
||||||
|
|
||||||
GDExtension
|
GDExtension
|
||||||
^^^^^^^^^^^
|
~~~~~~~~~~~
|
||||||
|
|
||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
||||||
@@ -36,7 +36,7 @@ Method ``open_library`` removed
|
|||||||
Since it was basically impossible to use these methods in any useful way, these methods have been removed. Use ``GDExtensionManager::load_extension`` and ``GDExtensionManager::unload_extension`` instead to correctly load and unload a GDExtension.
|
Since it was basically impossible to use these methods in any useful way, these methods have been removed. Use ``GDExtensionManager::load_extension`` and ``GDExtensionManager::unload_extension`` instead to correctly load and unload a GDExtension.
|
||||||
|
|
||||||
Animation
|
Animation
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
||||||
@@ -59,7 +59,7 @@ Method ``on_bone_pose_update`` replaced by ``on_skeleton_update``
|
|||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
|
|
||||||
GUI nodes
|
GUI nodes
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
||||||
@@ -70,7 +70,7 @@ Method ``remove_button`` changes parameter ``button`` type from ``Control`` to `
|
|||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
|
|
||||||
Physics
|
Physics
|
||||||
^^^^^^^
|
~~~~~~~
|
||||||
|
|
||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
||||||
@@ -85,7 +85,7 @@ Property ``motion`` changes type from ``Vector2`` to ``Vector3``
|
|||||||
detects the enum prefix. New members were added in `GH-89851`_ to the enum that caused the enum members to be renamed.
|
detects the enum prefix. New members were added in `GH-89851`_ to the enum that caused the enum members to be renamed.
|
||||||
|
|
||||||
Rendering
|
Rendering
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
||||||
@@ -131,7 +131,7 @@ Method ``get_velocity_texture`` adds a new ``msaa`` optional parameter
|
|||||||
renamed.
|
renamed.
|
||||||
|
|
||||||
Text
|
Text
|
||||||
^^^^
|
~~~~
|
||||||
|
|
||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
||||||
@@ -147,7 +147,7 @@ Method ``_shaped_text_get_word_breaks`` adds a new ``skip_grapheme_flags`` param
|
|||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
|
|
||||||
Audio
|
Audio
|
||||||
^^^^^
|
~~~~~
|
||||||
|
|
||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
||||||
@@ -157,7 +157,7 @@ Method ``play_stream`` adds new ``playback_type``, and ``bus`` optional paramete
|
|||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
|
|
||||||
Navigation
|
Navigation
|
||||||
^^^^^^^^^^
|
~~~~~~~~~~
|
||||||
|
|
||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
||||||
@@ -184,7 +184,7 @@ Method ``set_avoidance_layer_value`` removed
|
|||||||
replacement.
|
replacement.
|
||||||
|
|
||||||
TileMap
|
TileMap
|
||||||
^^^^^^^
|
~~~~~~~
|
||||||
|
|
||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
||||||
@@ -195,7 +195,7 @@ Method ``get_occluder`` adds new ``flip_h``, ``flip_v``, and ``transpose`` optio
|
|||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
|
|
||||||
XR
|
XR
|
||||||
^^
|
~~
|
||||||
|
|
||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
||||||
@@ -207,7 +207,7 @@ Method ``get_tracker`` changes return type from ``XRPositionalTracker`` to ``XRT
|
|||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
|
|
||||||
Editor plugins
|
Editor plugins
|
||||||
^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~
|
||||||
|
|
||||||
======================================================================================================================== =================== ==================== ==================== ===========
|
======================================================================================================================== =================== ==================== ==================== ===========
|
||||||
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
|
||||||
@@ -227,7 +227,7 @@ Behavior changes
|
|||||||
In 4.3 some behavior changes have been introduced, which might require you to adjust your project.
|
In 4.3 some behavior changes have been introduced, which might require you to adjust your project.
|
||||||
|
|
||||||
Core
|
Core
|
||||||
^^^^
|
~~~~
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -259,7 +259,7 @@ Core
|
|||||||
of the operating system that the program is running on.
|
of the operating system that the program is running on.
|
||||||
|
|
||||||
Animation
|
Animation
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -277,7 +277,7 @@ More information about the changes to Animation can be found in the
|
|||||||
article.
|
article.
|
||||||
|
|
||||||
GUI nodes
|
GUI nodes
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -291,7 +291,7 @@ GUI nodes
|
|||||||
are children of a node with the ``auto_translate`` property set to ``false``.
|
are children of a node with the ``auto_translate`` property set to ``false``.
|
||||||
|
|
||||||
Multiplayer
|
Multiplayer
|
||||||
^^^^^^^^^^^
|
~~~~~~~~~~~
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -303,7 +303,7 @@ Multiplayer
|
|||||||
Note that high-level multiplayer facilities are only ever meant to be compatible with server and client using the same Godot version. It is recommended to implement some kind of version checking.
|
Note that high-level multiplayer facilities are only ever meant to be compatible with server and client using the same Godot version. It is recommended to implement some kind of version checking.
|
||||||
|
|
||||||
Rendering
|
Rendering
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -318,14 +318,14 @@ Rendering
|
|||||||
article for more information and guidance on how to fix common scenarios.
|
article for more information and guidance on how to fix common scenarios.
|
||||||
|
|
||||||
TileMap
|
TileMap
|
||||||
^^^^^^^
|
~~~~~~~
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
``TileMap`` layers were moved to individual nodes (`GH-87379`_ and `GH-89179`_).
|
``TileMap`` layers were moved to individual nodes (`GH-87379`_ and `GH-89179`_).
|
||||||
|
|
||||||
Android
|
Android
|
||||||
^^^^^^^
|
~~~~~~~
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ Before beginning the upgrade process, it's worth thinking about the advantages
|
|||||||
and disadvantages that upgrading would bring to your project.
|
and disadvantages that upgrading would bring to your project.
|
||||||
|
|
||||||
Advantages of upgrading
|
Advantages of upgrading
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Along with the
|
Along with the
|
||||||
`new features present in 4.0 <https://godotengine.org/article/godot-4-0-sets-sail>`__,
|
`new features present in 4.0 <https://godotengine.org/article/godot-4-0-sets-sail>`__,
|
||||||
@@ -26,7 +26,7 @@ See :ref:`doc_docs_changelog` for a list of pages documenting new features in
|
|||||||
Godot 4.0, and :ref:`doc_list_of_features` for a list of all features in Godot.
|
Godot 4.0, and :ref:`doc_list_of_features` for a list of all features in Godot.
|
||||||
|
|
||||||
Disadvantages of upgrading
|
Disadvantages of upgrading
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
If you don't *need* any features present in Godot 4.0, you may want to stay on
|
If you don't *need* any features present in Godot 4.0, you may want to stay on
|
||||||
Godot 3.x for the following reasons:
|
Godot 3.x for the following reasons:
|
||||||
@@ -61,7 +61,7 @@ Godot 3.x for the following reasons:
|
|||||||
can be used to bypass this limitation, but they're too slow for gaming.
|
can be used to bypass this limitation, but they're too slow for gaming.
|
||||||
|
|
||||||
Caveats of upgrading
|
Caveats of upgrading
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. UPDATE: Planned feature. There are several planned or missing features that
|
.. UPDATE: Planned feature. There are several planned or missing features that
|
||||||
.. may be added back in the future. Check this section for accuracy and update
|
.. may be added back in the future. Check this section for accuracy and update
|
||||||
@@ -119,7 +119,7 @@ Running the project upgrade tool
|
|||||||
folder to another location.
|
folder to another location.
|
||||||
|
|
||||||
Using the Project Manager
|
Using the Project Manager
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
To use the project upgrade tool:
|
To use the project upgrade tool:
|
||||||
|
|
||||||
@@ -143,7 +143,7 @@ you can use the command line to upgrade the project (see below). This will allow
|
|||||||
you to override the converter's size limits.
|
you to override the converter's size limits.
|
||||||
|
|
||||||
Using the command line
|
Using the command line
|
||||||
^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
To use the project upgrade tool from the :ref:`command line <doc_command_line_tutorial>`,
|
To use the project upgrade tool from the :ref:`command line <doc_command_line_tutorial>`,
|
||||||
it's recommended to validate the project conversion by running the Godot editor binary with the following arguments:
|
it's recommended to validate the project conversion by running the Godot editor binary with the following arguments:
|
||||||
@@ -196,7 +196,7 @@ cater to all situations. Therefore, a large part of the upgrade process remains
|
|||||||
manual.
|
manual.
|
||||||
|
|
||||||
Automatically renamed nodes and resources
|
Automatically renamed nodes and resources
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The list below refers to nodes which were simply renamed for consistency or
|
The list below refers to nodes which were simply renamed for consistency or
|
||||||
clarity in Godot 4.0. The project upgrade tool renames them automatically in
|
clarity in Godot 4.0. The project upgrade tool renames them automatically in
|
||||||
@@ -372,7 +372,7 @@ a ``3D`` suffix to the old name:
|
|||||||
.. _doc_upgrading_to_godot_4_manual_rename:
|
.. _doc_upgrading_to_godot_4_manual_rename:
|
||||||
|
|
||||||
Manually renaming methods, properties, signals and constants
|
Manually renaming methods, properties, signals and constants
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Due to how the project upgrade tool works, not all
|
Due to how the project upgrade tool works, not all
|
||||||
:abbr:`API (Application Programming Interface)` renames can be performed automatically.
|
:abbr:`API (Application Programming Interface)` renames can be performed automatically.
|
||||||
@@ -488,7 +488,7 @@ table to find its new name.
|
|||||||
- MainLoop's ``NOTIFICATION_WM_QUIT_REQUEST`` is now ``NOTIFICATION_WM_CLOSE_REQUEST``.
|
- MainLoop's ``NOTIFICATION_WM_QUIT_REQUEST`` is now ``NOTIFICATION_WM_CLOSE_REQUEST``.
|
||||||
|
|
||||||
Checking project settings
|
Checking project settings
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Several project settings were renamed, and some of them had their enums changed
|
Several project settings were renamed, and some of them had their enums changed
|
||||||
in incompatible ways (such as shadow filter quality). This means you may need to
|
in incompatible ways (such as shadow filter quality). This means you may need to
|
||||||
@@ -496,7 +496,7 @@ set some project settings' values again. Make sure the **Advanced** toggle is
|
|||||||
enabled in the project settings dialog so you can see all project settings.
|
enabled in the project settings dialog so you can see all project settings.
|
||||||
|
|
||||||
Checking Environment settings
|
Checking Environment settings
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Graphics quality settings were moved from Environment properties to project
|
Graphics quality settings were moved from Environment properties to project
|
||||||
settings. This was done to make runtime quality adjustments easier, without
|
settings. This was done to make runtime quality adjustments easier, without
|
||||||
@@ -513,7 +513,7 @@ methods that affect environment effects' quality. Only the "base" toggle of each
|
|||||||
environment effect and its visual knobs remain within the Environment resource.
|
environment effect and its visual knobs remain within the Environment resource.
|
||||||
|
|
||||||
Updating shaders
|
Updating shaders
|
||||||
^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
There have been some changes to shaders that aren't covered by the upgrade tool.
|
There have been some changes to shaders that aren't covered by the upgrade tool.
|
||||||
You will need to make some manual changes, especially if your shader uses coordinate
|
You will need to make some manual changes, especially if your shader uses coordinate
|
||||||
@@ -549,7 +549,7 @@ This list is not exhaustive. If you made all the changes mentioned here and your
|
|||||||
shader still doesn't work, try asking for help in one of the `community channels <https://godotengine.org/community/>`__.
|
shader still doesn't work, try asking for help in one of the `community channels <https://godotengine.org/community/>`__.
|
||||||
|
|
||||||
Updating scripts to take backwards-incompatible changes into account
|
Updating scripts to take backwards-incompatible changes into account
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Some changes performed between Godot 3.x and 4 are not renames, but they still
|
Some changes performed between Godot 3.x and 4 are not renames, but they still
|
||||||
break backwards compatibility due to different default behavior.
|
break backwards compatibility due to different default behavior.
|
||||||
@@ -716,7 +716,7 @@ example, the following code snippet in Godot 3.x must be modified to work in 4.0
|
|||||||
for a full list of changes between Godot 3.x and 4.
|
for a full list of changes between Godot 3.x and 4.
|
||||||
|
|
||||||
ArrayMesh resource compatibility breakage
|
ArrayMesh resource compatibility breakage
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
If you've saved an ArrayMesh resource to a ``.res`` or ``.tres`` file, the
|
If you've saved an ArrayMesh resource to a ``.res`` or ``.tres`` file, the
|
||||||
format used in 4.0 is not compatible with the one used in 3.x. You will need to
|
format used in 4.0 is not compatible with the one used in 3.x. You will need to
|
||||||
|
|||||||
@@ -13,14 +13,14 @@ One of Godot's great features is its ability to export to the HTML5/WebAssembly
|
|||||||
This is a great opportunity for both demos and full games, but used to come with some limitations. In the area of networking, browsers used to support only HTTPRequests until recently, when first WebSocket and then WebRTC were proposed as standards.
|
This is a great opportunity for both demos and full games, but used to come with some limitations. In the area of networking, browsers used to support only HTTPRequests until recently, when first WebSocket and then WebRTC were proposed as standards.
|
||||||
|
|
||||||
WebSocket
|
WebSocket
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
When the WebSocket protocol was standardized in December 2011, it allowed browsers to create stable and bidirectional connections to a WebSocket server. The protocol is a very powerful tool to send push notifications to browsers, and has been used to implement chats, turn-based games, etc.
|
When the WebSocket protocol was standardized in December 2011, it allowed browsers to create stable and bidirectional connections to a WebSocket server. The protocol is a very powerful tool to send push notifications to browsers, and has been used to implement chats, turn-based games, etc.
|
||||||
|
|
||||||
WebSockets, though, still use a TCP connection, which is good for reliability but not for latency, so not good for real-time applications like VoIP and fast-paced games.
|
WebSockets, though, still use a TCP connection, which is good for reliability but not for latency, so not good for real-time applications like VoIP and fast-paced games.
|
||||||
|
|
||||||
WebRTC
|
WebRTC
|
||||||
^^^^^^
|
~~~~~~
|
||||||
|
|
||||||
For this reason, since 2010, Google started working on a new technology called WebRTC, which later on, in 2017, became a W3C candidate recommendation. WebRTC is a much more complex set of specifications, and relies on many other technologies behind the scenes (ICE, DTLS, SDP) to provide fast, real-time, and secure communication between two peers.
|
For this reason, since 2010, Google started working on a new technology called WebRTC, which later on, in 2017, became a W3C candidate recommendation. WebRTC is a much more complex set of specifications, and relies on many other technologies behind the scenes (ICE, DTLS, SDP) to provide fast, real-time, and secure communication between two peers.
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ WebRTC is implemented in Godot via two main classes :ref:`WebRTCPeerConnection <
|
|||||||
blocked by Android.
|
blocked by Android.
|
||||||
|
|
||||||
Minimal connection example
|
Minimal connection example
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
This example will show you how to create a WebRTC connection between two peers in the same application.
|
This example will show you how to create a WebRTC connection between two peers in the same application.
|
||||||
This is not very useful in real life, but will give you a good overview of how a WebRTC connection is set up.
|
This is not very useful in real life, but will give you a good overview of how a WebRTC connection is set up.
|
||||||
@@ -105,7 +105,7 @@ This will print:
|
|||||||
P2 received: Hi from P2
|
P2 received: Hi from P2
|
||||||
|
|
||||||
Local signaling example
|
Local signaling example
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
This example expands on the previous one, separating the peers in two different scenes, and using a :ref:`singleton <doc_singletons_autoload>` as a signaling server.
|
This example expands on the previous one, separating the peers in two different scenes, and using a :ref:`singleton <doc_singletons_autoload>` as a signaling server.
|
||||||
|
|
||||||
@@ -220,6 +220,6 @@ This will print something similar to this:
|
|||||||
/root/main/@@2 received: Hi from /root/main/@@3
|
/root/main/@@2 received: Hi from /root/main/@@3
|
||||||
|
|
||||||
Remote signaling with WebSocket
|
Remote signaling with WebSocket
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
A more advanced demo using WebSocket for signaling peers and :ref:`WebRTCMultiplayerPeer <class_WebRTCMultiplayerPeer>` is available in the `godot demo projects <https://github.com/godotengine/godot-demo-projects>`_ under `networking/webrtc_signaling`.
|
A more advanced demo using WebSocket for signaling peers and :ref:`WebRTCMultiplayerPeer <class_WebRTCMultiplayerPeer>` is available in the `godot demo projects <https://github.com/godotengine/godot-demo-projects>`_ under `networking/webrtc_signaling`.
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ details.
|
|||||||
blocked by Android.
|
blocked by Android.
|
||||||
|
|
||||||
Minimal client example
|
Minimal client example
|
||||||
^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
This example will show you how to create a WebSocket connection to a remote server, and how to send and receive data.
|
This example will show you how to create a WebSocket connection to a remote server, and how to send and receive data.
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ This will print something similar to:
|
|||||||
Got data from server: Test packet
|
Got data from server: Test packet
|
||||||
|
|
||||||
Minimal server example
|
Minimal server example
|
||||||
^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
This example will show you how to create a WebSocket server that listens for remote connections, and how to send and receive data.
|
This example will show you how to create a WebSocket server that listens for remote connections, and how to send and receive data.
|
||||||
|
|
||||||
@@ -162,7 +162,7 @@ This will print (when a client connects) something similar to this:
|
|||||||
Got data from client 1348090059: Test packet ... echoing
|
Got data from client 1348090059: Test packet ... echoing
|
||||||
|
|
||||||
Advanced chat demo
|
Advanced chat demo
|
||||||
^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
A more advanced chat demo which optionally uses the multiplayer mid-level
|
A more advanced chat demo which optionally uses the multiplayer mid-level
|
||||||
abstraction and a high-level multiplayer demo are available in the
|
abstraction and a high-level multiplayer demo are available in the
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ language you choose. If your project is making a lot of calculations in its own
|
|||||||
code, consider moving those calculations to a faster language.
|
code, consider moving those calculations to a faster language.
|
||||||
|
|
||||||
GDScript
|
GDScript
|
||||||
^^^^^^^^
|
~~~~~~~~
|
||||||
|
|
||||||
:ref:`GDScript <toc-learn-scripting-gdscript>` is designed to be easy to use and iterate,
|
:ref:`GDScript <toc-learn-scripting-gdscript>` is designed to be easy to use and iterate,
|
||||||
and is ideal for making many types of games. However, in this language, ease of
|
and is ideal for making many types of games. However, in this language, ease of
|
||||||
@@ -177,7 +177,7 @@ calculations, consider moving some of your project to one of the other
|
|||||||
languages.
|
languages.
|
||||||
|
|
||||||
C#
|
C#
|
||||||
^^
|
~~
|
||||||
|
|
||||||
:ref:`C# <toc-learn-scripting-C#>` is popular and has first-class support in Godot. It
|
:ref:`C# <toc-learn-scripting-C#>` is popular and has first-class support in Godot. It
|
||||||
offers a good compromise between speed and ease of use. Beware of possible
|
offers a good compromise between speed and ease of use. Beware of possible
|
||||||
@@ -186,13 +186,13 @@ common approach to workaround issues with garbage collection is to use *object
|
|||||||
pooling*, which is outside the scope of this guide.
|
pooling*, which is outside the scope of this guide.
|
||||||
|
|
||||||
Other languages
|
Other languages
|
||||||
^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Third parties provide support for several other languages, including `Rust
|
Third parties provide support for several other languages, including `Rust
|
||||||
<https://github.com/godot-rust/gdext>`_.
|
<https://github.com/godot-rust/gdext>`_.
|
||||||
|
|
||||||
C++
|
C++
|
||||||
^^^
|
~~~
|
||||||
|
|
||||||
Godot is written in C++. Using C++ will usually result in the fastest code.
|
Godot is written in C++. Using C++ will usually result in the fastest code.
|
||||||
However, on a practical level, it is the most difficult to deploy to end users'
|
However, on a practical level, it is the most difficult to deploy to end users'
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ To achieve the best results, we have two approaches:
|
|||||||
And preferably, we will use a blend of the two.
|
And preferably, we will use a blend of the two.
|
||||||
|
|
||||||
Smoke and mirrors
|
Smoke and mirrors
|
||||||
^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Part of working smarter is recognizing that, in games, we can often get the
|
Part of working smarter is recognizing that, in games, we can often get the
|
||||||
player to believe they're in a world that is far more complex, interactive, and
|
player to believe they're in a world that is far more complex, interactive, and
|
||||||
@@ -31,7 +31,7 @@ graphically exciting than it really is. A good programmer is a magician, and
|
|||||||
should strive to learn the tricks of the trade while trying to invent new ones.
|
should strive to learn the tricks of the trade while trying to invent new ones.
|
||||||
|
|
||||||
The nature of slowness
|
The nature of slowness
|
||||||
^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
To the outside observer, performance problems are often lumped together.
|
To the outside observer, performance problems are often lumped together.
|
||||||
But in reality, there are several different kinds of performance problems:
|
But in reality, there are several different kinds of performance problems:
|
||||||
@@ -73,7 +73,7 @@ different hardware. It's often a good idea to measure timings on more than one
|
|||||||
device. This is especially the case if you're targeting mobile devices.
|
device. This is especially the case if you're targeting mobile devices.
|
||||||
|
|
||||||
Limitations
|
Limitations
|
||||||
^^^^^^^^^^^
|
~~~~~~~~~~~
|
||||||
|
|
||||||
CPU profilers are often the go-to method for measuring performance. However,
|
CPU profilers are often the go-to method for measuring performance. However,
|
||||||
they don't always tell the whole story.
|
they don't always tell the whole story.
|
||||||
@@ -98,7 +98,7 @@ and also in terms of bug fixing). This can include hypothesis testing, and
|
|||||||
binary search.
|
binary search.
|
||||||
|
|
||||||
Hypothesis testing
|
Hypothesis testing
|
||||||
^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Say, for example, that you believe sprites are slowing down your game.
|
Say, for example, that you believe sprites are slowing down your game.
|
||||||
You can test this hypothesis by:
|
You can test this hypothesis by:
|
||||||
@@ -112,7 +112,7 @@ the performance drop?
|
|||||||
size, and measuring performance.
|
size, and measuring performance.
|
||||||
|
|
||||||
Binary search
|
Binary search
|
||||||
^^^^^^^^^^^^^
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
If you know that frames are taking much longer than they should, but you're
|
If you know that frames are taking much longer than they should, but you're
|
||||||
not sure where the bottleneck lies. You could begin by commenting out
|
not sure where the bottleneck lies. You could begin by commenting out
|
||||||
@@ -167,7 +167,7 @@ optimization is (by definition) undesirable, performant software is the result
|
|||||||
of performant design.
|
of performant design.
|
||||||
|
|
||||||
Performant design
|
Performant design
|
||||||
^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The danger with encouraging people to ignore optimization until necessary, is
|
The danger with encouraging people to ignore optimization until necessary, is
|
||||||
that it conveniently ignores that the most important time to consider
|
that it conveniently ignores that the most important time to consider
|
||||||
@@ -182,7 +182,7 @@ will often run many times faster than a mediocre design with low-level
|
|||||||
optimization.
|
optimization.
|
||||||
|
|
||||||
Incremental design
|
Incremental design
|
||||||
^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Of course, in practice, unless you have prior knowledge, you are unlikely to
|
Of course, in practice, unless you have prior knowledge, you are unlikely to
|
||||||
come up with the best design the first time. Instead, you'll often make a series
|
come up with the best design the first time. Instead, you'll often make a series
|
||||||
@@ -199,7 +199,7 @@ structures and algorithms for *cache locality* of data and linear access, rather
|
|||||||
than jumping around in memory.
|
than jumping around in memory.
|
||||||
|
|
||||||
The optimization process
|
The optimization process
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Assuming we have a reasonable design, and taking our lessons from Knuth, our
|
Assuming we have a reasonable design, and taking our lessons from Knuth, our
|
||||||
first step in optimization should be to identify the biggest bottlenecks - the
|
first step in optimization should be to identify the biggest bottlenecks - the
|
||||||
@@ -216,7 +216,7 @@ The process is thus:
|
|||||||
3. Return to step 1.
|
3. Return to step 1.
|
||||||
|
|
||||||
Optimizing bottlenecks
|
Optimizing bottlenecks
|
||||||
^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Some profilers will even tell you which part of a function (which data accesses,
|
Some profilers will even tell you which part of a function (which data accesses,
|
||||||
calculations) are slowing things down.
|
calculations) are slowing things down.
|
||||||
@@ -244,7 +244,7 @@ Appendix
|
|||||||
--------
|
--------
|
||||||
|
|
||||||
Bottleneck math
|
Bottleneck math
|
||||||
^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The proverb *"a chain is only as strong as its weakest link"* applies directly to
|
The proverb *"a chain is only as strong as its weakest link"* applies directly to
|
||||||
performance optimization. If your project is spending 90% of the time in
|
performance optimization. If your project is spending 90% of the time in
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ as much as possible so they can be rendered together, or with the minimum number
|
|||||||
of these expensive state changes.
|
of these expensive state changes.
|
||||||
|
|
||||||
2D batching
|
2D batching
|
||||||
^^^^^^^^^^^
|
~~~~~~~~~~~
|
||||||
|
|
||||||
In 2D, the costs of treating each item individually can be prohibitively high -
|
In 2D, the costs of treating each item individually can be prohibitively high -
|
||||||
there can easily be thousands of them on the screen. This is why 2D *batching*
|
there can easily be thousands of them on the screen. This is why 2D *batching*
|
||||||
@@ -56,7 +56,7 @@ much cheaper with Vulkan compared to OpenGL, there is less of a need to have 2D
|
|||||||
batching (although it can still be beneficial in some cases).
|
batching (although it can still be beneficial in some cases).
|
||||||
|
|
||||||
3D batching
|
3D batching
|
||||||
^^^^^^^^^^^
|
~~~~~~~~~~~
|
||||||
|
|
||||||
In 3D, we still aim to minimize draw calls and state changes. However, it can be
|
In 3D, we still aim to minimize draw calls and state changes. However, it can be
|
||||||
more difficult to batch together several objects into a single draw call. 3D
|
more difficult to batch together several objects into a single draw call. 3D
|
||||||
@@ -78,7 +78,7 @@ For more information on 3D specific optimizations, see
|
|||||||
:ref:`doc_optimizing_3d_performance`.
|
:ref:`doc_optimizing_3d_performance`.
|
||||||
|
|
||||||
Reuse shaders and materials
|
Reuse shaders and materials
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The Godot renderer is a little different to what is out there. It's designed to
|
The Godot renderer is a little different to what is out there. It's designed to
|
||||||
minimize GPU state changes as much as possible. :ref:`StandardMaterial3D
|
minimize GPU state changes as much as possible. :ref:`StandardMaterial3D
|
||||||
@@ -192,7 +192,7 @@ their material to decrease the shading cost.
|
|||||||
you can reasonably afford to use.**
|
you can reasonably afford to use.**
|
||||||
|
|
||||||
Reading textures
|
Reading textures
|
||||||
^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The other factor in fragment shaders is the cost of reading textures. Reading
|
The other factor in fragment shaders is the cost of reading textures. Reading
|
||||||
textures is an expensive operation, especially when reading from several
|
textures is an expensive operation, especially when reading from several
|
||||||
@@ -205,7 +205,7 @@ mobiles.
|
|||||||
algorithms that require as few texture reads as possible.**
|
algorithms that require as few texture reads as possible.**
|
||||||
|
|
||||||
Texture compression
|
Texture compression
|
||||||
^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
By default, Godot compresses textures of 3D models when imported using video RAM
|
By default, Godot compresses textures of 3D models when imported using video RAM
|
||||||
(VRAM) compression. Video RAM compression isn't as efficient in size as PNG or
|
(VRAM) compression. Video RAM compression isn't as efficient in size as PNG or
|
||||||
@@ -230,7 +230,7 @@ textures with transparency (only opaque), so keep this in mind.
|
|||||||
significantly due to their low resolution.
|
significantly due to their low resolution.
|
||||||
|
|
||||||
Post-processing and shadows
|
Post-processing and shadows
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Post-processing effects and shadows can also be expensive in terms of fragment
|
Post-processing effects and shadows can also be expensive in terms of fragment
|
||||||
shading activity. Always test the impact of these on different hardware.
|
shading activity. Always test the impact of these on different hardware.
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ take place in a small area, however things can quickly become problematic in
|
|||||||
larger levels.
|
larger levels.
|
||||||
|
|
||||||
Occlusion culling
|
Occlusion culling
|
||||||
^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Walking around a town for example, you may only be able to see a few buildings
|
Walking around a town for example, you may only be able to see a few buildings
|
||||||
in the street you are in, as well as the sky and a few birds flying overhead. As
|
in the street you are in, as well as the sky and a few birds flying overhead. As
|
||||||
@@ -85,7 +85,7 @@ Visibility ranges are also a good way to set up *impostors* for distant geometry
|
|||||||
(see below).
|
(see below).
|
||||||
|
|
||||||
Billboards and imposters
|
Billboards and imposters
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The simplest version of using transparency to deal with LOD is billboards. For
|
The simplest version of using transparency to deal with LOD is billboards. For
|
||||||
example, you can use a single transparent quad to represent a tree at distance.
|
example, you can use a single transparent quad to represent a tree at distance.
|
||||||
@@ -105,7 +105,7 @@ significantly. This can be complex to get working, but may be worth it depending
|
|||||||
on the type of project you are making.
|
on the type of project you are making.
|
||||||
|
|
||||||
Use instancing (MultiMesh)
|
Use instancing (MultiMesh)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
If several identical objects have to be drawn in the same place or nearby, try
|
If several identical objects have to be drawn in the same place or nearby, try
|
||||||
using :ref:`MultiMesh <class_MultiMesh>` instead. MultiMesh allows the drawing
|
using :ref:`MultiMesh <class_MultiMesh>` instead. MultiMesh allows the drawing
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ What can we do about frames and ticks being out of sync?
|
|||||||
--------------------------------------------------------
|
--------------------------------------------------------
|
||||||
|
|
||||||
Lock the tick / frame rate together?
|
Lock the tick / frame rate together?
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The most obvious solution is to get rid of the problem, by ensuring there is a
|
The most obvious solution is to get rid of the problem, by ensuring there is a
|
||||||
physics tick that coincides with every frame. This used to be the approach on old
|
physics tick that coincides with every frame. This used to be the approach on old
|
||||||
@@ -57,7 +57,7 @@ huge variations in performance, as well as different monitor refresh rates. We n
|
|||||||
to come up with a better way of dealing with the problem.
|
to come up with a better way of dealing with the problem.
|
||||||
|
|
||||||
Adapt the tick rate?
|
Adapt the tick rate?
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Instead of designing the game at a fixed physics tick rate, we could allow the tick
|
Instead of designing the game at a fixed physics tick rate, we could allow the tick
|
||||||
rate to scale according to the end users hardware. We could for example use a fixed
|
rate to scale according to the end users hardware. We could for example use a fixed
|
||||||
@@ -79,7 +79,7 @@ problematic for multiplayer games for competitive integrity, as running the game
|
|||||||
certain tick rates may be more advantageous than others.
|
certain tick rates may be more advantageous than others.
|
||||||
|
|
||||||
Lock the tick rate, but use interpolation to smooth frames in between physics ticks
|
Lock the tick rate, but use interpolation to smooth frames in between physics ticks
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
This has become one of the most popular approaches to deal with the problem,
|
This has become one of the most popular approaches to deal with the problem,
|
||||||
although it is optional and disabled by default.
|
although it is optional and disabled by default.
|
||||||
@@ -104,7 +104,7 @@ our ideal world of smooth continuous movement.
|
|||||||
.. image:: img/fti_graph_interpolated.webp
|
.. image:: img/fti_graph_interpolated.webp
|
||||||
|
|
||||||
Linear interpolation
|
Linear interpolation
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The simplest way to achieve this is linear interpolation, or lerping, which you may
|
The simplest way to achieve this is linear interpolation, or lerping, which you may
|
||||||
have used before.
|
have used before.
|
||||||
@@ -119,7 +119,7 @@ is 30 units.
|
|||||||
the easiest in terms of explanation.
|
the easiest in terms of explanation.
|
||||||
|
|
||||||
The physics interpolation fraction
|
The physics interpolation fraction
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
If our physics ticks are happening 10 times per second (for this example), what
|
If our physics ticks are happening 10 times per second (for this example), what
|
||||||
happens if our rendered frame takes place at time 0.12 seconds? We can do some math
|
happens if our rendered frame takes place at time 0.12 seconds? We can do some math
|
||||||
@@ -140,7 +140,7 @@ This is called the **physics interpolation fraction**, and is handily calculated
|
|||||||
for you by Godot. It can be retrieved on any frame by calling :ref:`Engine.get_physics_interpolation_fraction<class_Engine_method_get_physics_interpolation_fraction>`.
|
for you by Godot. It can be retrieved on any frame by calling :ref:`Engine.get_physics_interpolation_fraction<class_Engine_method_get_physics_interpolation_fraction>`.
|
||||||
|
|
||||||
Calculating the interpolated position
|
Calculating the interpolated position
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Once we have the interpolation fraction, we can insert it into a standard linear
|
Once we have the interpolation fraction, we can insert it into a standard linear
|
||||||
interpolation equation. The X coordinate would thus be:
|
interpolation equation. The X coordinate would thus be:
|
||||||
@@ -171,7 +171,7 @@ Let's break that down:
|
|||||||
the details as Godot will do all this for you.
|
the details as Godot will do all this for you.
|
||||||
|
|
||||||
Smoothed transformations between physics ticks?
|
Smoothed transformations between physics ticks?
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Putting all this together shows that it should be possible to have a nice smooth
|
Putting all this together shows that it should be possible to have a nice smooth
|
||||||
estimation of the transform of objects between the current and previous physics
|
estimation of the transform of objects between the current and previous physics
|
||||||
@@ -183,7 +183,7 @@ we are estimating the position of the object in the past. To be exact, we are
|
|||||||
estimating the position of the object *between 1 and 2 ticks* into the past.
|
estimating the position of the object *between 1 and 2 ticks* into the past.
|
||||||
|
|
||||||
In the past
|
In the past
|
||||||
^^^^^^^^^^^
|
~~~~~~~~~~~
|
||||||
|
|
||||||
What does this mean? This scheme does work, but it does mean we are effectively
|
What does this mean? This scheme does work, but it does mean we are effectively
|
||||||
introducing a delay between what we see on the screen, and where the objects
|
introducing a delay between what we see on the screen, and where the objects
|
||||||
@@ -197,7 +197,7 @@ input situations, you may wish to turn off physics interpolation and use a
|
|||||||
different scheme, or use a high tick rate, which mitigates these delays.
|
different scheme, or use a high tick rate, which mitigates these delays.
|
||||||
|
|
||||||
Why look into the past? Why not predict the future?
|
Why look into the past? Why not predict the future?
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
There is an alternative to this scheme, which is: instead of interpolating between
|
There is an alternative to this scheme, which is: instead of interpolating between
|
||||||
the previous and current tick, we use maths to *extrapolate* into the future. We
|
the previous and current tick, we use maths to *extrapolate* into the future. We
|
||||||
@@ -215,7 +215,7 @@ significant downsides:
|
|||||||
the corrected path. This can be visually jarring.
|
the corrected path. This can be visually jarring.
|
||||||
|
|
||||||
Fixed timestep interpolation
|
Fixed timestep interpolation
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
In Godot this whole system is referred to as physics interpolation, but you may
|
In Godot this whole system is referred to as physics interpolation, but you may
|
||||||
also hear it referred to as **"fixed timestep interpolation"**, as it is
|
also hear it referred to as **"fixed timestep interpolation"**, as it is
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ double-precision builds and vice versa. Text-based resources don't store a
|
|||||||
double-precision flag, as they don't require such a flag for correct reading.
|
double-precision flag, as they don't require such a flag for correct reading.
|
||||||
|
|
||||||
Known incompatibilities
|
Known incompatibilities
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
- In a networked multiplayer game, the server and all clients should be using
|
- In a networked multiplayer game, the server and all clients should be using
|
||||||
the same build type to ensure precision remains consistent across clients.
|
the same build type to ensure precision remains consistent across clients.
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ Usage
|
|||||||
-----
|
-----
|
||||||
|
|
||||||
Getting started
|
Getting started
|
||||||
***************
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Make sure you have enabled and successfully set up :ref:`Android Gradle Builds <doc_android_gradle_build>`.
|
Make sure you have enabled and successfully set up :ref:`Android Gradle Builds <doc_android_gradle_build>`.
|
||||||
Follow the compiling instructions on the ``GodotGooglePlayBilling`` `github page <https://github.com/godotengine/godot-google-play-billing>`__.
|
Follow the compiling instructions on the ``GodotGooglePlayBilling`` `github page <https://github.com/godotengine/godot-google-play-billing>`__.
|
||||||
@@ -21,7 +21,7 @@ The plugin should now show up in the Android export settings, where you can enab
|
|||||||
|
|
||||||
|
|
||||||
Initialize the plugin
|
Initialize the plugin
|
||||||
*********************
|
~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
To use the ``GodotGooglePlayBilling`` API:
|
To use the ``GodotGooglePlayBilling`` API:
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ Return values for ``getConnectionState()``:
|
|||||||
|
|
||||||
|
|
||||||
Query available items
|
Query available items
|
||||||
*********************
|
~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Once the API has connected, query SKUs using ``querySkuDetails()``. You must successfully complete
|
Once the API has connected, query SKUs using ``querySkuDetails()``. You must successfully complete
|
||||||
an SKU query before calling the ``purchase()`` or ``queryPurchases()`` functions,
|
an SKU query before calling the ``purchase()`` or ``queryPurchases()`` functions,
|
||||||
@@ -106,7 +106,7 @@ Example use of ``querySkuDetails()``:
|
|||||||
|
|
||||||
|
|
||||||
Query user purchases
|
Query user purchases
|
||||||
********************
|
~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
To retrieve a user's purchases, call the ``queryPurchases()`` function passing
|
To retrieve a user's purchases, call the ``queryPurchases()`` function passing
|
||||||
a string with the type of SKU to query. The SKU type string should be
|
a string with the type of SKU to query. The SKU type string should be
|
||||||
@@ -153,7 +153,7 @@ For more information on processing the purchase items returned by
|
|||||||
|
|
||||||
|
|
||||||
Purchase an item
|
Purchase an item
|
||||||
****************
|
~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
To initiate the purchase flow for an item, call ``purchase()`` passing the
|
To initiate the purchase flow for an item, call ``purchase()`` passing the
|
||||||
product id string of the SKU you wish to purchase.
|
product id string of the SKU you wish to purchase.
|
||||||
@@ -181,7 +181,7 @@ The payment flow will send a ``purchases_updated`` signal on success or a
|
|||||||
|
|
||||||
|
|
||||||
Processing a purchase item
|
Processing a purchase item
|
||||||
**************************
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The ``query_purchases_response`` and ``purchases_updated`` signals provide an array
|
The ``query_purchases_response`` and ``purchases_updated`` signals provide an array
|
||||||
of purchases in :ref:`Dictionary <class_Dictionary>` format. The purchase Dictionary
|
of purchases in :ref:`Dictionary <class_Dictionary>` format. The purchase Dictionary
|
||||||
@@ -210,7 +210,7 @@ Purchase fields:
|
|||||||
|
|
||||||
|
|
||||||
Check purchase state
|
Check purchase state
|
||||||
********************
|
~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Check the ``purchase_state`` value of a purchase to determine if a
|
Check the ``purchase_state`` value of a purchase to determine if a
|
||||||
purchase was completed or is still pending.
|
purchase was completed or is still pending.
|
||||||
@@ -237,7 +237,7 @@ in the Google Play Billing Library documentation.
|
|||||||
|
|
||||||
|
|
||||||
Consumables
|
Consumables
|
||||||
***********
|
~~~~~~~~~~~
|
||||||
|
|
||||||
If your in-app item is not a one-time purchase but a consumable item (e.g. coins) which can be purchased
|
If your in-app item is not a one-time purchase but a consumable item (e.g. coins) which can be purchased
|
||||||
multiple times, you can consume an item by calling ``consumePurchase()`` passing
|
multiple times, you can consume an item by calling ``consumePurchase()`` passing
|
||||||
@@ -271,7 +271,7 @@ Example use of ``consumePurchase()``:
|
|||||||
|
|
||||||
|
|
||||||
Acknowledging purchases
|
Acknowledging purchases
|
||||||
***********************
|
~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
If your in-app item is a one-time purchase, you must acknowledge the purchase by
|
If your in-app item is a one-time purchase, you must acknowledge the purchase by
|
||||||
calling the ``acknowledgePurchase()`` function, passing the ``purchase_token``
|
calling the ``acknowledgePurchase()`` function, passing the ``purchase_token``
|
||||||
@@ -307,7 +307,7 @@ Example use of ``acknowledgePurchase()``:
|
|||||||
|
|
||||||
|
|
||||||
Subscriptions
|
Subscriptions
|
||||||
*************
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
Subscriptions work mostly like regular in-app items. Use ``"subs"`` as the second
|
Subscriptions work mostly like regular in-app items. Use ``"subs"`` as the second
|
||||||
argument to ``querySkuDetails()`` to get subscription details. Pass ``"subs"``
|
argument to ``querySkuDetails()`` to get subscription details. Pass ``"subs"``
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ Below we break-down the steps used to create the GLTF Viewer app.
|
|||||||
- By declaring that the Activity will handle these configuration events using the `android:configChanges attribute <https://developer.android.com/guide/topics/manifest/activity-element#config>`_.
|
- By declaring that the Activity will handle these configuration events using the `android:configChanges attribute <https://developer.android.com/guide/topics/manifest/activity-element#config>`_.
|
||||||
|
|
||||||
1. Create the Android app
|
1. Create the Android app
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -167,7 +167,7 @@ Below we break-down the steps used to create the GLTF Viewer app.
|
|||||||
|
|
||||||
|
|
||||||
2. Create the Godot project
|
2. Create the Godot project
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -228,7 +228,7 @@ Below we break-down the steps used to create the GLTF Viewer app.
|
|||||||
|
|
||||||
|
|
||||||
3. Build and run the app
|
3. Build and run the app
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Once you complete configuration of your Godot project, build and run the Android app.
|
Once you complete configuration of your Godot project, build and run the Android app.
|
||||||
If set up correctly, the host Activity will initialize the embedded Godot Engine on startup.
|
If set up correctly, the host Activity will initialize the embedded Godot Engine on startup.
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ Starting in Godot 4.2, Android plugins built on the v1 architecture are now depr
|
|||||||
Instead, Godot 4.2 introduces a new **Version 2 (v2)** architecture for Android plugins.
|
Instead, Godot 4.2 introduces a new **Version 2 (v2)** architecture for Android plugins.
|
||||||
|
|
||||||
v2 Architecture
|
v2 Architecture
|
||||||
^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ which is provided by the :ref:`Godot Android library <doc_android_library>`.
|
|||||||
The ``GodotPlugin`` class provides APIs to access the running Godot instance and hook into its lifecycle. It is loaded at runtime by the Godot engine.
|
The ``GodotPlugin`` class provides APIs to access the running Godot instance and hook into its lifecycle. It is loaded at runtime by the Godot engine.
|
||||||
|
|
||||||
v2 Packaging format
|
v2 Packaging format
|
||||||
^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
v1 Android plugins required a custom ``gdap`` configuration file that was used by the Godot Editor to detect and load them.
|
v1 Android plugins required a custom ``gdap`` configuration file that was used by the Godot Editor to detect and load them.
|
||||||
However this approach had several drawbacks, primary ones being that it lacked flexibility and departed from the `existing
|
However this approach had several drawbacks, primary ones being that it lacked flexibility and departed from the `existing
|
||||||
@@ -106,7 +106,7 @@ To provide further understanding, here is a break-down of the steps used to crea
|
|||||||
|
|
||||||
|
|
||||||
Building a v2 Android plugin with GDExtension capabilities
|
Building a v2 Android plugin with GDExtension capabilities
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Similar to GDNative support in v1 Android plugins, v2 Android plugins support the ability to integrate GDExtension capabilities.
|
Similar to GDNative support in v1 Android plugins, v2 Android plugins support the ability to integrate GDExtension capabilities.
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ to set up your own Godot Android plugin project.
|
|||||||
|
|
||||||
|
|
||||||
Migrating a v1 Android plugin to v2
|
Migrating a v1 Android plugin to v2
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Use the following steps if you have a v1 Android plugin you want to migrate to v2:
|
Use the following steps if you have a v1 Android plugin you want to migrate to v2:
|
||||||
|
|
||||||
@@ -229,7 +229,7 @@ At build time, the contents of the ``export_scripts_template`` directory as well
|
|||||||
|
|
||||||
|
|
||||||
Packaging a v2 Android plugin with GDExtension capabilities
|
Packaging a v2 Android plugin with GDExtension capabilities
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
For GDExtension, we follow the same steps as for `Packaging a v2 Android plugin`_ and add the `GDExtension config file <https://docs.godotengine.org/en/stable/tutorials/scripting/gdextension/gdextension_cpp_example.html#using-the-gdextension-module>`_ in
|
For GDExtension, we follow the same steps as for `Packaging a v2 Android plugin`_ and add the `GDExtension config file <https://docs.godotengine.org/en/stable/tutorials/scripting/gdextension/gdextension_cpp_example.html#using-the-gdextension-module>`_ in
|
||||||
the same location as ``plugin.cfg``.
|
the same location as ``plugin.cfg``.
|
||||||
@@ -308,7 +308,7 @@ Using a v2 Android plugin
|
|||||||
|
|
||||||
|
|
||||||
Using a v2 Android plugin as an Android library
|
Using a v2 Android plugin as an Android library
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Since they are also Android libraries, Godot v2 Android plugins can be stripped from their ``EditorExportPlugin`` packaging and provided as raw ``AAR`` binaries for use as libraries alongside the :ref:`Godot Android library <doc_android_library>` by Android apps.
|
Since they are also Android libraries, Godot v2 Android plugins can be stripped from their ``EditorExportPlugin`` packaging and provided as raw ``AAR`` binaries for use as libraries alongside the :ref:`Godot Android library <doc_android_library>` by Android apps.
|
||||||
|
|
||||||
@@ -327,7 +327,7 @@ Tips and Guidelines
|
|||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
Simplify access to the exposed Java / Kotlin APIs
|
Simplify access to the exposed Java / Kotlin APIs
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
To make it easier to access the exposed Java / Kotlin APIs in the Godot Editor, it's recommended to
|
To make it easier to access the exposed Java / Kotlin APIs in the Godot Editor, it's recommended to
|
||||||
provide one (or multiple) gdscript wrapper class(es) for your plugin users to interface with.
|
provide one (or multiple) gdscript wrapper class(es) for your plugin users to interface with.
|
||||||
@@ -355,7 +355,7 @@ For example::
|
|||||||
printerr("Initialization error")
|
printerr("Initialization error")
|
||||||
|
|
||||||
Support using the GDExtension functionality in the Godot Editor
|
Support using the GDExtension functionality in the Godot Editor
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
If planning to use the GDExtension functionality in the Godot Editor, it is recommended that the
|
If planning to use the GDExtension functionality in the Godot Editor, it is recommended that the
|
||||||
GDExtension's native binaries are compiled not just for Android, but also for the OS onto which
|
GDExtension's native binaries are compiled not just for Android, but also for the OS onto which
|
||||||
@@ -367,7 +367,7 @@ editor. You can use the `godot-cpp-template <https://github.com/godotengine/godo
|
|||||||
github template for reference on how to do so.
|
github template for reference on how to do so.
|
||||||
|
|
||||||
Godot crashes upon load
|
Godot crashes upon load
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. UPDATE: Not supported yet. When more complex datatypes are supported,
|
.. UPDATE: Not supported yet. When more complex datatypes are supported,
|
||||||
.. update this section.
|
.. update this section.
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ settings, this is already part of the exported HTML page. To understand practica
|
|||||||
see :ref:`Custom HTML page for Web export <doc_customizing_html5_shell>`.
|
see :ref:`Custom HTML page for Web export <doc_customizing_html5_shell>`.
|
||||||
|
|
||||||
Static Methods
|
Static Methods
|
||||||
^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~
|
||||||
|
|
||||||
+---------+-----------------------------------------------------------------------------------------------+
|
+---------+-----------------------------------------------------------------------------------------------+
|
||||||
| Promise | :js:attr:`load <Engine.load>` **(** string basePath **)** |
|
| Promise | :js:attr:`load <Engine.load>` **(** string basePath **)** |
|
||||||
@@ -30,7 +30,7 @@ Static Methods
|
|||||||
+---------+-----------------------------------------------------------------------------------------------+
|
+---------+-----------------------------------------------------------------------------------------------+
|
||||||
|
|
||||||
Instance Methods
|
Instance Methods
|
||||||
^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
+---------+---------------------------------------------------------------------------------------------------------------+
|
+---------+---------------------------------------------------------------------------------------------------------------+
|
||||||
| Promise | :js:attr:`init <Engine.prototype.init>` **(** *[ string basePath ]* **)** |
|
| Promise | :js:attr:`init <Engine.prototype.init>` **(** *[ string basePath ]* **)** |
|
||||||
@@ -183,7 +183,7 @@ An object used to configure the Engine instance based on godot export options, a
|
|||||||
templates if needed.
|
templates if needed.
|
||||||
|
|
||||||
Properties
|
Properties
|
||||||
^^^^^^^^^^
|
~~~~~~~~~~
|
||||||
|
|
||||||
+-------------------+-------------------------------+
|
+-------------------+-------------------------------+
|
||||||
| type | name |
|
| type | name |
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ Making plugins
|
|||||||
==============
|
==============
|
||||||
|
|
||||||
About plugins
|
About plugins
|
||||||
~~~~~~~~~~~~~
|
-------------
|
||||||
|
|
||||||
A plugin is a great way to extend the editor with useful tools. It can be made
|
A plugin is a great way to extend the editor with useful tools. It can be made
|
||||||
entirely with GDScript and standard scenes, without even reloading the editor.
|
entirely with GDScript and standard scenes, without even reloading the editor.
|
||||||
@@ -19,7 +19,7 @@ is a custom node that you can add to any scene in the project, and the
|
|||||||
other is a custom dock added to the editor.
|
other is a custom dock added to the editor.
|
||||||
|
|
||||||
Creating a plugin
|
Creating a plugin
|
||||||
~~~~~~~~~~~~~~~~~
|
-----------------
|
||||||
|
|
||||||
Before starting, create a new empty project wherever you want. This will serve
|
Before starting, create a new empty project wherever you want. This will serve
|
||||||
as a base to develop and test the plugins.
|
as a base to develop and test the plugins.
|
||||||
@@ -86,7 +86,7 @@ The main script file will instruct Godot what your plugin does in the editor
|
|||||||
once it is active.
|
once it is active.
|
||||||
|
|
||||||
The script file
|
The script file
|
||||||
^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Upon creation of the plugin, the dialog will automatically open the
|
Upon creation of the plugin, the dialog will automatically open the
|
||||||
EditorPlugin script for you. The script has two requirements that you cannot
|
EditorPlugin script for you. The script has two requirements that you cannot
|
||||||
@@ -146,7 +146,7 @@ like this:
|
|||||||
This is a good template to use when creating new plugins.
|
This is a good template to use when creating new plugins.
|
||||||
|
|
||||||
A custom node
|
A custom node
|
||||||
~~~~~~~~~~~~~
|
-------------
|
||||||
|
|
||||||
Sometimes you want a certain behavior in many nodes, such as a custom scene
|
Sometimes you want a certain behavior in many nodes, such as a custom scene
|
||||||
or control that can be reused. Instancing is helpful in a lot of cases, but
|
or control that can be reused. Instancing is helpful in a lot of cases, but
|
||||||
@@ -282,7 +282,7 @@ click the button, you can see some text in the console:
|
|||||||
.. image:: img/making_plugins-custom_node_console.webp
|
.. image:: img/making_plugins-custom_node_console.webp
|
||||||
|
|
||||||
A custom dock
|
A custom dock
|
||||||
~~~~~~~~~~~~~
|
-------------
|
||||||
|
|
||||||
Sometimes, you need to extend the editor and add tools that are always available.
|
Sometimes, you need to extend the editor and add tools that are always available.
|
||||||
An easy way to do it is to add a new dock with a plugin. Docks are just scenes
|
An easy way to do it is to add a new dock with a plugin. Docks are just scenes
|
||||||
@@ -398,7 +398,7 @@ Note that, while the dock will initially appear at its specified position,
|
|||||||
the user can freely change its position and save the resulting layout.
|
the user can freely change its position and save the resulting layout.
|
||||||
|
|
||||||
Checking the results
|
Checking the results
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
It's now time to check the results of your work. Open the **Project
|
It's now time to check the results of your work. Open the **Project
|
||||||
Settings** and click on the **Plugins** tab. Your plugin should be the only one
|
Settings** and click on the **Plugins** tab. Your plugin should be the only one
|
||||||
@@ -416,7 +416,7 @@ the settings window. You should now have a custom dock:
|
|||||||
.. _doc_making_plugins_autoload:
|
.. _doc_making_plugins_autoload:
|
||||||
|
|
||||||
Registering autoloads/singletons in plugins
|
Registering autoloads/singletons in plugins
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
-------------------------------------------
|
||||||
|
|
||||||
It is possible for editor plugins to automatically register
|
It is possible for editor plugins to automatically register
|
||||||
:ref:`autoloads <doc_singletons_autoload>` when the plugin is enabled.
|
:ref:`autoloads <doc_singletons_autoload>` when the plugin is enabled.
|
||||||
@@ -471,7 +471,7 @@ Use the following code to register a singleton from an editor plugin:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
Using sub-plugins
|
Using sub-plugins
|
||||||
~~~~~~~~~~~~~~~~~
|
-----------------
|
||||||
|
|
||||||
Often a plugin adds multiple things, for example a custom node and a panel.
|
Often a plugin adds multiple things, for example a custom node and a panel.
|
||||||
In those cases it might be easier to have a separate plugin script for each of those features.
|
In those cases it might be easier to have a separate plugin script for each of those features.
|
||||||
@@ -506,7 +506,7 @@ Instead the main plugin script should enable and disable sub-plugins like this:
|
|||||||
EditorInterface.set_plugin_enabled(PLUGIN_NAME + "/panel", false)
|
EditorInterface.set_plugin_enabled(PLUGIN_NAME + "/panel", false)
|
||||||
|
|
||||||
Going beyond
|
Going beyond
|
||||||
~~~~~~~~~~~~
|
------------
|
||||||
|
|
||||||
Now that you've learned how to make basic plugins, you can extend the editor in
|
Now that you've learned how to make basic plugins, you can extend the editor in
|
||||||
several ways. Lots of functionality can be added to the editor with GDScript;
|
several ways. Lots of functionality can be added to the editor with GDScript;
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ Forcing your graphics card to use the maximum performance profile can also help
|
|||||||
reduce stuttering, at the cost of increased GPU power draw.
|
reduce stuttering, at the cost of increased GPU power draw.
|
||||||
|
|
||||||
Windows
|
Windows
|
||||||
^^^^^^^
|
~~~~~~~
|
||||||
|
|
||||||
Windows is known to cause stutter in windowed games. This mostly depends on the
|
Windows is known to cause stutter in windowed games. This mostly depends on the
|
||||||
hardware installed, drivers version and processes running in parallel (e.g.
|
hardware installed, drivers version and processes running in parallel (e.g.
|
||||||
@@ -109,7 +109,7 @@ Windows 10 and older versions.
|
|||||||
Windows to reduce jitter and input lag for fullscreen games.
|
Windows to reduce jitter and input lag for fullscreen games.
|
||||||
|
|
||||||
Linux
|
Linux
|
||||||
^^^^^
|
~~~~~
|
||||||
|
|
||||||
Stutter may be visible on desktop Linux, but this is usually associated with
|
Stutter may be visible on desktop Linux, but this is usually associated with
|
||||||
different video drivers and compositors. Some compositors may also trigger this
|
different video drivers and compositors. Some compositors may also trigger this
|
||||||
@@ -128,21 +128,21 @@ to automatically apply optimizations (such as forcing the GPU performance profil
|
|||||||
when running specific processes.
|
when running specific processes.
|
||||||
|
|
||||||
macOS
|
macOS
|
||||||
^^^^^
|
~~~~~
|
||||||
|
|
||||||
Generally, macOS is stutter-free, although recently some bugs were reported when
|
Generally, macOS is stutter-free, although recently some bugs were reported when
|
||||||
running on fullscreen (this is a macOS bug). If you have a machine exhibiting
|
running on fullscreen (this is a macOS bug). If you have a machine exhibiting
|
||||||
this behavior, please let us know.
|
this behavior, please let us know.
|
||||||
|
|
||||||
Android
|
Android
|
||||||
^^^^^^^
|
~~~~~~~
|
||||||
|
|
||||||
Generally, Android is stutter and jitter-free because the running activity gets
|
Generally, Android is stutter and jitter-free because the running activity gets
|
||||||
all the priority. That said, there may be problematic devices (older Kindle Fire
|
all the priority. That said, there may be problematic devices (older Kindle Fire
|
||||||
is known to be one). If you see this problem on Android, please let us know.
|
is known to be one). If you see this problem on Android, please let us know.
|
||||||
|
|
||||||
iOS
|
iOS
|
||||||
^^^
|
~~~
|
||||||
|
|
||||||
iOS devices are generally stutter-free, but older devices running newer versions
|
iOS devices are generally stutter-free, but older devices running newer versions
|
||||||
of the operating system may exhibit problems. This is generally unavoidable.
|
of the operating system may exhibit problems. This is generally unavoidable.
|
||||||
@@ -151,7 +151,7 @@ Input lag
|
|||||||
---------
|
---------
|
||||||
|
|
||||||
Project configuration
|
Project configuration
|
||||||
^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
On platforms that support disabling V-Sync, input lag can be made less
|
On platforms that support disabling V-Sync, input lag can be made less
|
||||||
noticeable by disabling V-Sync in the project settings. This will however cause
|
noticeable by disabling V-Sync in the project settings. This will however cause
|
||||||
@@ -206,7 +206,7 @@ done with caution.
|
|||||||
(``0`` is unlimited). These arguments can be used at the same time.
|
(``0`` is unlimited). These arguments can be used at the same time.
|
||||||
|
|
||||||
Hardware/OS-specific
|
Hardware/OS-specific
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
If your monitor supports it, consider enabling variable refresh rate
|
If your monitor supports it, consider enabling variable refresh rate
|
||||||
(G-Sync/FreeSync) while leaving V-Sync enabled, then cap the framerate in the
|
(G-Sync/FreeSync) while leaving V-Sync enabled, then cap the framerate in the
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ Stretch settings are located in the project settings and provide several options
|
|||||||
.. image:: img/stretchsettings.webp
|
.. image:: img/stretchsettings.webp
|
||||||
|
|
||||||
Stretch Mode
|
Stretch Mode
|
||||||
^^^^^^^^^^^^
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
The **Stretch Mode** setting defines how the base size is stretched to fit
|
The **Stretch Mode** setting defines how the base size is stretched to fit
|
||||||
the resolution of the window or screen. The animations below use a "base
|
the resolution of the window or screen. The animations below use a "base
|
||||||
@@ -174,7 +174,7 @@ To configure the stretch mode at runtime from a script, use the
|
|||||||
and the :ref:`ContentScaleMode <enum_Window_ContentScaleMode>` enum).
|
and the :ref:`ContentScaleMode <enum_Window_ContentScaleMode>` enum).
|
||||||
|
|
||||||
Stretch Aspect
|
Stretch Aspect
|
||||||
^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The second setting is the stretch aspect. Note that this only takes effect if
|
The second setting is the stretch aspect. Note that this only takes effect if
|
||||||
**Stretch Mode** is set to something other than **Disabled**.
|
**Stretch Mode** is set to something other than **Disabled**.
|
||||||
@@ -258,7 +258,7 @@ and the :ref:`ContentScaleAspect <enum_Window_ContentScaleAspect>` enum).
|
|||||||
.. _doc_multiple_resolutions_stretch_scale:
|
.. _doc_multiple_resolutions_stretch_scale:
|
||||||
|
|
||||||
Stretch Scale
|
Stretch Scale
|
||||||
^^^^^^^^^^^^^
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
The **Scale** setting allows you to add an extra scaling factor on top of
|
The **Scale** setting allows you to add an extra scaling factor on top of
|
||||||
what the **Stretch** options above already provide. The default value of ``1.0``
|
what the **Stretch** options above already provide. The default value of ``1.0``
|
||||||
@@ -284,7 +284,7 @@ To configure the stretch scale at runtime from a script, use the
|
|||||||
.. _doc_multiple_resolutions_stretch_scale_mode:
|
.. _doc_multiple_resolutions_stretch_scale_mode:
|
||||||
|
|
||||||
Stretch Scale Mode
|
Stretch Scale Mode
|
||||||
^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Since Godot 4.2, the **Stretch Scale Mode** setting allows you to constrain the
|
Since Godot 4.2, the **Stretch Scale Mode** setting allows you to constrain the
|
||||||
automatically determined scale factor (as well as the manually specified
|
automatically determined scale factor (as well as the manually specified
|
||||||
@@ -355,7 +355,7 @@ The following settings are recommended to support multiple resolutions and aspec
|
|||||||
ratios well.
|
ratios well.
|
||||||
|
|
||||||
Desktop game
|
Desktop game
|
||||||
^^^^^^^^^^^^
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
**Non-pixel art:**
|
**Non-pixel art:**
|
||||||
|
|
||||||
@@ -400,7 +400,7 @@ Desktop game
|
|||||||
stretch mode.
|
stretch mode.
|
||||||
|
|
||||||
Mobile game in landscape mode
|
Mobile game in landscape mode
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Godot is configured to use landscape mode by default. This means you don't need
|
Godot is configured to use landscape mode by default. This means you don't need
|
||||||
to change the display orientation project setting.
|
to change the display orientation project setting.
|
||||||
@@ -429,7 +429,7 @@ to change the display orientation project setting.
|
|||||||
base window height to ``960``.
|
base window height to ``960``.
|
||||||
|
|
||||||
Mobile game in portrait mode
|
Mobile game in portrait mode
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
- Set the base window width to ``720`` and window height to ``1280``.
|
- Set the base window width to ``720`` and window height to ``1280``.
|
||||||
- Alternatively, if you're targeting high-end devices primarily, set the base
|
- Alternatively, if you're targeting high-end devices primarily, set the base
|
||||||
@@ -456,7 +456,7 @@ Mobile game in portrait mode
|
|||||||
base window height to ``1280``.
|
base window height to ``1280``.
|
||||||
|
|
||||||
Non-game application
|
Non-game application
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
- Set the base window width and height to the smallest window size that you intend to target.
|
- Set the base window width and height to the smallest window size that you intend to target.
|
||||||
This is not required, but this ensures that you design your UI with small window sizes in mind.
|
This is not required, but this ensures that you design your UI with small window sizes in mind.
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ Godot collections
|
|||||||
.. _doc_c_sharp_collections_packedarray:
|
.. _doc_c_sharp_collections_packedarray:
|
||||||
|
|
||||||
PackedArray
|
PackedArray
|
||||||
^^^^^^^^^^^
|
~~~~~~~~~~~
|
||||||
|
|
||||||
Godot packed arrays are implemented as an array of a specific type, allowing it to be
|
Godot packed arrays are implemented as an array of a specific type, allowing it to be
|
||||||
more tightly packed as each element has the size of the specific type, not ``Variant``.
|
more tightly packed as each element has the size of the specific type, not ``Variant``.
|
||||||
@@ -95,7 +95,7 @@ does not exist. See the list of :ref:`c_sharp_variant_compatible_types`.
|
|||||||
.. _doc_c_sharp_collections_array:
|
.. _doc_c_sharp_collections_array:
|
||||||
|
|
||||||
Array
|
Array
|
||||||
^^^^^
|
~~~~~
|
||||||
|
|
||||||
Godot arrays are implemented as an array of ``Variant`` and can contain several elements
|
Godot arrays are implemented as an array of ``Variant`` and can contain several elements
|
||||||
of any type. In C#, the equivalent type is ``Godot.Collections.Array``.
|
of any type. In C#, the equivalent type is ``Godot.Collections.Array``.
|
||||||
@@ -189,7 +189,7 @@ operator [] Array[int] indexer
|
|||||||
.. _doc_c_sharp_collections_dictionary:
|
.. _doc_c_sharp_collections_dictionary:
|
||||||
|
|
||||||
Dictionary
|
Dictionary
|
||||||
^^^^^^^^^^
|
~~~~~~~~~~
|
||||||
|
|
||||||
Godot dictionaries are implemented as a dictionary with ``Variant`` keys and values.
|
Godot dictionaries are implemented as a dictionary with ``Variant`` keys and values.
|
||||||
In C#, the equivalent type is ``Godot.Collections.Dictionary``.
|
In C#, the equivalent type is ``Godot.Collections.Dictionary``.
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ does not allow declaring them in namespaces.
|
|||||||
Most global constants were moved to their own enums.
|
Most global constants were moved to their own enums.
|
||||||
|
|
||||||
Constants
|
Constants
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
In C#, only primitive types can be constant. For example, the ``TAU`` constant
|
In C#, only primitive types can be constant. For example, the ``TAU`` constant
|
||||||
is replaced by the ``Mathf.Tau`` constant, but the ``Vector2.RIGHT`` constant
|
is replaced by the ``Mathf.Tau`` constant, but the ``Vector2.RIGHT`` constant
|
||||||
@@ -53,7 +53,7 @@ GDScript C#
|
|||||||
======================= ===========================================================
|
======================= ===========================================================
|
||||||
|
|
||||||
Math functions
|
Math functions
|
||||||
^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Math global functions, like ``abs``, ``acos``, ``asin``, ``atan`` and ``atan2``, are
|
Math global functions, like ``abs``, ``acos``, ``asin``, ``atan`` and ``atan2``, are
|
||||||
located under ``Mathf`` as ``Abs``, ``Acos``, ``Asin``, ``Atan`` and ``Atan2``.
|
located under ``Mathf`` as ``Abs``, ``Acos``, ``Asin``, ``Atan`` and ``Atan2``.
|
||||||
@@ -66,7 +66,7 @@ contain other useful mathematical operations.
|
|||||||
.. _System.MathF: https://learn.microsoft.com/en-us/dotnet/api/system.mathf
|
.. _System.MathF: https://learn.microsoft.com/en-us/dotnet/api/system.mathf
|
||||||
|
|
||||||
Random functions
|
Random functions
|
||||||
^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Random global functions, like ``rand_range`` and ``rand_seed``, are located under ``GD``.
|
Random global functions, like ``rand_range`` and ``rand_seed``, are located under ``GD``.
|
||||||
Example: ``GD.RandRange`` and ``GD.RandSeed``.
|
Example: ``GD.RandRange`` and ``GD.RandSeed``.
|
||||||
@@ -78,7 +78,7 @@ Consider using `System.Random`_ or, if you need cryptographically strong randomn
|
|||||||
.. _System.Security.Cryptography.RandomNumberGenerator: https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography.randomnumbergenerator
|
.. _System.Security.Cryptography.RandomNumberGenerator: https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography.randomnumbergenerator
|
||||||
|
|
||||||
Other functions
|
Other functions
|
||||||
^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Many other global functions like ``print`` and ``var_to_str`` are located under ``GD``.
|
Many other global functions like ``print`` and ``var_to_str`` are located under ``GD``.
|
||||||
Example: ``GD.Print`` and ``GD.VarToStr``.
|
Example: ``GD.Print`` and ``GD.VarToStr``.
|
||||||
@@ -95,7 +95,7 @@ GDScript C#
|
|||||||
============================ =======================================================
|
============================ =======================================================
|
||||||
|
|
||||||
Tips
|
Tips
|
||||||
^^^^
|
~~~~
|
||||||
|
|
||||||
Sometimes it can be useful to use the ``using static`` directive. This directive allows
|
Sometimes it can be useful to use the ``using static`` directive. This directive allows
|
||||||
to access the members and nested types of a class without specifying the class name.
|
to access the members and nested types of a class without specifying the class name.
|
||||||
@@ -115,7 +115,7 @@ Example:
|
|||||||
}
|
}
|
||||||
|
|
||||||
Full list of equivalences
|
Full list of equivalences
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
List of Godot's global scope functions and their equivalent in C#:
|
List of Godot's global scope functions and their equivalent in C#:
|
||||||
|
|
||||||
|
|||||||
@@ -497,7 +497,7 @@ certain C# arrays and the collection types defined in the ``Godot.Collections``
|
|||||||
namespace are Variant-compatible, therefore, only those types can be exported.
|
namespace are Variant-compatible, therefore, only those types can be exported.
|
||||||
|
|
||||||
Exporting Godot arrays
|
Exporting Godot arrays
|
||||||
^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. code-block:: csharp
|
.. code-block:: csharp
|
||||||
|
|
||||||
@@ -537,7 +537,7 @@ drag-and-dropping multiple files from the FileSystem dock.
|
|||||||
public Godot.Collections.Array<PackedScene> Scenes { get; set; }
|
public Godot.Collections.Array<PackedScene> Scenes { get; set; }
|
||||||
|
|
||||||
Exporting Godot dictionaries
|
Exporting Godot dictionaries
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. code-block:: csharp
|
.. code-block:: csharp
|
||||||
|
|
||||||
@@ -571,7 +571,7 @@ The default value of Godot dictionaries is null. A different default can be spec
|
|||||||
};
|
};
|
||||||
|
|
||||||
Exporting C# arrays
|
Exporting C# arrays
|
||||||
^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
C# arrays can exported as long as the element type is a :ref:`Variant-compatible type <c_sharp_variant_compatible_types>`.
|
C# arrays can exported as long as the element type is a :ref:`Variant-compatible type <c_sharp_variant_compatible_types>`.
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ To get more advanced formatting capabilities, consider using
|
|||||||
.. _doc_output_panel_printing_rich_text:
|
.. _doc_output_panel_printing_rich_text:
|
||||||
|
|
||||||
Printing rich text
|
Printing rich text
|
||||||
^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Using :ref:`print_rich() <class_@GlobalScope_method_print_rich>`, you can print
|
Using :ref:`print_rich() <class_@GlobalScope_method_print_rich>`, you can print
|
||||||
rich text to the editor Output panel and standard output (visible when the user
|
rich text to the editor Output panel and standard output (visible when the user
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ You can find these options in the **Debug** editor menu.
|
|||||||
Here are the descriptions of the options:
|
Here are the descriptions of the options:
|
||||||
|
|
||||||
Deploy with Remote Debug
|
Deploy with Remote Debug
|
||||||
++++++++++++++++++++++++
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
When this option is enabled, using one-click deploy will make the executable
|
When this option is enabled, using one-click deploy will make the executable
|
||||||
attempt to connect to this computer's IP so the running project can be debugged.
|
attempt to connect to this computer's IP so the running project can be debugged.
|
||||||
@@ -48,7 +48,7 @@ device).
|
|||||||
You don't need to enable it to use the GDScript debugger locally.
|
You don't need to enable it to use the GDScript debugger locally.
|
||||||
|
|
||||||
Small Deploy with Network Filesystem
|
Small Deploy with Network Filesystem
|
||||||
++++++++++++++++++++++++++++++++++++
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
This option speeds up testing for games with a large footprint on remote devices.
|
This option speeds up testing for games with a large footprint on remote devices.
|
||||||
|
|
||||||
@@ -60,38 +60,38 @@ Also, on Android, the game is deployed using the USB cable to speed up
|
|||||||
deployment.
|
deployment.
|
||||||
|
|
||||||
Visible Collision Shapes
|
Visible Collision Shapes
|
||||||
++++++++++++++++++++++++
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
When this option is enabled, collision shapes and raycast nodes (for 2D and 3D)
|
When this option is enabled, collision shapes and raycast nodes (for 2D and 3D)
|
||||||
will be visible in the running project.
|
will be visible in the running project.
|
||||||
|
|
||||||
Visible Paths
|
Visible Paths
|
||||||
+++++++++++++
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
When this option is enabled, curve resources used by path nodes will be visible
|
When this option is enabled, curve resources used by path nodes will be visible
|
||||||
in the running project.
|
in the running project.
|
||||||
|
|
||||||
Visible Navigation
|
Visible Navigation
|
||||||
++++++++++++++++++
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
When this option is enabled, navigation meshes, and polygons will be visible in
|
When this option is enabled, navigation meshes, and polygons will be visible in
|
||||||
the running project.
|
the running project.
|
||||||
|
|
||||||
Visible Avoidance
|
Visible Avoidance
|
||||||
+++++++++++++++++
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
When this option is enabled, avoidance object shapes, radiuses, and velocities
|
When this option is enabled, avoidance object shapes, radiuses, and velocities
|
||||||
will be visible in the running project.
|
will be visible in the running project.
|
||||||
|
|
||||||
Debug CanvasItem Redraws
|
Debug CanvasItem Redraws
|
||||||
++++++++++++++++++++++++
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
When this option is enabled, redraw requests of 2D objects will become visible
|
When this option is enabled, redraw requests of 2D objects will become visible
|
||||||
(as a short flash) in the running project.
|
(as a short flash) in the running project.
|
||||||
This is useful to troubleshoot low processor mode.
|
This is useful to troubleshoot low processor mode.
|
||||||
|
|
||||||
Synchronize Scene Changes
|
Synchronize Scene Changes
|
||||||
++++++++++++++++++++++++++
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
When this option is enabled, any changes made to the scene in the editor will be
|
When this option is enabled, any changes made to the scene in the editor will be
|
||||||
replicated in the running project.
|
replicated in the running project.
|
||||||
@@ -99,20 +99,20 @@ When used remotely on a device, this is more efficient when the network
|
|||||||
filesystem option is enabled.
|
filesystem option is enabled.
|
||||||
|
|
||||||
Synchronize Script Changes
|
Synchronize Script Changes
|
||||||
+++++++++++++++++++++++++++
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
When this option is enabled, any changes made to the script in the editor will
|
When this option is enabled, any changes made to the script in the editor will
|
||||||
be reloaded in the running project. When used
|
be reloaded in the running project. When used
|
||||||
remotely on a device, this is more efficient with the network filesystem.
|
remotely on a device, this is more efficient with the network filesystem.
|
||||||
|
|
||||||
Keep Debug Server Open
|
Keep Debug Server Open
|
||||||
++++++++++++++++++++++
|
~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
When this option is enabled, the editor debug server will stay open and listen
|
When this option is enabled, the editor debug server will stay open and listen
|
||||||
for new sessions started outside of the editor itself.
|
for new sessions started outside of the editor itself.
|
||||||
|
|
||||||
Customize Run Instances...
|
Customize Run Instances...
|
||||||
++++++++++++++++++++++++++
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
This opens a dialog allowing you to tell Godot to run multiple instances of the
|
This opens a dialog allowing you to tell Godot to run multiple instances of the
|
||||||
game at once, and to specify the command line arguments for each instance. This
|
game at once, and to specify the command line arguments for each instance. This
|
||||||
@@ -242,37 +242,37 @@ In the project settings, there is a **Debug** category with subcategories which
|
|||||||
control different things. Enable **Advanced Settings** to change these settings.
|
control different things. Enable **Advanced Settings** to change these settings.
|
||||||
|
|
||||||
Settings
|
Settings
|
||||||
++++++++
|
~~~~~~~~
|
||||||
|
|
||||||
These are some general settings such as printing the current FPS
|
These are some general settings such as printing the current FPS
|
||||||
to the **Output** panel, the maximum amount of functions when profiling
|
to the **Output** panel, the maximum amount of functions when profiling
|
||||||
and others.
|
and others.
|
||||||
|
|
||||||
File Logging
|
File Logging
|
||||||
++++++++++++
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
These settings allow you to log console output and error messages to files.
|
These settings allow you to log console output and error messages to files.
|
||||||
|
|
||||||
GDScript
|
GDScript
|
||||||
++++++++
|
~~~~~~~~
|
||||||
|
|
||||||
These settings allow you to toggle specific GDScript warnings, such as for
|
These settings allow you to toggle specific GDScript warnings, such as for
|
||||||
unused variables. You can also turn off warnings completely. See
|
unused variables. You can also turn off warnings completely. See
|
||||||
:ref:`doc_gdscript_warning_system` for more information.
|
:ref:`doc_gdscript_warning_system` for more information.
|
||||||
|
|
||||||
Shader Language
|
Shader Language
|
||||||
+++++++++++++++
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
These settings allow you to toggle specific shader warnings, such as for
|
These settings allow you to toggle specific shader warnings, such as for
|
||||||
unused variables. You can also turn off warnings completely.
|
unused variables. You can also turn off warnings completely.
|
||||||
|
|
||||||
Canvas Items
|
Canvas Items
|
||||||
++++++++++++
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
These settings are for canvas item redraw debugging.
|
These settings are for canvas item redraw debugging.
|
||||||
|
|
||||||
Shapes
|
Shapes
|
||||||
++++++
|
~~~~~~
|
||||||
|
|
||||||
Shapes are where you can adjust the color of shapes that only appear for
|
Shapes are where you can adjust the color of shapes that only appear for
|
||||||
debugging purposes, such as collision and navigation shapes.
|
debugging purposes, such as collision and navigation shapes.
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ You could try to optimize everything and run the game repeatedly, but you can be
|
|||||||
smarter about this and narrow down the possibilities. Enter Godot's profiler.
|
smarter about this and narrow down the possibilities. Enter Godot's profiler.
|
||||||
|
|
||||||
An overview of the profiler
|
An overview of the profiler
|
||||||
+++++++++++++++++++++++++++
|
---------------------------
|
||||||
|
|
||||||
You can open the profiler by opening the **Debugger** panel and clicking on the
|
You can open the profiler by opening the **Debugger** panel and clicking on the
|
||||||
**Profiler** tab.
|
**Profiler** tab.
|
||||||
@@ -42,7 +42,7 @@ You can clear the data by clicking the **Clear** button anytime. Use the
|
|||||||
measurements panel and the graph will update accordingly.
|
measurements panel and the graph will update accordingly.
|
||||||
|
|
||||||
The measured data
|
The measured data
|
||||||
+++++++++++++++++
|
-----------------
|
||||||
|
|
||||||
The profiler's interface is split into two. There is a list of functions on the
|
The profiler's interface is split into two. There is a list of functions on the
|
||||||
left and the performance graph on the right.
|
left and the performance graph on the right.
|
||||||
@@ -77,7 +77,7 @@ left. In the top right, there is also a frame counter where you can manually
|
|||||||
adjust the frame you are looking at more granularly.
|
adjust the frame you are looking at more granularly.
|
||||||
|
|
||||||
Scope of measurement and measurement windows
|
Scope of measurement and measurement windows
|
||||||
++++++++++++++++++++++++++++++++++++++++++++
|
--------------------------------------------
|
||||||
|
|
||||||
You can change what measurement you are looking at using the **Measure**
|
You can change what measurement you are looking at using the **Measure**
|
||||||
drop-down menu. By default, it starts with Frame Time and lists the time it
|
drop-down menu. By default, it starts with Frame Time and lists the time it
|
||||||
@@ -110,7 +110,7 @@ spent more time waiting for some other function call to finish than not, and
|
|||||||
`find_nearest_neighbor` is **actually** slow.
|
`find_nearest_neighbor` is **actually** slow.
|
||||||
|
|
||||||
Debugging slow code with the profiler
|
Debugging slow code with the profiler
|
||||||
+++++++++++++++++++++++++++++++++++++
|
-------------------------------------
|
||||||
|
|
||||||
Finding slow code with the profiler boils down to running your game and watching
|
Finding slow code with the profiler boils down to running your game and watching
|
||||||
the performance graph as it draws. When an unacceptable spike occurs in the
|
the performance graph as it draws. When an unacceptable spike occurs in the
|
||||||
@@ -122,7 +122,7 @@ Under the Script functions, turn on the checkboxes for some functions to find
|
|||||||
which take time. These are the functions you need to review and optimize.
|
which take time. These are the functions you need to review and optimize.
|
||||||
|
|
||||||
Measuring manually in microseconds
|
Measuring manually in microseconds
|
||||||
++++++++++++++++++++++++++++++++++
|
----------------------------------
|
||||||
|
|
||||||
If your function is complex, it could be challenging to figure out which part
|
If your function is complex, it could be challenging to figure out which part
|
||||||
needs optimization. Is it your math or the way you access other pieces of data
|
needs optimization. Is it your math or the way you access other pieces of data
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ Here is an example of what that can look like:
|
|||||||
Here are lists of some of the available built-in options (for more look at the :ref:`feature tags <doc_feature_tags>`):
|
Here are lists of some of the available built-in options (for more look at the :ref:`feature tags <doc_feature_tags>`):
|
||||||
|
|
||||||
Running system
|
Running system
|
||||||
^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~
|
||||||
|
|
||||||
+-------------------------------+------------------------------------------------------------------------------------------------------+
|
+-------------------------------+------------------------------------------------------------------------------------------------------+
|
||||||
| Flag | Description |
|
| Flag | Description |
|
||||||
@@ -92,7 +92,7 @@ Running system
|
|||||||
+-------------------------------+------------------------------------------------------------------------------------------------------+
|
+-------------------------------+------------------------------------------------------------------------------------------------------+
|
||||||
|
|
||||||
Build
|
Build
|
||||||
^^^^^
|
~~~~~
|
||||||
|
|
||||||
+-------------------------------+------------------------------------------------------------------------------------------------------+
|
+-------------------------------+------------------------------------------------------------------------------------------------------+
|
||||||
| Flag | Description |
|
| Flag | Description |
|
||||||
@@ -105,7 +105,7 @@ Build
|
|||||||
+-------------------------------+------------------------------------------------------------------------------------------------------+
|
+-------------------------------+------------------------------------------------------------------------------------------------------+
|
||||||
|
|
||||||
Architecture
|
Architecture
|
||||||
^^^^^^^^^^^^
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
+-------------------------------+------------------------------------------------------------------------------------------------------+
|
+-------------------------------+------------------------------------------------------------------------------------------------------+
|
||||||
| Flag | Description |
|
| Flag | Description |
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ you should choose depends on your needs.
|
|||||||
break compatibility in order to fix major bugs or include critical features.
|
break compatibility in order to fix major bugs or include critical features.
|
||||||
|
|
||||||
Advantages of GDExtension
|
Advantages of GDExtension
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Unlike modules, GDExtension doesn't require compiling the engine's source code,
|
Unlike modules, GDExtension doesn't require compiling the engine's source code,
|
||||||
making it easier to distribute your work. It gives you access to most of the API
|
making it easier to distribute your work. It gives you access to most of the API
|
||||||
@@ -50,7 +50,7 @@ Also:
|
|||||||
incremental builds, this process is slower than using GDExtension.
|
incremental builds, this process is slower than using GDExtension.
|
||||||
|
|
||||||
Advantages of C++ modules
|
Advantages of C++ modules
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
We recommend :ref:`C++ modules <doc_custom_modules_in_cpp>` in cases where
|
We recommend :ref:`C++ modules <doc_custom_modules_in_cpp>` in cases where
|
||||||
GDExtension isn't enough:
|
GDExtension isn't enough:
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ quality-of-life features. Accordingly, most features available in GLSL are
|
|||||||
available in Godot's shading language.
|
available in Godot's shading language.
|
||||||
|
|
||||||
Shader programs
|
Shader programs
|
||||||
^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
In GLSL, each shader uses a separate program. You have one program for the
|
In GLSL, each shader uses a separate program. You have one program for the
|
||||||
vertex shader and one for the fragment shader. In Godot, you have a single
|
vertex shader and one for the fragment shader. In Godot, you have a single
|
||||||
@@ -30,7 +30,7 @@ fragment and vertex shaders in one file. In GLSL, the vertex and fragment
|
|||||||
programs cannot share variables except when varyings are used.
|
programs cannot share variables except when varyings are used.
|
||||||
|
|
||||||
Vertex attributes
|
Vertex attributes
|
||||||
^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
In GLSL, you can pass in per-vertex information using attributes and have the
|
In GLSL, you can pass in per-vertex information using attributes and have the
|
||||||
flexibility to pass in as much or as little as you want. In Godot, you have a
|
flexibility to pass in as much or as little as you want. In Godot, you have a
|
||||||
@@ -39,7 +39,7 @@ set number of input attributes, including ``VERTEX`` (position), ``COLOR``,
|
|||||||
of the documentation comes with a complete list of its vertex attributes.
|
of the documentation comes with a complete list of its vertex attributes.
|
||||||
|
|
||||||
gl_Position
|
gl_Position
|
||||||
^^^^^^^^^^^
|
~~~~~~~~~~~
|
||||||
|
|
||||||
``gl_Position`` receives the final position of a vertex specified in the vertex
|
``gl_Position`` receives the final position of a vertex specified in the vertex
|
||||||
shader. It is specified by the user in clip space. Typically, in GLSL, the model
|
shader. It is specified by the user in clip space. Typically, in GLSL, the model
|
||||||
@@ -56,7 +56,7 @@ to ``mat4(1.0)`` in order to nullify the final transform from view space to clip
|
|||||||
space.
|
space.
|
||||||
|
|
||||||
Varyings
|
Varyings
|
||||||
^^^^^^^^
|
~~~~~~~~
|
||||||
|
|
||||||
Varyings are a type of variable that can be passed from the vertex shader to the
|
Varyings are a type of variable that can be passed from the vertex shader to the
|
||||||
fragment shader. In modern GLSL (3.0 and up), varyings are defined with the
|
fragment shader. In modern GLSL (3.0 and up), varyings are defined with the
|
||||||
@@ -64,7 +64,7 @@ fragment shader. In modern GLSL (3.0 and up), varyings are defined with the
|
|||||||
defined with ``out`` in the vertex shader and ``in`` inside the fragment shader.
|
defined with ``out`` in the vertex shader and ``in`` inside the fragment shader.
|
||||||
|
|
||||||
Main
|
Main
|
||||||
^^^^
|
~~~~
|
||||||
|
|
||||||
In GLSL, each shader program looks like a self-contained C-style program.
|
In GLSL, each shader program looks like a self-contained C-style program.
|
||||||
Accordingly, the main entry point is ``main``. If you are copying a vertex
|
Accordingly, the main entry point is ``main``. If you are copying a vertex
|
||||||
@@ -72,7 +72,7 @@ shader, rename ``main`` to ``vertex`` and if you are copying a fragment shader,
|
|||||||
rename ``main`` to ``fragment``.
|
rename ``main`` to ``fragment``.
|
||||||
|
|
||||||
Macros
|
Macros
|
||||||
^^^^^^
|
~~~~~~
|
||||||
|
|
||||||
The :ref:`Godot shader preprocessor<doc_shader_preprocessor>` supports the following macros:
|
The :ref:`Godot shader preprocessor<doc_shader_preprocessor>` supports the following macros:
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ The :ref:`Godot shader preprocessor<doc_shader_preprocessor>` supports the follo
|
|||||||
* ``#pragma disable_preprocessor``, which disables preprocessing for the rest of the file
|
* ``#pragma disable_preprocessor``, which disables preprocessing for the rest of the file
|
||||||
|
|
||||||
Variables
|
Variables
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
GLSL has many built-in variables that are hard-coded. These variables are not
|
GLSL has many built-in variables that are hard-coded. These variables are not
|
||||||
uniforms, so they are not editable from the main program.
|
uniforms, so they are not editable from the main program.
|
||||||
@@ -106,14 +106,14 @@ uniforms, so they are not editable from the main program.
|
|||||||
.. _glsl_coordinates:
|
.. _glsl_coordinates:
|
||||||
|
|
||||||
Coordinates
|
Coordinates
|
||||||
^^^^^^^^^^^
|
~~~~~~~~~~~
|
||||||
|
|
||||||
``gl_FragCoord`` in GLSL and ``FRAGCOORD`` in the Godot shading language use the
|
``gl_FragCoord`` in GLSL and ``FRAGCOORD`` in the Godot shading language use the
|
||||||
same coordinate system. If using UV in Godot, the y-coordinate will be flipped
|
same coordinate system. If using UV in Godot, the y-coordinate will be flipped
|
||||||
upside down.
|
upside down.
|
||||||
|
|
||||||
Precision
|
Precision
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
In GLSL, you can define the precision of a given type (float or int) at the top
|
In GLSL, you can define the precision of a given type (float or int) at the top
|
||||||
of the shader with the ``precision`` keyword. In Godot, you can set the
|
of the shader with the ``precision`` keyword. In Godot, you can set the
|
||||||
@@ -133,13 +133,13 @@ Shadertoy does not give the user full control over the shader. It handles all
|
|||||||
the input and uniforms and only lets the user write the fragment shader.
|
the input and uniforms and only lets the user write the fragment shader.
|
||||||
|
|
||||||
Types
|
Types
|
||||||
^^^^^
|
~~~~~
|
||||||
|
|
||||||
Shadertoy uses the webgl spec, so it runs a slightly different version of GLSL.
|
Shadertoy uses the webgl spec, so it runs a slightly different version of GLSL.
|
||||||
However, it still has the regular types, including constants and macros.
|
However, it still has the regular types, including constants and macros.
|
||||||
|
|
||||||
mainImage
|
mainImage
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
The main point of entry to a Shadertoy shader is the ``mainImage`` function.
|
The main point of entry to a Shadertoy shader is the ``mainImage`` function.
|
||||||
``mainImage`` has two parameters, ``fragColor`` and ``fragCoord``, which
|
``mainImage`` has two parameters, ``fragColor`` and ``fragCoord``, which
|
||||||
@@ -149,7 +149,7 @@ them as parameters yourself. Anything in the ``mainImage`` function should be
|
|||||||
copied into the ``fragment`` function when porting to Godot.
|
copied into the ``fragment`` function when porting to Godot.
|
||||||
|
|
||||||
Variables
|
Variables
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
In order to make writing fragment shaders straightforward and easy, Shadertoy
|
In order to make writing fragment shaders straightforward and easy, Shadertoy
|
||||||
handles passing a lot of helpful information from the main program into the
|
handles passing a lot of helpful information from the main program into the
|
||||||
@@ -187,7 +187,7 @@ what they can pass in as a substitute.
|
|||||||
+---------------------+---------+------------------------+-----------------------------------------------------+
|
+---------------------+---------+------------------------+-----------------------------------------------------+
|
||||||
|
|
||||||
Coordinates
|
Coordinates
|
||||||
^^^^^^^^^^^
|
~~~~~~~~~~~
|
||||||
|
|
||||||
``fragCoord`` behaves the same as ``gl_FragCoord`` in :ref:`GLSL
|
``fragCoord`` behaves the same as ``gl_FragCoord`` in :ref:`GLSL
|
||||||
<glsl_coordinates>` and ``FRAGCOORD`` in Godot.
|
<glsl_coordinates>` and ``FRAGCOORD`` in Godot.
|
||||||
@@ -206,21 +206,21 @@ Shaders provides a `page <https://thebookofshaders.com/04>`_ on running shaders
|
|||||||
in various frameworks.
|
in various frameworks.
|
||||||
|
|
||||||
Types
|
Types
|
||||||
^^^^^
|
~~~~~
|
||||||
|
|
||||||
The Book of Shaders uses the webgl spec, so it runs a slightly different version
|
The Book of Shaders uses the webgl spec, so it runs a slightly different version
|
||||||
of GLSL. However, it still has the regular types, including constants and
|
of GLSL. However, it still has the regular types, including constants and
|
||||||
macros.
|
macros.
|
||||||
|
|
||||||
Main
|
Main
|
||||||
^^^^
|
~~~~
|
||||||
|
|
||||||
The entry point for a Book of Shaders fragment shader is ``main``, just like in
|
The entry point for a Book of Shaders fragment shader is ``main``, just like in
|
||||||
GLSL. Everything written in a Book of Shaders ``main`` function should be copied
|
GLSL. Everything written in a Book of Shaders ``main`` function should be copied
|
||||||
into Godot's ``fragment`` function.
|
into Godot's ``fragment`` function.
|
||||||
|
|
||||||
Variables
|
Variables
|
||||||
^^^^^^^^^
|
~~~~~~~~~
|
||||||
|
|
||||||
The Book of Shaders sticks closer to plain GLSL than Shadertoy does. It also
|
The Book of Shaders sticks closer to plain GLSL than Shadertoy does. It also
|
||||||
implements fewer uniforms than Shadertoy.
|
implements fewer uniforms than Shadertoy.
|
||||||
@@ -240,7 +240,7 @@ implements fewer uniforms than Shadertoy.
|
|||||||
+---------------------+---------+------------------------+-----------------------------------------------------+
|
+---------------------+---------+------------------------+-----------------------------------------------------+
|
||||||
|
|
||||||
Coordinates
|
Coordinates
|
||||||
^^^^^^^^^^^
|
~~~~~~~~~~~
|
||||||
|
|
||||||
The Book of Shaders uses the same coordinate system as
|
The Book of Shaders uses the same coordinate system as
|
||||||
:ref:`GLSL <glsl_coordinates>`.
|
:ref:`GLSL <glsl_coordinates>`.
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ Each shader type has different render modes. See the reference for each shader
|
|||||||
type for a complete list of render modes.
|
type for a complete list of render modes.
|
||||||
|
|
||||||
Vertex processor
|
Vertex processor
|
||||||
^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The ``vertex()`` processing function is called once for every vertex in
|
The ``vertex()`` processing function is called once for every vertex in
|
||||||
``spatial`` and ``canvas_item`` shaders.
|
``spatial`` and ``canvas_item`` shaders.
|
||||||
@@ -151,7 +151,7 @@ data yourself; see the :ref:`Spatial shader doc <doc_spatial_shader>` for an
|
|||||||
example.
|
example.
|
||||||
|
|
||||||
Fragment processor
|
Fragment processor
|
||||||
^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The ``fragment()`` processing function is used to set up the Godot material
|
The ``fragment()`` processing function is used to set up the Godot material
|
||||||
parameters per pixel. This code runs on every visible pixel the object or
|
parameters per pixel. This code runs on every visible pixel the object or
|
||||||
@@ -170,7 +170,7 @@ code out. Therefore, you will not waste calculations on the effects that you do
|
|||||||
not use.
|
not use.
|
||||||
|
|
||||||
Light processor
|
Light processor
|
||||||
^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The ``light()`` processor runs per pixel too, and it runs once for every light
|
The ``light()`` processor runs per pixel too, and it runs once for every light
|
||||||
that affects the object. It does not run if no lights affect the object. It
|
that affects the object. It does not run if no lights affect the object. It
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ Screen-reading shaders
|
|||||||
======================
|
======================
|
||||||
|
|
||||||
Introduction
|
Introduction
|
||||||
~~~~~~~~~~~~
|
------------
|
||||||
|
|
||||||
It is often desired to make a shader that reads from the same
|
It is often desired to make a shader that reads from the same
|
||||||
screen to which it's writing. 3D APIs, such as OpenGL or DirectX, make this very
|
screen to which it's writing. 3D APIs, such as OpenGL or DirectX, make this very
|
||||||
@@ -18,7 +18,7 @@ to a back-buffer and then read from it while drawing. Godot provides a
|
|||||||
few tools that make this process easy.
|
few tools that make this process easy.
|
||||||
|
|
||||||
Screen texture
|
Screen texture
|
||||||
~~~~~~~~~~~~~~
|
--------------
|
||||||
|
|
||||||
Godot :ref:`doc_shading_language` has a special texture to access the already
|
Godot :ref:`doc_shading_language` has a special texture to access the already
|
||||||
rendered contents of the screen. It is used by specifying a hint when declaring
|
rendered contents of the screen. It is used by specifying a hint when declaring
|
||||||
@@ -51,7 +51,7 @@ you.
|
|||||||
as with the ``0.0`` LOD parameter.
|
as with the ``0.0`` LOD parameter.
|
||||||
|
|
||||||
Screen texture example
|
Screen texture example
|
||||||
~~~~~~~~~~~~~~~~~~~~~~
|
----------------------
|
||||||
|
|
||||||
The screen texture can be used for many things. There is a
|
The screen texture can be used for many things. There is a
|
||||||
special demo for *Screen Space Shaders*, that you can download to see
|
special demo for *Screen Space Shaders*, that you can download to see
|
||||||
@@ -79,7 +79,7 @@ and saturation:
|
|||||||
}
|
}
|
||||||
|
|
||||||
Behind the scenes
|
Behind the scenes
|
||||||
~~~~~~~~~~~~~~~~~
|
-----------------
|
||||||
|
|
||||||
While this seems magical, it's not. In 2D, when ``hint_screen_texture`` is first
|
While this seems magical, it's not. In 2D, when ``hint_screen_texture`` is first
|
||||||
found in a node that is about to be drawn, Godot does a full-screen copy to a
|
found in a node that is about to be drawn, Godot does a full-screen copy to a
|
||||||
@@ -125,7 +125,7 @@ with a camera in the same position as your object, and then use the
|
|||||||
:ref:`Viewport's <class_Viewport>` texture instead of the screen texture.
|
:ref:`Viewport's <class_Viewport>` texture instead of the screen texture.
|
||||||
|
|
||||||
Back-buffer logic
|
Back-buffer logic
|
||||||
~~~~~~~~~~~~~~~~~
|
-----------------
|
||||||
|
|
||||||
So, to make it clearer, here's how the backbuffer copying logic works in 2D in
|
So, to make it clearer, here's how the backbuffer copying logic works in 2D in
|
||||||
Godot:
|
Godot:
|
||||||
@@ -148,7 +148,7 @@ Godot:
|
|||||||
|
|
||||||
|
|
||||||
Depth texture
|
Depth texture
|
||||||
~~~~~~~~~~~~~
|
-------------
|
||||||
|
|
||||||
For 3D shaders, it's also possible to access the screen depth buffer. For this,
|
For 3D shaders, it's also possible to access the screen depth buffer. For this,
|
||||||
the ``hint_depth_texture`` hint is used. This texture is not linear; it must be
|
the ``hint_depth_texture`` hint is used. This texture is not linear; it must be
|
||||||
@@ -167,7 +167,7 @@ The following code retrieves the 3D position below the pixel being drawn:
|
|||||||
}
|
}
|
||||||
|
|
||||||
Normal-roughness texture
|
Normal-roughness texture
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
------------------------
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -189,7 +189,7 @@ roughness of objects rendered in the depth prepass. The normal is stored in the
|
|||||||
screen_normal = screen_normal * 2.0 - 1.0;
|
screen_normal = screen_normal * 2.0 - 1.0;
|
||||||
|
|
||||||
Redefining screen textures
|
Redefining screen textures
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
--------------------------
|
||||||
|
|
||||||
The screen texture hints (``hint_screen_texture``, ``hint_depth_texture``, and
|
The screen texture hints (``hint_screen_texture``, ``hint_depth_texture``, and
|
||||||
``hint_normal_roughness_texture``) can be used with multiple uniforms. For
|
``hint_normal_roughness_texture``) can be used with multiple uniforms. For
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ CanvasItem shaders contain fewer built-in variables and functionality than
|
|||||||
with vertex, fragment, and light processor functions.
|
with vertex, fragment, and light processor functions.
|
||||||
|
|
||||||
Render modes
|
Render modes
|
||||||
^^^^^^^^^^^^
|
------------
|
||||||
|
|
||||||
+---------------------------------+----------------------------------------------------------------------+
|
+---------------------------------+----------------------------------------------------------------------+
|
||||||
| Render mode | Description |
|
| Render mode | Description |
|
||||||
@@ -39,14 +39,14 @@ Render modes
|
|||||||
+---------------------------------+----------------------------------------------------------------------+
|
+---------------------------------+----------------------------------------------------------------------+
|
||||||
|
|
||||||
Built-ins
|
Built-ins
|
||||||
^^^^^^^^^
|
---------
|
||||||
|
|
||||||
Values marked as ``in`` are read-only. Values marked as ``out`` can optionally be written to and will
|
Values marked as ``in`` are read-only. Values marked as ``out`` can optionally be written to and will
|
||||||
not necessarily contain sensible values. Values marked as ``inout`` provide a sensible default
|
not necessarily contain sensible values. Values marked as ``inout`` provide a sensible default
|
||||||
value, and can optionally be written to. Samplers cannot be written to so they are not marked.
|
value, and can optionally be written to. Samplers cannot be written to so they are not marked.
|
||||||
|
|
||||||
Global built-ins
|
Global built-ins
|
||||||
^^^^^^^^^^^^^^^^
|
----------------
|
||||||
|
|
||||||
Global built-ins are available everywhere, including custom functions.
|
Global built-ins are available everywhere, including custom functions.
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ Global built-ins are available everywhere, including custom functions.
|
|||||||
+-------------------+------------------------------------------------------------------------------------------+
|
+-------------------+------------------------------------------------------------------------------------------+
|
||||||
|
|
||||||
Vertex built-ins
|
Vertex built-ins
|
||||||
^^^^^^^^^^^^^^^^
|
----------------
|
||||||
|
|
||||||
Vertex data (``VERTEX``) is presented in local space (pixel coordinates, relative to the Node2D's origin).
|
Vertex data (``VERTEX``) is presented in local space (pixel coordinates, relative to the Node2D's origin).
|
||||||
If not written to, these values will not be modified and be passed through as they came.
|
If not written to, these values will not be modified and be passed through as they came.
|
||||||
@@ -148,7 +148,7 @@ is usually:
|
|||||||
|
|
||||||
|
|
||||||
Fragment built-ins
|
Fragment built-ins
|
||||||
^^^^^^^^^^^^^^^^^^
|
------------------
|
||||||
|
|
||||||
COLOR and TEXTURE
|
COLOR and TEXTURE
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
@@ -261,7 +261,7 @@ it to the ``NORMAL_MAP`` property. Godot will handle converting it for use in 2D
|
|||||||
+---------------------------------------------+---------------------------------------------------------------+
|
+---------------------------------------------+---------------------------------------------------------------+
|
||||||
|
|
||||||
Light built-ins
|
Light built-ins
|
||||||
^^^^^^^^^^^^^^^
|
---------------
|
||||||
|
|
||||||
Light processor functions work differently in Godot 4.x than they did in Godot
|
Light processor functions work differently in Godot 4.x than they did in Godot
|
||||||
3.x. In Godot 4.x all lighting is done during the regular draw pass. In other
|
3.x. In Godot 4.x all lighting is done during the regular draw pass. In other
|
||||||
@@ -332,7 +332,7 @@ Below is an example of a light shader that takes a CanvasItem's normal map into
|
|||||||
+----------------------------------+------------------------------------------------------------------------------+
|
+----------------------------------+------------------------------------------------------------------------------+
|
||||||
|
|
||||||
SDF functions
|
SDF functions
|
||||||
^^^^^^^^^^^^^
|
-------------
|
||||||
|
|
||||||
There are a few additional functions implemented to sample an automatically
|
There are a few additional functions implemented to sample an automatically
|
||||||
generated Signed Distance Field texture. These functions available for the ``fragment()``
|
generated Signed Distance Field texture. These functions available for the ``fragment()``
|
||||||
|
|||||||
@@ -19,14 +19,14 @@ every froxel that is touched by an axis aligned bounding box of the associated
|
|||||||
touch a given :ref:`FogVolume <class_FogVolume>` will still be used.
|
touch a given :ref:`FogVolume <class_FogVolume>` will still be used.
|
||||||
|
|
||||||
Built-ins
|
Built-ins
|
||||||
^^^^^^^^^
|
---------
|
||||||
|
|
||||||
Values marked as ``in`` are read-only. Values marked as ``out`` can optionally
|
Values marked as ``in`` are read-only. Values marked as ``out`` can optionally
|
||||||
be written to and will not necessarily contain sensible values. Samplers cannot
|
be written to and will not necessarily contain sensible values. Samplers cannot
|
||||||
be written to so they are not marked.
|
be written to so they are not marked.
|
||||||
|
|
||||||
Global built-ins
|
Global built-ins
|
||||||
^^^^^^^^^^^^^^^^
|
----------------
|
||||||
|
|
||||||
Global built-ins are available everywhere, including in custom functions.
|
Global built-ins are available everywhere, including in custom functions.
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ Global built-ins are available everywhere, including in custom functions.
|
|||||||
+-----------------------------------+------------------------------------------------------------------------------------------+
|
+-----------------------------------+------------------------------------------------------------------------------------------+
|
||||||
|
|
||||||
Fog built-ins
|
Fog built-ins
|
||||||
^^^^^^^^^^^^^
|
-------------
|
||||||
|
|
||||||
All of the output values of fog volumes overlap one another. This allows
|
All of the output values of fog volumes overlap one another. This allows
|
||||||
:ref:`FogVolumes <class_FogVolume>` to be rendered efficiently as they can all
|
:ref:`FogVolumes <class_FogVolume>` to be rendered efficiently as they can all
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ take place over multiple frames.
|
|||||||
on the CPU.
|
on the CPU.
|
||||||
|
|
||||||
Render modes
|
Render modes
|
||||||
^^^^^^^^^^^^
|
------------
|
||||||
|
|
||||||
+--------------------------+-------------------------------------------+
|
+--------------------------+-------------------------------------------+
|
||||||
| Render mode | Description |
|
| Render mode | Description |
|
||||||
@@ -43,14 +43,14 @@ Render modes
|
|||||||
+--------------------------+-------------------------------------------+
|
+--------------------------+-------------------------------------------+
|
||||||
|
|
||||||
Built-ins
|
Built-ins
|
||||||
^^^^^^^^^
|
---------
|
||||||
|
|
||||||
Values marked as ``in`` are read-only. Values marked as ``out`` can optionally be written to and will
|
Values marked as ``in`` are read-only. Values marked as ``out`` can optionally be written to and will
|
||||||
not necessarily contain sensible values. Values marked as ``inout`` provide a sensible default
|
not necessarily contain sensible values. Values marked as ``inout`` provide a sensible default
|
||||||
value, and can optionally be written to. Samplers cannot be written to so they are not marked.
|
value, and can optionally be written to. Samplers cannot be written to so they are not marked.
|
||||||
|
|
||||||
Global built-ins
|
Global built-ins
|
||||||
^^^^^^^^^^^^^^^^
|
----------------
|
||||||
|
|
||||||
Global built-ins are available everywhere, including custom functions.
|
Global built-ins are available everywhere, including custom functions.
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ Global built-ins are available everywhere, including custom functions.
|
|||||||
+-------------------+------------------------------------------------------------------------------------------+
|
+-------------------+------------------------------------------------------------------------------------------+
|
||||||
|
|
||||||
Start and Process built-ins
|
Start and Process built-ins
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
---------------------------
|
||||||
|
|
||||||
These properties can be accessed from both the ``start()`` and ``process()`` functions.
|
These properties can be accessed from both the ``start()`` and ``process()`` functions.
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ These properties can be accessed from both the ``start()`` and ``process()`` fun
|
|||||||
to ``true``. In a ShaderMaterial, access it with the ``COLOR`` variable.
|
to ``true``. In a ShaderMaterial, access it with the ``COLOR`` variable.
|
||||||
|
|
||||||
Start built-ins
|
Start built-ins
|
||||||
^^^^^^^^^^^^^^^
|
---------------
|
||||||
|
|
||||||
+---------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
+---------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||||
| Built-in | Description |
|
| Built-in | Description |
|
||||||
@@ -150,7 +150,7 @@ Start built-ins
|
|||||||
+---------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
+---------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||||
|
|
||||||
Process built-ins
|
Process built-ins
|
||||||
^^^^^^^^^^^^^^^^^
|
-----------------
|
||||||
|
|
||||||
+------------------------------------+-------------------------------------------------------------------------------------------------------+
|
+------------------------------------+-------------------------------------------------------------------------------------------------------+
|
||||||
| Built-in | Description |
|
| Built-in | Description |
|
||||||
@@ -167,7 +167,7 @@ Process built-ins
|
|||||||
+------------------------------------+-------------------------------------------------------------------------------------------------------+
|
+------------------------------------+-------------------------------------------------------------------------------------------------------+
|
||||||
|
|
||||||
Process functions
|
Process functions
|
||||||
^^^^^^^^^^^^^^^^^
|
-----------------
|
||||||
|
|
||||||
``emit_subparticle()`` is currently the only custom function supported by
|
``emit_subparticle()`` is currently the only custom function supported by
|
||||||
particles shaders. It allows users to add a new particle with specified
|
particles shaders. It allows users to add a new particle with specified
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ Directives
|
|||||||
----------
|
----------
|
||||||
|
|
||||||
General syntax
|
General syntax
|
||||||
^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~
|
||||||
|
|
||||||
- Preprocessor directives do not use brackets (``{}``), but can use parentheses.
|
- Preprocessor directives do not use brackets (``{}``), but can use parentheses.
|
||||||
- Preprocessor directives **never** end with semicolons (with the exception of ``#define``,
|
- Preprocessor directives **never** end with semicolons (with the exception of ``#define``,
|
||||||
@@ -40,7 +40,7 @@ General syntax
|
|||||||
the preprocessor statement.
|
the preprocessor statement.
|
||||||
|
|
||||||
#define
|
#define
|
||||||
^^^^^^^
|
~~~~~~~
|
||||||
|
|
||||||
**Syntax:** ``#define <identifier> [replacement_code]``.
|
**Syntax:** ``#define <identifier> [replacement_code]``.
|
||||||
|
|
||||||
@@ -110,7 +110,7 @@ Defining a ``#define`` for an identifier that is already defined results in an
|
|||||||
error. To prevent this, use ``#undef <identifier>``.
|
error. To prevent this, use ``#undef <identifier>``.
|
||||||
|
|
||||||
#undef
|
#undef
|
||||||
^^^^^^
|
~~~~~~
|
||||||
|
|
||||||
**Syntax:** ``#undef identifier``
|
**Syntax:** ``#undef identifier``
|
||||||
|
|
||||||
@@ -138,7 +138,7 @@ The ``#undef`` directive may be used to cancel a previously defined ``#define``
|
|||||||
Without ``#undef`` in the above example, there would be a macro redefinition error.
|
Without ``#undef`` in the above example, there would be a macro redefinition error.
|
||||||
|
|
||||||
#if
|
#if
|
||||||
^^^
|
~~~
|
||||||
|
|
||||||
**Syntax:** ``#if <condition>``
|
**Syntax:** ``#if <condition>``
|
||||||
|
|
||||||
@@ -232,7 +232,7 @@ high amounts of :abbr:`VGPRs (Vector General-Purpose Register)` (which can be ca
|
|||||||
having too many branches) can still slow down shader execution significantly.
|
having too many branches) can still slow down shader execution significantly.
|
||||||
|
|
||||||
#elif
|
#elif
|
||||||
^^^^^
|
~~~~~
|
||||||
|
|
||||||
The ``#elif`` directive stands for "else if" and checks the condition passed if
|
The ``#elif`` directive stands for "else if" and checks the condition passed if
|
||||||
the above ``#if`` evaluated to ``false``. ``#elif`` can only be used within an
|
the above ``#if`` evaluated to ``false``. ``#elif`` can only be used within an
|
||||||
@@ -267,7 +267,7 @@ Like with ``#if``, the ``defined()`` preprocessor function can be used:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef
|
#ifdef
|
||||||
^^^^^^
|
~~~~~~
|
||||||
|
|
||||||
**Syntax:** ``#ifdef <identifier>``
|
**Syntax:** ``#ifdef <identifier>``
|
||||||
|
|
||||||
@@ -303,7 +303,7 @@ than two branches:
|
|||||||
#endif // This ends `SHADOW_QUALITY_HIGH`'s branch.
|
#endif // This ends `SHADOW_QUALITY_HIGH`'s branch.
|
||||||
|
|
||||||
#ifndef
|
#ifndef
|
||||||
^^^^^^^
|
~~~~~~~
|
||||||
|
|
||||||
**Syntax:** ``#ifndef <identifier>``
|
**Syntax:** ``#ifndef <identifier>``
|
||||||
|
|
||||||
@@ -327,7 +327,7 @@ where ``#ifdef`` would never match, and vice versa.
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
^^^^^
|
~~~~~
|
||||||
|
|
||||||
**Syntax:** ``#else``
|
**Syntax:** ``#else``
|
||||||
|
|
||||||
@@ -349,14 +349,14 @@ Defines the optional block which is included when the previously defined ``#if``
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
^^^^^^
|
~~~~~~
|
||||||
|
|
||||||
**Syntax:** ``#endif``
|
**Syntax:** ``#endif``
|
||||||
|
|
||||||
Used as terminator for the ``#if``, ``#ifdef``, ``#ifndef`` or subsequent ``#else`` directives.
|
Used as terminator for the ``#if``, ``#ifdef``, ``#ifndef`` or subsequent ``#else`` directives.
|
||||||
|
|
||||||
#error
|
#error
|
||||||
^^^^^^
|
~~~~~~
|
||||||
|
|
||||||
**Syntax:** ``#error <message>``
|
**Syntax:** ``#error <message>``
|
||||||
|
|
||||||
@@ -374,7 +374,7 @@ defined value.
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include
|
#include
|
||||||
^^^^^^^^
|
~~~~~~~~
|
||||||
|
|
||||||
**Syntax:** ``#include "path"``
|
**Syntax:** ``#include "path"``
|
||||||
|
|
||||||
@@ -440,7 +440,7 @@ Example base shader (using the include file we created above):
|
|||||||
}
|
}
|
||||||
|
|
||||||
#pragma
|
#pragma
|
||||||
^^^^^^^
|
~~~~~~~
|
||||||
|
|
||||||
**Syntax:** ``#pragma value``
|
**Syntax:** ``#pragma value``
|
||||||
|
|
||||||
@@ -463,7 +463,7 @@ Built-in defines
|
|||||||
----------------
|
----------------
|
||||||
|
|
||||||
Current renderer
|
Current renderer
|
||||||
^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Since Godot 4.4, you can check which renderer is currently used with the built-in
|
Since Godot 4.4, you can check which renderer is currently used with the built-in
|
||||||
defines ``CURRENT_RENDERER``, ``RENDERER_COMPATIBILITY``, ``RENDERER_MOBILE``,
|
defines ``CURRENT_RENDERER``, ``RENDERER_COMPATIBILITY``, ``RENDERER_MOBILE``,
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ and the :ref:`radiance size <class_Sky_property_radiance_size>` to get the
|
|||||||
desired balance between performance and visual fidelity.
|
desired balance between performance and visual fidelity.
|
||||||
|
|
||||||
Render modes
|
Render modes
|
||||||
^^^^^^^^^^^^
|
------------
|
||||||
|
|
||||||
Subpasses allow you to do more expensive calculations at a lower resolution
|
Subpasses allow you to do more expensive calculations at a lower resolution
|
||||||
to speed up your shaders. For example the following code renders clouds at
|
to speed up your shaders. For example the following code renders clouds at
|
||||||
@@ -137,14 +137,14 @@ a lower resolution than the rest of the sky:
|
|||||||
+--------------------------+-----------------------------------------------------------------------+
|
+--------------------------+-----------------------------------------------------------------------+
|
||||||
|
|
||||||
Built-ins
|
Built-ins
|
||||||
^^^^^^^^^
|
---------
|
||||||
|
|
||||||
Values marked as ``in`` are read-only. Values marked as ``out`` can optionally
|
Values marked as ``in`` are read-only. Values marked as ``out`` can optionally
|
||||||
be written to and will not necessarily contain sensible values. Samplers cannot
|
be written to and will not necessarily contain sensible values. Samplers cannot
|
||||||
be written to so they are not marked.
|
be written to so they are not marked.
|
||||||
|
|
||||||
Global built-ins
|
Global built-ins
|
||||||
^^^^^^^^^^^^^^^^
|
----------------
|
||||||
|
|
||||||
Global built-ins are available everywhere, including in custom functions.
|
Global built-ins are available everywhere, including in custom functions.
|
||||||
|
|
||||||
@@ -194,7 +194,7 @@ There are 4 ``LIGHTX`` lights, accessed as ``LIGHT0``, ``LIGHT1``, ``LIGHT2``, a
|
|||||||
+---------------------------------+--------------------------------------------------------------------------------------------------------------------------+
|
+---------------------------------+--------------------------------------------------------------------------------------------------------------------------+
|
||||||
|
|
||||||
Sky built-ins
|
Sky built-ins
|
||||||
^^^^^^^^^^^^^
|
-------------
|
||||||
|
|
||||||
+-------------------------------+-------------------------------------------------------------------------------------------------+
|
+-------------------------------+-------------------------------------------------------------------------------------------------+
|
||||||
| Built-in | Description |
|
| Built-in | Description |
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ Spatial shaders are highly configurable with different render modes and differen
|
|||||||
write vertex, fragment, and light processor functions to affect how objects are drawn.
|
write vertex, fragment, and light processor functions to affect how objects are drawn.
|
||||||
|
|
||||||
Render modes
|
Render modes
|
||||||
^^^^^^^^^^^^
|
------------
|
||||||
For visual examples of these render modes, see :ref:`Standard Material 3D and ORM Material 3D<doc_standard_material_3d>`.
|
For visual examples of these render modes, see :ref:`Standard Material 3D and ORM Material 3D<doc_standard_material_3d>`.
|
||||||
|
|
||||||
+-------------------------------+------------------------------------------------------------------------------------------------------+
|
+-------------------------------+------------------------------------------------------------------------------------------------------+
|
||||||
@@ -87,14 +87,14 @@ For visual examples of these render modes, see :ref:`Standard Material 3D and OR
|
|||||||
+-------------------------------+------------------------------------------------------------------------------------------------------+
|
+-------------------------------+------------------------------------------------------------------------------------------------------+
|
||||||
|
|
||||||
Built-ins
|
Built-ins
|
||||||
^^^^^^^^^
|
---------
|
||||||
|
|
||||||
Values marked as ``in`` are read-only. Values marked as ``out`` can optionally be written to and will
|
Values marked as ``in`` are read-only. Values marked as ``out`` can optionally be written to and will
|
||||||
not necessarily contain sensible values. Values marked as ``inout`` provide a sensible default
|
not necessarily contain sensible values. Values marked as ``inout`` provide a sensible default
|
||||||
value, and can optionally be written to. Samplers cannot be written to so they are not marked.
|
value, and can optionally be written to. Samplers cannot be written to so they are not marked.
|
||||||
|
|
||||||
Global built-ins
|
Global built-ins
|
||||||
^^^^^^^^^^^^^^^^
|
----------------
|
||||||
|
|
||||||
Global built-ins are available everywhere, including custom functions.
|
Global built-ins are available everywhere, including custom functions.
|
||||||
|
|
||||||
@@ -126,7 +126,7 @@ Global built-ins are available everywhere, including custom functions.
|
|||||||
+-----------------------------+-----------------------------------------------------------------------------------------------------+
|
+-----------------------------+-----------------------------------------------------------------------------------------------------+
|
||||||
|
|
||||||
Vertex built-ins
|
Vertex built-ins
|
||||||
^^^^^^^^^^^^^^^^
|
----------------
|
||||||
|
|
||||||
Vertex data (``VERTEX``, ``NORMAL``, ``TANGENT``, and ``BITANGENT``) are presented in model space
|
Vertex data (``VERTEX``, ``NORMAL``, ``TANGENT``, and ``BITANGENT``) are presented in model space
|
||||||
(also called local space). If not written to, these values will not be modified and be
|
(also called local space). If not written to, these values will not be modified and be
|
||||||
@@ -268,7 +268,7 @@ shader, this value can be used as desired.
|
|||||||
``INV_VIEW_MATRIX`` is the matrix used for rendering the object in that pass, unlike ``MAIN_CAM_INV_VIEW_MATRIX``, which is the matrix of the camera in the scene. In the shadow pass, ``INV_VIEW_MATRIX``'s view is based on the camera that is located at the position of the light.
|
``INV_VIEW_MATRIX`` is the matrix used for rendering the object in that pass, unlike ``MAIN_CAM_INV_VIEW_MATRIX``, which is the matrix of the camera in the scene. In the shadow pass, ``INV_VIEW_MATRIX``'s view is based on the camera that is located at the position of the light.
|
||||||
|
|
||||||
Fragment built-ins
|
Fragment built-ins
|
||||||
^^^^^^^^^^^^^^^^^^
|
------------------
|
||||||
|
|
||||||
The default use of a Godot fragment processor function is to set up the material properties of your object
|
The default use of a Godot fragment processor function is to set up the material properties of your object
|
||||||
and to let the built-in renderer handle the final shading. However, you are not required to use all
|
and to let the built-in renderer handle the final shading. However, you are not required to use all
|
||||||
@@ -421,7 +421,7 @@ these properties, and if you don't write to them, Godot will optimize away the c
|
|||||||
for more information and ways to avoid issues.
|
for more information and ways to avoid issues.
|
||||||
|
|
||||||
Light built-ins
|
Light built-ins
|
||||||
^^^^^^^^^^^^^^^
|
---------------
|
||||||
|
|
||||||
Writing light processor functions is completely optional. You can skip the ``light()`` function by using
|
Writing light processor functions is completely optional. You can skip the ``light()`` function by using
|
||||||
the ``unshaded`` render mode. If no light function is written, Godot will use the material properties
|
the ``unshaded`` render mode. If no light function is written, Godot will use the material properties
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ Below are some special nodes that are worth knowing about. The list is not
|
|||||||
exhaustive and might be expanded with more nodes and examples.
|
exhaustive and might be expanded with more nodes and examples.
|
||||||
|
|
||||||
Expression node
|
Expression node
|
||||||
+++++++++++++++
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The ``Expression`` node allows you to write Godot Shading Language (GLSL-like)
|
The ``Expression`` node allows you to write Godot Shading Language (GLSL-like)
|
||||||
expressions inside your visual shaders. The node has buttons to add any amount
|
expressions inside your visual shaders. The node has buttons to add any amount
|
||||||
@@ -175,7 +175,7 @@ procedures, and use all the power of text-based shaders, such as loops, the
|
|||||||
.. image:: img/vs_expression2.png
|
.. image:: img/vs_expression2.png
|
||||||
|
|
||||||
Reroute node
|
Reroute node
|
||||||
++++++++++++
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
The ``Reroute`` node is used purely for organizational purposes. In a complicated
|
The ``Reroute`` node is used purely for organizational purposes. In a complicated
|
||||||
shader with many nodes you may find that the paths between nodes can make
|
shader with many nodes you may find that the paths between nodes can make
|
||||||
@@ -191,7 +191,7 @@ appears.
|
|||||||
.. image:: img/vs_reroute_handle.webp
|
.. image:: img/vs_reroute_handle.webp
|
||||||
|
|
||||||
Fresnel node
|
Fresnel node
|
||||||
++++++++++++
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
The ``Fresnel`` node is designed to accept normal and view vectors and produces
|
The ``Fresnel`` node is designed to accept normal and view vectors and produces
|
||||||
a scalar which is the saturated dot product between them. Additionally, you can
|
a scalar which is the saturated dot product between them. Additionally, you can
|
||||||
@@ -201,7 +201,7 @@ adding a rim-like lighting effect to objects.
|
|||||||
.. image:: img/vs_fresnel.webp
|
.. image:: img/vs_fresnel.webp
|
||||||
|
|
||||||
Boolean node
|
Boolean node
|
||||||
++++++++++++
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
The ``Boolean`` node can be converted to ``Scalar`` or ``Vector`` to represent
|
The ``Boolean`` node can be converted to ``Scalar`` or ``Vector`` to represent
|
||||||
``0`` or ``1`` and ``(0, 0, 0)`` or ``(1, 1, 1)`` respectively. This property
|
``0`` or ``1`` and ``(0, 0, 0)`` or ``(1, 1, 1)`` respectively. This property
|
||||||
@@ -210,7 +210,7 @@ can be used to enable or disable some effect parts with one click.
|
|||||||
.. image:: img/vs_boolean.gif
|
.. image:: img/vs_boolean.gif
|
||||||
|
|
||||||
If node
|
If node
|
||||||
+++++++
|
~~~~~~~
|
||||||
|
|
||||||
The ``If`` node allows you to setup a vector which will be returned the result
|
The ``If`` node allows you to setup a vector which will be returned the result
|
||||||
of the comparison between ``a`` and ``b``. There are three vectors which can be
|
of the comparison between ``a`` and ``b``. There are three vectors which can be
|
||||||
@@ -221,7 +221,7 @@ comparison threshold – by default it is equal to the minimal value, i.e.
|
|||||||
.. image:: img/vs_if.png
|
.. image:: img/vs_if.png
|
||||||
|
|
||||||
Switch node
|
Switch node
|
||||||
+++++++++++
|
~~~~~~~~~~~
|
||||||
|
|
||||||
The ``Switch`` node returns a vector if the boolean condition is ``true`` or
|
The ``Switch`` node returns a vector if the boolean condition is ``true`` or
|
||||||
``false``. ``Boolean`` was introduced above. If you convert a vector to a true
|
``false``. ``Boolean`` was introduced above. If you convert a vector to a true
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ other functions or to assign values to ``COLOR`` directly.
|
|||||||
.. image:: img/UV.png
|
.. image:: img/UV.png
|
||||||
|
|
||||||
Using ``TEXTURE`` built-in
|
Using ``TEXTURE`` built-in
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The default fragment function reads from the set Sprite2D texture and displays it.
|
The default fragment function reads from the set Sprite2D texture and displays it.
|
||||||
|
|
||||||
@@ -159,7 +159,7 @@ this variable. Use them to redraw the Sprite2D with the texture.
|
|||||||
.. image:: img/blue-tex.png
|
.. image:: img/blue-tex.png
|
||||||
|
|
||||||
Uniform input
|
Uniform input
|
||||||
^^^^^^^^^^^^^
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
Uniform input is used to pass data into a shader that will be the same across
|
Uniform input is used to pass data into a shader that will be the same across
|
||||||
the entire shader.
|
the entire shader.
|
||||||
@@ -191,7 +191,7 @@ declared. If you change the value in the editor, it will overwrite the default
|
|||||||
value you provided in the shader.
|
value you provided in the shader.
|
||||||
|
|
||||||
Interacting with shaders from code
|
Interacting with shaders from code
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
You can change uniforms from code using the function ``set_shader_parameter()``
|
You can change uniforms from code using the function ``set_shader_parameter()``
|
||||||
which is called on the node's material resource. With a Sprite2D node, the
|
which is called on the node's material resource. With a Sprite2D node, the
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ Container types
|
|||||||
Godot provides several container types out of the box as they serve different purposes:
|
Godot provides several container types out of the box as they serve different purposes:
|
||||||
|
|
||||||
Box Containers
|
Box Containers
|
||||||
^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Arranges child controls vertically or horizontally (via :ref:`HBoxContainer <class_HBoxContainer>` and
|
Arranges child controls vertically or horizontally (via :ref:`HBoxContainer <class_HBoxContainer>` and
|
||||||
:ref:`VBoxContainer <class_VBoxContainer>`). In the opposite of the designated direction
|
:ref:`VBoxContainer <class_VBoxContainer>`). In the opposite of the designated direction
|
||||||
@@ -81,7 +81,7 @@ Arranges child controls vertically or horizontally (via :ref:`HBoxContainer <cla
|
|||||||
These containers make use of the *Stretch Ratio* property for children with the *Expand* flag set.
|
These containers make use of the *Stretch Ratio* property for children with the *Expand* flag set.
|
||||||
|
|
||||||
Grid Container
|
Grid Container
|
||||||
^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Arranges child controls in a grid layout (via :ref:`GridContainer <class_GridContainer>`, amount
|
Arranges child controls in a grid layout (via :ref:`GridContainer <class_GridContainer>`, amount
|
||||||
of columns must be specified). Uses both the vertical and horizontal expand flags.
|
of columns must be specified). Uses both the vertical and horizontal expand flags.
|
||||||
@@ -89,7 +89,7 @@ of columns must be specified). Uses both the vertical and horizontal expand flag
|
|||||||
.. image:: img/containers_grid.png
|
.. image:: img/containers_grid.png
|
||||||
|
|
||||||
Margin Container
|
Margin Container
|
||||||
^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Child controls are expanded towards the bounds of this control (via
|
Child controls are expanded towards the bounds of this control (via
|
||||||
:ref:`MarginContainer <class_MarginContainer>`). Padding will be added on the margins
|
:ref:`MarginContainer <class_MarginContainer>`). Padding will be added on the margins
|
||||||
@@ -103,7 +103,7 @@ constants overrides section of each control:
|
|||||||
.. image:: img/containers_margin_constants.png
|
.. image:: img/containers_margin_constants.png
|
||||||
|
|
||||||
Tab Container
|
Tab Container
|
||||||
^^^^^^^^^^^^^
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
Allows you to place several child controls stacked on top of each other (via
|
Allows you to place several child controls stacked on top of each other (via
|
||||||
:ref:`TabContainer <class_TabContainer>`), with only the *current* one visible.
|
:ref:`TabContainer <class_TabContainer>`), with only the *current* one visible.
|
||||||
@@ -119,7 +119,7 @@ The titles are generated from the node names by default (although they can be ov
|
|||||||
Settings such as tab placement and *StyleBox* can be modified in the *TabContainer* theme overrides.
|
Settings such as tab placement and *StyleBox* can be modified in the *TabContainer* theme overrides.
|
||||||
|
|
||||||
Split Container
|
Split Container
|
||||||
^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Accepts only one or two children controls, then places them side to side with a divisor
|
Accepts only one or two children controls, then places them side to side with a divisor
|
||||||
(via :ref:`HSplitContainer <class_HSplitContainer>` and :ref:`VSplitContainer <class_VSplitContainer>`).
|
(via :ref:`HSplitContainer <class_HSplitContainer>` and :ref:`VSplitContainer <class_VSplitContainer>`).
|
||||||
@@ -133,7 +133,7 @@ The divisor can be dragged around to change the size relation between both child
|
|||||||
|
|
||||||
|
|
||||||
PanelContainer
|
PanelContainer
|
||||||
^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~
|
||||||
|
|
||||||
A container that draws a *StyleBox*, then expands children to cover its whole area
|
A container that draws a *StyleBox*, then expands children to cover its whole area
|
||||||
(via :ref:`PanelContainer <class_PanelContainer>`, respecting the *StyleBox* margins).
|
(via :ref:`PanelContainer <class_PanelContainer>`, respecting the *StyleBox* margins).
|
||||||
@@ -144,7 +144,7 @@ It respects both the horizontal and vertical sizing options.
|
|||||||
This container is useful as top-level, or just to add custom backgrounds to sections of a layout.
|
This container is useful as top-level, or just to add custom backgrounds to sections of a layout.
|
||||||
|
|
||||||
ScrollContainer
|
ScrollContainer
|
||||||
^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Accepts a single child node. If this node is bigger than the container, scrollbars will be added
|
Accepts a single child node. If this node is bigger than the container, scrollbars will be added
|
||||||
to allow panning the node around (via :ref:`ScrollContainer <class_ScrollContainer>`). Both
|
to allow panning the node around (via :ref:`ScrollContainer <class_ScrollContainer>`). Both
|
||||||
@@ -160,7 +160,7 @@ Mouse wheel and touch drag (when touch is available) are also valid ways to pan
|
|||||||
As in the example above, one of the most common ways to use this container is together with a *VBoxContainer* as child.
|
As in the example above, one of the most common ways to use this container is together with a *VBoxContainer* as child.
|
||||||
|
|
||||||
AspectRatioContainer
|
AspectRatioContainer
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
A container type that arranges its child controls in a way that preserves their proportions
|
A container type that arranges its child controls in a way that preserves their proportions
|
||||||
automatically when the container is resized.
|
automatically when the container is resized.
|
||||||
@@ -176,7 +176,7 @@ and you want the child elements to scale proportionally without losing their int
|
|||||||
.. image:: img/containers_aspectratio_drag.webp
|
.. image:: img/containers_aspectratio_drag.webp
|
||||||
|
|
||||||
FlowContainer
|
FlowContainer
|
||||||
^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
FlowContainer is a container that arranges its child controls either horizontally or vertically,
|
FlowContainer is a container that arranges its child controls either horizontally or vertically,
|
||||||
(via :ref:`HFlowContainer <class_HFlowContainer>` and via :ref:`VFlowContainer <class_VFlowContainer>`).
|
(via :ref:`HFlowContainer <class_HFlowContainer>` and via :ref:`VFlowContainer <class_VFlowContainer>`).
|
||||||
@@ -190,7 +190,7 @@ useful for creating flexible layouts where the child controls adjust automatical
|
|||||||
.. image:: img/containers_hflow_drag.webp
|
.. image:: img/containers_hflow_drag.webp
|
||||||
|
|
||||||
CenterContainer
|
CenterContainer
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
CenterContainer is a container that automatically keeps all of its child controls centered within it at their minimum size.
|
CenterContainer is a container that automatically keeps all of its child controls centered within it at their minimum size.
|
||||||
It ensures that the child controls are always aligned to the center, making it easier to create centered layouts without manual positioning.
|
It ensures that the child controls are always aligned to the center, making it easier to create centered layouts without manual positioning.
|
||||||
@@ -201,7 +201,7 @@ It ensures that the child controls are always aligned to the center, making it e
|
|||||||
.. image:: img/containers_center_drag.webp
|
.. image:: img/containers_center_drag.webp
|
||||||
|
|
||||||
SubViewportContainer
|
SubViewportContainer
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
This is a special control that will only accept a single *Viewport* node as child, and it will display
|
This is a special control that will only accept a single *Viewport* node as child, and it will display
|
||||||
it as if it was an image (via :ref:`SubViewportContainer <class_SubViewportContainer>`).
|
it as if it was an image (via :ref:`SubViewportContainer <class_SubViewportContainer>`).
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ Advanced font features
|
|||||||
.. _doc_using_fonts_antialiasing:
|
.. _doc_using_fonts_antialiasing:
|
||||||
|
|
||||||
Antialiasing
|
Antialiasing
|
||||||
^^^^^^^^^^^^
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
You can adjust how the font should be smoothed out when rendering by adjusting
|
You can adjust how the font should be smoothed out when rendering by adjusting
|
||||||
*antialiasing* and *hinting*. These are different properties, with different use
|
*antialiasing* and *hinting*. These are different properties, with different use
|
||||||
@@ -251,7 +251,7 @@ exploring.
|
|||||||
.. _doc_using_fonts_hinting:
|
.. _doc_using_fonts_hinting:
|
||||||
|
|
||||||
Hinting
|
Hinting
|
||||||
^^^^^^^
|
~~~~~~~
|
||||||
|
|
||||||
Hinting controls how aggressively glyph edges should be snapped to pixels when
|
Hinting controls how aggressively glyph edges should be snapped to pixels when
|
||||||
rasterizing the font. **None** results in the smoothest appearance, which can
|
rasterizing the font. **None** results in the smoothest appearance, which can
|
||||||
@@ -278,7 +278,7 @@ preference, you may prefer using one hinting mode over the other.
|
|||||||
.. _doc_using_fonts_subpixel_positioning:
|
.. _doc_using_fonts_subpixel_positioning:
|
||||||
|
|
||||||
Subpixel positioning
|
Subpixel positioning
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Subpixel positioning can be adjusted. This is a `FreeType <https://freetype.org/>`__
|
Subpixel positioning can be adjusted. This is a `FreeType <https://freetype.org/>`__
|
||||||
feature that allows glyphs to be rendered more closely to their intended form.
|
feature that allows glyphs to be rendered more closely to their intended form.
|
||||||
@@ -305,7 +305,7 @@ effect at smaller font sizes.
|
|||||||
.. _doc_using_fonts_mipmaps:
|
.. _doc_using_fonts_mipmaps:
|
||||||
|
|
||||||
Mipmaps
|
Mipmaps
|
||||||
^^^^^^^
|
~~~~~~~
|
||||||
|
|
||||||
By default, fonts do not have mipmaps generated to reduce memory usage and speed
|
By default, fonts do not have mipmaps generated to reduce memory usage and speed
|
||||||
up rasterization. However, this can cause downscaled fonts to become grainy. This
|
up rasterization. However, this can cause downscaled fonts to become grainy. This
|
||||||
@@ -324,7 +324,7 @@ resistant to graininess out of the box.
|
|||||||
.. _doc_using_fonts_msdf:
|
.. _doc_using_fonts_msdf:
|
||||||
|
|
||||||
MSDF font rendering
|
MSDF font rendering
|
||||||
^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Multi-channel signed distance field (MSDF) font rendering allows rendering fonts
|
Multi-channel signed distance field (MSDF) font rendering allows rendering fonts
|
||||||
at any size, without having to re-rasterize them when their size changes.
|
at any size, without having to re-rasterize them when their size changes.
|
||||||
@@ -371,7 +371,7 @@ to the Import dock, enable **Multichannel Signed Distance Field**, then click
|
|||||||
.. _doc_using_fonts_emoji:
|
.. _doc_using_fonts_emoji:
|
||||||
|
|
||||||
Using emoji
|
Using emoji
|
||||||
^^^^^^^^^^^
|
~~~~~~~~~~~
|
||||||
|
|
||||||
Godot has limited support for emoji fonts:
|
Godot has limited support for emoji fonts:
|
||||||
|
|
||||||
@@ -421,7 +421,7 @@ emoji font:
|
|||||||
It's possible to use a system font as a fallback font too.
|
It's possible to use a system font as a fallback font too.
|
||||||
|
|
||||||
Using icon fonts
|
Using icon fonts
|
||||||
^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Tools like `Fontello <https://fontello.com/>`__ can be used to generate font
|
Tools like `Fontello <https://fontello.com/>`__ can be used to generate font
|
||||||
files containing vectors imported from SVG files. This can be used to render
|
files containing vectors imported from SVG files. This can be used to render
|
||||||
@@ -465,7 +465,7 @@ reserved for use by custom fonts and doesn't contain standard glyphs by design.
|
|||||||
.. _doc_using_fonts_font_fallbacks:
|
.. _doc_using_fonts_font_fallbacks:
|
||||||
|
|
||||||
Font fallbacks
|
Font fallbacks
|
||||||
^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Godot supports defining one or more fallbacks when the main font lacks a glyph
|
Godot supports defining one or more fallbacks when the main font lacks a glyph
|
||||||
to be displayed. There are 2 main use cases for defining font fallbacks:
|
to be displayed. There are 2 main use cases for defining font fallbacks:
|
||||||
@@ -513,7 +513,7 @@ fallbacks.
|
|||||||
.. _doc_using_fonts_variable_fonts:
|
.. _doc_using_fonts_variable_fonts:
|
||||||
|
|
||||||
Variable fonts
|
Variable fonts
|
||||||
^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Godot has full support for `variable fonts <https://variablefonts.io/>`__, which
|
Godot has full support for `variable fonts <https://variablefonts.io/>`__, which
|
||||||
allow you to use a single font file to represent various font weights and styles
|
allow you to use a single font file to represent various font weights and styles
|
||||||
@@ -592,7 +592,7 @@ places:
|
|||||||
Saving FontVariation to an external resource file
|
Saving FontVariation to an external resource file
|
||||||
|
|
||||||
Faux bold and italic
|
Faux bold and italic
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
When writing text in bold or italic, using font variants specifically designed
|
When writing text in bold or italic, using font variants specifically designed
|
||||||
for this looks better. Spacing between glyphs will be more consistent when using
|
for this looks better. Spacing between glyphs will be more consistent when using
|
||||||
@@ -630,7 +630,7 @@ character transform to a positive value will italicize the text. Recommended
|
|||||||
values are between ``0.2`` and ``0.4`` depending on the font.
|
values are between ``0.2`` and ``0.4`` depending on the font.
|
||||||
|
|
||||||
Adjusting font spacing
|
Adjusting font spacing
|
||||||
^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
For stylistic purposes or for better readability, you may want to adjust how a
|
For stylistic purposes or for better readability, you may want to adjust how a
|
||||||
font is presented in Godot.
|
font is presented in Godot.
|
||||||
@@ -659,7 +659,7 @@ displayed with stretching.
|
|||||||
.. _doc_using_fonts_opentype_font_features:
|
.. _doc_using_fonts_opentype_font_features:
|
||||||
|
|
||||||
OpenType font features
|
OpenType font features
|
||||||
^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Godot supports enabling OpenType font features, which are a standardized way to
|
Godot supports enabling OpenType font features, which are a standardized way to
|
||||||
define alternate characters that can be toggled without having to swap font
|
define alternate characters that can be toggled without having to swap font
|
||||||
@@ -738,7 +738,7 @@ features, then unchecking them in the inspector:
|
|||||||
.. _doc_using_fonts_system_fonts:
|
.. _doc_using_fonts_system_fonts:
|
||||||
|
|
||||||
System fonts
|
System fonts
|
||||||
^^^^^^^^^^^^
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
.. warning::
|
.. warning::
|
||||||
|
|
||||||
@@ -827,7 +827,7 @@ for details.
|
|||||||
.. _doc_using_fonts_font_prerendering:
|
.. _doc_using_fonts_font_prerendering:
|
||||||
|
|
||||||
Font prerendering
|
Font prerendering
|
||||||
^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
When using traditional rasterized fonts, Godot caches glyphs on a per-font and
|
When using traditional rasterized fonts, Godot caches glyphs on a per-font and
|
||||||
per-size basis. This reduces stuttering, but it can still occur the first time a
|
per-size basis. This reduces stuttering, but it can still occur the first time a
|
||||||
@@ -949,7 +949,7 @@ covering many more languages, such as French, German and Spanish. For Russian,
|
|||||||
**Cyrillic** needs to be enabled, and so on.
|
**Cyrillic** needs to be enabled, and so on.
|
||||||
|
|
||||||
Default project font properties
|
Default project font properties
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
In the **GUI > Theme** section of the advanced Project Settings, you can choose
|
In the **GUI > Theme** section of the advanced Project Settings, you can choose
|
||||||
how the default font should be rendered:
|
how the default font should be rendered:
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ Now you need to add 3 components into your scene for each hand:
|
|||||||
.. image:: img/openxr_hand_tracking_nodes.webp
|
.. image:: img/openxr_hand_tracking_nodes.webp
|
||||||
|
|
||||||
Hand tracking node
|
Hand tracking node
|
||||||
^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The hand tracking system uses separate hand trackers to track the position of the player's hands
|
The hand tracking system uses separate hand trackers to track the position of the player's hands
|
||||||
within our tracking space.
|
within our tracking space.
|
||||||
@@ -120,7 +120,7 @@ For this you need to add an :ref:`XRNode3D <class_xrnode3d>` node to your ``XROr
|
|||||||
or make this node visible if tracking data is available.
|
or make this node visible if tracking data is available.
|
||||||
|
|
||||||
Rigged hand mesh
|
Rigged hand mesh
|
||||||
^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
In order to display our hand we need a hand mesh that is properly rigged and skinned.
|
In order to display our hand we need a hand mesh that is properly rigged and skinned.
|
||||||
For this Godot uses the hand bone structure as defined for the :ref:`Godot Humanoid <class_skeletonprofilehumanoid>`
|
For this Godot uses the hand bone structure as defined for the :ref:`Godot Humanoid <class_skeletonprofilehumanoid>`
|
||||||
@@ -133,7 +133,7 @@ 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 <class_skeleton3d>` node.
|
We also need to enable editable children to gain access to our :ref:`Skeleton3D <class_skeleton3d>` node.
|
||||||
|
|
||||||
The hand skeleton modifier
|
The hand skeleton modifier
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Finally we need to add a :ref:`XRHandModifier3D <class_xrhandmodifier3d>` node as a child to our ``Skeleton3D`` node.
|
Finally we need to add a :ref:`XRHandModifier3D <class_xrhandmodifier3d>` node as a child to our ``Skeleton3D`` node.
|
||||||
This node will obtain the finger tracking data from OpenXR and apply it the hand model.
|
This node will obtain the finger tracking data from OpenXR and apply it the hand model.
|
||||||
@@ -216,7 +216,7 @@ a number of extensions were added to the specification that provide some basic g
|
|||||||
and can be used with the action map.
|
and can be used with the action map.
|
||||||
|
|
||||||
The hand interaction profile
|
The hand interaction profile
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The `hand interaction profile extension <https://github.khronos.org/OpenXR-Inventory/extension_support.html#XR_EXT_hand_interaction>`_
|
The `hand interaction profile extension <https://github.khronos.org/OpenXR-Inventory/extension_support.html#XR_EXT_hand_interaction>`_
|
||||||
is a new core extension which supports pinch, grasp, and poke gestures and related poses.
|
is a new core extension which supports pinch, grasp, and poke gestures and related poses.
|
||||||
@@ -257,7 +257,7 @@ thus seamlessly switch between controller and hand tracking input.
|
|||||||
You need to enable the hand interaction profile extension in the OpenXR project settings.
|
You need to enable the hand interaction profile extension in the OpenXR project settings.
|
||||||
|
|
||||||
Microsoft hand interaction profile
|
Microsoft hand interaction profile
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The `Microsoft hand interaction profile extension <https://github.khronos.org/OpenXR-Inventory/extension_support.html#XR_MSFT_hand_interaction>`_
|
The `Microsoft hand interaction profile extension <https://github.khronos.org/OpenXR-Inventory/extension_support.html#XR_MSFT_hand_interaction>`_
|
||||||
was introduced by Microsoft and loosely mimics the simple controller profile.
|
was introduced by Microsoft and loosely mimics the simple controller profile.
|
||||||
@@ -280,7 +280,7 @@ With this setup the normal ``left_hand`` and ``right_hand`` trackers are used an
|
|||||||
thus seamlessly switch between controller and hand tracking input.
|
thus seamlessly switch between controller and hand tracking input.
|
||||||
|
|
||||||
HTC hand interaction profile
|
HTC hand interaction profile
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The `HTC hand interaction profile extension <https://github.khronos.org/OpenXR-Inventory/extension_support.html#XR_HTC_hand_interaction>`_
|
The `HTC hand interaction profile extension <https://github.khronos.org/OpenXR-Inventory/extension_support.html#XR_HTC_hand_interaction>`_
|
||||||
was introduced by HTC and is defined similarly to the Microsoft extension.
|
was introduced by HTC and is defined similarly to the Microsoft extension.
|
||||||
@@ -296,7 +296,7 @@ This means that extra logic needs to be implemented to switch between the defaul
|
|||||||
and the HTC specific trackers when the user puts down, or picks up, their controller.
|
and the HTC specific trackers when the user puts down, or picks up, their controller.
|
||||||
|
|
||||||
Simple controller profile
|
Simple controller profile
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The simple controller profile is a standard core profile defined as a fallback profile
|
The simple controller profile is a standard core profile defined as a fallback profile
|
||||||
when a controller is used for which no profile exists.
|
when a controller is used for which no profile exists.
|
||||||
@@ -337,7 +337,7 @@ thus seamlessly switch between controller and hand tracking input.
|
|||||||
and simple controller profiles.
|
and simple controller profiles.
|
||||||
|
|
||||||
Gesture based input
|
Gesture based input
|
||||||
^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
If the platform doesn't support any interaction profiles when hand tracking is used,
|
If the platform doesn't support any interaction profiles when hand tracking is used,
|
||||||
or if you're building an application where you need more complicated gesture support
|
or if you're building an application where you need more complicated gesture support
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ depending on the XR system used.
|
|||||||
In OpenXR these scenarios are well defined and selected by setting a reference space.
|
In OpenXR these scenarios are well defined and selected by setting a reference space.
|
||||||
|
|
||||||
Local
|
Local
|
||||||
^^^^^
|
~~~~~
|
||||||
|
|
||||||
The local reference space places our origin point at the player's head by default.
|
The local reference space places our origin point at the player's head by default.
|
||||||
Some XR runtimes will do this each time your game starts, others will make the position persist over sessions.
|
Some XR runtimes will do this each time your game starts, others will make the position persist over sessions.
|
||||||
@@ -83,7 +83,7 @@ so your game can react accordingly.
|
|||||||
You should **not** call ``center_on_hmd`` when using this reference space.
|
You should **not** call ``center_on_hmd`` when using this reference space.
|
||||||
|
|
||||||
Stage
|
Stage
|
||||||
^^^^^
|
~~~~~
|
||||||
|
|
||||||
The stage reference space is our default reference space and places our origin point at the center of our play space.
|
The stage reference space is our default reference space and places our origin point at the center of our play space.
|
||||||
For XR runtimes that allow you to draw out a guardian boundary this location and its orientation is often set by the user.
|
For XR runtimes that allow you to draw out a guardian boundary this location and its orientation is often set by the user.
|
||||||
@@ -111,7 +111,7 @@ In Godot you can do this by calling the ``center_on_hmd`` function on the :ref:`
|
|||||||
Any other XR tracked elements such as controllers or anchors will also be adjusted accordingly.
|
Any other XR tracked elements such as controllers or anchors will also be adjusted accordingly.
|
||||||
|
|
||||||
Local Floor
|
Local Floor
|
||||||
^^^^^^^^^^^
|
~~~~~~~~~~~
|
||||||
|
|
||||||
The local floor reference space is similar to the local reference space as it positions the origin point where the player is.
|
The local floor reference space is similar to the local reference space as it positions the origin point where the player is.
|
||||||
In this mode however the height of the player is kept.
|
In this mode however the height of the player is kept.
|
||||||
@@ -222,7 +222,7 @@ Extensions
|
|||||||
This subsection provides access to various optional OpenXR extensions.
|
This subsection provides access to various optional OpenXR extensions.
|
||||||
|
|
||||||
Hand Tracking
|
Hand Tracking
|
||||||
^^^^^^^^^^^^^
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
This enables the hand tracking extension when supported by the device used. This is on by default for legacy reasons.
|
This enables the hand tracking extension when supported by the device used. This is on by default for legacy reasons.
|
||||||
The hand tracking extension provides access to data that allows you to visualise the user's hands with correct finger positions.
|
The hand tracking extension provides access to data that allows you to visualise the user's hands with correct finger positions.
|
||||||
@@ -234,7 +234,7 @@ If your game only supports controllers this should be turned off.
|
|||||||
See the chapter on :ref:`hand tracking <doc_openxr_hand_tracking>` for additional details.
|
See the chapter on :ref:`hand tracking <doc_openxr_hand_tracking>` for additional details.
|
||||||
|
|
||||||
Eye Gaze Interaction
|
Eye Gaze Interaction
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
This enables the eye gaze interaction extension when supported by the device used.
|
This enables the eye gaze interaction extension when supported by the device used.
|
||||||
When enabled we will get feedback from eye tracking through a pose situated between the user's eyes
|
When enabled we will get feedback from eye tracking through a pose situated between the user's eyes
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user