소스 검색

Remove extra range conversion in Sprite3D normal encoding

clayjohn 2 년 전
부모
커밋
0c0e1a637e
1개의 변경된 파일1개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 3
      scene/3d/sprite_3d.cpp

+ 1 - 3
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;