Texturing, or what you need to know to become a Surface Artist. Part 3. PBR and materials

  • Tutorial
In the last part of the tutorial, we examined the principle of operation of masks, what is a “texture”, and that channels are used for absolutely everything - pixel parameters. Now we’ll take a look at everyone’s favorite PBR and collect textures to create wet, dirty asphalt.

In this lesson, I will refer a lot to other tutorials and sources of information in order to minimize the volume of the tutorial. Most of the links will be provided at the beginning of the tutorial, so if you do not understand any of this tutorial, follow the links and read the information there. When you are ready - return to the tutorial and continue to learn the basics of the artist on the surfaces. If any links are not available, please, let me know in PM or in the comments. I will definitely correct this misunderstanding.

Also, if something is completely incomprehensible - I beg you to report it so that I can expand on this topic in more detail.

Part 1. Pixel here
Part 2. Masks and textures here
Part 3. PBR and Materials - you read it.
Part 4. Models, normals, and sweep here .
Part 5. Material system here .


PBR


This abbreviation is decrypted as follows: Physically Based Rendering . Which means “Physics-based rendering”.

As we all know, we could not see a single object if the objects did not reflect the light that falls on them. All this works very simply - a ray of light hits the table, bounces off and hits your retina.

Depending on the surface, on its condition (whether it reflects like a mirror, or has roughness, whether there are drops of dirt / water / coffee on the surface), an already modified beam comes into your eye (let’s say so). Moreover, a ray is not entirely correct, since it is already known that light is also a wave. But this is already too deep for us, and here I can be wrong.

But the essence remains unchanged - the way we see objects is built from the way light is reflected from the surface. And the PBR standard describes what parameters should be taken into account so that the light looks as cinematic as possible.

I won’t begin to write about the rules by which light is constructed, how it is reflected and whether it is reflected at all. About how light works at the physics level, there are a bunch of articles:

  • The basics article from the creators of Substance Painter / Designer is here . And her 2015 translation is here . A link to the second part of the translation is on the same page.
  • An article from Google on their development of PBR (the same testicles, only in profile with other formulas) is here .
  • An article from MrShoor , who reviewed PBR on low-level shader programming here .

Parameters. Or how PBR is configured.


We will consider PBR from the point of view of the general concept and at the level of work with each parameter separately through pixel channels.

From the last part of the tutorial, remember that PBR is actually created through the summation of parameters (you should not go into the formulas). That is, PBR consists of a set of parameters:

  • Color (Base Color / Albedo).
  • Metallic
  • Specular
  • Roughness.
  • Glossiness
  • Ambient Occlusion (hereinafter AO).
  • Height
  • Normal map.

All parameters, except Color and Normal map, use 1 channel, and Color and Normal map - 3 channels each:

  • Color uses 3 channels - RGB to shape the color of the pixel.
  • Normal map uses 3 channels to simulate surface slope. Each channel is responsible for the vertical, horizontal, and depth tilt, respectively.

Offtop. Normal Map.
As for the Normal Map, its technical implementation (which channels are responsible for which slope) differs from the render settings. So, for example, in Unreal Engine 4, the Green Channel is responsible for the negative value of the vertical tilt, and in Unity for the positive.

More information can be found here .

There is also a huge comprehensive article on how to bake Normal Map and how to work with it at all on the render.ru website here .

Link to the discussion forum of normal and height maps (Height parameter) here .

And the Wikipedia description of embossed texturing here .

Now it is worth noting that the rendering (display), based on physics, has several different implementations. All of them are similar to each other and use the same pixel channels to adjust the final result. Usually, two types of implementation are divided:

image

in the first type, the Color-Metal-Roughness parameters are taken into account , in the second - Diffuse-Specular-Glossiness .

Both types of implementation use the same 3 parameters - AO, Normal map, Height .

Offtopic about which standard we will use
We will use the first option, since in the future we will transfer our training to Unreal Engine 4, and this engine uses the first option combinations + has an additional Specular parameter, which once again shows that PBR is a convention.


Moreover, in modern PBR, the Height parameter is mixed and hidden in the Normal Map. In fact, it’s easier to express unevenness through one Normal Map than to calculate the pixel depth / height, or something else in additional channels. Everything is simpler than it seems, and it is better not to be smart with dozens of parameters.

Although when creating textures in Substance Painter, the Height parameter is taken out separately, when baking textures, it is sewn into the normal map (you can still select it in a separate channel if you want).

