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

WebXR samples renderer issue #166

Open
cabanier opened this issue Jul 12, 2023 · 0 comments
Open

WebXR samples renderer issue #166

cabanier opened this issue Jul 12, 2023 · 0 comments
Assignees

Comments

@cabanier
Copy link
Member

We found an issue with the renderer that is bespoke to the sample repo.
When re-entering a WebXR session and creating a new renderer, some node will stop rendering.

This can be seen in immersive-hands.html. If you enter, exit and re-enter, the spinning cube in the middle will stop rendering.
This is happening because starting a session will create a new renderer which will run the following code:

  _setRenderer(renderer) {
    if (this._renderer == renderer) {
      return;
    }

    if (this._renderer) {
      // Changing the renderer removes any previously attached renderPrimitives
      // from a different renderer.
      this.clearRenderPrimitives(); <-------------
    }

    this._renderer = renderer;
    if (renderer) {
      this.onRendererChanged(renderer);

      for (let child of this.children) {
        child._setRenderer(renderer);
      }
    }
  }

After this, the objects have no more render primitives and will no longer draw.
@toji , do you have thoughts about this? Should this be fixed in the renderer or can we make it so we reuse the renderer?

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

2 participants