diff options
author | Juan Linietsky <reduzio@gmail.com> | 2019-01-16 00:37:00 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2019-01-16 00:37:00 -0300 |
commit | ffcb5cd18caecd29c207ed8edc8c55822f20c1d0 (patch) | |
tree | aad172b8c8de1f2aae40c2e508cd78ea4ec67b5c | |
parent | 96445cd90efc1fb24301fd1a85aea63c2c03cfec (diff) |
Ensure texture hints are obeyed, fixes #24875
-rw-r--r-- | drivers/gles2/rasterizer_canvas_gles2.cpp | 8 | ||||
-rw-r--r-- | drivers/gles2/rasterizer_scene_gles2.cpp | 18 |
2 files changed, 26 insertions, 0 deletions
diff --git a/drivers/gles2/rasterizer_canvas_gles2.cpp b/drivers/gles2/rasterizer_canvas_gles2.cpp index 14bd71c6eb..bbae3d3d22 100644 --- a/drivers/gles2/rasterizer_canvas_gles2.cpp +++ b/drivers/gles2/rasterizer_canvas_gles2.cpp @@ -1303,6 +1303,14 @@ void RasterizerCanvasGLES2::canvas_render_items(Item *p_item_list, int p_z, cons t = t->get_ptr(); +#ifdef TOOLS_ENABLED + if (t->detect_normal && texture_hints[i] == ShaderLanguage::ShaderNode::Uniform::HINT_NORMAL) { + t->detect_normal(t->detect_normal_ud); + } +#endif + if (t->render_target) + t->render_target->used_in_frame = true; + if (t->redraw_if_visible) { VisualServerRaster::redraw_request(); } diff --git a/drivers/gles2/rasterizer_scene_gles2.cpp b/drivers/gles2/rasterizer_scene_gles2.cpp index d9f1fe1212..e4783e907b 100644 --- a/drivers/gles2/rasterizer_scene_gles2.cpp +++ b/drivers/gles2/rasterizer_scene_gles2.cpp @@ -1245,6 +1245,24 @@ bool RasterizerSceneGLES2::_setup_material(RasterizerStorageGLES2::Material *p_m t = t->get_ptr(); + if (t->redraw_if_visible) { //must check before proxy because this is often used with proxies + VisualServerRaster::redraw_request(); + } + +#ifdef TOOLS_ENABLED + if (t->detect_3d) { + t->detect_3d(t->detect_3d_ud); + } +#endif + +#ifdef TOOLS_ENABLED + if (t->detect_normal && texture_hints[i] == ShaderLanguage::ShaderNode::Uniform::HINT_NORMAL) { + t->detect_normal(t->detect_normal_ud); + } +#endif + if (t->render_target) + t->render_target->used_in_frame = true; + glBindTexture(t->target, t->tex_id); if (i == 0) { state.current_main_tex = t->tex_id; |