Jump to content

Recording 360º video in Unity


Guest

Recommended Posts

I am well aware that there is an asset for Unity which allows for the creation of 360º videos, however I am also interested in making a KSP mod which does so as well, meaning I could not use said asset.  Does anyone here know anything about rendering a 360º video in Unity, possibly from cube maps?

Edited by Guest
Link to comment
Share on other sites

I used to shoot and stitch Quicktime panoramas together about 20 years ago.  I actually shot the panos vertically with respect to the horizon, so that resultant stitched cylinders allowed greater up and down panning and zooming.  However that didn't allow for coverage of true up and down views without use of non-integral images or some ugly placeholders or color blanks.  But now onto your topic:

You might be onto something with cube maps, since these are similar to skyboxes I've made, and are still used in many video games.

Check out different software.  You have cylinders, cubes and spheres for your mapping.  Some of these require proprietary hardware, but others do not.  Some are free, and some are sure not.  As you know, it may depend on what platform you use too.

I'd suggest some solutions, but its been a while since I've kept up with that stuff, so you'd probably be better off using your favorite search engine and comparing the most promising results.

I'd be curious as to what you find and decide on.

Edit:  when I say hardware, this might entail dongles (now USB thumb drives) or such.  But I would think Unity would give you the freedom you need to record with multiple in game "cameras" and settings.  Some software or assets should be simple and not require you to manually set them up, but others may require that you do so.  Some older games (or engines) do not allow you full camera freedom (cylinder mapping).  As to Unity specifically, it might even depend on the version.  The more "cameras" you set up or include, the more hard drive space the recording will require, I think.

Edit Edit:  That "asset" you linked to looks very promising.  Stereo (3D) video recording implies a lot of computational and drive space.  I see that the audio may still be a challenge but hey, you can always dub that.  Good luck!

PS- here is a 360VR on You Tube.  From "The Expanse":

You can kinda see how it is mapped when you use a browser which does not support 360VR videos, such as Safari.  You can see the intended results by using a browser such as Firefox.

Edited by Dispatcher
Link to comment
Share on other sites

9 hours ago, Dispatcher said:

<snip>

Thanks!  I'm still looking around at some possible ideas.  I'm considering outputting every frame as a cube map and then converting it into the equirectangular projection pixel by pixel and finally exporting images to an output folder.  It's very hockey, but it could potentially work for what I'm looking for.  Another option would be to do that without exporting it and instead adding it to a material and displaying it on screen for recording.  I've come across a few different things which have proven to be very useful:

http://hugin.sourceforge.net/docs/manual/Equirectangular_Projection.html

http://hugin.sourceforge.net/docs/manual/Cubic_Projection.html

http://stackoverflow.com/questions/11504584/cubic-to-equirectangular-projection-algorithm

And importantly this:

http://hugin.sourceforge.net

9 hours ago, Dispatcher said:

You can kinda see how it is mapped when you use a browser which does not support 360VR videos, such as Safari.  You can see the intended results by using a browser such as Firefox.

That is exactly what I've been doing. :) 

Link to comment
Share on other sites

I figure you'd just need to save out the Unity final frame buffer as a cubemap, or convert to equirectangular before saving. conversion to video could be done as a unity/ksp plugin; or in some standard video editor. 

https://docs.unity3d.com/ScriptReference/Camera.RenderToCubemap.html; I'd check TRReplacer or Reflection Shader plugin for code references too.

Link to comment
Share on other sites

1 hour ago, nli2work said:

I figure you'd just need to save out the Unity final frame buffer as a cubemap, or convert to equirectangular before saving. conversion to video could be done as a unity/ksp plugin; or in some standard video editor. 

https://docs.unity3d.com/ScriptReference/Camera.RenderToCubemap.html; I'd check TRReplacer or Reflection Shader plugin for code references too.

I have played around with RenderToCubemap.  That has been the most promising so far.  I'd love it if YouTube would accept cubemap videos...

Link to comment
Share on other sites

if you are able to get cubemap frame sequence from a camera in KSP, the rest is just a matter of converting cubemap to lat/long map. then convert the frame sequence to a video, inject the youtube metadata for 360 video and upload. Youtube only takes lat/long probably because that format is more common with cameras.

http://alexcpeterson.com/2015/08/25/converting-a-cube-map-to-a-sphericalequirectangular-map/

Edited by nli2work
Link to comment
Share on other sites

30 minutes ago, nli2work said:

if you are able to get cubemap frame sequence from a camera in KSP, the rest is just a matter of converting cubemap to lat/long map. then convert the frame sequence to a video, inject the youtube metadata for 360 video and upload. Youtube only takes lat/long probably because that format is more common with cameras.

http://alexcpeterson.com/2015/08/25/converting-a-cube-map-to-a-sphericalequirectangular-map/

You, sir, are awesome. :wink: 

Link to comment
Share on other sites

1 hour ago, nli2work said:

I don't know the specifics unfortunately. :/

No worries.  I'll take a look at this more tomorrow.  Maybe having a fresh mind will do me good. :) 

Link to comment
Share on other sites

Very impressive stuff!  From what I'm seeing, if you do not intend to do any image editing of frames, it would be best to capture/ convert to equirectangular mapping for posting on You Tube.  However, if you intend to edit with a still or a video image editor, you will find it easier to edit cube maps prior to converting.  By editing I mean using clone tools or something like that.  Of course for just doing special effects with lighting or style tools, there is no need for cube mapping.  But if all you are doing is capturing KSP video and adding title or credit text, there really is no need for image editing per se.  You'll want to do cut and transition edits but that really should not hurt your content.

I wonder if "competing" video sharing services other than You Tube support other mapping formats?  Like Vimeo or such.  Of course, for maximum exposure, you need to fit with You Tube.

Whatever approach you select, I'm sure you'll come up with some good results.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...