2017-09-12 20:42:36 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2021-04-26 11:14:51 +00:00
<class name= "Light" inherits= "VisualInstance" version= "3.4" >
2017-09-12 20:42:36 +00:00
<brief_description >
Provides a base class for different kinds of light nodes.
</brief_description>
<description >
2020-06-10 08:07:38 +00:00
Light is the [i]abstract[/i] 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.
2017-09-12 20:42:36 +00:00
</description>
<tutorials >
2021-03-26 09:43:43 +00:00
<link title= "3D lights and shadows" > https://docs.godotengine.org/en/3.3/tutorials/3d/lights_and_shadows.html</link>
2020-10-01 08:34:47 +00:00
<link title= "Third Person Shooter Demo" > https://godotengine.org/asset-library/asset/678</link>
2017-09-12 20:42:36 +00:00
</tutorials>
<methods >
2019-06-27 14:10:09 +00:00
<method name= "get_param" qualifiers= "const" >
<return type= "float" >
</return>
<argument index= "0" name= "param" type= "int" enum= "Light.Param" >
</argument>
<description >
2020-01-14 21:27:14 +00:00
Returns the value of the specified [enum Light.Param] parameter.
2019-06-27 14:10:09 +00:00
</description>
</method>
<method name= "set_param" >
<return type= "void" >
</return>
<argument index= "0" name= "param" type= "int" enum= "Light.Param" >
</argument>
<argument index= "1" name= "value" type= "float" >
</argument>
<description >
2020-01-14 21:27:14 +00:00
Sets the value of the specified [enum Light.Param] parameter.
2019-06-27 14:10:09 +00:00
</description>
</method>
2017-09-12 20:42:36 +00:00
</methods>
<members >
2019-06-29 10:38:01 +00:00
<member name= "editor_only" type= "bool" setter= "set_editor_only" getter= "is_editor_only" default= "false" >
2019-06-29 13:24:23 +00:00
If [code]true[/code], the light only appears in the editor and will not be visible at runtime.
2017-09-12 20:42:36 +00:00
</member>
2019-06-29 10:38:01 +00:00
<member name= "light_bake_mode" type= "int" setter= "set_bake_mode" getter= "get_bake_mode" enum= "Light.BakeMode" default= "1" >
2018-08-19 04:29:12 +00:00
The light's bake mode. See [enum BakeMode].
2017-12-16 19:34:16 +00:00
</member>
2019-06-29 10:38:01 +00:00
<member name= "light_color" type= "Color" setter= "set_color" getter= "get_color" default= "Color( 1, 1, 1, 1 )" >
2020-06-10 08:07:38 +00:00
The light's color. An [i]overbright[/i] color can be used to achieve a result equivalent to increasing the light's [member light_energy].
2017-09-12 20:42:36 +00:00
</member>
2019-06-29 10:38:01 +00:00
<member name= "light_cull_mask" type= "int" setter= "set_cull_mask" getter= "get_cull_mask" default= "4294967295" >
2018-08-19 04:29:12 +00:00
The light will affect objects in the selected layers.
2017-09-12 20:42:36 +00:00
</member>
2019-06-29 10:38:01 +00:00
<member name= "light_energy" type= "float" setter= "set_param" getter= "get_param" default= "1.0" >
2020-06-10 08:07:38 +00:00
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.
2017-09-12 20:42:36 +00:00
</member>
2019-06-29 10:38:01 +00:00
<member name= "light_indirect_energy" type= "float" setter= "set_param" getter= "get_param" default= "1.0" >
2019-06-21 23:04:47 +00:00
Secondary multiplier used with indirect light (light bounces). This works on both [BakedLightmap] and [GIProbe].
2017-11-24 08:16:27 +00:00
</member>
2019-06-29 10:38:01 +00:00
<member name= "light_negative" type= "bool" setter= "set_negative" getter= "is_negative" default= "false" >
2019-06-29 13:24:23 +00:00
If [code]true[/code], the light's effect is reversed, darkening areas and casting bright shadows.
2017-09-12 20:42:36 +00:00
</member>
2019-06-29 10:38:01 +00:00
<member name= "light_specular" type= "float" setter= "set_param" getter= "get_param" default= "0.5" >
2020-06-10 08:07:38 +00:00
The intensity of the specular blob in objects affected by the light. At [code]0[/code], the light becomes a pure diffuse light. When not baking emission, this can be used to avoid unrealistic reflections when placing lights above an emissive surface.
2017-09-12 20:42:36 +00:00
</member>
2019-06-29 10:38:01 +00:00
<member name= "shadow_bias" type= "float" setter= "set_param" getter= "get_param" default= "0.15" >
2020-06-10 08:07:38 +00:00
Used to adjust shadow appearance. Too small a value results in self-shadowing ("shadow acne"), while too large a value causes shadows to separate from casters ("peter-panning"). Adjust as needed.
2017-09-12 20:42:36 +00:00
</member>
2019-06-29 10:38:01 +00:00
<member name= "shadow_color" type= "Color" setter= "set_shadow_color" getter= "get_shadow_color" default= "Color( 0, 0, 0, 1 )" >
2018-08-19 04:29:12 +00:00
The color of shadows cast by this light.
2017-09-12 20:42:36 +00:00
</member>
2019-06-29 10:38:01 +00:00
<member name= "shadow_contact" type= "float" setter= "set_param" getter= "get_param" default= "0.0" >
2018-08-19 04:29:12 +00:00
Attempts to reduce [member shadow_bias] gap.
2017-09-12 20:42:36 +00:00
</member>
2019-06-29 10:38:01 +00:00
<member name= "shadow_enabled" type= "bool" setter= "set_shadow" getter= "has_shadow" default= "false" >
2019-06-29 13:24:23 +00:00
If [code]true[/code], the light will cast shadows.
2017-09-12 20:42:36 +00:00
</member>
2019-06-29 10:38:01 +00:00
<member name= "shadow_reverse_cull_face" type= "bool" setter= "set_shadow_reverse_cull_face" getter= "get_shadow_reverse_cull_face" default= "false" >
2020-01-14 21:27:14 +00:00
If [code]true[/code], 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 [constant GeometryInstance.SHADOW_CASTING_SETTING_DOUBLE_SIDED].
2017-09-12 20:42:36 +00:00
</member>
</members>
<constants >
2017-11-24 22:16:30 +00:00
<constant name= "PARAM_ENERGY" value= "0" enum= "Param" >
2020-01-14 21:27:14 +00:00
Constant for accessing [member light_energy].
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "PARAM_INDIRECT_ENERGY" value= "1" enum= "Param" >
2020-01-14 21:27:14 +00:00
Constant for accessing [member light_indirect_energy].
2017-11-24 08:16:27 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "PARAM_SPECULAR" value= "2" enum= "Param" >
2020-01-16 09:59:01 +00:00
Constant for accessing [member light_specular].
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "PARAM_RANGE" value= "3" enum= "Param" >
2020-01-14 21:27:14 +00:00
Constant for accessing [member OmniLight.omni_range] or [member SpotLight.spot_range].
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "PARAM_ATTENUATION" value= "4" enum= "Param" >
2020-01-14 21:27:14 +00:00
Constant for accessing [member OmniLight.omni_attenuation] or [member SpotLight.spot_attenuation].
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "PARAM_SPOT_ANGLE" value= "5" enum= "Param" >
2020-01-14 21:27:14 +00:00
Constant for accessing [member SpotLight.spot_angle].
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "PARAM_SPOT_ATTENUATION" value= "6" enum= "Param" >
2020-01-14 21:27:14 +00:00
Constant for accessing [member SpotLight.spot_angle_attenuation].
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "PARAM_CONTACT_SHADOW_SIZE" value= "7" enum= "Param" >
2020-01-14 21:27:14 +00:00
Constant for accessing [member shadow_contact].
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "PARAM_SHADOW_MAX_DISTANCE" value= "8" enum= "Param" >
2020-01-14 21:27:14 +00:00
Constant for accessing [member DirectionalLight.directional_shadow_max_distance].
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "PARAM_SHADOW_SPLIT_1_OFFSET" value= "9" enum= "Param" >
2020-01-14 21:27:14 +00:00
Constant for accessing [member DirectionalLight.directional_shadow_split_1].
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "PARAM_SHADOW_SPLIT_2_OFFSET" value= "10" enum= "Param" >
2020-01-14 21:27:14 +00:00
Constant for accessing [member DirectionalLight.directional_shadow_split_2].
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "PARAM_SHADOW_SPLIT_3_OFFSET" value= "11" enum= "Param" >
2020-01-14 21:27:14 +00:00
Constant for accessing [member DirectionalLight.directional_shadow_split_3].
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "PARAM_SHADOW_NORMAL_BIAS" value= "12" enum= "Param" >
2020-01-14 21:27:14 +00:00
Constant for accessing [member DirectionalLight.directional_shadow_normal_bias].
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "PARAM_SHADOW_BIAS" value= "13" enum= "Param" >
2020-01-14 21:27:14 +00:00
Constant for accessing [member shadow_bias].
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "PARAM_SHADOW_BIAS_SPLIT_SCALE" value= "14" enum= "Param" >
2020-01-14 21:27:14 +00:00
Constant for accessing [member DirectionalLight.directional_shadow_bias_split_scale].
2017-10-22 10:56:11 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "PARAM_MAX" value= "15" enum= "Param" >
2019-06-27 09:10:53 +00:00
Represents the size of the [enum Param] enum.
2017-09-12 20:42:36 +00:00
</constant>
2017-12-16 19:34:16 +00:00
<constant name= "BAKE_DISABLED" value= "0" enum= "BakeMode" >
2019-06-21 23:04:47 +00:00
Light is ignored when baking.
[b]Note:[/b] Hiding a light does [i]not[/i] affect baking.
2017-12-16 19:34:16 +00:00
</constant>
<constant name= "BAKE_INDIRECT" value= "1" enum= "BakeMode" >
2019-06-21 23:04:47 +00:00
Only indirect lighting will be baked (default).
2017-12-16 19:34:16 +00:00
</constant>
<constant name= "BAKE_ALL" value= "2" enum= "BakeMode" >
2019-06-21 23:04:47 +00:00
Both direct and indirect light will be baked.
[b]Note:[/b] You should hide the light if you don't want it to appear twice (dynamic and baked).
2017-12-16 19:34:16 +00:00
</constant>
2017-09-12 20:42:36 +00:00
</constants>
</class>