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

bool

editor_only

false

BakeMode

light_bake_mode

1

Color

light_color

Color( 1, 1, 1, 1 )

int

light_cull_mask

4294967295

float

light_energy

1.0

float

light_indirect_energy

1.0

bool

light_negative

false

float

light_size

0.0

float

light_specular

0.5

float

shadow_bias

0.15

Color

shadow_color

Color( 0, 0, 0, 1 )

float

shadow_contact

0.0

bool

shadow_enabled

false

bool

shadow_reverse_cull_face

false

Métodos

float

get_param ( Param param ) const

void

set_param ( Param param, float value )

Enumeraciones

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

Default

false

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.


Default

1

Setter

set_bake_mode(value)

Getter

get_bake_mode()

La luz está en modo cocinado. Ver BakeMode.


Default

Color( 1, 1, 1, 1 )

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

4294967295

Setter

set_cull_mask(value)

Getter

get_cull_mask()

La luz afectará a los objetos en las capas seleccionadas.


Default

1.0

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

1.0

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

false

Setter

set_negative(value)

Getter

is_negative()

Si true, el efecto de la luz se invierte, oscureciendo áreas y proyectando sombras brillantes.


Default

0.0

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.


Default

0.5

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.


Default

0.15

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.


Default

Color( 0, 0, 0, 1 )

Setter

set_shadow_color(value)

Getter

get_shadow_color()

El color de las sombras proyectadas por esta luz.


Default

0.0

Setter

set_param(value)

Getter

get_param()

Attempts to reduce shadow_bias gap.


  • bool shadow_enabled

Default

false

Setter

set_shadow(value)

Getter

has_shadow()

Si true, la luz proyectará sombras.


  • bool shadow_reverse_cull_face

Default

false

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.