Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support tiled multi-resolution equirectangular panoramas #142

Closed
ghost opened this issue Apr 26, 2016 · 5 comments
Closed

Support tiled multi-resolution equirectangular panoramas #142

ghost opened this issue Apr 26, 2016 · 5 comments

Comments

@ghost
Copy link

ghost commented Apr 26, 2016

Are there any plans to support multi-res panoramas without converting to your generate.py format?

For context, I'm working on an app that already has multi-res equirectangular tiles for 3000 panoramas, which are displayed as a custom Google Street Views. I'd like to migrate to using Panellum instead, but it doesn't seem to be possible without redoing all my existing images.

I've had a look at implementing this and it seems technically feasible - the optional phiStart, phiLength, thetaStart, thetaLength arguments to three.js' SphereGeometry make it fairly easy to build a sphere composed of multiple pieces, each piece showing a different tile.

(If it's any help, a quick but crap illustration of that: http://parsnick.github.io/panoviewer/ [think I've messed up the texture loading - may take a few refreshes to load everything, and needs click + drag before it starts showing anything])

So I guess there's two overlapping questions:

  1. Is there a technical reason that you don't already support equirectangular tiles? The multi-res format that is currently supported appears bespoke(?) and seems like more effort, both to implement and consume.
  2. Are there any plans to support equirectangular tiles in future?

And thanks for your work on this!

@mpetroff
Copy link
Owner

Cube maps are a technically superior format since they are an exact representation and are less computationally intensive to display, which is why they are used for video game skyboxes.

Using equirectangular tiles leads to distortions since the sphere is approximated using triangles; these could in theory be fixed by applying the correct distortions to the tiles, like what is done with cube maps, but there's no reason to do this instead of using a cube map, and Google doesn't do this. For example, compare the nadir of this photo on Google Photos to the nadir of the same photo on pannellum.org; the Google version has distortions, while the version displayed in Pannellum does not. Pannellum's regular equirectangular support gets around this by using an exact mathematical mapping from an equirectangular image to a rectilinear view, but this can't easily be used for tiles. The current cube map-based format is also simpler to implement than a spherical approximation, particularly since there's no geometry library being used (and the format is similar to what is used by krpano).

I have no intention of every implementing an equirectangular multires format. If I ever implement another format, it would be based on either HEALPix or a hierarchical triangular mesh (I work in astrophysics).

@Neon22
Copy link

Neon22 commented Apr 26, 2016

I believe the free version of HDR shop does equirectangular to skybox mapping.
Nona can also be configured to do it. below. So a simple python script could do all of the directories of files in one go.

E.g..

@mpetroff
Copy link
Owner

mpetroff commented Apr 27, 2016

The generate.py script uses nona for the conversion from equirectangular to cube map and then uses the Python Pillow package to create tiles from the cube faces.

@Rickmc3280
Copy link

Does anyone here have an idea how to convert equirectangular image to cubemap, and break it down based on information provided (for example - the moon). Circumference of the moon is10,921k meters. So a cubemap would have 4 tiles across the equator and break that down into the nearest power of 2 for tiling so... 10,921,000/4 = 2,730,250. 2,730,250\x = range of 4096 = grid pattern.

Or am I thinking about this the wrong way. Trying to find an algorithm, software to break this up and automate. Found a software to break up tif data into cubemaps, but having trouble being able to use said data in any terrain software due to the sizes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants