Merge pull request #32613 from clayjohn/GLES2-canvas-bg-mode

Add canvas background mode to GLES2
This commit is contained in:
Rémi Verschelde 2019-10-07 08:57:44 +02:00 committed by GitHub
commit 234289de2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3297,6 +3297,12 @@ void RasterizerSceneGLES2::render_scene(const Transform &p_cam_transform, const
reflection_probe_count = 0; reflection_probe_count = 0;
} }
if (env && env->bg_mode == VS::ENV_BG_CANVAS) {
// If using canvas background, copy 2d to screen copy texture
// TODO: When GLES2 renders to current_rt->mip_maps[], this copy will no longer be needed
_copy_texture_to_buffer(storage->frame.current_rt->color, storage->frame.current_rt->copy_screen_effect.fbo);
}
// render list stuff // render list stuff
render_list.clear(); render_list.clear();
@ -3433,8 +3439,11 @@ void RasterizerSceneGLES2::render_scene(const Transform &p_cam_transform, const
clear_color = Color(0.0, 1.0, 0.0, 1.0); clear_color = Color(0.0, 1.0, 0.0, 1.0);
} }
} break; } break;
case VS::ENV_BG_CANVAS: {
// use screen copy as background
_copy_texture_to_buffer(storage->frame.current_rt->copy_screen_effect.color, current_fb);
} break;
default: { default: {
// FIXME: implement other background modes
} break; } break;
} }
} }