Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Do WebGL Right: Recipes and Best Practices

DZone's Guide to

Do WebGL Right: Recipes and Best Practices

· Web Dev Zone ·
Free Resource

A true open source, API-first CMS — giving you the power to think outside the webpage. Try it for free.

Two simple ways of coding best: follow best practices, or use the best of other developers' code. Both are easier than understanding an API in depth, or tracing a technology from API to bytecode. 

High-powered graphics programming raises the performance stakes quite a bit -- so it demands either deep understanding of computer graphics or one of the easier methods of code-bettering.

For WebGL programming, you can read the spec, if you like, or break out the matrix algebra and slog through a free course in computer graphics (tons of great slides, btw).

Or for quicker improvement, ride on the shoulders of other giants, and digest these two resources:

  • WebGL Best Practices: from Mozilla, so slightly optimized for Firefox, but mostly not engine-specific. Includes useful list of things to avoid, things to think about, and general performance tips.
  • The WebGL Cookbook: from learningwebgl.com, includes recipes (how to initialize, include a function, draw a sphere, stuff on shaders), cheat sheets, matrix libraries (see, math not a problem), and quite a few frameworks I've seen used extensively online. (The frameworks section is particularly great.)

Either way, in different ways, should help you get started and write better WebGL in no time.

The New Standard for a Hybrid CMS: GraphQL Support, Scripting as a Service, SPA Support. Watch on-demand now.

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}