diff options
author | clayjohn <claynjohn@gmail.com> | 2021-10-06 21:46:07 -0700 |
---|---|---|
committer | clayjohn <claynjohn@gmail.com> | 2021-10-06 22:04:56 -0700 |
commit | 23dc490f40a605ae45ef65547c26a49e39665e01 (patch) | |
tree | f51b79ebd2c3d463033ba0d516feec5b117d602c /servers/rendering/renderer_rd | |
parent | 69f80b6631489472b06145a83f2b78b932e8467c (diff) |
Remove bogus sky error check
Diffstat (limited to 'servers/rendering/renderer_rd')
-rw-r--r-- | servers/rendering/renderer_rd/renderer_scene_sky_rd.cpp | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/servers/rendering/renderer_rd/renderer_scene_sky_rd.cpp b/servers/rendering/renderer_rd/renderer_scene_sky_rd.cpp index 7925e735a0..5814c164cc 100644 --- a/servers/rendering/renderer_rd/renderer_scene_sky_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_scene_sky_rd.cpp @@ -1036,11 +1036,7 @@ void RendererSceneSkyRD::setup(RendererSceneEnvironmentRD *p_env, RID p_render_b SkyShaderData *shader_data = nullptr; - RS::EnvironmentBG background = p_env->background; - - if (!(background == RS::ENV_BG_CLEAR_COLOR || background == RS::ENV_BG_COLOR) || sky) { - // !BAS! Possibly silently fail here, we now get error spam when you select sky as the background but haven't setup the sky yet. - ERR_FAIL_COND(!sky); + if (sky) { sky_material = sky_get_material(p_env->sky); if (sky_material.is_valid()) { @@ -1060,9 +1056,7 @@ void RendererSceneSkyRD::setup(RendererSceneEnvironmentRD *p_env, RID p_render_b shader_data = material->shader_data; ERR_FAIL_COND(!shader_data); - } - if (sky) { // Invalidate supbass buffers if screen size changes if (sky->screen_size != p_screen_size) { sky->screen_size = p_screen_size; @@ -1371,7 +1365,6 @@ void RendererSceneSkyRD::draw(RendererSceneEnvironmentRD *p_env, bool p_can_cont ERR_FAIL_COND(p_view_count > RendererSceneRender::MAX_RENDER_VIEWS); Sky *sky = get_sky(p_env->sky); - ERR_FAIL_COND(!sky); SkyMaterialData *material = nullptr; RID sky_material; @@ -1483,27 +1476,17 @@ void RendererSceneSkyRD::update_res_buffers(RendererSceneEnvironmentRD *p_env, u SkyMaterialData *material = nullptr; RID sky_material; - RS::EnvironmentBG background = p_env->background; - - if (!(background == RS::ENV_BG_CLEAR_COLOR || background == RS::ENV_BG_COLOR) || sky) { - ERR_FAIL_COND(!sky); - sky_material = sky_get_material(p_env->sky); - - if (sky_material.is_valid()) { - material = (SkyMaterialData *)storage->material_get_data(sky_material, RendererStorageRD::SHADER_TYPE_SKY); - if (!material || !material->shader_data->valid) { - material = nullptr; - } - } + sky_material = sky_get_material(p_env->sky); - if (!material) { - sky_material = sky_shader.default_material; - material = (SkyMaterialData *)storage->material_get_data(sky_material, RendererStorageRD::SHADER_TYPE_SKY); + if (sky_material.is_valid()) { + material = (SkyMaterialData *)storage->material_get_data(sky_material, RendererStorageRD::SHADER_TYPE_SKY); + if (!material || !material->shader_data->valid) { + material = nullptr; } } - if (background == RS::ENV_BG_CLEAR_COLOR || background == RS::ENV_BG_COLOR) { - sky_material = sky_scene_state.fog_material; + if (!material) { + sky_material = sky_shader.default_material; material = (SkyMaterialData *)storage->material_get_data(sky_material, RendererStorageRD::SHADER_TYPE_SKY); } @@ -1572,7 +1555,6 @@ void RendererSceneSkyRD::draw(RD::DrawListID p_draw_list, RendererSceneEnvironme ERR_FAIL_COND(p_view_count > RendererSceneRender::MAX_RENDER_VIEWS); Sky *sky = get_sky(p_env->sky); - ERR_FAIL_COND(!sky); SkyMaterialData *material = nullptr; RID sky_material; |