Merge pull request #9339 from mhilbrunner/docs-4.2-cherrypicks
4.2 cherrypicks
@@ -360,7 +360,8 @@ article ol,
|
||||
}
|
||||
|
||||
body,
|
||||
.rst-content table.docutils thead {
|
||||
.rst-content table.docutils thead,
|
||||
.rst-content table.docutils caption {
|
||||
color: var(--body-color);
|
||||
}
|
||||
|
||||
@@ -667,6 +668,7 @@ footer {
|
||||
}
|
||||
|
||||
.wy-body-for-nav {
|
||||
position: relative;
|
||||
background-color: var(--content-wrap-background-color);
|
||||
}
|
||||
|
||||
|
||||
@@ -289,7 +289,7 @@ Rendering
|
||||
- Does not rely on run-time mesh generation. This means decals can be used on
|
||||
complex skinned meshes with no performance penalty, even if the decal moves every frame.
|
||||
- Support for nearest, bilinear, trilinear or anisotropic texture filtering (configured globally).
|
||||
- Optional distance fade system to fade distant lights and their shadows, improving performance.
|
||||
- Optional distance fade system to fade distant decals, improving performance.
|
||||
- When using the Forward+ backend (default on desktop), decals are
|
||||
rendered with clustered forward optimizations to decrease their individual cost.
|
||||
Clustered rendering also lifts any limits on the number of decals that can be used on a mesh.
|
||||
|
||||
@@ -198,8 +198,8 @@ While Godot contributors aren't working under any deadlines, we strive to
|
||||
publish minor releases relatively frequently.
|
||||
|
||||
In particular, after the very length release cycle for 4.0, we are pivoting to
|
||||
a faster paced development workflow, with the 4.1 release expected within late
|
||||
Q2 / early Q3 2023.
|
||||
a faster paced development workflow, 4.1 released 4 months after 4.0, and 4.2
|
||||
released 4 months after 4.1
|
||||
|
||||
Frequent minor releases will enable us to ship new features faster (possibly
|
||||
as experimental), get user feedback quickly, and iterate to improve those
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
:allow_comments: False
|
||||
|
||||
.. _doc_system_requirements:
|
||||
|
||||
System requirements
|
||||
|
||||
@@ -15,7 +15,7 @@ Requirements
|
||||
|
||||
To compile export templates for the Web, the following is required:
|
||||
|
||||
- `Emscripten 1.39.9+ <https://emscripten.org>`__.
|
||||
- `Emscripten 3.1.39+ <https://emscripten.org>`__.
|
||||
- `Python 3.6+ <https://www.python.org/>`__.
|
||||
- `SCons 3.0+ <https://scons.org/pages/download.html>`__ build system.
|
||||
|
||||
@@ -25,6 +25,10 @@ To compile export templates for the Web, the following is required:
|
||||
For a general overview of SCons usage for Godot, see
|
||||
:ref:`doc_introduction_to_the_buildsystem`.
|
||||
|
||||
.. note:: Emscripten 3.1.39+ is recommended, but older 3.x versions are known to work.
|
||||
|
||||
Please note that the minimum requirement for GDExtension support is 3.1.14.
|
||||
|
||||
Building export templates
|
||||
-------------------------
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ To run and debug the project you need to create a new configuration in the ``lau
|
||||
|
||||
The name under ``program`` depends on your build configuration,
|
||||
e.g. ``godot.linuxbsd.editor.dev.x86_64`` for 64-bit LinuxBSD platform with
|
||||
``platform=editor`` and ``dev_build=yes``.
|
||||
``target=editor`` and ``dev_build=yes``.
|
||||
|
||||
If you run into any issues, ask for help in one of
|
||||
`Godot's community channels <https://godotengine.org/community>`__.
|
||||
|
||||
@@ -272,7 +272,7 @@ RenderingDevice presents a similar level of abstraction as Metal or WebGPU.
|
||||
|
||||
**Vulkan RenderingDevice implementation:**
|
||||
|
||||
- `drivers/vulkan/rendering_device_driver_vulkan.cpp <https://github.com/godotengine/godot/blob/4.2/drivers/vulkan/rendering_device_driver_vulkan.cpp>`__
|
||||
- `drivers/vulkan/rendering_device_vulkan.cpp <https://github.com/godotengine/godot/blob/4.2/drivers/vulkan/rendering_device_vulkan.cpp>`__
|
||||
|
||||
**Direct3D 12 RenderingDevice implementation:**
|
||||
|
||||
|
||||
@@ -48,9 +48,9 @@ Start by declaring the member variables this object will need:
|
||||
Using the ``export`` keyword on the first variable ``speed`` allows us to set
|
||||
its value in the Inspector. This can be handy for values that you want to be
|
||||
able to adjust just like a node's built-in properties. Click on the ``Player``
|
||||
node and you'll see the property now appears in the "Script Variables" section
|
||||
of the Inspector. Remember, if you change the value here, it will override the
|
||||
value written in the script.
|
||||
node and you'll see the property now appears in the Inspector in a new section
|
||||
with the name of the script. Remember, if you change the value here, it will
|
||||
override the value written in the script.
|
||||
|
||||
.. warning::
|
||||
|
||||
@@ -247,7 +247,7 @@ the ``_process`` function (make sure it's not indented under the `else`):
|
||||
Using this value ensures that your movement will remain consistent even
|
||||
if the frame rate changes.
|
||||
|
||||
Click "Play Scene" (:kbd:`F6`, :kbd:`Cmd + R` on macOS) and confirm you can move
|
||||
Click "Run Current Scene" (:kbd:`F6`, :kbd:`Cmd + R` on macOS) and confirm you can move
|
||||
the player around the screen in all directions.
|
||||
|
||||
.. warning:: If you get an error in the "Debugger" panel that says
|
||||
|
||||
@@ -100,7 +100,7 @@ to instance.
|
||||
}
|
||||
|
||||
Click the ``Main`` node and you will see the ``Mob Scene`` property in the Inspector
|
||||
under "Script Variables".
|
||||
under "Main.gd".
|
||||
|
||||
You can assign this property's value in two ways:
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 10 KiB |
@@ -234,7 +234,7 @@ Connect the signal to the ``Mob``
|
||||
|
||||
This will take you back to the script editor and add a new function for you,
|
||||
``_on_visible_on_screen_notifier_3d_screen_exited()``. From it, call the ``queue_free()``
|
||||
method. This function destroy the instance it's called on.
|
||||
method. This function destroys the instance it's called on.
|
||||
|
||||
.. tabs::
|
||||
.. code-tab:: gdscript GDScript
|
||||
|
||||
|
Before Width: | Height: | Size: 8.0 KiB |
BIN
getting_started/step_by_step/img/instancing_ball_duplicated.webp
Normal file
|
After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 34 KiB |
BIN
getting_started/step_by_step/img/instancing_ball_instanced.webp
Normal file
|
After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 7.2 KiB |
BIN
getting_started/step_by_step/img/instancing_ball_moved.webp
Normal file
|
After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 4.5 KiB |
BIN
getting_started/step_by_step/img/instancing_ball_scene.webp
Normal file
|
After Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 8.6 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 9.8 KiB |
|
Before Width: | Height: | Size: 5.1 KiB |
BIN
getting_started/step_by_step/img/instancing_import_button.webp
Normal file
|
After Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 9.8 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 27 KiB |
BIN
getting_started/step_by_step/img/instancing_main_scene.webp
Normal file
|
After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
BIN
getting_started/step_by_step/img/instancing_scene_tabs.webp
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 15 KiB |
BIN
getting_started/step_by_step/img/signals_12_node_connection.webp
Normal file
|
After Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 13 KiB |
BIN
getting_started/step_by_step/img/signals_17_custom_signal.webp
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
@@ -18,13 +18,13 @@ Here's an example of a ball. It's composed of a :ref:`RigidBody2D
|
||||
and bounce on walls, a :ref:`Sprite2D <class_Sprite2D>` node, and a
|
||||
:ref:`CollisionShape2D <class_CollisionShape2D>`.
|
||||
|
||||
.. image:: img/instancing_ball_scene.png
|
||||
.. image:: img/instancing_ball_scene.webp
|
||||
|
||||
Once you saved a scene, it works as a blueprint: you can reproduce it in other
|
||||
Once you have saved a scene, it works as a blueprint: you can reproduce it in other
|
||||
scenes as many times as you'd like. Replicating an object from a template like
|
||||
this is called **instancing**.
|
||||
|
||||
.. image:: img/instancing_ball_instances_example.png
|
||||
.. image:: img/instancing_ball_instances_example.webp
|
||||
|
||||
As we mentioned in the previous part, instanced scenes behave like a node: the
|
||||
editor hides their content by default. When you instance the Ball, you only see
|
||||
@@ -47,20 +47,16 @@ The Project Manager is accessed by opening Godot, or if you already have Godot o
|
||||
|
||||
In the Project Manager, click the *Import* button to import the project.
|
||||
|
||||
.. image:: img/instancing_import_button.png
|
||||
|
||||
In the pop-up that appears, click the browse button and navigate to the folder
|
||||
you extracted.
|
||||
|
||||
.. image:: img/instancing_import_browse.png
|
||||
.. image:: img/instancing_import_button.webp
|
||||
|
||||
In the pop-up that appears navigate to the folder you extracted.
|
||||
Double-click the ``project.godot`` file to open it.
|
||||
|
||||
.. image:: img/instancing_import_project_file.png
|
||||
.. image:: img/instancing_import_project_file.webp
|
||||
|
||||
Finally, click the Import & Edit button.
|
||||
|
||||
.. image:: img/instancing_import_and_edit_button.png
|
||||
.. image:: img/instancing_import_and_edit_button.webp
|
||||
|
||||
The project contains two packed scenes: ``main.tscn``, containing walls against
|
||||
which the ball collides, and ``ball.tscn``. The Main scene should open
|
||||
@@ -68,25 +64,25 @@ automatically. If you're seeing an empty 3D scene instead of the main scene, cli
|
||||
|
||||
.. image:: img/instancing_2d_scene_select.webp
|
||||
|
||||
.. image:: img/instancing_main_scene.png
|
||||
.. image:: img/instancing_main_scene.webp
|
||||
|
||||
Let's add a ball as a child of the Main node. In the Scene dock, select the Main
|
||||
node. Then, click the link icon at the top of the scene dock. This button allows
|
||||
you to add an instance of a scene as a child of the currently selected node.
|
||||
|
||||
.. image:: img/instancing_scene_link_button.png
|
||||
.. image:: img/instancing_scene_link_button.webp
|
||||
|
||||
Double-click the ball scene to instance it.
|
||||
|
||||
.. image:: img/instancing_instance_child_window.png
|
||||
.. image:: img/instancing_instance_child_window.webp
|
||||
|
||||
The ball appears in the top-left corner of the viewport.
|
||||
|
||||
.. image:: img/instancing_ball_instanced.png
|
||||
.. image:: img/instancing_ball_instanced.webp
|
||||
|
||||
Click on it and drag it towards the center of the view.
|
||||
|
||||
.. image:: img/instancing_ball_moved.png
|
||||
.. image:: img/instancing_ball_moved.webp
|
||||
|
||||
Play the game by pressing :kbd:`F5` (:kbd:`Cmd + B` on macOS). You should see it fall.
|
||||
|
||||
@@ -94,11 +90,11 @@ Now, we want to create more instances of the Ball node. With the ball still
|
||||
selected, press :kbd:`Ctrl + D` (:kbd:`Cmd + D` on macOS) to call the duplicate
|
||||
command. Click and drag to move the new ball to a different location.
|
||||
|
||||
.. image:: img/instancing_ball_duplicated.png
|
||||
.. image:: img/instancing_ball_duplicated.webp
|
||||
|
||||
You can repeat this process until you have several in the scene.
|
||||
|
||||
.. image:: img/instancing_main_scene_with_balls.png
|
||||
.. image:: img/instancing_main_scene_with_balls.webp
|
||||
|
||||
Play the game again. You should now see every ball fall independently from one
|
||||
another. This is what instances do. Each is an independent reproduction of a
|
||||
@@ -135,7 +131,7 @@ causes all instances to update accordingly.
|
||||
Let's now adjust an individual instance. Head back to the Main scene by clicking
|
||||
on the corresponding tab above the viewport.
|
||||
|
||||
.. image:: img/instancing_scene_tabs.png
|
||||
.. image:: img/instancing_scene_tabs.webp
|
||||
|
||||
Select one of the instanced Ball nodes and, in the Inspector, set its Gravity
|
||||
Scale value to ``10``.
|
||||
|
||||
@@ -58,7 +58,7 @@ you or a player runs the game.
|
||||
|
||||
On top of acting like nodes, scenes have the following characteristics:
|
||||
|
||||
1. They always have one root node, like the "Character" in our example.
|
||||
1. They always have one root node, like the "Player" in our example.
|
||||
2. You can save them to your local drive and load them later.
|
||||
3. You can create as many instances of a scene as you'd like. You could have
|
||||
five or ten characters in your game, created from your Character scene.
|
||||
|
||||
@@ -37,7 +37,7 @@ We will now use a signal to make our Godot icon from the previous lesson
|
||||
Scene setup
|
||||
-----------
|
||||
|
||||
To add a button to our game, we will create a new main scene which will include
|
||||
To add a button to our game, we will create a new scene which will include
|
||||
both a :ref:`Button <class_button>` and the ``sprite_2d.tscn`` scene we created in
|
||||
the :ref:`doc_scripting_first_script` lesson.
|
||||
|
||||
@@ -108,7 +108,7 @@ The dock displays a list of signals available on the selected node.
|
||||
|
||||
Double-click the "pressed" signal to open the node connection window.
|
||||
|
||||
.. image:: img/signals_12_node_connection.png
|
||||
.. image:: img/signals_12_node_connection.webp
|
||||
|
||||
There, you can connect the signal to the Sprite2D node. The node needs a
|
||||
receiver method, a function that Godot will call when the Button emits the
|
||||
@@ -442,7 +442,7 @@ reaches 0.
|
||||
Your signals work the same way as built-in ones: they appear in the Node tab and
|
||||
you can connect to them like any other.
|
||||
|
||||
.. image:: img/signals_17_custom_signal.png
|
||||
.. image:: img/signals_17_custom_signal.webp
|
||||
|
||||
To emit a signal in your scripts, call ``emit()`` on the signal.
|
||||
|
||||
@@ -472,7 +472,7 @@ names between parentheses:
|
||||
.. tabs::
|
||||
.. code-tab:: gdscript GDScript
|
||||
|
||||
extends Node
|
||||
extends Node2D
|
||||
|
||||
signal health_changed(old_value, new_value)
|
||||
|
||||
|
||||
12
index.rst
@@ -51,17 +51,7 @@ into your language, or talk to us on the ``#documentation`` channel on the
|
||||
Offline documentation
|
||||
---------------------
|
||||
|
||||
To browse the documentation offline, you can use the mirror of the documentation
|
||||
hosted on `DevDocs <https://devdocs.io/godot/>`__. To enable offline browsing on
|
||||
DevDocs, you need to:
|
||||
|
||||
- Click the three dots in the top-left corner, choose **Preferences**.
|
||||
- Enable the desired version of the Godot documentation by checking the box
|
||||
next to it in the sidebar.
|
||||
- Click the three dots in the top-left corner, choose **Offline data**.
|
||||
- Click the **Install** link next to the Godot documentation.
|
||||
|
||||
You can also `download an HTML copy <https://nightly.link/godotengine/godot-docs/workflows/build_offline_docs/master/godot-docs-html-master.zip>`__
|
||||
To browse the documentation offline, you can `download an HTML copy <https://nightly.link/godotengine/godot-docs/workflows/build_offline_docs/master/godot-docs-html-master.zip>`__
|
||||
for offline reading (updated every Monday). Extract the ZIP archive then open
|
||||
the top-level ``index.html`` in a web browser.
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ the following order:
|
||||
|
||||
.. code-tab:: csharp
|
||||
|
||||
var screenCord = GetViewport().GetScreenTransform() * GetGlobalTransformWithCanvas() * localPos;
|
||||
var screenCoord = GetViewport().GetScreenTransform() * GetGlobalTransformWithCanvas() * localPos;
|
||||
|
||||
Keep in mind, however, that it is generally not desired to work with screen coordinates. The
|
||||
recommended approach is to simply work in Canvas coordinates
|
||||
|
||||
|
Before Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 25 KiB |
BIN
tutorials/3d/img/spatial_material6.webp
Normal file
|
After Width: | Height: | Size: 16 KiB |
@@ -44,7 +44,7 @@ When the ``Disable Z`` property is enabled, particles will not move along the Z-
|
||||
Whether that is going to be the particle system's local Z-axis or the world Z-axis is
|
||||
determined by the :ref:`Local Coords <doc_3d_particles_properties_draw>` property.
|
||||
|
||||
The ``Daming as Friction`` property changes the behavior of damping from a constant
|
||||
The ``Damping as Friction`` property changes the behavior of damping from a constant
|
||||
deceleration to a deceleration based on speed.
|
||||
|
||||
Spawn
|
||||
|
||||
@@ -4,7 +4,7 @@ Using the SurfaceTool
|
||||
=====================
|
||||
|
||||
The :ref:`SurfaceTool <class_surfacetool>` provides a useful interface for constructing geometry.
|
||||
The interface is similar to the :ref:`ImmediateMesh <class_ImmediateMesh>` node. You
|
||||
The interface is similar to the :ref:`ImmediateMesh <class_ImmediateMesh>` class. You
|
||||
set each per-vertex attribute (e.g. normal, uv, color) and then when you add a vertex it
|
||||
captures the attributes.
|
||||
|
||||
|
||||
@@ -223,7 +223,8 @@ Textures used in 2D don't have mipmaps enabled by default, which means only 3D
|
||||
rendering is affected unless you enabled mipmaps on 2D textures in the Import
|
||||
dock.
|
||||
|
||||
The formula used to determine the texture mipmap bias is: TODO
|
||||
The formula used to determine the texture mipmap bias is:
|
||||
``log2f(min(scaling_3d_scale, 1.0)) + custom_texture_mipmap_bias``
|
||||
|
||||
To counteract the blurriness added by some antialiasing methods, Godot also adds
|
||||
a ``-0.25`` offset when FXAA is enabled, and a ``-0.5`` offset when TAA is
|
||||
|
||||
@@ -244,46 +244,49 @@ Shading
|
||||
Shading mode
|
||||
~~~~~~~~~~~~
|
||||
|
||||
Godot has a more or less uniform cost per pixel thanks to depth pre-pass. All
|
||||
lighting calculations are made by running the lighting shader on every pixel.
|
||||
Godot has a more or less uniform cost per pixel thanks to the depth pre-pass.
|
||||
All lighting calculations are made by running the lighting shader on every
|
||||
pixel.
|
||||
|
||||
As these calculations are costly, performance can be brought down considerably
|
||||
in some corner cases such as drawing several layers of transparency (which is
|
||||
common in particle systems). Switching to per-vertex lighting may help in these
|
||||
cases.
|
||||
common in particle systems). Switching to the **Unshaded** shading mode may help improve
|
||||
performance in these cases, especially when the camera is close to particles.
|
||||
|
||||
Additionally, on low-end or mobile devices, switching to vertex lighting
|
||||
Additionally, on low-end or mobile devices, switching to unshaded rendering
|
||||
can considerably increase rendering performance.
|
||||
|
||||
.. image:: img/spatial_material2.png
|
||||
|
||||
Keep in mind that when vertex lighting is enabled, only directional lighting
|
||||
can produce shadows (for performance reasons).
|
||||
|
||||
However, in some cases you might want to show just the albedo (color) and
|
||||
ignore the rest. To do this you can set the shading mode to unshaded
|
||||
|
||||
.. image:: img/spatial_material26.png
|
||||
|
||||
Keep in mind that when unshaded rendering is enabled, lights will not affect the
|
||||
material at all.
|
||||
|
||||
.. note::
|
||||
|
||||
**Per-Vertex** shading is listed as an option in the shading mode property.
|
||||
However, per-vertex shading is currently unimplemented and will act
|
||||
identical to per-pixel shading.
|
||||
|
||||
Support for per-vertex shading is planned to be reimplemented in a future
|
||||
Godot release.
|
||||
|
||||
Diffuse Mode
|
||||
~~~~~~~~~~~~
|
||||
|
||||
Specifies the algorithm used by diffuse scattering of light when hitting
|
||||
the object. The default is *Burley*. Other modes are also available:
|
||||
the object. The default is **Burley**. Other modes are also available:
|
||||
|
||||
* **Burley:** Default mode, the original Disney Principled PBS diffuse algorithm.
|
||||
* **Lambert:** Is not affected by roughness.
|
||||
* **Lambert Wrap:** Extends Lambert to cover more than 90 degrees when
|
||||
roughness increases. Works great for hair and simulating cheap
|
||||
subsurface scattering. This implementation is energy conserving.
|
||||
* **Oren Nayar:** This implementation aims to take microsurfacing into account
|
||||
(via roughness). Works well for clay-like materials and some types of cloth.
|
||||
* **Toon:** Provides a hard cut for lighting, with smoothing affected by roughness.
|
||||
It is recommended you disable sky contribution from your environment's
|
||||
ambient light settings or disable ambient light in the StandardMaterial3D
|
||||
to achieve a better effect.
|
||||
|
||||
.. image:: img/spatial_material6.png
|
||||
.. image:: img/spatial_material6.webp
|
||||
|
||||
Specular Mode
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
@@ -21,9 +21,9 @@ that the skeleton is reset to its T-pose or default rest pose.
|
||||
Bone Weights
|
||||
------------
|
||||
|
||||
Blender put rigged mesh vertices which has no bone weights at its original
|
||||
Blender puts rigged mesh vertices which have no bone weights at their original
|
||||
position, but these vertices would be placed at (0, 0, 0) in Godot, making the mesh
|
||||
deformed. Therefore, the exporter would raise an error for any vertex with no bone weights
|
||||
deformed. Therefore, the exporter will raise an error for any vertex with no bone weights
|
||||
detected in a rigged mesh.
|
||||
|
||||
Non-Deform Bone
|
||||
|
||||
@@ -50,7 +50,7 @@ your project's features.
|
||||
|
||||
- **Example:** Scripts, PackedScene (for scene files), and other types like
|
||||
each of the :ref:`AudioEffect <class_AudioEffect>` classes. Each of these
|
||||
can be save and loaded, therefore they extend from Resource.
|
||||
can be saved and loaded, therefore they extend from Resource.
|
||||
|
||||
- **Advantages:** Much has
|
||||
:ref:`already been said <doc_resources>`
|
||||
|
||||
@@ -65,7 +65,7 @@ initialize it:
|
||||
.. code-tab:: csharp
|
||||
|
||||
// Parent
|
||||
GetNode("Child").Connect("SignalName", ObjectWithMethod, "MethodOnTheObject");
|
||||
GetNode("Child").Connect("SignalName", Callable.From(ObjectWithMethod.MethodOnTheObject));
|
||||
|
||||
// Child
|
||||
EmitSignal("SignalName"); // Triggers parent-defined behavior.
|
||||
|
||||
@@ -454,37 +454,41 @@ Animation Track Editor
|
||||
Tile Map Editor
|
||||
---------------
|
||||
|
||||
+-------------------+-----------------+-------------------+-------------------------------------+
|
||||
| Action name | Windows, Linux | macOS | Editor setting |
|
||||
+===================+=================+===================+=====================================+
|
||||
| Find Tile | :kbd:`Ctrl + F` | :kbd:`Cmd + F` | ``tile_map_editor/find_tile`` |
|
||||
+-------------------+-----------------+-------------------+-------------------------------------+
|
||||
| Pick Tile | :kbd:`I` | :kbd:`I` | ``tile_map_editor/pick_tile`` |
|
||||
+-------------------+-----------------+-------------------+-------------------------------------+
|
||||
| Paint Tile | :kbd:`P` | :kbd:`P` | ``tile_map_editor/paint_tile`` |
|
||||
+-------------------+-----------------+-------------------+-------------------------------------+
|
||||
| Bucket Fill | :kbd:`G` | :kbd:`G` | ``tile_map_editor/bucket_fill`` |
|
||||
+-------------------+-----------------+-------------------+-------------------------------------+
|
||||
| Transpose | :kbd:`T` | :kbd:`T` | ``tile_map_editor/transpose`` |
|
||||
+-------------------+-----------------+-------------------+-------------------------------------+
|
||||
| Flip Horizontally | :kbd:`X` | :kbd:`X` | ``tile_map_editor/flip_horizontal`` |
|
||||
+-------------------+-----------------+-------------------+-------------------------------------+
|
||||
| Flip Vertically | :kbd:`Z` | :kbd:`Z` | ``tile_map_editor/flip_vertical`` |
|
||||
+-------------------+-----------------+-------------------+-------------------------------------+
|
||||
| Rotate Left | :kbd:`A` | :kbd:`A` | ``tile_map_editor/rotate_left`` |
|
||||
+-------------------+-----------------+-------------------+-------------------------------------+
|
||||
| Rotate Right | :kbd:`S` | :kbd:`S` | ``tile_map_editor/rotate_right`` |
|
||||
+-------------------+-----------------+-------------------+-------------------------------------+
|
||||
| Clear Transform | :kbd:`W` | :kbd:`W` | ``tile_map_editor/clear_transform`` |
|
||||
+-------------------+-----------------+-------------------+-------------------------------------+
|
||||
| Select | :kbd:`M` | :kbd:`M` | ``tile_map_editor/select`` |
|
||||
+-------------------+-----------------+-------------------+-------------------------------------+
|
||||
| Cut Selection | :kbd:`Ctrl + X` | :kbd:`Cmd + X` | ``tile_map_editor/cut_selection`` |
|
||||
+-------------------+-----------------+-------------------+-------------------------------------+
|
||||
| Copy Selection | :kbd:`Ctrl + C` | :kbd:`Cmd + C` | ``tile_map_editor/copy_selection`` |
|
||||
+-------------------+-----------------+-------------------+-------------------------------------+
|
||||
| Erase Selection | :kbd:`Del` | :kbd:`Cmd + BkSp` | ``tile_map_editor/erase_selection`` |
|
||||
+-------------------+-----------------+-------------------+-------------------------------------+
|
||||
+-------------------+-----------------+-------------------+---------------------------------------+
|
||||
| Action name | Windows, Linux | macOS | Editor setting |
|
||||
+===================+=================+===================+=======================================+
|
||||
| Select | :kbd:`S` | :kbd:`S` | ``tiles_editor/selection_tool`` |
|
||||
+-------------------+-----------------+-------------------+---------------------------------------+
|
||||
| Cut Selection | :kbd:`Ctrl + X` | :kbd:`Cmd + X` | ``tiles_editor/cut`` |
|
||||
+-------------------+-----------------+-------------------+---------------------------------------+
|
||||
| Copy Selection | :kbd:`Ctrl + C` | :kbd:`Cmd + C` | ``tiles_editor/copy`` |
|
||||
+-------------------+-----------------+-------------------+---------------------------------------+
|
||||
| Paste Selection | :kbd:`Ctrl + V` | :kbd:`Cmd + V` | ``tiles_editor/paste`` |
|
||||
+-------------------+-----------------+-------------------+---------------------------------------+
|
||||
| Delete Selection | :kbd:`Del` | :kbd:`Cmd + BkSp` | ``tiles_editor/delete`` |
|
||||
+-------------------+-----------------+-------------------+---------------------------------------+
|
||||
| Cancel | :kbd:`Esc` | :kbd:`Esc` | ``tiles_editor/cancel`` |
|
||||
+-------------------+-----------------+-------------------+---------------------------------------+
|
||||
| Paint | :kbd:`D` | :kbd:`D` | ``tiles_editor/paint_tool`` |
|
||||
+-------------------+-----------------+-------------------+---------------------------------------+
|
||||
| Line | :kbd:`L` | :kbd:`L` | ``tiles_editor/line_tool`` |
|
||||
+-------------------+-----------------+-------------------+---------------------------------------+
|
||||
| Rect | :kbd:`R` | :kbd:`R` | ``tiles_editor/rect_tool`` |
|
||||
+-------------------+-----------------+-------------------+---------------------------------------+
|
||||
| Bucket | :kbd:`B` | :kbd:`B` | ``tiles_editor/bucket_tool`` |
|
||||
+-------------------+-----------------+-------------------+---------------------------------------+
|
||||
| Picker | :kbd:`P` | :kbd:`P` | ``tiles_editor/picker`` |
|
||||
+-------------------+-----------------+-------------------+---------------------------------------+
|
||||
| Eraser | :kbd:`E` | :kbd:`E` | ``tiles_editor/eraser`` |
|
||||
+-------------------+-----------------+-------------------+---------------------------------------+
|
||||
| Flip Horizontally | :kbd:`C` | :kbd:`C` | ``tiles_editor/flip_tile_horizontal`` |
|
||||
+-------------------+-----------------+-------------------+---------------------------------------+
|
||||
| Flip Vertically | :kbd:`V` | :kbd:`V` | ``tiles_editor/flip_tile_vertical`` |
|
||||
+-------------------+-----------------+-------------------+---------------------------------------+
|
||||
| Rotate Left | :kbd:`Z` | :kbd:`Z` | ``tiles_editor/rotate_tile_left`` |
|
||||
+-------------------+-----------------+-------------------+---------------------------------------+
|
||||
| Rotate Right | :kbd:`X` | :kbd:`X` | ``tiles_editor/rotate_tile_right`` |
|
||||
+-------------------+-----------------+-------------------+---------------------------------------+
|
||||
|
||||
Tileset Editor
|
||||
--------------
|
||||
|
||||
@@ -40,9 +40,10 @@ Download and install the Android SDK.
|
||||
- CMake version 3.10.2.4988404
|
||||
- NDK version r23c (23.2.8568313)
|
||||
|
||||
- Alternatively, you can install the Android SDK using the `command line tools <https://developer.android.com/studio/#command-line-tools-only>`__.
|
||||
- Alternatively, you can install the Android SDK with the `sdkmanager` command line tool.
|
||||
|
||||
- Once the command line tools are installed, run the `sdkmanager <https://developer.android.com/studio/command-line/sdkmanager>`__ command to complete the setup process:
|
||||
- Install the command line tools package using these `instructions <https://developer.android.com/tools/sdkmanager>`__.
|
||||
- Once the command line tools are installed, run the following `sdkmanager` command to complete the setup process:
|
||||
|
||||
::
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ option is currently inherited, you must tick the box next to it first.
|
||||
- **Strip Visuals:** Export this resource, with visual files (textures and materials)
|
||||
replaced by placeholder classes. Placeholder classes store the image size
|
||||
(as it's sometimes used to position elements in a 2D scene), but nothing else.
|
||||
- **Keep:** Export this resource as usual, with visual files interact.
|
||||
- **Keep:** Export this resource as usual, with visual files intact.
|
||||
- **Remove:** The file is not included in the PCK. This is useful to ignore
|
||||
scenes and resources that only the client needs. If you do so, make sure the
|
||||
server doesn't reference these client-only scenes and resources in any way.
|
||||
|
||||
@@ -23,7 +23,7 @@ translations page before, we recommend you give it a read before reading this
|
||||
page.
|
||||
|
||||
.. note:: We will be using the official demo as an example; you can
|
||||
`download it from the Asset Library <https://godotengine.org/asset-library/asset/134>`_.
|
||||
`download it from the Asset Library <https://godotengine.org/asset-library/asset/2776>`_.
|
||||
|
||||
Configuring the imported translation
|
||||
------------------------------------
|
||||
|
||||
@@ -315,7 +315,7 @@ You can contribute an updated mapping to be included in the next Godot version
|
||||
by opening a pull request on the linked repository.
|
||||
|
||||
There are many ways to create mappings. One option is to use the mapping wizard
|
||||
in the `official Joypads demo <https://godotengine.org/asset-library/asset/140>`__.
|
||||
in the `official Joypads demo <https://godotengine.org/asset-library/asset/2785>`__.
|
||||
Once you have a working mapping for your controller, you can test it by defining
|
||||
the ``SDL_GAMECONTROLLERCONFIG`` environment variable before running Godot:
|
||||
|
||||
|
||||
@@ -422,7 +422,7 @@ ends up empty. When that happens, you reinitialize it to its default value::
|
||||
|
||||
|
||||
func get_fruit():
|
||||
if _fruits.empty():
|
||||
if _fruits.is_empty():
|
||||
# Fill the fruits array again and shuffle it.
|
||||
_fruits = _fruits_full.duplicate()
|
||||
_fruits.shuffle()
|
||||
|
||||
@@ -94,7 +94,8 @@ It uses the NavigationServer2D and a NavigationAgent2D for path movement.
|
||||
|
||||
.. image:: img/nav_2d_min_setup_step1.png
|
||||
|
||||
#. Define the moveable navigation area with the NavigationPolygon draw tool.
|
||||
#. Define the moveable navigation area with the NavigationPolygon draw tool. Then click
|
||||
the `Bake NavigationPolygon`` button on the toolbar.
|
||||
|
||||
.. image:: img/nav_2d_min_setup_step2.png
|
||||
|
||||
|
||||
@@ -378,7 +378,7 @@ The following script uses the NavigationServer to update a navigation region wit
|
||||
PackedInt32Array([0, 1, 2, 3])
|
||||
)
|
||||
|
||||
NavigationServer2D.region_set_navigation_polygon(new_2d_region_rid, new_navigation_mesh)
|
||||
NavigationServer2D.region_set_navigation_polygon(region_rid, navigation_mesh)
|
||||
|
||||
.. code-tab:: gdscript 3D GDScript
|
||||
|
||||
@@ -408,4 +408,4 @@ The following script uses the NavigationServer to update a navigation region wit
|
||||
PackedInt32Array([0, 1, 2, 3])
|
||||
)
|
||||
|
||||
NavigationServer3D.region_set_navigation_mesh(new_3d_region_rid, navigation_mesh)
|
||||
NavigationServer3D.region_set_navigation_mesh(region_rid, navigation_mesh)
|
||||
|
||||
@@ -38,10 +38,6 @@ In summary, you can use the low-level networking API for maximum control and imp
|
||||
(`here <https://gafferongames.com/categories/game-networking/>`__), including the comprehensive
|
||||
`introduction to networking models in games <https://gafferongames.com/post/what_every_programmer_needs_to_know_about_game_networking/>`__.
|
||||
|
||||
If you want to use your low-level networking library of choice instead of Godot's built-in networking,
|
||||
see here for an example:
|
||||
https://github.com/PerduGames/gdnet3
|
||||
|
||||
.. warning:: Adding networking to your game comes with some responsibility.
|
||||
It can make your application vulnerable if done wrong and may lead to cheats or exploits.
|
||||
It may even allow an attacker to compromise the machines your application runs on
|
||||
|
||||
@@ -10,7 +10,7 @@ Since version 3.1, Godot supports ragdoll physics. Ragdolls rely on physics simu
|
||||
|
||||
In this tutorial, we will be using the Platformer3D demo to set up a ragdoll.
|
||||
|
||||
.. note:: You can download the Platformer3D demo on `GitHub <https://github.com/godotengine/godot-demo-projects/tree/master/3d/platformer>`_ or using the `Asset Library <https://godotengine.org/asset-library/asset/125>`_.
|
||||
.. note:: You can download the Platformer3D demo on `GitHub <https://github.com/godotengine/godot-demo-projects/tree/master/3d/platformer>`_ or using the `Asset Library <https://godotengine.org/asset-library/asset/2748>`_.
|
||||
|
||||
Setting up the ragdoll
|
||||
----------------------
|
||||
|
||||
@@ -34,7 +34,7 @@ Cloak simulation
|
||||
|
||||
Let's make a cloak in the Platformer3D demo.
|
||||
|
||||
.. note:: You can download the Platformer3D demo on `GitHub <https://github.com/godotengine/godot-demo-projects/tree/master/3d/platformer>`_ or `the Asset Library <https://godotengine.org/asset-library/asset/125>`_.
|
||||
.. note:: You can download the Platformer3D demo on `GitHub <https://github.com/godotengine/godot-demo-projects/tree/master/3d/platformer>`_ or `the Asset Library <https://godotengine.org/asset-library/asset/2748>`_.
|
||||
|
||||
Open the ``Player`` scene, add a ``SoftBody`` node and assign a ``PlaneMesh`` to it.
|
||||
|
||||
|
||||
@@ -98,12 +98,12 @@ return ``true`` if this plugin should handle the object or its properties.
|
||||
.. note:: This includes any :ref:`class_Resource` attached to the object.
|
||||
|
||||
You can implement four other methods to add controls to the inspector at
|
||||
specific positions. The ``parse_begin()`` and ``parse_end()`` methods are called
|
||||
specific positions. The ``_parse_begin()`` and ``_parse_end()`` methods are called
|
||||
only once at the beginning and the end of parsing for each object, respectively.
|
||||
They can add controls at the top or bottom of the inspector layout by calling
|
||||
``add_custom_control()``.
|
||||
|
||||
As the editor parses the object, it calls the ``parse_category()`` and
|
||||
As the editor parses the object, it calls the ``_parse_category()`` and
|
||||
``_parse_property()`` methods. There, in addition to ``add_custom_control()``,
|
||||
you can call both ``add_property_editor()`` and
|
||||
``add_property_editor_for_multiple_properties()``. Use these last two methods to
|
||||
|
||||
|
Before Width: | Height: | Size: 6.1 KiB |
BIN
tutorials/rendering/img/screenres.webp
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 6.2 KiB |
@@ -1 +0,0 @@
|
||||
<svg height="213" viewBox="0 0 189.70625 56.356252" width="717" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><marker id="a" orient="auto" overflow="visible" refX="0.0" refY="0.0"><path d="m5.77 0-8.65 5v-10z" fill="#ff0505" fill-rule="evenodd" stroke="#ff0505" stroke-width="1pt" transform="scale(-.2)"/></marker><marker id="b" orient="auto" overflow="visible" refX="0.0" refY="0.0"><path d="m5.77 0-8.65 5v-10z" fill="#ff0505" fill-rule="evenodd" stroke="#ff0505" stroke-width="1pt" transform="scale(-.2)"/></marker><marker id="c" orient="auto" overflow="visible" refX="0.0" refY="0.0"><path d="m5.77 0-8.65 5v-10z" fill="#ff0505" fill-rule="evenodd" stroke="#ff0505" stroke-width="1pt" transform="scale(-.2)"/></marker><marker id="d" orient="auto" overflow="visible" refX="0.0" refY="0.0"><path d="m5.77 0-8.65 5v-10z" fill="#ff0505" fill-rule="evenodd" stroke="#ff0505" stroke-width="1pt" transform="scale(-.2)"/></marker><marker id="e" orient="auto" overflow="visible" refX="0.0" refY="0.0"><path d="m5.77 0-8.65 5v-10z" fill="#ff0505" fill-rule="evenodd" stroke="#ff0505" stroke-width="1pt" transform="scale(-.2)"/></marker><marker id="f" orient="auto" overflow="visible" refX="0.0" refY="0.0"><path d="m5.77 0-8.65 5v-10z" fill="#ff0505" fill-rule="evenodd" stroke="#ff0505" stroke-width="1pt" transform="scale(-.2)"/></marker><marker id="g" orient="auto" overflow="visible" refX="0.0" refY="0.0"><path d="m5.77 0-8.65 5v-10z" fill="#ff0505" fill-rule="evenodd" stroke="#ff0505" stroke-width="1pt" transform="scale(-.2)"/></marker><marker id="h" orient="auto" overflow="visible" refX="0.0" refY="0.0"><path d="m5.77 0-8.65 5v-10z" fill="#ff0505" fill-rule="evenodd" stroke="#ff0505" stroke-width="1pt" transform="scale(-.2)"/></marker><g transform="translate(0 -240.64373)"><g fill="none"><g stroke-linejoin="round" stroke-width="1.058333"><g stroke="#000"><path d="m69.7761 244.69925h50.154053v35.322506h-50.154053z"/><path d="m132.2177 244.69925h50.154053v35.322506h-50.154053z"/><path d="m7.334433 244.69925h50.154053v35.322506h-50.154053z"/></g><g stroke="#e40b0b"><path d="m71.18943 246.07916h47.3274v32.56264h-47.3274z"/><path d="m8.7477624 246.07916h16.3917946v10.89769h-16.3917946z"/><path d="m148.72414 256.56665h17.14119v11.58766h-17.14119z"/></g></g><g stroke="#ff0505" stroke-width="1.5875"><path d="m75.523807 251.13928 3.512737 3.70788" marker-start="url(#h)"/><path d="m113.77476 251.13928-3.51274 3.70788" marker-start="url(#e)"/><path d="m75.523807 274.24705 3.512737-3.70788" marker-start="url(#f)"/><path d="m113.77476 274.24705-3.51274-3.70788" marker-start="url(#g)"/><path d="m137.38698 251.13928 3.51273 3.70788" marker-start="url(#d)"/><path d="m175.63793 251.13928-3.51274 3.70788" marker-start="url(#c)"/><path d="m137.38698 274.24705 3.51273-3.70788" marker-start="url(#a)"/><path d="m175.63793 274.24705-3.51274-3.70788" marker-start="url(#b)"/></g></g><g font-family="Arial" font-size="8.466666" letter-spacing="0" stroke-width=".264583" word-spacing="0"><text x="15.906008" y="291.34055"><tspan font-family="Arial" font-size="8.466666" stroke-width=".264583" x="15.906008" y="291.34055">Disabled</tspan></text><text x="89.536987" y="291.40256"><tspan font-family="Arial" font-size="8.466666" stroke-width=".264583" x="89.536987" y="291.40256">2D</tspan></text><text x="140.88435" y="290.54886"><tspan font-family="Arial" font-size="8.466666" stroke-width=".264583" x="140.88435" y="290.54886">Viewport</tspan></text></g></g></svg>
|
||||
|
Before Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 3.0 KiB |
BIN
tutorials/rendering/img/stretchsettings.webp
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
@@ -59,7 +59,7 @@ Base size
|
||||
A base size for the window can be specified in the Project Settings under
|
||||
**Display → Window**.
|
||||
|
||||
.. image:: img/screenres.png
|
||||
.. image:: img/screenres.webp
|
||||
|
||||
However, what it does is not completely obvious; the engine will *not*
|
||||
attempt to switch the monitor to this resolution. Rather, think of this
|
||||
@@ -119,20 +119,16 @@ Stretch settings
|
||||
|
||||
Stretch settings are located in the project settings and provide several options:
|
||||
|
||||
.. image:: img/stretchsettings.png
|
||||
.. image:: img/stretchsettings.webp
|
||||
|
||||
Stretch Mode
|
||||
^^^^^^^^^^^^
|
||||
|
||||
The **Stretch Mode** setting defines how the base size is stretched to fit
|
||||
the resolution of the window or screen.
|
||||
|
||||
.. image:: img/stretch.png
|
||||
|
||||
The animations below use a "base size" of just 16×9 pixels to
|
||||
demonstrate the effect of different stretch modes. A single sprite, also
|
||||
16×9 pixels in size, covers the entire viewport, and a diagonal
|
||||
:ref:`Line2D <class_Line2D>` is added on top of it:
|
||||
the resolution of the window or screen. The animations below use a "base
|
||||
size" of just 16×9 pixels to demonstrate the effect of different stretch
|
||||
modes. A single sprite, also 16×9 pixels in size, covers the entire viewport,
|
||||
and a diagonal :ref:`Line2D <class_Line2D>` is added on top of it:
|
||||
|
||||
.. image:: img/stretch_demo_scene.png
|
||||
|
||||
@@ -459,7 +455,7 @@ Non-game application
|
||||
- Keep the stretch mode to its default value, ``disabled``.
|
||||
- Keep the stretch aspect to its default value, ``ignore``
|
||||
(its value won't be used since the stretch mode is ``disabled``).
|
||||
- You can define a minimum window size by setting ``OS.min_window_size`` in a
|
||||
- You can define a minimum window size by calling ``get_window().set_min_size()`` in a
|
||||
script's ``_ready()`` function. This prevents the user from resizing the application
|
||||
below a certain size, which could break the UI layout.
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ Change scenes manually
|
||||
======================
|
||||
|
||||
Sometimes it helps to have more control over how one swaps scenes around.
|
||||
As mentioned above, a :ref:`Viewport <class_Viewport>`'s child nodes
|
||||
will render to the image it generates. This holds true even for nodes outside
|
||||
A :ref:`Viewport <class_Viewport>`'s child nodes will render to the image
|
||||
it generates, this holds true even for nodes outside
|
||||
of the "current" scene. Autoloads fall into this category, but so do
|
||||
scenes which one instances and adds to the tree at runtime:
|
||||
|
||||
|
||||
@@ -201,7 +201,7 @@ Base placeholders
|
||||
+==========================+====================================================+
|
||||
| ``_BINDINGS_NAMESPACE_`` | The name of the Godot namespace (used in C# only). |
|
||||
+--------------------------+----------------------------------------------------+
|
||||
| ``_CLASS_`` | The name of the new class (used in C# only). |
|
||||
| ``_CLASS_`` | The name of the new class. |
|
||||
+--------------------------+----------------------------------------------------+
|
||||
| ``_BASE_`` | The base type a new script inherits from. |
|
||||
+--------------------------+----------------------------------------------------+
|
||||
|
||||
@@ -59,8 +59,8 @@ The main measurements are frame time, physics frame, idle time, and physics time
|
||||
- **Physics time** is the time Godot took to update physics tasks, like
|
||||
`_physics_process` and built-in nodes set to **Physics** update.
|
||||
|
||||
.. note:: In Godot 3, **Frame Time** includes rendering time. Say you find a
|
||||
mysterious spike of lag in your game, but your physics and scripts are
|
||||
.. note:: **Frame Time** includes rendering time. Say you find a mysterious
|
||||
spike of lag in your game, but your physics and scripts are
|
||||
all running fast. The delay could be due to the appearance of
|
||||
particles or visual effects!
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ Creating your own resources
|
||||
Like any Object in Godot, users can also script Resources. Resource scripts
|
||||
inherit the ability to freely translate between object properties and serialized
|
||||
text or binary data (\*.tres, \*.res). They also inherit the reference-counting
|
||||
memory management from the Reference type.
|
||||
memory management from the RefCounted type.
|
||||
|
||||
This comes with many distinct advantages over alternative data
|
||||
structures, such as JSON, CSV, or custom TXT files. Users can only import these
|
||||
|
||||
@@ -73,21 +73,8 @@ in top-to-bottom order.
|
||||
|
||||
.. image:: img/autoload_example.webp
|
||||
|
||||
This means that any node can access a singleton named "PlayerVariables" with:
|
||||
|
||||
.. tabs::
|
||||
.. code-tab:: gdscript GDScript
|
||||
|
||||
var player_vars = get_node("/root/PlayerVariables")
|
||||
player_vars.health -= 10
|
||||
|
||||
.. code-tab:: csharp
|
||||
|
||||
var playerVariables = GetNode<PlayerVariables>("/root/PlayerVariables");
|
||||
playerVariables.Health -= 10; // Instance field.
|
||||
|
||||
If the **Enable** column is checked (which is the default), then the singleton can
|
||||
be accessed directly in GDScript, without requiring ``get_node()``:
|
||||
be accessed directly in GDScript:
|
||||
|
||||
.. tabs::
|
||||
.. code-tab:: gdscript GDScript
|
||||
|
||||
@@ -11,18 +11,11 @@ In particular, it will explain how to write a post-processing shader that
|
||||
uses the depth buffer. You should already be familiar with post-processing
|
||||
generally and, in particular, with the methods outlined in the :ref:`custom post-processing tutorial <doc_custom_postprocessing>`.
|
||||
|
||||
In the previous post-processing tutorial, we rendered the scene to a :ref:`Viewport <class_Viewport>`
|
||||
and then rendered the Viewport in a :ref:`SubViewportContainer <class_SubViewportContainer>`
|
||||
to the main scene. One limitation of this method is that we could not access the
|
||||
depth buffer because the depth buffer is only available in shaders and
|
||||
Viewports do not maintain depth information.
|
||||
|
||||
Full screen quad
|
||||
----------------
|
||||
|
||||
In the :ref:`custom post-processing tutorial <doc_custom_postprocessing>`, we
|
||||
covered how to use a Viewport to make custom post-processing effects. There are
|
||||
two main drawbacks of using a Viewport:
|
||||
One way to make custom post-processing effects is by using a viewport. However,
|
||||
there are two main drawbacks of using a Viewport:
|
||||
|
||||
1. The depth buffer cannot be accessed
|
||||
2. The effect of the post-processing shader is not visible in the editor
|
||||
|
||||
@@ -174,7 +174,8 @@ There are 4 ``LIGHTX`` lights, accessed as ``LIGHT0``, ``LIGHT1``, ``LIGHT2``, a
|
||||
+---------------------------------+--------------------------------------------------------------------------------------------------------------------------+
|
||||
| in vec3 **LIGHTX_COLOR** | Color of ``LIGHTX``. |
|
||||
+---------------------------------+--------------------------------------------------------------------------------------------------------------------------+
|
||||
| in float **LIGHTX_SIZE** | Angular diameter of ``LIGHTX`` in the sky. Expressed in degrees. For reference, the sun from earth is about 0.5 degrees. |
|
||||
| in float **LIGHTX_SIZE** | Angular diameter of ``LIGHTX`` in the sky. Expressed in radians. For reference, the sun from earth is about .0087 radians|
|
||||
| | (0.5 degrees). |
|
||||
+---------------------------------+--------------------------------------------------------------------------------------------------------------------------+
|
||||
| in float **PI** | A ``PI`` constant (``3.141592``). |
|
||||
| | A ratio of a circle's circumference to its diameter and amount of radians in half turn. |
|
||||
|
||||
@@ -9,9 +9,9 @@ discussions, and tutorials. Hopefully, this will also support the development of
|
||||
auto-formatting tools.
|
||||
|
||||
Since the Godot shader language is close to C-style languages and GLSL, this
|
||||
guide is inspired by Godot's own GLSL formatting. You can view an example of a
|
||||
GLSL file in Godot's source code
|
||||
`here <https://github.com/godotengine/godot/blob/master/drivers/gles3/shaders/copy.glsl>`__.
|
||||
guide is inspired by Godot's own GLSL formatting. You can view examples of
|
||||
GLSL files in Godot's source code
|
||||
`here <https://github.com/godotengine/godot/blob/master/drivers/gles3/shaders/>`__.
|
||||
|
||||
Style guides aren't meant as hard rulebooks. At times, you may not be able to
|
||||
apply some of the guidelines below. When that happens, use your best judgment,
|
||||
|
||||
@@ -107,7 +107,7 @@ Alternatively, set it using a function:
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
SetCustomMinimumSize(new Vector2(20, 20));
|
||||
CustomMinimumSize = new Vector2(20, 20);
|
||||
}
|
||||
|
||||
Input
|
||||
|
||||