Chinese technology live the second phase, the material vector editing application (summary)

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/zhangxiaofan666/article/details/99677548

1 Object Postion use

If the stage onto the base color

Then moving objects found in the object color will change according to its position

To use the node SpeedTreeColorVariation

The value of the adjustment variable color found in the leaves of different locations are not the same

To study the material under SpeedTreeColorVariation function

It is out of the position of the object multiplied by a value, here PerInstanceRandom each Instance will give a random value

Two VertexNormalWS node

Information vertex normals, if the mask information obtained rgb values ​​of xyz three vertex normals, respectively

If this logic will now basecolor as you can see, mask the vertex normals z value, minus a parameter, multiplied by a parameter, it is the same as the Alpha Lerp color from white to straw, if the vertex normals upwardly, the Alpha larger, the closer the value of B, i.e. white, and vice versa, grass

Effect: snow grass

Vertex normals facing is white or the color of grass is

Similarly there is a PixelNormalWS, this is a pixel vertex, this should be more of it fine

Three Dot node

If the camera vector and the normal pixel dot product, the outer dot product is 0, because the vertical, black, the center point of a product, white, black outside and white inside

Black negated after the white outer

In this logic, obviously we have a more abundant changes

In the original node into a Fresnel pure white, as Alpha, Lerp from blue to white, rich details

Four how to mix the three colors with Lerp

Mixing the two colors is easier to do with a noise alpha

this way:

Lerp first mixed red and green, so that a value of the R channel TexCoord 0 to 0.5 for mixing red and green, and blue mixing 0.5 to 1

如果把纹理的R通道改成一张噪声纹理,效果就变了

五 做出叶子的流动自发光

先将这段逻辑放到EmissiveColor上,由于地板是个2040*2040大小的,使用了绝对世界位置

效果如下

再将Panner加进来,就出现了流动效果

效果

六 Distance

使用Distance用来取得两个坐标的距离

在视频中

七 制作战争迷雾效果

可以在蓝图中给材质设置参数,每一帧去更新参数(主角位置等等)

只不过设置参数完后,将材质给到渲染目标中

将这个材质放到地板上这个TextureSample是上面那个RT渲染目标

效果如下:

八 将该效果应用到树叶中

我们把上面流动叶子材质的这个TextureSample改成这个渲染目标

效果

将去反的节点断掉

效果

九 将燃烧后的叶子掉落下来

做下叶子的offset

原理:用一个噪声混合两个z方向为负的4维向量,减absuloteWorldPosition乘以(0,0,-1),再用连到Lerp的B节点,A节点是0,Alpha是AbsoluteWorldPosition位置除以地板宽度,Saturate,也即在人物附近的叶子,就会掉的多,否则掉的少

选择Subsurface次表明,模拟雪地透光效果

将这段逻辑连接到SubSurfaceColor上

最终效果:

Guess you like

Origin blog.csdn.net/zhangxiaofan666/article/details/99677548