facebookarchive / 360-Capture-SDK

A developer focused sample SDK that allows game and virtual Reality devs to be able to easily and quickly integrate 360 photo/video capture capability into their game apps.
https://github.com/facebook/360-Capture-SDK
Other
253 stars 75 forks source link

360 degree capture and Flipped projection #56

Open phanindrawipro opened 5 years ago

phanindrawipro commented 5 years ago

Hi! We have integrated FBCapture in our VR application. We are facing an issue with 360 degree capture for our Billboarded objects in Unity scene. They seem to be flipped vertically in the screenshot and VoD. By Billboarded objects i mean objects always facing the camera. In our case they are just sprites created in Geometry shader. We use sign of _projectionparams.x (Unity built-in shader variable) to detect flipped projection and based on that we invert UVs of billboarded sprite vertically. Sprites in our scene look fine but when we capture it using FBCapture they are getting inverted in saved o/p file. Below are the pictures which illustrate the issue. We appreciate your help here!

original scene: originalscene FBCapture: fbcapture

grancia commented 5 years ago

Hi,

You can flip encoding texture in fbc_setVodCaptureSettings and fbc_setScreenshotSettings with verticalFlip and horizontalFlip params.

private static extern FBCAPTURE_STATUS fbc_setVodCaptureSettings( int width, int height, int frameRate, int bitRate, string fullSavePath, bool is360, bool verticalFlip, bool horizontalFlip, PROJECTION_TYPE projectionType, STEREO_MODE stereoMode);

private static extern FBCAPTURE_STATUS fbc_setScreenshotSettings( int width, int height, string fullSavePath, bool is360, bool verticalFlip, bool horizontalFlip);

phanindrawipro commented 5 years ago

Hi,

Thanks for the reply. Actually i tried changing vertical flip param as suggested. But it flips whole scene. Our scene consists of normal objects (Which preserves camera orientation) and Bill-boarded sprites (Which always face camera). Our issue is only with bill-boarded objects getting flipped upside down using FBCapture as shown in pictures above.

phanindrawipro commented 5 years ago

Hi,

Non-360degree capture mode works for Billboarded objects. It seems like issue is only with 360 degree capture mode.

vonengel3d commented 5 years ago

I assume it is another problem in the unity render to cubemap function.