summaryrefslogtreecommitdiff
path: root/doc/classes/Light.xml
blob: ae5bba4f060adb1717645c66a4024619c8afa19a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Light" inherits="VisualInstance" category="Core" version="3.2">
	<brief_description>
		Provides a base class for different kinds of light nodes.
	</brief_description>
	<description>
		Light is the abstract base class for light nodes, so it shouldn't be used directly (it can't be instanced). Other types of light nodes inherit from it. Light contains the common variables and parameters used for lighting.
	</description>
	<tutorials>
		<link>https://docs.godotengine.org/en/latest/tutorials/3d/lights_and_shadows.html</link>
	</tutorials>
	<methods>
		<method name="get_param" qualifiers="const">
			<return type="float">
			</return>
			<argument index="0" name="param" type="int" enum="Light.Param">
			</argument>
			<description>
				Returns the value of the specified [enum Light.Param] parameter.
			</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>
				Sets the value of the specified [enum Light.Param] parameter.
			</description>
		</method>
	</methods>
	<members>
		<member name="editor_only" type="bool" setter="set_editor_only" getter="is_editor_only" default="false">
			If [code]true[/code], the light only appears in the editor and will not be visible at runtime.
		</member>
		<member name="light_bake_mode" type="int" setter="set_bake_mode" getter="get_bake_mode" enum="Light.BakeMode" default="1">
			The light's bake mode. See [enum BakeMode].
		</member>
		<member name="light_color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )">
			The light's color.
		</member>
		<member name="light_cull_mask" type="int" setter="set_cull_mask" getter="get_cull_mask" default="4294967295">
			The light will affect objects in the selected layers.
		</member>
		<member name="light_energy" type="float" setter="set_param" getter="get_param" default="1.0">
			The light's strength multiplier.
		</member>
		<member name="light_indirect_energy" type="float" setter="set_param" getter="get_param" default="1.0">
			Secondary multiplier used with indirect light (light bounces). This works on both [BakedLightmap] and [GIProbe].
		</member>
		<member name="light_negative" type="bool" setter="set_negative" getter="is_negative" default="false">
			If [code]true[/code], the light's effect is reversed, darkening areas and casting bright shadows.
		</member>
		<member name="light_specular" type="float" setter="set_param" getter="get_param" default="0.5">
			The intensity of the specular blob in objects affected by the light. At [code]0[/code] the light becomes a pure diffuse light.
		</member>
		<member name="shadow_bias" type="float" setter="set_param" getter="get_param" default="0.15">
			Used to adjust shadow appearance. Too small a value results in self-shadowing, while too large a value causes shadows to separate from casters. Adjust as needed.
		</member>
		<member name="shadow_color" type="Color" setter="set_shadow_color" getter="get_shadow_color" default="Color( 0, 0, 0, 1 )">
			The color of shadows cast by this light.
		</member>
		<member name="shadow_contact" type="float" setter="set_param" getter="get_param" default="0.0">
			Attempts to reduce [member shadow_bias] gap.
		</member>
		<member name="shadow_enabled" type="bool" setter="set_shadow" getter="has_shadow" default="false">
			If [code]true[/code], the light will cast shadows.
		</member>
		<member name="shadow_reverse_cull_face" type="bool" setter="set_shadow_reverse_cull_face" getter="get_shadow_reverse_cull_face" default="false">
			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].
		</member>
	</members>
	<constants>
		<constant name="PARAM_ENERGY" value="0" enum="Param">
			Constant for accessing [member light_energy].
		</constant>
		<constant name="PARAM_INDIRECT_ENERGY" value="1" enum="Param">
			Constant for accessing [member light_indirect_energy].
		</constant>
		<constant name="PARAM_SPECULAR" value="2" enum="Param">
			Constant for accessing [member light_specular].
		</constant>
		<constant name="PARAM_RANGE" value="3" enum="Param">
			Constant for accessing [member OmniLight.omni_range] or [member SpotLight.spot_range].
		</constant>
		<constant name="PARAM_ATTENUATION" value="4" enum="Param">
			Constant for accessing [member OmniLight.omni_attenuation] or [member SpotLight.spot_attenuation].
		</constant>
		<constant name="PARAM_SPOT_ANGLE" value="5" enum="Param">
			Constant for accessing [member SpotLight.spot_angle].
		</constant>
		<constant name="PARAM_SPOT_ATTENUATION" value="6" enum="Param">
			Constant for accessing [member SpotLight.spot_angle_attenuation].
		</constant>
		<constant name="PARAM_CONTACT_SHADOW_SIZE" value="7" enum="Param">
			Constant for accessing [member shadow_contact].
		</constant>
		<constant name="PARAM_SHADOW_MAX_DISTANCE" value="8" enum="Param">
			Constant for accessing [member DirectionalLight.directional_shadow_max_distance].
		</constant>
		<constant name="PARAM_SHADOW_SPLIT_1_OFFSET" value="9" enum="Param">
			Constant for accessing [member DirectionalLight.directional_shadow_split_1].
		</constant>
		<constant name="PARAM_SHADOW_SPLIT_2_OFFSET" value="10" enum="Param">
			Constant for accessing [member DirectionalLight.directional_shadow_split_2].
		</constant>
		<constant name="PARAM_SHADOW_SPLIT_3_OFFSET" value="11" enum="Param">
			Constant for accessing [member DirectionalLight.directional_shadow_split_3].
		</constant>
		<constant name="PARAM_SHADOW_NORMAL_BIAS" value="12" enum="Param">
			Constant for accessing [member DirectionalLight.directional_shadow_normal_bias].
		</constant>
		<constant name="PARAM_SHADOW_BIAS" value="13" enum="Param">
			Constant for accessing [member shadow_bias].
		</constant>
		<constant name="PARAM_SHADOW_BIAS_SPLIT_SCALE" value="14" enum="Param">
			Constant for accessing [member DirectionalLight.directional_shadow_bias_split_scale].
		</constant>
		<constant name="PARAM_MAX" value="15" enum="Param">
			Represents the size of the [enum Param] enum.
		</constant>
		<constant name="BAKE_DISABLED" value="0" enum="BakeMode">
			Light is ignored when baking.
			[b]Note:[/b] Hiding a light does [i]not[/i] affect baking.
		</constant>
		<constant name="BAKE_INDIRECT" value="1" enum="BakeMode">
			Only indirect lighting will be baked (default).
		</constant>
		<constant name="BAKE_ALL" value="2" enum="BakeMode">
			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).
		</constant>
	</constants>
</class>