Total, the final result of the picture consists of superimposing parameters in one pixel:
image

Let's look now at how this works in Substance Painter. To do this, we again create a new project with the usual playan and standard settings (I talked about them in the second part of the tutorials). And create a new fill layer:
image

Now let's look at the standard normal texture from the Substance Painter “Niche Rectangle Top Wide” set , which is located under the Hard Surface tag :
image

Next, we will transfer this normal map to the Base Color layer parameter (from the previous lesson we must remember how this do). This is how the normal map looks, if you take it as an image (image above). But now we will remove it from the BaseColor parameter (we did this for general familiarization) by clicking on the cross in the parameter:
image

And we will transfer it to the Normal parameter:
image

Your end result is immediately updated. Now, if you hold down Alt and LMB, you can rotate the camera and look at the planes from different angles. The light reflected from the pixels will begin to sparkle, creating the illusion of depth. It’s as if there are really some hollows and bulges on the plate. All this is noticeable at an angle from 90 to 140-150 degrees. And the greater the angle of inclination, the more it becomes clear that this is a calculation of a video card, which determines how each pixel should reflect light in order to create this illusion. As the initial values, we transfer 3 parameters to the video card in the form of pixel channels (in other words, the texture of the Normal map):

image

Now let's be perverted. We will remove this card from the Normal parameter and indicate it in the Metallic channel. Metallic has one channel, and the normal map has 3 channels, respectively, by inserting the normal map in this parameter, the Substance Painter will cut off 2 extra channels (I assume that GB) and leave only one for calculations:

image

And the result:

image

Now, in the final result, we see that there are no more bulges and hollows, but the surface itself began to look like some kind of metal plate. You can also see how Metallic will look like one, without the rest of the parameters (BaseColor and others), switching the display mode to 1 channel Metallic (if you haven't changed anything, then in the viewport on the top right there is the ability to switch the display):

image

Select metallic and we get the following result:

image

As you can see, this is one channel in grayscale, which determines which pixels should look like metal, which ones like something average, and which ones not metal. 0 is not metal. 1 - metal.

Similarly with the Roughness channel - any texture is suitable for working with it. It depends on what end result you need. You can try to stick any texture available to you into the Roughness channel yourself and look at the result.

Sophisticated materials


The word “material” usually means a collection of ready-made parameters, the combination of which gives a cinematic result - material (in other words, texture, surface).
Take, for example, this leather chair:

image

Visually, the chair consists of 3 materials:

  1. Leather.
  2. Metal rivets.
  3. Plastic (possibly wooden) legs.

Each material has its own parameters:

  • Color (for example, leather is close to black with specks of cracks, and riveting is a golden color with some stains of dirt).
  • Metallic (in leather it is almost 0, and in rivets it is close to 1).
  • Roughness (in skin it is closer to 1, and in rivets closer to 0).
  • Normal Map (In the skin, the normal map displays cracks and their depth, and in rivets - technical indentations / appearances).
  • AO (in the skin it will display the correctness of shading of cracks, and in rivets - indentations).

And this is how skin parameters look visually:

image

To summarize the intermediate result:

Now we know:

  • The principle of operation of PBR. And how to manage it through channels.
  • How all parameters work, and how we can influence them through textures.
  • The principle of building complex materials.
  • How to mix materials using masks.

Based on all this, we can now imagine how you can create wet, dirty asphalt with tire marks. Can we?

Practice


And what do we need in order to collect wet dirty asphalt with tire marks?

To begin with, we need to determine the amount of materials that will be used in our tutorial:

  1. Asphalt.
  2. Mud.
  3. Tire tracks (in other words, rubber).

Then add them to the Substance Painter project.

Where to get the materials?
The question arose - where to get these materials? You can suffer a little and create a collection of parameters for each material manually. For example, find an image of asphalt. Trim it to a square and make it as BaseColor. Then, through special programs (for example, xNormal), create a normal map from this image. Through the normal map, adjust Metallic and Roughness (you can also use BaseColor). As a result, spend several hours creating the ideal asphalt material, checking the correct parameters for metal and roughness.
And you can make everything simpler.
As I said above, most of the materials have already been prepared for you for a long time. Your task is only to find ready-made solutions that meet your requirements, download and install them. If you use Substance Painter, then allegorithmic (now Adobe) has a specialized repository of finished materials that can be downloaded. Access to them is both paid and free.
If you use Quixel, then hundreds of different materials are already included in this program, and you just need to specify them and start working with masks. Which, incidentally, is very convenient for beginners, so if you just started to master texturing and are not yet ready to work with the generation of materials - I recommend starting with Quixel. The principle is the same, another wrapper. Tutors on the program are on the Internet.

Here ( Link ) you can download the texture for the materials that we will use in our practice.

Our goal now is not to create very high-quality textures, but to get acquainted with how to create something interesting using PBR parameters and masks. Therefore, at this stage, we will not use generators of masks or dirt, but we will do everything manually to understand the essence. When you understand the essence , the basis of all this, you can use the generators much more efficiently than just start twisting them in the hope of getting the perfect mask / material.

If you have already looked at the files, then you probably paid attention to the tire mask. It was prepared separately, because I can’t generate it on the go in Substance Painter, so I used the tire pattern found on the Internet and prepared it through Photoshop for working in Substance Painter:

image

Now we will create a new project and add all our files to it. To do this, we select the standard settings, but now we need to specify our texture maps when creating the project:

image

In the project, create 3 folders for each material and rename them so as not to be confused:

image

In our case, the hierarchy of folders is very important (and not only in ours, but always important). Hierarchy determines the level of material, in other words, what lies on what. Asphalt in our example is the bottom. Traces of tires remain on it. But dirt can be on the tracks of tires, and on the pavement. Therefore, the dirt will be above all.

Now, let's immediately hide everything that should be hidden, and leave only the asphalt. That is, we will create black masks on the Rubber and Dirt folders:

image

Now we will create the 1st layer in each folder. Or rather, create layers and distribute them in folders. Do not forget about naming, so as not to get confused later (despite the fact that it is not visually clear that the layers are in folders - believe me, they are in folders):

image

All new layers have basic average parameters. Therefore, Base Color is gray, normal does not display bulges, and Metallic and Roughness do not create the impression of any material.
And now we need to fix this by indicating in each parameter the corresponding texture (using asphalt as an example):

image

Your task now is to distribute all the textures of the materials into the desired layer parameters. After you do all this, assign a mask for the rubber and create the effect of traces. Since we already have a black mask in the folder, we just need to connect the file with the traces of the wheels to this mask. To do this, click RMB on the mask and select Add Fill:

image

And in the GrayScale parameters, specify the mask:

image

As a result, traces of rubber will appear on the asphalt, but it will be quite difficult to make out, since this is still PBR and cinematography (!!!). To see them, you need to turn Plane at a certain angle:

image

Now these two layers (asphalt and rubber) are on the same level. But we know that the rubber is on the asphalt, which means that the rubber layer should be physically higher. And now we will use the very Height parameter.

Find it in the Rubber layer options and unscrew it to the maximum to feel how it works. Twist the camera to see how the light began to process the pixels that you set yourself. Feel your power! =)

