From c858dbdc4e4f316148fbd63184d8a8c5a25ce279 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 26 Dec 2017 15:56:18 -0300 Subject: [PATCH] Fixed proper texture binding for sprite material, fixes #13987 --- drivers/gles3/rasterizer_canvas_gles3.cpp | 2 +- drivers/gles3/rasterizer_scene_gles3.cpp | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp index 8d22a0e0725..86415ea7409 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.cpp +++ b/drivers/gles3/rasterizer_canvas_gles3.cpp @@ -1150,7 +1150,7 @@ void RasterizerCanvasGLES3::canvas_render_items(Item *p_item_list, int p_z, cons glBindTexture(t->target, t->tex_id); } - } else if (!shader_ptr) { + } else { state.canvas_shader.set_custom_shader(0); state.canvas_shader.bind(); } diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index b777f9343a4..1c3361d2dec 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -1541,7 +1541,19 @@ void RasterizerSceneGLES3::_render_geometry(RenderList::Element *e) { if (c.texture.is_valid() && storage->texture_owner.owns(c.texture)) { - const RasterizerStorageGLES3::Texture *t = storage->texture_owner.get(c.texture); + RasterizerStorageGLES3::Texture *t = storage->texture_owner.get(c.texture); + + t = t->get_ptr(); //resolve for proxies +#ifdef TOOLS_ENABLED + if (t->detect_3d) { + t->detect_3d(t->detect_3d_ud); + } +#endif + + if (t->render_target) { + t->render_target->used_in_frame = true; + } + glActiveTexture(GL_TEXTURE0); glBindTexture(t->target, t->tex_id); restore_tex = true;