Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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):

alt text

Product Version: UE 4.10
more ▼

asked Jun 05 '16 at 12:02 PM in Using UE4

avatar image

37 7 9 11

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first


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.


more ▼

answered Jun 05 '16 at 12:42 PM

avatar image

345 24 22 202

avatar image Sheeplie Jun 05 '16 at 11:47 PM

Hi! Thanks for the well-detailed explanation. So I guess you would actually want to subtract some alpha from the rocks when you go to paint them if you want more snow, right?

That makes sense, but why is the lerp result multiplied by the vertex color as a whole?

avatar image PacoChan Jun 06 '16 at 07:41 AM

Exactly. In your case, the less alpha, the more snow. And the final multiplication is just to give an extra coloring to the mesh. The final texture blending will be multiplied by the RGB color in the vertices. You could add some extra difference to each instance of a mesh. Some darker areas or something like that.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question