chunky-dev / chunky

A path tracer to create realistic images of your Minecraft worlds.
https://chunky-dev.github.io/docs
GNU General Public License v3.0
654 stars 77 forks source link

Creating Photospheres #278

Closed ubenzer closed 10 years ago

ubenzer commented 10 years ago

I tried creating photospheres through Chunky using equirectangular projection, but I was unable to generate 360 degree photography. For example, I don't know what field of depth should I use.

What I want to do is, I want to take a 360 degree photo which I can view it as a photosphere on Google+ or my phone etc.

Is it possibble to add a guide or a preset for this?

I think once I create a 360 degree photograph, then I can add required metadata using this web site:

http://photo-sphere.appspot.com/

llbit commented 10 years ago

To create a photosphere you need an eqirectangular sky map. This can be created in chunky by following these steps:

  1. Set up you scene as usual (load some chunks from the world you want to render)
  2. Go to the Camera tab in the Render Controls window
  3. Enter -90 into the second text field of the Direction values
  4. Select Projection: Panoramic (equirectangular)
  5. Set the field of view to 180 (max out the slider)
  6. Go to the General tab in the Render Controls window
  7. You must set the canvas width to be twice of the canvas height. Do this by entering for example 800x400 in the canvas size text field and hit Enter

The result should look something like this:

create_skymap

custom_sky_map

I was not able to complete the photosphere creation on that google page, but the rendered image should be compatible. Equirectangular panoramic projection is the most common such panorama format for full 360x180 panoramas.

ubenzer commented 10 years ago

Thanks!

For anyone that is interested:

To make it appear as a photosphere in Google+ and Android you need to add proper exif data. You can do this using exiftool:

exiftool -xmp:ProjectionType=equirectangular -xmp:CroppedAreaImageWidthPixels=4000 -xmp:CroppedAreaImageHeightPixels=2000 -xmp:FullPanoWidthPixels=4000 -xmp:FullPanoHeightPixels=2000 -xmp:CroppedAreaLeftPixels=0 -xmp:CroppedAreaTopPixels=0 -xmp:UsePanoramaViewer=True filename.png

Replace 4000 and 2000 with your width and height.

llbit commented 10 years ago

Oh, cool! Tested it now and it works nicely. Seems like you need quite a high resolution to get a nice photo sphere.

llbit commented 10 years ago

I rewrote the PNG output code so that it includes the necessary XMP tags now when you save the render in Chunky.