Finally, Parallax Occlusion Mapping!

Just added the first version of self-shadowing!

Here’s a visualization of the displaced heights I’ll use as an example. White is closer to the camera:

This is an unmodified /Engine/MapTemplates/TestCard being displayed on a flat quad. I like to use TestCard with a really large parallax scale for debugging because it demonstrates a bunch of worst case scenarios (nearly-vertical drops, axis-unaligned shapes, high frequency surfaces, and thin features to be exact). You can assume that any examples I show using TestCard will look even better with typical assets, or assets authored with POM’s limitations in mind.

Hard shadowing:

(Just multiply this by a fraction to get lighter shadows, or leave as-is for a very stark comic book lighting effect)

Soft shadowing raised to the power of 3:

The shadow layer is its own output so you can use it in your PBR or unlit material workflows however you like. This flexibility even allows you to process the shadows separately. Imagine a small amethyst structure letting glassy purple light through, or a magical water structure forming and casting panned caustic patterns on itself!

It also includes a tweakable shadow offset so you can trade artifacts for accuracy as you like, or do weird effects.

Note too how unlike most solutions which assume a directional light vector, the shadows are distorted as if emanating from a point source. This makes the effect much more convincing on large surfaces. The function simply takes a world space position as input. This is a huge advantage if you have multiple self shadowed materials, as it means you don’t need to calculate and pass a different light vector to each one in the blueprints. If you want a directional light, you can simply pass in a light source position relative to the the pixel position. Want to simulate a flickering fire? Just jitter the position input over time! You can also do neat glitch effects by passing in positions which change per-pixel in unrealistic ways. Maybe a phantom that emits light but causes shadows that ripple?

Next I’m going to add support for light sources of varying widths. Will update with results!