Respect keep_3d_linear when transparent_bg is on.

When transparent_bg is on, or the render target is too small,
Godot would skip postprocessing and disregard keep_3d_linear.

This fixes #26817.

(cherry picked from commit 7cbfce7a8c)
This commit is contained in:
toasteater 2019-03-09 10:37:37 +08:00 committed by Rémi Verschelde
parent 4574894e43
commit 511fb03e20
1 changed files with 1 additions and 1 deletions

View File

@ -3663,7 +3663,7 @@ void RasterizerSceneGLES3::_post_process(Environment *env, const CameraMatrix &p
glBindFramebuffer(GL_FRAMEBUFFER, storage->frame.current_rt->fbo);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->effects.mip_maps[0].color);
storage->shaders.copy.set_conditional(CopyShaderGLES3::LINEAR_TO_SRGB, true);
storage->shaders.copy.set_conditional(CopyShaderGLES3::LINEAR_TO_SRGB, !storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_KEEP_3D_LINEAR]);
storage->shaders.copy.set_conditional(CopyShaderGLES3::V_FLIP, storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_VFLIP]);
storage->shaders.copy.set_conditional(CopyShaderGLES3::DISABLE_ALPHA, !storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_TRANSPARENT]);
storage->shaders.copy.bind();