From 193b0bf1e3ee6c669a2fb6d95e264796844c86c0 Mon Sep 17 00:00:00 2001 From: clayjohn Date: Sat, 11 Apr 2020 16:10:34 -0700 Subject: [PATCH] Reset texture flags after radiance map generation --- drivers/gles2/rasterizer_storage_gles2.cpp | 3 +++ drivers/gles3/rasterizer_storage_gles3.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp index 7440c41fbd8..755f7786fa2 100644 --- a/drivers/gles2/rasterizer_storage_gles2.cpp +++ b/drivers/gles2/rasterizer_storage_gles2.cpp @@ -1317,6 +1317,9 @@ void RasterizerStorageGLES2::sky_set_texture(RID p_sky, RID p_panorama, int p_ra glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, 0); + //reset flags on Sky Texture that may have changed + texture_set_flags(sky->panorama, texture->flags); + // Framebuffer did its job. thank mr framebuffer glActiveTexture(GL_TEXTURE0); //back to panorama glBindFramebuffer(GL_FRAMEBUFFER, RasterizerStorageGLES2::system_fbo); diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index 4364f1ccb19..7f047776329 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -2189,6 +2189,9 @@ void RasterizerStorageGLES3::sky_set_texture(RID p_sky, RID p_panorama, int p_ra glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + //reset flags on Sky Texture that may have changed + texture_set_flags(sky->panorama, texture->flags); + glBindFramebuffer(GL_FRAMEBUFFER, RasterizerStorageGLES3::system_fbo); glDeleteFramebuffers(1, &tmp_fb); glDeleteFramebuffers(1, &tmp_fb2);