Off-World-Live / obs-spout2-plugin

A Plugin for OBS Studio to enable Spout2 (https://github.com/leadedge/Spout2) input / output
https://knowledge.offworld.live/en/spout-plugin-for-obs-studio
GNU General Public License v2.0
523 stars 49 forks source link

Implement correctly blended premultiplied alpha #39

Closed emilianavt closed 2 years ago

emilianavt commented 2 years ago

This PR implements the new blending option for premultiplied alpha described in issue #38. It renames the old option to "Converted Premultiplied Alpha (legacy)" and adds a new option "Premultiplied Alpha". I wasn't able to update the Chinese string table, so that still needs to be done.

Here's an example of the difference. Premultiplied alpha source sent from Unity:

Source

Converted premultiplied alpha gets desaturated under certain circumstances, with part of the yellow particles turning white:

Legacy

Using the correct blend settings, it is applied without desaturation:

New

campbellwmorgan commented 2 years ago

Thanks very much for this! We'll send this through QA to test it out early next week and let you know, but looks very promising. Thanks again