diff options
author | Bruno Lourenço <madequa@users.noreply.github.com> | 2019-12-23 18:40:48 +0000 |
---|---|---|
committer | Bruno Lourenço <madequa@users.noreply.github.com> | 2019-12-23 18:40:48 +0000 |
commit | 65195f505f353231b4f419dd5ee3b44cfdd66334 (patch) | |
tree | bbb1042ebe99628d26af050ee5887a348a2007e2 | |
parent | 22782d519c263febe0af94c7765fd79565c0f3ce (diff) |
Fix canvas GLES3 skeleton transform uniform updating.
-rw-r--r-- | drivers/gles3/rasterizer_canvas_gles3.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp index 1803a3dbbe..f5569490ad 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.cpp +++ b/drivers/gles3/rasterizer_canvas_gles3.cpp @@ -1416,8 +1416,6 @@ void RasterizerCanvasGLES3::canvas_render_items(Item *p_item_list, int p_z, cons glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 1); glBindTexture(GL_TEXTURE_2D, skeleton->texture); state.using_skeleton = true; - state.canvas_shader.set_uniform(CanvasShaderGLES3::SKELETON_TRANSFORM, state.skeleton_transform); - state.canvas_shader.set_uniform(CanvasShaderGLES3::SKELETON_TRANSFORM_INVERSE, state.skeleton_transform_inverse); } else { state.using_skeleton = false; } @@ -1604,6 +1602,11 @@ void RasterizerCanvasGLES3::canvas_render_items(Item *p_item_list, int p_z, cons state.final_transform = ci->final_transform; state.extra_matrix = Transform2D(); + if (state.using_skeleton) { + state.canvas_shader.set_uniform(CanvasShaderGLES3::SKELETON_TRANSFORM, state.skeleton_transform); + state.canvas_shader.set_uniform(CanvasShaderGLES3::SKELETON_TRANSFORM_INVERSE, state.skeleton_transform_inverse); + } + state.canvas_shader.set_uniform(CanvasShaderGLES3::FINAL_MODULATE, state.canvas_item_modulate); state.canvas_shader.set_uniform(CanvasShaderGLES3::MODELVIEW_MATRIX, state.final_transform); state.canvas_shader.set_uniform(CanvasShaderGLES3::EXTRA_MATRIX, state.extra_matrix); |