Improve the 3D light documentations
See https://github.com/godotengine/godot-docs/issues/3670.
This commit is contained in:
parent
ae21b5ddad
commit
f7e21d8e88
|
@ -4,7 +4,7 @@
|
||||||
Provides a base class for different kinds of light nodes.
|
Provides a base class for different kinds of light nodes.
|
||||||
</brief_description>
|
</brief_description>
|
||||||
<description>
|
<description>
|
||||||
Light3D 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. Light3D contains the common variables and parameters used for lighting.
|
Light3D 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. Light3D contains the common variables and parameters used for lighting.
|
||||||
</description>
|
</description>
|
||||||
<tutorials>
|
<tutorials>
|
||||||
<link>https://docs.godotengine.org/en/latest/tutorials/3d/lights_and_shadows.html</link>
|
<link>https://docs.godotengine.org/en/latest/tutorials/3d/lights_and_shadows.html</link>
|
||||||
|
@ -36,19 +36,19 @@
|
||||||
If [code]true[/code], the light only appears in the editor and will not be visible at runtime.
|
If [code]true[/code], the light only appears in the editor and will not be visible at runtime.
|
||||||
</member>
|
</member>
|
||||||
<member name="light_angular_distance" type="float" setter="set_param" getter="get_param" default="0.0">
|
<member name="light_angular_distance" type="float" setter="set_param" getter="get_param" default="0.0">
|
||||||
Angular size of the light in degrees. Only available for [DirectionalLight3D]s. For reference, the sun from earth is approximately [code]0.5[/code].
|
The light's angular size in degrees. Only available for [DirectionalLight3D]s. For reference, the Sun from the Earth is approximately [code]0.5[/code].
|
||||||
</member>
|
</member>
|
||||||
<member name="light_bake_mode" type="int" setter="set_bake_mode" getter="get_bake_mode" enum="Light3D.BakeMode" default="1">
|
<member name="light_bake_mode" type="int" setter="set_bake_mode" getter="get_bake_mode" enum="Light3D.BakeMode" default="1">
|
||||||
The light's bake mode. See [enum BakeMode].
|
The light's bake mode. See [enum BakeMode].
|
||||||
</member>
|
</member>
|
||||||
<member name="light_color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )">
|
<member name="light_color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )">
|
||||||
The light's color.
|
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].
|
||||||
</member>
|
</member>
|
||||||
<member name="light_cull_mask" type="int" setter="set_cull_mask" getter="get_cull_mask" default="4294967295">
|
<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.
|
The light will affect objects in the selected layers.
|
||||||
</member>
|
</member>
|
||||||
<member name="light_energy" type="float" setter="set_param" getter="get_param" default="1.0">
|
<member name="light_energy" type="float" setter="set_param" getter="get_param" default="1.0">
|
||||||
The light's strength multiplier.
|
The light's strength multiplier (this is not a physical unit). For [OmniLight3D] and [SpotLight3D], changing this value will only change the light color's intensity, not the light's radius.
|
||||||
</member>
|
</member>
|
||||||
<member name="light_indirect_energy" type="float" setter="set_param" getter="get_param" default="1.0">
|
<member name="light_indirect_energy" type="float" setter="set_param" getter="get_param" default="1.0">
|
||||||
Secondary multiplier used with indirect light (light bounces). Used with [GIProbe].
|
Secondary multiplier used with indirect light (light bounces). Used with [GIProbe].
|
||||||
|
@ -60,16 +60,16 @@
|
||||||
[Texture2D] projected by light. [member shadow_enabled] must be on for the projector to work. Light projectors make the light appear as if it is shining through a colored but transparent object, almost like light shining through stained glass.
|
[Texture2D] projected by light. [member shadow_enabled] must be on for the projector to work. Light projectors make the light appear as if it is shining through a colored but transparent object, almost like light shining through stained glass.
|
||||||
</member>
|
</member>
|
||||||
<member name="light_size" type="float" setter="set_param" getter="get_param" default="0.0">
|
<member name="light_size" type="float" setter="set_param" getter="get_param" default="0.0">
|
||||||
The size of the light in Godot units. Only available for [OmniLight3D]s and [SpotLight3D]s.
|
The size of the light in Godot units. Only available for [OmniLight3D]s and [SpotLight3D]s. Increasing this value will make the light fade out slower and shadows appear blurrier. This can be used to simulate area lights to an extent.
|
||||||
</member>
|
</member>
|
||||||
<member name="light_specular" type="float" setter="set_param" getter="get_param" default="0.5">
|
<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.
|
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.
|
||||||
</member>
|
</member>
|
||||||
<member name="shadow_bias" type="float" setter="set_param" getter="get_param" default="0.02">
|
<member name="shadow_bias" type="float" setter="set_param" getter="get_param" default="0.02">
|
||||||
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.
|
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.
|
||||||
</member>
|
</member>
|
||||||
<member name="shadow_blur" type="float" setter="set_param" getter="get_param" default="1.0">
|
<member name="shadow_blur" type="float" setter="set_param" getter="get_param" default="1.0">
|
||||||
Blurs the edges of the shadow. Can be used to hide pixel artifacts in low resolution shadow maps. A high value can make shadows appear grainy and can cause other unwanted artifacts. Try to keep as near default as possible.
|
Blurs the edges of the shadow. Can be used to hide pixel artifacts in low-resolution shadow maps. A high value can impact performance, make shadows appear grainy and can cause other unwanted artifacts. Try to keep as near default as possible.
|
||||||
</member>
|
</member>
|
||||||
<member name="shadow_color" type="Color" setter="set_shadow_color" getter="get_shadow_color" default="Color( 0, 0, 0, 1 )">
|
<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.
|
The color of shadows cast by this light.
|
||||||
|
@ -78,7 +78,7 @@
|
||||||
If [code]true[/code], the light will cast shadows.
|
If [code]true[/code], the light will cast shadows.
|
||||||
</member>
|
</member>
|
||||||
<member name="shadow_normal_bias" type="float" setter="set_param" getter="get_param" default="1.0">
|
<member name="shadow_normal_bias" type="float" setter="set_param" getter="get_param" default="1.0">
|
||||||
Offsets the lookup into the shadow map by the objects normal. This can be used reduce self-shadowing artifacts without using [member shadow_bias]. In practice, this value should be tweaked along with [member shadow_bias] to reduce artifacts as much as possible.
|
Offsets the lookup into the shadow map by the object's normal. This can be used to reduce self-shadowing artifacts without using [member shadow_bias]. In practice, this value should be tweaked along with [member shadow_bias] to reduce artifacts as much as possible.
|
||||||
</member>
|
</member>
|
||||||
<member name="shadow_reverse_cull_face" type="bool" setter="set_shadow_reverse_cull_face" getter="get_shadow_reverse_cull_face" default="false">
|
<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 GeometryInstance3D.SHADOW_CASTING_SETTING_DOUBLE_SIDED].
|
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 GeometryInstance3D.SHADOW_CASTING_SETTING_DOUBLE_SIDED].
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
The light's attenuation (drop-off) curve. A number of presets are available in the [b]Inspector[/b] by right-clicking the curve.
|
The light's attenuation (drop-off) curve. A number of presets are available in the [b]Inspector[/b] by right-clicking the curve.
|
||||||
</member>
|
</member>
|
||||||
<member name="omni_range" type="float" setter="set_param" getter="get_param" default="5.0">
|
<member name="omni_range" type="float" setter="set_param" getter="get_param" default="5.0">
|
||||||
The light's radius.
|
The light's radius. Note that the effectively lit area may appear to be smaller depending on the [member omni_attenuation] in use. No matter the [member omni_attenuation] in use, the light will never reach anything outside this radius.
|
||||||
</member>
|
</member>
|
||||||
<member name="omni_shadow_mode" type="int" setter="set_shadow_mode" getter="get_shadow_mode" enum="OmniLight3D.ShadowMode" default="1">
|
<member name="omni_shadow_mode" type="int" setter="set_shadow_mode" getter="get_shadow_mode" enum="OmniLight3D.ShadowMode" default="1">
|
||||||
See [enum ShadowMode].
|
See [enum ShadowMode].
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
The spotlight's light energy attenuation curve.
|
The spotlight's light energy attenuation curve.
|
||||||
</member>
|
</member>
|
||||||
<member name="spot_range" type="float" setter="set_param" getter="get_param" default="5.0">
|
<member name="spot_range" type="float" setter="set_param" getter="get_param" default="5.0">
|
||||||
The maximal range that can be reached by the spotlight.
|
The maximal range that can be reached by the spotlight. Note that the effectively lit area may appear to be smaller depending on the [member spot_attenuation] in use. No matter the [member spot_attenuation] in use, the light will never reach anything outside this range.
|
||||||
</member>
|
</member>
|
||||||
</members>
|
</members>
|
||||||
<constants>
|
<constants>
|
||||||
|
|
Loading…
Reference in New Issue