Website powered by

Parallax Mapping with Self-Shadowing | HLSL Unity

This demo compares Unity’s built-in parallax mapping with a custom HLSL implementation, using both Blinn-Phong and Cook-Torrance lighting models. It showcases features like steep parallax, self-shadowing, and how different materials (stone, metal, concrete roofs) respond under each model.

Parallax mapping was something I first saw in a computer graphics class, but didn’t fully understand at the time. I came back to it recently, rebuilt it from scratch in Unity’s Built-in Render Pipeline, and documented everything along the way.

The project progresses from simple parallax mapping to steep parallax, parallax occlusion, and finally self-shadowing. I also explored how different shading models affect the look and realism of depth effects.
______________
Full write-up (with visualisers and analogies to explain the maths):
https://bentobaux.github.io/posts/parallax-mapping-with-self-shadowing/
______________