Why this tutorial makes materials a certain way.
Hi there, I'm watching a tutorial on Digital Tutors (Pluralsight) about making blizzard environments.
What is vertex color? To make a blendable snow and concrete material in unreal engine 4, the artist lerps the two texture samples together using the vertex color's alpha channel as input for the lerp. He then multiplies this by all of the vertex color to get his "base color" input for the material.
He does this exact same thing for his normal and specular maps. This method of texture blending could be outdated, which may explain why I've never seen it done before- still I'm curious and interested about the math behind this.
Also, he stresses that the "main" texture, the one we want to be there before any painting is done, must be plugged in to the 'B' input of the lerp node. Why is this so important?
Here's what his setup looks like (I left out specular and diffuse):
asked Jun 05 '16 at 12:02 PM in Using UE4
It is common to use vertex colors to create a lot of effects. It's an efficient way to store some extra data for each of the vertices of the mesh. Then, in the shader, you can read those colors and use them for whatever you want. They don't need to be used as colors (they are just four numeric values from 0 to 1).
So, in your example, they are using those vertex colors to add some coloring to the mesh and specify how those two textures will blend. You can paint those vertex colors inside your 3d application (3DS Max, Maya, Blender, etc.) or you can paint them inside UE4 with the Paint tool. With this, you can, for example, add two instances of the same rock in your scene and assign them that material. With the paint tool, you can paint some values to the alpha channel of vertices of each instance of the rock. So that will allow you to add snow differently to each instance. So with only one material and one mesh, you can have a lot of different looking rocks. One instance of the rock could be under a bridge, so you could specify that instance to don't have snow.
And the tutorial is recommending to plug the main texture to the B input because by default, the vertex colors of a mesh are always white (RGBA 1,1,1,1), so by default, meshes with that material would show that main texture (A = 0, B = 1). If the textures where plugged in the other way, everything would be snowy and you would have to subtract the snow instead of adding it. It just depends of your needs.
I hope this information is useful to you and ask if you have any doubts.
answered Jun 05 '16 at 12:42 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here