keijiro / Kino

A collection of custom post processing effects for Unity
2.1k stars 149 forks source link

Streak effect missing alpha channel on LWRP&PPV2 #11

Closed phields closed 4 years ago

keijiro commented 4 years ago

Could you elaborate what you are trying to do? Kino only supports HDRP, so I think you can't do anything with it on LWRP.

phields commented 4 years ago

@keijiro Thanks for the reply, I'm trying to stream the alpha frames with spout2 But I lose the alpha channel info when I enable the Streak effect. 微信截图_20191209141726

keijiro commented 4 years ago

So, you're using an old version of Kino, right?

I think you can recover the original alpha by modifying the line 80 as follows:

return half4(cf + c3, SAMPLE_TEXTURE2D(_HighTex, sampler_HighTex, i.tecoord).a));
phields commented 4 years ago

@phields Thank you! It seems that the post-processing of the current HDRP/URP pipeline will automatically close the alpha channel... Whether you add effects or not. That's really bad for mixing video with NDI or spout.

keijiro commented 4 years ago

As far as I know, the most of the post-processing effects don't preserve alpha values -- It's "by design".

keijiro commented 4 years ago

In addition to that, HDRP doesn't preserve alpha while rendering. You have to use the AOV feature to capture the alpha channel values.

https://docs.unity3d.com/Packages/com.unity.aovrecorder@0.1/manual/index.html

keijiro commented 4 years ago

I'm closing this issue now as the problem is not actually relevant to this project. Please feel free to reopen it for further questions.

keijiro commented 4 years ago

@phields I can understand your frustration -- I know that it's important to preserve alpha channel when using an external compositing system. Actually, I'm frustrated with this problem sometimes too. I'd like to solve the problem or make a workaround for it, but at the moment, I don't have any good idea.