mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2026-01-05 14:10:19 +03:00
Currently including `zh_CN` and `es` which both have very high completion ratios. Others will be added once they reach a significant percentage too. These RST files will be used by godot-docs in place of its `classes` folder after we sync with https://github.com/godotengine/godot-docs/pull/5458. The update workflow is manual for now (example for `zh_CN`): - Build `godotengine/godot` in the branch we currently track (now `3.x`) - Run `godot --doctool -l zh_CN` - Run `cd doc && make rst LANGARG=zh_CN` - Copy `doc/_build/rst/*` to `classes/zh_CN/` here - Make sure to have `classes/zh_CN/index.rst` copied from `docs/classes`
232 lines
14 KiB
ReStructuredText
232 lines
14 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
|
.. DO NOT EDIT THIS FILE, but the DirectionalLight.xml source instead.
|
|
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
|
|
|
.. _class_DirectionalLight:
|
|
|
|
DirectionalLight
|
|
================
|
|
|
|
**Inherits:** :ref:`Light<class_Light>` **<** :ref:`VisualInstance<class_VisualInstance>` **<** :ref:`CullInstance<class_CullInstance>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
|
|
|
Luz direccional desde una distancia, como desde el Sol.
|
|
|
|
Descripción
|
|
----------------------
|
|
|
|
A directional light is a type of :ref:`Light<class_Light>` node that models an infinite number of parallel rays covering the entire scene. It is used for lights with strong intensity that are located far away from the scene to model sunlight or moonlight. The worldspace location of the DirectionalLight transform (origin) is ignored. Only the basis is used to determine light direction.
|
|
|
|
Tutoriales
|
|
--------------------
|
|
|
|
- :doc:`../tutorials/3d/lights_and_shadows`
|
|
|
|
Propiedades
|
|
----------------------
|
|
|
|
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`directional_shadow_bias_split_scale<class_DirectionalLight_property_directional_shadow_bias_split_scale>` | ``0.25`` |
|
|
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`directional_shadow_blend_splits<class_DirectionalLight_property_directional_shadow_blend_splits>` | ``false`` |
|
|
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------+
|
|
| :ref:`ShadowDepthRange<enum_DirectionalLight_ShadowDepthRange>` | :ref:`directional_shadow_depth_range<class_DirectionalLight_property_directional_shadow_depth_range>` | ``0`` |
|
|
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`directional_shadow_max_distance<class_DirectionalLight_property_directional_shadow_max_distance>` | ``100.0`` |
|
|
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------+
|
|
| :ref:`ShadowMode<enum_DirectionalLight_ShadowMode>` | :ref:`directional_shadow_mode<class_DirectionalLight_property_directional_shadow_mode>` | ``2`` |
|
|
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`directional_shadow_normal_bias<class_DirectionalLight_property_directional_shadow_normal_bias>` | ``0.8`` |
|
|
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`directional_shadow_split_1<class_DirectionalLight_property_directional_shadow_split_1>` | ``0.1`` |
|
|
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`directional_shadow_split_2<class_DirectionalLight_property_directional_shadow_split_2>` | ``0.2`` |
|
|
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`directional_shadow_split_3<class_DirectionalLight_property_directional_shadow_split_3>` | ``0.5`` |
|
|
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | shadow_bias | ``0.1`` (overrides :ref:`Light<class_Light_property_shadow_bias>`) |
|
|
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------+
|
|
|
|
Enumeraciones
|
|
--------------------------
|
|
|
|
.. _enum_DirectionalLight_ShadowMode:
|
|
|
|
.. _class_DirectionalLight_constant_SHADOW_ORTHOGONAL:
|
|
|
|
.. _class_DirectionalLight_constant_SHADOW_PARALLEL_2_SPLITS:
|
|
|
|
.. _class_DirectionalLight_constant_SHADOW_PARALLEL_4_SPLITS:
|
|
|
|
enum **ShadowMode**:
|
|
|
|
- **SHADOW_ORTHOGONAL** = **0** --- Renderiza el mapa de sombras de toda la escena desde un punto de vista ortogonal. Este es el modo de sombra de dirección más rápida. Puede dar lugar a sombras más borrosas en objetos cercanos.
|
|
|
|
- **SHADOW_PARALLEL_2_SPLITS** = **1** --- Divide la vista del frustum en 2 áreas, cada una con su propio mapa de sombras. Este modo de sombra es un compromiso entre :ref:`SHADOW_ORTHOGONAL<class_DirectionalLight_constant_SHADOW_ORTHOGONAL>` y :ref:`SHADOW_PARALLEL_4_SPLITS<class_DirectionalLight_constant_SHADOW_PARALLEL_4_SPLITS>` en términos de rendimiento.
|
|
|
|
- **SHADOW_PARALLEL_4_SPLITS** = **2** --- Divide el frustum de la vista en 4 áreas, cada una con su propio mapa de sombras. Este es el modo de sombra direccional más lento.
|
|
|
|
----
|
|
|
|
.. _enum_DirectionalLight_ShadowDepthRange:
|
|
|
|
.. _class_DirectionalLight_constant_SHADOW_DEPTH_RANGE_STABLE:
|
|
|
|
.. _class_DirectionalLight_constant_SHADOW_DEPTH_RANGE_OPTIMIZED:
|
|
|
|
enum **ShadowDepthRange**:
|
|
|
|
- **SHADOW_DEPTH_RANGE_STABLE** = **0** --- Mantiene la sombra estable cuando la cámara se mueve, a costa de una menor resolución efectiva de la sombra.
|
|
|
|
- **SHADOW_DEPTH_RANGE_OPTIMIZED** = **1** --- Intenta conseguir la máxima resolución de las sombras. Puede resultar en un efecto de sierra en los bordes de la sombra. Este modo suele funcionar mejor en juegos en los que la cámara suele moverse a altas velocidades, como la mayoría de los juegos de carreras.
|
|
|
|
Descripciones de Propiedades
|
|
--------------------------------------------------------
|
|
|
|
.. _class_DirectionalLight_property_directional_shadow_bias_split_scale:
|
|
|
|
- :ref:`float<class_float>` **directional_shadow_bias_split_scale**
|
|
|
|
+-----------+------------------+
|
|
| *Default* | ``0.25`` |
|
|
+-----------+------------------+
|
|
| *Setter* | set_param(value) |
|
|
+-----------+------------------+
|
|
| *Getter* | get_param() |
|
|
+-----------+------------------+
|
|
|
|
Amount of extra bias for shadow splits that are far away. If self-shadowing occurs only on the splits far away, increasing this value can fix them.
|
|
|
|
----
|
|
|
|
.. _class_DirectionalLight_property_directional_shadow_blend_splits:
|
|
|
|
- :ref:`bool<class_bool>` **directional_shadow_blend_splits**
|
|
|
|
+-----------+---------------------------+
|
|
| *Default* | ``false`` |
|
|
+-----------+---------------------------+
|
|
| *Setter* | set_blend_splits(value) |
|
|
+-----------+---------------------------+
|
|
| *Getter* | is_blend_splits_enabled() |
|
|
+-----------+---------------------------+
|
|
|
|
Si ``true``, el detalle de la sombra se sacrifica a cambio de transiciones más suaves entre las divisiones.
|
|
|
|
----
|
|
|
|
.. _class_DirectionalLight_property_directional_shadow_depth_range:
|
|
|
|
- :ref:`ShadowDepthRange<enum_DirectionalLight_ShadowDepthRange>` **directional_shadow_depth_range**
|
|
|
|
+-----------+-------------------------------+
|
|
| *Default* | ``0`` |
|
|
+-----------+-------------------------------+
|
|
| *Setter* | set_shadow_depth_range(value) |
|
|
+-----------+-------------------------------+
|
|
| *Getter* | get_shadow_depth_range() |
|
|
+-----------+-------------------------------+
|
|
|
|
Optimiza la representación de las sombras para los detalles frente al movimiento. Ver :ref:`ShadowDepthRange<enum_DirectionalLight_ShadowDepthRange>`.
|
|
|
|
----
|
|
|
|
.. _class_DirectionalLight_property_directional_shadow_max_distance:
|
|
|
|
- :ref:`float<class_float>` **directional_shadow_max_distance**
|
|
|
|
+-----------+------------------+
|
|
| *Default* | ``100.0`` |
|
|
+-----------+------------------+
|
|
| *Setter* | set_param(value) |
|
|
+-----------+------------------+
|
|
| *Getter* | get_param() |
|
|
+-----------+------------------+
|
|
|
|
La distancia máxima para las divisiones de la sombra.
|
|
|
|
----
|
|
|
|
.. _class_DirectionalLight_property_directional_shadow_mode:
|
|
|
|
- :ref:`ShadowMode<enum_DirectionalLight_ShadowMode>` **directional_shadow_mode**
|
|
|
|
+-----------+------------------------+
|
|
| *Default* | ``2`` |
|
|
+-----------+------------------------+
|
|
| *Setter* | set_shadow_mode(value) |
|
|
+-----------+------------------------+
|
|
| *Getter* | get_shadow_mode() |
|
|
+-----------+------------------------+
|
|
|
|
El algoritmo de renderizado de las sombras de la luz. Ver :ref:`ShadowMode<enum_DirectionalLight_ShadowMode>`.
|
|
|
|
----
|
|
|
|
.. _class_DirectionalLight_property_directional_shadow_normal_bias:
|
|
|
|
- :ref:`float<class_float>` **directional_shadow_normal_bias**
|
|
|
|
+-----------+------------------+
|
|
| *Default* | ``0.8`` |
|
|
+-----------+------------------+
|
|
| *Setter* | set_param(value) |
|
|
+-----------+------------------+
|
|
| *Getter* | get_param() |
|
|
+-----------+------------------+
|
|
|
|
Can be used to fix special cases of self shadowing when objects are perpendicular to the light.
|
|
|
|
----
|
|
|
|
.. _class_DirectionalLight_property_directional_shadow_split_1:
|
|
|
|
- :ref:`float<class_float>` **directional_shadow_split_1**
|
|
|
|
+-----------+------------------+
|
|
| *Default* | ``0.1`` |
|
|
+-----------+------------------+
|
|
| *Setter* | set_param(value) |
|
|
+-----------+------------------+
|
|
| *Getter* | get_param() |
|
|
+-----------+------------------+
|
|
|
|
La distancia de la cámara a la sombra se divide en 1. Relativo a :ref:`directional_shadow_max_distance<class_DirectionalLight_property_directional_shadow_max_distance>`. Sólo se utiliza cuando :ref:`directional_shadow_mode<class_DirectionalLight_property_directional_shadow_mode>` es ``SHADOW_PARALLEL_2_SPLITS`` o ``SHADOW_PARALLEL_4_SPLITS``.
|
|
|
|
----
|
|
|
|
.. _class_DirectionalLight_property_directional_shadow_split_2:
|
|
|
|
- :ref:`float<class_float>` **directional_shadow_split_2**
|
|
|
|
+-----------+------------------+
|
|
| *Default* | ``0.2`` |
|
|
+-----------+------------------+
|
|
| *Setter* | set_param(value) |
|
|
+-----------+------------------+
|
|
| *Getter* | get_param() |
|
|
+-----------+------------------+
|
|
|
|
La distancia de la sombra se divide en dos. Relativo a :ref:`directional_shadow_max_distance<class_DirectionalLight_property_directional_shadow_max_distance>`. Sólo se utiliza cuando :ref:`directional_shadow_mode<class_DirectionalLight_property_directional_shadow_mode>` es ``SHADOW_PARALLEL_2_SPLITS`` o ``SHADOW_PARALLEL_4_SPLITS``.
|
|
|
|
----
|
|
|
|
.. _class_DirectionalLight_property_directional_shadow_split_3:
|
|
|
|
- :ref:`float<class_float>` **directional_shadow_split_3**
|
|
|
|
+-----------+------------------+
|
|
| *Default* | ``0.5`` |
|
|
+-----------+------------------+
|
|
| *Setter* | set_param(value) |
|
|
+-----------+------------------+
|
|
| *Getter* | get_param() |
|
|
+-----------+------------------+
|
|
|
|
La distancia de la sombra se divide en dos y tres. Relativo a :ref:`directional_shadow_max_distance<class_DirectionalLight_property_directional_shadow_max_distance>`. Sólo se usa cuando :ref:`directional_shadow_mode<class_DirectionalLight_property_directional_shadow_mode>` es ``SHADOW_PARALLEL_4_SPLITS``.
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
|
|
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
|
|
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
|