Przeglądaj źródła

Merge branch 'master' into 4.0

Rémi Verschelde 2 lat temu
rodzic
commit
37f0f2e8c2
100 zmienionych plików z 914 dodań i 253 usunięć
  1. 8 3
      _static/css/custom.css
  2. 3 3
      _static/js/custom.js
  3. 31 16
      _templates/breadcrumbs.html
  4. 2 1
      _templates/layout.html
  5. 1 1
      _templates/versions.html
  6. 1 1
      about/faq.rst
  7. 3 3
      about/list_of_features.rst
  8. 20 17
      conf.py
  9. 23 0
      contributing/development/compiling/compiling_for_web.rst
  10. 6 6
      getting_started/first_2d_game/05.the_main_game_scene.rst
  11. BIN
      getting_started/introduction/img/engine_design_02.png
  12. 1 1
      getting_started/introduction/introduction_to_godot.rst
  13. 8 8
      tutorials/2d/2d_sprite_animation.rst
  14. BIN
      tutorials/2d/img/2d_animation_add_from_spritesheet.png
  15. BIN
      tutorials/2d/img/2d_animation_add_from_spritesheet.webp
  16. BIN
      tutorials/2d/img/2d_animation_play_spritesheet_animation.png
  17. BIN
      tutorials/2d/img/2d_animation_play_spritesheet_animation.webp
  18. BIN
      tutorials/2d/img/2d_animation_spriteframes.png
  19. BIN
      tutorials/2d/img/2d_animation_spriteframes.webp
  20. BIN
      tutorials/2d/img/2d_animation_spriteframes_done.png
  21. BIN
      tutorials/2d/img/2d_animation_spriteframes_done.webp
  22. BIN
      tutorials/2d/img/2d_animation_spritesheet_animation.png
  23. BIN
      tutorials/2d/img/2d_animation_spritesheet_animation.webp
  24. BIN
      tutorials/2d/img/2d_animation_spritesheet_select_rows.png
  25. BIN
      tutorials/2d/img/2d_animation_spritesheet_select_rows.webp
  26. BIN
      tutorials/2d/img/2d_animation_spritesheet_selectframes.png
  27. BIN
      tutorials/2d/img/2d_animation_spritesheet_selectframes.webp
  28. 2 2
      tutorials/2d/using_tilesets.rst
  29. 4 0
      tutorials/3d/3d_antialiasing.rst
  30. 6 6
      tutorials/3d/global_illumination/using_lightmap_gi.rst
  31. 4 4
      tutorials/3d/high_dynamic_range.rst
  32. BIN
      tutorials/3d/img/decals_blob_shadow.webp
  33. BIN
      tutorials/3d/img/decals_dirt.webp
  34. BIN
      tutorials/3d/img/lights_and_shadows_acne.webp
  35. BIN
      tutorials/3d/img/lights_and_shadows_blur.webp
  36. BIN
      tutorials/3d/img/lights_and_shadows_directional_mode.webp
  37. BIN
      tutorials/3d/img/lights_and_shadows_directional_shadow_params.webp
  38. BIN
      tutorials/3d/img/lights_and_shadows_dual_parabolid_vs_cubemap.webp
  39. BIN
      tutorials/3d/img/lights_and_shadows_filter_quality.webp
  40. BIN
      tutorials/3d/img/lights_and_shadows_omni_projector.webp
  41. BIN
      tutorials/3d/img/lights_and_shadows_omni_projector_example.webp
  42. BIN
      tutorials/3d/img/lights_and_shadows_pcss.webp
  43. BIN
      tutorials/3d/img/lights_and_shadows_peter_panning.webp
  44. BIN
      tutorials/3d/img/lights_and_shadows_pssm_explained.webp
  45. BIN
      tutorials/3d/img/lights_and_shadows_shadow_quadrants.webp
  46. BIN
      tutorials/3d/img/lights_and_shadows_shadow_quadrants2.webp
  47. BIN
      tutorials/3d/img/lights_and_shadows_spot_projector.webp
  48. BIN
      tutorials/3d/img/lights_and_shadows_spot_projector_example.webp
  49. BIN
      tutorials/3d/img/pssm_explained.png
  50. BIN
      tutorials/3d/img/shadow_atlas.png
  51. BIN
      tutorials/3d/img/shadow_bias.png
  52. BIN
      tutorials/3d/img/shadow_blocky.png
  53. BIN
      tutorials/3d/img/shadow_contact.png
  54. BIN
      tutorials/3d/img/shadow_omni_dp_cm.png
  55. BIN
      tutorials/3d/img/shadow_pcf1.png
  56. BIN
      tutorials/3d/img/shadow_pcf2.png
  57. BIN
      tutorials/3d/img/shadow_pssm.png
  58. BIN
      tutorials/3d/img/shadow_quadrants.png
  59. BIN
      tutorials/3d/img/shadow_quadrants2.png
  60. 1 0
      tutorials/3d/index.rst
  61. 24 19
      tutorials/3d/introduction_to_3d.rst
  62. 380 115
      tutorials/3d/lights_and_shadows.rst
  63. 14 0
      tutorials/3d/mesh_lod.rst
  64. 4 4
      tutorials/3d/standard_material_3d.rst
  65. 234 0
      tutorials/3d/using_decals.rst
  66. 2 2
      tutorials/3d/using_transforms.rst
  67. 38 21
      tutorials/animation/animation_track_types.rst
  68. 94 20
      tutorials/animation/animation_tree.rst
  69. BIN
      tutorials/animation/img/3D_transform_track.png
  70. BIN
      tutorials/animation/img/animation_animation_panel.png
  71. BIN
      tutorials/animation/img/animation_animation_panel.webp
  72. BIN
      tutorials/animation/img/animation_animation_panel_overview.png
  73. BIN
      tutorials/animation/img/animation_animation_panel_overview.webp
  74. BIN
      tutorials/animation/img/animation_create_animationplayer.png
  75. BIN
      tutorials/animation/img/animation_create_animationplayer.webp
  76. BIN
      tutorials/animation/img/animation_create_new_animation.png
  77. BIN
      tutorials/animation/img/animation_create_new_animation.webp
  78. BIN
      tutorials/animation/img/animation_keyframe_editor_key.png
  79. BIN
      tutorials/animation/img/animation_keyframe_editor_key.webp
  80. BIN
      tutorials/animation/img/animation_library.webp
  81. BIN
      tutorials/animation/img/animation_library_dialog.webp
  82. BIN
      tutorials/animation/img/animation_player_animation.png
  83. BIN
      tutorials/animation/img/animation_player_animation.webp
  84. BIN
      tutorials/animation/img/animation_properties_keyframe.png
  85. BIN
      tutorials/animation/img/animation_properties_keyframe.webp
  86. BIN
      tutorials/animation/img/animation_track.png
  87. BIN
      tutorials/animation/img/animation_track.webp
  88. BIN
      tutorials/animation/img/animation_track_interpolation.png
  89. BIN
      tutorials/animation/img/animation_track_interpolation.webp
  90. BIN
      tutorials/animation/img/animation_track_loop_modes.png
  91. BIN
      tutorials/animation/img/animation_track_loop_modes.webp
  92. BIN
      tutorials/animation/img/animation_track_rate.png
  93. BIN
      tutorials/animation/img/animation_track_rate.webp
  94. BIN
      tutorials/animation/img/animation_track_settings.png
  95. BIN
      tutorials/animation/img/animation_track_settings.webp
  96. BIN
      tutorials/animation/img/animtree3.png
  97. BIN
      tutorials/animation/img/animtree3.webp
  98. BIN
      tutorials/animation/img/audio_track.png
  99. BIN
      tutorials/animation/img/audio_track.webp
  100. BIN
      tutorials/animation/img/bezier_curve_icon.png

+ 8 - 3
_static/css/custom.css

@@ -938,14 +938,19 @@ code,
 /* Admonition tweaks */
 .rst-content .admonition-grid {
     display: grid;
-    grid-template-columns: 4fr 5fr;
+    grid-template-columns: 1fr;
     gap: 20px;
 }
+.rst-content .admonition-grid-2x {
+    grid-template-columns: 4fr 5fr;
+}
 @media screen and (max-width: 1020px) {
     .rst-content .admonition-grid {
-        grid-template-columns: 1fr;
         gap: 12px;
     }
+    .rst-content .admonition-grid-2x {
+        grid-template-columns: 1fr;
+    }
 }
 
 .rst-content .admonition,
@@ -967,7 +972,6 @@ code,
     font-size: 105%;
     line-height: 120%;
     padding: 6px 16px;
