Skip to content

Out of sync pano reload issue #1

@JohnHardy

Description

@JohnHardy

I've noticed that when you update the pano location in quick succession (i.e. anything which results in two composePanorama() calls before the first one completes) the images from the first one can overwrite the second one, causing a nasty shearing effect between the two locations.

The fix is simple: just add a request number to each pano, so that we can drop ones which are not relevant any more.

Variables:

_requestNumber = 0,

In the lamda for compsePanorama:

                (function (x, y, iRequest) { 
                    var img = new Image();
                    img.requestNum = iRequest;
                    img.addEventListener('load', function () {
                        self.composeFromTile(x, y, this);
                    });
                    img.crossOrigin = '';
                    img.src = url;  
                })(x, y, _requestNumber);

At the top of composeFromTile:

        // Do we need to drop this request (i.e. it is for an old pano).
        if (texture.requestNum != _requestNumber)
        {
            console.log("(EE) Pano image request number out of sync.  Dropping draw request.");
            return;
        }

Impressive library, thanks for sharing. 👍

John

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions