exeldro / obs-shaderfilter

OBS Studio filter for applying an arbitrary shader to a source.
GNU General Public License v2.0
377 stars 39 forks source link

The shader seems to have skip sampling behavior #28

Open Danjuanlab opened 9 months ago

Danjuanlab commented 9 months ago

I tried to use the obs shader plug-in to delete specific grayscale colors (adjust alpha=0) on a black and white masked image, but I found that the results were always unsatisfactory.

Later, I tried to use the code as shown below to test, and I found that the final result screen seemed to have a regular pixel skip sampling problem. In the black pixels, every other pixel will become transparent, but in the actual picture, there is no such color performance in the black parts.

This grayscale picture is from bmd ultimatte 12 chroma key matte out.

微信图片_20231118162544

微信图片_20231118162559 微信图片_20231118162605

微信图片_20231118162609

this is orignal frame 微信图片_20231118162616

micsthepick commented 8 months ago

can you see what happens if you use either of the following: return image.Sample(textureSampler, v_in).xyzx; or base = image.Sample(textureSampler, v_in); base.a = base.r > 0.5 ? 1.0 : 0.0

It seems as if your file doesn't have absolute black everywhere. perhaps it's dithered?