浏览代码

Fix a rendering bug with screen_texture

Bojidar Marinov 7 年之前
父节点
当前提交
ea57a19b34
共有 1 个文件被更改,包括 4 次插入6 次删除
  1. 4 6
      drivers/gles3/rasterizer_canvas_gles3.cpp

+ 4 - 6
drivers/gles3/rasterizer_canvas_gles3.cpp

@@ -993,13 +993,11 @@ void RasterizerCanvasGLES3::_copy_texscreen(const Rect2 &p_rect) {
 	glBindFramebuffer(GL_FRAMEBUFFER, storage->frame.current_rt->fbo); //back to front
 	glBindFramebuffer(GL_FRAMEBUFFER, storage->frame.current_rt->fbo); //back to front
 	glViewport(0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height);
 	glViewport(0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height);
 
 
-	state.canvas_shader.bind(); //back to canvas
-	_bind_canvas_texture(state.current_tex, state.current_normal);
+	// back to canvas, force rebind
+	state.using_texture_rect = true;
+	_set_texture_rect_mode(false);
 
 
-	if (state.using_texture_rect) {
-		state.using_texture_rect = false;
-		_set_texture_rect_mode(state.using_texture_rect, state.using_ninepatch);
-	}
+	_bind_canvas_texture(state.current_tex, state.current_normal);
 
 
 	glEnable(GL_BLEND);
 	glEnable(GL_BLEND);
 }
 }