O'Reilly logo

HTML5 Games Most Wanted: Build the Best HTML5 Games by Shy Shalom, Jonas Wagner, Brian Danchilla, Rob Hawkes, David Strauß, Russell Goldenberg, Mathias Paumgarten, Egor Kuryanovich, Jonathan Bergknoff, Gaëtan Renaudeau, Seb Lee-Delisle

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

images

Chapter 7

Beginning WebGL

WebGL (Web-based Graphics Language) is a very exciting new technology that leverages the power of the Graphics Processing Unit (GPU) within the browser.

In this chapter, we will discuss the history and capabilities of WebGL. As a prerequisite to programming games with WebGL, we need to cover the following:

  • checking for WebGL support
  • working within a 3D coordinate system
  • the WebGL graphics pipeline and GLSL (GL Shading Language) basics
  • using buffers and drawing basic shapes
  • setting up world view and projection matrices
  • animating a 3D object
  • enabling depth testing
  • using a texture

Near the end of the chapter, we will ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required