diff --git a/doc/classes/Light3D.xml b/doc/classes/Light3D.xml index 966d0fdcb462..4878599dbd50 100644 --- a/doc/classes/Light3D.xml +++ b/doc/classes/Light3D.xml @@ -98,7 +98,7 @@ [b]Note:[/b] [member light_size] is not affected by [member Node3D.scale] (the light's scale or its parent's scale). [b]Note:[/b] PCSS for positional lights is only supported in the Forward+ and Mobile rendering methods, not Compatibility. - + 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. diff --git a/doc/classes/OmniLight3D.xml b/doc/classes/OmniLight3D.xml index b0965a26da07..60016822f75f 100644 --- a/doc/classes/OmniLight3D.xml +++ b/doc/classes/OmniLight3D.xml @@ -13,6 +13,7 @@ $DOCS_URL/tutorials/3d/global_illumination/faking_global_illumination.html + Controls the distance attenuation function for omnilights. A value of [code]0.0[/code] will maintain a constant brightness through most of the range, but smoothly attenuate the light at the edge of the range. Use a value of [code]2.0[/code] for physically accurate lights as it results in the proper inverse square attenutation. diff --git a/doc/classes/SpotLight3D.xml b/doc/classes/SpotLight3D.xml index 66908f5af134..15acaffc19a3 100644 --- a/doc/classes/SpotLight3D.xml +++ b/doc/classes/SpotLight3D.xml @@ -14,6 +14,7 @@ https://godotengine.org/asset-library/asset/2710 + diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index 8f79d8fad51a..a85409967ad8 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -2138,7 +2138,7 @@ void main() { continue; } #endif - light_compute(normal, normalize(directional_lights[i].direction), normalize(view), directional_lights[i].size, directional_lights[i].color * directional_lights[i].energy, true, 1.0, f0, roughness, metallic, 1.0, albedo, alpha, screen_uv, + light_compute(normal, normalize(directional_lights[i].direction), normalize(view), directional_lights[i].size, directional_lights[i].color * directional_lights[i].energy, true, 1.0, f0, roughness, metallic, directional_lights[i].specular, albedo, alpha, screen_uv, #ifdef LIGHT_BACKLIGHT_USED backlight, #endif @@ -2440,7 +2440,7 @@ void main() { #endif // SHADOWS_DISABLED #ifndef USE_VERTEX_LIGHTING - light_compute(normal, normalize(directional_lights[directional_shadow_index].direction), normalize(view), directional_lights[directional_shadow_index].size, directional_lights[directional_shadow_index].color * directional_lights[directional_shadow_index].energy, true, directional_shadow, f0, roughness, metallic, 1.0, albedo, alpha, screen_uv, + light_compute(normal, normalize(directional_lights[directional_shadow_index].direction), normalize(view), directional_lights[directional_shadow_index].size, directional_lights[directional_shadow_index].color * directional_lights[directional_shadow_index].energy, true, directional_shadow, f0, roughness, metallic, directional_lights[directional_shadow_index].specular, albedo, alpha, screen_uv, #ifdef LIGHT_BACKLIGHT_USED backlight, #endif diff --git a/scene/3d/light_3d.cpp b/scene/3d/light_3d.cpp index 6cc81da76f81..a8b4dfbf6b5e 100644 --- a/scene/3d/light_3d.cpp +++ b/scene/3d/light_3d.cpp @@ -545,7 +545,7 @@ void DirectionalLight3D::_validate_property(PropertyInfo &p_property) const { p_property.usage = PROPERTY_USAGE_NO_EDITOR; } - if (p_property.name == "light_size" || p_property.name == "light_projector" || p_property.name == "light_specular") { + if (p_property.name == "light_size" || p_property.name == "light_projector") { // Not implemented in DirectionalLight3D (`light_size` is replaced by `light_angular_distance`). p_property.usage = PROPERTY_USAGE_NONE; } @@ -595,6 +595,7 @@ DirectionalLight3D::DirectionalLight3D() : // Increase the default shadow normal bias to better suit most scenes. set_param(PARAM_SHADOW_NORMAL_BIAS, 2.0); set_param(PARAM_INTENSITY, 100000.0); // Specified in Lux, approximate mid-day sun. + set_param(PARAM_SPECULAR, 1.0); set_shadow_mode(SHADOW_PARALLEL_4_SPLITS); blend_splits = false; set_sky_mode(SKY_MODE_LIGHT_AND_SKY); diff --git a/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl b/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl index c14ea34c8f0c..c1338dbbc060 100644 --- a/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl +++ b/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl @@ -2351,7 +2351,7 @@ void fragment_shader(in SceneData scene_data) { #else directional_lights.data[i].color * directional_lights.data[i].energy * tint, #endif - true, shadow, f0, orms, 1.0, albedo, alpha, screen_uv, + true, shadow, f0, orms, directional_lights.data[i].specular, albedo, alpha, screen_uv, #ifdef LIGHT_BACKLIGHT_USED backlight, #endif diff --git a/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl b/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl index a3c264b82366..2789c62fb245 100644 --- a/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl +++ b/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl @@ -1647,7 +1647,7 @@ void main() { light_compute(normal, directional_lights.data[i].direction, view, size_A, directional_lights.data[i].color * directional_lights.data[i].energy * tint, - true, shadow, f0, orms, 1.0, albedo, alpha, screen_uv, + true, shadow, f0, orms, directional_lights.data[i].specular, albedo, alpha, screen_uv, #ifdef LIGHT_BACKLIGHT_USED backlight, #endif