schellingb / UnityCapture

Streams Unity rendered output to other Windows applications as virtual capture device
430 stars 68 forks source link

alpha channel with post-processing #4

Open BASHMIX opened 5 years ago

BASHMIX commented 5 years ago

I have problems when using any of post-processing V2 effects (Ao, Bloom, DOF, Motion blur) and capturing with Alpha channel, I believe its caused by the post-processing shaders. so can I choose when to export alpha for each camera and when not? and Thanks for this Awesome plugin 👍

schellingb commented 5 years ago

Hi there Not exporting alpha is not that simlpe because the rendered camera image always has 4 channels (including alpha) no matter what. So "not exporting alpha" would actually mean filling the alpha channel with 255 at some point in the image transfer. It would be much easier to set the background color of your camera with alpha = 255. Is that not possible for you? Also, what problems are you seeing? A quick test here with Unity 2018.2 and Post-processing 2.0.1.7 makes the effects you listed look decent even with alpha tracking (with camera background color set to 0,0,0,0).

BASHMIX commented 5 years ago

capture1 thank you for your replay, the image attached shows the problem I talk about in OBS I use the video format ARGB because I am using the same source for multiple unity cameras in the scene that some of them needs an alpha channel, in the image attached you can see the OBS background layer visible in shadow areas of the post-processing effects (Ao, DOF) - for this camera I have the background color to 0,0,0,0 and I am using Unity 2018.2 and pp ver 2.0.17. thanks in Advance

BASHMIX commented 5 years ago

however, I found a solution by using a second capture device for the the none-alpha camera and disable alpha in OBS and thank you again for this amazing plugin