Download

[Tutorial] Parallax Occlusion Mapping - POM

Hey all,

So yesterday during the stream I announced I would be making a Parallax Occlusion Mapping tutorial for those interested in the material function and how to go about setting it up. I was inspired by our Senior Technical Artist - Ryan Brucks while watching the POM Twitch Stream. I highly recommend watching this stream as Ryan does an amazing job of breaking down the functionality of Parallax Occlusion and how it is calculated. You can learn a great deal about this material function and even good rendering practices by watching the stream!

There are a few things I would like to mention before posting the tutorial.

  • This tutorial is going to be made compatible for 4.9.2 and 4.10.2. When the official release for 4.11 is out, I will update the tutorial to reflect the changes.
  • You might notice the missing ‘Reference Plane’ input on the POM function. Ryan mentions in the stream he has made sure to add this in versions 4.11 and on.
  • Understanding how and why something works is equally as important as setting it up correctly (This is where the technical explanations in the stream will help a lot)
  • This tutorial will be using the ‘T_CobbleStone’ texture from the ‘Starter Content’ as it produces an awesome result!
  • I will also provide a simple mesh as an example of the type of surface you will generally use when implementing POM.
  • This Material Function has a pretty high instruction count on it’s own, so you want to use POM intelligently for things like debris filler or ground cover.

With all of that said, I will post the tutorial in this thread when it is complete. You will also be able to find it on my Wiki Profile Page where I have some other fun and useful tutorials!

Thanks everyone :slight_smile:

As promised here is the tutorial.

Parallax Occlusion Mapping Tutorial

Since I wasn’t watching the stream live and questions on youtube comments don’t seem to be getting answered, I’ll ask this here. Ryan mentioned that if you use POM for landscaoe, use it wisely. What is exactly meant by that? Don’t use that certain layer that has POM too much?

So landscapes, as you know are made up of multiple components, and a landscapes size is usually much larger than that of any other regular mesh. The large size of landscapes used with the high instruction count of the POM material function can cause your project to be non-performant. You can use it, but the more aggressive the effect of the function and the more instructions you add, the lower the performance.

Wouldn’t it be possible to show the pom effect on ladscape only around a definite radius around the player ? The rest of the landscape would use the same material just with diabled pom parameters.

I also meant to avoid using very deep POM heightmaps combined with terrain that is very jagged or has sharp peaks. You may see some distortion in those cases. Smoother terrain should be fine. In either case, artifacts could be reduced with ‘horizon flattening’ which could be computed as The Dot product between the camera vector and the vertex normal. Take the absolute value of that, then use it as the alpha of a lerp node. Hook up a scalar called ‘horizon flattening’ into A. Leave B disconnected with the default of 1. Then you can multiply this by your Height scalar to make the POM less intense at grazing angles which should reduce artifacts on bumpy terrains.

What should i do if i want to use this technique in Master material and then use multiple material instances? Specifically, i have problem with creating Heigth map node as a parameter so i can use it in instances. Thanks

Texture object parameter should work.

Geebus! Read the tut. Thxs. But man, i wish it was as simple as a displacement map on a slot. Lol

Agreed, in fact, I don’t like the material blueprint for POM. I am used to working with another engine where all I have to do is specify whether using POM, give the height/bump texture, and give the offset. It’s way too complex in it’s current form and really unnecessary IMO. This could easily be made as simple as BumpOffset is.

Yeah, I already requested a feature where we can toggle from nodes to a UI similar to othet renders. Simple slots with their own maps amd values. Hopefully it one day iy goes that direction.

Well - we can make a “master material” with texture objects and a few other params - then a child material is as you describe.

It sure would be nice to have these master materials included with the engine - though setting things up myself has provided good opportunitys to tweak basics to better fit my game