From c2138bdc873b979a111bb344ebb9937673bd3844 Mon Sep 17 00:00:00 2001 From: reduz Date: Fri, 11 Jun 2021 12:35:31 -0300 Subject: [PATCH] Fix tangent importing * Binormal compression was wrong. --- servers/rendering_server.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/servers/rendering_server.cpp b/servers/rendering_server.cpp index 0471990ed70..0c355512892 100644 --- a/servers/rendering_server.cpp +++ b/servers/rendering_server.cpp @@ -422,7 +422,9 @@ Error RenderingServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint value |= CLAMP(int((src[i * 4 + 0] * 0.5 + 0.5) * 1023.0), 0, 1023); value |= CLAMP(int((src[i * 4 + 1] * 0.5 + 0.5) * 1023.0), 0, 1023) << 10; value |= CLAMP(int((src[i * 4 + 2] * 0.5 + 0.5) * 1023.0), 0, 1023) << 20; - value |= CLAMP(int((src[i * 4 + 3] * 0.5 + 0.5) * 1023.0), 0, 1023) << 30; + if (src[i * 4 + 3] > 0) { + value |= 3 << 30; + } memcpy(&vw[p_offsets[ai] + i * p_vertex_stride], &value, 4); }