mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2024-12-25 01:11:48 +01:00
Pica/Rasterizer: Fix garbage pixels at triangle borders.
This commit is contained in:
parent
638b370fb5
commit
3cb22d31a7
@ -101,7 +101,9 @@ static void ProcessTriangleInternal(const VertexShader::OutputVertex& v0,
|
|||||||
{
|
{
|
||||||
// vertex positions in rasterizer coordinates
|
// vertex positions in rasterizer coordinates
|
||||||
auto FloatToFix = [](float24 flt) {
|
auto FloatToFix = [](float24 flt) {
|
||||||
return Fix12P4(static_cast<unsigned short>(flt.ToFloat32() * 16.0f));
|
// TODO: Rounding here is necessary to prevent garbage pixels at
|
||||||
|
// triangle borders. Is it that the correct solution, though?
|
||||||
|
return Fix12P4(static_cast<unsigned short>(round(flt.ToFloat32() * 16.0f)));
|
||||||
};
|
};
|
||||||
auto ScreenToRasterizerCoordinates = [FloatToFix](const Math::Vec3<float24> vec) {
|
auto ScreenToRasterizerCoordinates = [FloatToFix](const Math::Vec3<float24> vec) {
|
||||||
return Math::Vec3<Fix12P4>{FloatToFix(vec.x), FloatToFix(vec.y), FloatToFix(vec.z)};
|
return Math::Vec3<Fix12P4>{FloatToFix(vec.x), FloatToFix(vec.y), FloatToFix(vec.z)};
|
||||||
|
Loading…
Reference in New Issue
Block a user