Skip to Main Content
WebGL Insights
book

WebGL Insights

by Patrick Cozzi
August 2015
Intermediate to advanced content levelIntermediate to advanced
416 pages
16h 58m
English
A K Peters/CRC Press
Content preview from WebGL Insights
338 21. e BrainBrowser Surface Viewer
21.3.1 Data Flow
Data coming into the Surface Viewer proceed through several steps to prepare them for
display. Heavier data parsing steps are handled by Web Workers to avoid blocking the
main UI and rendering thread. Whenever possible, data are passed to and from Web
Workers as transferable objects
*
to avoid the overhead associated with structured cloning
(Listing 21.2). For more details on transferable objects, refer to Chapter 4.
Listing 21.2 Passing parsed geometry data as transferable objects from a Web Worker
to the main thread.
var result = {};
var transfer = [];
result.vertices = new Float32Array
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning HTML5 Game Programming: Build Online Games with Canvas, SVG, and WebGL

Learning HTML5 Game Programming: Build Online Games with Canvas, SVG, and WebGL

James L. Williams

Publisher Resources

ISBN: 9781498716079