在虚幻引擎 4 中制作山谷环境
地编场景制作3D场景引擎地编地图编辑 1698 1
实名

通过了实名认证的内容创造者

发布于 2021-12-29 13:48:41

您需要 登录 才可以下载或查看,没有账号?注册

x
本帖最后由 执此一念 于 2022-1-12 11:23 编辑

在虚幻引擎 4 中制作山谷环境

Abhishek Sharma 回来向我们介绍了自然之美项目,讨论了材质功能工作流程,并解释了他的自定义自动景观着色器的细微差别。

IntroductioM
介绍

Hi, my name is Abhishek Sharma. I’m currently working as a Lead Environment Artist at Ubisoft Mumbai. I did my game development course at Frameboxx Jaipur. I have 9 years of experience working in AAA game development and have contributed to projects like – Dark Souls2, Bloodborne, Hyper-scape, Kingdom Hearts III & 2.8, Tekken 7.

你好,我叫阿布舍克·夏尔马。我目前在 Ubisoft Mumbai 担任首席环境美工。我在 Frameboxx Jaipur 上过我的游戏开发课程。我在 AAA 游戏开发方面有 9 年的工作经验,并为诸如黑暗之魂 2、血源、Hyper-scape、Kingdom Hearts III & 2.8、铁拳 7 等项目做出了贡献。

This project started as an exercise for creating my own custom Auto Landscape Shader. I majorly focused on creating an automatic system that helps in creating rich lush natural open-world environments. So I started with creating the Procedural Landscape shader with an auto foliage system.

这个项目最初是作为创建我自己的自定义自动景观着色器的练习。我主要专注于创建一个自动系统,帮助创建丰富的、郁郁葱葱的自然开放世界环境。所以我开始使用自动植物系统创建程序景观着色器。

References
参考
Following are a few references that helped me understand the size and composition of the scene. As per references, my rough plan is to create a village/town near the lake and an iconic mountain in the background. For color and feel mostly, I have collected images from Switzerland.

以下是一些帮助我了解场景大小和构成的参考资料。根据参考资料,我的粗略计划是在湖边创建一个村庄/城镇,并在背景中创建一座标志性的山脉。主要是为了颜色和感觉,我从瑞士收集了图像。

widen_920x0.jpg


Workflow
工作流程

Then I started creating terrain in World Machine Software. The terrain is 8*8 Kms in size.

然后我开始在 World Machine Software 中创建地形。地形大小为8*8公里。

widen_920x0.jpg


I got the basic shape of terrain with the Basic Noise node and divided it with radial so I could make some space for the lake area. Then with the use of Perlin, I have added huge mountains into my scene. Then added some erosion feel to give more details in terrain.

我使用 Basic Noise 节点获得了地形的基本形状,并用径向划分了它,这样我就可以为湖区腾出一些空间。然后使用 Perlin,我在场景中添加了巨大的山脉。然后添加了一些侵蚀感觉以提供更多地形细节。



Then I exported a Height Map and imported it into UE4. I used a Landscape tool with that Height Map to create this terrain and did some basic light setup to get the golden light feel.

然后我导出了一个高度图并将其导入到 UE4 中。我使用带有高度图的地形工具来创建这个地形,并进行了一些基本的灯光设置以获得金色光感。



Landscape properties and basic light setup:

景观属性和基本灯光设置:





The Unreal Water system helped me in creating this lake.

在虚幻水系统帮我在创造这个湖。
Then I used the WaterBody Lake tool to create the lake.

然后我使用 WaterBody Lake 工具创建了湖。
This is how it looks like after adding a lake into the scene.

这是在场景中添加湖泊后的样子。

After that, I adjusted its material as per requirement. I also added some VFX fog particles for far water areas.

之后,我根据要求调整了它的材料。我还为远水区域添加了一些 VFX 雾粒子。



Auto Landscape Shader
自动景观着色器

For this lush green landscape, I used 6 material layers:
对于这个郁郁葱葱的绿色景观,我使用了 6 个材质层:

  • Cliff – For the mountain.
  • 悬崖——为山。

  • Grass – For plains.
  • 草——用于平原。

  • Dry Grass – For blending between the mountain and plains.
  • 干草 – 用于山地和平原之间的混合。

  • Snow – For mountain peaks
  • 雪 – 适用于山峰

  • Stones Ground – For pathways
  • Stones Ground – 用于路径

  • Water Puddle – To add water effect on the ground.
  • 水坑 - 在地面上添加水效果。

Initially, I created a few Materials Function that helped in adjusting texture within UE4.
最初,我创建了一些有助于在 UE4 中调整纹理的材质函数。

Diffuse MF – This function gives control to edit diffuse tint, contrast, brightness, saturation.
漫反射 MF - 此功能可控制编辑漫反射色调、对比度、亮度、饱和度。

