mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 10:22:05 -05:00
LibSoftGPU: Prevent fog from overwriting the alpha channel
Fog only affects the RGB channels according to the spec.
This commit is contained in:
parent
f2d8fcb830
commit
9d90bab91b
1 changed files with 4 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue