diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index ad127c40de0..146a2359b68 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -4165,7 +4165,7 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const clear_color = env->bg_color.to_linear(); storage->frame.clear_request = false; - } else if (env->bg_mode == VS::ENV_BG_SKY) { + } else if (env->bg_mode == VS::ENV_BG_SKY || env->bg_mode == VS::ENV_BG_COLOR_SKY) { sky = storage->sky_owner.getornull(env->sky); @@ -4173,6 +4173,9 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const env_radiance_tex = sky->radiance; } storage->frame.clear_request = false; + if (env->bg_mode == VS::ENV_BG_COLOR_SKY) { + clear_color = env->bg_color.to_linear(); + } } else { storage->frame.clear_request = false; diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp index 14225d945df..da3bc6a95b0 100644 --- a/scene/resources/environment.cpp +++ b/scene/resources/environment.cpp @@ -269,13 +269,13 @@ Ref Environment::get_adjustment_color_correction() const { void Environment::_validate_property(PropertyInfo &property) const { if (property.name == "background_sky" || property.name == "background_sky_scale" || property.name == "ambient_light/sky_contribution") { - if (bg_mode != BG_SKY) { + if (bg_mode != BG_SKY && bg_mode != BG_COLOR_SKY) { property.usage = PROPERTY_USAGE_NOEDITOR; } } if (property.name == "background_color") { - if (bg_mode != BG_COLOR) { + if (bg_mode != BG_COLOR && bg_mode != BG_COLOR_SKY) { property.usage = PROPERTY_USAGE_NOEDITOR; } } @@ -839,7 +839,7 @@ void Environment::_bind_methods() { ClassDB::bind_method(D_METHOD("get_ambient_light_sky_contribution"), &Environment::get_ambient_light_sky_contribution); ADD_GROUP("Background", "background_"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "background_mode", PROPERTY_HINT_ENUM, "Clear Color,Custom Color,Sky,Canvas,Keep"), "set_background", "get_background"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "background_mode", PROPERTY_HINT_ENUM, "Clear Color,Custom Color,Sky,Color+Sky,Canvas,Keep"), "set_background", "get_background"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "background_sky", PROPERTY_HINT_RESOURCE_TYPE, "Sky"), "set_sky", "get_sky"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "background_sky_scale", PROPERTY_HINT_RANGE, "0,32,0.01"), "set_sky_scale", "get_sky_scale"); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "background_color"), "set_bg_color", "get_bg_color"); @@ -1118,6 +1118,7 @@ void Environment::_bind_methods() { BIND_ENUM_CONSTANT(BG_CLEAR_COLOR); BIND_ENUM_CONSTANT(BG_COLOR); BIND_ENUM_CONSTANT(BG_SKY); + BIND_ENUM_CONSTANT(BG_COLOR_SKY); BIND_ENUM_CONSTANT(BG_CANVAS); BIND_ENUM_CONSTANT(BG_MAX); diff --git a/scene/resources/environment.h b/scene/resources/environment.h index 6337981b95e..9046ec1e492 100644 --- a/scene/resources/environment.h +++ b/scene/resources/environment.h @@ -45,6 +45,7 @@ public: BG_CLEAR_COLOR, BG_COLOR, BG_SKY, + BG_COLOR_SKY, BG_CANVAS, BG_KEEP, BG_MAX diff --git a/servers/visual_server.h b/servers/visual_server.h index 9b88df5c73c..74948202873 100644 --- a/servers/visual_server.h +++ b/servers/visual_server.h @@ -628,6 +628,7 @@ public: ENV_BG_CLEAR_COLOR, ENV_BG_COLOR, ENV_BG_SKY, + ENV_BG_COLOR_SKY, ENV_BG_CANVAS, ENV_BG_KEEP, ENV_BG_MAX