From 7d53755ca70069602741761da46164e121cc1533 Mon Sep 17 00:00:00 2001 From: Duarte David Date: Thu, 23 Sep 2021 21:04:57 +0100 Subject: [PATCH] Fixes the normals of SphereMesh when the radius is different from 1 --- scene/resources/primitive_meshes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/resources/primitive_meshes.cpp b/scene/resources/primitive_meshes.cpp index 25eb7015962..f8be00f5fbe 100644 --- a/scene/resources/primitive_meshes.cpp +++ b/scene/resources/primitive_meshes.cpp @@ -1466,7 +1466,7 @@ void SphereMesh::_create_mesh_array(Array &p_arr) const { } else { Vector3 p = Vector3(x * radius * w, y, z * radius * w); points.push_back(p); - Vector3 normal = Vector3(x * radius * w * scale, y / scale, z * radius * w * scale); + Vector3 normal = Vector3(x * w * scale, radius * (y / scale), z * w * scale); normals.push_back(normal.normalized()); }; ADD_TANGENT(z, 0.0, -x, 1.0)