Texture start load

211 views
Skip to first unread message

ka...@photo.gallery

unread,
Aug 30, 2018, 2:16:45 AM8/30/18
to marzipano
I am trying to integrate a loading indicator into a custom Marzipano viewer. We use only equirectangular image sources, and it seems crucial to have a loading indicator for this type of source (single large src), unlike multi cube tiles of smaller size, which will load faster/progressively into view.

I have already looked into the below post, but the logic doesn't apply. First of all, the reference to layer.visibleTiles(tileList); does not apply to equirectangular sources, where visibleTiles will always return max ONE visible tile.
https://groups.google.com/forum/#!msg/marzipano/xszV2UIxeHY/QTiMqS2EBAAJ

I have also setup textureStore.addListener('textureLoad', function(){}), which allows us to detect WHEN a texture is loaded. However, what's the point of this if we can't detect when/if a texture STARTS loading? We might have 3-4 source levels with increasing image dimensions, but browser (depending on screen and zoom) may only load 1-2 of the sources. How are we to initiate a loading indicator if we do not know when Marzipano starts to load a texture? In cases with small screens, it's not even loading more textures than the first pinned level. The textureLoad event does not help if we do not know how if new textures are being loaded or when they start loading.

What I would have liked, was a textureStartLoad event. Or am I missing something?

Thanks.


Tiago Quelhas

unread,
Sep 16, 2018, 1:59:43 AM9/16/18
to marzipano
Sorry, this email got lost in my inbox.

The fact that there's no `textureStartLoad` event looks like an oversight. I agree it makes sense to add one.

Apart from the TextureStore events, you can also call TextureStore#query to determine whether the texture for a particular tile is being loaded (`visible && !hasTexture`).

Tiago Quelhas

unread,
Sep 17, 2018, 12:06:46 AM9/17/18
to marzipano
I've added a `Stage#renderComplete` event which should make loading indicators a lot easier to implement.

The usage looks like this:

    viewer.stage().addEventListener('renderComplete', function(eventName, complete) {
      // show or hide loading indicator depending on the value of `complete`
    });

The API may change in the future, but for now `complete` is just a boolean (true = loading complete, false = loading in progress).

I will add an example to the demos soon.
Message has been deleted

ka...@photo.gallery

unread,
Sep 17, 2018, 2:55:13 AM9/17/18
to marzipano
Thanks for the follow up. I am looking forward to test new textureLoad and renderComplete events.
Reply all
Reply to author
Forward
0 new messages