Twgl.js is a small, WebGL helper library. The purpose of this JS library is to make the WebGL API more concise and readable. The WebGL API is very verbose, and setting shaders, buffers, attributes, and uniforms requires a lot of code. A simple glow cube effect may require more than 60 code calls in WebGL. Using TWGL can greatly reduce the writing of the Code, and the written code is neat and easy to read.
TWGL has 5 core functions:
- Twgl.createprograminfo: Compiler for compiling shaders and creating properties and uniforms.
- Twgl.createbufferinfofromarrays: Plugin buffers and properties of the set.
- Twgl.setbuffersandattributes: Binds the buffer and sets the property.
- Twgl.setuniforms: Set uniforms.
- Twgl.createtextures: Create a variety of textures.
Effect Demo: http://www.htmleaf.com/Demo/201504131674.html
: http://www.htmleaf.com/html5/html5-canvas/201504131673.html
WebGL Helper: Twgl simplifies the JS animation library plugin for WebGL API