Giter VIP home page Giter VIP logo

Comments (7)

patrickfuller avatar patrickfuller commented on September 27, 2024

The single renderer approach makes sense to me, and seems to be an easy upgrade if the renderer can change DOM elements.

Out of curiosity, how many instances do you have running when this occurs?

from imolecule.

jhrmnn avatar jhrmnn commented on September 27, 2024

About 30, each with hundreds of atoms (not sure whether that matters). I was a bit surprised, didn't seem like a crazy number.

from imolecule.

patrickfuller avatar patrickfuller commented on September 27, 2024

After some testing, it looks like the renderer can't be shared across different canvases, ie. everything rendered has to be in the <canvas> div.

I'll leave the issue open in case another solution comes up, but won't be able to fix this any time soon.

from imolecule.

jhrmnn avatar jhrmnn commented on September 27, 2024

Do you have an idea what refactoring would be needed? I might try doing it myself.

from imolecule.

patrickfuller avatar patrickfuller commented on September 27, 2024

In my testing, I made a global imoleculeRenderer variable, replaced this line with:

if (imoleculeRenderer === undefined) {
    imoleculeRenderer = new THREE.WebGLRenderer({antialias: true, alpha: true});

and then swapped out instances of this.renderer and self.renderer with imoleculeRenderer. This broke previous canvases, which makes sense.

Regarding whether or not there's a right way to do this, I honestly don't know. The one-renderer approach works if everything is on one canvas, but I don't think that's feasible in a notebook. Maybe there's a smart way to swap out active webGL canvases with static images?

from imolecule.

sxhexe avatar sxhexe commented on September 27, 2024

@Azag0 @patrickfuller Same problem here. Did you guys figure out any workarounds?

from imolecule.

patrickfuller avatar patrickfuller commented on September 27, 2024

Nothing straightforward unfortunately, at least within the constraints of the jupyter notebook.

from imolecule.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.