diff options
author | clayjohn <claynjohn@gmail.com> | 2020-01-15 15:59:00 -0800 |
---|---|---|
committer | clayjohn <claynjohn@gmail.com> | 2020-01-15 15:59:00 -0800 |
commit | a34508843328bcd726d5421ef979f6332ce5d304 (patch) | |
tree | 6c25ec3c62bde3727a69e439d9e733b3a0a6e507 /drivers/gles2 | |
parent | 40f0649e5b02037cb4745c336170e1e5422467ed (diff) |
Add background mode keep to GLES2
Diffstat (limited to 'drivers/gles2')
-rw-r--r-- | drivers/gles2/rasterizer_scene_gles2.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gles2/rasterizer_scene_gles2.cpp b/drivers/gles2/rasterizer_scene_gles2.cpp index 5c52d88cc7..441e7e5c1a 100644 --- a/drivers/gles2/rasterizer_scene_gles2.cpp +++ b/drivers/gles2/rasterizer_scene_gles2.cpp @@ -3325,6 +3325,7 @@ void RasterizerSceneGLES2::render_scene(const Transform &p_cam_transform, const glDepthMask(GL_TRUE); glClearDepth(1.0f); glEnable(GL_DEPTH_TEST); + glClear(GL_DEPTH_BUFFER_BIT); // clear color @@ -3351,13 +3352,12 @@ void RasterizerSceneGLES2::render_scene(const Transform &p_cam_transform, const if (!env || env->bg_mode != VS::ENV_BG_KEEP) { glClearColor(clear_color.r, clear_color.g, clear_color.b, clear_color.a); + glClear(GL_COLOR_BUFFER_BIT); } state.default_ambient = Color(clear_color.r, clear_color.g, clear_color.b, 1.0); state.default_bg = Color(clear_color.r, clear_color.g, clear_color.b, 1.0); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - if (storage->frame.current_rt && storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_DIRECT_TO_SCREEN]) { glDisable(GL_SCISSOR_TEST); } |