📜 ⬆️ ⬇️

Choosing a library to work with WebGL

One morning, as I ran past the glorious lesson , I thought, “This is cool, but all the same, there’s not enough.” If you need to write a lot of code quickly and easily, then we need, without a doubt, for this library. But how can we choose it, if everyone who knows how to start a repository on a githaba has washed his bicycle? And about this for you, my friend, I will write a post today suddenly.

I, like many other users of WebGL technology, began my acquaintance with it from a single library, which I read about somewhere or heard from someone, and now I am hammering all the nails with the same hammer. However, if I was just starting to get acquainted with WebGL today, then everything could have been different. The fact is that last year one kind person spent 6 months writing a series of simplest examples of working with WebGL using all the libraries that I could reach - which gives you a unique opportunity to compare the APIs of different libraries before starting in-depth study of one of them:

LibraryVersionThe size
Naked webgl1.00TytsTytsTytsTyts
Naked webgl2.00TytsTytsTytsTyts
Webgl helper-15KBTytsTytsTytsTyts
TWGL.jsv0.0.2019KBTytsTytsTytsTyts
glCubic.jsv0.0122KBTytsTytsTytsTyts
webgl-utils.js-50KBTytsTytsTytsTyts
stackglv1.4.067KBTytsTytsTytsTyts
lightgl.js-72KBTytsTytsTytsTyts
GLOW.jsr1.177KBTytsTytsTytsTyts
TDLv0.0.891KBTytsTytsTytsTyts
GLBoost-132KBTytsTytsTytsTyts
Philoglv1.4.3136KBTytsTytsTytsTyts
Webglu-178KBTytsTytsTyts-
xeoEnginev0.1.0224KBTytsTytsTytsTyts
Scenejsv4.2.1242KBTytsTytsTytsTyts
CubicVR.jsv0.2.1347KBTytsTytsTytsTyts
three.jsr71419KBTytsTytsTytsTyts
SpiderGLv0.2.0498KBTytsTytsTytsTyts
Babylon.jsv2.1814KBTytsTytsTytsTyts


This table presents four simple examples of working with procedural geometry as part of the APIs of the respective libraries, and overhead, which your website or application will have to pay for using them. In addition, the author performed the same examples using library primitives, where it was possible:
')
LibraryVersionThe size
lightgl.js-72KBTytsTytsTytsTyts
Processing.js1.4.13223KBTytsTytsTytsTyts
p5.jsv0.4.13236KBTytsTytsTytsTyts
three.jsr71419KBTytsTytsTytsTyts
Babylon.jsv2.1814KBTytsTytsTytsTyts
AwayJSv0.4.311,008KBTytsTytsTytsTyts


Of course, procedural geometry is not all that you need in your work, but from this series of examples you can also learn the general principles of working with this or that API, and create your own informed opinion before you start doing anything.

Update 9 / III : I thought I would continue to work on the article, but I will not check out the reaction . Learn to chew before swallowing, dear readers.

Source: https://habr.com/ru/post/278731/


All Articles