summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar wwylele2017-08-02 22:05:53 +0300
committerGravatar wwylele2017-08-02 22:05:53 +0300
commitc59ed47608367de8cd5e4e6d58da02dee30810a9 (patch)
tree428ec6fda3e5ab79f14e4440f1392ff0d5d1bb5f /src
parentSwRasterizer/Lighting: dist atten lut input need to be clamp (diff)
downloadyuzu-c59ed47608367de8cd5e4e6d58da02dee30810a9.tar.gz
yuzu-c59ed47608367de8cd5e4e6d58da02dee30810a9.tar.xz
yuzu-c59ed47608367de8cd5e4e6d58da02dee30810a9.zip
SwRasterizer/Lighting: move quaternion normalization to the caller
Diffstat (limited to 'src')
-rw-r--r--src/video_core/swrasterizer/rasterizer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/video_core/swrasterizer/rasterizer.cpp b/src/video_core/swrasterizer/rasterizer.cpp
index 37d1313cf..80ecf72ec 100644
--- a/src/video_core/swrasterizer/rasterizer.cpp
+++ b/src/video_core/swrasterizer/rasterizer.cpp
@@ -141,7 +141,7 @@ std::tuple<Math::Vec4<u8>, Math::Vec4<u8>> ComputeFragmentsColors(
141 } 141 }
142 142
143 // Use the normalized the quaternion when performing the rotation 143 // Use the normalized the quaternion when performing the rotation
144 auto normal = Math::QuaternionRotate(normquat.Normalized(), surface_normal); 144 auto normal = Math::QuaternionRotate(normquat, surface_normal);
145 145
146 Math::Vec4<float> diffuse_sum = {0.0f, 0.0f, 0.0f, 1.0f}; 146 Math::Vec4<float> diffuse_sum = {0.0f, 0.0f, 0.0f, 1.0f};
147 Math::Vec4<float> specular_sum = {0.0f, 0.0f, 0.0f, 1.0f}; 147 Math::Vec4<float> specular_sum = {0.0f, 0.0f, 0.0f, 1.0f};
@@ -664,12 +664,12 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve
664 Math::Vec4<u8> secondary_fragment_color = {0, 0, 0, 0}; 664 Math::Vec4<u8> secondary_fragment_color = {0, 0, 0, 0};
665 665
666 if (!g_state.regs.lighting.disable) { 666 if (!g_state.regs.lighting.disable) {
667 Math::Quaternion<float> normquat{ 667 Math::Quaternion<float> normquat = Math::Quaternion<float>{
668 {GetInterpolatedAttribute(v0.quat.x, v1.quat.x, v2.quat.x).ToFloat32(), 668 {GetInterpolatedAttribute(v0.quat.x, v1.quat.x, v2.quat.x).ToFloat32(),
669 GetInterpolatedAttribute(v0.quat.y, v1.quat.y, v2.quat.y).ToFloat32(), 669 GetInterpolatedAttribute(v0.quat.y, v1.quat.y, v2.quat.y).ToFloat32(),
670 GetInterpolatedAttribute(v0.quat.z, v1.quat.z, v2.quat.z).ToFloat32()}, 670 GetInterpolatedAttribute(v0.quat.z, v1.quat.z, v2.quat.z).ToFloat32()},
671 GetInterpolatedAttribute(v0.quat.w, v1.quat.w, v2.quat.w).ToFloat32(), 671 GetInterpolatedAttribute(v0.quat.w, v1.quat.w, v2.quat.w).ToFloat32(),
672 }; 672 }.Normalized();
673 673
674 Math::Vec3<float> view{ 674 Math::Vec3<float> view{
675 GetInterpolatedAttribute(v0.view.x, v1.view.x, v2.view.x).ToFloat32(), 675 GetInterpolatedAttribute(v0.view.x, v1.view.x, v2.view.x).ToFloat32(),