Merge pull request #32603 from clayjohn/GLES2-post-processing-bugs

Fix current issues with post-processing
This commit is contained in:
Rémi Verschelde 2019-10-07 07:03:47 +02:00 committed by GitHub
commit aece1fee8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 11 deletions

View file

@ -2905,16 +2905,10 @@ void RasterizerSceneGLES2::_post_process(Environment *env, const CameraMatrix &p
glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->depth); glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->depth);
glActiveTexture(GL_TEXTURE0); glActiveTexture(GL_TEXTURE0);
if (!storage->frame.current_rt->used_dof_blur_near) { if (storage->frame.current_rt->mip_maps[0].color) {
if (storage->frame.current_rt->mip_maps[0].color) { glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->mip_maps[0].color);
glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->mip_maps[0].color); } else {
} else { glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->mip_maps[0].sizes[0].color);
for (int i = 0; i < storage->frame.current_rt->mip_maps[i].sizes.size(); i++) {
glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->mip_maps[0].sizes[i].color);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, storage->frame.current_rt->mip_maps[0].sizes[i].width, storage->frame.current_rt->mip_maps[0].sizes[i].height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
}
glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->mip_maps[0].sizes[0].color);
}
} }
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);

View file

@ -5757,7 +5757,8 @@ void RasterizerStorageGLES2::initialize() {
config.multisample_supported = config.extensions.has("GL_EXT_framebuffer_multisample") || config.extensions.has("GL_EXT_multisampled_render_to_texture") || config.extensions.has("GL_APPLE_framebuffer_multisample"); config.multisample_supported = config.extensions.has("GL_EXT_framebuffer_multisample") || config.extensions.has("GL_EXT_multisampled_render_to_texture") || config.extensions.has("GL_APPLE_framebuffer_multisample");
#ifdef GLES_OVER_GL #ifdef GLES_OVER_GL
config.render_to_mipmap_supported = true; //TODO: causes huge problems with desktop video drivers. Making false for now, needs to be true to render SCREEN_TEXTURE mipmaps
config.render_to_mipmap_supported = false;
#else #else
//check if mipmaps can be used for SCREEN_TEXTURE and Glow on Mobile and web platforms //check if mipmaps can be used for SCREEN_TEXTURE and Glow on Mobile and web platforms
config.render_to_mipmap_supported = config.extensions.has("GL_OES_fbo_render_mipmap") && config.extensions.has("GL_EXT_texture_lod"); config.render_to_mipmap_supported = config.extensions.has("GL_OES_fbo_render_mipmap") && config.extensions.has("GL_EXT_texture_lod");