Wiki
Clarifications for Angel's Interactive Computer Graphics

Section 7.12 (Worksheet 8)
Page last edited by Jeppe Revall Frisvad (jerf) 26/10-2017

The line for specifying the depth and resolution of the renderbuffer is missing an argument. Instead of

  gl.renderbufferStorage(gl.DEPTH_COMPONENT16, width, height);

it should be

  gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, width, height);

Sec. 7.12 is missing an important line that attaches the renderbuffer to the framebuffer object. The missing line is

  gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, renderbuffer);

This should be called while the framebuffer and the renderbuffer are both bound.

Support: +45 45 25 74 43