project thumbnail
Duration: ±2 weeks
Date: April 2013
Course: Graphics programming 4
Tools used: OpenGL
Cg
Visual Studio 2010
gDEBugger

Steep parallax shader

The first assignment for graphics programming 4 was to implement lighting in Cg shaders. I wanted more of a challenge so started reading up on parallax shaders. In the end I ended up with a steep parallax shader using ray-marching through a height map. I didn't spend much time optimizing it as this little project was more about understanding how it worked.

Features:

  • Supporting point light, directional light, and spot light.
  • Diffuse texture, normal map, specular map, and height map inputs.
  • Self shadowing (the height map details can produce shadows on itself).

Images

Steep parallax shader screenshot 1
Rock material using a diffuse texture, specular texture, and height map. Showing off 3 different depth multipliers.

Steep parallax shader screenshot 2
Showing rock material from two different angles.

Steep parallax shader screenshot 3
Test pattern in height map showing off the self shadowing, rendered with one quad.