WebGL : optimizing / compositing

Posted: June 7, 2011 in IT/Dev
Tags: , ,

Compositing engines found on browsers that support WebGL use  CPU in order to mix HTML elements with 3D canvas (required by the specification) :

WebGL is essentially another rendering context on the canvas element, so it can be cleanly combined with HTML and other web content that is layered on top or underneath the 3D content.

Then optimal performance cannot be achieved (there are GPU to CPU data transfer, and then CPU back to GPU transfer). Common optimizations (batch commands, shader – GLSL – functions) arent’ then so much efficient.

Browsers could use two rendering engines, as compositing between WebGL views (3D canvas) and other HTML elements aren’t likely. Dedicated hardware rendered views are still used for 3D applications, windowed games, and recent versions of Flash plugin.

However Flash uses the embed element, that is managed in a different manner (it was created on purpose, to allow to embed non standard elements), while WebGL element (standard) is at the same level as other HTML elements, and then rendered by the same container view (that corresponds to the HTML document), that is a Cocoa WebView on MacOSX.

Hardware acceleration is still used for CSS Effects/CSS3 transitions and video tag, however they may also require software compositing (or the specification doesn’t state to allow mixing with other HTML elements).

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s