WebGL Helper: Twgl simplifies the JS animation library plugin for WebGL API

Source: Internet
Author: User
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.