summaryrefslogtreecommitdiff
path: root/servers/rendering/renderer_rd/renderer_scene_sky_rd.cpp
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2021-10-20 00:40:46 +0200
committerclayjohn <claynjohn@gmail.com>2022-03-17 14:00:02 -0700
commitc45d2c242bf568363f0d6528dc142c0cac0eb1c8 (patch)
tree895ceb187050d15c94f5ad3a3e2de7c26e9be715 /servers/rendering/renderer_rd/renderer_scene_sky_rd.cpp
parent6228063972b23a1ed216956b0e1d87d303548996 (diff)
Replace DirectionalLight3D's `use_in_sky_only` with `sky_mode` enum
3 options are available: - Light and Sky (default) - Light Only (new) - Sky Only (equivalent to `use_in_sky_only = true`) Co-authored by: clayjohn <claynjohn@gmail.com>
Diffstat (limited to 'servers/rendering/renderer_rd/renderer_scene_sky_rd.cpp')
-rw-r--r--servers/rendering/renderer_rd/renderer_scene_sky_rd.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/servers/rendering/renderer_rd/renderer_scene_sky_rd.cpp b/servers/rendering/renderer_rd/renderer_scene_sky_rd.cpp
index 1785a6b180..44da9e40f8 100644
--- a/servers/rendering/renderer_rd/renderer_scene_sky_rd.cpp
+++ b/servers/rendering/renderer_rd/renderer_scene_sky_rd.cpp
@@ -1167,7 +1167,7 @@ void RendererSceneSkyRD::setup(RendererSceneEnvironmentRD *p_env, RID p_render_b
ERR_CONTINUE(base.is_null());
RS::LightType type = storage->light_get_type(base);
- if (type == RS::LIGHT_DIRECTIONAL) {
+ if (type == RS::LIGHT_DIRECTIONAL && storage->light_directional_get_sky_mode(base) != RS::LIGHT_DIRECTIONAL_SKY_MODE_LIGHT_ONLY) {
SkyDirectionalLightData &sky_light_data = sky_scene_state.directional_lights[sky_scene_state.ubo.directional_light_count];
Transform3D light_transform = li->transform;
Vector3 world_direction = light_transform.basis.xform(Vector3(0, 0, 1)).normalized();