Vertex Animation示例
This material graph sample demonstrates how to use a vertex animation texture in UNIGINE.这个材质图示例演示了如何在UNIGINE中使用顶点动画纹理。
Vertex animation can be baked into a texture via one of the modern DCC tools (the example contains textures baked in Blender) and then exported as a set of several files: a geometry file (.fbx) and texture files: textures for the model and textures storing animation (an .exr texture with position offsets and a .tga texture with normals). Then these files are imported into UNIGINE to create the material graph.顶点动画可以通过现代DCC工具之一烘焙到纹理中(示例包含在Blender中烘焙的纹理),然后导出为一组文件:一个几何文件(.fbx)和纹理文件:用于模型的纹理和存储动画的纹理(一个.exr纹理与位置偏移和.tga纹理与法线)。然后将这些文件导入UNIGINE以创建材质图。
The textures with animation are imported with the following settings:使用以下设置导入带有动画的纹理:
位置偏移纹理 | 法线纹理 |
---|---|
|
|
Albedo and Roughness data for the Vertex Animation material are sampled via the Sample Texture node from the provided albedo and shading textures with accordance to the specified UVs (the Vertex UV 0 node). The Roughness data is also multiplied by a roughness coefficient after sampling. Vertex Animation材质的Albedo和Roughness数据通过Sample Texture节点从提供的albedo和shading纹理中根据指定的uv (Vertex UV 0节点)进行采样。Roughness数据在采样后还要乘以粗糙度系数。
Object-space Normal data for the material is obtained by blending of tangent-space normals sampled via the Sample Texture node from the provided normal and animation normal textures and subsequent transforming the output tangent-space normals to the object-space ones (the Rotate Space node). 对象空间Normal数据是通过混合从提供的normal和animation normal纹理中通过Sample Texture节点采样的切线空间法线来获得的,随后将输出的切线空间法线转换为对象空间法线(Rotate Space节点)。
At that, when sampling of the animation normal texture is performed, the original UV is modified as follows: the U coordinate is provided by the Vertex UV 1 node, the V coordinate is the time multiplied by the animation speed. After sampling, vertex interpolation is performed (the Vertex Interpolation node). 在那里,当对动画正常纹理进行采样时,原始UV被修改如下:U坐标由Vertex UV 1节点提供,V坐标是时间乘以动画速度。采样后,进行顶点插值(Vertex Interpolation节点)。
Vertex Position data for the material is sampled via the Sample Texture node from the provided position offsets texture according to the UV that is modified as follows: the U coordinate is provided by the Vertex UV 1 node, the V coordinate is the time multiplied by the animation speed. After sampling, the data is multiplied by the vertex offset intensity and then added to the Vertex Position. Vertex Position材质的数据通过Sample Texture节点从提供的position offsets纹理中采样,根据UV进行如下修改:U坐标由Vertex UV 1节点提供,V坐标是时间乘以动画速度。采样后,数据乘以vertex offset intensity,然后添加到Vertex Position。