mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2025-12-31 09:49:22 +03:00
301 lines
19 KiB
ReStructuredText
301 lines
19 KiB
ReStructuredText
:github_url: hide
|
||
|
||
.. meta::
|
||
:keywords: sun
|
||
|
||
.. _class_DirectionalLight3D:
|
||
|
||
DirectionalLight3D
|
||
==================
|
||
|
||
**Успадковує:** :ref:`Light3D<class_Light3D>` **<** :ref:`VisualInstance3D<class_VisualInstance3D>` **<** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
||
|
||
Прямий світло від дистанції, як від Сонця.
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
Опис
|
||
--------
|
||
|
||
Спрямоване світло – це тип вузла :ref:`Light3D<class_Light3D>`, який моделює нескінченну кількість паралельних променів, що охоплюють усю сцену. Він використовується для джерел світла з високою інтенсивністю, розташованих далеко від сцени, для моделювання сонячного або місячного світла.
|
||
|
||
Світло випромінюється в напрямку -Z глобального базису вузла. Для необертового світла це означає, що світло випромінюється вперед, освітлюючи передню сторону 3D-моделі (див. :ref:`Vector3.FORWARD<class_Vector3_constant_FORWARD>` та :ref:`Vector3.MODEL_FRONT<class_Vector3_constant_MODEL_FRONT>`). Положення вузла ігнорується; для визначення напрямку світла використовується лише базис.
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
Посібники
|
||
------------------
|
||
|
||
- :doc:`3D світло та тіні <../tutorials/3d/lights_and_shadows>`
|
||
|
||
- :doc:`Захоплення глобального освітлення <../tutorials/3d/global_illumination/faking_global_illumination>`
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
Властивості
|
||
----------------------
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+-----------+
|
||
| :ref:`bool<class_bool>` | :ref:`directional_shadow_blend_splits<class_DirectionalLight3D_property_directional_shadow_blend_splits>` | ``false`` |
|
||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+-----------+
|
||
| :ref:`float<class_float>` | :ref:`directional_shadow_fade_start<class_DirectionalLight3D_property_directional_shadow_fade_start>` | ``0.8`` |
|
||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+-----------+
|
||
| :ref:`float<class_float>` | :ref:`directional_shadow_max_distance<class_DirectionalLight3D_property_directional_shadow_max_distance>` | ``100.0`` |
|
||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+-----------+
|
||
| :ref:`ShadowMode<enum_DirectionalLight3D_ShadowMode>` | :ref:`directional_shadow_mode<class_DirectionalLight3D_property_directional_shadow_mode>` | ``2`` |
|
||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+-----------+
|
||
| :ref:`float<class_float>` | :ref:`directional_shadow_pancake_size<class_DirectionalLight3D_property_directional_shadow_pancake_size>` | ``20.0`` |
|
||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+-----------+
|
||
| :ref:`float<class_float>` | :ref:`directional_shadow_split_1<class_DirectionalLight3D_property_directional_shadow_split_1>` | ``0.1`` |
|
||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+-----------+
|
||
| :ref:`float<class_float>` | :ref:`directional_shadow_split_2<class_DirectionalLight3D_property_directional_shadow_split_2>` | ``0.2`` |
|
||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+-----------+
|
||
| :ref:`float<class_float>` | :ref:`directional_shadow_split_3<class_DirectionalLight3D_property_directional_shadow_split_3>` | ``0.5`` |
|
||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+-----------+
|
||
| :ref:`SkyMode<enum_DirectionalLight3D_SkyMode>` | :ref:`sky_mode<class_DirectionalLight3D_property_sky_mode>` | ``0`` |
|
||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+-----------+
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
Переліки
|
||
----------------
|
||
|
||
.. _enum_DirectionalLight3D_ShadowMode:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **ShadowMode**: :ref:`🔗<enum_DirectionalLight3D_ShadowMode>`
|
||
|
||
.. _class_DirectionalLight3D_constant_SHADOW_ORTHOGONAL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ShadowMode<enum_DirectionalLight3D_ShadowMode>` **SHADOW_ORTHOGONAL** = ``0``
|
||
|
||
Рендери вся shadow map з ортогональної точки зору. Це найшвидший режим тіні. Може призвести до розмитих тіней на закритих об'єктах.
|
||
|
||
.. _class_DirectionalLight3D_constant_SHADOW_PARALLEL_2_SPLITS:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ShadowMode<enum_DirectionalLight3D_ShadowMode>` **SHADOW_PARALLEL_2_SPLITS** = ``1``
|
||
|
||
Розділяє вид frustum в 2 областях, кожен з власною shadow map. Цей режим тіні є компромісом між :ref:`SHADOW_ORTHOGONAL<class_DirectionalLight3D_constant_SHADOW_ORTHOGONAL>` та :ref:`SHADOW_PARALLEL_4_SPLITS<class_DirectionalLight3D_constant_SHADOW_PARALLEL_4_SPLITS>` з точки зору продуктивності.
|
||
|
||
.. _class_DirectionalLight3D_constant_SHADOW_PARALLEL_4_SPLITS:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ShadowMode<enum_DirectionalLight3D_ShadowMode>` **SHADOW_PARALLEL_4_SPLITS** = ``2``
|
||
|
||
Розділяє вид frustum в 4 областях, кожен з власною shadow map. Це повільний спрямований режим тіні.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_DirectionalLight3D_SkyMode:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **SkyMode**: :ref:`🔗<enum_DirectionalLight3D_SkyMode>`
|
||
|
||
.. _class_DirectionalLight3D_constant_SKY_MODE_LIGHT_AND_SKY:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`SkyMode<enum_DirectionalLight3D_SkyMode>` **SKY_MODE_LIGHT_AND_SKY** = ``0``
|
||
|
||
Зробіть світло видиме в обох сценах освітлення і неба рендерингу.
|
||
|
||
.. _class_DirectionalLight3D_constant_SKY_MODE_LIGHT_ONLY:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`SkyMode<enum_DirectionalLight3D_SkyMode>` **SKY_MODE_LIGHT_ONLY** = ``1``
|
||
|
||
Створює світло видиме освітлення сцени тільки (в тому числі прямий освітлення та глобальне освітлення). При використанні цього режиму світло не буде видно з небесних відтінків.
|
||
|
||
.. _class_DirectionalLight3D_constant_SKY_MODE_SKY_ONLY:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`SkyMode<enum_DirectionalLight3D_SkyMode>` **SKY_MODE_SKY_ONLY** = ``2``
|
||
|
||
Виготовляємо світло видимих для небесних відтінків. При використанні цього режиму світло не відкине світло на сцену (все через пряме освітлення або через глобальне освітлення), але може бути доступним через небі відтінки. Це може бути корисною, наприклад, коли ви хочете контролювати небо ефектів без освітлення сцени (за нічним циклом, наприклад).
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
Описи властивостей
|
||
------------------------------------
|
||
|
||
.. _class_DirectionalLight3D_property_directional_shadow_blend_splits:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **directional_shadow_blend_splits** = ``false`` :ref:`🔗<class_DirectionalLight3D_property_directional_shadow_blend_splits>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_blend_splits**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_blend_splits_enabled**\ (\ )
|
||
|
||
Якщо ``true``, деталізація тіней приноситься в жертву в обмін на більш плавні переходи між розбиттями. Увімкнення розбиття тіней також має помірні витрати на продуктивність. Це ігнорується, коли :ref:`directional_shadow_mode<class_DirectionalLight3D_property_directional_shadow_mode>` дорівнює :ref:`SHADOW_ORTHOGONAL<class_DirectionalLight3D_constant_SHADOW_ORTHOGONAL>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_DirectionalLight3D_property_directional_shadow_fade_start:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`float<class_float>` **directional_shadow_fade_start** = ``0.8`` :ref:`🔗<class_DirectionalLight3D_property_directional_shadow_fade_start>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_param**\ (\ value\: :ref:`float<class_float>`\ )
|
||
- :ref:`float<class_float>` **get_param**\ (\ )
|
||
|
||
Частка від :ref:`directional_shadow_max_distance<class_DirectionalLight3D_property_directional_shadow_max_distance>`, на якій тінь починає зникати. При :ref:`directional_shadow_max_distance<class_DirectionalLight3D_property_directional_shadow_max_distance>` тінь зникне. Значення за замовчуванням є балансом між плавним зниканням і видимістю тіні на великій відстані. Якщо камера рухається швидко, а значення :ref:`directional_shadow_max_distance<class_DirectionalLight3D_property_directional_shadow_max_distance>` низьке, спробуйте зменшити :ref:`directional_shadow_fade_start<class_DirectionalLight3D_property_directional_shadow_fade_start>` нижче ``0.8``, щоб зробити переходи тіней менш помітними. З іншого боку, якщо ви налаштували :ref:`directional_shadow_max_distance<class_DirectionalLight3D_property_directional_shadow_max_distance>` на покриття всієї сцени, ви можете встановити :ref:`directional_shadow_fade_start<class_DirectionalLight3D_property_directional_shadow_fade_start>` на ``1.0``, щоб запобігти зниканню тіні на відстані (замість цього вона раптово обриватиметься).
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_DirectionalLight3D_property_directional_shadow_max_distance:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`float<class_float>` **directional_shadow_max_distance** = ``100.0`` :ref:`🔗<class_DirectionalLight3D_property_directional_shadow_max_distance>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_param**\ (\ value\: :ref:`float<class_float>`\ )
|
||
- :ref:`float<class_float>` **get_param**\ (\ )
|
||
|
||
Максимальна відстань для тіньових розколів. Підвищення цього значення дозволить зробити спрямовані тіні, видимі з подальшої відкладки, за вартістю нижньої загальної деталі тіні і продуктивності (звідси більше об'єктів необхідно включити в спрямовану тінь).
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_DirectionalLight3D_property_directional_shadow_mode:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`ShadowMode<enum_DirectionalLight3D_ShadowMode>` **directional_shadow_mode** = ``2`` :ref:`🔗<class_DirectionalLight3D_property_directional_shadow_mode>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_shadow_mode**\ (\ value\: :ref:`ShadowMode<enum_DirectionalLight3D_ShadowMode>`\ )
|
||
- :ref:`ShadowMode<enum_DirectionalLight3D_ShadowMode>` **get_shadow_mode**\ (\ )
|
||
|
||
Алгоритм візуалізації тіні світла.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_DirectionalLight3D_property_directional_shadow_pancake_size:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`float<class_float>` **directional_shadow_pancake_size** = ``20.0`` :ref:`🔗<class_DirectionalLight3D_property_directional_shadow_pancake_size>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_param**\ (\ value\: :ref:`float<class_float>`\ )
|
||
- :ref:`float<class_float>` **get_param**\ (\ )
|
||
|
||
Встановлює розмір спрямованого тіньового млинця. Млинець відключає початок роботи камери тіні frustum, щоб забезпечити більш ефективне регулювання глибини для тіні. Однак високий розмір млинця може викликати артефакти в тіні великих об'єктів, які знаходяться поблизу краю фрусту. Зменшення розміру млинця може допомогти. Налаштування розміру до ``0`` вимкнено ефект каструлі.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_DirectionalLight3D_property_directional_shadow_split_1:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`float<class_float>` **directional_shadow_split_1** = ``0.1`` :ref:`🔗<class_DirectionalLight3D_property_directional_shadow_split_1>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_param**\ (\ value\: :ref:`float<class_float>`\ )
|
||
- :ref:`float<class_float>` **get_param**\ (\ )
|
||
|
||
Відстань від камери до розбиття тіні 1. Відносно :ref:`directional_shadow_max_distance<class_DirectionalLight3D_property_directional_shadow_max_distance>`. Використовується лише тоді, коли :ref:`directional_shadow_mode<class_DirectionalLight3D_property_directional_shadow_mode>` дорівнює :ref:`SHADOW_PARALLEL_2_SPLITS<class_DirectionalLight3D_constant_SHADOW_PARALLEL_2_SPLITS>` або :ref:`SHADOW_PARALLEL_4_SPLITS<class_DirectionalLight3D_constant_SHADOW_PARALLEL_4_SPLITS>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_DirectionalLight3D_property_directional_shadow_split_2:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`float<class_float>` **directional_shadow_split_2** = ``0.2`` :ref:`🔗<class_DirectionalLight3D_property_directional_shadow_split_2>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_param**\ (\ value\: :ref:`float<class_float>`\ )
|
||
- :ref:`float<class_float>` **get_param**\ (\ )
|
||
|
||
Відстань від роздільної ланки тіні 1 до роздільної ланки 2. Відносно до :ref:`directional_shadow_max_distance<class_DirectionalLight3D_property_directional_shadow_max_distance>`. Використовується лише тоді, коли :ref:`directional_shadow_mode<class_DirectionalLight3D_property_directional_shadow_mode>` має значення :ref:`SHADOW_PARALLEL_4_SPLITS<class_DirectionalLight3D_constant_SHADOW_PARALLEL_4_SPLITS>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_DirectionalLight3D_property_directional_shadow_split_3:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`float<class_float>` **directional_shadow_split_3** = ``0.5`` :ref:`🔗<class_DirectionalLight3D_property_directional_shadow_split_3>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_param**\ (\ value\: :ref:`float<class_float>`\ )
|
||
- :ref:`float<class_float>` **get_param**\ (\ )
|
||
|
||
Відстань від роздільної ланки тіні 2 до роздільної ланки 3. Відносно до :ref:`directional_shadow_max_distance<class_DirectionalLight3D_property_directional_shadow_max_distance>`. Використовується лише тоді, коли :ref:`directional_shadow_mode<class_DirectionalLight3D_property_directional_shadow_mode>` має значення :ref:`SHADOW_PARALLEL_4_SPLITS<class_DirectionalLight3D_constant_SHADOW_PARALLEL_4_SPLITS>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_DirectionalLight3D_property_sky_mode:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`SkyMode<enum_DirectionalLight3D_SkyMode>` **sky_mode** = ``0`` :ref:`🔗<class_DirectionalLight3D_property_sky_mode>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_sky_mode**\ (\ value\: :ref:`SkyMode<enum_DirectionalLight3D_SkyMode>`\ )
|
||
- :ref:`SkyMode<enum_DirectionalLight3D_SkyMode>` **get_sky_mode**\ (\ )
|
||
|
||
Чи видно цей **DirectionalLight3D** на небі, у сцені, чи і на небі, і в сцені.
|
||
|
||
.. |virtual| replace:: :abbr:`virtual (Зазвичай, цей метод перевизначається користувачем, щоб він мав вплив.)`
|
||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||
.. |const| replace:: :abbr:`const (Цей метод не має побічних ефектів. Не змінює ніяку змінну екземпляра об'єкта.)`
|
||
.. |vararg| replace:: :abbr:`vararg (Цей метод приймає будь-яке число аргументів після описаних тут.)`
|
||
.. |constructor| replace:: :abbr:`constructor (Цей метод використовується для побудови типів.)`
|
||
.. |static| replace:: :abbr:`static (Цей метод не потребує екземпляра для виклику, його можна викликати безпосередньо за допомогою назви класу.)`
|
||
.. |operator| replace:: :abbr:`operator (Цей метод описує дійсний оператор для взаємодії з цим типом як з лівим операндом.)`
|
||
.. |bitfield| replace:: :abbr:`BitField (Це значення є цілим числом, складеним у вигляді бітової маски з наступних прапорів.)`
|
||
.. |void| replace:: :abbr:`void (Значення не повертається.)`
|