Hi All,
I've had an attempt at implementing blending modes for sources, which has been previously requested in these two threads:
I've implemented it in a way that makes use of the existing blending state set up for compositing a source texture onto the scene, so unfortunately it's not a 'plugin', but is effectively 'free' from a performance point of view (for sources that were already being rendered to their own texture). As such, I was somewhat limited to implementing blending modes which are representable by specific combinations of src/dst blend factors & blend ops - the list of implemented blending modes is:
Here are some examples (for comparison to the blending modes defined here: https://www.w3.org/TR/compositing/#blendingseparable):
So far I've only tested this on macOS, so I've been unable to test the d3d11 changes I've made. If anyone is willing to test, then I've put the changes here:
https://github.com/jw0z96/obs-studio/tree/source-blending-modes
If anyone has any advice for how these changes could be implemented as a plugin, rather than as changes to obs-studio's rendering backend, then I'm open to suggestions :)
Thanks!
I've had an attempt at implementing blending modes for sources, which has been previously requested in these two threads:
Blend modes for sources
I searched around the web and these forums a bit but couldn't find any mentions of this. Seems like something that might've been mentioned or requested before, but I don't see anything. For anyone who uses Photoshop, blend modes will probably be familiar. The wikipedia page for it explains it...
obsproject.com
Add blend modes for dynamic sources · OBS Studio Ideas and Suggestions
Adding this option will give a lot of new creative possibilities to OBS users. Although such an option already exists as an Image Mask Filter (it has
ideas.obsproject.com
I've implemented it in a way that makes use of the existing blending state set up for compositing a source texture onto the scene, so unfortunately it's not a 'plugin', but is effectively 'free' from a performance point of view (for sources that were already being rendered to their own texture). As such, I was somewhat limited to implementing blending modes which are representable by specific combinations of src/dst blend factors & blend ops - the list of implemented blending modes is:
- Normal
- Additive
- Subtractive
- Screen
- Multiply
- Lighten
- Darken (works incorrectly for transparent images - but a workaround could be to re-export the transparent image with a white background.)
Here are some examples (for comparison to the blending modes defined here: https://www.w3.org/TR/compositing/#blendingseparable):
So far I've only tested this on macOS, so I've been unable to test the d3d11 changes I've made. If anyone is willing to test, then I've put the changes here:
https://github.com/jw0z96/obs-studio/tree/source-blending-modes
If anyone has any advice for how these changes could be implemented as a plugin, rather than as changes to obs-studio's rendering backend, then I'm open to suggestions :)
Thanks!