Difference between buffer geometry and geometry

From 2021

This is now a moot point, geometry was removed from threejs in r125.

Geometry is now just an alias for BufferGeometry, source here.

export { BoxGeometry, BoxGeometry as BoxBufferGeometry };

Geometry is converted to buffergeometry in the end so if you dont have any performance issues, stick to geometry if its convenient for you.

Here you can see that ConeGeometry calls CylinderGeometry constructor.

CylinderGeometry.call( this, 0, radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength );

https://github.com/mrdoob/three.js/blob/dev/src/geometries/ConeGeometry.js

Then CylinderGeometry is created using CylinderBufferGeometry.

this.fromBufferGeometry( new CylinderBufferGeometry( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) );

https://github.com/mrdoob/three.js/blob/dev/src/geometries/CylinderGeometry.js


The difference is essentially in underlying data structures (how geometry stores and handles vertices, faces etc in memory).

For learning purposes you should not care about it, just use ConeGeometry until you come across performance issues. Then come to the topic again, next time you will be more prepared to get the difference between two.

Please check BufferGeometry

An efficient representation of mesh, line, or point geometry. Includes vertex positions, face indices, normals, colors, UVs, and custom attributes within buffers, reducing the cost of passing all this data to the GPU.

To read and edit data in BufferGeometry attributes, see BufferAttribute documentation.

For a less efficient but easier-to-use representation of geometry, see Geometry.

On another side Geometry:

Geometry is a user-friendly alternative to BufferGeometry. Geometries store attributes (vertex positions, faces, colors, etc.) using objects like Vector3 or Color that are easier to read and edit, but less efficient than typed arrays.

Prefer BufferGeometry for large or serious projects.

BufferGeometry performance explained here: why-is-the-geometry-faster-than-buffergeometry

Tags:

Three.Js