From b588d1ab8d6e7f49f2d7818e3dd3892301b6ad4e Mon Sep 17 00:00:00 2001 From: kleonc <9283098+kleonc@users.noreply.github.com> Date: Tue, 10 Oct 2023 13:23:53 +0200 Subject: [PATCH] Fix incorrect vertex data size calculation in ImmediateMesh --- scene/resources/immediate_mesh.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/resources/immediate_mesh.cpp b/scene/resources/immediate_mesh.cpp index dbc74d7c87a..0112ffd4522 100644 --- a/scene/resources/immediate_mesh.cpp +++ b/scene/resources/immediate_mesh.cpp @@ -175,7 +175,7 @@ void ImmediateMesh::surface_end() { AABB aabb; { - surface_vertex_create_cache.resize(vertex_stride * vertices.size()); + surface_vertex_create_cache.resize((vertex_stride + normal_tangent_stride) * vertices.size()); uint8_t *surface_vertex_ptr = surface_vertex_create_cache.ptrw(); for (uint32_t i = 0; i < vertices.size(); i++) { {