You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this project, ThreeJS native objects are stored in a computed function called inst.
Knowing how big and complex those objects are, I guess they are stored this way for a reason.
My first guess was about removing VueJS observers on objects that doesn't required direct reactivity.
Obviously we don't need Vue to tell us about every single changes in this ThreeJS object.
The main reason for that is performance and by using a computed function it's a clever way to do so. (no-cached computed)
If that is the case, I would like to ask why don't we just declare the instance during created() ?
As explained in this post, var declaration on this during created doesn't provide reactivity !
This trick is really useful on complex objects and also datas that get modified a lot in a few seconds (like live mouse position) and has a huge performance benefits for ThreeJS objects !
The text was updated successfully, but these errors were encountered:
Some components of VueGL are computed inst with props, not just a constructor. It's for recreating THREE's object when the props change. Some of THREE's class accept properties when only creation, so I thought this way makes managing instance easier. (Otherwise, we should recreate objects manually and trigger functions to register namespaces, to manage object trees...)
inst computed properties have just references to THREE's object, but could that be an obstacle to performance?
In this project, ThreeJS native objects are stored in a computed function called
inst
.Knowing how big and complex those objects are, I guess they are stored this way for a reason.
My first guess was about removing VueJS observers on objects that doesn't required direct reactivity.
Obviously we don't need Vue to tell us about every single changes in this ThreeJS object.
The main reason for that is performance and by using a computed function it's a clever way to do so. (no-cached computed)
If that is the case, I would like to ask why don't we just declare the instance during
created()
?As explained in this post, var declaration on
this
during created doesn't provide reactivity !This trick is really useful on complex objects and also datas that get modified a lot in a few seconds (like live mouse position) and has a huge performance benefits for ThreeJS objects !
The text was updated successfully, but these errors were encountered: