Round primary color inputs in software rasterizer

OpenGL version coming soon.
This commit is contained in:
Dwayne Slater 2017-11-08 20:42:25 -05:00
parent d55a13c35d
commit dc48deaecc

View file

@ -293,18 +293,18 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve
};
Math::Vec4<u8> primary_color{
(u8)(
static_cast<u8>(round(
GetInterpolatedAttribute(v0.color.r(), v1.color.r(), v2.color.r()).ToFloat32() *
255),
(u8)(
255)),
static_cast<u8>(round(
GetInterpolatedAttribute(v0.color.g(), v1.color.g(), v2.color.g()).ToFloat32() *
255),
(u8)(
255)),
static_cast<u8>(round(
GetInterpolatedAttribute(v0.color.b(), v1.color.b(), v2.color.b()).ToFloat32() *
255),
(u8)(
255)),
static_cast<u8>(round(
GetInterpolatedAttribute(v0.color.a(), v1.color.a(), v2.color.a()).ToFloat32() *
255),
255)),
};
Math::Vec2<float24> uv[3];