summaryrefslogtreecommitdiff
path: root/servers/rendering
diff options
context:
space:
mode:
authorAnilforextra <anilforextra@gmail.com>2021-09-23 20:43:43 +0545
committerAnilforextra <anilforextra@gmail.com>2021-09-23 22:26:07 +0545
commitcc51b045da4bf40722d347c6306b2764a1c9d813 (patch)
tree96323b3b6cd43dbbec3a74a9c09762c911e9dc32 /servers/rendering
parent2ec1152b0fda21f2050b30e49630659697a5e68b (diff)
Construct values only when necessary.
Diffstat (limited to 'servers/rendering')
-rw-r--r--servers/rendering/renderer_canvas_cull.cpp2
-rw-r--r--servers/rendering/renderer_rd/renderer_scene_render_rd.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/servers/rendering/renderer_canvas_cull.cpp b/servers/rendering/renderer_canvas_cull.cpp
index efa3a457d3..456c736731 100644
--- a/servers/rendering/renderer_canvas_cull.cpp
+++ b/servers/rendering/renderer_canvas_cull.cpp
@@ -182,7 +182,7 @@ void RendererCanvasCull::_attach_canvas_item_for_draw(RendererCanvasCull::Item *
if (ci->commands != nullptr) {
ci->final_transform = xform;
- ci->final_modulate = Color(modulate.r * ci->self_modulate.r, modulate.g * ci->self_modulate.g, modulate.b * ci->self_modulate.b, modulate.a * ci->self_modulate.a);
+ ci->final_modulate = modulate * ci->self_modulate;
ci->global_rect_cache = global_rect;
ci->global_rect_cache.position -= p_clip_rect.position;
ci->light_masked = false;
diff --git a/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp b/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp
index fa66ed85a9..8e31ec1d8b 100644
--- a/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp
+++ b/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp
@@ -3365,7 +3365,7 @@ void RendererSceneRenderRD::_setup_decals(const PagedArray<RID> &p_decals, const
Vector3 decal_extents = storage->decal_get_extents(decal);
Transform3D scale_xform;
- scale_xform.basis.scale(Vector3(decal_extents.x, decal_extents.y, decal_extents.z));
+ scale_xform.basis.scale(decal_extents);
Transform3D to_decal_xform = (p_camera_inverse_xform * di->transform * scale_xform * uv_xform).affine_inverse();
RendererStorageRD::store_transform(to_decal_xform, dd.xform);