Well, now align the parameter to 0.1, so that it is not so explicit and more believable:

image

We could unscrew it at -0.1 so that we have pits, like after cars in the mud, but this is asphalt, and it does not fail so easily.

Now set up the dirt. Based on reality, it can be assumed that dirt should clog into asphalt cracks in the first place. But we do not have a mask so that we can show a layer of dirt in the cracks. However, there is a solution - we can take BaseColor asphalt and make a mask for dirt on its basis.

How it works? If you look at the BaseColor asphalt, you can notice that the darker the pixel, the more it looks like a crack. That is, in this image, everything dark is cracks, and everything light is the surface. And if we want to use the image as a mask, then it would be enough for us to invert the colors (dark to make light and vice versa) pixels, and we get a mask for dirt.

To do this, turn off the display of the asphalt layer (by clicking on the eye of the folder with asphalt) to make it easier to perceive what we are doing.

Next, we indicate that the file should be in the mud mask and attach the Asphalt_BaseColor file to it:

image

As I wrote above, the asphalt was light and the cracks dark. Accordingly, dirt began to appear on large surfaces, and the basic gray color (basic parameters / background) dominates in the cracks.

Now our task is to make this texture be perceived differently - invert colors and strengthen them so that the mask shows dirt in cracks. The easiest way to do this is with the additional “Levels” effect. Add an additional filter “Levels” to the mask in the same way as we added Fill (RMB - Add Levels). And we twist the parameters approximately, as in the picture below:

image

And click on the button “Invert” below to invert the channel intensity levels:

image

Now the dirt is located exactly where we need it - in asphalt cracks:

image

