A More Performant, Better Looking Parallax Occlusion Mapping
This project features a material function which provides a rendering technique similar to parallax occlusion mapping, called iterative parallax mapping. The function inputs are very similar, and at first glance the rendered result is the same, but when looking close at grazing angles to the geometry, there are far fewer artifacts, and can be over twice as performant! Worst case, with equivalent inputs, performance is on par with the traditional method.
Ideal for:
Projects needing lots of detail but cannot enable Nanite
Terrains with few layers
Situations needing high optimization but not requiring perfect accuracy
Function Inputs:
Height Texture (T2d)
UVs (V2)
Channel Select (V4)
Reference Plane (S)
Intensity (S)
Iterations (S)
Key Differences From Traditional Parallax Occlusion Mapping:
Lowest height areas lose accuracy with lower quality settings before other areas.
Although all parts of the material will exhibit parallax, only height values below the reference plane will occlude.
To verify performance claim:
Open the Demo level that comes with the project.
Set r.RHISetGPUCaptureOptions to 1 in the console after loading the editor
At the bottom of the editor UI, click Trace > Channels > RDG (Enable)
With both Traditional and Better example assets equally visible in the editor viewport, click the circular "Start Tracing" button. Wait a few seconds, then click the button again (should be a red square).
Open the most recent trace at the top of the list under Trace > Recent Traces.
Zoom into an area of the trace with a stable frame rate, and into Scene > BasePass > NaniteBasePass > Nanite::BasePass > RDGEvent
Observe the two "SWShading" calls by hovering your mouse over them.