diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-04-30 18:33:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-30 18:33:34 +0200 |
commit | dd2cd06165670bb0d78bf4aa397935be15716e76 (patch) | |
tree | 87017115deb9dafbc9f6ee7e003e024f1d5f48cf /servers/visual | |
parent | 06440408727cf30c2220b1a9225b14467302a8d0 (diff) | |
parent | de33ef2d1b94c1d3acc1cfa708665c99d0d0bb43 (diff) |
Merge pull request #25670 from aqnuep/bake_mode_affect_gi_prove
Disable GI probe capturing lights with bake mode disabled
Diffstat (limited to 'servers/visual')
-rw-r--r-- | servers/visual/rasterizer.h | 2 | ||||
-rw-r--r-- | servers/visual/visual_server_raster.h | 1 | ||||
-rw-r--r-- | servers/visual/visual_server_scene.cpp | 6 | ||||
-rw-r--r-- | servers/visual/visual_server_wrap_mt.h | 1 |
4 files changed, 10 insertions, 0 deletions
diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index b22e26f903..a02f52f034 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -373,6 +373,7 @@ public: virtual void light_set_negative(RID p_light, bool p_enable) = 0; virtual void light_set_cull_mask(RID p_light, uint32_t p_mask) = 0; virtual void light_set_reverse_cull_face_mode(RID p_light, bool p_enabled) = 0; + virtual void light_set_use_gi(RID p_light, bool p_enable) = 0; virtual void light_omni_set_shadow_mode(RID p_light, VS::LightOmniShadowMode p_mode) = 0; virtual void light_omni_set_shadow_detail(RID p_light, VS::LightOmniShadowDetail p_detail) = 0; @@ -392,6 +393,7 @@ public: virtual AABB light_get_aabb(RID p_light) const = 0; virtual float light_get_param(RID p_light, VS::LightParam p_param) = 0; virtual Color light_get_color(RID p_light) = 0; + virtual bool light_get_use_gi(RID p_light) = 0; virtual uint64_t light_get_version(RID p_light) const = 0; /* PROBE API */ diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h index efe2a99d2e..3ec428d687 100644 --- a/servers/visual/visual_server_raster.h +++ b/servers/visual/visual_server_raster.h @@ -312,6 +312,7 @@ public: BIND2(light_set_negative, RID, bool) BIND2(light_set_cull_mask, RID, uint32_t) BIND2(light_set_reverse_cull_face_mode, RID, bool) + BIND2(light_set_use_gi, RID, bool) BIND2(light_omni_set_shadow_mode, RID, LightOmniShadowMode) BIND2(light_omni_set_shadow_detail, RID, LightOmniShadowDetail) diff --git a/servers/visual/visual_server_scene.cpp b/servers/visual/visual_server_scene.cpp index af580d6794..bce5eaf7b0 100644 --- a/servers/visual/visual_server_scene.cpp +++ b/servers/visual/visual_server_scene.cpp @@ -3117,6 +3117,9 @@ bool VisualServerScene::_check_gi_probe(Instance *p_gi_probe) { for (List<Instance *>::Element *E = p_gi_probe->scenario->directional_lights.front(); E; E = E->next()) { + if (!VSG::storage->light_get_use_gi(E->get()->base)) + continue; + InstanceGIProbeData::LightCache lc; lc.type = VSG::storage->light_get_type(E->get()->base); lc.color = VSG::storage->light_get_color(E->get()->base); @@ -3137,6 +3140,9 @@ bool VisualServerScene::_check_gi_probe(Instance *p_gi_probe) { for (Set<Instance *>::Element *E = probe_data->lights.front(); E; E = E->next()) { + if (!VSG::storage->light_get_use_gi(E->get()->base)) + continue; + InstanceGIProbeData::LightCache lc; lc.type = VSG::storage->light_get_type(E->get()->base); lc.color = VSG::storage->light_get_color(E->get()->base); diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/visual/visual_server_wrap_mt.h index 3e451511cd..b2753369b8 100644 --- a/servers/visual/visual_server_wrap_mt.h +++ b/servers/visual/visual_server_wrap_mt.h @@ -248,6 +248,7 @@ public: FUNC2(light_set_negative, RID, bool) FUNC2(light_set_cull_mask, RID, uint32_t) FUNC2(light_set_reverse_cull_face_mode, RID, bool) + FUNC2(light_set_use_gi, RID, bool) FUNC2(light_omni_set_shadow_mode, RID, LightOmniShadowMode) FUNC2(light_omni_set_shadow_detail, RID, LightOmniShadowDetail) |