summaryrefslogtreecommitdiff
path: root/drivers/gles3/rasterizer_storage_gles3.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gles3/rasterizer_storage_gles3.cpp')
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp
index be44d62efc..95d4bec611 100644
--- a/drivers/gles3/rasterizer_storage_gles3.cpp
+++ b/drivers/gles3/rasterizer_storage_gles3.cpp
@@ -5219,6 +5219,7 @@ RID RasterizerStorageGLES3::light_create(VS::LightType p_type) {
light->directional_blend_splits = false;
light->directional_range_mode = VS::LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE;
light->reverse_cull = false;
+ light->use_gi = true;
light->version = 0;
return light_owner.make_rid(light);
@@ -5310,6 +5311,15 @@ void RasterizerStorageGLES3::light_set_reverse_cull_face_mode(RID p_light, bool
light->instance_change_notify(true, false);
}
+void RasterizerStorageGLES3::light_set_use_gi(RID p_light, bool p_enabled) {
+ Light *light = light_owner.getornull(p_light);
+ ERR_FAIL_COND(!light);
+
+ light->use_gi = p_enabled;
+
+ light->version++;
+ light->instance_change_notify(true, false);
+}
void RasterizerStorageGLES3::light_omni_set_shadow_mode(RID p_light, VS::LightOmniShadowMode p_mode) {
Light *light = light_owner.getornull(p_light);
@@ -5415,6 +5425,13 @@ Color RasterizerStorageGLES3::light_get_color(RID p_light) {
return light->color;
}
+bool RasterizerStorageGLES3::light_get_use_gi(RID p_light) {
+ Light *light = light_owner.getornull(p_light);
+ ERR_FAIL_COND_V(!light, false);
+
+ return light->use_gi;
+}
+
bool RasterizerStorageGLES3::light_has_shadow(RID p_light) const {
const Light *light = light_owner.getornull(p_light);