Skip to content

Commit

Permalink
Merge pull request #32613 from clayjohn/GLES2-canvas-bg-mode
Browse files Browse the repository at this point in the history
Add canvas background mode to GLES2
  • Loading branch information
akien-mga committed Oct 7, 2019
2 parents f84bf7e + 77939c6 commit 234289d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion drivers/gles2/rasterizer_scene_gles2.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
} }
} }
Expand Down

0 comments on commit 234289d

Please sign in to comment.