Wednesday, January 19, 2011

WebGL update on TI platforms (Part 1)

WebGL is slowly making inroads - Here is a snapshot of happenings in this key technology.

What is it ?

Allows users to view 3D content in a browser, in a standardised manner. (I am not too much in favour of the other definition "works without downloading and installing any plugins", because the definition of a plugin varies - is it bundled with the browsers' installer ? Or is it installed in some other way without the user noticing it ?). It allows developers to use the graphics HW acceleration along with other standard HTML elements.

See below for the possibilities (from the Khronos Wiki page)















The spec is being ratified by Khronos consortium.

How to use:

1. Get the canvas with HTML5's - canvas element.

2. Get the GL context with something like,

gl = canvas.getContext("experimental-webgl");

3. Initialise WebGL

4. Initialise the shaders and everything else just like regular openGL ES

5. Use the gl context to draw shapes/ use textures

6. Close contexts/programs on exit


Veterans in OpenGLES would note that there is no swapbuffer() call - it is done automatically by the browser to show it on the display screen.

Browser support:
  • Qt/Webkit - supports this on the desktop and verified on ARM Cortex A8.
  • Others unconfirmed on ARM platforms (if you have verified, please comment).
Acceleration from TI

Qt/Webkit - part of TI SDK for AM/DM35/37xx platforms.

http://focus.ti.com/docs/toolsw/folders/print/linuxsdk-am37x.html

TI Graphics SDK - available from below link

http://processors.wiki.ti.com/index.php/AM35x-OMAP35x_Graphics_SDK_Getting_Started_Guide

More details on enabling this will be posted soon.

Links

WebGL BOF introduction
http://www.khronos.org/library/detail/2010-siggraph-webgl-bof/

The public Khronos home page for webgl - links to various demos and specs
http://www.khronos.org/webgl/

Shadertoy - live editing of shader code and see results instantly - Chocolux is especially nice (under 3D demos)
http://www.iquilezles.org/apps/shadertoy

1 comment:

  1. Follow up 2nd post on WebGL with more details available now at,

    http://tigraphics.blogspot.in/2012/04/sgx-hw-accelerated-webgl-with-firefox14.html

    ReplyDelete