Clear color was not correctly being set, fixes #4939

This commit is contained in:
Juan Linietsky 2018-07-29 15:09:42 -03:00
parent c752c26427
commit 7b63c6323d
5 changed files with 16 additions and 3 deletions

View File

@ -225,7 +225,7 @@ void RasterizerGLES3::set_current_render_target(RID p_render_target) {
if (!p_render_target.is_valid() && storage->frame.current_rt && storage->frame.clear_request) {
//handle pending clear request, if the framebuffer was not cleared
glBindFramebuffer(GL_FRAMEBUFFER, storage->frame.current_rt->fbo);
print_line("unbind clear of: " + storage->frame.clear_request_color);
glClearColor(
storage->frame.clear_request_color.r,
storage->frame.clear_request_color.g,

View File

@ -803,7 +803,12 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
switch (p_tool) {
case TOOL_CREATE_2D_SCENE: new_node = memnew(Node2D); break;
case TOOL_CREATE_3D_SCENE: new_node = memnew(Spatial); break;
case TOOL_CREATE_USER_INTERFACE: new_node = memnew(Control); break;
case TOOL_CREATE_USER_INTERFACE: {
Control *node = memnew(Control);
node->set_anchors_and_margins_preset(PRESET_WIDE); //more useful for resizable UIs.
new_node = node;
} break;
}
editor_data->get_undo_redo().create_action("New Scene Root");

View File

@ -161,6 +161,7 @@ void VisualServerRaster::set_boot_image(const Ref<Image> &p_image, const Color &
VSG::rasterizer->set_boot_image(p_image, p_color, p_scale);
}
void VisualServerRaster::set_default_clear_color(const Color &p_color) {
VSG::viewport->set_default_clear_color(p_color);
}
bool VisualServerRaster::has_feature(Features p_feature) const {

View File

@ -252,7 +252,9 @@ void VisualServerViewport::draw_viewports() {
// process all our active interfaces
ARVRServer::get_singleton()->_process();
if (Engine::get_singleton()->is_editor_hint()) {
clear_color = GLOBAL_GET("rendering/environment/default_clear_color");
}
//sort viewports
active_viewports.sort_custom<ViewportSort>();
@ -660,5 +662,9 @@ bool VisualServerViewport::free(RID p_rid) {
return false;
}
void VisualServerViewport::set_default_clear_color(const Color &p_color) {
clear_color = p_color;
}
VisualServerViewport::VisualServerViewport() {
}

View File

@ -188,6 +188,7 @@ public:
virtual int viewport_get_render_info(RID p_viewport, VS::ViewportRenderInfo p_info);
virtual void viewport_set_debug_draw(RID p_viewport, VS::ViewportDebugDraw p_draw);
void set_default_clear_color(const Color &p_color);
void draw_viewports();
bool free(RID p_rid);