From 2bfeb29bc61da242da5cb2a6775c857794d79b94 Mon Sep 17 00:00:00 2001 From: nklbdev Date: Sat, 1 Jul 2023 18:46:52 +0500 Subject: [PATCH] Potencially fix nan's on octahedral tangents in RenderingServer (cherry picked from commit 1d16704faf220bf9535c380450348dccf0fb2ca7) --- scene/3d/sprite_3d.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp index 9f7ff05924a..6e44696fe4d 100644 --- a/scene/3d/sprite_3d.cpp +++ b/scene/3d/sprite_3d.cpp @@ -647,11 +647,11 @@ SpriteBase3D::SpriteBase3D() { // Create basic mesh and store format information. for (int i = 0; i < 4; i++) { - mesh_normals.write[i] = Vector3(0.0, 0.0, 0.0); - mesh_tangents.write[i * 4 + 0] = 0.0; + mesh_normals.write[i] = Vector3(0.0, 0.0, 1.0); + mesh_tangents.write[i * 4 + 0] = 1.0; mesh_tangents.write[i * 4 + 1] = 0.0; mesh_tangents.write[i * 4 + 2] = 0.0; - mesh_tangents.write[i * 4 + 3] = 0.0; + mesh_tangents.write[i * 4 + 3] = 1.0; mesh_colors.write[i] = Color(1.0, 1.0, 1.0, 1.0); mesh_uvs.write[i] = Vector2(0.0, 0.0); mesh_vertices.write[i] = Vector3(0.0, 0.0, 0.0);