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
188 11. Performance and Rendering Algorithms in Blend4Web
We needed a parser, which was generated using the PEG.js* generator on the basis
of the preprocessor directives grammar. is parser produces an abstract syntax tree
(AST)—a JavaScript object containing GLSL and preprocessor tokens. en, the analysis
of this object is performed in order to substitute the macro values, which saves us the
necessity to specify the #define directives. At the next stage, the shader text code is cre-
ated from theAST. When an #include directive is met, the AST from the corresponding
include le is simply inserted into the current tree. Finally, the shader i ...
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