RAM MF – This material function gives basic control to adjust Roughness, AO, and Metallic.
RAM MF - 此材质功能提供基本控制来调整粗糙度、AO 和金属。

Normal MF – This material function helps in adjusting Normal Map strength.

法线 MF - 此材质功能有助于调整法线贴图强度。

Displacement MF.
位移MF。

The biggest issue I face when it comes to landscapes is obvious – texture tiling. Landscape textures often look good up-close near the player but at further distances, the tiling becomes very noticeable. So, to solve these issues I created a new material function that helps in adjusting tilling for near and far texture separately.

我在风景方面面临的最大问题很明显——纹理平铺。风景纹理在玩家附近通常看起来不错,但在更远的距离,平铺变得非常明显。所以,为了解决这些问题,我创建了一个新的材质函数,帮助分别调整近和远纹理的耕作。

MF Distance Blend
MF距离混合

Through this MF I have got two tilling control to adjust the texture for near and far distances. I have used Absolute World Position and Camera Position to create that mask and with it, I can adjust the distance in its material instance.

通过这个MF,我有两个耕作控制来调整近远距离的纹理。我使用了绝对世界位置和相机位置来创建该蒙版,并使用它来调整其材质实例中的距离。



With and without Distance Blend:
有和没有距离混合:


This helps in fixing distance texture visibility issues. Now, I need to fix the tilling issues. To do so, I created another Material Function which helped in de-tilling the texture.

这有助于修复距离纹理可见性问题。现在,我需要解决耕作问题。为此, 我创建了另一个材质函数来帮助去除纹理。

To explain it better, I have applied a gradient texture in this material.
为了更好地解释它,我在这种材质中应用了渐变纹理。

With and without MF Cell Tiling:
有和没有 MF 单元格平铺:


This material function takes random patches of texture and rotates them and projects them on each other to remove tilling repetition. This technic only works with organic textures and is a bit expensive as well.
此材质函数采用随机纹理块并旋转它们并将它们相互投影以消除重复耕作。这种技术只适用于有机纹理,而且有点贵。

Then, I added the same Distance node again to fix distance texture visibility.
然后,我再次添加了相同的距离节点来修复距离纹理可见性。

Adding some macro variation on the terrain texture gives the feel of realism.
在地形纹理上添加一些宏观变化给人以真实感。

Then multiply it with the final Diffuse Map.
然后将其与最终的漫反射贴图相乘。



To improve the performance of the shader I used both the Tilling method and put a Switch node to turn on/off de-tilling MF.
为了提高着色器的性能,我同时使用了 Tilling 方法并放置了一个 Switch 节点来打开/关闭 de-tilling MF。

Using the same procedure, I have created all the other material layers except for the cliff.
使用相同的程序,我创建了除悬崖之外的所有其他材质层。

MF Tri-Planar
MF 三平面

Tri-Planar for Diffuse/RAM, for cliff material I have used the tri-planar technic to get texture projection from all the axis.
Tri-Planar for Diffuse/RAM,对于悬崖材质,我使用了三平面技术从所有轴获得纹理投影。

MF Tri-Planar Normal
MF 三平面法线



This tutorial helped me to understand how tri-planar works.
本教程帮助我了解了三平面的工作原理。

Then, I added some Distance Tilling nodes to fix the far texture visibility issues.
然后,我添加了一些距离耕作节点来解决远纹理可见性问题。

MF Tri-Planar Distance
MF 三平面距离



MF Tri-Planar Distance Normal
MF 三平面距离法线



Now I need to compile all material layers in the final shader. Out of the 6-material layer, I have chosen three of them for the auto material paint feature as per height – Cliff (MF Cliff), Dry Grass (MF Material 01), and Grass (MF Material 02).
现在我需要在最终着色器中编译所有材质层。在 6 个材质层中,我根据高度选择了其中三个用于汽车材质油漆功能 - Cliff (MF Cliff)、Dry Grass (MF Material 01) 和 Grass (MF Material 02)。

Then I used the World Aligned Blend node to create the alpha and then the MatLayerBlend node to blend Material Layers. Initially, I started with blending Cliff and Dry Grass. Blend Sharpness and Blend Bias help in controlling the blend intensity and area.
然后我使用 World Aligned Blend 节点来创建 alpha,然后使用 MatLayerBlend 节点来混合材质层。最初,我开始混合 Cliff 和 Dry Grass。混合锐度和混合偏差有助于控制混合强度和区域。



Just for testing, I put Red Color for Cliff, Green Color for Dry Grass, and Blue for Grass. Then, in the same way, I added a Blue material layer and blended it with Red and Green.
只是为了测试,我把红色代表悬崖,绿色代表干草,蓝色代表草。然后,以同样的方式,我添加了一个蓝色材质层并将其与红色和绿色混合。