Turn on the asphalt and look at our work:

image

But it is too simple. Therefore, let's now add orange markings to our asphalt. To do this, we will need:

  • Create a new folder and name it Road_Line.
  • Add a black mask to the folder.
  • Add a new layer to the folder and name it Layer_RoadLine.
  • For the layer in the BaseColor parameters specify the orange color directly:

image

You can also adjust Metallic and Roughness to your taste to create realistic paint. I did not do this in order to reduce the time of the tutor.

Now, recalling the rules of the hierarchy of layers, we will arrange a folder with a road line between the asphalt and rubber:

image

It is time for manual drawing. Select the mask of the RoadLine folder and draw a marking strip on the plane. I got something like this:

image

Now it’s worth adding another mask to the paint layer itself to create a feeling of paint falling off. To do this, we will not create a folder, but create a mask directly on the layer and add any standard Substance Painter mask. To do this, add a mask, and then add a fill (RMB by mask and Add Fill). In the fill, specify the Dirt 4 Texture, which is under the Procedural tag:

image

And we look at the result:

image

Do not forget that the height of the paint layer must be specified. I propose to indicate 0.05 - the average between rubber and asphalt.

Be careful, because for this you need to select the layer, and not the mask. You can specify a value manually by clicking on the number to the right of the top of the slider.

Well, what is asphalt without water?

To do this, create a folder with the layer yourself. Do NOT add any masks yet .

Set the folder in the hierarchy to the very top. After all, water is from above, right? At the layer, unscrew to the maximum Metallic and to the minimum Roughness. Next, indicate a water height of 0.15.

And now turn off the Color channel by clicking on the button marked with a blue frame:

image

What happened All the lower layers were mixed according to the masks and the layer with water. But water now has no color channel, which means that it cannot paint the pixels it needs. For this, all other channels affect the pixels of the texture, and the asphalt became as wet and unpleasant as possible, as if it were not asphalt at all =)

image

Now homework: apply masks so that the asphalt is not completely wet, but with small puddles. Remember that puddles do not have roughnesses on the surface - think about how to mix the layers so that the puddles are smooth. And what else needs to be done for this? I’m sure you can do it =)

Summary

In this tutorial, we've covered how to create textures. In general, correctly applying the parameters, you can already begin to texture and even boldly call yourself a junior texture artist.

We learned how PBR works.

Parameters in PBR need not be unique. These are still normal parameters that we can specify through pixel channels.

We can use the same textures in different ways. This gives us an advantage - we do not need to load memory with unnecessary files with a large number of pixels, but just load one file and tell the program how to calculate it.

We got acquainted with the materials and how they are assembled. Now you know that it is not necessary to be a super-cool Photoshop master, but just find the ready-made parameters so that the program can present the material correctly from them.

In the following parts, we will cover topics such as sweep, texel density (and what texel is), and finally we will come to the most interesting part - creating your own shaders in UE4.

Quixel and Substance Painter Programs

I always recommend that beginners who are involved in creating textures from materials (not materials themselves) start working with Quixel. Since this program already has hundreds of ready-made presets, which are very easy to control and configure, and through masks you can achieve the same result as we have in practice through Substance Painter.

As for Substance Painter, its power begins to appear when the third Substance Designer program is included in the work. Designer allows you to create your own materials by generating the surfaces we need. The designer is cool in that you can create “smart materials” that will have settings for internal masks that will control the quantity and quality of internal materials. That is, “smart materials” in this case is a container that contains several materials and predefined masks, which are governed by formulas and algorithms that the artist prescribes in Designer.

Then this container is exported to Painter, where it is fine-tuned. For example, we created our wet asphalt in Painter. But we could collect in Designer and connect a bunch of additional settings that would allow us to change the result on the fly, in one place, and not switch among a bunch of masks, like in Painter.

About PBR and the translation of this abbreviation

Very often, PBRs are translated as a physically correct render. I believe that accurate translation is important here, because translations of the “Physically Correct” type are fundamentally incorrect, since the render in this case is based on physics, but does not have to be correct in relation to physics. You can make metal = 1, and a roughness equal to 1, and additionally include a bunch of other parameters, and this will not be material correct from the point of view of physics, but once based on it and converted by you into your own set of parameters. That is, when creating materials based on PBR, you can completely ignore the laws of physics and create material that will be unique in its own way.

For example, stones drawn in their style. How physically correct should we display fictional material that does not exist in nature?

Also popular now: