From 5604071bb480285bcc983555c13cace4586f1441 Mon Sep 17 00:00:00 2001 From: Relintai Date: Mon, 11 Mar 2024 12:45:36 +0100 Subject: [PATCH] Fix 2d mesh transforms and colors. --- drivers/gles2/rasterizer_canvas_gles2.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gles2/rasterizer_canvas_gles2.cpp b/drivers/gles2/rasterizer_canvas_gles2.cpp index 2ca5e562d..7b66771a4 100644 --- a/drivers/gles2/rasterizer_canvas_gles2.cpp +++ b/drivers/gles2/rasterizer_canvas_gles2.cpp @@ -874,6 +874,9 @@ void RasterizerCanvasGLES2::render_batches(Item *p_current_clip, bool &r_reclip, Size2 texpixel_size(1.0 / texture->width, 1.0 / texture->height); state.canvas_shader.set_uniform(CanvasShaderGLES2::COLOR_TEXPIXEL_SIZE, texpixel_size); } + + state.canvas_shader.set_uniform(CanvasShaderGLES2::MODELVIEW_MATRIX, state.uniforms.modelview_matrix * mesh->transform); + state.canvas_shader.set_uniform(CanvasShaderGLES2::FINAL_MODULATE, state.uniforms.final_modulate * mesh->modulate); RasterizerStorageGLES2::Mesh *mesh_data = storage->mesh_owner.getornull(mesh->mesh); if (mesh_data) { @@ -918,6 +921,9 @@ void RasterizerCanvasGLES2::render_batches(Item *p_current_clip, bool &r_reclip, glDisableVertexAttribArray(j); } } + + state.canvas_shader.set_uniform(CanvasShaderGLES2::MODELVIEW_MATRIX, state.uniforms.modelview_matrix); + state.canvas_shader.set_uniform(CanvasShaderGLES2::FINAL_MODULATE, state.uniforms.final_modulate); storage->info.render._2d_draw_call_count++; } break;