From e6f55a532ae54241098f6a11cd309dd6ae68f452 Mon Sep 17 00:00:00 2001 From: clayjohn Date: Tue, 30 Apr 2024 12:14:49 -0700 Subject: [PATCH] Enable tangents in blend shape format when using normals --- servers/rendering_server.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/servers/rendering_server.cpp b/servers/rendering_server.cpp index bbe6b1ad0da..47992db51f3 100644 --- a/servers/rendering_server.cpp +++ b/servers/rendering_server.cpp @@ -1226,6 +1226,10 @@ Error RenderingServer::mesh_create_surface_data_from_arrays(SurfaceData *r_surfa bsformat |= (1 << j); } } + if (bsformat & RS::ARRAY_FORMAT_NORMAL) { + // We must use tangents if using normals. + bsformat |= RS::ARRAY_FORMAT_TANGENT; + } ERR_FAIL_COND_V_MSG(bsformat != (format & RS::ARRAY_FORMAT_BLEND_SHAPE_MASK), ERR_INVALID_PARAMETER, "Blend shape format must match the main array format for Vertex, Normal and Tangent arrays."); }