-    text-align: right;
 }
 
 .rst-content .admonition .admonition-title:before {
@@ -1597,6 +1601,7 @@ p + .classref-constant {
     overflow-y: auto;
     overflow-x: hidden;
     max-height: calc(100% - 348px);
+    padding-bottom: 24px;
 }
 @media screen and (max-width: 768px) {
     .wy-nav-side {

+ 3 - 3
_static/js/custom.js

@@ -13,11 +13,11 @@ const registerOnScrollEvent = (function(){
   // The number of pixels the user must scroll by before the logo is completely hidden.
   const scrollTopPixels = 84;
   // The target margin to be applied to the navigation bar when the logo is hidden.
-  const menuTopMargin = 88;
+  const menuTopMargin = 70;
   // The max-height offset when the logo is completely visible.
-  const menuHeightOffset_default = 180;
+  const menuHeightOffset_default = 162;
   // The max-height offset when the logo is completely hidden.
-  const menuHeightOffset_fixed = 98;
+  const menuHeightOffset_fixed = 80;
   // The distance between the two max-height offset values above; used for intermediate values.
   const menuHeightOffset_diff = (menuHeightOffset_default - menuHeightOffset_fixed);
 

+ 31 - 16
_templates/breadcrumbs.html

@@ -1,25 +1,40 @@
 {%- extends "sphinx_rtd_theme/breadcrumbs.html" %}
 
+{% block breadcrumbs %}
+<li>
+	<div style="font-size: 105%;font-weight: 600;">
+		{{ godot_docs_title | replace("%s", godot_version) }}
+	</div>
+	<ul class="wy-breadcrumbs">
+		{{ super() }}
+	</ul>
+</li>
+{% endblock %}
+
 {% block breadcrumbs_aside %}
 {% if not meta or meta.get('github_url') != 'hide' %}
-{{ super() }}
-
-<style>
-	.godot-edit-guidelines {
-		font-size: 14px;
-		float: right;
-		clear: both;
-		padding-top: 4px;
-	}
+<li style="float: right; text-align: right;">
+	<ul>
+		{{ super() }}
+	</ul>
 
-	@media screen and (max-width: 480px) {
+	<style>
 		.godot-edit-guidelines {
-			display: none;
+			font-size: 14px;
+			float: right;
+			clear: both;
+			padding-top: 4px;
+		}
+
+		@media screen and (max-width: 480px) {
+			.godot-edit-guidelines {
+				display: none;
+			}
 		}
-	}
-</style>
-<a class="godot-edit-guidelines" href="https://docs.godotengine.org/en/latest/contributing/documentation/index.html#writing-documentation">
-	Learn how to contribute!
-</a>
+	</style>
+	<a class="godot-edit-guidelines" href="https://docs.godotengine.org/en/latest/contributing/documentation/index.html#writing-documentation">
+		Learn how to contribute!
+	</a>
+</li>
 {% endif %}
 {% endblock %}

+ 2 - 1
_templates/layout.html

@@ -1,4 +1,5 @@
 {% extends "!layout.html" -%}
+{# Refer to https://github.com/readthedocs/sphinx_rtd_theme/blob/master/sphinx_rtd_theme/layout.html #}
 
 {% block htmltitle -%}
 <title>{{ godot_title_prefix }}{{ title|striptags|e }}{{ titlesuffix }}</title>
@@ -27,7 +28,7 @@
 {%- block document %}
 <div itemprop="articleBody">
   {% if godot_is_latest or godot_show_article_status %}
-  <div class="admonition-grid">
+  <div class="admonition-grid {% if godot_is_latest and godot_show_article_status %}admonition-grid-2x{% endif %}">
     {% if godot_is_latest %}
     <div class="admonition attention latest-notice">
       <p class="first admonition-title">Attention</p>

+ 1 - 1
_templates/versions.html

@@ -13,7 +13,7 @@
 <div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
   <span class="rst-current-version" data-toggle="rst-current-version">
     <span class="fa fa-book"> Read the Docs</span>
-    v: {{ display_version }}
+    v: {{ display_version }}{% if display_version != godot_version %} ({{ godot_version }}){% endif %}
     <span class="fa fa-caret-down"></span>
   </span>
   <div class="rst-other-versions">

+ 1 - 1
about/faq.rst

@@ -162,7 +162,7 @@ What 3D model formats does Godot support?
 -----------------------------------------
 
 You can find detailed information on supported formats, how to export them from
-your 3D DCC, and how to import them for Godot in the
+your 3D modeling software, and how to import them for Godot in the
 :ref:`doc_importing_3d_scenes` documentation.
 
 Will [insert closed SDK such as FMOD, GameWorks, etc.] be supported in Godot?

+ 3 - 3
about/list_of_features.rst

@@ -7,9 +7,9 @@ This page aims to list **all** features currently supported by Godot.
 
 .. note::
 
-    This page lists features supported by the current development version of
-    Godot (4.0.rc). Some of these features may not be available in the
-    `current stable release series (3.x) <https://docs.godotengine.org/en/stable/about/list_of_features.html>`__.
+    This page lists features supported by the current stable version of
+    Godot (4.0). Some of these features may not be available in the
+    `LTS release series (3.x) <https://docs.godotengine.org/en/3.5/about/list_of_features.html>`__.
 
 Platforms
 ---------

+ 20 - 17
conf.py

@@ -97,20 +97,20 @@ if env_tags is not None:
 # Language / i18n
 
 supported_languages = {
-    "en": "Godot Engine (%s) documentation in English",
-    "de": "Godot Engine (%s) Dokumentation auf Deutsch",
-    "es": "Documentación de Godot Engine (%s) en español",
-    "fr": "Documentation de Godot Engine (%s) en français",
-    "fi": "Godot Engine (%s) dokumentaatio suomeksi",
-    "it": "Godot Engine (%s) documentazione in italiano",
-    "ja": "Godot Engine (%s)の日本語のドキュメント",
-    "ko": "Godot Engine (%s) 문서 (한국어)",
-    "pl": "Dokumentacja Godot Engine (%s) w języku polskim",
-    "pt_BR": "Documentação da Godot Engine (%s) em Português Brasileiro",
-    "ru": "Документация Godot Engine (%s) на русском языке",
-    "uk": "Документація до Godot Engine (%s) українською мовою",
-    "zh_CN": "Godot Engine (%s) 简体中文文档",
-    "zh_TW": "Godot Engine (%s) 正體中文 (台灣) 文件",
+    "en": "Godot Engine %s documentation in English",
+    "de": "Godot Engine %s Dokumentation auf Deutsch",
+    "es": "Documentación de Godot Engine %s en español",
+    "fr": "Documentation de Godot Engine %s en français",
+    "fi": "Godot Engine %s dokumentaatio suomeksi",
+    "it": "Godot Engine %s documentazione in italiano",
+    "ja": "Godot Engine %sの日本語のドキュメント",
+    "ko": "Godot Engine %s 문서 (한국어)",
+    "pl": "Dokumentacja Godot Engine %s w języku polskim",
+    "pt_BR": "Documentação da Godot Engine %s em Português Brasileiro",
+    "ru": "Документация Godot Engine %s на русском языке",
+    "uk": "Документація до Godot Engine %s українською мовою",
+    "zh_CN": "Godot Engine %s 简体中文文档",
+    "zh_TW": "Godot Engine %s 正體中文 (台灣) 文件",
 }
 
 language = os.getenv("READTHEDOCS_LANGUAGE", "en")
@@ -155,9 +155,11 @@ html_theme_options = {
     "logo_only": True,
     # Collapse navigation (False makes it tree-like)
     "collapse_navigation": False,
+    # Hide the documentation version name/number under the logo
+    "display_version": False,
 }
 
-html_title = supported_languages[language] % version
+html_title = supported_languages[language] % ( "(" + version + ")" )
 
 # VCS options: https://docs.readthedocs.io/en/latest/vcs.html#github
 html_context = {
@@ -168,6 +170,7 @@ html_context = {
     "conf_py_path": "/",  # Path in the checkout to the docs root
     "godot_inject_language_links": True,
     "godot_docs_supported_languages": list(supported_languages.keys()),
+    "godot_docs_title": supported_languages[language],
     "godot_docs_basepath": "https://docs.godotengine.org/",
     "godot_docs_suffix": ".html",
     "godot_default_lang": "en",
@@ -195,14 +198,14 @@ html_extra_path = ["robots.txt"]
 html_css_files = [
     'css/algolia.css',
     'https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css',
-    "css/custom.css?8", # Increment the number at the end when the file changes to bust the cache.
+    "css/custom.css?10", # Increment the number at the end when the file changes to bust the cache.
 ]
 
 if not on_rtd:
     html_css_files.append("css/dev.css")
 
 html_js_files = [
-    "js/custom.js?5", # Increment the number at the end when the file changes to bust the cache.
+    "js/custom.js?6", # Increment the number at the end when the file changes to bust the cache.
     ('https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js', {'defer': 'defer'}),
     ('js/algolia.js', {'defer': 'defer'})
 ]

+ 23 - 0
contributing/development/compiling/compiling_for_web.rst

@@ -98,3 +98,26 @@ zip content to your web server and visit it with your browser to use the editor.
 
 Refer to the :ref:`export page <doc_javascript_export_options>` for the web
 server requirements.
+
+.. tip::
+
+    The Godot repository includes a
+    `Python script to host a local web server <https://raw.githubusercontent.com/godotengine/godot/master/platform/web/serve.py>`__.
+    This can be used to test the web editor locally.
+
+    After compiling the editor, extract the ZIP archive that was created in the
+    ``bin/`` folder, then run the following command in the Godot repository
+    root:
+
+    ::
+
+        # You may need to replace `python` with `python3` on some platforms.
+        python platform/web/serve.py
+
+    This will serve the contents of the ``bin/`` folder and open the default web
+    browser automatically. In the page that opens, access ``godot.tools.html``
+    and you should be able to test the web editor this way.
+
+    Note that for production use cases, this Python-based web server should not
+    be used. Instead, you should use an established web server such as Apache or
+    nginx.

+ 6 - 6
getting_started/first_2d_game/05.the_main_game_scene.rst

@@ -73,7 +73,7 @@ Your scene should look like this:
 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
 to instance.
 
@@ -154,7 +154,7 @@ to instance.
     };
 
     #endif // MAIN_H
-    
+
     // This code goes in `main.cpp`.
     #include "main.hpp"
 
@@ -243,7 +243,7 @@ new game:
     }
 
 Now connect the ``timeout()`` signal of each of the Timer nodes (``StartTimer``,
-``ScoreTimer`` , and ``MobTimer``) to the main script. ``StartTimer`` will start
+``ScoreTimer``, and ``MobTimer``) to the main script. ``StartTimer`` will start
 the other two timers. ``ScoreTimer`` will increment the score by 1.
 
 .. tabs::
@@ -311,7 +311,7 @@ Note that a new instance must be added to the scene using ``add_child()``.
 
         # Choose a random location on Path2D.
         var mob_spawn_location = get_node("MobPath/MobSpawnLocation")
-        mob_spawn_location.progress_ratio = randi()
+        mob_spawn_location.progress_ratio = randf()
 
         # Set the mob's direction perpendicular to the path direction.
         var direction = mob_spawn_location.rotation + PI / 2
@@ -343,7 +343,7 @@ Note that a new instance must be added to the scene using ``add_child()``.
 
         // Choose a random location on Path2D.
         var mobSpawnLocation = GetNode<PathFollow2D>("MobPath/MobSpawnLocation");
-        mobSpawnLocation.ProgressRatio = GD.Randi();
+        mobSpawnLocation.ProgressRatio = GD.Randf();
 
         // Set the mob's direction perpendicular to the path direction.
         float direction = mobSpawnLocation.Rotation + Mathf.Pi / 2;
@@ -371,7 +371,7 @@ Note that a new instance must be added to the scene using ``add_child()``.
         godot::Node *mob = mob_scene->instance();
 
         // Choose a random location on Path2D.
-        _mob_spawn_location->set_progress_ratio((real_t)_random->randi());
+        _mob_spawn_location->set_progress_ratio((real_t)_random->randf());
 
         // Set the mob's direction perpendicular to the path direction.
         real_t direction = _mob_spawn_location->get_rotation() + (real_t)Math_PI / 2;

BIN
getting_started/introduction/img/engine_design_02.png


+ 1 - 1
getting_started/introduction/introduction_to_godot.rst

@@ -31,7 +31,7 @@ programming skills or a developer to port the game for you.
 What can the engine do?
 -----------------------
 
-Godot was initially developed in-house by an Argentinan game studio. Its
+Godot was initially developed in-house by an Argentinian game studio. Its
 development started in 2001, and the engine was rewritten and improved
 tremendously since its open source release in 2014.
 

+ 8 - 8
tutorials/2d/2d_sprite_animation.rst

@@ -50,13 +50,13 @@ Now select the ``AnimatedSprite2D`` and in its *SpriteFrames* property, select
 Click on the new SpriteFrames resource and you'll see a new panel appear at the
 bottom of the editor window:
 
-.. image:: img/2d_animation_spriteframes.png
+.. image:: img/2d_animation_spriteframes.webp
 
 From the FileSystem dock on the left side, drag the 8 individual images into
 the center part of the SpriteFrames panel. On the left side, change the name
 of the animation from "default" to "run".
 
-.. image:: img/2d_animation_spriteframes_done.png
+.. image:: img/2d_animation_spriteframes_done.webp
 
 Back in the Inspector, check the box for the *Playing* property. You should
 now see the animation playing in the viewport. However, it is a bit slow. To
@@ -127,25 +127,25 @@ Set up your scene tree the same way you did previously when using individual ima
 
 Click on the new SpriteFrames resource. This time, when the bottom panel appears, select "Add frames from a Sprite Sheet".
 
-.. image:: img/2d_animation_add_from_spritesheet.png
+.. image:: img/2d_animation_add_from_spritesheet.webp
 
 You will be prompted to open a file. Select your sprite sheet.
 
 A new window will open, showing your sprite sheet. The first thing you will need to do is to change the number of vertical and horizontal images in your sprite sheet. In this sprite sheet, we have four images horizontally and two images vertically.
 
-.. image:: img/2d_animation_spritesheet_select_rows.png
+.. image:: img/2d_animation_spritesheet_select_rows.webp
 
 Next, select the frames from the sprite sheet that you want to include in your animation. We will select the top four, then click "Add 4 frames" to create the animation.
 
-.. image:: img/2d_animation_spritesheet_selectframes.png
+.. image:: img/2d_animation_spritesheet_selectframes.webp
 
 You will now see your animation under the list of animations in the bottom panel. Double click on default to change the name of the animation to jump.
 
-.. image:: img/2d_animation_spritesheet_animation.png
+.. image:: img/2d_animation_spritesheet_animation.webp
 
-Finally, check Playing on the AnimatedSprite2D in the inspector to see your frog jump!
+Finally, check the play button on the SpriteFrames editor to see your frog jump!
 
-.. image:: img/2d_animation_play_spritesheet_animation.png
+.. image:: img/2d_animation_play_spritesheet_animation.webp
 
 
 Sprite sheet with AnimationPlayer

BIN
tutorials/2d/img/2d_animation_add_from_spritesheet.png


BIN
tutorials/2d/img/2d_animation_add_from_spritesheet.webp


BIN
tutorials/2d/img/2d_animation_play_spritesheet_animation.png


BIN
tutorials/2d/img/2d_animation_play_spritesheet_animation.webp


BIN
tutorials/2d/img/2d_animation_spriteframes.png


BIN
tutorials/2d/img/2d_animation_spriteframes.webp


BIN
tutorials/2d/img/2d_animation_spriteframes_done.png


BIN
tutorials/2d/img/2d_animation_spriteframes_done.webp


BIN
tutorials/2d/img/2d_animation_spritesheet_animation.png


BIN
tutorials/2d/img/2d_animation_spritesheet_animation.webp


BIN
tutorials/2d/img/2d_animation_spritesheet_select_rows.png


BIN
tutorials/2d/img/2d_animation_spritesheet_select_rows.webp


BIN
tutorials/2d/img/2d_animation_spritesheet_selectframes.png


BIN
tutorials/2d/img/2d_animation_spritesheet_selectframes.webp


+ 2 - 2
tutorials/2d/using_tilesets.rst

@@ -196,7 +196,7 @@ Save this scene to a scene file (separate from the scene containing the
 TileMap), then switch to the scene containing the TileMap node. Open the TileSet
 editor, and create a new **Scenes Collection** in the left column:
 
-.. figure:: img/using_tilesets_recreate_tiles_automatically.webp
+.. figure:: img/using_tilesets_creating_scene_collection.webp
    :align: center
    :alt: Creating a scenes collection in the TileSet editor
 
@@ -215,7 +215,7 @@ collection then create a new scene slot:
 Select this scene slot in the right column, then use **Quick Load** (or
 **Load**) to load the scene file containing the particles:
 
-.. figure:: img/using_tilesets_recreate_tiles_automatically.webp
+.. figure:: img/using_tilesets_adding_scene_tile.webp
    :align: center
    :alt: Creating a scene slot, then loading a scene file into it in the TileSet editor
 

+ 4 - 0
tutorials/3d/3d_antialiasing.rst

@@ -73,6 +73,8 @@ Note that alpha antialiasing is not used here:
 
 .. image:: img/antialiasing_msaa_8x.webp
 
+.. _doc_3d_antialiasing_taa:
+
 Temporal antialiasing (TAA)
 ---------------------------
 
@@ -103,6 +105,8 @@ Comparison between no antialiasing (left) and TAA (right):
 
 .. image:: img/antialiasing_taa.webp
 
+.. _doc_3d_antialiasing_fxaa:
+
 Fast approximate antialiasing (FXAA)
 ------------------------------------
 

+ 6 - 6
tutorials/3d/global_illumination/using_lightmap_gi.rst

@@ -143,8 +143,8 @@ of the 3D editor viewport:
 This will generate a second set of UV2 coordinates which can be used for baking.
 It will also set the texture size automatically.
 
-Unwrap from your 3D DCC
-^^^^^^^^^^^^^^^^^^^^^^^
+Unwrap from your 3D modeling software
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 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.
@@ -161,10 +161,10 @@ size on the mesh after import.
 
 .. image:: img/lightmap_gi_lmsize.png
 
-If you use external meshes on import, the size will be kept.
-Be wary that most unwrappers in 3D DCCs are not quality oriented, as they are
-meant to work quickly. You will mostly need to use seams or other techniques to
-create better unwrapping.
+If you use external meshes on import, the size will be kept. Be wary that most
+unwrappers in 3D modeling software are not quality-oriented, as they are meant
+to work quickly. You will mostly need to use seams or other techniques to create
+better unwrapping.
 
 Checking UV2
 ^^^^^^^^^^^^

+ 4 - 4
tutorials/3d/high_dynamic_range.rst

@@ -8,10 +8,10 @@ High dynamic range lighting
 Introduction
 ------------
 
-Normally, an artist does all the 3D modelling, then all the texturing,
-looks at their awesome looking model in the 3D DCC and says "looks
-fantastic, ready for integration!" then goes into the game, lighting is
-setup and the game runs.
+Normally, an artist does all the 3D modelling, then all the texturing, looks at
+their awesome looking model in the 3D modeling software and says "looks
+fantastic, ready for integration!" then goes into the game, lighting is setup
+and the game runs.
 
 So at what point does all this "HDR" business come into play? To understand
 the answer, we need to look at how displays behave.

BIN
tutorials/3d/img/decals_blob_shadow.webp


BIN
tutorials/3d/img/decals_dirt.webp


BIN
tutorials/3d/img/lights_and_shadows_acne.webp


BIN
tutorials/3d/img/lights_and_shadows_blur.webp


BIN
tutorials/3d/img/lights_and_shadows_directional_mode.webp


BIN
tutorials/3d/img/lights_and_shadows_directional_shadow_params.webp


BIN
tutorials/3d/img/lights_and_shadows_dual_parabolid_vs_cubemap.webp


BIN
tutorials/3d/img/lights_and_shadows_filter_quality.webp


BIN
tutorials/3d/img/lights_and_shadows_omni_projector.webp


BIN
tutorials/3d/img/lights_and_shadows_omni_projector_example.webp


BIN
tutorials/3d/img/lights_and_shadows_pcss.webp


BIN
tutorials/3d/img/lights_and_shadows_peter_panning.webp


BIN
tutorials/3d/img/lights_and_shadows_pssm_explained.webp


BIN
tutorials/3d/img/lights_and_shadows_shadow_quadrants.webp


BIN
tutorials/3d/img/lights_and_shadows_shadow_quadrants2.webp


BIN
tutorials/3d/img/lights_and_shadows_spot_projector.webp


BIN
tutorials/3d/img/lights_and_shadows_spot_projector_example.webp


BIN
tutorials/3d/img/pssm_explained.png


BIN
tutorials/3d/img/shadow_atlas.png


BIN
tutorials/3d/img/shadow_bias.png


BIN
tutorials/3d/img/shadow_blocky.png


BIN
tutorials/3d/img/shadow_contact.png


BIN
tutorials/3d/img/shadow_omni_dp_cm.png


BIN
tutorials/3d/img/shadow_pcf1.png


BIN
tutorials/3d/img/shadow_pcf2.png


BIN
tutorials/3d/img/shadow_pssm.png


BIN
tutorials/3d/img/shadow_quadrants.png


BIN
tutorials/3d/img/shadow_quadrants2.png


+ 1 - 0
tutorials/3d/index.rst

@@ -20,6 +20,7 @@ Rendering
    3d_rendering_limitations
    standard_material_3d
    lights_and_shadows
+   using_decals
    physical_light_and_camera_units
    high_dynamic_range
    global_illumination/index

+ 24 - 19
tutorials/3d/introduction_to_3d.rst

@@ -38,21 +38,21 @@ scale.
 3D content
 ~~~~~~~~~~
 
-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 (usually referred to as Digital Content Creation tools, or
-DCCs) and exported to an exchange file format to be imported in
-Godot. This is required since 3D formats are not as standardized as images.
+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
+(also called Digital Content Creation tools, or DCCs) and exported to an
+exchange file format to be imported in Godot. This is required since 3D formats
+are not as standardized as images.
 
-DCC-created models
-------------------
+Maually authored models (using 3D modeling software)
+----------------------------------------------------
 
 .. FIXME: Needs update to properly description Godot 3.x workflow
    (used to reference a non existing doc_importing_3d_meshes importer).
 
-There are two pipelines to import 3D models in Godot. The first and most
-common one is by :ref:`doc_importing_3d_scenes`, which allows you to import
-entire scenes (exactly as they look in the DCC), including animation,
+There are two pipelines to import 3D models in Godot. The first and most common
+one is by :ref:`doc_importing_3d_scenes`, which allows you to import entire
+scenes (exactly as they look in the 3D modeling software), including animation,
 skeletal rigs, blend shapes, etc.
 
 The second pipeline is by importing simple .OBJ files as mesh resources,
@@ -130,12 +130,12 @@ system for everything in 3D, with 1 unit being equal to 1 meter.
 Physics and other areas are tuned for this scale. Therefore, attempting to use a
 different scale is usually a bad idea (unless you know what you are doing).
 
-When working with 3D assets, it's always best to work in the correct
-scale (set your DCC to metric). Godot allows scaling post-import and,
-while this works in most cases, in rare situations it may introduce
-floating-point precision issues (and thus, glitches or artifacts) in
-delicate areas such as rendering or physics. Make sure your artists
-always work in the right scale!
+When working with 3D assets, it's always best to work in the correct scale (set
+the unit to metric in your 3D modeling software). Godot allows scaling
+post-import and, while this works in most cases, in rare situations it may
+introduce floating-point precision issues (and thus, glitches or artifacts) in
+delicate areas such as rendering or physics. Make sure your artists always work
+in the right scale!
 
 The Y coordinate is used for "up". As for the horizontal X/Z axes, Godot uses a
 **right-handed** coordinate system. This means that for most objects that need
@@ -193,7 +193,7 @@ When created from the Project Manager, the 3D environment has a default sky.
 
 .. image:: img/tuto_3d8.png
 
-Given how physically based rendering works, it is advised to always try to
+Given how physically-based rendering works, it is advised to always try to
 work with a default environment in order to provide indirect and reflected
 light to your objects.
 
@@ -230,5 +230,10 @@ each viewport:
 Lights
 ------
 
-There is no limitation on the number of lights, nor of types of lights, in
-Godot. As many as desired can be added (as long as performance allows).
+The background environment emits some ambient light which appears on surfaces.
+Still, without any light sources placed in the scene, the scene will appear
+quite dark unless the background environment is very bright.
+
+Most outdoor scenes have a directional light (the sun or moon), while indoor
+scenes typically have several positional lights (lamps, torches, …).
+See :ref:`doc_lights_and_shadows` for more information on setting up lights in Godot.

+ 380 - 115
tutorials/3d/lights_and_shadows.rst

@@ -9,12 +9,13 @@ Introduction
 Light sources emit light that mixes with the materials and produces a visible
 result. Light can come from several types of sources in a scene:
 
--  From the Material itself in the form of the emission color (though
-   it does not affect nearby objects unless baked).
--  Light Nodes: Directional, Omni and Spot.
--  Ambient Light in the
-   :ref:`Environment <class_Environment>`.
--  Baked Light (read :ref:`doc_using_lightmap_gi`).
+- From the material itself, in the form of the emission color (though it does
+  not affect nearby objects unless baked or screen-space indirect lighting is enabled).
+- Light nodes: DirectionalLight3D, OmniLight3D and SpotLight3D.
+- Ambient light in the :ref:`Environment <class_Environment>` or
+  :ref:`doc_reflection_probes`.
+- Global illumination (:ref:`LightmapGI <doc_using_lightmap_gi>`,
+  :ref:`VoxelGI <doc_using_voxel_gi>` or :ref:`SDFGI <doc_using_sdfgi>`).
 
 The emission color is a material property. You can read more about it
 in the :ref:`doc_standard_material_3d` tutorial.
@@ -22,30 +23,73 @@ in the :ref:`doc_standard_material_3d` tutorial.
 Light nodes
 -----------
 
-There are three types of light nodes: `Directional light`_,
-`Omni light`_ and `Spot light`_. Let's take a look at the common
+There are three types of light nodes: :ref:`class_DirectionalLight3D`,
+:ref:`class_OmniLight3D` and :ref:`class_SpotLight3D`. Let's take a look at the common
 parameters for lights:
 
 .. image:: img/light_params.png
 
-Each one has a specific function:
+Each property has a specific function:
 
--  **Color**: Base color for emitted light.
--  **Energy**: Energy multiplier. This is useful for saturating lights or working with :ref:`doc_high_dynamic_range`.
--  **Indirect Energy**: Secondary multiplier used with indirect light (light bounces). This works in baked light or GIProbe.
--  **Negative**: Light becomes subtractive instead of additive. It's sometimes useful to manually compensate some dark corners.
--  **Specular**: Affects the intensity of the specular blob in objects affected by this light. At zero, this light becomes a pure diffuse light.
--  **Bake Mode**: Sets the bake mode for the light. For more information see :ref:`doc_using_lightmap_gi`
--  **Cull Mask**: Objects that are in the selected layers below will be affected by this light.
-   Note that objects disabled via this cull mask will still cast shadows.
-   If you don't want disabled objects to cast shadows, adjust the ``cast_shadow`` property on the
-   GeometryInstance to the desired value.
+- **Color:** Base color for emitted light.
+- **Energy:** Energy multiplier. This is useful for saturating lights or working with :ref:`doc_high_dynamic_range`.
+- **Indirect Energy:** Secondary multiplier used with indirect light (light bounces). This works with :ref:`doc_using_lightmap_gi`, VoxelGI or SDFGI.
+- **Volumetric Fog Energy:** Secondary multiplier used with volumetric fog. This only has an effect when volumetric fog is enabled.
+- **Negative:** Light becomes subtractive instead of additive. It's sometimes useful to manually compensate some dark corners.
+- **Specular:** Affects the intensity of the specular blob in objects affected by this light. At zero, this light becomes a pure diffuse light.
+- **Bake Mode:** Sets the bake mode for the light. See :ref:`doc_using_lightmap_gi`.
+- **Cull Mask:** Objects that are in the selected layers below will be affected by this light.
+  Note that objects disabled via this cull mask will still cast shadows.
+  If you don't want disabled objects to cast shadows, adjust the **Cast Shadow**
+  property on the GeometryInstance3D to the desired value.
 
 .. seealso::
 
     See :ref:`doc_physical_light_and_camera_units` if you wish to use real world
     units to configure your lights' intensity and color temperature.
 
+Light number limits
+-------------------
+
+When using the Forward+ renderer, Godot uses a *clustering* approach for
+real-time lighting. As many lights as desired can be added (as long as
+performance allows). However, there's still a default limit of 512 *clustered
+elements* that can be present in the current camera view. A clustered element is
+an omni light, a spot light, a :ref:`decal <doc_using_decals>` or a
+:ref:`reflection probe <doc_reflection_probes>`. This limit can be increased by
+adjusting the **Rendering > Limits > Cluster Builder > Max Clustered Elements**
+advanced project setting.
+
+When using the Forward Mobile renderer, there is a limitation of 8 OmniLights +
+8 SpotLights per mesh resource. There is also a limit of 256 OmniLights + 256
+SpotLights that can be rendered in the current camera view. These limits
+currently cannot be changed.
+
+When using the Compatibility renderer, up to 8 OmniLights + 8 SpotLights can be
+rendered per mesh resource. This limit can be increased in the advanced Project
+Settings by adjusting **Rendering > Limits > OpenGL > Max Renderable Lights**
+and/or **Rendering > Limits > OpenGL > Max Lights Per Object** at the cost of
+performance and longer shader compilation times. The limit can also be decreased
+to reduce shader compilation times and improve performance slightly.
+
+With all rendering methods, up to 8 DirectionalLights can be visible at a time.
+However, each additional DirectionalLight with shadows enabled will reduce the
+effective shadow resolution of each DirectionalLight. This is because
+directional shadow atlas is shared between all lights.
+
+If the rendering limit is exceeded, lights will start popping in and out during
+camera movement, which can be distracting. Enabling **Distance Fade** on light
+nodes can help reduce this issue while also improving performance. Splitting
+your meshes into smaller portions can also help, especially for level geometry
+(which also improves culling efficiency).
+
+If you need to render more lights than possible in a given rendering backend,
+consider using :ref:`baked lightmaps <doc_using_lightmap_gi>` with lights' bake
+mode set to **Static**. This allows lights to be fully baked, which also makes
+them much faster to render. You can also use emissive materials with any
+:ref:`global illumination <doc_introduction_to_global_illumination>` technique
+as a replacement for light nodes that emit light over a large area.
+
 Shadow mapping
 ^^^^^^^^^^^^^^
 
@@ -53,30 +97,66 @@ Lights can optionally cast shadows. This gives them greater realism (light does
 not reach occluded areas), but it can incur a bigger performance cost.
 There is a list of generic shadow parameters, each also has a specific function:
 
--  **Enabled**: Check to enable shadow mapping in this light.
--  **Color**: Areas occluded are multiplied by this color. It is black by default, but it can be changed to tint shadows.
--  **Bias**: When this parameter is too small, self shadowing occurs. When too large, shadows separate from the casters. Tweak to what works best for you.
--  **Contact**: Performs a short screen-space raycast to reduce the gap generated by the bias. Contact shadows are only available when using the GLES3 backend.
--  **Reverse Cull Faces**: Some scenes work better when shadow mapping is rendered with face-culling inverted.
+- **Enabled:** Check to enable shadow mapping in this light.
+- **Opacity:** Areas occluded are darkened by this opacity factor. Shadows are
+  fully opaque by default, but this can be changed to make shadows translucent
+  for a given light.
+- **Bias:** When this parameter is too low, self-shadowing occurs. When too
+  high, shadows separate from the casters. Tweak to what works best for you.
+- **Normal Bias:** When this parameter is too low, self-shadowing occurs. When too
+  high, shadows appear misaligned from the casters. Tweak to what works best for you.
+- **Transmittance Bias:** When this parameter is too low, self-shadowing
+  occurs on materials that have transmittance enabled. When too high, shadows
+  will not affect materials that have transmittance enabled consistently. Tweak
+  to what works best for you.
+- **Reverse Cull Face:** Some scenes work better when shadow mapping is rendered
+  with face-culling inverted.
+- **Blur:** Multiplies the shadow blur radius for this light. This works with
+  both traditional shadow mapping and contact-hardening shadows (lights with
+  **Angular Distance** or **Size** greater than ``0.0``). Higher values result
+  in softer shadows, which will also appear to be more temporally stable for
+  moving objects. The downside of increasing shadow blur is that it will make
+  the grainy pattern used for filtering more noticeable.
+  See also :ref:`doc_lights_and_shadows_shadow_filter_mode`.
 
 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.
+
+If the **Shadow Bias** or **Shadow Normal Bias** is set too low for a given light,
+the shadow will be "smeared" onto the objects. This will cause the light's
+intended appearance to darken, and is called *shadow acne*:
+
+.. image:: img/lights_and_shadows_acne.webp
+
+On the other hand, if the **Shadow Bias** or **Shadow Normal Bias** is set too
+high for a given light, the shadow may appear to be disconnected from the
+object. This is called *peter-panning*:
 
-.. image:: img/shadow_bias.png
+.. image:: img/lights_and_shadows_peter_panning.webp
 
-Finally, if gaps can't be solved, the **Contact** option can help:
+In general, increasing **Shadow Normal Bias** is preferred over increasing
+**Shadow Bias**. Increasing **Shadow Normal Bias** does not cause as much
+peter-panning as increasing **Shadow Normal Bias**, but it can still resolve
+most shadow acne issues efficiently. The downside of increasing **Shadow Normal
+Bias** is that it can make shadows appear thinner for certain objects.
 
-.. image:: img/shadow_contact.png
+Any sort of bias issues can be fixed by
+:ref:`increasing the shadow map resolution <doc_lights_and_shadows_balancing_performance_and_quality>`,
+at the cost of decreased performance.
 
-Any sort of bias issues can always be fixed by increasing the shadow map resolution,
-although that may lead to decreased performance on low-end hardware.
+.. note::
+
+    Tweaking shadow mapping settings is an art – there are no "one size fits
+    all" settings. To achieve the best visuals, you may need to use different
+    shadow bias values on a per-light basis.
 
 Directional light
-~~~~~~~~~~~~~~~~~
+-----------------
 
-This is the most common type of light and represents a light source
-very far away (such as the sun). It is also the cheapest light to compute and should be used whenever possible
-(although it's not the cheapest shadow-map to compute, but more on that later).
+This is the most common type of light and represents a light source very far
+away (such as the sun). It is also the cheapest light to compute and should be
+used whenever possible (although it's not the cheapest shadow-map to compute,
+but more on that later).
 
 Directional light models an infinite number of parallel light rays
 covering the whole scene. The directional light node is represented by a big arrow which
@@ -85,70 +165,78 @@ does not affect the lighting at all and can be anywhere.
 
 .. image:: img/light_directional.png
 
-Every face whose front-side is hit by the light rays is lit, while the others stay dark. Unlike most
-other light types directional lights, don't have specific parameters.
+Every face whose front-side is hit by the light rays is lit, while the others
+stay dark. Unlike most other light types directional lights, don't have specific
+parameters.
+
+The directional light also offers a **Angular Distance** property, which
+determines the light's angular size in degrees. Increasing this above ``0.0``
+will make shadows softer at greater distances from the caster, while also
+affecting the sun's appearance in procedural sky materials. This is called a
+*contact-hardening* shadow (also known as PCSS).
+
+For reference, the angular distance of the Sun viewed from the Earth is
+approximately ``0.5``. This kind of shadow is expensive, so check the
+recommendations in :ref:`doc_lights_and_shadows_pcss_recommendations` if setting
+this value above ``0.0`` on lights with shadows enabled.
 
 Directional shadow mapping
 ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-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, however, a problem with this approach because objects
-closer to the camera receive blocky shadows.
+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,
+however, a problem with this approach because objects closer to the camera
+receive low-resolution shadows that may appear blocky.
 
-.. image:: img/shadow_blocky.png
+To fix this, a technique named *Parallel Split Shadow Maps* (PSSM) is used.
+This splits the view frustum in 2 or 4 areas. Each area gets its own shadow map.
+This allows small areas close to the viewer to have the same shadow resolution
+as a huge, far-away area.
 
-To fix this, a technique named "Parallel Split Shadow Maps" (or PSSM) is used. This splits the view frustum in 2 or 4 areas. Each
-area gets its own shadow map. This allows small areas close to the viewer to have the same shadow resolution as a huge, far-away area.
-
-.. image:: img/pssm_explained.png
+.. image:: img/lights_and_shadows_pssm_explained.webp
 
 With this, shadows become more detailed:
 
-.. image:: img/shadow_pssm.png
+.. image:: img/lights_and_shadows_directional_mode.webp
 
 To control PSSM, a number of parameters are exposed:
 
-.. image:: img/directional_shadow_params.png
+.. image:: img/lights_and_shadows_directional_shadow_params.webp
 
 Each split distance is controlled relative to the camera far (or shadow
-**Max Distance** if greater than zero), so *0.0* is the eye position and *1.0*
-is where the shadow ends at a distance. Splits are in-between. Default values
-generally work well, but tweaking the first split a bit is common to give more
-detail to close objects (like a character in a third person game).
-
-Always make sure to set a shadow *Max Distance* according to what the scene needs.
-A lower maximum distance will result in better-looking shadows.
-
-Sometimes, the transition between a split and the next can look bad. To fix this,
-the **"Blend Splits"** option can be turned on, which sacrifices detail in exchange
-for smoother transitions:
+**Max Distance** if greater than ``0.0``). ``0.0`` is the eye position and
+``1.0`` is where the shadow ends at a distance. Splits are in-between.
+Default values generally work well, but tweaking the first split a bit is common
+to give more detail to close objects (like a character in a third-person game).
+
+Always make sure to set a shadow **Max Distance** according to what the scene
+needs. A lower maximum distance will result in better-looking shadows and better
+performance, as fewer objects will need to be included in shadow rendering. You
+can also adjust **Fade Start** to control how aggressive the shadow fade-out
+should be at a distance. For scenes where the **Max Distance** fully covers the
+scene at any given camera position, you can increase **Fade Start** to ``1.0``
+to prevent the shadow from fading at a distance. This should not be done in
+scenes where **Max Distance** doesn't fully cover the scene, as the shadow will
+appear to be suddenly cut off at a distance.
+
+Sometimes, the transition between a split and the next can look bad. To fix
+this, the **Blend Splits** option can be turned on, which sacrifices detail and
+performance in exchange for smoother transitions:
 
 .. image:: img/blend_splits.png
 
-The **"Normal Bias"** parameter can be used to fix special cases of self shadowing
-when objects are perpendicular to the light. The only downside is that it makes
-the shadow a bit thinner.
-
-.. image:: img/normal_bias.png
-
-The **"Bias Split Scale"** parameter can control extra bias for the splits that
-are far away. If self shadowing occurs only on the splits far away, this value can fix them.
-
-Finally, the **"Depth Range"** has two settings:
+The **Shadow > Normal Bias** parameter can be used to fix special cases of
+self-shadowing when objects are perpendicular to the light. The only downside is
+that it makes the shadow a bit thinner. Consider increasing **Shadow > Normal
+Bias** before increasing **Shadow > Bias** in most situations.
 
-- **Stable**: Keeps the shadow stable while the camera moves, and the blocks that appear in the outline when close to the shadow edges remain in-place. This is the default and generally desired, but it reduces the effective shadow resolution.
-- **Optimized**: Tries to achieve the maximum resolution available at any given time. This may result in a "moving saw" effect on shadow edges, but at the same time the shadow looks more detailed (so this effect may be subtle enough to be forgiven).
-
-Just experiment which setting works better for your scene.
-
-Shadowmap size for directional lights can be changed in Project Settings -> Rendering -> Quality:
-
-.. image:: img/project_setting_shadow.png
-
-Increasing it can solve bias problems, but decrease performance. Shadow mapping is an art of tweaking.
+Lastly, **Pancake Size** is a property that can be adjusted to fix missing
+shadows when using large objects with unsubdivided meshes. Only change this
+value if you notice missing shadows that are not related to shadow biasing
+issues.
 
 Omni light
-~~~~~~~~~~
+----------
 
 Omni light is a point source that emits light spherically in all directions up to a given
 radius.
@@ -158,7 +246,7 @@ radius.
 In real life, light attenuation is an inverse function, which means omni lights don't have a radius.
 This is a problem because it means computing several omni lights would become demanding.
 
-To solve this, a *Range* is introduced together with an attenuation function.
+To solve this, a **Range** parameter is introduced together with an attenuation function.
 
 .. image:: img/light_omni_params.png
 
@@ -166,59 +254,114 @@ These two parameters allow tweaking how this works visually in order to find aes
 
 .. image:: img/light_attenuation.png
 
+A **Size** parameter is also available in OmniLight3D. Increasing this value
+will make the light fade out slower and shadows appear blurrier when far away
+from the caster. This can be used to simulate area lights to an extent. This is
+called a *contact-hardening* shadow (also known as PCSS). This kind of shadow is
+expensive, so check the recommendations in
+:ref:`doc_lights_and_shadows_pcss_recommendations` if setting this value above
+``0.0`` on lights with shadows enabled.
 
 Omni shadow mapping
 ^^^^^^^^^^^^^^^^^^^
 
-Omni light shadow mapping is relatively straightforward. The main issue that needs to be
-considered is the algorithm used to render it.
+Omni light shadow mapping is relatively straightforward. The main issue that
+needs to be considered is the algorithm used to render it.
+
+Omni Shadows can be rendered as either **Dual Paraboloid** or **Cube** mapped.
+**Dual Parabolid** renders quickly, but can cause deformations, while **Cube**
+is more correct, but slower. The default is **Cube**, but consider changing it
+to **Dual Parabolid** for lights where it doesn't make much of a visual
+difference.
+
+.. image:: img/lights_and_shadows_dual_parabolid_vs_cubemap.webp
+
+If the objects being rendered are mostly irregular and subdivided, Dual
+Paraboloid is usually enough. In any case, as these shadows are cached in a
+shadow atlas (more on that at the end), it may not make a difference in
+performance for most scenes.
 
-Omni Shadows can be rendered as either **"Dual Paraboloid" or "Cube Mapped"**.
-The former renders quickly, but can cause deformations,
-while the later is more correct, but costlier.
+Omni lights with shadows enabled can make use of projectors. The projector
+texture will *multiply* the light's color by the color at a given point on the
+texture. As a result, lights will usually appear to be darker once a projector
+texture is assigned; you can increase **Energy** to compensate for this.
 
-.. image:: img/shadow_omni_dp_cm.png
+Omni light projector textures require a special 360° panorama mapping, similar
+to :ref:`class_PanoramaSkyMaterial` textures.
 
-If the objects being rendered are mostly irregular, Dual Paraboloid is usually
-enough. In any case, as these shadows are cached in a shadow atlas (more on that at the end), it
-may not make a difference in performance for most scenes.
+With the projector texture below, the following result is obtained:
+
+.. image:: img/lights_and_shadows_omni_projector_example.webp
+
+.. image:: img/lights_and_shadows_omni_projector.webp
+
+.. tip::
+
+    If you've acquired omni projectors in the form of cubemap images, you can use
+    `this web-based conversion tool <https://danilw.github.io/GLSL-howto/cubemap_to_panorama_js/cubemap_to_panorama.html>`__
+    to convert them to a single panorama image.
 
 Spot light
-~~~~~~~~~~
+----------
 
 Spot lights are similar to omni lights, except they emit light only into a cone
 (or "cutoff"). They are useful to simulate flashlights,
 car lights, reflectors, spots, etc. This type of light is also attenuated towards the
 opposite direction it points to.
 
-.. image:: img/light_spot.png
-
-Spot lights share the same **Range** and **Attenuation** as **OmniLight**, and add two extra parameters:
+Spot lights share the same **Range**, **Attenuation** and **Size** as OmniLight3D,
+and add two extra parameters:
 
-- **Angle**: The aperture angle of the light
-- **Angle Attenuation**: The cone attenuation, which helps soften the cone borders.
+- **Angle:** The aperture angle of the light.
+- **Angle Attenuation:** The cone attenuation, which helps soften the cone borders.
 
 Spot shadow mapping
 ^^^^^^^^^^^^^^^^^^^
 
-Spots don't need any parameters for shadow mapping. Keep in mind that, at more than 89 degrees of aperture, shadows
-stop functioning for spots, and you should consider using an Omni light instead.
+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
+shadow texture needs to be rendered (instead of rendering 6 faces, or 2 in dual
+parabolid mode).
 
-Shadow atlas
-~~~~~~~~~~~~
+Spot lights with shadows enabled can make use of projectors. The projector
+texture will *multiply* the light's color by the color at a given point on the
+texture. As a result, lights will usually appear to be darker once a projector
+texture is assigned; you can increase **Energy** to compensate for this.
 
-Unlike Directional lights, which have their own shadow texture, Omni and Spot lights are assigned to slots of a shadow atlas.
-This atlas can be configured in Project Settings -> Rendering -> Quality -> Shadow Atlas.
+Unlike omni light projectors, a spot light projector texture doesn't need to
+follow a special format to look correct. It will be mapped in a way similar to a
+:ref:`decal <doc_using_decals>`.
 
-.. image:: img/shadow_atlas.png
+With the projector texture below, the following result is obtained:
 
-The resolution applies to the whole Shadow Atlas. This atlas is divided into four quadrants:
+.. image:: img/lights_and_shadows_spot_projector_example.webp
 
-.. image:: img/shadow_quadrants.png
+.. image:: img/lights_and_shadows_spot_projector.webp
+
+.. note::
+
+    Spot lights with wide angles will have lower-quality shadows than spot
+    lights with narrow angles, as the shadow map is spread over a larger
+    surface. At angles wider than 89 degrees, spot light shadows will stop
+    working entirely. If you need shadows for wider lights, use an omni light
+    instead.
+
+.. _doc_lights_and_shadows_shadow_atlas:
+
+Shadow atlas
+------------
+
+Unlike Directional lights, which have their own shadow texture, omni and spot
+lights are assigned to slots of a shadow atlas. This atlas can be configured in
+the advanced Project Settings (**Rendering > Lights And Shadows > Positional Shadow**).
+
+The resolution applies to the whole shadow atlas. This atlas is divided into four quadrants:
+
+.. image:: img/lights_and_shadows_shadow_quadrants.webp
 
 Each quadrant can be subdivided to allocate any number of shadow maps; the following is the default subdivision:
 
-.. image:: img/shadow_quadrants2.png
+.. image:: img/lights_and_shadows_shadow_quadrants2.webp
 
 The shadow atlas allocates space as follows:
 
@@ -231,20 +374,142 @@ Every frame, the following procedure is performed for all lights:
 2. Check if any object affecting the shadow map has changed. If it did, re-render the light.
 3. If neither of the above has happened, nothing is done, and the shadow is left untouched.
 
-If the slots in a quadrant are full, lights are pushed back to smaller slots, depending on size and distance.
+If the slots in a quadrant are full, lights are pushed back to smaller slots,
+depending on size and distance. If all slots in all quadrants are full, some
+lights will not be able to render shadows even if shadows are enabled on them.
+
+The default shadow allocation strategy allows rendering up to 88 lights with
+shadows enabled in the camera frustum (4 + 4 + 16 + 64):
+
+1. The first and most detailed quadrant can store 4 shadows.
+2. The second quadrant can store 4 other shadows.
+3. The third quadrant can store 16 shadows, with less detail.
+4. The fourth and least detailed quadrant can store 64 shadows, with even less detail.
+
+Using a higher number of shadows per quadrant allows supporting a greater amount
+of total lights with shadows enabled, while also improving performance (as
+shadows will be rendered at a lower resolution for each light). However,
+increasing the number of shadows per quadrant comes at the cost of lower shadow
+quality.
+
+In some cases, you may want to use a different allocation strategy. For example,
+in a top-down game where all lights are around the same size, you may want to
+set all quadrants to have the same subdivision so that all lights have shadows
+of similar quality level.
 
-This allocation strategy works for most games, but you may want to use a separate one in some cases (for example, a top-down game where
-all lights are around the same size and quadrants may all have the same subdivision).
+.. _doc_lights_and_shadows_balancing_performance_and_quality:
 
-Shadow filter quality
-~~~~~~~~~~~~~~~~~~~~~
+Balancing performance and quality
+---------------------------------
 
-The filter quality of shadows can be tweaked. This can be found in
-Project Settings -> Rendering -> Quality -> Shadows.
-Godot supports no filter, PCF5 and PCF13.
+Shadow rendering is a critical topic in 3D rendering performance. It's important
+to make the right choices here to avoid creating bottlenecks.
 
-.. image:: img/shadow_pcf1.png
+Directional shadow quality settings can be changed at run-time by calling the
+appropriate :ref:`class_RenderingServer` methods.
 
-It affects the blockiness of the shadow outline:
+Positional (omni/spot) shadow quality settings can be changed at run-time on the
+root :ref:`class_Viewport`.
+
+Shadow map size
+^^^^^^^^^^^^^^^
+
+High shadow resolutions result in sharper shadows, but at a significant
+performance cost. It should also be noted that *sharper shadows are not always
+more realistic*. In most cases, this should be kept at its default value of
+``4096`` or decreased to ``2048`` for low-end GPUs.
+
+If positional shadows become too blurry after decreasing the shadow map size,
+you can counteract this by adjusting the
+:ref:`shadow atlas <doc_lights_and_shadows_shadow_atlas>` quadrants to contain
+fewer shadows. This will allow each shadow to be rendered at a higher resolution.
+
+.. _doc_lights_and_shadows_shadow_filter_mode:
+
+Shadow filter mode
+^^^^^^^^^^^^^^^^^^
+
+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
+textures, as the texture detail will help make the dithering pattern less noticeable.
+
+However, in projects with less detailed textures, the shadow dithering pattern
+may be more visible. To hide this pattern, you can either enable
+:ref:`doc_3d_antialiasing_taa`, :ref:`doc_3d_antialiasing_fxaa`, or increase the
+shadow filter quality to **Soft Medium** or higher.
+
+The **Soft Very Low** setting will automatically decrease shadow blur to make
+artifacts from the low sample count less visible. Conversely, the **Soft High**
+and **Soft Ultra** settings will automatically increase shadow blur to better
+make use of the increased sample count.
+
+16-bits versus 32-bit
+^^^^^^^^^^^^^^^^^^^^^
+
+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
+in quality.
+
+If **16 Bits** is disabled, 32-bit depth textures will be used instead. This
+can result in less artifacting in large scenes and large lights with shadows
+enabled. However, the difference is often barely visible, yet this can have a
+significant performance cost.
+
+Light/shadow distance fade
+^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-.. image:: img/shadow_pcf2.png
+OmniLight3D and SpotLight3D offer several properties to hide distant lights.
+This can improve performance significantly in large scenes with dozens of lights
+or more.
+
+- **Enabled:** Controls whether distance fade (a form of :abbr:`LOD (Level of Detail)`)
+  is enabled. The light will fade out over **Begin + Length**, after which it
+  will be culled and not sent to the shader at all. Use this to reduce the number
+  of active lights in a scene and thus improve performance.
+- **Begin:** The distance from the camera at which the light begins to fade away
+  (in 3D units).
+- **Shadow:** The distance from the camera at which the shadow begins to fade away
+  (in 3D units). This can be used to fade out shadows sooner compared to the light,
+  further improving performance. Only available if shadows are enabled for the light.
+- **Length:** The distance over which the light and shadow fades (in 3D units).
+  The light becomes slowly more transparent over this distance and is completely
+  invisible at the end. Higher values result in a smoother fade-out transition,
+  which is more suited when the camera moves fast.
+
+.. _doc_lights_and_shadows_pcss_recommendations:
+
+PCSS recommendations
+^^^^^^^^^^^^^^^^^^^^
+
+Percentage-closer soft shadows (PCSS) provide a more realistic shadow mapping
+appearance, with the penumbra size varying depending on the distance between the
+caster and the surface receiving the shadow. This comes at a high performance
+cost, especially for directional lights.
+
+To avoid performance issues, it's recommended to:
+
+- Only use a handful of lights with PCSS shadows enabled at a given time. The
+  effect is generally most visible on large, bright lights. Secondary light
+  sources that are more faint usually don't benefit much from using PCSS
+  shadows.
+- Provide a setting for users to disable PCSS shadows. On directional lights,
+  this can be done by setting the DirectionalLight3D's
+  ``light_angular_distance`` property to ``0.0`` in a script. On positional
+  lights, this can be done by setting the OmniLight3D or SpotLight3D's
+  ``light_size`` property to ``0.0`` in a script.
+
+Projector filter mode
+^^^^^^^^^^^^^^^^^^^^^
+
+The way projectors are rendered also has an impact on performance. The
+**Rendering > Textures > Light Projectors > Filter** advanced project setting
+lets you control how projector textures should be filtered. **Nearest/Linear** do
+not use mipmaps, which makes them faster to render. However, projectors will
+look grainy at distance. **Nearest/Linear Mipmaps** will look smoother at a
+distance, but projectors will look blurry when viewed from oblique angles. This
+can be resolved by using **Nearest/Linear Mipmaps Anisotropic**, which is the
+highest-quality mode but also the most expensive.
+
+If your project has a pixel art style, consider setting the filter to one of the
+**Nearest** values so that projectors use nearest-neighbor filtering. Otherwise,
+stick to **Linear**.

+ 14 - 0
tutorials/3d/mesh_lod.rst

@@ -84,6 +84,20 @@ click **Reimport**:
 
 This will require restarting the editor after clicking **Reimport**.
 
+.. note::
+
+   The mesh LOD generation process is not perfect, and may occasionally
+   introduce rendering issues (especially in skinned meshes). Mesh LOD
+   generation can also take a while on complex meshes.
+
+   If mesh LOD causes a specific mesh to look broken, you can disable LOD
+   generation for it in the Import dock. This will also speed up resource
+   importing. This can be done globally in the 3D scene's import options, or on
+   a per-mesh basis using the Advanced Import Settings dialog.
+
+   See :ref:`Importing 3D scenes <doc_importing_3d_scenes_using_the_import_dock>`
+   for more information.
+
 Comparing mesh LOD visuals and performance
 ------------------------------------------
 

+ 4 - 4
tutorials/3d/standard_material_3d.rst

@@ -218,8 +218,8 @@ Choosing this option means vertex color is used as albedo color.
 Is sRGB
 ~~~~~~~
 
-Most 3D DCCs will likely export vertex colors as sRGB, so toggling this
-option on will help them look correct.
+Most 3D modeling software will likely export vertex colors as sRGB, so toggling
+this option on will help them look correct.
 
 Albedo
 ------
@@ -531,8 +531,8 @@ Use Point Size
 ~~~~~~~~~~~~~~~
 
 This option is only effective when the geometry rendered is made of points
-(generally it's made of triangles when imported from 3D DCCs). If so, then
-those points can be resized (see below).
+(generally it's made of triangles when imported from 3D modeling software). If
+so, then those points can be resized (see below).
 
 Point Size
 ~~~~~~~~~~

+ 234 - 0
tutorials/3d/using_decals.rst

@@ -0,0 +1,234 @@
+.. _doc_using_decals:
+
+Using decals
+============
+
+.. note::
+
+    Decals are only supported in the Clustered Forward and Forward Mobile
+    rendering backends, not the Compatibility backend.
+
+    If using the Compatibility backend, consider using Sprite3D as an alternative
+    for projecting decals onto (mostly) flat surfaces.
+
+Decals are projected textures that apply on opaque or transparent surfaces in
+3D. This projection happens in real-time and doesn't rely on mesh generation.
+This allows you to move decals every frame with only a small performance impact,
+even when applied on complex meshes.
+
+While decals cannot add actual geometry detail onto the projected surface,
+decals can still make use of physically-based rendering to provide similar
+properties to full-blown :abbr:`PBR (Physically-Based Rendering)` materials.
+
+On this page, you'll learn:
+
+- How to set up decals in the 3D editor.
+- How to create decals during gameplay in a 3D scene (such as bullet impacts).
+- How to balance decal configuration between performance and quality.
+
+.. seealso::
+
+    The Godot demo projects repository contains a
+    `3D decals demo <https://github.com/godotengine/godot-demo-projects/tree/4.0-dev/3d/decals>`__.
+
+    If you're looking to write arbitrary 3D text on top of a surface, use
+    :ref:`doc_3d_text` placed close to a surface instead of a Decal node.
+
+Use cases
+---------
+
+Static decoration
+^^^^^^^^^^^^^^^^^
+
+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
+scattered on a large surface. Decals can help break up texture repetition in
+scenes and make patterns look more natural. On a smaller scale, decals can also
+be used to create detail variations for objects. For example, decals can be used
+to add nuts and bolts on top of hard-surface geometry.
+
+Since decals can inject their own :abbr:`PBR (Physically-Based Rendering)`
+properties on top of the projected surfaces, they can also be used to create
+footprints or wet puddles.
+
+.. figure:: img/decals_dirt.webp
+   :align: center
+   :alt: Dirt added on top of level geometry using decals
+
+   Dirt added on top of level geometry using decals
+
+Dynamic gameplay elements
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Decals can represent temporary or persistent gameplay effects such as bullet
+impacts and explosion scorches.
+
+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.
+
+Blob shadows
+^^^^^^^^^^^^
+
+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
+devices. However, when relying on baked lightmaps with fully baked lights,
+dynamic objects will not cast *any* shadow from those lights. This makes dynamic
+objects in lightmapped scenes look flat in comparison to real-time lighting,
+with dynamic objects almost looking like they're floating.
+
+Thanks to blob shadows, dynamic objects can still cast an approximative shadow.
+Not only this helps with depth perception in the scene, but this can also be a
+gameplay element, especially in 3D platformers. The blob shadow's length can be
+extended to let the player know where they will land if they fall straight down.
+
+Even with real-time lighting, blob shadows can still be useful as a form of
+ambient occlusion for situations where SSAO is too expensive or too unstable due
+to its screen-space nature. For example, vehicles' underside shadows are
+well-represented using blob shadows.
+
+.. figure:: img/decals_blob_shadow.webp
+   :align: center
+   :alt: Blob shadow under object comparison
+
+   Blob shadow under object comparison
+
+Quick start guide
+-----------------
+
+Creating decals in the editor
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+1. Create a Decal node in the 3D editor.
+2. In the inspector, expand the **Textures** section and load a texture in
+   **Textures > Albedo**.
+3. Move the Decal node towards an object, then rotate it so the decal is visible
+   (and in the right orientation). If the decal appears mirrored, try to rotate
+   it by 180 degrees. You can double-check whether it's in the right orientation
+   by increasing **Parameters > Normal Fade** to 0.5. This will prevent the Decal
+   from being projected on surfaces that are not facing the decal.
+4. If your decal is meant to affect static objects only, configure it to prevent
+   affecting dynamic objects (or vice versa). To do so, change the decal's
+   **Cull Mask** property to exclude certain layers. After doing this, modify
+   your dynamic objects' MeshInstance3D nodes to change their visibility layers.
+   For instance, you can move them from layer 1 to layer 2, then disable layer 2
+   in the decal's **Cull Mask** property.
+
+Decal node properties
+---------------------
+
+- **Extents:** The size of the decal. The Y axis determines the length of the
+  decal's projection. Keep the projection length as short as possible to improve
+  culling opportunities, therefore improving performance.
+
+Textures
+^^^^^^^^
+
+- **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
+  or ORM map, an albedo map *must* be set to provide an alpha channel. This
+  alpha channel will be used as a mask to determine how much the normal/ORM maps
+  will affect the underlying surface.
+- **Normal:** The normal map to use for the decal. This can be used
+  to increase perceived detail on the decal by modifying how light reacts to it.
+  The impact of this texture is multiplied by the albedo texture's alpha channel
+  (but not **Albedo Mix**).
+- **ORM:** The Occlusion/Roughness/Metallic map to use for the decal.
+  This is an optimized format for storing PBR material maps. Ambient Occlusion
+  map is stored in the red channel, roughness map in the green channel, metallic
+  map in the blue channel. The impact of this texture is multiplied by the
+  albedo texture's alpha channel (but not **Albedo Mix**).
+- **Emission:** The emission texture to use for the decal. Unlike
+  **Albedo**, this texture will appear to glow in the dark.
+
+Parameters
+^^^^^^^^^^
+
+- **Emission Energy:** The brightness of the emission texture.
+- **Modulate:** Multiplies the color of the albedo and emission textures. Use
+  this to tint decals (e.g. for paint decals, or to increase variation by
+  randomizing each decal's modulation).
+- **Albedo Mix:** The opacity of the albedo texture. Unlike using an albedo
+  texture with a more transparent alpha channel, decreasing this value below
+  ``1.0`` does *not* reduce the impact of the normal/ORM texture on the
+  underlying surface. Set this to ``0.0`` when creating normal/ORM-only decals
+  such as footsteps or wet puddles.
+- **Normal Fade:** Fades the Decal if the angle between the Decal's
+  :abbr:`AABB (Axis-Aligned Bounding Box)` and the target surface becomes too large.
+  A value of ``0.0`` projects the decal regardless of angle, while a value of ``0.999``
+  limits the decal to surfaces that are nearly perpendicular. Setting **Normal
+  Fade** to a value greater than ``0.0`` has a small performance cost due to the
+  added normal angle computations.
+
+Vertical Fade
+^^^^^^^^^^^^^
+
+- **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)`
+  (towards the decal's projection angle). Only positive values are valid.
+- **Lower 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)` (away
+  from the decal's projection angle). Only positive values are valid.
+
+Distance Fade
+^^^^^^^^^^^^^
+
+- **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
+  will be culled and not sent to the shader at all. Use this to reduce the number
+  of active decals in a scene and thus improve performance.
+- **Begin:** The distance from the camera at which the decal begins to fade away
+  (in 3D units).
+- **Length:** The distance over which the decal fades (in 3D units). The decal
+  becomes slowly more transparent over this distance and is completely invisible
+  at the end. Higher values result in a smoother fade-out transition, which is
+  more suited when the camera moves fast.
+
+Cull Mask
+^^^^^^^^^
+
+- **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
+  types of objects receive the decal and which do not. This is especially useful
+  so you can ensure that dynamic objects don't accidentally receive a Decal
+  intended for the terrain under them.
+
+Tweaking performance and quality
+--------------------------------
+
+Decal rendering performance is mostly determined by their screen coverage, but
+also their number. In general, a few large decals that cover up most of the
+screen will be more expensive to render than many small decals that are
+scattered around.
+
+To improve rendering performance, you can enable the **Distance Fade** property
+as described above. This will make distant decals fade out when they are far
+away from the camera (and may have little to no impact on the final scene
+rendering). Using node groups, you can also prevent non-essential decorative
+decals from spawning based on user configuration.
+
+The way decals are rendered also has an impact on performance. The **Rendering >
+Textures > Decals > Filter** advanced project setting lets you control how decal
+textures should be filtered. **Nearest/Linear** does not use mipmaps. However,
+decals will look grainy at a distance. **Nearest/Linear Mipmaps** will look
+smoother at a distance, but decals will look blurry when viewed from oblique
+angles. This can be resolved by using **Nearest/Linear Mipmaps Anisotropic**,
+which provides the highest quality but is also slower to render.
+
+If your project has a pixel art style, consider setting the filter to one of the
+**Nearest** values so that decals use nearest-neighbor filtering. Otherwise,
+stick to **Linear**.
+
+Limitations
+-----------
+
+Decals cannot affect material properties other than the ones listed above,
+such as height (for parallax mapping).
+
+For performance reasons, decals use purely fixed rendering logic. This means
+decals cannot use custom shaders. However, custom shaders on the projected
+surfaces are able to read the information that is overridden by decals on top of
+them, such as roughness and metallic.
+
+When using the Forward Mobile backend, only 8 decals can be applied on each
+individual Mesh *resource*. If there are more decals affecting a single mesh,
+not all of them will be rendered on the mesh.

+ 2 - 2
tutorials/3d/using_transforms.rst

@@ -293,7 +293,7 @@ Jump:
     if Input.is_action_just_pressed("jump"):
         velocity.y = JUMP_SPEED
 
-    velocity = move_and_slide(velocity)
+    move_and_slide()
 
  .. code-tab:: csharp
 
@@ -301,7 +301,7 @@ Jump:
     if (Input.IsActionJustPressed("jump"))
         velocity.Y = JumpSpeed;
 
-    velocity = MoveAndSlide(velocity);
+    MoveAndSlide();
 
 All common behaviors and logic can be done with just vectors.
 

+ 38 - 21
tutorials/animation/animation_track_types.rst

@@ -13,38 +13,51 @@ player node on top of the default property tracks.
    We assume you already read :ref:`doc_introduction_animation`, which covers
    the basics, including property tracks.
 
-.. image:: img/track_types.png
+.. image:: img/track_types.webp
 
+Property Track
+--------------
 
-3D Transform Track
-------------------
+The most basic track type. See :ref:`doc_introduction_animation`.
+
+Position 3D / Rotation 3D / Scale 3D Track
+------------------------------------------
 
-3D transform tracks control the location, rotation, and scale of a 3D object.
+These 3D transform tracks control the location, rotation, and scale of a 3D object.
 They make it easier to animate a 3D object's transform compared to using regular
 property tracks.
 
-.. image:: img/3D_transform_track.png
+It is designed for animations imported from external 3D models and can reduce resource capacity through compression.
+
+Blend Shape Track
+-----------------
+
+A blend shape track is optimized for animating blend shape in :ref:`MeshInstance3D <class_MeshInstance3D>`.
 
-Call Method tracks
+It is designed for animations imported from external 3D models and can reduce resource capacity through compression.
+
+Call Method Track
 ------------------
 
-Call method tracks allow you to call a function at a precise time from within an
+A call method track allow you to call a function at a precise time from within an
 animation. For example, you can call ``queue_free()`` to delete a node at the
 end of a death animation.
 
+.. note:: The events placed on the call method track are not executed when the animation is previewed in the editor for safety.
+
 To create such a track, click "Add Track -> Call Method Track." Then, a window
 opens and lets you select the node to associate with the track. To call one of
 the node's methods, right-click the timeline and select "Insert Key". A window
 opens with a list of available methods. Double-click one to finish creating the
 keyframe.
 
-.. image:: img/node_methods.png
+.. image:: img/node_methods.webp
 
 To change the method call or its arguments, click on the key and head to the
 inspector dock. There, you can change the method to call. If you expand the
 "Args" section, you will see a list of arguments you can edit.
 
-.. image:: img/node_method_args.png
+.. image:: img/node_method_args.webp
 
 Bezier Curve Track
 ------------------
@@ -52,27 +65,30 @@ Bezier Curve Track
 A bezier curve track is similar to a property track, except it allows you to
 animate a property's value using a bezier curve.
 
+.. note:: Bezier curve track and property track cannot be blended in :ref:`AnimationPlayer <class_AnimationPlayer>` and :ref:`AnimationTree <class_AnimationTree>`.
+
 To create one, click "Add Track -> Bezier Curve Track". As with property tracks,
 you need to select a node and a property to animate. To open the bezier curve
 editor, click the curve icon to the right of the animation track.
 
-.. image:: img/bezier_curve_icon.png
+.. image:: img/bezier_curve_icon.webp
 
-In the editor, keys are represented by white diamonds and the transparent
+In the editor, keys are represented by filled diamonds and the outlined
 diamonds connected to them by a line control curve's shape.
 
-.. image:: img/bezier_curves.png
+.. image:: img/bezier_curves.webp
 
-In the bottom-right of the editor, you can select the manipulator mode:
+In the right click panel of the editor, you can select the handle mode:
 
-- Free allows you to orient a manipulator in any direction without affecting the
+- Free: Allows you to orient a manipulator in any direction without affecting the
   other's position.
-- Balanced makes it so manipulators rotate together, but the distance between
+- Linear: Does not allow rotation of the manipulator and draws a linear graph.
+- Balanced: Makes it so manipulators rotate together, but the distance between
   the key and a manipulator is not mirrored.
-- Mirror makes the position of one manipulator perfectly mirror the other,
+- Mirrored: Makes the position of one manipulator perfectly mirror the other,
   including their distance to the key.
 
-.. image:: img/manipulator_modes.png
+.. image:: img/manipulator_modes.webp
 
 Audio Playback Track
 --------------------
@@ -86,13 +102,14 @@ To play a sound in your animation, drag and drop an audio file from the file
 system dock onto the animation track. You should see the waveform of your audio
 file in the track.
 
-.. image:: img/audio_track.png
+.. image:: img/audio_track.webp
 
 To remove a sound from the animation, you can right-click it and select "Delete
 Key(s)" or click on it and press the :kbd:`Del` key.
 
-.. note:: If you need to, you can create multiple audio tracks that trigger
-          playback on the same node.
+The blend mode allows you to choose whether or not to adjust the audio volume when blending in the :ref:`AnimationTree <class_AnimationTree>`.
+
+.. image:: img/blend_mode.webp
 
 Animation Playback Track
 ------------------------
@@ -109,7 +126,7 @@ Then, select the animation player you want to associate with the track.
 To add an animation to the track, right-click on it and insert a key. Select the
 key you just created to select an animation in the inspector dock.
 
-.. image:: img/animation_player_animation.png
+.. image:: img/animation_player_animation.webp
 
 If an animation is already playing and you want to stop it early, you can create
 a key and have it set to `[STOP]` in the inspector.

+ 94 - 20
tutorials/animation/animation_tree.rst

@@ -60,7 +60,7 @@ Blend tree
 
 An ``AnimationNodeBlendTree`` can contain both root and regular nodes used for blending. Nodes are added to the graph from a menu:
 
-.. image:: img/animtree3.png
+.. image:: img/animtree3.webp
 
 All blend trees contain an ``Output`` node by default, and something has to be connected to it in order for animations to play.
 
@@ -93,33 +93,64 @@ This node will execute a sub-animation and return once it finishes. Blend times
 
 .. image:: img/animtree6b.gif
 
-Seek
-^^^^
+After setting the request and changing the animation playback, the one-shot node automatically clears the request on the next process frame by setting its [code]request[/code] value to [constant ONE_SHOT_REQUEST_NONE].
+
+.. tabs::
+ .. code-tab:: gdscript GDScript
+
+    # Play child animation connected to "shot" port.
+    animation_tree.set("parameters/OneShot/request", AnimationNodeOneShot.ONE_SHOT_REQUEST_FIRE)
+    # Alternative syntax (same result as above).
+    animation_tree["parameters/OneShot/request"] = AnimationNodeOneShot.ONE_SHOT_REQUEST_FIRE
+
+    # Abort child animation connected to "shot" port.
+    animation_tree.set("parameters/OneShot/request", AnimationNodeOneShot.ONE_SHOT_REQUEST_ABORT)
+    # Alternative syntax (same result as above).
+    animation_tree["parameters/OneShot/request"] = AnimationNodeOneShot.ONE_SHOT_REQUEST_ABORT
+
+    # Get current state (read-only).
+    animation_tree.get("parameters/OneShot/active"))
+    # Alternative syntax (same result as above).
+    animation_tree["parameters/OneShot/active"]
+
+ .. code-tab:: csharp
+
+    // Play child animation connected to "shot" port.
+    animationTree.Set("parameters/OneShot/request", AnimationNodeOneShot.ONE_SHOT_REQUEST_FIRE);
+
+    // Abort child animation connected to "shot" port.
+    animationTree.Set("parameters/OneShot/request", AnimationNodeOneShot.ONE_SHOT_REQUEST_ABORT);
+
+    // Get current state (read-only).
+    animationTree.Get("parameters/OneShot/active");
+
+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``.
 
-After setting the time and changing the animation playback, the seek node automatically goes into sleep mode on the next process frame by setting its ``seek_position`` value to ``-1.0``.
+After setting the time and changing the animation playback, the seek node automatically goes into sleep mode on the next process frame by setting its ``seek_request`` value to ``-1.0``.
 
 .. tabs::
  .. code-tab:: gdscript GDScript
 
     # Play child animation from the start.
-    anim_tree.set("parameters/Seek/seek_position", 0.0)
+    animation_tree.set("parameters/TimeSeek/seek_request", 0.0)
     # Alternative syntax (same result as above).
-    anim_tree["parameters/Seek/seek_position"] = 0.0
+    animation_tree["parameters/TimeSeek/seek_request"] = 0.0
 
     # Play child animation from 12 second timestamp.
-    anim_tree.set("parameters/Seek/seek_position", 12.0)
+    animation_tree.set("parameters/TimeSeek/seek_request", 12.0)
     # Alternative syntax (same result as above).
-    anim_tree["parameters/Seek/seek_position"] = 12.0
+    animation_tree["parameters/TimeSeek/seek_request"] = 12.0
 
  .. code-tab:: csharp
 
     // Play child animation from the start.
-    animTree.Set("parameters/Seek/seek_position", 0.0);
+    animationTree.Set("parameters/TimeSeek/seek_request", 0.0);
 
     // Play child animation from 12 second timestamp.
-    animTree.Set("parameters/Seek/seek_position", 12.0);
+    animationTree.Set("parameters/TimeSeek/seek_request", 12.0);
 
 TimeScale
 ^^^^^^^^^
@@ -130,6 +161,36 @@ 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.
+After setting the request and changing the animation playback, the transition node automatically clears the request on the next process frame by setting its [code]transition_request[/code] value to empty.
+
+.. tabs::
+ .. code-tab:: gdscript GDScript
+
+    # Play child animation connected to "state_2" port.
+    animation_tree.set("parameters/Transition/transition_request", "state_2")
+    # Alternative syntax (same result as above).
+    animation_tree["parameters/Transition/transition_request"] = "state_2"
+
+    # Get current state name (read-only).
+    animation_tree.get("parameters/Transition/current_state")
+    # Alternative syntax (same result as above).
+    animation_tree["parameters/Transition/current_state"]
+
+    # Get current state index (read-only).
+    animation_tree.get("parameters/Transition/current_index"))
+    # Alternative syntax (same result as above).
+    animation_tree["parameters/Transition/current_index"]
+
+ .. code-tab:: csharp
+
+    // Play child animation connected to "state_2" port.
+    animationTree.Set("parameters/Transition/transition_request", "state_2");
+
+    // Get current state name (read-only).
+    animationTree.Get("parameters/Transition/current_state");
+
+    // Get current state index (read-only).
+    animationTree.Get("parameters/Transition/current_index");
 
 BlendSpace2D
 ^^^^^^^^^^^^
@@ -247,11 +308,27 @@ Afterwards, the actual motion can be retrieved via the :ref:`AnimationTree <clas
 .. tabs::
  .. code-tab:: gdscript GDScript
 
-    anim_tree.get_root_motion_transform()
+    # Get the motion delta.
+    animation_tree.get_root_motion_position()
+    animation_tree.get_root_motion_rotation()
+    animation_tree.get_root_motion_scale()
+
+    # Get the actual blended value of the animation.
+    animation_tree.get_root_motion_position_accumulator()
+    animation_tree.get_root_motion_rotation_accumulator()
+    animation_tree.get_root_motion_scale_accumulator()
 
  .. code-tab:: csharp
 
-    animTree.GetRootMotionTransform();
+    // Get the motion delta.
+    animationTree.GetRootMotionPosition();
+    animationTree.GetRootMotionRotation();
+    animationTree.GetRootMotionScale();
+
+    // Get the actual blended value of the animation.
+    animationTree.GetRootMotionPositionAccumulator();
+    animationTree.GetRootMotionRotationAccumulator();
+    animationTree.GetRootMotionScaleAccumulator();
 
 This can be fed to functions such as :ref:`CharacterBody3D.move_and_slide <class_CharacterBody3D_method_move_and_slide>` to control the character movement.
 
@@ -260,7 +337,6 @@ character and animations (this node is disabled by default during the game).
 
 .. image:: img/animtree15.gif
 
-
 Controlling from code
 ---------------------
 
@@ -288,14 +364,13 @@ Which allows setting them or reading them:
 .. tabs::
  .. code-tab:: gdscript GDScript
 
-    anim_tree.set("parameters/eye_blend/blend_amount", 1.0)
+    animation_tree.set("parameters/eye_blend/blend_amount", 1.0)
     # Simpler alternative form:
-    anim_tree["parameters/eye_blend/blend_amount"] = 1.0
+    animation_tree["parameters/eye_blend/blend_amount"] = 1.0
 
  .. code-tab:: csharp
 
-    animTree.Set("parameters/eye_blend/blend_amount", 1.0);
-
+    animationTree.Set("parameters/eye_blend/blend_amount", 1.0);
 
 State machine travel
 --------------------
@@ -308,15 +383,14 @@ to the destination state.
 To use the travel ability, you should first retrieve the :ref:`AnimationNodeStateMachinePlayback <class_AnimationNodeStateMachinePlayback>`
 object from the ``AnimationTree`` node (it is exported as a property).
 
-
 .. tabs::
  .. code-tab:: gdscript GDScript
 
-    var state_machine = anim_tree["parameters/playback"]
+    var state_machine = animation_tree["parameters/playback"]
 
  .. code-tab:: csharp
 
-    AnimationNodeStateMachinePlayback stateMachine = (AnimationNodeStateMachinePlayback)animTree.Get("parameters/playback");
+    AnimationNodeStateMachinePlayback stateMachine = (AnimationNodeStateMachinePlayback)animationTree.Get("parameters/playback");
 
 Once retrieved, it can be used by calling one of the many functions it offers:
 

BIN
tutorials/animation/img/3D_transform_track.png


BIN
tutorials/animation/img/animation_animation_panel.png


BIN
tutorials/animation/img/animation_animation_panel.webp


BIN
tutorials/animation/img/animation_animation_panel_overview.png


BIN
tutorials/animation/img/animation_animation_panel_overview.webp


BIN
tutorials/animation/img/animation_create_animationplayer.png


BIN
tutorials/animation/img/animation_create_animationplayer.webp


BIN
tutorials/animation/img/animation_create_new_animation.png


BIN
tutorials/animation/img/animation_create_new_animation.webp


BIN
tutorials/animation/img/animation_keyframe_editor_key.png


BIN
tutorials/animation/img/animation_keyframe_editor_key.webp


BIN
tutorials/animation/img/animation_library.webp


BIN
tutorials/animation/img/animation_library_dialog.webp


BIN
tutorials/animation/img/animation_player_animation.png


BIN
tutorials/animation/img/animation_player_animation.webp


BIN
tutorials/animation/img/animation_properties_keyframe.png


BIN
tutorials/animation/img/animation_properties_keyframe.webp


BIN
tutorials/animation/img/animation_track.png


BIN
tutorials/animation/img/animation_track.webp


BIN
tutorials/animation/img/animation_track_interpolation.png


BIN
tutorials/animation/img/animation_track_interpolation.webp


BIN
tutorials/animation/img/animation_track_loop_modes.png


BIN
tutorials/animation/img/animation_track_loop_modes.webp


BIN
tutorials/animation/img/animation_track_rate.png


BIN
tutorials/animation/img/animation_track_rate.webp


BIN
tutorials/animation/img/animation_track_settings.png


BIN
tutorials/animation/img/animation_track_settings.webp


BIN
tutorials/animation/img/animtree3.png


BIN
tutorials/animation/img/animtree3.webp


BIN
tutorials/animation/img/audio_track.png


BIN
tutorials/animation/img/audio_track.webp


BIN
tutorials/animation/img/bezier_curve_icon.png


Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików