googlevr / gvr-ios-sdk

Google VR SDK for iOS
http://developers.google.com/vr/ios/
Other
645 stars 191 forks source link

Transparency in GVRVideoRenderer #323

Open Oliver-Binns opened 6 years ago

Oliver-Binns commented 6 years ago

I need to implement transparency in GVRVideoRenderer. The use case for this is playing a video over a 360° photo background to give a VR effect.

I have used Chroma Key blending with an input and mask image to implement the transparency in AVPlayerItem:

let filter = AlphaFrameFilter()   
filter.inputImage = request.sourceImage.cropped(to: sourceRect)     
filter.maskImage = request.sourceImage.cropped(to: alphaRect).transformed(by: transform)

Unfortunately, when passing this into GVRVideoRenderer, the view still has a black background.

image

How can I fix this?