Light¶
Inherits: VisualInstance < CullInstance < Spatial < Node < Object
Inherited By: DirectionalLight, OmniLight, SpotLight
Proporciona una clase base para diferentes tipos de nodos de luz.
Descripción¶
Light is the abstract base class for light nodes. As it can't be instanced, it shouldn't be used directly. Other types of light nodes inherit from it. Light contains the common variables and parameters used for lighting.
Tutoriales¶
Propiedades¶
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Métodos¶
void |
Enumeraciones¶
enum Param:
PARAM_ENERGY = 0 --- Constante para acceder a light_energy.
PARAM_INDIRECT_ENERGY = 1 --- Constante para acceder a light_indirect_energy.
PARAM_SIZE = 2 --- Constante para el acceso a light_size.
PARAM_SPECULAR = 3 --- Constante para acceder a light_specular.
PARAM_RANGE = 4 --- Constant for accessing OmniLight.omni_range or SpotLight.spot_range.
PARAM_ATTENUATION = 5 --- Constant for accessing OmniLight.omni_attenuation or SpotLight.spot_attenuation.
PARAM_SPOT_ANGLE = 6 --- Constant for accessing SpotLight.spot_angle.
PARAM_SPOT_ATTENUATION = 7 --- Constant for accessing SpotLight.spot_angle_attenuation.
PARAM_CONTACT_SHADOW_SIZE = 8 --- Constant for accessing shadow_contact.
PARAM_SHADOW_MAX_DISTANCE = 9 --- Constant for accessing DirectionalLight.directional_shadow_max_distance.
PARAM_SHADOW_SPLIT_1_OFFSET = 10 --- Constant for accessing DirectionalLight.directional_shadow_split_1.
PARAM_SHADOW_SPLIT_2_OFFSET = 11 --- Constant for accessing DirectionalLight.directional_shadow_split_2.
PARAM_SHADOW_SPLIT_3_OFFSET = 12 --- Constant for accessing DirectionalLight.directional_shadow_split_3.
PARAM_SHADOW_NORMAL_BIAS = 13 --- Constant for accessing DirectionalLight.directional_shadow_normal_bias.
PARAM_SHADOW_BIAS = 14 --- Constante para acceder a shadow_bias.
PARAM_SHADOW_BIAS_SPLIT_SCALE = 15 --- Constant for accessing DirectionalLight.directional_shadow_bias_split_scale.
PARAM_MAX = 16 --- Representa el tamaño del enum Param.
enum BakeMode:
BAKE_DISABLED = 0 --- La luz es ignorada cuando se cocina.
Nota: Ocultar una luz no afecta al cocinado.
BAKE_INDIRECT = 1 --- Sólo se cocinará la iluminación indirecta (por defecto).
BAKE_ALL = 2 --- Tanto la luz directa como la indirecta serán cocinadas.
Nota: Debes ocultar la luz si no quieres que aparezca dos veces (dinámica y cocinada).
Descripciones de Propiedades¶
bool editor_only
Default |
|
Setter |
set_editor_only(value) |
Getter |
is_editor_only() |
Si true
, la luz sólo aparece en el editor y no será visible en tiempo de ejecución.
BakeMode light_bake_mode
Default |
|
Setter |
set_bake_mode(value) |
Getter |
get_bake_mode() |
La luz está en modo cocinado. Ver BakeMode.
Color light_color
Default |
|
Setter |
set_color(value) |
Getter |
get_color() |
El color de la luz. Un color sobrebrillante puede ser usado para lograr un resultado equivalente a incrementar la light_energy de la luz.
int light_cull_mask
Default |
|
Setter |
set_cull_mask(value) |
Getter |
get_cull_mask() |
La luz afectará a los objetos en las capas seleccionadas.
float light_energy
Default |
|
Setter |
set_param(value) |
Getter |
get_param() |
The light's strength multiplier (this is not a physical unit). For OmniLight and SpotLight, changing this value will only change the light color's intensity, not the light's radius.
float light_indirect_energy
Default |
|
Setter |
set_param(value) |
Getter |
get_param() |
Secondary multiplier used with indirect light (light bounces). This works on both BakedLightmap and GIProbe.
bool light_negative
Default |
|
Setter |
set_negative(value) |
Getter |
is_negative() |
Si true
, el efecto de la luz se invierte, oscureciendo áreas y proyectando sombras brillantes.
float light_size
Default |
|
Setter |
set_param(value) |
Getter |
get_param() |
The size of the light in Godot units. Only considered in baked lightmaps and only if light_bake_mode is set to BAKE_ALL. Increasing this value will make the shadows appear blurrier. This can be used to simulate area lights to an extent.
float light_specular
Default |
|
Setter |
set_param(value) |
Getter |
get_param() |
La intensidad de la mancha especular en los objetos afectados por la luz. En 0
, la luz se convierte en una luz difusa pura. Cuando no se emite, puede utilizarse para evitar reflejos poco realistas al colocar las luces sobre una superficie emisora.
float shadow_bias
Default |
|
Setter |
set_param(value) |
Getter |
get_param() |
Se usa para ajustar la apariencia de las sombras. Un valor demasiado pequeño da como resultado una sombra propia ("shadow acne"), mientras que un valor demasiado grande hace que las sombras se separen de las ruedas ("peter-panning"). Ajústelo según sea necesario.
Color shadow_color
Default |
|
Setter |
set_shadow_color(value) |
Getter |
get_shadow_color() |
El color de las sombras proyectadas por esta luz.
float shadow_contact
Default |
|
Setter |
set_param(value) |
Getter |
get_param() |
Attempts to reduce shadow_bias gap.
bool shadow_enabled
Default |
|
Setter |
set_shadow(value) |
Getter |
has_shadow() |
Si true
, la luz proyectará sombras.
bool shadow_reverse_cull_face
Default |
|
Setter |
set_shadow_reverse_cull_face(value) |
Getter |
get_shadow_reverse_cull_face() |
If true
, reverses the backface culling of the mesh. This can be useful when you have a flat mesh that has a light behind it. If you need to cast a shadow on both sides of the mesh, set the mesh to use double-sided shadows with GeometryInstance.SHADOW_CASTING_SETTING_DOUBLE_SIDED.
Descripciones de Métodos¶
Returns the value of the specified Param parameter.
Sets the value of the specified Param parameter.