360° Screenshot Capture [Open Source]

Hello there!

Here’s a simple script that captures a 360° photo with your Unity camera and injects the necessary XMP metadata to it; so the output image supports 360° viewers on the web out-of-the-box (like Facebook and Flickr). Both JPEG and PNG formats are supported.

Asset Store: 360° Screenshot Capture | Camera | Unity Asset Store
Also available at: GitHub - yasirkula/Unity360ScreenshotCapture: A simple script to capture 360° screenshots in-game with Unity
Discord: yasirkula Unity Assets
GitHub Sponsors :coffee:

The raw image is in equirectangular form. Here is an example screenshot (it looks like this when uploaded to Flickr):

The details are available at the repo (with example code).

FAQ

  • Objects are rendered inside out in the 360° screenshot

This is usually caused by 3rd-party plugins that change the value of GL.invertCulling (e.g. mirrors). See the solution: 360° Screenshot Capture [Open Source] - Community Showcases - Unity Discussions

Enjoy!

1 Like

Now available on Asset Store!

2 Likes

Hi, I create a playmaker action that works in conjunction with your package. Basically it triggers your code from within playmaker. Of course, opensource: GitHub - ericvanderwal/Unity-360-Screenshot-Capture: Playmaker actions for the opensource Unity 360 screen capture package

1 Like

That’s really cool! Thank you for creating this extension :slight_smile:

1 Like

I installed this plugin yesterday. It 's very cool and it works fine.

1 Like

Installed and tried it out. After turning off motion blur (which messes up your screen capture), unfortunately the shot has taken every single polygon and turned them inside out. :frowning:

Can you check this out: Cubemaps rendering inside out.
And this: RenderToCubemap rendering backfaces only?

Tried that. Only slightly better.

I’m simply calling Unity’s RenderToCubemap function to render the 360 image. I’m afraid I’ve no control over the internal rendering process.

hey where does the 360 screenshot get saved to?

Example code saves it to Application.persistentDataPath and logs the path to the console: GitHub - yasirkula/Unity360ScreenshotCapture: A simple script to capture 360° screenshots in-game with Unity. Otherwise, the function returns a byte[ ] object, you can save it to anywhere you like via File.WriteAllBytes.

Can you please tell me how should i render the image in a sphere properly

Here’s the image that i captured from my android phone i tried to render it in 360 but it’s not coming properly

You can render equirectangular images using one of these shaders:

However, your image doesn’t look like it is in equirectangular form, I don’t know how you can render it in Unity. Maybe try importing it to Unity and then changing the Texture Shape property to Cube?

I did that but images is

I captured this image using ARFoundation Camera from my mobile device i think that’s the problem is there any way i can capture the panorama image from my mobile camera

I have no experience with 360 image capture using device’s camera, so I can’t help with that. My plugin captures in-game 360 image using in-game Camera.

Can we capture a panorama image from your native camera plugin?

If the native camera app supports panorama capture, you should be but there is no parameter to force the camera to capture a panorama image. So users would probably have to switch to panorama mode manually once the camera is opened.

Hello, great asset thanks! I’m having an issue when taking many screenshots one after the other. What i’m doing is that i’m moving the camera and taking screenshots, let’s say 1000 pictures. The problem is that my RAM memory explodes and I can’t see why this is happening. Do you have any suggestion? Thanks

Plugin destroys the temporary textures after capturing a screenshot, so AFAIK, it shouldn’t leak any memory. Are you keeping a reference to the returned byte[ ] objects or maybe converting them to textures but not destroying these textures?