Merge pull request #44489 from ForestKatsch/3.2

Fix PanoramaSky artifacts on Android/GLES2
This commit is contained in:
Rémi Verschelde 2020-12-20 19:31:17 +01:00 committed by GitHub
commit 8c63b65b67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1276,11 +1276,8 @@ void RasterizerStorageGLES2::sky_set_texture(RID p_sky, RID p_panorama, int p_ra
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, resources.mipmap_blur_color, 0);
if (lod == 1) {
//bind panorama for smaller lods
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_CUBE_MAP, sky->radiance);
shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES2::USE_SOURCE_PANORAMA, false);
// We set USE_DIRECT_WRITE to false for LOD levels 1 and up, so the shader will properly
// filter the roughness instead of just copying 1:1 from the source panorama.
shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES2::USE_DIRECT_WRITE, false);
shaders.cubemap_filter.bind();
}