From 833c93bd989dc71e1b5d4d27e1e81b44a673ef16 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Mon, 17 Mar 2014 12:53:49 -0700 Subject: [PATCH] Dumb mistake, forgot the divide. Probably caused the blending issues. --- GPU/Math3D.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/GPU/Math3D.cpp b/GPU/Math3D.cpp index 5c763accc..abacd62f9 100644 --- a/GPU/Math3D.cpp +++ b/GPU/Math3D.cpp @@ -73,7 +73,7 @@ Vec3 Vec3::FromRGB(unsigned int rgb) __m128i z = _mm_setzero_si128(); __m128i c = _mm_cvtsi32_si128(rgb); c = _mm_unpacklo_epi16(_mm_unpacklo_epi8(c, z), z); - return Vec3(_mm_cvtepi32_ps(c)); + return Vec3(_mm_mul_ps(_mm_cvtepi32_ps(c), _mm_set_ps1(1.0f / 255.0f))); #else return Vec3((rgb & 0xFF) * (1.0f/255.0f), ((rgb >> 8) & 0xFF) * (1.0f/255.0f), @@ -240,7 +240,7 @@ Vec4 Vec4::FromRGBA(unsigned int rgba) __m128i z = _mm_setzero_si128(); __m128i c = _mm_cvtsi32_si128(rgba); c = _mm_unpacklo_epi16(_mm_unpacklo_epi8(c, z), z); - return Vec4(_mm_cvtepi32_ps(c)); + return Vec4(_mm_mul_ps(_mm_cvtepi32_ps(c), _mm_set_ps1(1.0f / 255.0f))); #else return Vec4((rgba & 0xFF) * (1.0f/255.0f), ((rgba >> 8) & 0xFF) * (1.0f/255.0f), @@ -335,4 +335,4 @@ float Vec4::Normalize() return len; } -}; // namespace Math3D \ No newline at end of file +}; // namespace Math3D