OpenGL Demos on the web

Some simple OpenGL demos in C++, now compiled for the web with Emscripten.

Hello World

This example draws a yellow rectangle on a blue background.
If anything goes wrong it will display a red image and print errors to the console.
Demo
Source Code

Model View Projection

This demo shows off simple usage of the model, view, and projection matrices to display a spinning rectangle.
Demo
Source Code

Normals & Lighting

This demo shows how to do basic lighting using object normals.
It uses Lambertian diffuse and Blinn-Phong specular.
A geometry shader is used to draw the normal vectors and the light vector in the desktop version.
Demo
Source Code

Advanced Lighting

This demo shows how to do more realistic lighting.
It uses a simple PBR material model, with a microfacet based BRDF and hacked up diffuse.
It also performs tonemapping to correctly deal with the high dynamic range of real lighting.
Based off of this great SIGGRAPH Course.
Demo
Source Code