Merge pull request #35175 from clayjohn/GLES2-bg-keep
Add background mode keep to GLES2
This commit is contained in:
commit
f9cb219c2f
|
@ -3325,6 +3325,7 @@ void RasterizerSceneGLES2::render_scene(const Transform &p_cam_transform, const
|
||||||
glDepthMask(GL_TRUE);
|
glDepthMask(GL_TRUE);
|
||||||
glClearDepth(1.0f);
|
glClearDepth(1.0f);
|
||||||
glEnable(GL_DEPTH_TEST);
|
glEnable(GL_DEPTH_TEST);
|
||||||
|
glClear(GL_DEPTH_BUFFER_BIT);
|
||||||
|
|
||||||
// clear color
|
// 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) {
|
if (!env || env->bg_mode != VS::ENV_BG_KEEP) {
|
||||||
glClearColor(clear_color.r, clear_color.g, clear_color.b, clear_color.a);
|
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_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);
|
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]) {
|
if (storage->frame.current_rt && storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_DIRECT_TO_SCREEN]) {
|
||||||
glDisable(GL_SCISSOR_TEST);
|
glDisable(GL_SCISSOR_TEST);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue