Merge pull request #1414 from romulox-x/viewport_clear_alpha

changed viewport clearing to use the alpha value of the clear color, and...
This commit is contained in:
Juan Linietsky 2015-03-01 18:58:50 -03:00
commit e15157f289
2 changed files with 7 additions and 2 deletions

View file

@ -4280,7 +4280,7 @@ void RasterizerGLES2::clear_viewport(const Color& p_color) {
}
glEnable(GL_SCISSOR_TEST);
glClearColor(p_color.r,p_color.g,p_color.b,1.0);
glClearColor(p_color.r,p_color.g,p_color.b,p_color.a);
glClear(GL_COLOR_BUFFER_BIT); //should not clear if anything else cleared..
glDisable(GL_SCISSOR_TEST);
};

View file

@ -6641,7 +6641,12 @@ void VisualServerRaster::_draw_viewport(Viewport *p_viewport,int p_ofs_x, int p_
//clear the viewport black because of no camera? i seriously should..
if (p_viewport->render_target_clear_on_new_frame || p_viewport->render_target_clear) {
rasterizer->clear_viewport(clear_color);
if (p_viewport->transparent_bg) {
rasterizer->clear_viewport(Color(0,0,0,0));
}
else {
rasterizer->clear_viewport(clear_color);
}
p_viewport->render_target_clear=false;
}
}