Why is the Geometry faster than BufferGeometry?

:heavy_plus_sign: There’s one more question about this. :heavy_plus_sign:


The number of 7.7k views (6th place on the list) of this post so far shows that it obviously interests many beginners burning. :fire: :information_source: :fire:

Some time ago I have added the desired stats to the speedtests. But the viewer is less interested in a theoretical value than in a smooth and largely jerk-free representation.
But these two examples clearly show the better performance of Geometry for this particular case.
I still can’t explain it to myself. I cannot completely penetrate the very complex system of three.js. :sob:

Since I have been programming for 50 years (not as a profession, but also larger projects, see e.g. page 29 Addon. Produces almost infinite many time-varying geometries with functions - #29 by hofk) I can think of something. I started with binary coding / machine language and assembler, later FORTRAN and other languages. But it doesn’t have to be true in this case. I am looking for an explanation for this phenomenon. :thinking: :thinking::thinking:

If I write an algorithm directly in binary/assembler, but don’t do this very effectively/optimally, it is possible that a very good compiler of a programming language will generate better binary code from an optimal version of the algorithm.

:question: Are there any differences in the definition of BufferGeometry and its conversion up to the CPU/GPU and the process when starting from Geometry and looking at the conversions :question:


My first addons THREEf and THREEg I realized after a hint quite consciously parallel with Geometry, indexed BufferGeometry and non-indexed BufferGeometry. Here you can compare the variants. hofk (Klaus Hoffmeister) · GitHub
Now I work with BufferGeometry. Yes, some things only work with BufferGeometry.

As a beginner I also started with Geometry in 2016. For BufferGeometry it would need more basic examples in the documentation. The examples show the potential of three.js, but are often too complex for beginners, the core of the matter is not always immediately tangible.

But who should provide these basic examples?

=> A lot has already been delivered! <= :+1:

I collect it all the time and sometimes I can’t keep up. Collection of examples from discourse.threejs.org


Conclusion:
At first BufferGeometry seems more difficult, but it is like anywhere a question of exercise and habituation.


PS:
My page was just updated from http to https. Maybe there are still some problems.
Wow, an extra-long contribution from me. Because of my miserable English: Translated by DeepL Translate: The world's most accurate translator

1 Like