diff options
| author | 2015-01-02 01:01:06 +0100 | |
|---|---|---|
| committer | 2015-02-18 14:50:28 +0100 | |
| commit | 3cb22d31a71ce1f0103b075cfc2533aaebff9ace (patch) | |
| tree | d672ab96286720206ccea99b0418dc4f1b846d37 /src/video_core/rasterizer.cpp | |
| parent | Pica/Rasterizer: Clean up and fix backface culling. (diff) | |
| download | yuzu-3cb22d31a71ce1f0103b075cfc2533aaebff9ace.tar.gz yuzu-3cb22d31a71ce1f0103b075cfc2533aaebff9ace.tar.xz yuzu-3cb22d31a71ce1f0103b075cfc2533aaebff9ace.zip | |
Pica/Rasterizer: Fix garbage pixels at triangle borders.
Diffstat (limited to 'src/video_core/rasterizer.cpp')
| -rw-r--r-- | src/video_core/rasterizer.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/video_core/rasterizer.cpp b/src/video_core/rasterizer.cpp index 5769bd81e..74182abef 100644 --- a/src/video_core/rasterizer.cpp +++ b/src/video_core/rasterizer.cpp | |||
| @@ -101,7 +101,9 @@ static void ProcessTriangleInternal(const VertexShader::OutputVertex& v0, | |||
| 101 | { | 101 | { |
| 102 | // vertex positions in rasterizer coordinates | 102 | // vertex positions in rasterizer coordinates |
| 103 | auto FloatToFix = [](float24 flt) { | 103 | auto FloatToFix = [](float24 flt) { |
| 104 | return Fix12P4(static_cast<unsigned short>(flt.ToFloat32() * 16.0f)); | 104 | // TODO: Rounding here is necessary to prevent garbage pixels at |
| 105 | // triangle borders. Is it that the correct solution, though? | ||
| 106 | return Fix12P4(static_cast<unsigned short>(round(flt.ToFloat32() * 16.0f))); | ||
| 105 | }; | 107 | }; |
| 106 | auto ScreenToRasterizerCoordinates = [FloatToFix](const Math::Vec3<float24> vec) { | 108 | auto ScreenToRasterizerCoordinates = [FloatToFix](const Math::Vec3<float24> vec) { |
| 107 | return Math::Vec3<Fix12P4>{FloatToFix(vec.x), FloatToFix(vec.y), FloatToFix(vec.z)}; | 109 | return Math::Vec3<Fix12P4>{FloatToFix(vec.x), FloatToFix(vec.y), FloatToFix(vec.z)}; |