Then I created another blend graph which helped in blending dry grass with green grass with the help of noise texture.
然后我创建了另一个混合图,它有助于在噪波纹理的帮助下将干草与绿草混合。





Then I added snow on the top of the mountain, for that, I created a mask using my terrain Height Map.
然后我在山顶上添加了雪,为此,我使用我的地形高度图创建了一个蒙版。





And then I put tilling of 0.0248 on this snow mask, so it would align properly with the mesh.
然后我在这个雪面具上放了 0.0248 的耕作,所以它会与网格正确对齐。



After blending everything together, the result looks like this:
将所有内容混合在一起后,结果如下所示:



MF Tessellation
MF镶嵌

I have created one more material function for tessellation and given a few controls to set is distance and amount of tessellation.
我为曲面细分创建了另一个材质函数,并提供了一些控件来设置曲面细分的距离和数量。





Now, when the Auto-Blend Layer is ready, I add the feature of manual material painting as well. For that, I merged the Auto-Material Blend with the other 6 materials.
现在,当自动混合图层准备好时,我也添加了手动材质绘制的功能。为此,我将 Auto-Material Blend 与其他 6 种材料合并。





Then according to the material, I created a Landscape grass type which helped in generating foliage automatically as per the texture assigned.
然后根据材质,我创建了一个景观草类型,它有助于根据指定的纹理自动生成树叶。



For this project, I used 4 of them.
对于这个项目,我使用了其中的 4 个。

  • Landscape Bush – Generate bush where noise mask is coming.
  • 景观灌木 - 在噪声掩码到来的地方生成灌木。

  • Landscape Grass – Generate grass as per blue color mask.
  • Landscape Grass – 根据蓝色遮罩生成草。

  • Landscape Tree – Generate trees as per green color mask.
  • 景观树 - 根据绿色遮罩生成树木。

  • Landscape Stone – Generate stone where I paint my stone material.
  • 景观石 - 在我绘制石材的地方生成石头。



And finally, this is the final graph for Auto Landscape Shader:
最后,这是 Auto Landscape Shader 的最终图表:



Lighting灯光
I tried to set a pleasant lighting mood. So, I chose golden hour time which also helps in getting golden reflection on the water. In Directional Light, I adjusted the color and intensity (3 lux) and then added some light shafts and bloom. To get the good shadow on the background forest I have increased the Dynamic Shadow Distance of movable light, I found this option in Cascaded Shadow Map in Directional Light.
我试图设置一个愉快的照明气氛。所以,我选择了黄金时段,这也有助于在水面上获得金色的倒影。在定向光中,我调整了颜色和强度(3 勒克斯),然后添加了一些光轴和光晕。为了在背景森林上获得良好的阴影,我增加了可移动光的动态阴影距离,我在定向光的级联阴影贴图中找到了这个选项。



Sky Light and Exponential Height Fog:
天光和指数高度雾:





Clouds and Sky
云和天空

For the sky, I used HDRI which helped me in getting realistic background clouds. The clouds that are moving over the mountains are volumetric.
对于天空,我使用了 HDRI,它帮助我获得了逼真的背景云。在山上移动的云是体积的。

Post-Production
后期制作

In post-production, I tweaked a few parameters like white balance, shadows, and tones to make the scene more saturated and lusher.
在后期制作中,我调整了一些参数,如白平衡、阴影和色调,使场景更加饱和和更丰富。

















Conclusion结论
I have spent around 3 months on this project. My major focus was to create an automatic system that helps in creating rich lush natural open-world environments and try new tools of UE 4.26. I really enjoyed the journey and faced a lot of challenges in understanding volumetric clouds and water.
我在这个项目上花了大约 3 个月的时间。我的主要重点是创建一个自动系统,帮助创建丰富的自然开放世界环境并尝试 UE 4.26 的新工具。我真的很喜欢这次旅行,并且在理解体积云和水方面遇到了很多挑战。

Feedback is very important to improve overall quality, your mind works best for you, but if you want to show your work to the world, you must apply different points of view and learn from it. Special thanks to my friends for their continuous input for improving overall composition.
反馈对于提高整体质量非常重要,你的大脑最适合你,但如果你想向世界展示你的作品,你必须应用不同的观点并从中学习。特别感谢我的朋友们为改进整体构图而不断投入。



Abhishek Sharma, 3D Environment Artist

END


评分

参与人数 2元素币 +30 活跃度 +42 贡献值 +1 展开 理由
微凉. + 20 【点赞】这很有大网气质!
元素界王神... + 30 + 22 + 1 【点赞】这很有大网气质!

查看全部评分

本帖被以下画板推荐:

来了老弟~
使用道具 <
逝去的不再来  发表于 2022-1-1 14:00:43  
2#
很棒的内容
回复 收起回复
使用道具
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表