Shading models, reflections models, and post-processing effects
| Links:
In this project, I implemented a variety of shading and reflection models, and post-processing effects using OpenGL.
Matcaps, or Material Captures, are texture images of a pre-rendered sphere with a material. To sample them, map the unit sphere centered at the origin, as defined by the x,y coordinates of the vertex normal, to the [0,1] unit square of UV space in the vertex shader.
Procedural cosine-curve color palettes were popularized by Iñigo Quilez in the article Palettes of his blog. Given 4 RGB colors \(a\), \(b\), \(c\), and \(d\), one can get a color palette by evaluating \(f(t) = a+b\cos(2\pi(ct+d))\) with \(t \in [0,1]\) in the fragment shader.
Gaussian blur, Sobel filter edge detection, greyscale and vignetting, and fake bloom are all post-processing effects applied to a render target where the model has previously been rendered using some shading or reflection model. The Sobel filter is of particular interest because it is a key component of a Variable Rate Shading solution.
Clay matcap | Chrome matcap | Pearl matcap |
---|---|---|
Plastic matcap | Cosine curve color palette | Silhouette |
---|---|---|
Normals | Blinn-Phong | Gaussian blur |
---|---|---|
Sobel filter edge detection | Greyscale and vignette | Fake bloom |
---|---|---|