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

double renderer on scene when use sprite renderer #232

Open
Trusiak opened this issue Sep 17, 2022 · 0 comments
Open

double renderer on scene when use sprite renderer #232

Trusiak opened this issue Sep 17, 2022 · 0 comments

Comments

@Trusiak
Copy link

Trusiak commented Sep 17, 2022

hi,

const animate = (nebula, app) => {
      requestAnimationFrame(() => animate(nebula, app));
      nebula.update();
      try{
        app.renderer.render(this.scene, this.camera);
      }
      catch(e){
      }
    }
    
    Nebula.fromJSONAsync(tu, THREE).then(loaded => {
      const app = getThreeApp();
      const nebulaRenderer = new SpriteRenderer(this.scene, THREE);
      const nebula = loaded.addRenderer(nebulaRenderer);
      animate(nebula, app);
    }); 

when try to add new sprite renderer, scene becomes duplicated: https://i.imgur.com/bTDJMpM.png
but if i try to replace SpriteRenderer with my scene renderer, then i got this:

System.js:125 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'init')
    at System.addRenderer (System.js:125:1)
    at index.ts:562:1
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

1 participant