Reputation: 213
So I'm pretty much fine using either BufferGeometry or Geometry, I'm used to both at this point. I'm even used to using BufferGeometry in places where I have to modify things a lot - the code is more verbose, but not too much so.
So are there any guidelines that can be given on when to use which?
Upvotes: 0
Views: 92
Reputation: 104763
Many of the loaders in three.js are being modified to return BufferGeometry
instead of Geometry
. This is because the loading is faster, and BufferGeometry
is more memory efficient.
BufferGeometry
stores the data in a format that is easy to pass to the GPU. Geometry
stores the data in a format that, in some regards, is more user-friendly. Geometry
can be more convenient if you need to manipulate the geometry programatically.
three.js provides methods to convert between Geometry
and BufferGeometry
, so you can use either.
How much you gain in speed, or save in reduced memory usage, is use-case-specific.
Become familiar with both data structures, and you will be able to decide for yourself which one is best for your application.
three.js r.75
Upvotes: 1