summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclayjohn <claynjohn@gmail.com>2022-12-14 15:41:43 -0800
committerclayjohn <claynjohn@gmail.com>2022-12-14 15:41:43 -0800
commit0c0e1a637e7537fa7487c9f4c57e3db4a88a3fb8 (patch)
tree1abc3d733d21d725abc6ff944b7ddf0dd15f5d3d
parentc22876e61c67614687e7f6dc79f98424d6df45a3 (diff)
Remove extra range conversion in Sprite3D normal encoding
-rw-r--r--scene/3d/sprite_3d.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp
index d69953fee5..e488ff3059 100644
--- a/scene/3d/sprite_3d.cpp
+++ b/scene/3d/sprite_3d.cpp
@@ -191,9 +191,7 @@ void SpriteBase3D::draw_texture_rect(Ref<Texture2D> p_texture, Rect2 p_dst_rect,
uint32_t v_normal;
{
- Vector3 n = normal * Vector3(0.5, 0.5, 0.5) + Vector3(0.5, 0.5, 0.5);
-
- Vector2 res = n.octahedron_encode();
+ Vector2 res = normal.octahedron_encode();
uint32_t value = 0;
value |= (uint16_t)CLAMP(res.x * 65535, 0, 65535);
value |= (uint16_t)CLAMP(res.y * 65535, 0, 65535) << 16;