mpetroff / pannellum

Pannellum is a lightweight, free, and open source panorama viewer for the web.
https://pannellum.org/
MIT License
4.22k stars 718 forks source link

Multi-res loading order #460

Open byValle opened 7 years ago

byValle commented 7 years ago

First of all, congrats and thanks for this awesome tool.

I believe multires loads tiles from right to left. Would it be possible loading them from the center towards the edges? I feel like it would improve the experience rendering first what you are looking at.

Thanks again

mpetroff commented 7 years ago

The direction actually depends on which cube face, but, regardless, it's not optimized.

byValle commented 7 years ago

untitled-3 That's the effect I'm talking about. If you rotate the view, the new tiles will load from right to left as well

mpetroff commented 7 years ago

I know what effect you're talking about. As I said before, the direction depends on the cube face, though. While the front and back faces generally load right to left, the right face loads top to bottom, and the left face loads bottom to top. The loading also depends somewhat on the panning and zooming that brought the tile into view, so it's not always the same.

strarsis commented 7 years ago

FWIW, Blender (3D program) can also render tiles in a Hilbert Spiral, maybe the same approach can be used for multires tile loading?

mpetroff commented 7 years ago

That's solving a difference problem; it's choosing a location on the screen and then rendering it, instead of determining where a tile is and how close it is to the center. The reason the Hilbert Spiral mode was added to Blender is because it is faster than the center outward mode because as a space-filling curve, subsequent tiles are always adjacent to previous tiles, which lends a performance improvement due to improved cache coherence. Since tile loading has nothing to do with cache coherence, there's no reason to use a space-filling curve instead of just loading tiles from the center outward.