diff options
Diffstat (limited to 'drivers/gles3/storage/texture_storage.cpp')
-rw-r--r-- | drivers/gles3/storage/texture_storage.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/gles3/storage/texture_storage.cpp b/drivers/gles3/storage/texture_storage.cpp index c4fef89cfd..fd187527ac 100644 --- a/drivers/gles3/storage/texture_storage.cpp +++ b/drivers/gles3/storage/texture_storage.cpp @@ -1827,10 +1827,10 @@ void TextureStorage::_create_render_target_backbuffer(RenderTarget *rt) { return; } - // Initialize all levels to opaque Magenta. + // Initialize all levels to clear black. for (int j = 0; j < count; j++) { glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, rt->backbuffer, j); - glClearColor(1.0, 0.0, 1.0, 1.0); + glClearColor(0.0, 0.0, 0.0, 0.0); glClear(GL_COLOR_BUFFER_BIT); } @@ -2548,18 +2548,18 @@ void TextureStorage::render_target_copy_to_back_buffer(RID p_render_target, cons } glDisable(GL_BLEND); - //single texture copy for backbuffer + // Single texture copy for backbuffer. glBindFramebuffer(GL_FRAMEBUFFER, rt->backbuffer_fbo); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, rt->color); GLES3::CopyEffects::get_singleton()->copy_screen(); if (p_gen_mipmaps) { - GLES3::CopyEffects::get_singleton()->bilinear_blur(rt->backbuffer, rt->mipmap_count, region); + GLES3::CopyEffects::get_singleton()->gaussian_blur(rt->backbuffer, rt->mipmap_count, region, rt->size); glBindFramebuffer(GL_FRAMEBUFFER, rt->backbuffer_fbo); } - glEnable(GL_BLEND); // 2D almost always uses blend. + glEnable(GL_BLEND); // 2D starts with blend enabled. } void TextureStorage::render_target_clear_back_buffer(RID p_render_target, const Rect2i &p_region, const Color &p_color) { @@ -2604,8 +2604,10 @@ void TextureStorage::render_target_gen_back_buffer_mipmaps(RID p_render_target, return; //nothing to do } } + glDisable(GL_BLEND); + GLES3::CopyEffects::get_singleton()->gaussian_blur(rt->backbuffer, rt->mipmap_count, region, rt->size); + glEnable(GL_BLEND); // 2D starts with blend enabled. - GLES3::CopyEffects::get_singleton()->bilinear_blur(rt->backbuffer, rt->mipmap_count, region); glBindFramebuffer(GL_FRAMEBUFFER, rt->backbuffer_fbo); } |