This pertains to the BlendingMethod option SrgbOff for an OBS source.
When SrgbOff is enabled for an OBS source, it skips pre-multiplication, which involves multiplying the RGB values with the alpha channel (default background is black). However, after applying the shader filter, the pre-multiplication is reintroduced. To address this, I used a "pre-division function" to offset the pre-multiplication, which worked as expected.
To implement this, include the following function outside the image.Sample():
The code should be written as follows: fix_alpha(image.Sample(...)).
Regardless of whether BlendingMethod is set to SrgbOff or Normal, the filter will work as expected.
This pertains to the BlendingMethod option
SrgbOff
for an OBS source.When
SrgbOff
is enabled for an OBS source, it skips pre-multiplication, which involves multiplying the RGB values with the alpha channel (default background is black). However, after applying the shader filter, the pre-multiplication is reintroduced. To address this, I used a "pre-division function" to offset the pre-multiplication, which worked as expected.To implement this, include the following function outside the
image.Sample()
:The code should be written as follows:
fix_alpha(image.Sample(...))
. Regardless of whetherBlendingMethod
is set toSrgbOff
orNormal
, the filter will work as expected.