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
21913.4 Source Transforms
e name eld must be unique, as npm has a single namespace for published packages.
If unsure, check http://npmjs.org/package/<n a m e> to make sure the name isn’t already
taken. e version eld should be familiar, and description is an additional eld
used by npm for searching for and displaying the package.
Let’s create an index.glsl le: is le will be the default le loaded when users of
our package use require(glsl-example-sum):
float sum(float a, float b) {return a + b}
float sum(vec2 a, vec2 b) {return a + b}
float sum(vec3 a, vec3 b) {return a + b}
float sum(vec4 a, vec4 b) {return a + b}
#pragma export(sum)
If de ...
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