rydn / HTML-GL

Get as many FPS as you need and amazing effects by rendering HTML/CSS in WebGL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HTML GL

60 FPS and amazing effects by rendering HTML/CSS in WebGL, framework agnostic

Gitter chat

HTML GL solves "the slow DOM problem" by creating WebGL representations of DOM elements and hiding actual DOM after. This speeds up HTML/CSS animations and transformations by using 3D hardware acceleration and allows to apply OpenGL effects as modern 3D games have.

Using HTML GL you still work with HTML/CSS as you are common to, but DOM elements are just facades to their WebGL represenations. These GPU accelerated textures are very effective from resources consuming perspective and are very cheap to transform or animate.

Usage

As Web Component

<html-gl>
    This element`s content is rendered in <h1>WebGL</h1>
    <span style="color: green;">was it easy?</span>
    Feel free to use CSS, images and all you are common to in HTML/CSS world.
</html-gl>

As jQuery plugin

    $('.some div').htmlgl();

No DOM + WebGL rendering = highest FPS possible for Web platform

HTML GL flow diagram

Demos

  • Filters WebGL is not only about performance. It breaks any HTML/CSS limits in terms of animations and interactivity
  • Basic HTML GL demo shows how to use HTML GL and animate GL Elements. It also demonstrate that HTML GL handle content change events and repaints element`s WebGL representation
  • Basic DOM this is the same project as previous. The only difference is that htmlgl.js is not included
  • Advanced content HTML GL slider with nested content rendered via WebGL and animated, ability to drag with mouse horizontaly, click event listeners on boxes
  • Advanced content DOM

How to use?

Include HTMLGL.js into project. Use tag name <html-gl> or jQuery plugin $(myElement).htmlgl() for elements you are going to animate. These elements will be rendered in WebGL and their CSS Transform properties will be mapped to WebGL representation transformations. So DOM node itself will not be animated or displayed in order to avoid resources consuming. HTML GL is framework agnostic and is easy to inject into existing project which needs performance tweaking.

Rasterization API

In order to improve technology we are trying to promote standardized native Rasterization API for JavaScript. Help us to be better and to add this cool feature to browsers by spreading the article and proposal draft.

License

MIT: http://mit-license.org/

Copyright 2015 Denis Radin aka PixelsCommander

About

Get as many FPS as you need and amazing effects by rendering HTML/CSS in WebGL


Languages

Language:JavaScript 63.3%Language:HTML 29.2%Language:CSS 7.5%