LibSoftGPU: Prevent fog from overwriting the alpha channel

Fog only affects the RGB channels according to the spec.
This commit is contained in:
Jelle Raaijmakers 2021-12-30 00:32:17 +01:00 committed by Andreas Kling
parent f2d8fcb830
commit 9d90bab91b

View file

@ -742,8 +742,10 @@ void Device::submit_triangle(const Triangle& triangle, Vector<size_t> const& ena
break;
}
// Mix texel with fog
fragment = mix(m_options.fog_color, fragment, factor);
// Mix texel's RGB with fog's RBG - leave alpha alone
fragment.set_x(mix(m_options.fog_color.x(), fragment.x(), factor));
fragment.set_y(mix(m_options.fog_color.y(), fragment.y(), factor));
fragment.set_z(mix(m_options.fog_color.z(), fragment.z(), factor));
}
return fragment;