It’s nonetheless an issue understanding such a fancy method in supplies like POM and we’ll attempt to deeply perceive how one can use POM and as quick as doable. Additionally we’re going to clarify what every node does and why we use every one in all them.
Let’s begin with what supplies are in Unreal Engine? Supplies in Unreal Engine outline the floor properties of the objects in your scene. A fabric is one thing like a “paint” that defines the visible look of an object.
Now what’s POM? Parallax Occlusion Mapping (POM) is a fancy texture-based method so as to add extra particulars for meshes. With POM we get extra depth visually than we may get simply with Regular maps, as a result of we get three-dimensional shapes with out including any extra vertices to meshes. POM makes use of Ray Tracing to search out the right offsets at every level.
So why is Parallax Occlusion higher than making subdivision to meshes?
-
It’s sooner than modeling since you possibly can put it on any mesh;
-
Straightforward to set – you are able to do it with all textures in the event that they’re appropriately made.
However there are additionally some issues that you must bear in mind:
-
POM provides texel peak information, individually from the texel regular information;
-
Every fragment of knowledge is ray-traced on the GPU to find out the right visible end result, resolving all the above limitations. This provides an exceedingly life like end result beneath many viewing circumstances, on the expense of considerable GPU time;
-
We nonetheless use the identical textures that we’d. The distinction is we additionally add a displacement map and some extra nodes to our materials;
-
POM doesn’t actually work with overlapping UV and may look dangerous when you have unsuitable UV;
-
On low scalability POM gained’t be seen in any respect. You need to have AT LEAST medium scalability;
-
POM is a fancy operate and we’d like a number of nodes that ought to be additionally appropriately configured, in any other case we’re going to get artifacts;
-
POV doesn’t work very effectively with shadow maps, so PROBABLY it’s important to untick “solid shadow map” for a mesh to which you’ve gotten given a POV materials.
So let’s create a POM materials. First, let’s create a fabric. Press the suitable mouse button in “Content material browser” and choose “Materials”, now you must identify it. Since it is going to be a grasp materials, let’s identify it M_POMbricks or MM_POMbricks. The distinction between “Grasp Materials” and “Materials Occasion” is sort of a mum or dad to a toddler in programming. If a mum or dad has some values a toddler will get them too, however a change of values of a kid gained’t have an effect on a mum or dad. The connection between them known as a “Parameter”.
We’ve acquired now a very clear materials and we’d like textures. We will make our personal textures, however our important topic is POM , so let’s press the suitable mouse button on “Content material Browser” and choose “Add Quixel Content material”. Discover a brick materials. In my case it’s “BRICK WALL”. Obtain it.
After downloading it, open the fabric that we created earlier than by urgent the left mouse button twice. To have these textures, it’s important to choose the textures of “BRICK WALL” and transfer it to the Materials Graph. Then you must join all of them like within the screenshot beneath.
The feel with standard colours with none details about gentle (Albedo) belongs to “Base colour”, it provides colours that we have to see in a brick wall on this case. The blue texture belongs to “Regular”, as a result of it provides depth. However the yellow texture that we name “ARD” texture differs from others, as a result of it has a number of textures inside in numerous channels, so we’re going to make use of a few of them. ARD = Ambient occlusion + Roughness + Displacement, that’s why we linked like what’s on the screenshot.
Now let’s create extra nodes so we may lastly have a POM impact. To create a node press the suitable mouse button inside the fabric graph and write the identify of your node. Or press the palette and discover the nodes that you simply want. Within the screenshot there are names for every node.
Fixed – is a quantity that we’re going to want to present a numerical worth. It’s a bit of inexperienced node. Press the suitable mouse button and sort “Fixed”, then press the left mouse button on it. Names of different nodes you possibly can see in screenshots beneath.
Let’s proceed. You see that constante nodes have completely different names within the screenshots? It’s as a result of they’re not simply nodes, they’re Parameters. Now it’s important to press the suitable mouse button on them and press “Convert to Parameter”, you then identify them like in these screenshots.
Now let’s discover every node. What does every of them imply?
1)Channel (it’s referred to as so as a result of we named it like that after making this node a Parameter) – is a four-vector fixed, to create it it is advisable write not simply “fixed”, however “constant4vector”. As we wrote earlier than, this node controls which channel goes to be offered to ParallaxOcclusionMapping. If you happen to bear in mind what we wrote about ARD, then you possibly can guess that we’re going to make use of “B” channel, which implies now we have to make it fully Blue, so it ought to be 0,0,1,0. Additionally we used the node “Append”, as a result of ParallaxOcclusionMapping expects us to present worth of constant4vector (that’s why there’s written V4) and since four-vectors constantes have Alpha channel we give the colour (B channel) and alpha.
2)Texture Coordinate controls scaling of the feel. Create one other node and join it to “Multiply” (this node multiplies two linked values), create one other node and join it too. Now you possibly can scale it. We want texture coordinates and the dimensions is determined by the scene you’re creating.
3)Peak Ratio (Parameter of one-vector fixed) – controls values of our peak map, in different phrases controls how a lot POM this materials might be. We’ll write 0.3 as a default worth and we’re going to vary it in a fabric occasion that we’re going to create, as a result of the whole lot is determined by the textures that we use.
4)Min Steps and Max Steps – Values for making POV clean. The extra steps now we have, the extra clean it turns into, it’s just like the modifier “Subdivision” in Blender.
As you see we linked ParallaxOcclusionMapping to the textures, however we additionally linked “Pixel Depth Offset” of each nodes. We did it as a result of in any other case we gained’t have any POV impact. However once more as I discussed earlier than, since we use Pixel Depth Offset, probably you must flip off “Forged shadow” on actors on which we’re going to make use of our supplies since they don’t work collectively very effectively.
We now perceive why we created such nodes for the POM impact. Needless to say Materials Situations with Parameters assist us in making supplies and this case shouldn’t be an exception both.
Ultimately of this text it will be nice so as to add a number of extra issues that would provide help to:
-
Texture decision impacts reminiscence and bandwidth. They may trigger lag and freezes. The way you deal with decision relies upon completely on you;
-
If you happen to get the warning “The present materials has compilation errors, so it won’t render presently in characteristic stage SM6”, you then most likely forgot to make the node Constant4Vector (Heightmap on photographs on this article) a Parameter;
Written by Alexander Mukhitdinov, recreation developer of Skyhell, mentor and co-founder of Dice of Ability. Date – twenty sixth August, 2024. Uzbekistan. [email protected]