From c54927a127a69a0073d30e7caa795f4bdda9e780 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 26 Dec 2017 15:13:00 -0300 Subject: Property apply shader parameters, even when materials are being reused, fixes #14012 --- drivers/gles3/rasterizer_canvas_gles3.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp index a4daa77b50..8d22a0e072 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.cpp +++ b/drivers/gles3/rasterizer_canvas_gles3.cpp @@ -1086,19 +1086,22 @@ void RasterizerCanvasGLES3::canvas_render_items(Item *p_item_list, int p_z, cons } } - if (shader_ptr && shader_ptr != shader_cache) { + if (shader_ptr) { if (shader_ptr->canvas_item.uses_screen_texture && !state.canvas_texscreen_used) { //copy if not copied before _copy_texscreen(Rect2()); } - if (shader_ptr->canvas_item.uses_time) { - VisualServerRaster::redraw_request(); - } + if (shader_ptr != shader_cache) { - state.canvas_shader.set_custom_shader(shader_ptr->custom_code_id); - state.canvas_shader.bind(); + if (shader_ptr->canvas_item.uses_time) { + VisualServerRaster::redraw_request(); + } + + state.canvas_shader.set_custom_shader(shader_ptr->custom_code_id); + state.canvas_shader.bind(); + } if (material_ptr->ubo_id) { glBindBufferBase(GL_UNIFORM_BUFFER, 2, material_ptr->ubo_id); -- cgit v1.2.3